diff --git a/.gitignore b/.gitignore index bdc3535..63008e5 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,7 @@ Generated_Code #added for RIA/Silverlight projects _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML + +# Temp Data +*.orig +*temp.cs diff --git a/LICENSE b/LICENSE index e69de29..0f1472a 100644 --- a/LICENSE +++ b/LICENSE @@ -0,0 +1 @@ +Only for educational use. \ No newline at end of file diff --git a/Microsoft.Xna.Framework.RuntimeProfile b/Microsoft.Xna.Framework.RuntimeProfile new file mode 100644 index 0000000..adf8302 --- /dev/null +++ b/Microsoft.Xna.Framework.RuntimeProfile @@ -0,0 +1 @@ +Windows.v4.0.Reach diff --git a/README.md b/README.md index 4f59d38..57170c8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ Terraria-Source-Code ==================== +Terraria Source Code 1.2.0.3.1 + +Only for educational use. \ No newline at end of file diff --git a/Terraria.csproj b/Terraria.csproj new file mode 100644 index 0000000..ae8bd36 --- /dev/null +++ b/Terraria.csproj @@ -0,0 +1,73 @@ + + + + 916B1896-36A0-41DC-9D70-87D6E8DD2179 + Debug + x86 + WinExe + Terraria + v4.0 + 4 + + + x86 + + + bin\Debug\ + true + full + false + + + bin\Release\ + true + pdbonly + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Terraria.sln b/Terraria.sln new file mode 100644 index 0000000..cd65888 --- /dev/null +++ b/Terraria.sln @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +# SharpDevelop 4.3 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Terraria", "Terraria.csproj", "916B1896-36A0-41DC-9D70-87D6E8DD2179" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + 916B1896-36A0-41DC-9D70-87D6E8DD2179.Debug|x86.Build.0 = Debug|x86 + 916B1896-36A0-41DC-9D70-87D6E8DD2179.Debug|x86.ActiveCfg = Debug|x86 + 916B1896-36A0-41DC-9D70-87D6E8DD2179.Release|x86.Build.0 = Release|x86 + 916B1896-36A0-41DC-9D70-87D6E8DD2179.Release|x86.ActiveCfg = Release|x86 + EndGlobalSection +EndGlobal diff --git a/Terraria/ChatLine.cs b/Terraria/ChatLine.cs new file mode 100644 index 0000000..d81c328 --- /dev/null +++ b/Terraria/ChatLine.cs @@ -0,0 +1,11 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class ChatLine + { + public Color color = Color.White; + public int showTime; + public string text = ""; + } +} diff --git a/Terraria/Chest.cs b/Terraria/Chest.cs new file mode 100644 index 0000000..a590299 --- /dev/null +++ b/Terraria/Chest.cs @@ -0,0 +1,869 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Chest + { + public static int maxItems = 40; + public Item[] item = new Item[Chest.maxItems]; + public int x; + public int y; + public object Clone() + { + return base.MemberwiseClone(); + } + public static void Unlock(int X, int Y) + { + Main.PlaySound(22, X * 16, Y * 16, 1); + for (int i = X; i <= X + 1; i++) + { + for (int j = Y; j <= Y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if ((Main.tile[i, j].frameX >= 72 && Main.tile[i, j].frameX <= 106) || (Main.tile[i, j].frameX >= 144 && Main.tile[i, j].frameX <= 178)) + { + Tile expr_A3 = Main.tile[i, j]; + expr_A3.frameX -= 36; + for (int k = 0; k < 4; k++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 11, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (Main.tile[i, j].frameX >= 828 && Main.tile[i, j].frameX <= 990) + { + Tile expr_134 = Main.tile[i, j]; + expr_134.frameX -= 180; + for (int l = 0; l < 4; l++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 11, 0f, 0f, 0, default(Color), 1f); + } + } + } + } + } + } + public static int UsingChest(int i) + { + if (Main.chest[i] != null) + { + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && Main.player[j].chest == i) + { + return j; + } + } + } + return -1; + } + public static int FindChest(int X, int Y) + { + for (int i = 0; i < 1000; i++) + { + if (Main.chest[i] != null && Main.chest[i].x == X && Main.chest[i].y == Y) + { + return i; + } + } + return -1; + } + public static int CreateChest(int X, int Y) + { + for (int i = 0; i < 1000; i++) + { + if (Main.chest[i] != null && Main.chest[i].x == X && Main.chest[i].y == Y) + { + return -1; + } + } + for (int j = 0; j < 1000; j++) + { + if (Main.chest[j] == null) + { + Main.chest[j] = new Chest(); + Main.chest[j].x = X; + Main.chest[j].y = Y; + for (int k = 0; k < Chest.maxItems; k++) + { + Main.chest[j].item[k] = new Item(); + } + return j; + } + } + return -1; + } + public static bool DestroyChest(int X, int Y) + { + for (int i = 0; i < 1000; i++) + { + if (Main.chest[i] != null && Main.chest[i].x == X && Main.chest[i].y == Y) + { + for (int j = 0; j < Chest.maxItems; j++) + { + if (Main.chest[i].item[j].type > 0 && Main.chest[i].item[j].stack > 0) + { + return false; + } + } + Main.chest[i] = null; + return true; + } + } + return true; + } + public void AddShop(Item newItem) + { + int i = 0; + while (i < 39) + { + if (this.item[i] == null || this.item[i].type == 0) + { + this.item[i] = (Item)newItem.Clone(); + this.item[i].buyOnce = true; + if (this.item[i].value <= 0) + { + break; + } + this.item[i].value = this.item[i].value / 5; + if (this.item[i].value < 1) + { + this.item[i].value = 1; + return; + } + break; + } + else + { + i++; + } + } + } + public void SetupShop(int type) + { + for (int i = 0; i < Chest.maxItems; i++) + { + this.item[i] = new Item(); + } + int num = 0; + if (type == 1) + { + this.item[num].SetDefaults("Mining Helmet"); + num++; + this.item[num].SetDefaults("Piggy Bank"); + num++; + this.item[num].SetDefaults("Iron Anvil"); + num++; + this.item[num].SetDefaults("Copper Pickaxe"); + num++; + this.item[num].SetDefaults("Copper Axe"); + num++; + this.item[num].SetDefaults("Torch"); + num++; + this.item[num].SetDefaults("Lesser Healing Potion"); + num++; + if (Main.player[Main.myPlayer].statManaMax == 200) + { + this.item[num].SetDefaults("Lesser Mana Potion"); + num++; + } + this.item[num].SetDefaults("Wooden Arrow"); + num++; + this.item[num].SetDefaults("Shuriken"); + num++; + this.item[num].SetDefaults("Rope"); + num++; + if (Main.player[Main.myPlayer].zoneSnow) + { + this.item[num].SetDefaults(967, false); + num++; + } + if (Main.bloodMoon) + { + this.item[num].SetDefaults("Throwing Knife"); + num++; + } + if (!Main.dayTime) + { + this.item[num].SetDefaults("Glowstick"); + num++; + } + if (NPC.downedBoss3) + { + this.item[num].SetDefaults("Safe"); + num++; + } + if (Main.hardMode) + { + this.item[num].SetDefaults(488, false); + num++; + } + for (int j = 0; j < 58; j++) + { + if (Main.player[Main.myPlayer].inventory[j].type == 930) + { + this.item[num].SetDefaults(931, false); + num++; + this.item[num].SetDefaults(1614, false); + num++; + break; + } + } + if (Main.hardMode) + { + this.item[num].SetDefaults(1348, false); + } + num++; + } + else + { + if (type == 2) + { + this.item[num].SetDefaults("Musket Ball"); + num++; + if (Main.bloodMoon || Main.hardMode) + { + this.item[num].SetDefaults("Silver Bullet"); + num++; + } + if ((NPC.downedBoss2 && !Main.dayTime) || Main.hardMode) + { + this.item[num].SetDefaults(47, false); + num++; + } + this.item[num].SetDefaults("Flintlock Pistol"); + num++; + this.item[num].SetDefaults("Minishark"); + num++; + if (!Main.dayTime) + { + this.item[num].SetDefaults(324, false); + num++; + } + if (Main.hardMode) + { + this.item[num].SetDefaults(534, false); + num++; + } + if (Main.hardMode) + { + this.item[num].SetDefaults(1432, false); + num++; + } + if (Main.player[Main.myPlayer].HasItem(1258)) + { + this.item[num].SetDefaults(1261, false); + num++; + } + } + else + { + if (type == 3) + { + if (Main.bloodMoon) + { + this.item[num].SetDefaults(67, false); + num++; + this.item[num].SetDefaults(59, false); + num++; + } + else + { + this.item[num].SetDefaults("Purification Powder"); + num++; + this.item[num].SetDefaults("Grass Seeds"); + num++; + this.item[num].SetDefaults("Sunflower"); + num++; + } + this.item[num].SetDefaults("Acorn"); + num++; + this.item[num].SetDefaults(114, false); + num++; + this.item[num].SetDefaults(745, false); + num++; + this.item[num].SetDefaults(747, false); + num++; + if (Main.hardMode) + { + this.item[num].SetDefaults(746, false); + } + num++; + if (Main.hardMode) + { + this.item[num].SetDefaults(369, false); + } + num++; + if (Main.shroomTiles > 50) + { + this.item[num].SetDefaults(194, false); + } + num++; + } + else + { + if (type == 4) + { + this.item[num].SetDefaults("Grenade"); + num++; + this.item[num].SetDefaults("Bomb"); + num++; + this.item[num].SetDefaults("Dynamite"); + num++; + if (Main.hardMode) + { + this.item[num].SetDefaults("Hellfire Arrow"); + num++; + } + if (Main.hardMode && NPC.downedGolemBoss && NPC.downedPirates) + { + this.item[num].SetDefaults(937, false); + num++; + } + if (Main.hardMode) + { + this.item[num].SetDefaults(1347, false); + num++; + } + } + else + { + if (type == 5) + { + this.item[num].SetDefaults(254, false); + num++; + this.item[num].SetDefaults(981, false); + num++; + if (Main.dayTime) + { + this.item[num].SetDefaults(242, false); + num++; + } + if (Main.moonPhase == 0) + { + this.item[num].SetDefaults(245, false); + num++; + this.item[num].SetDefaults(246, false); + num++; + } + else + { + if (Main.moonPhase == 1) + { + this.item[num].SetDefaults(325, false); + num++; + this.item[num].SetDefaults(326, false); + num++; + } + } + this.item[num].SetDefaults(269, false); + num++; + this.item[num].SetDefaults(270, false); + num++; + this.item[num].SetDefaults(271, false); + num++; + if (NPC.downedClown) + { + this.item[num].SetDefaults(503, false); + num++; + this.item[num].SetDefaults(504, false); + num++; + this.item[num].SetDefaults(505, false); + num++; + } + if (Main.bloodMoon) + { + this.item[num].SetDefaults(322, false); + num++; + } + if (Main.player[Main.myPlayer].zoneSnow) + { + this.item[num].SetDefaults(1429, false); + } + num++; + if (Main.hardMode) + { + if (Main.moonPhase == 2) + { + this.item[num].SetDefaults(869, false); + num++; + } + if (Main.moonPhase == 4) + { + this.item[num].SetDefaults(864, false); + num++; + this.item[num].SetDefaults(865, false); + num++; + } + if (Main.moonPhase == 6) + { + this.item[num].SetDefaults(873, false); + num++; + this.item[num].SetDefaults(874, false); + num++; + this.item[num].SetDefaults(875, false); + num++; + } + } + if (NPC.downedFrost) + { + this.item[num].SetDefaults(1275, false); + num++; + this.item[num].SetDefaults(1276, false); + num++; + } + } + else + { + if (type == 6) + { + this.item[num].SetDefaults(128, false); + num++; + this.item[num].SetDefaults(486, false); + num++; + this.item[num].SetDefaults(398, false); + num++; + this.item[num].SetDefaults(84, false); + num++; + this.item[num].SetDefaults(407, false); + num++; + this.item[num].SetDefaults(161, false); + num++; + } + else + { + if (type == 7) + { + this.item[num].SetDefaults(487, false); + num++; + this.item[num].SetDefaults(496, false); + num++; + this.item[num].SetDefaults(500, false); + num++; + this.item[num].SetDefaults(507, false); + num++; + this.item[num].SetDefaults(508, false); + num++; + this.item[num].SetDefaults(531, false); + num++; + this.item[num].SetDefaults(576, false); + num++; + } + else + { + if (type == 8) + { + this.item[num].SetDefaults(509, false); + num++; + this.item[num].SetDefaults(850, false); + num++; + this.item[num].SetDefaults(851, false); + num++; + this.item[num].SetDefaults(510, false); + num++; + this.item[num].SetDefaults(530, false); + num++; + this.item[num].SetDefaults(513, false); + num++; + this.item[num].SetDefaults(538, false); + num++; + this.item[num].SetDefaults(529, false); + num++; + this.item[num].SetDefaults(541, false); + num++; + this.item[num].SetDefaults(542, false); + num++; + this.item[num].SetDefaults(543, false); + num++; + this.item[num].SetDefaults(852, false); + num++; + this.item[num].SetDefaults(853, false); + num++; + this.item[num].SetDefaults(849, false); + num++; + } + else + { + if (type == 9) + { + this.item[num].SetDefaults(588, false); + num++; + this.item[num].SetDefaults(589, false); + num++; + this.item[num].SetDefaults(590, false); + num++; + this.item[num].SetDefaults(597, false); + num++; + this.item[num].SetDefaults(598, false); + num++; + this.item[num].SetDefaults(596, false); + num++; + } + else + { + if (type == 10) + { + this.item[num].SetDefaults(756, false); + num++; + this.item[num].SetDefaults(787, false); + num++; + this.item[num].SetDefaults(868, false); + num++; + this.item[num].SetDefaults(1551, false); + num++; + this.item[num].SetDefaults(1181, false); + num++; + this.item[num].SetDefaults(783, false); + num++; + } + else + { + if (type == 11) + { + this.item[num].SetDefaults(779, false); + num++; + if (Main.moonPhase >= 4) + { + this.item[num].SetDefaults(748, false); + num++; + } + else + { + this.item[num].SetDefaults(839, false); + num++; + this.item[num].SetDefaults(840, false); + num++; + this.item[num].SetDefaults(841, false); + num++; + } + if (Main.dayTime) + { + this.item[num].SetDefaults(998, false); + num++; + } + else + { + this.item[num].SetDefaults(995, false); + num++; + } + this.item[num].SetDefaults(1263, false); + num++; + if (Main.eclipse || Main.bloodMoon) + { + if (WorldGen.crimson) + { + this.item[num].SetDefaults(784, false); + num++; + } + else + { + this.item[num].SetDefaults(782, false); + num++; + } + } + else + { + if (Main.player[Main.myPlayer].zoneHoly) + { + this.item[num].SetDefaults(781, false); + num++; + } + else + { + this.item[num].SetDefaults(780, false); + num++; + } + } + if (Main.hardMode) + { + this.item[num].SetDefaults(1344, false); + } + num++; + } + else + { + if (type == 12) + { + this.item[num].SetDefaults(1037, false); + num++; + this.item[num].SetDefaults(1120, false); + num++; + } + else + { + if (type == 13) + { + this.item[num].SetDefaults(1000, false); + num++; + this.item[num].SetDefaults(1168, false); + num++; + this.item[num].SetDefaults(1449, false); + num++; + this.item[num].SetDefaults(1345, false); + num++; + this.item[num].SetDefaults(1450, false); + num++; + if (Main.hardMode) + { + this.item[num].SetDefaults(970, false); + num++; + this.item[num].SetDefaults(971, false); + num++; + this.item[num].SetDefaults(972, false); + num++; + this.item[num].SetDefaults(973, false); + num++; + } + } + else + { + if (type == 14) + { + this.item[num].SetDefaults(771, false); + num++; + if (Main.bloodMoon) + { + this.item[num].SetDefaults(772, false); + num++; + } + if (!Main.dayTime || Main.eclipse) + { + this.item[num].SetDefaults(773, false); + num++; + } + if (Main.eclipse) + { + this.item[num].SetDefaults(774, false); + num++; + } + if (Main.hardMode) + { + this.item[num].SetDefaults(760, false); + num++; + } + if (Main.hardMode) + { + this.item[num].SetDefaults(1346, false); + num++; + } + } + else + { + if (type == 15) + { + this.item[num].SetDefaults(1071, false); + num++; + this.item[num].SetDefaults(1072, false); + num++; + this.item[num].SetDefaults(1100, false); + num++; + for (int k = 1073; k <= 1084; k++) + { + this.item[num].SetDefaults(k, false); + num++; + } + this.item[num].SetDefaults(1097, false); + num++; + this.item[num].SetDefaults(1099, false); + num++; + this.item[num].SetDefaults(1098, false); + num++; + this.item[num].SetDefaults(1490, false); + num++; + if (Main.moonPhase <= 1) + { + this.item[num].SetDefaults(1481, false); + num++; + } + else + { + if (Main.moonPhase <= 3) + { + this.item[num].SetDefaults(1482, false); + num++; + } + else + { + if (Main.moonPhase <= 5) + { + this.item[num].SetDefaults(1483, false); + num++; + } + else + { + this.item[num].SetDefaults(1484, false); + num++; + } + } + } + if (Main.player[Main.myPlayer].zoneBlood) + { + this.item[num].SetDefaults(1492, false); + num++; + } + if (Main.player[Main.myPlayer].zoneEvil) + { + this.item[num].SetDefaults(1488, false); + num++; + } + if (Main.player[Main.myPlayer].zoneHoly) + { + this.item[num].SetDefaults(1489, false); + num++; + } + if (Main.player[Main.myPlayer].zoneJungle) + { + this.item[num].SetDefaults(1486, false); + num++; + } + if (Main.player[Main.myPlayer].zoneSnow) + { + this.item[num].SetDefaults(1487, false); + num++; + } + if (Main.sandTiles > 1000) + { + this.item[num].SetDefaults(1491, false); + num++; + } + if (Main.bloodMoon) + { + this.item[num].SetDefaults(1493, false); + num++; + } + if ((double)(Main.player[Main.myPlayer].position.Y / 16f) < Main.worldSurface * 0.34999999403953552) + { + this.item[num].SetDefaults(1485, false); + num++; + } + if ((double)(Main.player[Main.myPlayer].position.Y / 16f) < Main.worldSurface * 0.34999999403953552 && Main.hardMode) + { + this.item[num].SetDefaults(1494, false); + num++; + } + } + else + { + if (type == 16) + { + this.item[num].SetDefaults(1430, false); + num++; + this.item[num].SetDefaults(986, false); + num++; + if (Main.hardMode && NPC.downedPlantBoss) + { + if (Main.player[Main.myPlayer].HasItem(1157)) + { + this.item[num].SetDefaults(1159, false); + num++; + this.item[num].SetDefaults(1160, false); + num++; + this.item[num].SetDefaults(1161, false); + num++; + if (!Main.dayTime) + { + this.item[num].SetDefaults(1158, false); + num++; + } + if (Main.player[Main.myPlayer].zoneJungle) + { + this.item[num].SetDefaults(1167, false); + num++; + } + } + this.item[num].SetDefaults(1339, false); + num++; + } + if (Main.hardMode && Main.player[Main.myPlayer].zoneJungle) + { + this.item[num].SetDefaults(1171, false); + num++; + if (!Main.dayTime) + { + this.item[num].SetDefaults(1162, false); + num++; + } + } + if (Main.hardMode && NPC.downedGolemBoss) + { + this.item[num].SetDefaults(909, false); + num++; + this.item[num].SetDefaults(910, false); + num++; + this.item[num].SetDefaults(940, false); + num++; + this.item[num].SetDefaults(941, false); + num++; + this.item[num].SetDefaults(942, false); + num++; + this.item[num].SetDefaults(943, false); + num++; + this.item[num].SetDefaults(944, false); + num++; + this.item[num].SetDefaults(945, false); + num++; + } + if (Main.player[Main.myPlayer].HasItem(1258)) + { + this.item[num].SetDefaults(1261, false); + num++; + } + } + else + { + if (type == 17) + { + this.item[num].SetDefaults(928, false); + num++; + this.item[num].SetDefaults(929, false); + num++; + this.item[num].SetDefaults(876, false); + num++; + this.item[num].SetDefaults(877, false); + num++; + this.item[num].SetDefaults(878, false); + num++; + int num2 = (int)((Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f); + if ((double)(Main.screenPosition.Y / 16f) < Main.worldSurface + 10.0 && (num2 < 380 || num2 > Main.maxTilesX - 380)) + { + this.item[num].SetDefaults(1180, false); + num++; + } + if (Main.hardMode && NPC.downedMechBossAny && NPC.AnyNPCs(208)) + { + this.item[num].SetDefaults(1337, false); + num++; + this.item[num].SetDefaults(1338, false); + num++; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.player[Main.myPlayer].discount) + { + for (int l = 0; l < num; l++) + { + this.item[l].value = (int)((float)this.item[l].value * 0.8f); + } + } + } + } +} diff --git a/Terraria/ClientSock.cs b/Terraria/ClientSock.cs new file mode 100644 index 0000000..2fd0073 --- /dev/null +++ b/Terraria/ClientSock.cs @@ -0,0 +1,53 @@ +using System; +using System.Net.Sockets; +namespace Terraria +{ + public class ClientSock + { + public TcpClient tcpClient = new TcpClient(); + public NetworkStream networkStream; + public string statusText; + public int statusCount; + public int statusMax; + public int timeOut; + public byte[] readBuffer; + public byte[] writeBuffer; + public bool active; + public bool locked; + public int state; + public void ClientWriteCallBack(IAsyncResult ar) + { + NetMessage.buffer[256].spamCount--; + } + public void ClientReadCallBack(IAsyncResult ar) + { + if (!Netplay.disconnect) + { + int num = this.networkStream.EndRead(ar); + if (num == 0) + { + Netplay.disconnect = true; + Main.statusText = "Lost connection"; + } + else + { + if (Main.ignoreErrors) + { + try + { + NetMessage.RecieveBytes(this.readBuffer, num, 256); + goto IL_59; + } + catch + { + goto IL_59; + } + } + NetMessage.RecieveBytes(this.readBuffer, num, 256); + } + } + IL_59: + this.locked = false; + } + } +} diff --git a/Terraria/Cloud.cs b/Terraria/Cloud.cs new file mode 100644 index 0000000..3e88eb8 --- /dev/null +++ b/Terraria/Cloud.cs @@ -0,0 +1,342 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +namespace Terraria +{ + public class Cloud + { + public Vector2 position; + public float scale; + public float rotation; + public float rSpeed; + public float sSpeed; + public bool active; + public SpriteEffects spriteDir; + public int type; + public int width; + public int height; + public float Alpha; + public bool kill; + private static Random rand = new Random(); + public static void resetClouds() + { + if (Main.dedServ) + { + return; + } + if (Main.cloudLimit < 10) + { + return; + } + Main.windSpeed = Main.windSpeedSet; + for (int i = 0; i < 200; i++) + { + Main.cloud[i].active = false; + } + for (int j = 0; j < Main.numClouds; j++) + { + Cloud.addCloud(); + Main.cloud[j].Alpha = 1f; + } + for (int k = 0; k < 200; k++) + { + Main.cloud[k].Alpha = 1f; + } + } + public static void addCloud() + { + if (Main.netMode == 2) + { + return; + } + int num = -1; + for (int i = 0; i < 200; i++) + { + if (!Main.cloud[i].active) + { + num = i; + break; + } + } + if (num >= 0) + { + Main.cloud[num].kill = false; + Main.cloud[num].rSpeed = 0f; + Main.cloud[num].sSpeed = 0f; + Main.cloud[num].scale = (float)Cloud.rand.Next(70, 131) * 0.01f; + Main.cloud[num].rotation = (float)Cloud.rand.Next(-10, 11) * 0.01f; + Main.cloud[num].width = (int)((float)Main.cloudTexture[Main.cloud[num].type].Width * Main.cloud[num].scale); + Main.cloud[num].height = (int)((float)Main.cloudTexture[Main.cloud[num].type].Height * Main.cloud[num].scale); + Main.cloud[num].Alpha = 0f; + Main.cloud[num].spriteDir = SpriteEffects.None; + if (Cloud.rand.Next(2) == 0) + { + Main.cloud[num].spriteDir = SpriteEffects.FlipHorizontally; + } + float num2 = Main.windSpeed; + if (!Main.gameMenu) + { + num2 = Main.windSpeed - Main.player[Main.myPlayer].velocity.X * 0.1f; + } + int num3 = 0; + int num4 = 0; + if (num2 > 0f) + { + num3 -= 200; + } + if (num2 < 0f) + { + num4 += 200; + } + int num5 = 300; + float x = (float)WorldGen.genRand.Next(num3 - num5, Main.screenWidth + num4 + num5); + Main.cloud[num].Alpha = 0f; + Main.cloud[num].position.Y = (float)Cloud.rand.Next((int)((float)(-(float)Main.screenHeight) * 0.25f), (int)((float)Main.screenHeight * 0.25f)); + Cloud expr_211_cp_0 = Main.cloud[num]; + expr_211_cp_0.position.Y = expr_211_cp_0.position.Y - (float)Cloud.rand.Next((int)((float)Main.screenHeight * 0.15f)); + Cloud expr_241_cp_0 = Main.cloud[num]; + expr_241_cp_0.position.Y = expr_241_cp_0.position.Y - (float)Cloud.rand.Next((int)((float)Main.screenHeight * 0.15f)); + Main.cloud[num].type = Cloud.rand.Next(4); + if (Main.rand == null) + { + Main.rand = new Random(); + } + if ((Main.cloudAlpha > 0f && Cloud.rand.Next(4) != 0) || (Main.cloudBGActive >= 1f && Main.rand.Next(2) == 0)) + { + Main.cloud[num].type = Cloud.rand.Next(18, 22); + if ((double)Main.cloud[num].scale >= 1.15) + { + Cloud expr_303_cp_0 = Main.cloud[num]; + expr_303_cp_0.position.Y = expr_303_cp_0.position.Y - 150f; + } + if (Main.cloud[num].scale >= 1f) + { + Cloud expr_336_cp_0 = Main.cloud[num]; + expr_336_cp_0.position.Y = expr_336_cp_0.position.Y - 150f; + } + } + else + { + if (((Main.cloudBGActive <= 0f && Main.cloudAlpha == 0f && Main.cloud[num].scale < 1f && Main.cloud[num].position.Y < (float)(-(float)Main.screenHeight) * 0.2f) || Main.cloud[num].position.Y < (float)(-(float)Main.screenHeight) * 0.2f) && (double)Main.numClouds < 50.0) + { + Main.cloud[num].type = Cloud.rand.Next(9, 14); + } + else + { + if ((((double)Main.cloud[num].scale < 1.15 && Main.cloud[num].position.Y < (float)(-(float)Main.screenHeight) * 0.3f) || ((double)Main.cloud[num].scale < 0.85 && Main.cloud[num].position.Y < (float)Main.screenHeight * 0.15f)) && ((double)Main.numClouds > 70.0 || Main.cloudBGActive >= 1f)) + { + Main.cloud[num].type = Cloud.rand.Next(4, 9); + } + else + { + if (Main.cloud[num].position.Y > (float)(-(float)Main.screenHeight) * 0.15f && Cloud.rand.Next(2) == 0 && (double)Main.numClouds > 20.0) + { + Main.cloud[num].type = Cloud.rand.Next(14, 18); + } + } + } + } + if ((double)Main.cloud[num].scale > 1.2) + { + Cloud expr_50A_cp_0 = Main.cloud[num]; + expr_50A_cp_0.position.Y = expr_50A_cp_0.position.Y + 100f; + } + if ((double)Main.cloud[num].scale > 1.3) + { + Main.cloud[num].scale = 1.3f; + } + if ((double)Main.cloud[num].scale < 0.7) + { + Main.cloud[num].scale = 0.7f; + } + Main.cloud[num].active = true; + Main.cloud[num].position.X = x; + if (Main.cloud[num].position.X > (float)(Main.screenWidth + 100)) + { + Main.cloud[num].Alpha = 1f; + } + if (Main.cloud[num].position.X + (float)Main.cloudTexture[Main.cloud[num].type].Width * Main.cloud[num].scale < -100f) + { + Main.cloud[num].Alpha = 1f; + } + Rectangle rectangle = new Rectangle((int)Main.cloud[num].position.X, (int)Main.cloud[num].position.Y, Main.cloud[num].width, Main.cloud[num].height); + for (int j = 0; j < 200; j++) + { + if (num != j && Main.cloud[j].active) + { + Rectangle value = new Rectangle((int)Main.cloud[j].position.X, (int)Main.cloud[j].position.Y, Main.cloud[j].width, Main.cloud[j].height); + if (rectangle.Intersects(value)) + { + Main.cloud[num].active = false; + } + } + } + } + } + public Color cloudColor(Color bgColor) + { + float num = this.scale * this.Alpha; + if (num > 1f) + { + num = 1f; + } + float num2 = (float)((int)((float)bgColor.R * num)); + float num3 = (float)((int)((float)bgColor.G * num)); + float num4 = (float)((int)((float)bgColor.B * num)); + float num5 = (float)((int)((float)bgColor.A * num)); + return new Color((int)((byte)num2), (int)((byte)num3), (int)((byte)num4), (int)((byte)num5)); + } + public object Clone() + { + return base.MemberwiseClone(); + } + public static void UpdateClouds() + { + if (Main.netMode == 2) + { + return; + } + int num = 0; + for (int i = 0; i < 200; i++) + { + if (Main.cloud[i].active) + { + Main.cloud[i].Update(); + if (!Main.cloud[i].kill) + { + num++; + } + } + } + for (int j = 0; j < 200; j++) + { + if (Main.cloud[j].active) + { + if (j > 1 && (!Main.cloud[j - 1].active || (double)Main.cloud[j - 1].scale > (double)Main.cloud[j].scale + 0.02)) + { + Cloud cloud = (Cloud)Main.cloud[j - 1].Clone(); + Main.cloud[j - 1] = (Cloud)Main.cloud[j].Clone(); + Main.cloud[j] = cloud; + } + if (j < 199 && (!Main.cloud[j].active || (double)Main.cloud[j + 1].scale < (double)Main.cloud[j].scale - 0.02)) + { + Cloud cloud2 = (Cloud)Main.cloud[j + 1].Clone(); + Main.cloud[j + 1] = (Cloud)Main.cloud[j].Clone(); + Main.cloud[j] = cloud2; + } + } + } + if (num < Main.numClouds) + { + Cloud.addCloud(); + return; + } + if (num > Main.numClouds) + { + int num2 = Main.rand.Next(num); + int num3 = 0; + while (Main.cloud[num2].kill && num3 < 100) + { + num3++; + num2 = Main.rand.Next(num); + } + Main.cloud[num2].kill = true; + } + } + public void Update() + { + if (Main.gameMenu) + { + this.position.X = this.position.X + Main.windSpeed * this.scale * 3f; + } + else + { + if (this.scale == 1f) + { + this.scale -= 0.0001f; + } + if ((double)this.scale == 1.15) + { + this.scale -= 0.0001f; + } + float num; + if (this.scale < 1f) + { + num = 0.07f; + float num2 = this.scale + 0.15f; + num2 = (num2 + 1f) / 2f; + num2 *= num2; + num *= num2; + } + else + { + if ((double)this.scale <= 1.15) + { + num = 0.17f; + float num3 = this.scale - 0.075f; + num3 *= num3; + num *= num3; + } + else + { + num = 0.23f; + float num4 = this.scale - 0.15f - 0.075f; + num4 *= num4; + num *= num4; + } + } + this.position.X = this.position.X + Main.windSpeed * num * 5f * (float)Main.dayRate; + float num5 = Main.screenPosition.X - Main.screenLastPosition.X; + this.position.X = this.position.X - num5 * num; + } + float num6 = 600f; + if (!this.kill) + { + if (this.Alpha < 1f) + { + this.Alpha += 0.001f * (float)Main.dayRate; + if (this.Alpha > 1f) + { + this.Alpha = 1f; + } + } + } + else + { + this.Alpha -= 0.001f * (float)Main.dayRate; + if (this.Alpha <= 0f) + { + this.active = false; + } + } + if (this.position.X + (float)Main.cloudTexture[this.type].Width * this.scale < -num6 || this.position.X > (float)Main.screenWidth + num6) + { + this.active = false; + } + this.rSpeed += (float)Cloud.rand.Next(-10, 11) * 2E-05f; + if ((double)this.rSpeed > 0.0002) + { + this.rSpeed = 0.0002f; + } + if ((double)this.rSpeed < -0.0002) + { + this.rSpeed = -0.0002f; + } + if ((double)this.rotation > 0.02) + { + this.rotation = 0.02f; + } + if ((double)this.rotation < -0.02) + { + this.rotation = -0.02f; + } + this.rotation += this.rSpeed; + this.width = (int)((float)Main.cloudTexture[this.type].Width * this.scale); + this.height = (int)((float)Main.cloudTexture[this.type].Height * this.scale); + if (this.type >= 9 && this.type <= 13 && (Main.cloudAlpha > 0f || Main.cloudBGActive >= 1f)) + { + this.kill = true; + } + } + } +} diff --git a/Terraria/Collision.cs b/Terraria/Collision.cs new file mode 100644 index 0000000..39b8bf7 --- /dev/null +++ b/Terraria/Collision.cs @@ -0,0 +1,1380 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Collision + { + public static bool honey; + public static bool sloping; + public static bool landMine; + public static bool up; + public static bool down; + public static bool CanHit(Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2) + { + int num = (int)((Position1.X + (float)(Width1 / 2)) / 16f); + int num2 = (int)((Position1.Y + (float)(Height1 / 2)) / 16f); + int num3 = (int)((Position2.X + (float)(Width2 / 2)) / 16f); + int num4 = (int)((Position2.Y + (float)(Height2 / 2)) / 16f); + bool result; + try + { + while (true) + { + int num5 = Math.Abs(num - num3); + int num6 = Math.Abs(num2 - num4); + if (num == num3 && num2 == num4) + { + break; + } + if (num5 > num6) + { + if (num < num3) + { + num++; + } + else + { + num--; + } + if (Main.tile[num, num2 - 1] == null) + { + Main.tile[num, num2 - 1] = new Tile(); + } + if (Main.tile[num, num2 + 1] == null) + { + Main.tile[num, num2 + 1] = new Tile(); + } + if (!Main.tile[num, num2 - 1].inActive() && Main.tile[num, num2 - 1].active() && Main.tileSolid[(int)Main.tile[num, num2 - 1].type] && !Main.tileSolidTop[(int)Main.tile[num, num2 - 1].type] && Main.tile[num, num2 - 1].slope() == 0 && !Main.tile[num, num2 - 1].halfBrick() && !Main.tile[num, num2 + 1].inActive() && Main.tile[num, num2 + 1].active() && Main.tileSolid[(int)Main.tile[num, num2 + 1].type] && !Main.tileSolidTop[(int)Main.tile[num, num2 + 1].type] && Main.tile[num, num2 + 1].slope() == 0 && !Main.tile[num, num2 + 1].halfBrick()) + { + goto Block_19; + } + } + else + { + if (num2 < num4) + { + num2++; + } + else + { + num2--; + } + if (Main.tile[num - 1, num2] == null) + { + Main.tile[num - 1, num2] = new Tile(); + } + if (Main.tile[num + 1, num2] == null) + { + Main.tile[num + 1, num2] = new Tile(); + } + if (!Main.tile[num - 1, num2].inActive() && Main.tile[num - 1, num2].active() && Main.tileSolid[(int)Main.tile[num - 1, num2].type] && !Main.tileSolidTop[(int)Main.tile[num - 1, num2].type] && Main.tile[num - 1, num2].slope() == 0 && !Main.tile[num - 1, num2].halfBrick() && !Main.tile[num + 1, num2].inActive() && Main.tile[num + 1, num2].active() && Main.tileSolid[(int)Main.tile[num + 1, num2].type] && !Main.tileSolidTop[(int)Main.tile[num + 1, num2].type] && Main.tile[num + 1, num2].slope() == 0 && !Main.tile[num + 1, num2].halfBrick()) + { + goto Block_34; + } + } + if (Main.tile[num, num2] == null) + { + Main.tile[num, num2] = new Tile(); + } + if (!Main.tile[num, num2].inActive() && Main.tile[num, num2].active() && Main.tileSolid[(int)Main.tile[num, num2].type] && !Main.tileSolidTop[(int)Main.tile[num, num2].type]) + { + goto Block_39; + } + } + result = true; + return result; + Block_19: + result = false; + return result; + Block_34: + result = false; + return result; + Block_39: + result = false; + } + catch + { + result = false; + } + return result; + } + public static bool EmptyTile(int i, int j, bool ignoreTiles = false) + { + Rectangle rectangle = new Rectangle(i * 16, j * 16, 16, 16); + if (Main.tile[i, j].active() && !ignoreTiles) + { + return false; + } + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active && rectangle.Intersects(new Rectangle((int)Main.player[k].position.X, (int)Main.player[k].position.Y, Main.player[k].width, Main.player[k].height))) + { + return false; + } + } + for (int l = 0; l < 200; l++) + { + if (Main.npc[l].active && rectangle.Intersects(new Rectangle((int)Main.npc[l].position.X, (int)Main.npc[l].position.Y, Main.npc[l].width, Main.npc[l].height))) + { + return false; + } + } + return true; + } + public static bool DrownCollision(Vector2 Position, int Width, int Height, float gravDir = -1f) + { + Vector2 vector = new Vector2(Position.X + (float)(Width / 2), Position.Y + (float)(Height / 2)); + int num = 10; + int num2 = 12; + if (num > Width) + { + num = Width; + } + if (num2 > Height) + { + num2 = Height; + } + vector = new Vector2(vector.X - (float)(num / 2), Position.Y + -2f); + if (gravDir == -1f) + { + vector.Y += (float)(Height / 2 - 6); + } + int num3 = (int)(Position.X / 16f) - 1; + int num4 = (int)((Position.X + (float)Width) / 16f) + 2; + int num5 = (int)(Position.Y / 16f) - 1; + int num6 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int i = num3; i < num4; i++) + { + for (int j = num5; j < num6; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].liquid > 0 && !Main.tile[i, j].lava()) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num7 = 16; + float num8 = (float)(256 - (int)Main.tile[i, j].liquid); + num8 /= 32f; + vector2.Y += num8 * 2f; + num7 -= (int)(num8 * 2f); + if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num7) + { + return true; + } + } + } + } + return false; + } + public static bool WetCollision(Vector2 Position, int Width, int Height) + { + Collision.honey = false; + Vector2 vector = new Vector2(Position.X + (float)(Width / 2), Position.Y + (float)(Height / 2)); + int num = 10; + int num2 = Height / 2; + if (num > Width) + { + num = Width; + } + if (num2 > Height) + { + num2 = Height; + } + vector = new Vector2(vector.X - (float)(num / 2), vector.Y - (float)(num2 / 2)); + int num3 = (int)(Position.X / 16f) - 1; + int num4 = (int)((Position.X + (float)Width) / 16f) + 2; + int num5 = (int)(Position.Y / 16f) - 1; + int num6 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int i = num3; i < num4; i++) + { + for (int j = num5; j < num6; j++) + { + if (Main.tile[i, j] != null) + { + if (Main.tile[i, j].liquid > 0) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num7 = 16; + float num8 = (float)(256 - (int)Main.tile[i, j].liquid); + num8 /= 32f; + vector2.Y += num8 * 2f; + num7 -= (int)(num8 * 2f); + if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num7) + { + if (Main.tile[i, j].honey()) + { + Collision.honey = true; + } + return true; + } + } + else + { + if (Main.tile[i, j].active() && Main.tile[i, j].slope() != 0 && Main.tile[i, j - 1].liquid > 0) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num9 = 16; + if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num9) + { + if (Main.tile[i, j - 1].honey()) + { + Collision.honey = true; + } + return true; + } + } + } + } + } + } + return false; + } + public static bool LavaCollision(Vector2 Position, int Width, int Height) + { + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].liquid > 0 && Main.tile[i, j].lava()) + { + Vector2 vector; + vector.X = (float)(i * 16); + vector.Y = (float)(j * 16); + int num5 = 16; + float num6 = (float)(256 - (int)Main.tile[i, j].liquid); + num6 /= 32f; + vector.Y += num6 * 2f; + num5 -= (int)(num6 * 2f); + if (Position.X + (float)Width > vector.X && Position.X < vector.X + 16f && Position.Y + (float)Height > vector.Y && Position.Y < vector.Y + (float)num5) + { + return true; + } + } + } + } + return false; + } + public static Vector4 WalkDownSlope(Vector2 Position, Vector2 Velocity, int Width, int Height, float gravity = 0f) + { + if (Velocity.Y != gravity) + { + return new Vector4(Position, Velocity.X, Velocity.Y); + } + Vector2 vector = Position; + int num = (int)(vector.X / 16f); + int num2 = (int)((vector.X + (float)Width) / 16f); + int num3 = (int)((Position.Y + (float)Height + 4f) / 16f); + float num4 = (float)((num3 + 3) * 16); + int num5 = 0; + int num6 = 0; + int num7 = 1; + if (Velocity.X < 0f) + { + num7 = 2; + } + for (int i = num; i <= num2; i++) + { + for (int j = num3; j <= num3 + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].nactive() && (Main.tileSolid[(int)Main.tile[i, j].type] || Main.tileSolidTop[(int)Main.tile[i, j].type])) + { + int num8 = j * 16; + if (Main.tile[i, j].halfBrick()) + { + num8 += 8; + } + Rectangle rectangle = new Rectangle(i * 16, j * 16 - 17, 16, 16); + if (rectangle.Intersects(new Rectangle((int)Position.X, (int)Position.Y, Width, Height)) && (float)num8 <= num4) + { + if (num4 == (float)num8) + { + if (Main.tile[i, j].slope() != 0) + { + if (Main.tile[num5, num6].slope() != 0) + { + if ((int)Main.tile[i, j].slope() == num7) + { + num4 = (float)num8; + num5 = i; + num6 = j; + } + } + else + { + num4 = (float)num8; + num5 = i; + num6 = j; + } + } + } + else + { + num4 = (float)num8; + num5 = i; + num6 = j; + } + } + } + } + } + int num9 = num5; + int num10 = num6; + if (Main.tile[num9, num10] != null && Main.tile[num9, num10].slope() > 0) + { + int num11 = (int)Main.tile[num9, num10].slope(); + Vector2 vector2; + vector2.X = (float)(num9 * 16); + vector2.Y = (float)(num10 * 16); + if (num11 == 2) + { + float num12 = vector2.X + 16f - (Position.X + (float)Width); + if (Position.Y + (float)Height >= vector2.Y + num12 && Velocity.X < 0f) + { + Velocity.Y += Math.Abs(Velocity.X); + } + } + else + { + if (num11 == 1) + { + float num12 = Position.X - vector2.X; + if (Position.Y + (float)Height >= vector2.Y + num12 && Velocity.X > 0f) + { + Velocity.Y += Math.Abs(Velocity.X); + } + } + } + } + return new Vector4(Position, Velocity.X, Velocity.Y); + } + public static Vector4 SlopeCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, float gravity = 0f) + { + int num = 0; + float y = Position.Y; + Collision.sloping = false; + Vector2 vector = Position; + Vector2 vector2 = Position; + Vector2 vector3 = Velocity; + int num2 = (int)(Position.X / 16f) - 1; + int num3 = (int)((Position.X + (float)Width) / 16f) + 2; + int num4 = (int)(Position.Y / 16f) - 1; + int num5 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num2 < 0) + { + num2 = 0; + } + if (num3 > Main.maxTilesX) + { + num3 = Main.maxTilesX; + } + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesY) + { + num5 = Main.maxTilesY; + } + for (int i = num2; i < num3; i++) + { + for (int j = num4; j < num5; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].active() && !Main.tile[i, j].inActive() && (Main.tileSolid[(int)Main.tile[i, j].type] || (Main.tileSolidTop[(int)Main.tile[i, j].type] && Main.tile[i, j].frameY == 0))) + { + Vector2 vector4; + vector4.X = (float)(i * 16); + vector4.Y = (float)(j * 16); + int num6 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector4.Y += 8f; + num6 -= 8; + } + if (Position.X + (float)Width > vector4.X && Position.X < vector4.X + 16f && Position.Y + (float)Height > vector4.Y && Position.Y < vector4.Y + (float)num6) + { + bool flag = true; + if (Main.tile[i, j].slope() > 0) + { + if (Main.tile[i, j].slope() == 1 && vector.Y + (float)Height - Math.Abs(Velocity.X) - 1f <= vector4.Y + (float)num6 && vector.X >= vector4.X) + { + flag = true; + } + if (Main.tile[i, j].slope() == 2 && vector.Y + (float)Height - Math.Abs(Velocity.X) - 1f <= vector4.Y + (float)num6 && vector.X + (float)Width <= vector4.X + 16f) + { + flag = true; + } + } + if (flag) + { + if (Width == 18) + { + } + if (Width == 18) + { + } + int num7 = (int)Main.tile[i, j].slope(); + vector4.X = (float)(i * 16); + vector4.Y = (float)(j * 16); + if (Position.X + (float)Width > vector4.X && Position.X < vector4.X + 16f && Position.Y + (float)Height > vector4.Y && Position.Y < vector4.Y + 16f) + { + if (num7 == 2) + { + float num8 = vector4.X + 16f - (Position.X + (float)Width); + if (num8 >= 0f) + { + if (Position.Y + (float)Height >= vector4.Y + num8) + { + float num9 = vector4.Y - (vector.Y + (float)Height) + num8; + if (Position.Y + num9 < y) + { + vector2.Y = Position.Y + num9; + y = vector2.Y; + if (vector3.Y > 0f) + { + vector3.Y = 0f; + } + num = num7; + } + } + } + else + { + float num10 = vector4.Y - (float)Height; + if (vector2.Y > num10) + { + vector2.Y = num10; + if (vector3.Y > 0f) + { + vector3.Y = 0f; + } + } + } + } + else + { + if (num7 == 1) + { + float num8 = Position.X - vector4.X; + if (num8 >= 0f) + { + if (Position.Y + (float)Height >= vector4.Y + num8) + { + float num11 = vector4.Y - (vector.Y + (float)Height) + num8; + if (Position.Y + num11 < y) + { + vector2.Y = Position.Y + num11; + y = vector2.Y; + if (vector3.Y > 0f) + { + vector3.Y = 0f; + } + num = num7; + } + } + } + else + { + float num12 = vector4.Y - (float)Height; + if (vector2.Y > num12) + { + vector2.Y = num12; + if (vector3.Y > 0f) + { + vector3.Y = 0f; + } + } + } + } + } + } + } + } + } + } + } + Vector2 position = Position; + Vector2 velocity = vector2 - Position; + Vector2 vector5 = Collision.TileCollision(position, velocity, Width, Height, false, false); + if (vector5.Y > velocity.Y) + { + float num13 = velocity.Y - vector5.Y; + vector2.Y = Position.Y + vector5.Y; + if (num == 1) + { + vector2.X = Position.X - num13; + } + else + { + vector2.X = Position.X + num13; + } + vector3.X = 0f; + vector3.Y = 0f; + Collision.up = false; + } + return new Vector4(vector2, vector3.X, vector3.Y); + } + public static Vector2 noSlopeCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough = false, bool fall2 = false) + { + Collision.up = false; + Collision.down = false; + Vector2 result = Velocity; + Vector2 vector = Velocity; + Vector2 vector2 = Position + Velocity; + Vector2 vector3 = Position; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + int num5 = -1; + int num6 = -1; + int num7 = -1; + int num8 = -1; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + float num9 = (float)((num4 + 3) * 16); + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].active() && (Main.tileSolid[(int)Main.tile[i, j].type] || (Main.tileSolidTop[(int)Main.tile[i, j].type] && Main.tile[i, j].frameY == 0))) + { + Vector2 vector4; + vector4.X = (float)(i * 16); + vector4.Y = (float)(j * 16); + int num10 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector4.Y += 8f; + num10 -= 8; + } + if (vector2.X + (float)Width > vector4.X && vector2.X < vector4.X + 16f && vector2.Y + (float)Height > vector4.Y && vector2.Y < vector4.Y + (float)num10) + { + if (vector3.Y + (float)Height <= vector4.Y) + { + Collision.down = true; + if ((!Main.tileSolidTop[(int)Main.tile[i, j].type] || !fallThrough || (Velocity.Y > 1f && !fall2)) && num9 > vector4.Y) + { + num7 = i; + num8 = j; + if (num10 < 16) + { + num8++; + } + if (num7 != num5) + { + result.Y = vector4.Y - (vector3.Y + (float)Height); + num9 = vector4.Y; + } + } + } + else + { + if (vector3.X + (float)Width <= vector4.X && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + num5 = i; + num6 = j; + if (num6 != num8) + { + result.X = vector4.X - (vector3.X + (float)Width); + } + if (num7 == num5) + { + result.Y = vector.Y; + } + } + else + { + if (vector3.X >= vector4.X + 16f && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + num5 = i; + num6 = j; + if (num6 != num8) + { + result.X = vector4.X + 16f - vector3.X; + } + if (num7 == num5) + { + result.Y = vector.Y; + } + } + else + { + if (vector3.Y >= vector4.Y + (float)num10 && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + Collision.up = true; + num7 = i; + num8 = j; + result.Y = vector4.Y + (float)num10 - vector3.Y + 0.01f; + if (num8 == num6) + { + result.X = vector.X; + } + } + } + } + } + } + } + } + } + return result; + } + public static Vector2 TileCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough = false, bool fall2 = false) + { + Collision.up = false; + Collision.down = false; + Vector2 result = Velocity; + Vector2 vector = Velocity; + Vector2 vector2 = Position + Velocity; + Vector2 vector3 = Position; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + int num5 = -1; + int num6 = -1; + int num7 = -1; + int num8 = -1; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + float num9 = (float)((num4 + 3) * 16); + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].active() && !Main.tile[i, j].inActive() && (Main.tileSolid[(int)Main.tile[i, j].type] || (Main.tileSolidTop[(int)Main.tile[i, j].type] && Main.tile[i, j].frameY == 0))) + { + Vector2 vector4; + vector4.X = (float)(i * 16); + vector4.Y = (float)(j * 16); + int num10 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector4.Y += 8f; + num10 -= 8; + } + if (vector2.X + (float)Width > vector4.X && vector2.X < vector4.X + 16f && vector2.Y + (float)Height > vector4.Y && vector2.Y < vector4.Y + (float)num10) + { + bool flag = false; + bool flag2 = false; + if (Main.tile[i, j].slope() > 0) + { + flag = true; + if (Main.tile[i, j].slope() == 1 && vector3.Y + (float)Height - Math.Abs(Velocity.X) <= vector4.Y + (float)num10 && vector3.X >= vector4.X) + { + flag2 = true; + } + if (Main.tile[i, j].slope() == 2 && vector3.Y + (float)Height - Math.Abs(Velocity.X) <= vector4.Y + (float)num10 && vector3.X + (float)Width <= vector4.X + 16f) + { + flag2 = true; + } + } + if (!flag2) + { + if (vector3.Y + (float)Height <= vector4.Y) + { + Collision.down = true; + if ((!Main.tileSolidTop[(int)Main.tile[i, j].type] || !fallThrough || (Velocity.Y > 1f && !fall2)) && num9 > vector4.Y) + { + num7 = i; + num8 = j; + if (num10 < 16) + { + num8++; + } + if (num7 != num5 && !flag) + { + result.Y = vector4.Y - (vector3.Y + (float)Height); + num9 = vector4.Y; + } + } + } + else + { + if (vector3.X + (float)Width <= vector4.X && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + if (Main.tile[i - 1, j] == null) + { + Main.tile[i - 1, j] = new Tile(); + } + if (Main.tile[i - 1, j].slope() != 2) + { + num5 = i; + num6 = j; + if (num6 != num8) + { + result.X = vector4.X - (vector3.X + (float)Width); + } + if (num7 == num5) + { + result.Y = vector.Y; + } + } + } + else + { + if (vector3.X >= vector4.X + 16f && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + if (Main.tile[i + 1, j] == null) + { + Main.tile[i + 1, j] = new Tile(); + } + if (Main.tile[i + 1, j].slope() != 1) + { + num5 = i; + num6 = j; + if (num6 != num8) + { + result.X = vector4.X + 16f - vector3.X; + } + if (num7 == num5) + { + result.Y = vector.Y; + } + } + } + else + { + if (vector3.Y >= vector4.Y + (float)num10 && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + Collision.up = true; + num7 = i; + num8 = j; + result.Y = vector4.Y + (float)num10 - vector3.Y + 0.01f; + if (num8 == num6) + { + result.X = vector.X; + } + } + } + } + } + } + } + } + } + } + return result; + } + public static bool SolidCollision(Vector2 Position, int Width, int Height) + { + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && !Main.tile[i, j].inActive() && Main.tile[i, j].active() && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + Vector2 vector; + vector.X = (float)(i * 16); + vector.Y = (float)(j * 16); + int num5 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector.Y += 8f; + num5 -= 8; + } + if (Position.X + (float)Width > vector.X && Position.X < vector.X + 16f && Position.Y + (float)Height > vector.Y && Position.Y < vector.Y + (float)num5) + { + return true; + } + } + } + } + return false; + } + public static Vector2 WaterCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough = false, bool fall2 = false, bool lavaWalk = true) + { + Vector2 result = Velocity; + Vector2 vector = Position + Velocity; + Vector2 vector2 = Position; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].liquid > 0 && Main.tile[i, j - 1].liquid == 0 && (!Main.tile[i, j].lava() || lavaWalk)) + { + int num5 = (int)(Main.tile[i, j].liquid / 32 * 2 + 2); + Vector2 vector3; + vector3.X = (float)(i * 16); + vector3.Y = (float)(j * 16 + 16 - num5); + if (vector.X + (float)Width > vector3.X && vector.X < vector3.X + 16f && vector.Y + (float)Height > vector3.Y && vector.Y < vector3.Y + (float)num5 && vector2.Y + (float)Height <= vector3.Y && !fallThrough) + { + result.Y = vector3.Y - (vector2.Y + (float)Height); + } + } + } + } + return result; + } + public static Vector2 AnyCollision(Vector2 Position, Vector2 Velocity, int Width, int Height) + { + Vector2 result = Velocity; + Vector2 vector = Velocity; + Vector2 vector2 = Position + Velocity; + Vector2 vector3 = Position; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + int num5 = -1; + int num6 = -1; + int num7 = -1; + int num8 = -1; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].active() && !Main.tile[i, j].inActive()) + { + Vector2 vector4; + vector4.X = (float)(i * 16); + vector4.Y = (float)(j * 16); + int num9 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector4.Y += 8f; + num9 -= 8; + } + if (vector2.X + (float)Width > vector4.X && vector2.X < vector4.X + 16f && vector2.Y + (float)Height > vector4.Y && vector2.Y < vector4.Y + (float)num9) + { + if (vector3.Y + (float)Height <= vector4.Y) + { + num7 = i; + num8 = j; + if (num7 != num5) + { + result.Y = vector4.Y - (vector3.Y + (float)Height); + } + } + else + { + if (vector3.X + (float)Width <= vector4.X && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + num5 = i; + num6 = j; + if (num6 != num8) + { + result.X = vector4.X - (vector3.X + (float)Width); + } + if (num7 == num5) + { + result.Y = vector.Y; + } + } + else + { + if (vector3.X >= vector4.X + 16f && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + num5 = i; + num6 = j; + if (num6 != num8) + { + result.X = vector4.X + 16f - vector3.X; + } + if (num7 == num5) + { + result.Y = vector.Y; + } + } + else + { + if (vector3.Y >= vector4.Y + (float)num9 && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + num7 = i; + num8 = j; + result.Y = vector4.Y + (float)num9 - vector3.Y + 0.01f; + if (num8 == num6) + { + result.X = vector.X + 0.01f; + } + } + } + } + } + } + } + } + } + return result; + } + public static void HitTiles(Vector2 Position, Vector2 Velocity, int Width, int Height) + { + Vector2 vector = Position + Velocity; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && !Main.tile[i, j].inActive() && Main.tile[i, j].active() && (Main.tileSolid[(int)Main.tile[i, j].type] || (Main.tileSolidTop[(int)Main.tile[i, j].type] && Main.tile[i, j].frameY == 0))) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num5 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector2.Y += 8f; + num5 -= 8; + } + if (vector.X + (float)Width >= vector2.X && vector.X <= vector2.X + 16f && vector.Y + (float)Height >= vector2.Y && vector.Y <= vector2.Y + (float)num5) + { + WorldGen.KillTile(i, j, true, true, false); + } + } + } + } + } + public static Vector2 HurtTiles(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fireImmune = false) + { + Vector2 vector = Position; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].inActive() && Main.tile[i, j].active() && (Main.tile[i, j].type == 32 || Main.tile[i, j].type == 37 || Main.tile[i, j].type == 48 || Main.tile[i, j].type == 232 || Main.tile[i, j].type == 53 || Main.tile[i, j].type == 57 || Main.tile[i, j].type == 58 || Main.tile[i, j].type == 69 || Main.tile[i, j].type == 76 || Main.tile[i, j].type == 112 || Main.tile[i, j].type == 116 || Main.tile[i, j].type == 123 || Main.tile[i, j].type == 224 || Main.tile[i, j].type == 234)) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num5 = 0; + int type = (int)Main.tile[i, j].type; + int num6 = 16; + if (Main.tile[i, j].halfBrick()) + { + vector2.Y += 8f; + num6 -= 8; + } + if (type == 32 || type == 69 || type == 80) + { + if (vector.X + (float)Width > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)Height > vector2.Y && (double)vector.Y < (double)(vector2.Y + (float)num6) + 0.01) + { + int num7 = 1; + if (vector.X + (float)(Width / 2) < vector2.X + 8f) + { + num7 = -1; + } + num5 = 10; + if (type == 69) + { + num5 = 17; + } + else + { + if (type == 80) + { + num5 = 6; + } + } + if (type == 32 || type == 69) + { + WorldGen.KillTile(i, j, false, false, false); + if (Main.netMode == 1 && !Main.tile[i, j].active() && Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 4, (float)i, (float)j, 0f, 0); + } + } + return new Vector2((float)num7, (float)num5); + } + } + else + { + if (type == 53 || type == 112 || type == 116 || type == 123 || type == 224 || type == 234) + { + if (vector.X + (float)Width - 2f >= vector2.X && vector.X + 2f <= vector2.X + 16f && vector.Y + (float)Height - 2f >= vector2.Y && vector.Y + 2f <= vector2.Y + (float)num6) + { + int num8 = 1; + if (vector.X + (float)(Width / 2) < vector2.X + 8f) + { + num8 = -1; + } + num5 = 15; + return new Vector2((float)num8, (float)num5); + } + } + else + { + if (vector.X + (float)Width >= vector2.X && vector.X <= vector2.X + 16f && vector.Y + (float)Height >= vector2.Y && (double)vector.Y <= (double)(vector2.Y + (float)num6) + 0.01) + { + int num9 = 1; + if (vector.X + (float)(Width / 2) < vector2.X + 8f) + { + num9 = -1; + } + if (!fireImmune && (type == 37 || type == 58 || type == 76)) + { + num5 = 20; + } + if (type == 48) + { + num5 = 40; + } + if (type == 232) + { + num5 = 60; + } + return new Vector2((float)num9, (float)num5); + } + } + } + } + } + } + return default(Vector2); + } + public static bool SwitchTiles(Vector2 Position, int Width, int Height, Vector2 oldPosition, int objType) + { + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].active() && (Main.tile[i, j].type == 135 || Main.tile[i, j].type == 210)) + { + Vector2 vector; + vector.X = (float)(i * 16); + vector.Y = (float)(j * 16 + 12); + if (Position.X + (float)Width > vector.X && Position.X < vector.X + 16f && Position.Y + (float)Height > vector.Y && (double)Position.Y < (double)vector.Y + 4.01) + { + if (Main.tile[i, j].type == 210) + { + WorldGen.ExplodeMine(i, j); + } + else + { + if (oldPosition.X + (float)Width <= vector.X || oldPosition.X >= vector.X + 16f || oldPosition.Y + (float)Height <= vector.Y || (double)oldPosition.Y >= (double)vector.Y + 16.01) + { + int num5 = (int)(Main.tile[i, j].frameY / 18); + bool flag = true; + if ((num5 == 4 || num5 == 2 || num5 == 3 || num5 == 6) && objType != 1) + { + flag = false; + } + if (num5 == 5 && objType == 1) + { + flag = false; + } + if (flag) + { + WorldGen.hitSwitch(i, j); + NetMessage.SendData(59, -1, -1, "", i, (float)j, 0f, 0f, 0); + return true; + } + } + } + } + } + } + } + return false; + } + public static Vector2 StickyTiles(Vector2 Position, Vector2 Velocity, int Width, int Height) + { + Vector2 vector = Position; + int num = (int)(Position.X / 16f) - 1; + int num2 = (int)((Position.X + (float)Width) / 16f) + 2; + int num3 = (int)(Position.Y / 16f) - 1; + int num4 = (int)((Position.Y + (float)Height) / 16f) + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null && Main.tile[i, j].active()) + { + if (Main.tile[i, j].type == 51) + { + int num5 = 0; + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + if (vector.X + (float)Width > vector2.X - (float)num5 && vector.X < vector2.X + 16f + (float)num5 && vector.Y + (float)Height > vector2.Y && (double)vector.Y < (double)vector2.Y + 16.01) + { + if (Main.tile[i, j].type == 51 && (double)(Math.Abs(Velocity.X) + Math.Abs(Velocity.Y)) > 0.7 && Main.rand.Next(30) == 0) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 30, 0f, 0f, 0, default(Color), 1f); + } + return new Vector2((float)i, (float)j); + } + } + else + { + if (Main.tile[i, j].type == 229 && Main.tile[i, j].slope() == 0) + { + int num6 = 1; + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + float num7 = 16.01f; + if (Main.tile[i, j].halfBrick()) + { + vector2.Y += 8f; + num7 -= 8f; + } + if (vector.X + (float)Width > vector2.X - (float)num6 && vector.X < vector2.X + 16f + (float)num6 && vector.Y + (float)Height > vector2.Y && vector.Y < vector2.Y + num7) + { + if (Main.tile[i, j].type == 51 && (double)(Math.Abs(Velocity.X) + Math.Abs(Velocity.Y)) > 0.7 && Main.rand.Next(30) == 0) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 30, 0f, 0f, 0, default(Color), 1f); + } + return new Vector2((float)i, (float)j); + } + } + } + } + } + } + return new Vector2(-1f, -1f); + } + public static bool SolidTiles(int startX, int endX, int startY, int endY) + { + if (startX < 0) + { + return true; + } + if (endX >= Main.maxTilesX) + { + return true; + } + if (startY < 0) + { + return true; + } + if (endY >= Main.maxTilesY) + { + return true; + } + for (int i = startX; i < endX + 1; i++) + { + for (int j = startY; j < endY + 1; j++) + { + if (Main.tile[i, j] == null) + { + return false; + } + if (Main.tile[i, j].active() && !Main.tile[i, j].inActive() && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + return true; + } + } + } + return false; + } + } +} diff --git a/Terraria/CombatText.cs b/Terraria/CombatText.cs new file mode 100644 index 0000000..a2da1ff --- /dev/null +++ b/Terraria/CombatText.cs @@ -0,0 +1,178 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class CombatText + { + public Vector2 position; + public Vector2 velocity; + public float alpha; + public int alphaDir = 1; + public string text; + public float scale = 1f; + public float rotation; + public Color color; + public bool active; + public int lifeTime; + public bool crit; + public bool dot; + public static void NewText(Rectangle location, Color color, string text, bool Crit = false, bool dot = false) + { + if (Main.netMode == 2) + { + return; + } + int i = 0; + while (i < 100) + { + if (!Main.combatText[i].active) + { + int num = 0; + if (Crit) + { + num = 1; + } + Vector2 vector = Main.fontCombatText[num].MeasureString(text); + Main.combatText[i].alpha = 1f; + Main.combatText[i].alphaDir = -1; + Main.combatText[i].active = true; + Main.combatText[i].scale = 0f; + Main.combatText[i].rotation = 0f; + Main.combatText[i].position.X = (float)location.X + (float)location.Width * 0.5f - vector.X * 0.5f; + Main.combatText[i].position.Y = (float)location.Y + (float)location.Height * 0.25f - vector.Y * 0.5f; + CombatText expr_FB_cp_0 = Main.combatText[i]; + expr_FB_cp_0.position.X = expr_FB_cp_0.position.X + (float)Main.rand.Next(-(int)((double)location.Width * 0.5), (int)((double)location.Width * 0.5) + 1); + CombatText expr_147_cp_0 = Main.combatText[i]; + expr_147_cp_0.position.Y = expr_147_cp_0.position.Y + (float)Main.rand.Next(-(int)((double)location.Height * 0.5), (int)((double)location.Height * 0.5) + 1); + Main.combatText[i].color = color; + Main.combatText[i].text = text; + Main.combatText[i].velocity.Y = -7f; + if (Main.player[Main.myPlayer].gravDir == -1f) + { + CombatText expr_1DA_cp_0 = Main.combatText[i]; + expr_1DA_cp_0.velocity.Y = expr_1DA_cp_0.velocity.Y * -1f; + Main.combatText[i].position.Y = (float)location.Y + (float)location.Height * 0.75f + vector.Y * 0.5f; + } + Main.combatText[i].lifeTime = 60; + Main.combatText[i].crit = Crit; + Main.combatText[i].dot = dot; + if (Crit) + { + Main.combatText[i].text = text; + Main.combatText[i].color = new Color(255, 100, 30, 255); + Main.combatText[i].lifeTime *= 2; + CombatText expr_29C_cp_0 = Main.combatText[i]; + expr_29C_cp_0.velocity.Y = expr_29C_cp_0.velocity.Y * 2f; + Main.combatText[i].velocity.X = (float)Main.rand.Next(-25, 26) * 0.05f; + Main.combatText[i].rotation = (float)(Main.combatText[i].lifeTime / 2) * 0.002f; + if (Main.combatText[i].velocity.X < 0f) + { + Main.combatText[i].rotation *= -1f; + } + } + if (dot) + { + Main.combatText[i].velocity.Y = -4f; + Main.combatText[i].lifeTime = 40; + return; + } + break; + } + else + { + i++; + } + } + } + public void Update() + { + if (this.active) + { + this.alpha += (float)this.alphaDir * 0.05f; + if ((double)this.alpha <= 0.6) + { + this.alphaDir = 1; + } + if (this.alpha >= 1f) + { + this.alpha = 1f; + this.alphaDir = -1; + } + if (this.dot) + { + this.velocity.Y = this.velocity.Y + 0.15f; + } + else + { + this.velocity.Y = this.velocity.Y * 0.92f; + if (this.crit) + { + this.velocity.Y = this.velocity.Y * 0.92f; + } + } + this.velocity.X = this.velocity.X * 0.93f; + this.position += this.velocity; + this.lifeTime--; + if (this.lifeTime <= 0) + { + this.scale -= 0.1f; + if ((double)this.scale < 0.1) + { + this.active = false; + } + this.lifeTime = 0; + if (this.crit) + { + this.alphaDir = -1; + this.scale += 0.07f; + return; + } + } + else + { + if (this.crit) + { + if (this.velocity.X < 0f) + { + this.rotation += 0.001f; + } + else + { + this.rotation -= 0.001f; + } + } + if (this.dot) + { + this.scale += 0.5f; + if ((double)this.scale > 0.8) + { + this.scale = 0.8f; + return; + } + } + else + { + if (this.scale < 1f) + { + this.scale += 0.1f; + } + if (this.scale > 1f) + { + this.scale = 1f; + } + } + } + } + } + public static void UpdateCombatText() + { + for (int i = 0; i < 100; i++) + { + if (Main.combatText[i].active) + { + Main.combatText[i].Update(); + } + } + } + } +} diff --git a/Terraria/Dust.cs b/Terraria/Dust.cs new file mode 100644 index 0000000..7113cac --- /dev/null +++ b/Terraria/Dust.cs @@ -0,0 +1,1772 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Dust + { + public static float dCount; + public Vector2 position; + public Vector2 velocity; + public static int lavaBubbles; + public float fadeIn; + public bool noGravity; + public float scale; + public float rotation; + public bool noLight; + public bool active; + public int type; + public Color color; + public int alpha; + public Rectangle frame; + public static int NewDust(Vector2 Position, int Width, int Height, int Type, float SpeedX = 0f, float SpeedY = 0f, int Alpha = 0, Color newColor = default(Color), float Scale = 1f) + { + if (Main.gameMenu) + { + return 0; + } + if (Main.rand == null) + { + Main.rand = new Random((int)DateTime.Now.Ticks); + } + if (Main.gamePaused) + { + return 0; + } + if (WorldGen.gen) + { + return 0; + } + if (Main.netMode == 2) + { + return 0; + } + Rectangle rectangle = new Rectangle((int)(Main.screenPosition.X - 400f), (int)(Main.screenPosition.Y - 400f), Main.screenWidth + 800, Main.screenHeight + 800); + Rectangle value = new Rectangle((int)Position.X, (int)Position.Y, 10, 10); + if (!rectangle.Intersects(value)) + { + return 6000; + } + int result = 6000; + int i = 0; + while (i < 6000) + { + if (!Main.dust[i].active) + { + if ((double)i > (double)Main.numDust * 0.9) + { + if (Main.rand.Next(4) != 0) + { + return 5999; + } + } + else + { + if ((double)i > (double)Main.numDust * 0.8) + { + if (Main.rand.Next(3) != 0) + { + return 5999; + } + } + else + { + if ((double)i > (double)Main.numDust * 0.7) + { + if (Main.rand.Next(2) == 0) + { + return 5999; + } + } + else + { + if ((double)i > (double)Main.numDust * 0.6) + { + if (Main.rand.Next(4) == 0) + { + return 5999; + } + } + else + { + if ((double)i > (double)Main.numDust * 0.5) + { + if (Main.rand.Next(5) == 0) + { + return 5999; + } + } + else + { + Dust.dCount = 0f; + } + } + } + } + } + int num = Width; + int num2 = Height; + if (num < 5) + { + num = 5; + } + if (num2 < 5) + { + num2 = 5; + } + result = i; + Main.dust[i].fadeIn = 0f; + Main.dust[i].active = true; + Main.dust[i].type = Type; + Main.dust[i].noGravity = false; + Main.dust[i].color = newColor; + Main.dust[i].alpha = Alpha; + Main.dust[i].position.X = Position.X + (float)Main.rand.Next(num - 4) + 4f; + Main.dust[i].position.Y = Position.Y + (float)Main.rand.Next(num2 - 4) + 4f; + Main.dust[i].velocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + SpeedX; + Main.dust[i].velocity.Y = (float)Main.rand.Next(-20, 21) * 0.1f + SpeedY; + Main.dust[i].frame.X = 10 * Type; + Main.dust[i].frame.Y = 10 * Main.rand.Next(3); + if (Type >= 100) + { + Dust expr_2FF_cp_0 = Main.dust[i]; + expr_2FF_cp_0.frame.X = expr_2FF_cp_0.frame.X - 1000; + Dust expr_31C_cp_0 = Main.dust[i]; + expr_31C_cp_0.frame.Y = expr_31C_cp_0.frame.Y + 30; + } + Main.dust[i].frame.Width = 8; + Main.dust[i].frame.Height = 8; + Main.dust[i].rotation = 0f; + Main.dust[i].scale = 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Main.dust[i].scale *= Scale; + Main.dust[i].noLight = false; + if (Main.dust[i].type == 135 || Main.dust[i].type == 6 || Main.dust[i].type == 75 || Main.dust[i].type == 169 || Main.dust[i].type == 29 || (Main.dust[i].type >= 59 && Main.dust[i].type <= 65) || Main.dust[i].type == 158) + { + Main.dust[i].velocity.Y = (float)Main.rand.Next(-10, 6) * 0.1f; + Dust expr_461_cp_0 = Main.dust[i]; + expr_461_cp_0.velocity.X = expr_461_cp_0.velocity.X * 0.3f; + Main.dust[i].scale *= 0.7f; + } + if (Main.dust[i].type == 127 || Main.dust[i].type == 187) + { + Main.dust[i].velocity *= 0.3f; + Main.dust[i].scale *= 0.7f; + } + if (Main.dust[i].type == 33 || Main.dust[i].type == 52 || Main.dust[i].type == 98 || Main.dust[i].type == 99 || Main.dust[i].type == 100 || Main.dust[i].type == 101 || Main.dust[i].type == 102 || Main.dust[i].type == 103 || Main.dust[i].type == 104 || Main.dust[i].type == 105) + { + Main.dust[i].alpha = 170; + Main.dust[i].velocity *= 0.5f; + Dust expr_5C0_cp_0 = Main.dust[i]; + expr_5C0_cp_0.velocity.Y = expr_5C0_cp_0.velocity.Y + 1f; + } + if (Main.dust[i].type == 41) + { + Main.dust[i].velocity *= 0f; + } + if (Main.dust[i].type == 80) + { + Main.dust[i].alpha = 50; + } + if (Main.dust[i].type != 34 && Main.dust[i].type != 35 && Main.dust[i].type != 152) + { + break; + } + Main.dust[i].velocity *= 0.1f; + Main.dust[i].velocity.Y = -0.5f; + if (Main.dust[i].type == 34 && !Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y - 8f), 4, 4)) + { + Main.dust[i].active = false; + break; + } + break; + } + else + { + i++; + } + } + return result; + } + public static int dustWater() + { + if (Main.waterStyle == 2) + { + return 98; + } + if (Main.waterStyle == 3) + { + return 99; + } + if (Main.waterStyle == 4) + { + return 100; + } + if (Main.waterStyle == 5) + { + return 101; + } + if (Main.waterStyle == 6) + { + return 102; + } + if (Main.waterStyle == 7) + { + return 103; + } + if (Main.waterStyle == 8) + { + return 104; + } + if (Main.waterStyle == 9) + { + return 105; + } + if (Main.waterStyle == 10) + { + return 123; + } + return 33; + } + public static void UpdateDust() + { + int num = 0; + Dust.lavaBubbles = 0; + Main.snowDust = 0; + for (int i = 0; i < 6000; i++) + { + if (i < Main.numDust) + { + if (Main.dust[i].active) + { + Dust.dCount += 1f; + if (Main.dust[i].scale > 10f) + { + Main.dust[i].active = false; + } + if (Main.dust[i].type == 35) + { + Dust.lavaBubbles++; + } + Main.dust[i].position += Main.dust[i].velocity; + if (Main.dust[i].type >= 86 && Main.dust[i].type <= 92 && !Main.dust[i].noLight) + { + float num2 = Main.dust[i].scale * 0.6f; + int num3 = Main.dust[i].type - 85; + float num4 = num2; + float num5 = num2; + float num6 = num2; + if (num3 == 3) + { + num4 *= 0f; + num5 *= 0.1f; + num6 *= 1.3f; + } + else + { + if (num3 == 5) + { + num4 *= 1f; + num5 *= 0.1f; + num6 *= 0.1f; + } + else + { + if (num3 == 4) + { + num4 *= 0f; + num5 *= 1f; + num6 *= 0.1f; + } + else + { + if (num3 == 1) + { + num4 *= 0.9f; + num5 *= 0f; + num6 *= 0.9f; + } + else + { + if (num3 == 6) + { + num4 *= 1.3f; + num5 *= 1.3f; + num6 *= 1.3f; + } + else + { + if (num3 == 2) + { + num4 *= 0.9f; + num5 *= 0.9f; + num6 *= 0f; + } + } + } + } + } + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num2 * num4, num2 * num5, num2 * num6); + } + if (Main.dust[i].type == 154) + { + Main.dust[i].rotation += Main.dust[i].velocity.X * 0.3f; + Main.dust[i].scale -= 0.03f; + } + if (Main.dust[i].type == 172) + { + float num7 = Main.dust[i].scale * 0.5f; + if (num7 > 1f) + { + num7 = 1f; + } + float num8 = num7; + float num9 = num7; + float num10 = num7; + num8 *= 0f; + num9 *= 0.25f; + num10 *= 1f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num7 * num8, num7 * num9, num7 * num10); + } + if (Main.dust[i].type == 182) + { + Main.dust[i].rotation += 1f; + float num11 = Main.dust[i].scale * 0.25f; + if (num11 > 1f) + { + num11 = 1f; + } + float num12 = num11; + float num13 = num11; + float num14 = num11; + num12 *= 1f; + num13 *= 0.2f; + num14 *= 0.1f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num11 * num12, num11 * num13, num11 * num14); + } + if (Main.dust[i].type == 157) + { + float num15 = Main.dust[i].scale * 0.2f; + float num16 = num15; + float num17 = num15; + float num18 = num15; + num16 *= 0.25f; + num17 *= 1f; + num18 *= 0.5f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num15 * num16, num15 * num17, num15 * num18); + } + if (Main.dust[i].type == 163) + { + float num19 = Main.dust[i].scale * 0.25f; + float num20 = num19; + float num21 = num19; + float num22 = num19; + num20 *= 0.25f; + num21 *= 1f; + num22 *= 0.05f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num19 * num20, num19 * num21, num19 * num22); + } + if (Main.dust[i].type == 170) + { + float num23 = Main.dust[i].scale * 0.5f; + float num24 = num23; + float num25 = num23; + float num26 = num23; + num24 *= 1f; + num25 *= 1f; + num26 *= 0.05f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num23 * num24, num23 * num25, num23 * num26); + } + if (Main.dust[i].type == 156) + { + float num27 = Main.dust[i].scale * 0.6f; + int arg_5DB_0 = Main.dust[i].type; + float num28 = num27; + float num29 = num27; + float num30 = num27; + num28 *= 0.5f; + num29 *= 0.9f; + num30 *= 1f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num27 * num28, num27 * num29, num27 * num30); + } + if (Main.dust[i].type == 175) + { + Main.dust[i].scale -= 0.05f; + } + if (Main.dust[i].type == 174) + { + Main.dust[i].scale -= 0.01f; + float num31 = Main.dust[i].scale * 1f; + if (num31 > 0.6f) + { + num31 = 0.6f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num31, num31 * 0.4f, 0f); + } + if (Main.dust[i].type == 6 || Main.dust[i].type == 135 || Main.dust[i].type == 127 || Main.dust[i].type == 187 || Main.dust[i].type == 75 || Main.dust[i].type == 169 || Main.dust[i].type == 29 || (Main.dust[i].type >= 59 && Main.dust[i].type <= 65) || Main.dust[i].type == 158) + { + if (!Main.dust[i].noGravity) + { + Dust expr_7D9_cp_0 = Main.dust[i]; + expr_7D9_cp_0.velocity.Y = expr_7D9_cp_0.velocity.Y + 0.05f; + } + if (!Main.dust[i].noLight) + { + float num32 = Main.dust[i].scale * 1.4f; + if (Main.dust[i].type == 29) + { + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * 0.1f, num32 * 0.4f, num32); + } + if (Main.dust[i].type == 75) + { + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * 0.7f, num32, num32 * 0.2f); + } + if (Main.dust[i].type == 169) + { + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * 1.1f, num32 * 1.1f, num32 * 0.2f); + } + else + { + if (Main.dust[i].type == 135) + { + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * 0.2f, num32 * 0.7f, num32); + } + else + { + if (Main.dust[i].type == 158) + { + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * 1f, num32 * 0.5f, 0f); + } + else + { + if (Main.dust[i].type >= 59 && Main.dust[i].type <= 65) + { + if (num32 > 0.8f) + { + num32 = 0.8f; + } + int num33 = Main.dust[i].type - 58; + float num34 = 1f; + float num35 = 1f; + float num36 = 1f; + if (num33 == 1) + { + num34 = 0f; + num35 = 0.1f; + num36 = 1.3f; + } + else + { + if (num33 == 2) + { + num34 = 1f; + num35 = 0.1f; + num36 = 0.1f; + } + else + { + if (num33 == 3) + { + num34 = 0f; + num35 = 1f; + num36 = 0.1f; + } + else + { + if (num33 == 4) + { + num34 = 0.9f; + num35 = 0f; + num36 = 0.9f; + } + else + { + if (num33 == 5) + { + num34 = 1.3f; + num35 = 1.3f; + num36 = 1.3f; + } + else + { + if (num33 == 6) + { + num34 = 0.9f; + num35 = 0.9f; + num36 = 0f; + } + else + { + if (num33 == 7) + { + num34 = 0.5f * Main.demonTorch + 1f * (1f - Main.demonTorch); + num35 = 0.3f; + num36 = 1f * Main.demonTorch + 0.5f * (1f - Main.demonTorch); + } + } + } + } + } + } + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * num34, num32 * num35, num32 * num36); + } + else + { + if (Main.dust[i].type == 127) + { + num32 *= 1.3f; + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32, num32 * 0.45f, num32 * 0.2f); + } + else + { + if (Main.dust[i].type == 187) + { + num32 *= 1.3f; + if (num32 > 1f) + { + num32 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32 * 0.2f, num32 * 0.45f, num32); + } + else + { + if (num32 > 0.6f) + { + num32 = 0.6f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num32, num32 * 0.65f, num32 * 0.4f); + } + } + } + } + } + } + } + } + else + { + if (Main.dust[i].type == 159) + { + float num37 = Main.dust[i].scale * 1.3f; + if (num37 > 1f) + { + num37 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num37, num37, num37 * 0.1f); + if (Main.dust[i].noGravity) + { + if (Main.dust[i].scale < 0.7f) + { + Main.dust[i].velocity *= 1.075f; + } + else + { + if (Main.rand.Next(2) == 0) + { + Main.dust[i].velocity *= -0.95f; + } + else + { + Main.dust[i].velocity *= 1.05f; + } + } + Main.dust[i].scale -= 0.03f; + } + else + { + Main.dust[i].scale += 0.005f; + Main.dust[i].velocity *= 0.9f; + Dust expr_E82_cp_0 = Main.dust[i]; + expr_E82_cp_0.velocity.X = expr_E82_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.02f; + Dust expr_EAF_cp_0 = Main.dust[i]; + expr_EAF_cp_0.velocity.Y = expr_EAF_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.02f; + if (Main.rand.Next(5) == 0) + { + int num38 = Dust.NewDust(Main.dust[i].position, 4, 4, Main.dust[i].type, 0f, 0f, 0, default(Color), 1f); + Main.dust[num38].noGravity = true; + Main.dust[num38].scale = Main.dust[i].scale * 2.5f; + } + } + } + else + { + if (Main.dust[i].type == 164) + { + float num39 = Main.dust[i].scale; + if (num39 > 1f) + { + num39 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num39, num39 * 0.1f, num39 * 0.8f); + if (Main.dust[i].noGravity) + { + if (Main.dust[i].scale < 0.7f) + { + Main.dust[i].velocity *= 1.075f; + } + else + { + if (Main.rand.Next(2) == 0) + { + Main.dust[i].velocity *= -0.95f; + } + else + { + Main.dust[i].velocity *= 1.05f; + } + } + Main.dust[i].scale -= 0.03f; + } + else + { + Main.dust[i].scale -= 0.005f; + Main.dust[i].velocity *= 0.9f; + Dust expr_10AE_cp_0 = Main.dust[i]; + expr_10AE_cp_0.velocity.X = expr_10AE_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.02f; + Dust expr_10DB_cp_0 = Main.dust[i]; + expr_10DB_cp_0.velocity.Y = expr_10DB_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.02f; + if (Main.rand.Next(5) == 0) + { + int num40 = Dust.NewDust(Main.dust[i].position, 4, 4, Main.dust[i].type, 0f, 0f, 0, default(Color), 1f); + Main.dust[num40].noGravity = true; + Main.dust[num40].scale = Main.dust[i].scale * 2.5f; + } + } + } + else + { + if (Main.dust[i].type == 173) + { + float num41 = Main.dust[i].scale; + if (num41 > 1f) + { + num41 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num41 * 0.4f, num41 * 0.1f, num41); + if (Main.dust[i].noGravity) + { + Main.dust[i].velocity *= 0.8f; + Dust expr_122D_cp_0 = Main.dust[i]; + expr_122D_cp_0.velocity.X = expr_122D_cp_0.velocity.X + (float)Main.rand.Next(-20, 21) * 0.01f; + Dust expr_125A_cp_0 = Main.dust[i]; + expr_125A_cp_0.velocity.Y = expr_125A_cp_0.velocity.Y + (float)Main.rand.Next(-20, 21) * 0.01f; + Main.dust[i].scale -= 0.01f; + } + else + { + Main.dust[i].scale -= 0.015f; + Main.dust[i].velocity *= 0.8f; + Dust expr_12D8_cp_0 = Main.dust[i]; + expr_12D8_cp_0.velocity.X = expr_12D8_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.005f; + Dust expr_1305_cp_0 = Main.dust[i]; + expr_1305_cp_0.velocity.Y = expr_1305_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.005f; + if (Main.rand.Next(10) == 10) + { + int num42 = Dust.NewDust(Main.dust[i].position, 4, 4, Main.dust[i].type, 0f, 0f, 0, default(Color), 1f); + Main.dust[num42].noGravity = true; + Main.dust[num42].scale = Main.dust[i].scale; + } + } + } + else + { + if (Main.dust[i].type == 184) + { + if (!Main.dust[i].noGravity) + { + Main.dust[i].velocity *= 0f; + Main.dust[i].scale -= 0.01f; + } + } + else + { + if (Main.dust[i].type == 160 || Main.dust[i].type == 162) + { + float num43 = Main.dust[i].scale * 1.3f; + if (num43 > 1f) + { + num43 = 1f; + } + if (Main.dust[i].type == 162) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num43, num43 * 0.7f, num43 * 0.1f); + } + else + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num43 * 0.1f, num43, num43); + } + if (Main.dust[i].noGravity) + { + Main.dust[i].velocity *= 0.8f; + Dust expr_1520_cp_0 = Main.dust[i]; + expr_1520_cp_0.velocity.X = expr_1520_cp_0.velocity.X + (float)Main.rand.Next(-20, 21) * 0.04f; + Dust expr_154D_cp_0 = Main.dust[i]; + expr_154D_cp_0.velocity.Y = expr_154D_cp_0.velocity.Y + (float)Main.rand.Next(-20, 21) * 0.04f; + Main.dust[i].scale -= 0.1f; + } + else + { + Main.dust[i].scale -= 0.1f; + Dust expr_15AF_cp_0 = Main.dust[i]; + expr_15AF_cp_0.velocity.X = expr_15AF_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.02f; + Dust expr_15DC_cp_0 = Main.dust[i]; + expr_15DC_cp_0.velocity.Y = expr_15DC_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.02f; + if ((double)Main.dust[i].scale > 0.3 && Main.rand.Next(50) == 0) + { + int num44 = Dust.NewDust(new Vector2(Main.dust[i].position.X - 4f, Main.dust[i].position.Y - 4f), 1, 1, Main.dust[i].type, 0f, 0f, 0, default(Color), 1f); + Main.dust[num44].noGravity = true; + Main.dust[num44].scale = Main.dust[i].scale * 1.5f; + } + } + } + else + { + if (Main.dust[i].type == 168) + { + float num45 = Main.dust[i].scale * 0.8f; + if ((double)num45 > 0.55) + { + num45 = 0.55f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num45, 0f, num45 * 0.8f); + Main.dust[i].scale += 0.03f; + Dust expr_1764_cp_0 = Main.dust[i]; + expr_1764_cp_0.velocity.X = expr_1764_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.02f; + Dust expr_1791_cp_0 = Main.dust[i]; + expr_1791_cp_0.velocity.Y = expr_1791_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.02f; + Main.dust[i].velocity *= 0.99f; + } + else + { + if (Main.dust[i].type >= 139 && Main.dust[i].type < 143) + { + Dust expr_180B_cp_0 = Main.dust[i]; + expr_180B_cp_0.velocity.X = expr_180B_cp_0.velocity.X * 0.98f; + Dust expr_1828_cp_0 = Main.dust[i]; + expr_1828_cp_0.velocity.Y = expr_1828_cp_0.velocity.Y * 0.98f; + if (Main.dust[i].velocity.Y < 1f) + { + Dust expr_185D_cp_0 = Main.dust[i]; + expr_185D_cp_0.velocity.Y = expr_185D_cp_0.velocity.Y + 0.05f; + } + Main.dust[i].scale += 0.009f; + Main.dust[i].rotation -= Main.dust[i].velocity.X * 0.4f; + if (Main.dust[i].velocity.X > 0f) + { + Main.dust[i].rotation += 0.005f; + } + else + { + Main.dust[i].rotation -= 0.005f; + } + } + else + { + if (Main.dust[i].type == 14 || Main.dust[i].type == 16 || Main.dust[i].type == 31 || Main.dust[i].type == 46 || Main.dust[i].type == 124 || Main.dust[i].type == 186 || Main.dust[i].type == 188) + { + Dust expr_1987_cp_0 = Main.dust[i]; + expr_1987_cp_0.velocity.Y = expr_1987_cp_0.velocity.Y * 0.98f; + Dust expr_19A4_cp_0 = Main.dust[i]; + expr_19A4_cp_0.velocity.X = expr_19A4_cp_0.velocity.X * 0.98f; + if (Main.dust[i].type == 31 && Main.dust[i].noGravity) + { + Main.dust[i].velocity *= 1.02f; + Main.dust[i].scale += 0.02f; + Main.dust[i].alpha += 4; + if (Main.dust[i].alpha > 255) + { + Main.dust[i].scale = 0.0001f; + Main.dust[i].alpha = 255; + } + } + } + else + { + if (Main.dust[i].type == 32) + { + Main.dust[i].scale -= 0.01f; + Dust expr_1A92_cp_0 = Main.dust[i]; + expr_1A92_cp_0.velocity.X = expr_1A92_cp_0.velocity.X * 0.96f; + if (!Main.dust[i].noGravity) + { + Dust expr_1AC0_cp_0 = Main.dust[i]; + expr_1AC0_cp_0.velocity.Y = expr_1AC0_cp_0.velocity.Y + 0.1f; + } + } + else + { + if (Main.dust[i].type == 43) + { + Main.dust[i].rotation += 0.1f * Main.dust[i].scale; + Color color = Lighting.GetColor((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f)); + float num46 = (float)color.R / 270f; + float num47 = (float)color.G / 270f; + float num48 = (float)color.B / 270f; + float num49 = (float)(Main.dust[i].color.R / 255); + float num50 = (float)(Main.dust[i].color.G / 255); + float num51 = (float)(Main.dust[i].color.B / 255); + num46 *= Main.dust[i].scale * 1.07f * num49; + num47 *= Main.dust[i].scale * 1.07f * num50; + num48 *= Main.dust[i].scale * 1.07f * num51; + if (Main.dust[i].alpha < 255) + { + Main.dust[i].scale += 0.09f; + if (Main.dust[i].scale >= 1f) + { + Main.dust[i].scale = 1f; + Main.dust[i].alpha = 255; + } + } + else + { + if ((double)Main.dust[i].scale < 0.8) + { + Main.dust[i].scale -= 0.01f; + } + if ((double)Main.dust[i].scale < 0.5) + { + Main.dust[i].scale -= 0.01f; + } + } + if ((double)num46 < 0.05 && (double)num47 < 0.05 && (double)num48 < 0.05) + { + Main.dust[i].active = false; + } + else + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num46, num47, num48); + } + } + else + { + if (Main.dust[i].type == 15 || Main.dust[i].type == 57 || Main.dust[i].type == 58) + { + Dust expr_1D91_cp_0 = Main.dust[i]; + expr_1D91_cp_0.velocity.Y = expr_1D91_cp_0.velocity.Y * 0.98f; + Dust expr_1DAE_cp_0 = Main.dust[i]; + expr_1DAE_cp_0.velocity.X = expr_1DAE_cp_0.velocity.X * 0.98f; + float num52 = Main.dust[i].scale; + if (Main.dust[i].type != 15) + { + num52 = Main.dust[i].scale * 0.8f; + } + if (Main.dust[i].noLight) + { + Main.dust[i].velocity *= 0.95f; + } + if (num52 > 1f) + { + num52 = 1f; + } + if (Main.dust[i].type == 15) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num52 * 0.45f, num52 * 0.55f, num52); + } + else + { + if (Main.dust[i].type == 57) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num52 * 0.95f, num52 * 0.95f, num52 * 0.45f); + } + else + { + if (Main.dust[i].type == 58) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num52, num52 * 0.55f, num52 * 0.75f); + } + } + } + } + else + { + if (Main.dust[i].type == 110) + { + float num53 = Main.dust[i].scale * 0.1f; + if (num53 > 1f) + { + num53 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num53 * 0.2f, num53, num53 * 0.5f); + } + else + { + if (Main.dust[i].type == 111) + { + float num54 = Main.dust[i].scale * 0.125f; + if (num54 > 1f) + { + num54 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num54 * 0.2f, num54 * 0.7f, num54); + } + else + { + if (Main.dust[i].type == 112) + { + float num55 = Main.dust[i].scale * 0.1f; + if (num55 > 1f) + { + num55 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num55 * 0.8f, num55 * 0.2f, num55 * 0.8f); + } + else + { + if (Main.dust[i].type == 113) + { + float num56 = Main.dust[i].scale * 0.1f; + if (num56 > 1f) + { + num56 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num56 * 0.2f, num56 * 0.3f, num56 * 1.3f); + } + else + { + if (Main.dust[i].type == 114) + { + float num57 = Main.dust[i].scale * 0.1f; + if (num57 > 1f) + { + num57 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num57 * 1.2f, num57 * 0.5f, num57 * 0.4f); + } + else + { + if (Main.dust[i].type == 66) + { + if (Main.dust[i].velocity.X < 0f) + { + Main.dust[i].rotation -= 1f; + } + else + { + Main.dust[i].rotation += 1f; + } + Dust expr_2243_cp_0 = Main.dust[i]; + expr_2243_cp_0.velocity.Y = expr_2243_cp_0.velocity.Y * 0.98f; + Dust expr_2260_cp_0 = Main.dust[i]; + expr_2260_cp_0.velocity.X = expr_2260_cp_0.velocity.X * 0.98f; + Main.dust[i].scale += 0.02f; + float num58 = Main.dust[i].scale; + if (Main.dust[i].type != 15) + { + num58 = Main.dust[i].scale * 0.8f; + } + if (num58 > 1f) + { + num58 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num58 * ((float)Main.dust[i].color.R / 255f), num58 * ((float)Main.dust[i].color.G / 255f), num58 * ((float)Main.dust[i].color.B / 255f)); + } + else + { + if (Main.dust[i].type == 20 || Main.dust[i].type == 21) + { + Main.dust[i].scale += 0.005f; + Dust expr_239D_cp_0 = Main.dust[i]; + expr_239D_cp_0.velocity.Y = expr_239D_cp_0.velocity.Y * 0.94f; + Dust expr_23BA_cp_0 = Main.dust[i]; + expr_23BA_cp_0.velocity.X = expr_23BA_cp_0.velocity.X * 0.94f; + float num59 = Main.dust[i].scale * 0.8f; + if (num59 > 1f) + { + num59 = 1f; + } + if (Main.dust[i].type == 21) + { + num59 = Main.dust[i].scale * 0.4f; + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num59 * 0.8f, num59 * 0.3f, num59); + } + else + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num59 * 0.3f, num59 * 0.6f, num59); + } + } + else + { + if (Main.dust[i].type == 27 || Main.dust[i].type == 45) + { + Main.dust[i].velocity *= 0.94f; + Main.dust[i].scale += 0.002f; + float num60 = Main.dust[i].scale; + if (Main.dust[i].noLight) + { + num60 *= 0.1f; + Main.dust[i].scale -= 0.06f; + if (Main.dust[i].scale < 1f) + { + Main.dust[i].scale -= 0.06f; + } + if (Main.player[Main.myPlayer].wet) + { + Main.dust[i].position += Main.player[Main.myPlayer].velocity * 0.5f; + } + else + { + Main.dust[i].position += Main.player[Main.myPlayer].velocity; + } + } + if (num60 > 1f) + { + num60 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num60 * 0.6f, num60 * 0.2f, num60); + } + else + { + if (Main.dust[i].type == 55 || Main.dust[i].type == 56 || Main.dust[i].type == 73 || Main.dust[i].type == 74) + { + Main.dust[i].velocity *= 0.98f; + float num61 = Main.dust[i].scale * 0.8f; + if (Main.dust[i].type == 55) + { + if (num61 > 1f) + { + num61 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num61, num61, num61 * 0.6f); + } + else + { + if (Main.dust[i].type == 73) + { + if (num61 > 1f) + { + num61 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num61, num61 * 0.35f, num61 * 0.5f); + } + else + { + if (Main.dust[i].type == 74) + { + if (num61 > 1f) + { + num61 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num61 * 0.35f, num61, num61 * 0.5f); + } + else + { + num61 = Main.dust[i].scale * 1.2f; + if (num61 > 1f) + { + num61 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num61 * 0.35f, num61 * 0.5f, num61); + } + } + } + } + else + { + if (Main.dust[i].type == 71 || Main.dust[i].type == 72) + { + Main.dust[i].velocity *= 0.98f; + float num62 = Main.dust[i].scale; + if (num62 > 1f) + { + num62 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num62 * 0.2f, 0f, num62 * 0.1f); + } + else + { + if (Main.dust[i].type == 76) + { + int arg_292B_0 = (int)Main.dust[i].position.X / 16; + int arg_2941_0 = (int)Main.dust[i].position.Y / 16; + Main.snowDust++; + Main.dust[i].scale += 0.009f; + if (!Main.dust[i].noLight) + { + Main.dust[i].position += Main.player[Main.myPlayer].velocity * 0.2f; + } + } + else + { + if (!Main.dust[i].noGravity && Main.dust[i].type != 41 && Main.dust[i].type != 44) + { + if (Main.dust[i].type == 107) + { + Main.dust[i].velocity *= 0.9f; + } + else + { + Dust expr_2A12_cp_0 = Main.dust[i]; + expr_2A12_cp_0.velocity.Y = expr_2A12_cp_0.velocity.Y + 0.1f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.dust[i].type == 5 && Main.dust[i].noGravity) + { + Main.dust[i].scale -= 0.04f; + } + if (Main.dust[i].type == 33 || Main.dust[i].type == 52 || Main.dust[i].type == 98 || Main.dust[i].type == 99 || Main.dust[i].type == 100 || Main.dust[i].type == 101 || Main.dust[i].type == 102 || Main.dust[i].type == 103 || Main.dust[i].type == 104 || Main.dust[i].type == 105 || Main.dust[i].type == 123) + { + if (Main.dust[i].velocity.X == 0f) + { + if (Collision.SolidCollision(Main.dust[i].position, 2, 2)) + { + Main.dust[i].scale = 0f; + } + Main.dust[i].rotation += 0.5f; + Main.dust[i].scale -= 0.01f; + } + bool flag = Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y), 4, 4); + if (flag) + { + Main.dust[i].alpha += 20; + Main.dust[i].scale -= 0.1f; + } + Main.dust[i].alpha += 2; + Main.dust[i].scale -= 0.005f; + if (Main.dust[i].alpha > 255) + { + Main.dust[i].scale = 0f; + } + if (Main.dust[i].velocity.Y > 4f) + { + Main.dust[i].velocity.Y = 4f; + } + if (Main.dust[i].noGravity) + { + if (Main.dust[i].velocity.X < 0f) + { + Main.dust[i].rotation -= 0.2f; + } + else + { + Main.dust[i].rotation += 0.2f; + } + Main.dust[i].scale += 0.03f; + Dust expr_2CE0_cp_0 = Main.dust[i]; + expr_2CE0_cp_0.velocity.X = expr_2CE0_cp_0.velocity.X * 1.05f; + Dust expr_2CFD_cp_0 = Main.dust[i]; + expr_2CFD_cp_0.velocity.Y = expr_2CFD_cp_0.velocity.Y + 0.15f; + } + } + if (Main.dust[i].type == 35 && Main.dust[i].noGravity) + { + Main.dust[i].scale += 0.03f; + if (Main.dust[i].scale < 1f) + { + Dust expr_2D69_cp_0 = Main.dust[i]; + expr_2D69_cp_0.velocity.Y = expr_2D69_cp_0.velocity.Y + 0.075f; + } + Dust expr_2D86_cp_0 = Main.dust[i]; + expr_2D86_cp_0.velocity.X = expr_2D86_cp_0.velocity.X * 1.08f; + if (Main.dust[i].velocity.X > 0f) + { + Main.dust[i].rotation += 0.01f; + } + else + { + Main.dust[i].rotation -= 0.01f; + } + float num63 = Main.dust[i].scale * 0.6f; + if (num63 > 1f) + { + num63 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f + 1f), num63, num63 * 0.3f, num63 * 0.1f); + } + else + { + if (Main.dust[i].type == 152 && Main.dust[i].noGravity) + { + Main.dust[i].scale += 0.03f; + if (Main.dust[i].scale < 1f) + { + Dust expr_2EB5_cp_0 = Main.dust[i]; + expr_2EB5_cp_0.velocity.Y = expr_2EB5_cp_0.velocity.Y + 0.075f; + } + Dust expr_2ED2_cp_0 = Main.dust[i]; + expr_2ED2_cp_0.velocity.X = expr_2ED2_cp_0.velocity.X * 1.08f; + if (Main.dust[i].velocity.X > 0f) + { + Main.dust[i].rotation += 0.01f; + } + else + { + Main.dust[i].rotation -= 0.01f; + } + } + else + { + if (Main.dust[i].type == 67 || Main.dust[i].type == 92) + { + float num64 = Main.dust[i].scale; + if (num64 > 1f) + { + num64 = 1f; + } + if (Main.dust[i].noLight) + { + num64 *= 0.1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), 0f, num64 * 0.8f, num64); + } + else + { + if (Main.dust[i].type == 185) + { + float num65 = Main.dust[i].scale; + if (num65 > 1f) + { + num65 = 1f; + } + if (Main.dust[i].noLight) + { + num65 *= 0.1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num65 * 0.1f, num65 * 0.7f, num65); + } + else + { + if (Main.dust[i].type == 107) + { + float num66 = Main.dust[i].scale * 0.5f; + if (num66 > 1f) + { + num66 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num66 * 0.1f, num66, num66 * 0.4f); + } + else + { + if (Main.dust[i].type == 34 || Main.dust[i].type == 35 || Main.dust[i].type == 152) + { + if (!Collision.WetCollision(new Vector2(Main.dust[i].position.X, Main.dust[i].position.Y - 8f), 4, 4)) + { + Main.dust[i].scale = 0f; + } + else + { + Main.dust[i].alpha += Main.rand.Next(2); + if (Main.dust[i].alpha > 255) + { + Main.dust[i].scale = 0f; + } + Main.dust[i].velocity.Y = -0.5f; + if (Main.dust[i].type == 34) + { + Main.dust[i].scale += 0.005f; + } + else + { + Main.dust[i].alpha++; + Main.dust[i].scale -= 0.01f; + Main.dust[i].velocity.Y = -0.2f; + } + Dust expr_3242_cp_0 = Main.dust[i]; + expr_3242_cp_0.velocity.X = expr_3242_cp_0.velocity.X + (float)Main.rand.Next(-10, 10) * 0.002f; + if ((double)Main.dust[i].velocity.X < -0.25) + { + Main.dust[i].velocity.X = -0.25f; + } + if ((double)Main.dust[i].velocity.X > 0.25) + { + Main.dust[i].velocity.X = 0.25f; + } + } + if (Main.dust[i].type == 35) + { + float num67 = Main.dust[i].scale * 0.3f + 0.4f; + if (num67 > 1f) + { + num67 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num67, num67 * 0.5f, num67 * 0.3f); + } + } + } + } + } + } + } + if (Main.dust[i].type == 68) + { + float num68 = Main.dust[i].scale * 0.3f; + if (num68 > 1f) + { + num68 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num68 * 0.1f, num68 * 0.2f, num68); + } + if (Main.dust[i].type == 70) + { + float num69 = Main.dust[i].scale * 0.3f; + if (num69 > 1f) + { + num69 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num69 * 0.5f, 0f, num69); + } + if (Main.dust[i].type == 41) + { + Dust expr_345C_cp_0 = Main.dust[i]; + expr_345C_cp_0.velocity.X = expr_345C_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.01f; + Dust expr_3489_cp_0 = Main.dust[i]; + expr_3489_cp_0.velocity.Y = expr_3489_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.01f; + if ((double)Main.dust[i].velocity.X > 0.75) + { + Main.dust[i].velocity.X = 0.75f; + } + if ((double)Main.dust[i].velocity.X < -0.75) + { + Main.dust[i].velocity.X = -0.75f; + } + if ((double)Main.dust[i].velocity.Y > 0.75) + { + Main.dust[i].velocity.Y = 0.75f; + } + if ((double)Main.dust[i].velocity.Y < -0.75) + { + Main.dust[i].velocity.Y = -0.75f; + } + Main.dust[i].scale += 0.007f; + float num70 = Main.dust[i].scale * 0.7f; + if (num70 > 1f) + { + num70 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num70 * 0.4f, num70 * 0.9f, num70); + } + else + { + if (Main.dust[i].type == 44) + { + Dust expr_361D_cp_0 = Main.dust[i]; + expr_361D_cp_0.velocity.X = expr_361D_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.003f; + Dust expr_364A_cp_0 = Main.dust[i]; + expr_364A_cp_0.velocity.Y = expr_364A_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.003f; + if ((double)Main.dust[i].velocity.X > 0.35) + { + Main.dust[i].velocity.X = 0.35f; + } + if ((double)Main.dust[i].velocity.X < -0.35) + { + Main.dust[i].velocity.X = -0.35f; + } + if ((double)Main.dust[i].velocity.Y > 0.35) + { + Main.dust[i].velocity.Y = 0.35f; + } + if ((double)Main.dust[i].velocity.Y < -0.35) + { + Main.dust[i].velocity.Y = -0.35f; + } + Main.dust[i].scale += 0.0085f; + float num71 = Main.dust[i].scale * 0.7f; + if (num71 > 1f) + { + num71 = 1f; + } + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num71 * 0.7f, num71, num71 * 0.8f); + } + else + { + Dust expr_37C8_cp_0 = Main.dust[i]; + expr_37C8_cp_0.velocity.X = expr_37C8_cp_0.velocity.X * 0.99f; + } + } + if (Main.dust[i].type != 79) + { + Main.dust[i].rotation += Main.dust[i].velocity.X * 0.5f; + } + if (Main.dust[i].fadeIn > 0f) + { + if (Main.dust[i].type == 46) + { + Main.dust[i].scale += 0.1f; + } + else + { + Main.dust[i].scale += 0.03f; + } + if (Main.dust[i].scale > Main.dust[i].fadeIn) + { + Main.dust[i].fadeIn = 0f; + } + } + else + { + Main.dust[i].scale -= 0.01f; + } + if (Main.dust[i].type >= 130 && Main.dust[i].type <= 134) + { + float num72 = Main.dust[i].scale; + if (num72 > 1f) + { + num72 = 1f; + } + if (Main.dust[i].type == 130) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num72 * 1f, num72 * 0.5f, num72 * 0.4f); + } + if (Main.dust[i].type == 131) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num72 * 0.4f, num72 * 1f, num72 * 0.6f); + } + if (Main.dust[i].type == 132) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num72 * 0.3f, num72 * 0.5f, num72 * 1f); + } + if (Main.dust[i].type == 133) + { + Lighting.addLight((int)(Main.dust[i].position.X / 16f), (int)(Main.dust[i].position.Y / 16f), num72 * 0.9f, num72 * 0.9f, num72 * 0.3f); + } + if (Main.dust[i].noGravity) + { + Main.dust[i].velocity *= 0.93f; + if (Main.dust[i].fadeIn == 0f) + { + Main.dust[i].scale += 0.0025f; + } + } + else + { + if (Main.dust[i].type == 131) + { + Main.dust[i].velocity *= 0.98f; + Dust expr_3B0F_cp_0 = Main.dust[i]; + expr_3B0F_cp_0.velocity.Y = expr_3B0F_cp_0.velocity.Y - 0.1f; + Main.dust[i].scale += 0.0025f; + } + else + { + Main.dust[i].velocity *= 0.95f; + Main.dust[i].scale -= 0.0025f; + } + } + } + else + { + if (Main.dust[i].noGravity) + { + Main.dust[i].velocity *= 0.92f; + if (Main.dust[i].fadeIn == 0f) + { + Main.dust[i].scale -= 0.04f; + } + } + } + if (Main.dust[i].position.Y > Main.screenPosition.Y + (float)Main.screenHeight) + { + Main.dust[i].active = false; + } + float num73 = 0.1f; + if ((double)Dust.dCount == 0.5) + { + Main.dust[i].scale -= 0.001f; + } + if ((double)Dust.dCount == 0.6) + { + Main.dust[i].scale -= 0.0025f; + } + if ((double)Dust.dCount == 0.7) + { + Main.dust[i].scale -= 0.005f; + } + if ((double)Dust.dCount == 0.8) + { + Main.dust[i].scale -= 0.01f; + } + if ((double)Dust.dCount == 0.9) + { + Main.dust[i].scale -= 0.02f; + } + if ((double)Dust.dCount == 0.5) + { + num73 = 0.11f; + } + if ((double)Dust.dCount == 0.6) + { + num73 = 0.13f; + } + if ((double)Dust.dCount == 0.7) + { + num73 = 0.16f; + } + if ((double)Dust.dCount == 0.8) + { + num73 = 0.22f; + } + if ((double)Dust.dCount == 0.9) + { + num73 = 0.25f; + } + if (Main.dust[i].scale < num73) + { + Main.dust[i].active = false; + } + } + } + else + { + Main.dust[i].active = false; + } + } + int num74 = num; + if ((double)num74 > (double)Main.numDust * 0.9) + { + Dust.dCount = 0.9f; + return; + } + if ((double)num74 > (double)Main.numDust * 0.8) + { + Dust.dCount = 0.8f; + return; + } + if ((double)num74 > (double)Main.numDust * 0.7) + { + Dust.dCount = 0.7f; + return; + } + if ((double)num74 > (double)Main.numDust * 0.6) + { + Dust.dCount = 0.6f; + return; + } + if ((double)num74 > (double)Main.numDust * 0.5) + { + Dust.dCount = 0.5f; + return; + } + Dust.dCount = 0f; + } + public Color GetAlpha(Color newColor) + { + float num = (float)(255 - this.alpha) / 255f; + if (this.type >= 86 && this.type <= 91 && !this.noLight) + { + return new Color(255, 255, 255, 0); + } + if (this.type >= 110 && this.type <= 114) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 181) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 182) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 159) + { + return new Color(250, 250, 250, 50); + } + if (this.type == 163) + { + return new Color(250, 250, 250, 0); + } + if (this.type == 170) + { + return new Color(200, 200, 200, 100); + } + if (this.type == 180) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 175) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 183) + { + return new Color(50, 0, 0, 0); + } + if (this.type == 172) + { + return new Color(250, 250, 250, 150); + } + if (this.type == 160 || this.type == 162 || this.type == 164 || this.type == 173) + { + int num2 = (int)(250f * this.scale); + return new Color(num2, num2, num2, 0); + } + if (this.type == 92 || this.type == 106 || this.type == 107) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 185) + { + return new Color(200, 200, 255, 125); + } + if (this.type == 127 || this.type == 187) + { + return new Color((int)newColor.R, (int)newColor.G, (int)newColor.B, 25); + } + if (this.type == 156) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 6 || this.type == 174 || this.type == 135 || this.type == 75 || this.type == 20 || this.type == 21 || this.type == 169 || (this.type >= 130 && this.type <= 134) || this.type == 158) + { + return new Color((int)newColor.R, (int)newColor.G, (int)newColor.B, 25); + } + if ((this.type == 68 || this.type == 70) && this.noGravity) + { + return new Color(255, 255, 255, 0); + } + int num5; + int num4; + int num3; + if (this.type == 157) + { + num3 = (num4 = (num5 = 255)); + float num6 = (float)Main.mouseTextColor / 100f - 1.6f; + num4 = (int)((float)num4 * num6); + num3 = (int)((float)num3 * num6); + num5 = (int)((float)num5 * num6); + int a = (int)(100f * num6); + num4 += 50; + if (num4 > 255) + { + num4 = 255; + } + num3 += 50; + if (num3 > 255) + { + num3 = 255; + } + num5 += 50; + if (num5 > 255) + { + num5 = 255; + } + return new Color(num4, num3, num5, a); + } + if (this.type == 15 || this.type == 20 || this.type == 21 || this.type == 29 || this.type == 35 || this.type == 41 || this.type == 44 || this.type == 27 || this.type == 45 || this.type == 55 || this.type == 56 || this.type == 57 || this.type == 58 || this.type == 73 || this.type == 74) + { + num = (num + 3f) / 4f; + } + else + { + if (this.type == 43) + { + num = (num + 9f) / 10f; + } + else + { + if (this.type == 66) + { + return new Color((int)newColor.R, (int)newColor.G, (int)newColor.B, 0); + } + if (this.type == 71) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 72) + { + return new Color(200, 200, 200, 200); + } + } + } + num4 = (int)((float)newColor.R * num); + num3 = (int)((float)newColor.G * num); + num5 = (int)((float)newColor.B * num); + int num7 = (int)newColor.A - this.alpha; + if (num7 < 0) + { + num7 = 0; + } + if (num7 > 255) + { + num7 = 255; + } + return new Color(num4, num3, num5, num7); + } + public Color GetColor(Color newColor) + { + int num = (int)(this.color.R - (255 - newColor.R)); + int num2 = (int)(this.color.G - (255 - newColor.G)); + int num3 = (int)(this.color.B - (255 - newColor.B)); + int num4 = (int)(this.color.A - (255 - newColor.A)); + if (num < 0) + { + num = 0; + } + if (num > 255) + { + num = 255; + } + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + if (num3 < 0) + { + num3 = 0; + } + if (num3 > 255) + { + num3 = 255; + } + if (num4 < 0) + { + num4 = 0; + } + if (num4 > 255) + { + num4 = 255; + } + return new Color(num, num2, num3, num4); + } + } +} diff --git a/Terraria/Gore.cs b/Terraria/Gore.cs new file mode 100644 index 0000000..5503060 --- /dev/null +++ b/Terraria/Gore.cs @@ -0,0 +1,342 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Gore + { + public static int goreTime = 600; + public Vector2 position; + public Vector2 velocity; + public float rotation; + public float scale; + public int alpha; + public int type; + public float light; + public bool active; + public bool sticky = true; + public int timeLeft = Gore.goreTime; + public void Update() + { + if (Main.netMode == 2) + { + return; + } + if (this.active) + { + if (this.type >= 276 && this.type <= 282) + { + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + if (this.velocity.Y < this.scale) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + if ((double)this.velocity.Y > 0.1) + { + if (this.velocity.X > 0f) + { + this.rotation += 0.01f; + } + else + { + this.rotation -= 0.01f; + } + } + } + else + { + if (this.type == 11 || this.type == 12 || this.type == 13 || this.type == 61 || this.type == 62 || this.type == 63 || this.type == 99 || this.type == 220 || this.type == 221 || this.type == 222 || (this.type >= 375 && this.type <= 377) || (this.type >= 435 && this.type <= 437)) + { + this.velocity.Y = this.velocity.Y * 0.98f; + this.velocity.X = this.velocity.X * 0.98f; + this.scale -= 0.007f; + if ((double)this.scale < 0.1) + { + this.scale = 0.1f; + this.alpha = 255; + } + } + else + { + if (this.type == 16 || this.type == 17) + { + this.velocity.Y = this.velocity.Y * 0.98f; + this.velocity.X = this.velocity.X * 0.98f; + this.scale -= 0.01f; + if ((double)this.scale < 0.1) + { + this.scale = 0.1f; + this.alpha = 255; + } + } + else + { + if (this.type == 331) + { + this.alpha += 5; + this.velocity.Y = this.velocity.Y * 0.95f; + this.velocity.X = this.velocity.X * 0.95f; + this.rotation = this.velocity.X * 0.1f; + } + else + { + if (this.type < 411 || this.type > 430) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + } + } + } + this.rotation += this.velocity.X * 0.1f; + if (this.type >= 411 && this.type <= 430) + { + this.alpha = 50; + this.velocity.X = (this.velocity.X * 50f + Main.windSpeed * 2f + (float)Main.rand.Next(-10, 11) * 0.1f) / 51f; + this.velocity.Y = (this.velocity.Y * 50f + -0.25f + (float)Main.rand.Next(-10, 11) * 0.2f) / 51f; + this.rotation = this.velocity.X * 0.3f; + if (Main.goreLoaded[this.type]) + { + Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, (int)((float)Main.goreTexture[this.type].Width * this.scale), (int)((float)Main.goreTexture[this.type].Height * this.scale)); + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead) + { + Rectangle value = new Rectangle((int)Main.player[i].position.X, (int)Main.player[i].position.Y, Main.player[i].width, Main.player[i].height); + if (rectangle.Intersects(value)) + { + this.timeLeft = 0; + } + } + } + if (Collision.SolidCollision(this.position, (int)((float)Main.goreTexture[this.type].Width * this.scale), (int)((float)Main.goreTexture[this.type].Height * this.scale))) + { + this.timeLeft = 0; + } + } + if (this.timeLeft > 0) + { + if (Main.rand.Next(2) == 0) + { + this.timeLeft--; + } + if (Main.rand.Next(50) == 0) + { + this.timeLeft -= 5; + } + if (Main.rand.Next(100) == 0) + { + this.timeLeft -= 10; + } + } + else + { + this.alpha = 255; + if (Main.goreLoaded[this.type]) + { + float num = (float)Main.goreTexture[this.type].Width * this.scale * 0.8f; + float x = this.position.X; + float y = this.position.Y; + float num2 = (float)Main.goreTexture[this.type].Width * this.scale; + float num3 = (float)Main.goreTexture[this.type].Height * this.scale; + int num4 = 176; + if (this.type >= 416 && this.type <= 420) + { + num4 = 177; + } + if (this.type >= 421 && this.type <= 425) + { + num4 = 178; + } + if (this.type >= 426 && this.type <= 430) + { + num4 = 179; + } + int num5 = 0; + while ((float)num5 < num) + { + int num6 = Dust.NewDust(new Vector2(x, y), (int)num2, (int)num3, num4, 0f, 0f, 0, default(Color), 1f); + Main.dust[num6].noGravity = true; + Main.dust[num6].alpha = 100; + Main.dust[num6].scale = this.scale; + num5++; + } + } + } + } + else + { + if (this.sticky) + { + int num7 = 32; + if (Main.goreLoaded[this.type]) + { + num7 = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num7) + { + num7 = Main.goreTexture[this.type].Height; + } + } + num7 = (int)((float)num7 * 0.9f); + this.velocity = Collision.TileCollision(this.position, this.velocity, (int)((float)num7 * this.scale), (int)((float)num7 * this.scale), false, false); + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01) + { + this.velocity.X = 0f; + } + } + if (this.timeLeft > 0) + { + this.timeLeft--; + } + else + { + this.alpha++; + } + } + else + { + this.alpha += 2; + } + } + this.position += this.velocity; + if (this.alpha >= 255) + { + this.active = false; + } + if (this.light > 0f) + { + float num8 = this.light * this.scale; + float num9 = this.light * this.scale; + float num10 = this.light * this.scale; + if (this.type == 16) + { + num10 *= 0.3f; + num9 *= 0.8f; + } + else + { + if (this.type == 17) + { + num9 *= 0.6f; + num8 *= 0.3f; + } + } + if (Main.goreLoaded[this.type]) + { + Lighting.addLight((int)((this.position.X + (float)Main.goreTexture[this.type].Width * this.scale / 2f) / 16f), (int)((this.position.Y + (float)Main.goreTexture[this.type].Height * this.scale / 2f) / 16f), num8, num9, num10); + return; + } + Lighting.addLight((int)((this.position.X + 32f * this.scale / 2f) / 16f), (int)((this.position.Y + 32f * this.scale / 2f) / 16f), num8, num9, num10); + } + } + } + public static int NewGore(Vector2 Position, Vector2 Velocity, int Type, float Scale = 1f) + { + if (Main.rand == null) + { + Main.rand = new Random(); + } + if (Main.netMode == 2) + { + return 0; + } + int num = 500; + for (int i = 0; i < 500; i++) + { + if (!Main.gore[i].active) + { + num = i; + break; + } + } + if (num == 500) + { + return num; + } + Main.gore[num].light = 0f; + Main.gore[num].position = Position; + Main.gore[num].velocity = Velocity; + Gore expr_84_cp_0 = Main.gore[num]; + expr_84_cp_0.velocity.Y = expr_84_cp_0.velocity.Y - (float)Main.rand.Next(10, 31) * 0.1f; + Gore expr_B1_cp_0 = Main.gore[num]; + expr_B1_cp_0.velocity.X = expr_B1_cp_0.velocity.X + (float)Main.rand.Next(-20, 21) * 0.1f; + Main.gore[num].type = Type; + Main.gore[num].active = true; + Main.gore[num].alpha = 0; + Main.gore[num].rotation = 0f; + Main.gore[num].scale = Scale; + if (Gore.goreTime == 0 || Type == 11 || Type == 12 || Type == 13 || Type == 16 || Type == 17 || Type == 61 || Type == 62 || Type == 63 || Type == 99 || Type == 220 || Type == 221 || Type == 222 || Type == 435 || Type == 436 || Type == 437) + { + Main.gore[num].sticky = false; + } + else + { + if (Type >= 375 && Type <= 377) + { + Main.gore[num].sticky = false; + Main.gore[num].alpha = 100; + } + else + { + Main.gore[num].sticky = true; + Main.gore[num].timeLeft = Gore.goreTime; + } + } + if (Type == 16 || Type == 17) + { + Main.gore[num].alpha = 100; + Main.gore[num].scale = 0.7f; + Main.gore[num].light = 1f; + } + if (Type >= 411 && Type <= 430 && Main.goreLoaded[Type]) + { + Main.gore[num].position.X = Position.X - (float)(Main.goreTexture[Type].Width / 2) * Scale; + Main.gore[num].position.Y = Position.Y - (float)Main.goreTexture[Type].Height * Scale; + Gore expr_28F_cp_0 = Main.gore[num]; + expr_28F_cp_0.velocity.Y = expr_28F_cp_0.velocity.Y * ((float)Main.rand.Next(90, 150) * 0.01f); + Gore expr_2BF_cp_0 = Main.gore[num]; + expr_2BF_cp_0.velocity.X = expr_2BF_cp_0.velocity.X * ((float)Main.rand.Next(40, 90) * 0.01f); + int num2 = Main.rand.Next(4) * 5; + Main.gore[num].type += num2; + Main.gore[num].timeLeft = Main.rand.Next(Gore.goreTime / 2, Gore.goreTime * 2); + } + return num; + } + public Color GetAlpha(Color newColor) + { + float num = (float)(255 - this.alpha) / 255f; + int r; + int g; + int b; + if (this.type == 16 || this.type == 17) + { + r = (int)newColor.R; + g = (int)newColor.G; + b = (int)newColor.B; + } + else + { + if (this.type == 331) + { + return new Color(255, 255, 255, 50); + } + r = (int)((float)newColor.R * num); + g = (int)((float)newColor.G * num); + b = (int)((float)newColor.B * num); + } + int num2 = (int)newColor.A - this.alpha; + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + return new Color(r, g, b, num2); + } + } +} diff --git a/Terraria/Item.cs b/Terraria/Item.cs new file mode 100644 index 0000000..ecb979d --- /dev/null +++ b/Terraria/Item.cs @@ -0,0 +1,29064 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Item + { + public static int potionDelay = 3600; + public static int[] headType = new int[112]; + public static int[] bodyType = new int[75]; + public static int[] legType = new int[64]; + public bool flame; + public bool mech; + public bool wet; + public bool honeyWet; + public byte wetCount; + public bool lavaWet; + public Vector2 position; + public Vector2 velocity; + public int width; + public int height; + public bool active; + public int noGrabDelay; + public bool beingGrabbed; + public int spawnTime; + public int tileWand = -1; + public bool wornArmor; + public byte dye; + public byte paint; + public int ownIgnore = -1; + public int ownTime; + public int keepTime; + public int type; + public string name; + public int holdStyle; + public int useStyle; + public bool channel; + public bool accessory; + public int useAnimation; + public int useTime; + public int stack; + public int maxStack; + public int pick; + public int axe; + public int hammer; + public int tileBoost; + public int createTile = -1; + public int createWall = -1; + public int placeStyle; + public int damage; + public float knockBack; + public int healLife; + public int healMana; + public bool potion; + public bool consumable; + public bool autoReuse; + public bool useTurn; + public Color color; + public int alpha; + public float scale = 1f; + public int useSound; + public int defense; + public int headSlot = -1; + public int bodySlot = -1; + public int legSlot = -1; + public string toolTip; + public string toolTip2; + public int owner = 255; + public int rare; + public int shoot; + public float shootSpeed; + public int ammo; + public bool notAmmo; + public int useAmmo; + public int lifeRegen; + public int manaIncrease; + public bool buyOnce; + public int mana; + public bool noUseGraphic; + public bool noMelee; + public int release; + public int value; + public bool buy; + public bool social; + public bool vanity; + public bool material; + public bool noWet; + public int buffType; + public int buffTime; + public int netID; + public int crit; + public byte prefix; + public bool melee; + public bool magic; + public bool ranged; + public bool summon; + public int reuseDelay; + public bool Prefix(int pre) + { + if (pre == 0 || this.type == 0) + { + return false; + } + int num = pre; + float num2 = 1f; + float num3 = 1f; + float num4 = 1f; + float num5 = 1f; + float num6 = 1f; + float num7 = 1f; + int num8 = 0; + bool flag = true; + while (flag) + { + num2 = 1f; + num3 = 1f; + num4 = 1f; + num5 = 1f; + num6 = 1f; + num7 = 1f; + num8 = 0; + flag = false; + if (num == -1 && Main.rand.Next(4) == 0) + { + num = 0; + } + if (pre < -1) + { + num = -1; + } + if (num == -1 || num == -2 || num == -3) + { + if (this.type == 1 || this.type == 4 || this.type == 6 || this.type == 7 || this.type == 10 || this.type == 24 || this.type == 45 || this.type == 46 || this.type == 103 || this.type == 104 || this.type == 121 || this.type == 122 || this.type == 155 || this.type == 190 || this.type == 196 || this.type == 198 || this.type == 199 || this.type == 200 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 204 || this.type == 213 || this.type == 217 || this.type == 273 || this.type == 367 || this.type == 368 || this.type == 426 || this.type == 482 || this.type == 483 || this.type == 484 || this.type == 653 || this.type == 654 || this.type == 656 || this.type == 657 || this.type == 659 || this.type == 660 || this.type == 671 || this.type == 672 || this.type == 674 || this.type == 675 || this.type == 676 || this.type == 723 || this.type == 724 || this.type == 757 || this.type == 776 || this.type == 777 || this.type == 778 || this.type == 787 || this.type == 795 || this.type == 797 || this.type == 798 || this.type == 799 || this.type == 881 || this.type == 882 || this.type == 921 || this.type == 922 || this.type == 989 || this.type == 990 || this.type == 991 || this.type == 992 || this.type == 993 || this.type == 1123 || this.type == 1166 || this.type == 1185 || this.type == 1188 || this.type == 1192 || this.type == 1195 || this.type == 1199 || this.type == 1202 || this.type == 1222 || this.type == 1223 || this.type == 1224 || this.type == 1226 || this.type == 1227 || this.type == 1230 || this.type == 1233 || this.type == 1234 || this.type == 1294 || this.type == 1304 || this.type == 1305 || this.type == 1306 || this.type == 1320 || this.type == 1327 || this.type == 1506 || this.type == 1507) + { + int num9 = Main.rand.Next(40); + if (num9 == 0) + { + num = 1; + } + if (num9 == 1) + { + num = 2; + } + if (num9 == 2) + { + num = 3; + } + if (num9 == 3) + { + num = 4; + } + if (num9 == 4) + { + num = 5; + } + if (num9 == 5) + { + num = 6; + } + if (num9 == 6) + { + num = 7; + } + if (num9 == 7) + { + num = 8; + } + if (num9 == 8) + { + num = 9; + } + if (num9 == 9) + { + num = 10; + } + if (num9 == 10) + { + num = 11; + } + if (num9 == 11) + { + num = 12; + } + if (num9 == 12) + { + num = 13; + } + if (num9 == 13) + { + num = 14; + } + if (num9 == 14) + { + num = 15; + } + if (num9 == 15) + { + num = 36; + } + if (num9 == 16) + { + num = 37; + } + if (num9 == 17) + { + num = 38; + } + if (num9 == 18) + { + num = 53; + } + if (num9 == 19) + { + num = 54; + } + if (num9 == 20) + { + num = 55; + } + if (num9 == 21) + { + num = 39; + } + if (num9 == 22) + { + num = 40; + } + if (num9 == 23) + { + num = 56; + } + if (num9 == 24) + { + num = 41; + } + if (num9 == 25) + { + num = 57; + } + if (num9 == 26) + { + num = 42; + } + if (num9 == 27) + { + num = 43; + } + if (num9 == 28) + { + num = 44; + } + if (num9 == 29) + { + num = 45; + } + if (num9 == 30) + { + num = 46; + } + if (num9 == 31) + { + num = 47; + } + if (num9 == 32) + { + num = 48; + } + if (num9 == 33) + { + num = 49; + } + if (num9 == 34) + { + num = 50; + } + if (num9 == 35) + { + num = 51; + } + if (num9 == 36) + { + num = 59; + } + if (num9 == 37) + { + num = 60; + } + if (num9 == 38) + { + num = 61; + } + if (num9 == 39) + { + num = 81; + } + } + else + { + if (this.type == 162 || this.type == 160 || this.type == 163 || this.type == 220 || this.type == 274 || this.type == 277 || this.type == 280 || this.type == 383 || this.type == 384 || this.type == 385 || this.type == 386 || this.type == 387 || this.type == 388 || this.type == 389 || this.type == 390 || this.type == 406 || this.type == 537 || this.type == 550 || this.type == 579 || this.type == 756 || this.type == 759 || this.type == 801 || this.type == 802 || this.type == 1186 || this.type == 1189 || this.type == 1190 || this.type == 1193 || this.type == 1196 || this.type == 1197 || this.type == 1200 || this.type == 1203 || this.type == 1204 || this.type == 1228 || this.type == 1231 || this.type == 1232 || this.type == 1259 || this.type == 1262 || this.type == 1297 || this.type == 1314 || this.type == 1325) + { + int num10 = Main.rand.Next(14); + if (num10 == 0) + { + num = 36; + } + if (num10 == 1) + { + num = 37; + } + if (num10 == 2) + { + num = 38; + } + if (num10 == 3) + { + num = 53; + } + if (num10 == 4) + { + num = 54; + } + if (num10 == 5) + { + num = 55; + } + if (num10 == 6) + { + num = 39; + } + if (num10 == 7) + { + num = 40; + } + if (num10 == 8) + { + num = 56; + } + if (num10 == 9) + { + num = 41; + } + if (num10 == 10) + { + num = 57; + } + if (num10 == 11) + { + num = 59; + } + if (num10 == 12) + { + num = 60; + } + if (num10 == 13) + { + num = 61; + } + } + else + { + if (this.type == 39 || this.type == 44 || this.type == 95 || this.type == 96 || this.type == 98 || this.type == 99 || this.type == 120 || this.type == 164 || this.type == 197 || this.type == 219 || this.type == 266 || this.type == 281 || this.type == 434 || this.type == 435 || this.type == 436 || this.type == 481 || this.type == 506 || this.type == 533 || this.type == 534 || this.type == 578 || this.type == 655 || this.type == 658 || this.type == 661 || this.type == 679 || this.type == 682 || this.type == 725 || this.type == 758 || this.type == 759 || this.type == 760 || this.type == 796 || this.type == 800 || this.type == 905 || this.type == 964 || this.type == 986 || this.type == 1156 || this.type == 1187 || this.type == 1194 || this.type == 1201 || this.type == 1229 || this.type == 1254 || this.type == 1255 || this.type == 1258 || this.type == 1265 || this.type == 1319 || this.type == 1553) + { + int num11 = Main.rand.Next(36); + if (num11 == 0) + { + num = 16; + } + if (num11 == 1) + { + num = 17; + } + if (num11 == 2) + { + num = 18; + } + if (num11 == 3) + { + num = 19; + } + if (num11 == 4) + { + num = 20; + } + if (num11 == 5) + { + num = 21; + } + if (num11 == 6) + { + num = 22; + } + if (num11 == 7) + { + num = 23; + } + if (num11 == 8) + { + num = 24; + } + if (num11 == 9) + { + num = 25; + } + if (num11 == 10) + { + num = 58; + } + if (num11 == 11) + { + num = 36; + } + if (num11 == 12) + { + num = 37; + } + if (num11 == 13) + { + num = 38; + } + if (num11 == 14) + { + num = 53; + } + if (num11 == 15) + { + num = 54; + } + if (num11 == 16) + { + num = 55; + } + if (num11 == 17) + { + num = 39; + } + if (num11 == 18) + { + num = 40; + } + if (num11 == 19) + { + num = 56; + } + if (num11 == 20) + { + num = 41; + } + if (num11 == 21) + { + num = 57; + } + if (num11 == 22) + { + num = 42; + } + if (num11 == 23) + { + num = 43; + } + if (num11 == 24) + { + num = 44; + } + if (num11 == 25) + { + num = 45; + } + if (num11 == 26) + { + num = 46; + } + if (num11 == 27) + { + num = 47; + } + if (num11 == 28) + { + num = 48; + } + if (num11 == 29) + { + num = 49; + } + if (num11 == 30) + { + num = 50; + } + if (num11 == 31) + { + num = 51; + } + if (num11 == 32) + { + num = 59; + } + if (num11 == 33) + { + num = 60; + } + if (num11 == 34) + { + num = 61; + } + if (num11 == 35) + { + num = 82; + } + } + else + { + if (this.type == 64 || this.type == 65 || this.type == 112 || this.type == 113 || this.type == 127 || this.type == 157 || this.type == 165 || this.type == 218 || this.type == 272 || this.type == 494 || this.type == 495 || this.type == 496 || this.type == 514 || this.type == 517 || this.type == 518 || this.type == 519 || this.type == 683 || this.type == 726 || this.type == 739 || this.type == 740 || this.type == 741 || this.type == 742 || this.type == 743 || this.type == 744 || this.type == 788 || this.type == 1121 || this.type == 1155 || this.type == 1157 || this.type == 1178 || this.type == 1244 || this.type == 1256 || this.type == 1260 || this.type == 1264 || this.type == 1266 || this.type == 1295 || this.type == 1296 || this.type == 1308 || this.type == 1309 || this.type == 1313 || this.type == 1336 || this.type == 1444 || this.type == 1445 || this.type == 1446 || this.type == 1572) + { + int num12 = Main.rand.Next(36); + if (num12 == 0) + { + num = 26; + } + if (num12 == 1) + { + num = 27; + } + if (num12 == 2) + { + num = 28; + } + if (num12 == 3) + { + num = 29; + } + if (num12 == 4) + { + num = 30; + } + if (num12 == 5) + { + num = 31; + } + if (num12 == 6) + { + num = 32; + } + if (num12 == 7) + { + num = 33; + } + if (num12 == 8) + { + num = 34; + } + if (num12 == 9) + { + num = 35; + } + if (num12 == 10) + { + num = 52; + } + if (num12 == 11) + { + num = 36; + } + if (num12 == 12) + { + num = 37; + } + if (num12 == 13) + { + num = 38; + } + if (num12 == 14) + { + num = 53; + } + if (num12 == 15) + { + num = 54; + } + if (num12 == 16) + { + num = 55; + } + if (num12 == 17) + { + num = 39; + } + if (num12 == 18) + { + num = 40; + } + if (num12 == 19) + { + num = 56; + } + if (num12 == 20) + { + num = 41; + } + if (num12 == 21) + { + num = 57; + } + if (num12 == 22) + { + num = 42; + } + if (num12 == 23) + { + num = 43; + } + if (num12 == 24) + { + num = 44; + } + if (num12 == 25) + { + num = 45; + } + if (num12 == 26) + { + num = 46; + } + if (num12 == 27) + { + num = 47; + } + if (num12 == 28) + { + num = 48; + } + if (num12 == 29) + { + num = 49; + } + if (num12 == 30) + { + num = 50; + } + if (num12 == 31) + { + num = 51; + } + if (num12 == 32) + { + num = 59; + } + if (num12 == 33) + { + num = 60; + } + if (num12 == 34) + { + num = 61; + } + if (num12 == 35) + { + num = 83; + } + } + else + { + if (this.type == 55 || this.type == 119 || this.type == 191 || this.type == 284 || this.type == 670 || this.type == 1122 || this.type == 1513 || this.type == 1569 || this.type == 1571) + { + int num13 = Main.rand.Next(14); + if (num13 == 0) + { + num = 36; + } + if (num13 == 1) + { + num = 37; + } + if (num13 == 2) + { + num = 38; + } + if (num13 == 3) + { + num = 53; + } + if (num13 == 4) + { + num = 54; + } + if (num13 == 5) + { + num = 55; + } + if (num13 == 6) + { + num = 39; + } + if (num13 == 7) + { + num = 40; + } + if (num13 == 8) + { + num = 56; + } + if (num13 == 9) + { + num = 41; + } + if (num13 == 10) + { + num = 57; + } + if (num13 == 11) + { + num = 59; + } + if (num13 == 12) + { + num = 60; + } + if (num13 == 13) + { + num = 61; + } + } + else + { + if (!this.accessory || this.type == 267 || this.type == 562 || this.type == 563 || this.type == 564 || this.type == 565 || this.type == 566 || this.type == 567 || this.type == 568 || this.type == 569 || this.type == 570 || this.type == 571 || this.type == 572 || this.type == 573 || this.type == 574 || this.type == 576 || this.type == 1307) + { + return false; + } + num = Main.rand.Next(62, 81); + } + } + } + } + } + } + if (pre == -3) + { + return true; + } + if (pre == -1 && (num == 7 || num == 8 || num == 9 || num == 10 || num == 11 || num == 22 || num == 23 || num == 24 || num == 29 || num == 30 || num == 31 || num == 39 || num == 40 || num == 56 || num == 41 || num == 47 || num == 48 || num == 49) && Main.rand.Next(3) != 0) + { + num = 0; + } + if (num == 1) + { + num5 = 1.12f; + } + else + { + if (num == 2) + { + num5 = 1.18f; + } + else + { + if (num == 3) + { + num2 = 1.05f; + num8 = 2; + num5 = 1.05f; + } + else + { + if (num == 4) + { + num2 = 1.1f; + num5 = 1.1f; + num3 = 1.1f; + } + else + { + if (num == 5) + { + num2 = 1.15f; + } + else + { + if (num == 6) + { + num2 = 1.1f; + } + else + { + if (num == 81) + { + num3 = 1.15f; + num2 = 1.15f; + num8 = 5; + num4 = 0.9f; + num5 = 1.1f; + } + else + { + if (num == 7) + { + num5 = 0.82f; + } + else + { + if (num == 8) + { + num3 = 0.85f; + num2 = 0.85f; + num5 = 0.87f; + } + else + { + if (num == 9) + { + num5 = 0.9f; + } + else + { + if (num == 10) + { + num2 = 0.85f; + } + else + { + if (num == 11) + { + num4 = 1.1f; + num3 = 0.9f; + num5 = 0.9f; + } + else + { + if (num == 12) + { + num3 = 1.1f; + num2 = 1.05f; + num5 = 1.1f; + num4 = 1.15f; + } + else + { + if (num == 13) + { + num3 = 0.8f; + num2 = 0.9f; + num5 = 1.1f; + } + else + { + if (num == 14) + { + num3 = 1.15f; + num4 = 1.1f; + } + else + { + if (num == 15) + { + num3 = 0.9f; + num4 = 0.85f; + } + else + { + if (num == 16) + { + num2 = 1.1f; + num8 = 3; + } + else + { + if (num == 17) + { + num4 = 0.85f; + num6 = 1.1f; + } + else + { + if (num == 18) + { + num4 = 0.9f; + num6 = 1.15f; + } + else + { + if (num == 19) + { + num3 = 1.15f; + num6 = 1.05f; + } + else + { + if (num == 20) + { + num3 = 1.05f; + num6 = 1.05f; + num2 = 1.1f; + num4 = 0.95f; + num8 = 2; + } + else + { + if (num == 21) + { + num3 = 1.15f; + num2 = 1.1f; + } + else + { + if (num == 82) + { + num3 = 1.15f; + num2 = 1.15f; + num8 = 5; + num4 = 0.9f; + num6 = 1.1f; + } + else + { + if (num == 22) + { + num3 = 0.9f; + num6 = 0.9f; + num2 = 0.85f; + } + else + { + if (num == 23) + { + num4 = 1.15f; + num6 = 0.9f; + } + else + { + if (num == 24) + { + num4 = 1.1f; + num3 = 0.8f; + } + else + { + if (num == 25) + { + num4 = 1.1f; + num2 = 1.15f; + num8 = 1; + } + else + { + if (num == 58) + { + num4 = 0.85f; + num2 = 0.85f; + } + else + { + if (num == 26) + { + num7 = 0.85f; + num2 = 1.1f; + } + else + { + if (num == 27) + { + num7 = 0.85f; + } + else + { + if (num == 28) + { + num7 = 0.85f; + num2 = 1.15f; + num3 = 1.05f; + } + else + { + if (num == 83) + { + num3 = 1.15f; + num2 = 1.15f; + num8 = 5; + num4 = 0.9f; + num7 = 0.9f; + } + else + { + if (num == 29) + { + num7 = 1.1f; + } + else + { + if (num == 30) + { + num7 = 1.2f; + num2 = 0.9f; + } + else + { + if (num == 31) + { + num3 = 0.9f; + num2 = 0.9f; + } + else + { + if (num == 32) + { + num7 = 1.15f; + num2 = 1.1f; + } + else + { + if (num == 33) + { + num7 = 1.1f; + num3 = 1.1f; + num4 = 0.9f; + } + else + { + if (num == 34) + { + num7 = 0.9f; + num3 = 1.1f; + num4 = 1.1f; + num2 = 1.1f; + } + else + { + if (num == 35) + { + num7 = 1.2f; + num2 = 1.15f; + num3 = 1.15f; + } + else + { + if (num == 52) + { + num7 = 0.9f; + num2 = 0.9f; + num4 = 0.9f; + } + else + { + if (num == 36) + { + num8 = 3; + } + else + { + if (num == 37) + { + num2 = 1.1f; + num8 = 3; + num3 = 1.1f; + } + else + { + if (num == 38) + { + num3 = 1.15f; + } + else + { + if (num == 53) + { + num2 = 1.1f; + } + else + { + if (num == 54) + { + num3 = 1.15f; + } + else + { + if (num == 55) + { + num3 = 1.15f; + num2 = 1.05f; + } + else + { + if (num == 59) + { + num3 = 1.15f; + num2 = 1.15f; + num8 = 5; + } + else + { + if (num == 60) + { + num2 = 1.15f; + num8 = 5; + } + else + { + if (num == 61) + { + num8 = 5; + } + else + { + if (num == 39) + { + num2 = 0.7f; + num3 = 0.8f; + } + else + { + if (num == 40) + { + num2 = 0.85f; + } + else + { + if (num == 56) + { + num3 = 0.8f; + } + else + { + if (num == 41) + { + num3 = 0.85f; + num2 = 0.9f; + } + else + { + if (num == 57) + { + num3 = 0.9f; + num2 = 1.18f; + } + else + { + if (num == 42) + { + num4 = 0.9f; + } + else + { + if (num == 43) + { + num2 = 1.1f; + num4 = 0.9f; + } + else + { + if (num == 44) + { + num4 = 0.9f; + num8 = 3; + } + else + { + if (num == 45) + { + num4 = 0.95f; + } + else + { + if (num == 46) + { + num8 = 3; + num4 = 0.94f; + num2 = 1.07f; + } + else + { + if (num == 47) + { + num4 = 1.15f; + } + else + { + if (num == 48) + { + num4 = 1.2f; + } + else + { + if (num == 49) + { + num4 = 1.08f; + } + else + { + if (num == 50) + { + num2 = 0.8f; + num4 = 1.15f; + } + else + { + if (num == 51) + { + num3 = 0.9f; + num4 = 0.9f; + num2 = 1.05f; + num8 = 2; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (num2 != 1f && Math.Round((double)((float)this.damage * num2)) == (double)this.damage) + { + flag = true; + num = -1; + } + if (num4 != 1f && Math.Round((double)((float)this.useAnimation * num4)) == (double)this.useAnimation) + { + flag = true; + num = -1; + } + if (num7 != 1f && Math.Round((double)((float)this.mana * num7)) == (double)this.mana) + { + flag = true; + num = -1; + } + if (num3 != 1f && this.knockBack == 0f) + { + flag = true; + num = -1; + } + if (pre == -2 && num == 0) + { + num = -1; + flag = true; + } + } + this.damage = (int)Math.Round((double)((float)this.damage * num2)); + this.useAnimation = (int)Math.Round((double)((float)this.useAnimation * num4)); + this.useTime = (int)Math.Round((double)((float)this.useTime * num4)); + this.reuseDelay = (int)Math.Round((double)((float)this.reuseDelay * num4)); + this.mana = (int)Math.Round((double)((float)this.mana * num7)); + this.knockBack *= num3; + this.scale *= num5; + this.shootSpeed *= num6; + this.crit += num8; + float num14 = 1f * num2 * (2f - num4) * (2f - num7) * num5 * num3 * num6 * (1f + (float)this.crit * 0.02f); + if (num == 62 || num == 69 || num == 73 || num == 77) + { + num14 *= 1.05f; + } + if (num == 63 || num == 70 || num == 74 || num == 78 || num == 67) + { + num14 *= 1.1f; + } + if (num == 64 || num == 71 || num == 75 || num == 79 || num == 66) + { + num14 *= 1.15f; + } + if (num == 65 || num == 72 || num == 76 || num == 80 || num == 68) + { + num14 *= 1.2f; + } + if ((double)num14 >= 1.2) + { + this.rare += 2; + } + else + { + if ((double)num14 >= 1.05) + { + this.rare++; + } + else + { + if ((double)num14 <= 0.8) + { + this.rare -= 2; + } + else + { + if ((double)num14 <= 0.95) + { + this.rare--; + } + } + } + } + if (this.rare < -1) + { + this.rare = -1; + } + if (this.rare > 9) + { + this.rare = 9; + } + num14 *= num14; + this.value = (int)((float)this.value * num14); + this.prefix = (byte)num; + return true; + } + public string AffixName() + { + string text = ""; + if (Lang.lang <= 1) + { + if (this.prefix == 1) + { + text = "Large"; + } + if (this.prefix == 2) + { + text = "Massive"; + } + if (this.prefix == 3) + { + text = "Dangerous"; + } + if (this.prefix == 4) + { + text = "Savage"; + } + if (this.prefix == 5) + { + text = "Sharp"; + } + if (this.prefix == 6) + { + text = "Pointy"; + } + if (this.prefix == 7) + { + text = "Tiny"; + } + if (this.prefix == 8) + { + text = "Terrible"; + } + if (this.prefix == 9) + { + text = "Small"; + } + if (this.prefix == 10) + { + text = "Dull"; + } + if (this.prefix == 11) + { + text = "Unhappy"; + } + if (this.prefix == 12) + { + text = "Bulky"; + } + if (this.prefix == 13) + { + text = "Shameful"; + } + if (this.prefix == 14) + { + text = "Heavy"; + } + if (this.prefix == 15) + { + text = "Light"; + } + if (this.prefix == 16) + { + text = "Sighted"; + } + if (this.prefix == 17) + { + text = "Rapid"; + } + if (this.prefix == 18) + { + text = "Hasty"; + } + if (this.prefix == 19) + { + text = "Intimidating"; + } + if (this.prefix == 20) + { + text = "Deadly"; + } + if (this.prefix == 21) + { + text = "Staunch"; + } + if (this.prefix == 22) + { + text = "Awful"; + } + if (this.prefix == 23) + { + text = "Lethargic"; + } + if (this.prefix == 24) + { + text = "Awkward"; + } + if (this.prefix == 25) + { + text = "Powerful"; + } + if (this.prefix == 58) + { + text = "Frenzying"; + } + if (this.prefix == 26) + { + text = "Mystic"; + } + if (this.prefix == 27) + { + text = "Adept"; + } + if (this.prefix == 28) + { + text = "Masterful"; + } + if (this.prefix == 29) + { + text = "Inept"; + } + if (this.prefix == 30) + { + text = "Ignorant"; + } + if (this.prefix == 31) + { + text = "Deranged"; + } + if (this.prefix == 32) + { + text = "Intense"; + } + if (this.prefix == 33) + { + text = "Taboo"; + } + if (this.prefix == 34) + { + text = "Celestial"; + } + if (this.prefix == 35) + { + text = "Furious"; + } + if (this.prefix == 52) + { + text = "Manic"; + } + if (this.prefix == 36) + { + text = "Keen"; + } + if (this.prefix == 37) + { + text = "Superior"; + } + if (this.prefix == 38) + { + text = "Forceful"; + } + if (this.prefix == 53) + { + text = "Hurtful"; + } + if (this.prefix == 54) + { + text = "Strong"; + } + if (this.prefix == 55) + { + text = "Unpleasant"; + } + if (this.prefix == 39) + { + text = "Broken"; + } + if (this.prefix == 40) + { + text = "Damaged"; + } + if (this.prefix == 56) + { + text = "Weak"; + } + if (this.prefix == 41) + { + text = "Shoddy"; + } + if (this.prefix == 57) + { + text = "Ruthless"; + } + if (this.prefix == 42) + { + text = "Quick"; + } + if (this.prefix == 43) + { + text = "Deadly"; + } + if (this.prefix == 44) + { + text = "Agile"; + } + if (this.prefix == 45) + { + text = "Nimble"; + } + if (this.prefix == 46) + { + text = "Murderous"; + } + if (this.prefix == 47) + { + text = "Slow"; + } + if (this.prefix == 48) + { + text = "Sluggish"; + } + if (this.prefix == 49) + { + text = "Lazy"; + } + if (this.prefix == 50) + { + text = "Annoying"; + } + if (this.prefix == 51) + { + text = "Nasty"; + } + if (this.prefix == 59) + { + text = "Godly"; + } + if (this.prefix == 60) + { + text = "Demonic"; + } + if (this.prefix == 61) + { + text = "Zealous"; + } + if (this.prefix == 62) + { + text = "Hard"; + } + if (this.prefix == 63) + { + text = "Guarding"; + } + if (this.prefix == 64) + { + text = "Armored"; + } + if (this.prefix == 65) + { + text = "Warding"; + } + if (this.prefix == 66) + { + text = "Arcane"; + } + if (this.prefix == 67) + { + text = "Precise"; + } + if (this.prefix == 68) + { + text = "Lucky"; + } + if (this.prefix == 69) + { + text = "Jagged"; + } + if (this.prefix == 70) + { + text = "Spiked"; + } + if (this.prefix == 71) + { + text = "Angry"; + } + if (this.prefix == 72) + { + text = "Menacing"; + } + if (this.prefix == 73) + { + text = "Brisk"; + } + if (this.prefix == 74) + { + text = "Fleeting"; + } + if (this.prefix == 75) + { + text = "Hasty"; + } + if (this.prefix == 76) + { + text = "Quick"; + } + if (this.prefix == 77) + { + text = "Wild"; + } + if (this.prefix == 78) + { + text = "Rash"; + } + if (this.prefix == 79) + { + text = "Intrepid"; + } + if (this.prefix == 80) + { + text = "Violent"; + } + if (this.prefix == 81) + { + text = "Legendary"; + } + if (this.prefix == 82) + { + text = "Unreal"; + } + if (this.prefix == 83) + { + text = "Mythical"; + } + } + else + { + if (Lang.lang == 2) + { + if (this.prefix == 1) + { + text = "Gross"; + } + if (this.prefix == 2) + { + text = "Massiv"; + } + if (this.prefix == 3) + { + text = "Gefährlich"; + } + if (this.prefix == 4) + { + text = "Barbarisch"; + } + if (this.prefix == 5) + { + text = "Scharf"; + } + if (this.prefix == 6) + { + text = "Spitze"; + } + if (this.prefix == 7) + { + text = "Winzig"; + } + if (this.prefix == 8) + { + text = "Schrecklicher"; + } + if (this.prefix == 9) + { + text = "Klein"; + } + if (this.prefix == 10) + { + text = "Stumpf"; + } + if (this.prefix == 11) + { + text = "Unglücklich"; + } + if (this.prefix == 12) + { + text = "Sperrig"; + } + if (this.prefix == 13) + { + text = "Beschämend"; + } + if (this.prefix == 14) + { + text = "Schwer"; + } + if (this.prefix == 15) + { + text = "Locker"; + } + if (this.prefix == 16) + { + text = "Gesichtet"; + } + if (this.prefix == 17) + { + text = "Schnell"; + } + if (this.prefix == 18) + { + text = "Hastig"; + } + if (this.prefix == 19) + { + text = "Einschüchternd"; + } + if (this.prefix == 20) + { + text = "Tödlich"; + } + if (this.prefix == 21) + { + text = "Stillen"; + } + if (this.prefix == 22) + { + text = "Schrecklich"; + } + if (this.prefix == 23) + { + text = "Lethargisch"; + } + if (this.prefix == 24) + { + text = "Unbeholfen"; + } + if (this.prefix == 25) + { + text = "Mächtig"; + } + if (this.prefix == 26) + { + text = "Mystisch"; + } + if (this.prefix == 27) + { + text = "Geschickt"; + } + if (this.prefix == 28) + { + text = "Meisterhaft"; + } + if (this.prefix == 29) + { + text = "Ungeschickt"; + } + if (this.prefix == 30) + { + text = "Unwissend"; + } + if (this.prefix == 31) + { + text = "Gestört"; + } + if (this.prefix == 32) + { + text = "Intensiv"; + } + if (this.prefix == 33) + { + text = "Tabu"; + } + if (this.prefix == 34) + { + text = "Himmlisch"; + } + if (this.prefix == 35) + { + text = "Wütend"; + } + if (this.prefix == 36) + { + text = "Scharf"; + } + if (this.prefix == 37) + { + text = "Überlegen"; + } + if (this.prefix == 38) + { + text = "Kraftvoll"; + } + if (this.prefix == 39) + { + text = "Gebrochen"; + } + if (this.prefix == 40) + { + text = "Beschädigt"; + } + if (this.prefix == 41) + { + text = "Schäbig"; + } + if (this.prefix == 42) + { + text = "Rasch"; + } + if (this.prefix == 43) + { + text = "Tödlich"; + } + if (this.prefix == 44) + { + text = "Agil"; + } + if (this.prefix == 45) + { + text = "Wendig"; + } + if (this.prefix == 46) + { + text = "Mörderisch"; + } + if (this.prefix == 47) + { + text = "Langsam"; + } + if (this.prefix == 48) + { + text = "Träge"; + } + if (this.prefix == 49) + { + text = "Faul"; + } + if (this.prefix == 50) + { + text = "Lästig"; + } + if (this.prefix == 51) + { + text = "Böse"; + } + if (this.prefix == 52) + { + text = "Manisch"; + } + if (this.prefix == 53) + { + text = "Verletzend"; + } + if (this.prefix == 54) + { + text = "Stark"; + } + if (this.prefix == 55) + { + text = "Unangenehm"; + } + if (this.prefix == 56) + { + text = "Schwach"; + } + if (this.prefix == 57) + { + text = "Rücksichtslos"; + } + if (this.prefix == 58) + { + text = "Rasend"; + } + if (this.prefix == 59) + { + text = "Fromm"; + } + if (this.prefix == 60) + { + text = "Dämonisch"; + } + if (this.prefix == 61) + { + text = "Eifrig"; + } + if (this.prefix == 62) + { + text = "Schwer"; + } + if (this.prefix == 63) + { + text = "Schutz-"; + } + if (this.prefix == 64) + { + text = "Gepanzert"; + } + if (this.prefix == 65) + { + text = "Defensiv"; + } + if (this.prefix == 66) + { + text = "Geheimnisvoll"; + } + if (this.prefix == 67) + { + text = "Präzise"; + } + if (this.prefix == 68) + { + text = "Glücklich"; + } + if (this.prefix == 69) + { + text = "Gezackt"; + } + if (this.prefix == 70) + { + text = "Spike"; + } + if (this.prefix == 71) + { + text = "Wütend"; + } + if (this.prefix == 72) + { + text = "Bedrohlich"; + } + if (this.prefix == 73) + { + text = "Rege"; + } + if (this.prefix == 74) + { + text = "Flüchtig"; + } + if (this.prefix == 75) + { + text = "Hastig"; + } + if (this.prefix == 76) + { + text = "Rasch"; + } + if (this.prefix == 77) + { + text = "Wild"; + } + if (this.prefix == 78) + { + text = "Voreilig"; + } + if (this.prefix == 79) + { + text = "Unerschrocken"; + } + if (this.prefix == 80) + { + text = "Gewalttätig"; + } + if (this.prefix == 81) + { + text = "Legendär"; + } + if (this.prefix == 82) + { + text = "Unwirklich"; + } + if (this.prefix == 83) + { + text = "Mythisch"; + } + } + else + { + if (Lang.lang == 3) + { + if (this.prefix == 1) + { + text = "Grande"; + } + if (this.prefix == 2) + { + text = "Massiccio"; + } + if (this.prefix == 3) + { + text = "Pericoloso"; + } + if (this.prefix == 4) + { + text = "Selvaggio"; + } + if (this.prefix == 5) + { + text = "Appuntito"; + } + if (this.prefix == 6) + { + text = "Tagliente"; + } + if (this.prefix == 7) + { + text = "Minuto"; + } + if (this.prefix == 8) + { + text = "Terribile"; + } + if (this.prefix == 9) + { + text = "Piccolo"; + } + if (this.prefix == 10) + { + text = "Opaco"; + } + if (this.prefix == 11) + { + text = "Infelice"; + } + if (this.prefix == 12) + { + text = "Ingombrante"; + } + if (this.prefix == 13) + { + text = "Vergognoso"; + } + if (this.prefix == 14) + { + text = "Pesante"; + } + if (this.prefix == 15) + { + text = "Luce"; + } + if (this.prefix == 16) + { + text = "Avvistato"; + } + if (this.prefix == 17) + { + text = "Rapido"; + } + if (this.prefix == 18) + { + text = "Frettoloso"; + } + if (this.prefix == 19) + { + text = "Intimidatorio"; + } + if (this.prefix == 20) + { + text = "Mortale"; + } + if (this.prefix == 21) + { + text = "Convinto"; + } + if (this.prefix == 22) + { + text = "Orribile"; + } + if (this.prefix == 23) + { + text = "Letargico"; + } + if (this.prefix == 24) + { + text = "Scomodo"; + } + if (this.prefix == 25) + { + text = "Potente"; + } + if (this.prefix == 26) + { + text = "Mistico"; + } + if (this.prefix == 27) + { + text = "Esperto"; + } + if (this.prefix == 28) + { + text = "Magistrale"; + } + if (this.prefix == 29) + { + text = "Inetto"; + } + if (this.prefix == 30) + { + text = "Ignorante"; + } + if (this.prefix == 31) + { + text = "Squilibrato"; + } + if (this.prefix == 32) + { + text = "Intenso"; + } + if (this.prefix == 33) + { + text = "Tabù"; + } + if (this.prefix == 34) + { + text = "Celeste"; + } + if (this.prefix == 35) + { + text = "Furioso"; + } + if (this.prefix == 36) + { + text = "Appassionato"; + } + if (this.prefix == 37) + { + text = "Superiore"; + } + if (this.prefix == 38) + { + text = "Forte"; + } + if (this.prefix == 39) + { + text = "Rotto"; + } + if (this.prefix == 40) + { + text = "Danneggiato"; + } + if (this.prefix == 41) + { + text = "Scadente"; + } + if (this.prefix == 42) + { + text = "Veloce"; + } + if (this.prefix == 43) + { + text = "Mortale"; + } + if (this.prefix == 44) + { + text = "Agile"; + } + if (this.prefix == 45) + { + text = "Lesto"; + } + if (this.prefix == 46) + { + text = "Omicida"; + } + if (this.prefix == 47) + { + text = "Lento"; + } + if (this.prefix == 48) + { + text = "Pigro"; + } + if (this.prefix == 49) + { + text = "Indolente"; + } + if (this.prefix == 50) + { + text = "Fastidioso"; + } + if (this.prefix == 51) + { + text = "Brutto"; + } + if (this.prefix == 52) + { + text = "Maniaco"; + } + if (this.prefix == 53) + { + text = "Offensivo"; + } + if (this.prefix == 54) + { + text = "Robusto"; + } + if (this.prefix == 55) + { + text = "Sgradevole"; + } + if (this.prefix == 56) + { + text = "Debole"; + } + if (this.prefix == 57) + { + text = "Spietato"; + } + if (this.prefix == 58) + { + text = "Frenetico"; + } + if (this.prefix == 59) + { + text = "Devoto"; + } + if (this.prefix == 60) + { + text = "Demonico"; + } + if (this.prefix == 61) + { + text = "Zelante"; + } + if (this.prefix == 62) + { + text = "Duro"; + } + if (this.prefix == 63) + { + text = "Protettivo"; + } + if (this.prefix == 64) + { + text = "Corazzato"; + } + if (this.prefix == 65) + { + text = "Difensivo"; + } + if (this.prefix == 66) + { + text = "Arcano"; + } + if (this.prefix == 67) + { + text = "Preciso"; + } + if (this.prefix == 68) + { + text = "Fortunato"; + } + if (this.prefix == 69) + { + text = "Frastagliato"; + } + if (this.prefix == 70) + { + text = "Spillo"; + } + if (this.prefix == 71) + { + text = "Arrabbiato"; + } + if (this.prefix == 72) + { + text = "Minaccioso"; + } + if (this.prefix == 73) + { + text = "Vivace"; + } + if (this.prefix == 74) + { + text = "Fugace"; + } + if (this.prefix == 75) + { + text = "Frettoloso"; + } + if (this.prefix == 76) + { + text = "Veloce"; + } + if (this.prefix == 77) + { + text = "Selvaggio"; + } + if (this.prefix == 78) + { + text = "Temerario"; + } + if (this.prefix == 79) + { + text = "Intrepido"; + } + if (this.prefix == 80) + { + text = "Violento"; + } + if (this.prefix == 81) + { + text = "Leggendario"; + } + if (this.prefix == 82) + { + text = "Irreale"; + } + if (this.prefix == 83) + { + text = "Mitico"; + } + } + else + { + if (Lang.lang == 4) + { + if (this.prefix == 1) + { + text = "Grand"; + } + if (this.prefix == 2) + { + text = "Massif"; + } + if (this.prefix == 3) + { + text = "Dangereuses"; + } + if (this.prefix == 4) + { + text = "Sauvages"; + } + if (this.prefix == 5) + { + text = "Coupante"; + } + if (this.prefix == 6) + { + text = "Pointues"; + } + if (this.prefix == 7) + { + text = "Minuscules"; + } + if (this.prefix == 8) + { + text = "Terrible"; + } + if (this.prefix == 9) + { + text = "Petit"; + } + if (this.prefix == 10) + { + text = "Terne"; + } + if (this.prefix == 11) + { + text = "Malheureux"; + } + if (this.prefix == 12) + { + text = "Volumineux"; + } + if (this.prefix == 13) + { + text = "Honteux"; + } + if (this.prefix == 14) + { + text = "Lourds"; + } + if (this.prefix == 15) + { + text = "Léger"; + } + if (this.prefix == 16) + { + text = "Voyants"; + } + if (this.prefix == 17) + { + text = "Rapide"; + } + if (this.prefix == 18) + { + text = "Hâtif"; + } + if (this.prefix == 19) + { + text = "Intimidant"; + } + if (this.prefix == 20) + { + text = "Mortelle"; + } + if (this.prefix == 21) + { + text = "Dévoué"; + } + if (this.prefix == 22) + { + text = "Affreux"; + } + if (this.prefix == 23) + { + text = "Léthargique"; + } + if (this.prefix == 24) + { + text = "Scomodo"; + } + if (this.prefix == 25) + { + text = "Puissante"; + } + if (this.prefix == 26) + { + text = "Mystique"; + } + if (this.prefix == 27) + { + text = "Expert"; + } + if (this.prefix == 28) + { + text = "Magistrale"; + } + if (this.prefix == 29) + { + text = "Inepte"; + } + if (this.prefix == 30) + { + text = "Ignorants"; + } + if (this.prefix == 31) + { + text = "Dérangé"; + } + if (this.prefix == 32) + { + text = "Intenses"; + } + if (this.prefix == 33) + { + text = "Tabou"; + } + if (this.prefix == 34) + { + text = "Célestes"; + } + if (this.prefix == 35) + { + text = "Furieux"; + } + if (this.prefix == 36) + { + text = "Vif"; + } + if (this.prefix == 37) + { + text = "Supérieure"; + } + if (this.prefix == 38) + { + text = "Énergique"; + } + if (this.prefix == 39) + { + text = "Rompu"; + } + if (this.prefix == 40) + { + text = "Endommagés"; + } + if (this.prefix == 41) + { + text = "Mesquin"; + } + if (this.prefix == 42) + { + text = "Prompt"; + } + if (this.prefix == 43) + { + text = "Mortelle"; + } + if (this.prefix == 44) + { + text = "Agile"; + } + if (this.prefix == 45) + { + text = "Leste"; + } + if (this.prefix == 46) + { + text = "Meurtrier"; + } + if (this.prefix == 47) + { + text = "Lente"; + } + if (this.prefix == 48) + { + text = "Paresseux"; + } + if (this.prefix == 49) + { + text = "Fainéant"; + } + if (this.prefix == 50) + { + text = "Ennuyeux"; + } + if (this.prefix == 51) + { + text = "Méchant"; + } + if (this.prefix == 52) + { + text = "Maniaco"; + } + if (this.prefix == 53) + { + text = "Blessant"; + } + if (this.prefix == 54) + { + text = "Robuste"; + } + if (this.prefix == 55) + { + text = "Désagréables"; + } + if (this.prefix == 56) + { + text = "Faibles"; + } + if (this.prefix == 57) + { + text = "Impitoyable"; + } + if (this.prefix == 58) + { + text = "Frénétique"; + } + if (this.prefix == 59) + { + text = "Pieux"; + } + if (this.prefix == 60) + { + text = "Démoniaque"; + } + if (this.prefix == 61) + { + text = "Zélé"; + } + if (this.prefix == 62) + { + text = "Durs"; + } + if (this.prefix == 63) + { + text = "Protecteur"; + } + if (this.prefix == 64) + { + text = "Blindés"; + } + if (this.prefix == 65) + { + text = "Défensif"; + } + if (this.prefix == 66) + { + text = "Ésotérique"; + } + if (this.prefix == 67) + { + text = "Précise"; + } + if (this.prefix == 68) + { + text = "Chanceux"; + } + if (this.prefix == 69) + { + text = "Déchiqueté"; + } + if (this.prefix == 70) + { + text = "Pointes"; + } + if (this.prefix == 71) + { + text = "Fâché"; + } + if (this.prefix == 72) + { + text = "Menaçant"; + } + if (this.prefix == 73) + { + text = "Brusque"; + } + if (this.prefix == 74) + { + text = "Fugace"; + } + if (this.prefix == 75) + { + text = "Hâtif"; + } + if (this.prefix == 76) + { + text = "Prompt"; + } + if (this.prefix == 77) + { + text = "Sauvages"; + } + if (this.prefix == 78) + { + text = "Téméraire"; + } + if (this.prefix == 79) + { + text = "Intrépide"; + } + if (this.prefix == 80) + { + text = "Violent"; + } + if (this.prefix == 81) + { + text = "Légendaire"; + } + if (this.prefix == 82) + { + text = "Irréel"; + } + if (this.prefix == 83) + { + text = "Mythique"; + } + } + else + { + if (Lang.lang == 5) + { + if (this.prefix == 1) + { + text = "Grande"; + } + if (this.prefix == 2) + { + text = "Masivo"; + } + if (this.prefix == 3) + { + text = "Peligroso"; + } + if (this.prefix == 4) + { + text = "Salvaje"; + } + if (this.prefix == 5) + { + text = "Puntiagudo"; + } + if (this.prefix == 6) + { + text = "Agudo"; + } + if (this.prefix == 7) + { + text = "Diminuto"; + } + if (this.prefix == 8) + { + text = "Mala "; + } + if (this.prefix == 9) + { + text = "Pequeño"; + } + if (this.prefix == 10) + { + text = "Aburrido"; + } + if (this.prefix == 11) + { + text = "Infeliz"; + } + if (this.prefix == 12) + { + text = "Voluminoso"; + } + if (this.prefix == 13) + { + text = "Vergonzoso"; + } + if (this.prefix == 14) + { + text = "Pesado"; + } + if (this.prefix == 15) + { + text = "Ligero"; + } + if (this.prefix == 16) + { + text = "Ámbito"; + } + if (this.prefix == 17) + { + text = "Rápido"; + } + if (this.prefix == 18) + { + text = "Precipitado"; + } + if (this.prefix == 19) + { + text = "Intimidante"; + } + if (this.prefix == 20) + { + text = "Mortal"; + } + if (this.prefix == 21) + { + text = "Firme"; + } + if (this.prefix == 22) + { + text = "Atroz"; + } + if (this.prefix == 23) + { + text = "Letárgico"; + } + if (this.prefix == 24) + { + text = "Torpe"; + } + if (this.prefix == 25) + { + text = "Poderoso"; + } + if (this.prefix == 26) + { + text = "Místico"; + } + if (this.prefix == 27) + { + text = "Experto"; + } + if (this.prefix == 28) + { + text = "Maestro"; + } + if (this.prefix == 29) + { + text = "Inepto"; + } + if (this.prefix == 30) + { + text = "Ignorante"; + } + if (this.prefix == 31) + { + text = "Trastornado"; + } + if (this.prefix == 32) + { + text = "Intenso"; + } + if (this.prefix == 33) + { + text = "Tabú"; + } + if (this.prefix == 34) + { + text = "Celeste"; + } + if (this.prefix == 35) + { + text = "Furioso"; + } + if (this.prefix == 36) + { + text = "Afilado"; + } + if (this.prefix == 37) + { + text = "Superior"; + } + if (this.prefix == 38) + { + text = "Fuerte"; + } + if (this.prefix == 39) + { + text = "Roto"; + } + if (this.prefix == 40) + { + text = "Estropeado"; + } + if (this.prefix == 41) + { + text = "Regenerado"; + } + if (this.prefix == 42) + { + text = "Pronto"; + } + if (this.prefix == 43) + { + text = "Mortal"; + } + if (this.prefix == 44) + { + text = "Ágil"; + } + if (this.prefix == 45) + { + text = "Listo"; + } + if (this.prefix == 46) + { + text = "Asesino"; + } + if (this.prefix == 47) + { + text = "Lento"; + } + if (this.prefix == 48) + { + text = "Perezoso"; + } + if (this.prefix == 49) + { + text = "Gandul"; + } + if (this.prefix == 50) + { + text = "Molesto"; + } + if (this.prefix == 51) + { + text = "Feo"; + } + if (this.prefix == 52) + { + text = "Maníacos"; + } + if (this.prefix == 53) + { + text = "Hiriente"; + } + if (this.prefix == 54) + { + text = "Vigoroso"; + } + if (this.prefix == 55) + { + text = "Desagradable"; + } + if (this.prefix == 56) + { + text = "Débil"; + } + if (this.prefix == 57) + { + text = "Despiadado"; + } + if (this.prefix == 58) + { + text = "Frenético"; + } + if (this.prefix == 59) + { + text = "Piadoso"; + } + if (this.prefix == 60) + { + text = "Demoníaco"; + } + if (this.prefix == 61) + { + text = "Celoso"; + } + if (this.prefix == 62) + { + text = "Duro"; + } + if (this.prefix == 63) + { + text = "Protector"; + } + if (this.prefix == 64) + { + text = "Blindado"; + } + if (this.prefix == 65) + { + text = "Defensivo"; + } + if (this.prefix == 66) + { + text = "Arcano"; + } + if (this.prefix == 67) + { + text = "Preciso"; + } + if (this.prefix == 68) + { + text = "Afortunado"; + } + if (this.prefix == 69) + { + text = "Dentado"; + } + if (this.prefix == 70) + { + text = "Claveteado"; + } + if (this.prefix == 71) + { + text = "Enojado"; + } + if (this.prefix == 72) + { + text = "Amenazador"; + } + if (this.prefix == 73) + { + text = "Enérgico"; + } + if (this.prefix == 74) + { + text = "Fugaz"; + } + if (this.prefix == 75) + { + text = "Precipitado"; + } + if (this.prefix == 76) + { + text = "Pronto"; + } + if (this.prefix == 77) + { + text = "Salvaje"; + } + if (this.prefix == 78) + { + text = "Temerario"; + } + if (this.prefix == 79) + { + text = "Intrépido"; + } + if (this.prefix == 80) + { + text = "Violento"; + } + if (this.prefix == 81) + { + text = "Legendario"; + } + if (this.prefix == 82) + { + text = "Irreal"; + } + if (this.prefix == 83) + { + text = "Mítico"; + } + } + } + } + } + } + if (Lang.lang <= 1) + { + string result = this.name; + if (text != "") + { + result = text + " " + this.name; + } + return result; + } + if (Lang.lang == 2) + { + string result2 = this.name; + if (text != "") + { + result2 = this.name + " (" + text + ")"; + } + return result2; + } + if (Lang.lang == 3) + { + string result3 = this.name; + if (text != "") + { + result3 = this.name + " (" + text + ")"; + } + return result3; + } + if (Lang.lang == 4) + { + string result4 = this.name; + if (text != "") + { + result4 = this.name + " (" + text + ")"; + } + return result4; + } + string result5 = this.name; + if (text != "") + { + result5 = this.name + " (" + text + ")"; + } + return result5; + } + public void CheckTip() + { + if (this.toolTip != "") + { + this.toolTip = Lang.toolTip(this.netID, false); + } + if (this.toolTip2 != "") + { + this.toolTip2 = Lang.toolTip2(this.netID, false); + } + } + public void SetDefaults(string ItemName) + { + this.name = ""; + bool flag = false; + if (ItemName == "Gold Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(210, 190, 0, 100); + this.useTime = 17; + this.pick = 55; + this.useAnimation = 20; + this.scale = 1.05f; + this.damage = 6; + this.value = 10000; + this.toolTip = "Can mine Meteorite"; + this.netID = -1; + goto IL_1367; + } + if (ItemName == "Gold Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(210, 190, 0, 100); + this.useAnimation = 20; + this.damage = 13; + this.scale = 1.05f; + this.value = 9000; + this.netID = -2; + goto IL_1367; + } + if (ItemName == "Gold Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(210, 190, 0, 100); + this.damage = 11; + this.useAnimation = 11; + this.scale = 0.95f; + this.value = 7000; + this.netID = -3; + goto IL_1367; + } + if (ItemName == "Gold Axe") + { + this.SetDefaults(10, false); + this.color = new Color(210, 190, 0, 100); + this.useTime = 18; + this.axe = 11; + this.useAnimation = 26; + this.scale = 1.15f; + this.damage = 7; + this.value = 8000; + this.netID = -4; + goto IL_1367; + } + if (ItemName == "Gold Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(210, 190, 0, 100); + this.useAnimation = 28; + this.useTime = 23; + this.scale = 1.25f; + this.damage = 9; + this.hammer = 55; + this.value = 8000; + this.netID = -5; + goto IL_1367; + } + if (ItemName == "Gold Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 26; + this.useTime = 26; + this.color = new Color(210, 190, 0, 100); + this.damage = 11; + this.value = 7000; + this.netID = -6; + goto IL_1367; + } + if (ItemName == "Silver Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(180, 180, 180, 100); + this.useTime = 11; + this.pick = 45; + this.useAnimation = 19; + this.scale = 1.05f; + this.damage = 6; + this.value = 5000; + this.netID = -7; + goto IL_1367; + } + if (ItemName == "Silver Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(180, 180, 180, 100); + this.useAnimation = 21; + this.damage = 11; + this.value = 4500; + this.netID = -8; + goto IL_1367; + } + if (ItemName == "Silver Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(180, 180, 180, 100); + this.damage = 9; + this.useAnimation = 12; + this.scale = 0.95f; + this.value = 3500; + this.netID = -9; + goto IL_1367; + } + if (ItemName == "Silver Axe") + { + this.SetDefaults(10, false); + this.color = new Color(180, 180, 180, 100); + this.useTime = 18; + this.axe = 10; + this.useAnimation = 26; + this.scale = 1.15f; + this.damage = 6; + this.value = 4000; + this.netID = -10; + goto IL_1367; + } + if (ItemName == "Silver Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(180, 180, 180, 100); + this.useAnimation = 29; + this.useTime = 19; + this.scale = 1.25f; + this.damage = 9; + this.hammer = 45; + this.value = 4000; + this.netID = -11; + goto IL_1367; + } + if (ItemName == "Silver Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 27; + this.useTime = 27; + this.color = new Color(180, 180, 180, 100); + this.damage = 9; + this.value = 3500; + this.netID = -12; + goto IL_1367; + } + if (ItemName == "Copper Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(180, 100, 45, 80); + this.useTime = 15; + this.pick = 35; + this.useAnimation = 23; + this.damage = 4; + this.scale = 0.9f; + this.tileBoost = -1; + this.value = 500; + this.netID = -13; + goto IL_1367; + } + if (ItemName == "Copper Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(180, 100, 45, 80); + this.useAnimation = 23; + this.damage = 8; + this.value = 450; + this.netID = -14; + goto IL_1367; + } + if (ItemName == "Copper Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(180, 100, 45, 80); + this.damage = 5; + this.useAnimation = 13; + this.scale = 0.8f; + this.value = 350; + this.netID = -15; + goto IL_1367; + } + if (ItemName == "Copper Axe") + { + this.SetDefaults(10, false); + this.color = new Color(180, 100, 45, 80); + this.useTime = 21; + this.axe = 7; + this.useAnimation = 30; + this.scale = 1f; + this.damage = 3; + this.tileBoost = -1; + this.value = 400; + this.netID = -16; + goto IL_1367; + } + if (ItemName == "Copper Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(180, 100, 45, 80); + this.useAnimation = 33; + this.useTime = 23; + this.scale = 1.1f; + this.damage = 4; + this.hammer = 35; + this.tileBoost = -1; + this.value = 400; + this.netID = -17; + goto IL_1367; + } + if (ItemName == "Copper Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 29; + this.useTime = 29; + this.color = new Color(180, 100, 45, 80); + this.damage = 6; + this.value = 350; + this.netID = -18; + goto IL_1367; + } + if (ItemName == "Blue Phasesaber") + { + this.SetDefaults(198, false); + this.damage = 41; + this.scale = 1.15f; + flag = true; + this.autoReuse = true; + this.useTurn = true; + this.rare = 4; + this.netID = -19; + goto IL_1367; + } + if (ItemName == "Red Phasesaber") + { + this.SetDefaults(199, false); + this.damage = 41; + this.scale = 1.15f; + flag = true; + this.autoReuse = true; + this.useTurn = true; + this.rare = 4; + this.netID = -20; + goto IL_1367; + } + if (ItemName == "Green Phasesaber") + { + this.SetDefaults(200, false); + this.damage = 41; + this.scale = 1.15f; + flag = true; + this.autoReuse = true; + this.useTurn = true; + this.rare = 4; + this.netID = -21; + goto IL_1367; + } + if (ItemName == "Purple Phasesaber") + { + this.SetDefaults(201, false); + this.damage = 41; + this.scale = 1.15f; + flag = true; + this.autoReuse = true; + this.useTurn = true; + this.rare = 4; + this.netID = -22; + goto IL_1367; + } + if (ItemName == "White Phasesaber") + { + this.SetDefaults(202, false); + this.damage = 41; + this.scale = 1.15f; + flag = true; + this.autoReuse = true; + this.useTurn = true; + this.rare = 4; + this.netID = -23; + goto IL_1367; + } + if (ItemName == "Yellow Phasesaber") + { + this.SetDefaults(203, false); + this.damage = 41; + this.scale = 1.15f; + flag = true; + this.autoReuse = true; + this.useTurn = true; + this.rare = 4; + this.netID = -24; + goto IL_1367; + } + if (ItemName == "Tin Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(170, 150, 80, 110); + this.useTime = 14; + this.pick = 35; + this.useAnimation = 21; + this.damage = 5; + this.scale = 0.95f; + this.value = 750; + this.netID = -25; + goto IL_1367; + } + if (ItemName == "Tin Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(170, 150, 80, 110); + this.useAnimation = 22; + this.damage = 9; + this.value = 675; + this.netID = -26; + goto IL_1367; + } + if (ItemName == "Tin Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(170, 150, 80, 110); + this.damage = 7; + this.useAnimation = 12; + this.scale = 0.85f; + this.value = 525; + this.netID = -27; + goto IL_1367; + } + if (ItemName == "Tin Axe") + { + this.SetDefaults(10, false); + this.color = new Color(170, 150, 80, 110); + this.useTime = 20; + this.axe = 8; + this.useAnimation = 28; + this.scale = 1.05f; + this.damage = 4; + this.value = 600; + this.netID = -28; + goto IL_1367; + } + if (ItemName == "Tin Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(170, 150, 80, 110); + this.useAnimation = 31; + this.useTime = 21; + this.scale = 1.15f; + this.damage = 6; + this.hammer = 38; + this.value = 600; + this.netID = -29; + goto IL_1367; + } + if (ItemName == "Tin Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 28; + this.useTime = 28; + this.color = new Color(170, 150, 80, 110); + this.damage = 7; + this.value = 525; + this.netID = -30; + goto IL_1367; + } + if (ItemName == "Lead Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(90, 100, 110, 170); + this.useTime = 12; + this.pick = 43; + this.useAnimation = 19; + this.damage = 6; + this.scale = 1.025f; + this.value = 3000; + this.netID = -31; + goto IL_1367; + } + if (ItemName == "Lead Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(80, 90, 170, 160); + this.useAnimation = 21; + this.damage = 11; + this.value = 2700; + this.netID = -32; + goto IL_1367; + } + if (ItemName == "Lead Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(90, 100, 110, 170); + this.damage = 9; + this.useAnimation = 12; + this.scale = 0.925f; + this.value = 2100; + this.netID = -33; + goto IL_1367; + } + if (ItemName == "Lead Axe") + { + this.SetDefaults(10, false); + this.color = new Color(90, 100, 110, 170); + this.useTime = 19; + this.axe = 10; + this.useAnimation = 28; + this.scale = 1.125f; + this.damage = 6; + this.value = 2400; + this.netID = -34; + goto IL_1367; + } + if (ItemName == "Lead Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(90, 100, 110, 170); + this.useAnimation = 29; + this.useTime = 19; + this.scale = 1.225f; + this.damage = 8; + this.hammer = 43; + this.value = 2400; + this.netID = -35; + goto IL_1367; + } + if (ItemName == "Lead Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 27; + this.useTime = 27; + this.color = new Color(90, 100, 110, 170); + this.damage = 9; + this.value = 2100; + this.netID = -36; + goto IL_1367; + } + if (ItemName == "Tungsten Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(130, 180, 130, 100); + this.useTime = 19; + this.pick = 50; + this.useAnimation = 21; + this.scale = 1.05f; + this.damage = 6; + this.value = 7500; + this.netID = -37; + this.toolTip = "Can mine Meteorite"; + goto IL_1367; + } + if (ItemName == "Tungsten Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(130, 180, 130, 100); + this.useAnimation = 20; + this.damage = 12; + this.scale *= 1.025f; + this.value = 6750; + this.netID = -38; + goto IL_1367; + } + if (ItemName == "Tungsten Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(130, 180, 130, 100); + this.damage = 10; + this.useAnimation = 11; + this.scale = 0.95f; + this.value = 5250; + this.netID = -39; + goto IL_1367; + } + if (ItemName == "Tungsten Axe") + { + this.SetDefaults(10, false); + this.color = new Color(130, 180, 130, 100); + this.useTime = 18; + this.axe = 11; + this.useAnimation = 26; + this.scale = 1.15f; + this.damage = 7; + this.value = 4000; + this.netID = -40; + goto IL_1367; + } + if (ItemName == "Tungsten Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(130, 180, 130, 100); + this.useAnimation = 28; + this.useTime = 25; + this.scale = 1.25f; + this.damage = 9; + this.hammer = 50; + this.value = 6000; + this.netID = -41; + goto IL_1367; + } + if (ItemName == "Tungsten Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 26; + this.useTime = 26; + this.color = new Color(130, 180, 130, 100); + this.damage = 10; + this.value = 5250; + this.netID = -42; + goto IL_1367; + } + if (ItemName == "Platinum Pickaxe") + { + this.SetDefaults(1, false); + this.color = new Color(110, 140, 200, 80); + this.useTime = 15; + this.pick = 59; + this.useAnimation = 19; + this.scale = 1.05f; + this.damage = 7; + this.value = 15000; + this.toolTip = "Can mine Meteorite"; + this.netID = -43; + goto IL_1367; + } + if (ItemName == "Platinum Broadsword") + { + this.SetDefaults(4, false); + this.color = new Color(110, 140, 200, 80); + this.useAnimation = 19; + this.damage = 15; + this.scale = 1.075f; + this.value = 13500; + this.netID = -44; + goto IL_1367; + } + if (ItemName == "Platinum Shortsword") + { + this.SetDefaults(6, false); + this.color = new Color(110, 140, 200, 80); + this.damage = 13; + this.useAnimation = 10; + this.scale = 0.975f; + this.value = 10500; + this.netID = -45; + goto IL_1367; + } + if (ItemName == "Platinum Axe") + { + this.SetDefaults(10, false); + this.color = new Color(110, 140, 200, 80); + this.useTime = 17; + this.axe = 12; + this.useAnimation = 25; + this.scale = 1.175f; + this.damage = 8; + this.value = 12000; + this.netID = -46; + goto IL_1367; + } + if (ItemName == "Platinum Hammer") + { + this.SetDefaults(7, false); + this.color = new Color(110, 140, 200, 80); + this.useAnimation = 27; + this.useTime = 21; + this.scale = 1.275f; + this.damage = 10; + this.hammer = 59; + this.value = 12000; + this.netID = -47; + goto IL_1367; + } + if (ItemName == "Platinum Bow") + { + this.SetDefaults(99, false); + this.useAnimation = 25; + this.useTime = 25; + this.color = new Color(110, 140, 200, 80); + this.damage = 13; + this.value = 10500; + this.netID = -48; + goto IL_1367; + } + if (ItemName != "") + { + for (int i = 0; i < 1725; i++) + { + if (Main.itemName[i] == ItemName) + { + this.SetDefaults(i, false); + this.checkMat(); + return; + } + } + this.name = ""; + this.stack = 0; + this.type = 0; + } + IL_1367: + if (this.type != 0) + { + if (flag) + { + this.material = false; + goto IL_1382; + } + this.checkMat(); + IL_1382: + this.name = ItemName; + this.name = Lang.itemName(this.netID, false); + this.CheckTip(); + } + } + public Rectangle getRect() + { + return new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + } + public bool checkMat() + { + if (this.type >= 71 && this.type <= 74) + { + this.material = false; + return false; + } + for (int i = 0; i < Recipe.numRecipes; i++) + { + int num = 0; + while (Main.recipe[i].requiredItem[num].type > 0) + { + if (this.netID == Main.recipe[i].requiredItem[num].netID) + { + this.material = true; + return true; + } + num++; + } + } + this.material = false; + return false; + } + public void netDefaults(int type) + { + if (type < 0) + { + if (type == -1) + { + this.SetDefaults("Gold Pickaxe"); + return; + } + if (type == -2) + { + this.SetDefaults("Gold Broadsword"); + return; + } + if (type == -3) + { + this.SetDefaults("Gold Shortsword"); + return; + } + if (type == -4) + { + this.SetDefaults("Gold Axe"); + return; + } + if (type == -5) + { + this.SetDefaults("Gold Hammer"); + return; + } + if (type == -6) + { + this.SetDefaults("Gold Bow"); + return; + } + if (type == -7) + { + this.SetDefaults("Silver Pickaxe"); + return; + } + if (type == -8) + { + this.SetDefaults("Silver Broadsword"); + return; + } + if (type == -9) + { + this.SetDefaults("Silver Shortsword"); + return; + } + if (type == -10) + { + this.SetDefaults("Silver Axe"); + return; + } + if (type == -11) + { + this.SetDefaults("Silver Hammer"); + return; + } + if (type == -12) + { + this.SetDefaults("Silver Bow"); + return; + } + if (type == -13) + { + this.SetDefaults("Copper Pickaxe"); + return; + } + if (type == -14) + { + this.SetDefaults("Copper Broadsword"); + return; + } + if (type == -15) + { + this.SetDefaults("Copper Shortsword"); + return; + } + if (type == -16) + { + this.SetDefaults("Copper Axe"); + return; + } + if (type == -17) + { + this.SetDefaults("Copper Hammer"); + return; + } + if (type == -18) + { + this.SetDefaults("Copper Bow"); + return; + } + if (type == -19) + { + this.SetDefaults("Blue Phasesaber"); + return; + } + if (type == -20) + { + this.SetDefaults("Red Phasesaber"); + return; + } + if (type == -21) + { + this.SetDefaults("Green Phasesaber"); + return; + } + if (type == -22) + { + this.SetDefaults("Purple Phasesaber"); + return; + } + if (type == -23) + { + this.SetDefaults("White Phasesaber"); + return; + } + if (type == -24) + { + this.SetDefaults("Yellow Phasesaber"); + return; + } + if (type == -25) + { + this.SetDefaults("Tin Pickaxe"); + return; + } + if (type == -26) + { + this.SetDefaults("Tin Broadsword"); + return; + } + if (type == -27) + { + this.SetDefaults("Tin Shortsword"); + return; + } + if (type == -28) + { + this.SetDefaults("Tin Axe"); + return; + } + if (type == -29) + { + this.SetDefaults("Tin Hammer"); + return; + } + if (type == -30) + { + this.SetDefaults("Tin Bow"); + return; + } + if (type == -31) + { + this.SetDefaults("Lead Pickaxe"); + return; + } + if (type == -32) + { + this.SetDefaults("Lead Broadsword"); + return; + } + if (type == -33) + { + this.SetDefaults("Lead Shortsword"); + return; + } + if (type == -34) + { + this.SetDefaults("Lead Axe"); + return; + } + if (type == -35) + { + this.SetDefaults("Lead Hammer"); + return; + } + if (type == -36) + { + this.SetDefaults("Lead Bow"); + return; + } + if (type == -37) + { + this.SetDefaults("Tungsten Pickaxe"); + return; + } + if (type == -38) + { + this.SetDefaults("Tungsten Broadsword"); + return; + } + if (type == -39) + { + this.SetDefaults("Tungsten Shortsword"); + return; + } + if (type == -40) + { + this.SetDefaults("Tungsten Axe"); + return; + } + if (type == -41) + { + this.SetDefaults("Tungsten Hammer"); + return; + } + if (type == -42) + { + this.SetDefaults("Tungsten Bow"); + return; + } + if (type == -43) + { + this.SetDefaults("Platinum Pickaxe"); + return; + } + if (type == -44) + { + this.SetDefaults("Platinum Broadsword"); + return; + } + if (type == -45) + { + this.SetDefaults("Platinum Shortsword"); + return; + } + if (type == -46) + { + this.SetDefaults("Platinum Axe"); + return; + } + if (type == -47) + { + this.SetDefaults("Platinum Hammer"); + return; + } + if (type == -48) + { + this.SetDefaults("Platinum Bow"); + return; + } + return; + } + this.SetDefaults(type, false); + } + public static int NPCtoBanner(int i) + { + switch (i) + { + case 1: + case 147: + case 184: + return 69; + case 2: + case 133: + case 190: + case 191: + case 192: + case 193: + case 194: + return 25; + case 3: + case 132: + case 186: + case 187: + case 188: + case 189: + case 200: + return 87; + case 6: + return 27; + case 10: + case 11: + case 12: + case 95: + case 96: + case 97: + return 84; + case 21: + case 201: + case 202: + case 203: + return 67; + case 23: + return 55; + case 24: + return 50; + case 27: + return 41; + case 28: + return 42; + case 29: + return 39; + case 32: + return 68; + case 39: + case 40: + case 41: + return 13; + case 42: + case 176: + case 231: + case 232: + case 233: + case 234: + case 235: + return 47; + case 43: + return 54; + case 46: + return 14; + case 47: + return 18; + case 48: + return 44; + case 49: + case 93: + return 7; + case 55: + case 230: + return 43; + case 57: + return 19; + case 58: + return 61; + case 60: + case 151: + return 45; + case 61: + return 79; + case 62: + case 66: + case 156: + return 24; + case 63: + case 64: + case 103: + return 51; + case 65: + return 66; + case 67: + return 20; + case 69: + return 4; + case 73: + return 40; + case 74: + return 8; + case 75: + return 63; + case 77: + return 6; + case 78: + case 79: + case 80: + return 57; + case 82: + return 85; + case 83: + return 23; + case 84: + return 28; + case 85: + return 16; + case 86: + return 77; + case 87: + case 88: + case 89: + case 90: + case 91: + case 92: + return 86; + case 98: + case 99: + case 100: + return 83; + case 102: + return 1; + case 104: + return 81; + case 109: + return 17; + case 111: + return 38; + case 120: + return 15; + case 122: + return 37; + case 141: + return 75; + case 153: + case 154: + return 74; + case 155: + return 82; + case 157: + return 5; + case 158: + case 159: + return 78; + case 161: + return 29; + case 162: + return 34; + case 163: + case 238: + return 9; + case 164: + case 165: + return 71; + case 166: + return 73; + case 169: + return 48; + case 170: + case 171: + case 180: + return 60; + case 173: + return 21; + case 174: + return 46; + case 177: + return 26; + case 179: + return 22; + case 181: + return 30; + case 182: + return 31; + case 185: + return 70; + case 195: + case 196: + return 80; + case 198: + case 199: + return 53; + case 205: + return 56; + case 206: + return 49; + case 212: + case 213: + case 214: + case 215: + case 216: + return 62; + case 223: + return 64; + case 224: + return 32; + case 225: + return 76; + case 226: + return 33; + case 236: + case 237: + return 52; + case 239: + return 12; + case 241: + return 10; + case 242: + return 11; + case 250: + return 2; + case 252: + return 59; + case 253: + return 65; + case 254: + case 255: + return 72; + case 256: + return 36; + case 257: + return 3; + case 258: + return 58; + case 259: + case 260: + return 35; + } + return -1; + } + public static int BannerToNPC(int i) + { + switch (i) + { + case 1: + return 102; + case 2: + return 250; + case 3: + return 257; + case 4: + return 69; + case 5: + return 157; + case 6: + return 77; + case 7: + return 49; + case 8: + return 74; + case 9: + return 163; + case 10: + return 241; + case 11: + return 242; + case 12: + return 239; + case 13: + return 39; + case 14: + return 46; + case 15: + return 120; + case 16: + return 85; + case 17: + return 109; + case 18: + return 47; + case 19: + return 57; + case 20: + return 67; + case 21: + return 173; + case 22: + return 179; + case 23: + return 83; + case 24: + return 62; + case 25: + return 2; + case 26: + return 177; + case 27: + return 6; + case 28: + return 84; + case 29: + return 161; + case 30: + return 181; + case 31: + return 182; + case 32: + return 224; + case 33: + return 226; + case 34: + return 162; + case 35: + return 259; + case 36: + return 256; + case 37: + return 122; + case 38: + return 111; + case 39: + return 29; + case 40: + return 73; + case 41: + return 27; + case 42: + return 28; + case 43: + return 55; + case 44: + return 48; + case 45: + return 60; + case 46: + return 174; + case 47: + return 42; + case 48: + return 169; + case 49: + return 206; + case 50: + return 24; + case 51: + return 63; + case 52: + return 236; + case 53: + return 199; + case 54: + return 43; + case 55: + return 23; + case 56: + return 205; + case 57: + return 78; + case 58: + return 258; + case 59: + return 252; + case 60: + return 170; + case 61: + return 58; + case 62: + return 212; + case 63: + return 75; + case 64: + return 223; + case 65: + return 253; + case 66: + return 65; + case 67: + return 21; + case 68: + return 32; + case 69: + return 1; + case 70: + return 185; + case 71: + return 164; + case 72: + return 254; + case 73: + return 166; + case 74: + return 153; + case 75: + return 141; + case 76: + return 225; + case 77: + return 86; + case 78: + return 158; + case 79: + return 61; + case 80: + return 196; + case 81: + return 104; + case 82: + return 155; + case 83: + return 98; + case 84: + return 10; + case 85: + return 82; + case 86: + return 87; + case 87: + return 3; + default: + return -1; + } + } + public void SetDefaults(int Type, bool noMatCheck = false) + { + if (Main.netMode == 1 || Main.netMode == 2) + { + this.owner = 255; + goto IL_28; + } + this.owner = Main.myPlayer; + IL_28: + this.dye = 0; + this.paint = 0; + this.tileWand = -1; + this.notAmmo = false; + this.netID = 0; + this.prefix = 0; + this.crit = 0; + this.mech = false; + this.flame = false; + this.reuseDelay = 0; + this.melee = false; + this.magic = false; + this.ranged = false; + this.summon = false; + this.placeStyle = 0; + this.buffTime = 0; + this.buffType = 0; + this.material = false; + this.noWet = false; + this.vanity = false; + this.mana = 0; + this.wet = false; + this.wetCount = 0; + this.lavaWet = false; + this.channel = false; + this.manaIncrease = 0; + this.release = 0; + this.noMelee = false; + this.noUseGraphic = false; + this.lifeRegen = 0; + this.shootSpeed = 0f; + this.active = true; + this.alpha = 0; + this.ammo = 0; + this.useAmmo = 0; + this.autoReuse = false; + this.accessory = false; + this.axe = 0; + this.healMana = 0; + this.bodySlot = -1; + this.legSlot = -1; + this.headSlot = -1; + this.potion = false; + this.color = default(Color); + this.consumable = false; + this.createTile = -1; + this.createWall = -1; + this.damage = -1; + this.defense = 0; + this.hammer = 0; + this.healLife = 0; + this.holdStyle = 0; + this.knockBack = 0f; + this.maxStack = 1; + this.pick = 0; + this.rare = 0; + this.scale = 1f; + this.shoot = 0; + this.stack = 1; + this.toolTip = null; + this.toolTip2 = null; + this.tileBoost = 0; + this.type = Type; + this.useStyle = 0; + this.useSound = 0; + this.useTime = 100; + this.useAnimation = 100; + this.value = 0; + this.useTurn = false; + this.buy = false; + if (this.type == 0) + { + this.netID = 0; + this.name = ""; + this.stack = 0; + goto IL_381A; + } + if (this.type == 1) + { + this.name = "Iron Pickaxe"; + this.color = new Color(160, 145, 130, 110); + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 20; + this.useTime = 13; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 5; + this.pick = 40; + this.useSound = 1; + this.knockBack = 2f; + this.value = 2000; + this.melee = true; + goto IL_381A; + } + if (this.type == 2) + { + this.name = "Dirt Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 0; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 3) + { + this.name = "Stone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 1; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 4) + { + this.name = "Iron Broadsword"; + this.color = new Color(160, 145, 130, 110); + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 21; + this.useTime = 21; + this.width = 24; + this.height = 28; + this.damage = 10; + this.knockBack = 5f; + this.useSound = 1; + this.scale = 1f; + this.value = 1800; + this.melee = true; + goto IL_381A; + } + if (this.type == 5) + { + this.name = "Mushroom"; + this.useStyle = 2; + this.useSound = 2; + this.useTurn = false; + this.useAnimation = 17; + this.useTime = 17; + this.width = 16; + this.height = 18; + this.healLife = 15; + this.maxStack = 99; + this.consumable = true; + this.potion = true; + this.value = 25; + goto IL_381A; + } + if (this.type == 6) + { + this.name = "Iron Shortsword"; + this.color = new Color(160, 145, 130, 110); + this.useStyle = 3; + this.useTurn = false; + this.useAnimation = 12; + this.useTime = 12; + this.width = 24; + this.height = 28; + this.damage = 8; + this.knockBack = 4f; + this.scale = 0.9f; + this.useSound = 1; + this.useTurn = true; + this.value = 1400; + this.melee = true; + goto IL_381A; + } + if (this.type == 7) + { + this.name = "Iron Hammer"; + this.color = new Color(160, 145, 130, 110); + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 30; + this.useTime = 20; + this.hammer = 40; + this.width = 24; + this.height = 28; + this.damage = 7; + this.knockBack = 5.5f; + this.scale = 1.2f; + this.useSound = 1; + this.value = 1600; + this.melee = true; + goto IL_381A; + } + if (this.type == 8) + { + this.flame = true; + this.noWet = true; + this.name = "Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.width = 10; + this.height = 12; + this.toolTip = "Provides light"; + this.value = 50; + goto IL_381A; + } + if (this.type == 9) + { + this.name = "Wood"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 30; + this.width = 8; + this.height = 10; + goto IL_381A; + } + if (this.type == 10) + { + this.name = "Iron Axe"; + this.color = new Color(160, 145, 130, 110); + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 27; + this.knockBack = 4.5f; + this.useTime = 19; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 5; + this.axe = 9; + this.scale = 1.1f; + this.useSound = 1; + this.value = 1600; + this.melee = true; + goto IL_381A; + } + if (this.type == 11) + { + this.name = "Iron Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 6; + this.width = 12; + this.height = 12; + this.value = 500; + goto IL_381A; + } + if (this.type == 12) + { + this.name = "Copper Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 7; + this.width = 12; + this.height = 12; + this.value = 250; + goto IL_381A; + } + if (this.type == 13) + { + this.name = "Gold Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 8; + this.width = 12; + this.height = 12; + this.value = 2000; + goto IL_381A; + } + if (this.type == 14) + { + this.name = "Silver Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 9; + this.width = 12; + this.height = 12; + this.value = 1000; + goto IL_381A; + } + if (this.type == 15) + { + this.name = "Copper Watch"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Tells the time"; + this.value = 1000; + goto IL_381A; + } + if (this.type == 16) + { + this.name = "Silver Watch"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Tells the time"; + this.value = 5000; + goto IL_381A; + } + if (this.type == 17) + { + this.name = "Gold Watch"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.rare = 1; + this.toolTip = "Tells the time"; + this.value = 10000; + goto IL_381A; + } + if (this.type == 18) + { + this.name = "Depth Meter"; + this.width = 24; + this.height = 18; + this.accessory = true; + this.rare = 1; + this.toolTip = "Shows depth"; + this.value = 10000; + goto IL_381A; + } + if (this.type == 19) + { + this.name = "Gold Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 6000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 6; + goto IL_381A; + } + if (this.type == 20) + { + this.name = "Copper Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 750; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 0; + goto IL_381A; + } + if (this.type == 21) + { + this.name = "Silver Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 3000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 4; + goto IL_381A; + } + if (this.type == 22) + { + this.name = "Iron Bar"; + this.color = new Color(160, 145, 130, 110); + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 1500; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 2; + goto IL_381A; + } + if (this.type == 23) + { + this.name = "Gel"; + this.width = 10; + this.height = 12; + this.maxStack = 999; + this.alpha = 175; + this.ammo = 23; + this.color = new Color(0, 80, 255, 100); + this.toolTip = "'Both tasty and flammable'"; + this.value = 5; + goto IL_381A; + } + if (this.type == 24) + { + this.name = "Wooden Sword"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 25; + this.width = 24; + this.height = 28; + this.damage = 7; + this.knockBack = 4f; + this.scale = 0.95f; + this.useSound = 1; + this.value = 100; + this.melee = true; + goto IL_381A; + } + if (this.type == 25) + { + this.name = "Wooden Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_381A; + } + if (this.type == 26) + { + this.name = "Stone Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 1; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 27) + { + this.name = "Acorn"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 20; + this.width = 18; + this.height = 18; + this.value = 10; + goto IL_381A; + } + if (this.type == 28) + { + this.name = "Lesser Healing Potion"; + this.useSound = 3; + this.healLife = 50; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.potion = true; + this.value = 300; + goto IL_381A; + } + if (this.type == 29) + { + this.name = "Life Crystal"; + this.maxStack = 99; + this.consumable = true; + this.width = 18; + this.height = 18; + this.useStyle = 4; + this.useTime = 30; + this.useSound = 4; + this.useAnimation = 30; + this.toolTip = "Permanently increases maximum life by 20"; + this.rare = 2; + this.value = 75000; + goto IL_381A; + } + if (this.type == 30) + { + this.name = "Dirt Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 16; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 31) + { + this.name = "Bottle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 13; + this.width = 16; + this.height = 24; + this.value = 20; + goto IL_381A; + } + if (this.type == 32) + { + this.name = "Wooden Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_381A; + } + if (this.type == 33) + { + this.name = "Furnace"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 17; + this.width = 26; + this.height = 24; + this.value = 300; + this.toolTip = "Used for smelting ore"; + goto IL_381A; + } + if (this.type == 34) + { + this.name = "Wooden Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.width = 12; + this.height = 30; + this.value = 150; + goto IL_381A; + } + if (this.type == 35) + { + this.name = "Iron Anvil"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 16; + this.width = 28; + this.height = 14; + this.value = 5000; + this.toolTip = "Used to craft items from metal bars"; + goto IL_381A; + } + if (this.type == 36) + { + this.name = "Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_381A; + } + if (this.type == 37) + { + this.name = "Goggles"; + this.width = 28; + this.height = 12; + this.defense = 1; + this.headSlot = 10; + this.rare = 1; + this.value = 1000; + goto IL_381A; + } + if (this.type == 38) + { + this.name = "Lens"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = 500; + goto IL_381A; + } + if (this.type == 39) + { + this.useStyle = 5; + this.useAnimation = 30; + this.useTime = 30; + this.name = "Wooden Bow"; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 4; + this.shootSpeed = 6.1f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + goto IL_381A; + } + if (this.type == 40) + { + this.name = "Wooden Arrow"; + this.shootSpeed = 3f; + this.shoot = 1; + this.damage = 4; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 2f; + this.value = 10; + this.ranged = true; + goto IL_381A; + } + if (this.type == 41) + { + this.name = "Flaming Arrow"; + this.shootSpeed = 3.5f; + this.shoot = 2; + this.damage = 6; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 2f; + this.value = 15; + this.ranged = true; + goto IL_381A; + } + if (this.type == 42) + { + this.useStyle = 1; + this.name = "Shuriken"; + this.shootSpeed = 9f; + this.shoot = 3; + this.damage = 10; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 20; + this.ranged = true; + goto IL_381A; + } + if (this.type == 43) + { + this.useStyle = 4; + this.name = "Suspicious Looking Eye"; + this.width = 22; + this.height = 14; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.maxStack = 20; + this.toolTip = "Summons the Eye of Cthulhu"; + goto IL_381A; + } + if (this.type == 44) + { + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 25; + this.name = "Demon Bow"; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 14; + this.shootSpeed = 6.7f; + this.knockBack = 1f; + this.alpha = 30; + this.rare = 1; + this.noMelee = true; + this.value = 18000; + this.ranged = true; + goto IL_381A; + } + if (this.type == 45) + { + this.name = "War Axe of the Night"; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 30; + this.knockBack = 6f; + this.useTime = 15; + this.width = 24; + this.height = 28; + this.damage = 20; + this.axe = 15; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 1; + this.value = 13500; + this.melee = true; + goto IL_381A; + } + if (this.type == 46) + { + this.name = "Light's Bane"; + this.useStyle = 1; + this.useAnimation = 20; + this.knockBack = 5f; + this.width = 24; + this.height = 28; + this.damage = 17; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 1; + this.value = 13500; + this.melee = true; + goto IL_381A; + } + if (this.type == 47) + { + this.name = "Unholy Arrow"; + this.shootSpeed = 3.4f; + this.shoot = 4; + this.damage = 8; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 3f; + this.alpha = 30; + this.rare = 1; + this.value = 40; + this.ranged = true; + goto IL_381A; + } + if (this.type == 48) + { + this.name = "Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_381A; + } + if (this.type == 49) + { + this.name = "Band of Regeneration"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.lifeRegen = 1; + this.rare = 1; + this.toolTip = "Slowly regenerates life"; + this.value = 50000; + goto IL_381A; + } + if (this.type == 50) + { + this.name = "Magic Mirror"; + this.useTurn = true; + this.width = 20; + this.height = 20; + this.useStyle = 4; + this.useTime = 90; + this.useSound = 6; + this.useAnimation = 90; + this.toolTip = "Gaze in the mirror to return home"; + this.rare = 1; + this.value = 50000; + goto IL_381A; + } + if (this.type == 51) + { + this.name = "Jester's Arrow"; + this.shootSpeed = 0.5f; + this.shoot = 5; + this.damage = 9; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 4f; + this.rare = 1; + this.value = 100; + this.ranged = true; + goto IL_381A; + } + if (this.type == 52 || this.type == 673 || this.type == 677 || this.type == 678 || this.type == 858) + { + this.type = 52; + this.name = "Angel Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 1; + goto IL_381A; + } + if (this.type == 53) + { + this.name = "Cloud in a Bottle"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "Allows the holder to double jump"; + this.value = 50000; + goto IL_381A; + } + if (this.type == 54) + { + this.name = "Hermes Boots"; + this.width = 28; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "The wearer can run super fast"; + this.value = 50000; + goto IL_381A; + } + if (this.type == 55) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Enchanted Boomerang"; + this.shootSpeed = 10f; + this.shoot = 6; + this.damage = 13; + this.knockBack = 8f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.rare = 1; + this.value = 50000; + this.melee = true; + goto IL_381A; + } + if (this.type == 56) + { + this.name = "Demonite Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 22; + this.width = 12; + this.height = 12; + this.rare = 1; + this.toolTip = "'Pulsing with dark energy'"; + this.value = 4000; + goto IL_381A; + } + if (this.type == 57) + { + this.name = "Demonite Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.rare = 1; + this.toolTip = "'Pulsing with dark energy'"; + this.value = 16000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 8; + goto IL_381A; + } + if (this.type == 58) + { + this.name = "Heart"; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 59) + { + this.name = "Corrupt Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 23; + this.width = 14; + this.height = 14; + this.value = 500; + goto IL_381A; + } + if (this.type == 60) + { + this.name = "Vile Mushroom"; + this.width = 16; + this.height = 18; + this.maxStack = 99; + this.value = 50; + goto IL_381A; + } + if (this.type == 61) + { + this.name = "Ebonstone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 25; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 62) + { + this.name = "Grass Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 2; + this.width = 14; + this.height = 14; + this.value = 20; + goto IL_381A; + } + if (this.type == 63) + { + this.name = "Sunflower"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 27; + this.width = 26; + this.height = 26; + this.value = 200; + goto IL_381A; + } + if (this.type == 64) + { + this.mana = 10; + this.damage = 10; + this.useStyle = 1; + this.name = "Vilethorn"; + this.shootSpeed = 32f; + this.shoot = 7; + this.width = 26; + this.height = 28; + this.useSound = 8; + this.useAnimation = 28; + this.useTime = 28; + this.rare = 1; + this.noMelee = true; + this.knockBack = 1f; + this.toolTip = "Summons a vile thorn"; + this.value = 10000; + this.magic = true; + goto IL_381A; + } + if (this.type == 65) + { + this.knockBack = 5f; + this.alpha = 100; + this.color = new Color(150, 150, 150, 0); + this.damage = 22; + this.useStyle = 1; + this.scale = 1.25f; + this.name = "Starfury"; + this.shootSpeed = 20f; + this.shoot = 9; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 21; + this.useTime = 60; + this.rare = 2; + this.toolTip = "Causes stars to rain from the sky"; + this.toolTip2 = "'Forged with the fury of heaven'"; + this.value = 50000; + this.melee = true; + goto IL_381A; + } + if (this.type == 66) + { + this.useStyle = 1; + this.name = "Purification Powder"; + this.shootSpeed = 4f; + this.shoot = 10; + this.width = 16; + this.height = 24; + this.maxStack = 99; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.toolTip = "Cleanses the corruption"; + this.value = 75; + goto IL_381A; + } + if (this.type == 67) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Vile Powder"; + this.shootSpeed = 4f; + this.shoot = 11; + this.width = 16; + this.height = 24; + this.maxStack = 99; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.value = 100; + this.toolTip = "Removes the Hallow"; + goto IL_381A; + } + if (this.type == 68) + { + this.name = "Rotten Chunk"; + this.width = 18; + this.height = 20; + this.maxStack = 99; + this.toolTip = "'Looks tasty!'"; + this.value = 10; + goto IL_381A; + } + if (this.type == 69) + { + this.name = "Worm Tooth"; + this.width = 8; + this.height = 20; + this.maxStack = 99; + this.value = 100; + goto IL_381A; + } + if (this.type == 70) + { + this.useStyle = 4; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Worm Food"; + this.width = 28; + this.height = 28; + this.maxStack = 20; + this.toolTip = "Summons the Eater of Worlds"; + goto IL_381A; + } + if (this.type == 71) + { + this.name = "Copper Coin"; + this.width = 10; + this.height = 12; + this.maxStack = 100; + this.value = 5; + this.ammo = 71; + this.shoot = 158; + this.notAmmo = true; + this.damage = 25; + this.shootSpeed = 1f; + this.ranged = true; + goto IL_381A; + } + if (this.type == 72) + { + this.name = "Silver Coin"; + this.width = 10; + this.height = 12; + this.maxStack = 100; + this.value = 500; + this.ammo = 71; + this.notAmmo = true; + this.damage = 50; + this.shoot = 159; + this.shootSpeed = 2f; + this.ranged = true; + goto IL_381A; + } + if (this.type == 73) + { + this.name = "Gold Coin"; + this.width = 10; + this.height = 12; + this.maxStack = 100; + this.value = 50000; + this.ammo = 71; + this.notAmmo = true; + this.damage = 100; + this.shoot = 160; + this.shootSpeed = 3f; + this.ranged = true; + goto IL_381A; + } + if (this.type == 74) + { + this.name = "Platinum Coin"; + this.width = 10; + this.height = 12; + this.maxStack = 100; + this.value = 5000000; + this.ammo = 71; + this.notAmmo = true; + this.damage = 200; + this.shoot = 161; + this.shootSpeed = 4f; + this.ranged = true; + goto IL_381A; + } + if (this.type == 75) + { + this.name = "Fallen Star"; + this.width = 18; + this.height = 20; + this.maxStack = 100; + this.alpha = 75; + this.ammo = 15; + this.toolTip = "Disappears after the sunrise"; + this.value = 500; + this.useStyle = 4; + this.useSound = 4; + this.useTurn = false; + this.useAnimation = 17; + this.useTime = 17; + this.consumable = true; + this.rare = 1; + goto IL_381A; + } + if (this.type == 76) + { + this.name = "Copper Greaves"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 1; + this.value = 750; + goto IL_381A; + } + if (this.type == 77) + { + this.name = "Iron Greaves"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.legSlot = 2; + this.value = 3000; + goto IL_381A; + } + if (this.type == 78) + { + this.name = "Silver Greaves"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.legSlot = 3; + this.value = 7500; + goto IL_381A; + } + if (this.type == 79) + { + this.name = "Gold Greaves"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.legSlot = 4; + this.value = 15000; + goto IL_381A; + } + if (this.type == 80) + { + this.name = "Copper Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.bodySlot = 1; + this.value = 1000; + goto IL_381A; + } + if (this.type == 81) + { + this.name = "Iron Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.bodySlot = 2; + this.value = 4000; + goto IL_381A; + } + if (this.type == 82) + { + this.name = "Silver Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.bodySlot = 3; + this.value = 10000; + goto IL_381A; + } + if (this.type == 83) + { + this.name = "Gold Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.bodySlot = 4; + this.value = 20000; + goto IL_381A; + } + if (this.type == 84) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Grappling Hook"; + this.shootSpeed = 11.5f; + this.shoot = 13; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + this.toolTip = "'Get over here!'"; + goto IL_381A; + } + if (this.type == 85) + { + this.name = "Chain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 8; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 214; + this.width = 12; + this.height = 12; + this.value = 1000; + this.tileBoost += 2; + this.toolTip = "Can be climbed on"; + goto IL_381A; + } + if (this.type == 86) + { + this.name = "Shadow Scale"; + this.width = 14; + this.height = 18; + this.maxStack = 99; + this.rare = 1; + this.value = 500; + goto IL_381A; + } + if (this.type == 87) + { + this.name = "Piggy Bank"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 29; + this.width = 20; + this.height = 12; + this.value = 10000; + goto IL_381A; + } + if (this.type == 88) + { + this.name = "Mining Helmet"; + this.width = 22; + this.height = 16; + this.defense = 1; + this.headSlot = 11; + this.rare = 1; + this.value = 80000; + this.toolTip = "Provides light when worn"; + goto IL_381A; + } + if (this.type == 89) + { + this.name = "Copper Helmet"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 1; + this.value = 1250; + goto IL_381A; + } + if (this.type == 90) + { + this.name = "Iron Helmet"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.headSlot = 2; + this.value = 5000; + goto IL_381A; + } + if (this.type == 91) + { + this.name = "Silver Helmet"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.headSlot = 3; + this.value = 12500; + goto IL_381A; + } + if (this.type == 92) + { + this.name = "Gold Helmet"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 4; + this.value = 25000; + goto IL_381A; + } + if (this.type == 93) + { + this.name = "Wood Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 4; + this.width = 12; + this.height = 12; + goto IL_381A; + } + if (this.type == 94) + { + this.name = "Wood Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.width = 8; + this.height = 10; + goto IL_381A; + } + if (this.type == 95) + { + this.useStyle = 5; + this.useAnimation = 16; + this.useTime = 16; + this.name = "Flintlock Pistol"; + this.width = 24; + this.height = 28; + this.shoot = 14; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 10; + this.shootSpeed = 5f; + this.noMelee = true; + this.value = 50000; + this.scale = 0.9f; + this.rare = 1; + this.ranged = true; + goto IL_381A; + } + if (this.type == 96) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 41; + this.useTime = 41; + this.name = "Musket"; + this.width = 44; + this.height = 14; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 25; + this.shootSpeed = 8.5f; + this.noMelee = true; + this.value = 100000; + this.knockBack = 4.5f; + this.rare = 1; + this.ranged = true; + goto IL_381A; + } + if (this.type == 97) + { + this.name = "Musket Ball"; + this.shootSpeed = 4f; + this.shoot = 14; + this.damage = 7; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 2f; + this.value = 7; + this.ranged = true; + goto IL_381A; + } + if (this.type == 98) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 8; + this.useTime = 8; + this.name = "Minishark"; + this.width = 50; + this.height = 18; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 6; + this.shootSpeed = 7f; + this.noMelee = true; + this.value = 350000; + this.rare = 2; + this.toolTip = "33% chance to not consume ammo"; + this.toolTip2 = "'Half shark, half gun, completely awesome.'"; + this.ranged = true; + goto IL_381A; + } + if (this.type == 99) + { + this.useStyle = 5; + this.useAnimation = 28; + this.useTime = 28; + this.name = "Iron Bow"; + this.color = new Color(160, 145, 130, 110); + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 8; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 1400; + this.ranged = true; + goto IL_381A; + } + if (this.type == 100) + { + this.name = "Shadow Greaves"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.legSlot = 5; + this.rare = 1; + this.value = 22500; + this.toolTip = "7% increased melee speed"; + goto IL_381A; + } + if (this.type == 101) + { + this.name = "Shadow Scalemail"; + this.width = 18; + this.height = 18; + this.defense = 7; + this.bodySlot = 5; + this.rare = 1; + this.value = 30000; + this.toolTip = "7% increased melee speed"; + goto IL_381A; + } + if (this.type == 102) + { + this.name = "Shadow Helmet"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.headSlot = 5; + this.rare = 1; + this.value = 37500; + this.toolTip = "7% increased melee speed"; + goto IL_381A; + } + if (this.type == 103) + { + this.name = "Nightmare Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 20; + this.useTime = 15; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 9; + this.pick = 65; + this.useSound = 1; + this.knockBack = 3f; + this.rare = 1; + this.value = 18000; + this.scale = 1.15f; + this.toolTip = "Able to mine Hellstone"; + this.melee = true; + goto IL_381A; + } + if (this.type == 104) + { + this.name = "The Breaker"; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 45; + this.useTime = 19; + this.hammer = 55; + this.width = 24; + this.height = 28; + this.damage = 24; + this.knockBack = 6f; + this.scale = 1.3f; + this.useSound = 1; + this.rare = 1; + this.value = 15000; + this.melee = true; + goto IL_381A; + } + if (this.type == 105) + { + this.flame = true; + this.noWet = true; + this.name = "Candle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.width = 8; + this.height = 18; + this.holdStyle = 1; + goto IL_381A; + } + if (this.type == 106) + { + this.name = "Copper Chandelier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.width = 26; + this.height = 26; + this.value = 3000; + goto IL_381A; + } + if (this.type == 107) + { + this.name = "Silver Chandelier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 35; + this.width = 26; + this.height = 26; + this.value = 12000; + goto IL_381A; + } + if (this.type == 108) + { + this.name = "Gold Chandelier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 36; + this.width = 26; + this.height = 26; + this.value = 24000; + goto IL_381A; + } + if (this.type == 109) + { + this.name = "Mana Crystal"; + this.maxStack = 99; + this.consumable = true; + this.width = 18; + this.height = 18; + this.useStyle = 4; + this.useTime = 30; + this.useSound = 29; + this.useAnimation = 30; + this.toolTip = "Permanently increases maximum mana by 20"; + this.rare = 2; + goto IL_381A; + } + if (this.type == 110) + { + this.name = "Lesser Mana Potion"; + this.useSound = 3; + this.healMana = 50; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 15; + this.consumable = true; + this.width = 14; + this.height = 24; + this.value = 200; + goto IL_381A; + } + if (this.type == 111) + { + this.name = "Band of Starpower"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 1; + this.toolTip = "Increases maximum mana by 20"; + this.value = 50000; + goto IL_381A; + } + if (this.type == 112) + { + this.mana = 17; + this.damage = 44; + this.useStyle = 1; + this.name = "Flower of Fire"; + this.shootSpeed = 6f; + this.shoot = 15; + this.width = 26; + this.height = 28; + this.useSound = 20; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.knockBack = 5.5f; + this.toolTip = "Throws balls of fire"; + this.value = 10000; + this.magic = true; + goto IL_381A; + } + if (this.type == 113) + { + this.mana = 10; + this.channel = true; + this.damage = 22; + this.useStyle = 1; + this.name = "Magic Missile"; + this.shootSpeed = 6f; + this.shoot = 16; + this.width = 26; + this.height = 28; + this.useSound = 9; + this.useAnimation = 17; + this.useTime = 17; + this.rare = 2; + this.noMelee = true; + this.knockBack = 5f; + this.toolTip = "Casts a controllable missile"; + this.value = 10000; + this.magic = true; + goto IL_381A; + } + if (this.type == 114) + { + this.channel = true; + this.damage = 0; + this.useStyle = 1; + this.name = "Dirt Rod"; + this.shoot = 17; + this.width = 26; + this.height = 28; + this.useSound = 8; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.knockBack = 5f; + this.toolTip = "Magically moves dirt"; + this.value = 200000; + goto IL_381A; + } + if (this.type == 115) + { + this.channel = true; + this.damage = 0; + this.useStyle = 4; + this.name = "Shadow Orb"; + this.shoot = 18; + this.width = 24; + this.height = 24; + this.useSound = 8; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.toolTip = "Creates a magical shadow orb"; + this.value = 10000; + this.buffType = 19; + goto IL_381A; + } + if (this.type == 116) + { + this.name = "Meteorite"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 37; + this.width = 12; + this.height = 12; + this.value = 1000; + goto IL_381A; + } + if (this.type == 117) + { + this.name = "Meteorite Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.rare = 1; + this.toolTip = "'Warm to the touch'"; + this.value = 7000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 9; + goto IL_381A; + } + if (this.type == 118) + { + this.name = "Hook"; + this.maxStack = 99; + this.width = 18; + this.height = 18; + this.value = 1000; + this.toolTip = "Sometimes dropped by Skeletons and Piranha"; + goto IL_381A; + } + if (this.type == 119) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Flamarang"; + this.shootSpeed = 11f; + this.shoot = 19; + this.damage = 32; + this.knockBack = 8f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.rare = 3; + this.value = 100000; + this.melee = true; + goto IL_381A; + } + if (this.type == 120) + { + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 25; + this.name = "Molten Fury"; + this.width = 14; + this.height = 32; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 29; + this.shootSpeed = 8f; + this.knockBack = 2f; + this.alpha = 30; + this.rare = 3; + this.noMelee = true; + this.scale = 1.1f; + this.value = 27000; + this.toolTip = "Lights wooden arrows ablaze"; + this.ranged = true; + goto IL_381A; + } + if (this.type == 121) + { + this.name = "Fiery Greatsword"; + this.useStyle = 1; + this.useAnimation = 34; + this.knockBack = 6.5f; + this.width = 24; + this.height = 28; + this.damage = 36; + this.scale = 1.3f; + this.useSound = 1; + this.rare = 3; + this.value = 27000; + this.toolTip = "'It's made out of fire!'"; + this.melee = true; + } + IL_381A: + if (this.type == 122) + { + this.name = "Molten Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 25; + this.useTime = 25; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 12; + this.pick = 100; + this.scale = 1.15f; + this.useSound = 1; + this.knockBack = 2f; + this.rare = 3; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 123) + { + this.name = "Meteor Helmet"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 6; + this.rare = 1; + this.value = 45000; + this.toolTip = "7% increased magic damage"; + goto IL_2B846; + } + if (this.type == 124) + { + this.name = "Meteor Suit"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.bodySlot = 6; + this.rare = 1; + this.value = 30000; + this.toolTip = "7% increased magic damage"; + goto IL_2B846; + } + if (this.type == 125) + { + this.name = "Meteor Leggings"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.legSlot = 6; + this.rare = 1; + this.value = 30000; + this.toolTip = "7% increased magic damage"; + goto IL_2B846; + } + if (this.type == 126) + { + this.name = "Bottled Water"; + this.useSound = 3; + this.healLife = 20; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.potion = true; + this.value = 20; + goto IL_2B846; + } + if (this.type == 127) + { + this.autoReuse = true; + this.useStyle = 5; + this.useAnimation = 18; + this.useTime = 18; + this.name = "Space Gun"; + this.width = 24; + this.height = 28; + this.shoot = 20; + this.mana = 8; + this.useSound = 12; + this.knockBack = 0.5f; + this.damage = 18; + this.shootSpeed = 10f; + this.noMelee = true; + this.scale = 0.8f; + this.rare = 1; + this.magic = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 128) + { + this.name = "Rocket Boots"; + this.width = 28; + this.height = 24; + this.accessory = true; + this.rare = 3; + this.toolTip = "Allows flight"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 129) + { + this.name = "Gray Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 38; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 130) + { + this.name = "Gray Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 5; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 131) + { + this.name = "Red Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 39; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 132) + { + this.name = "Red Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 6; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 133) + { + this.name = "Clay Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 40; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 134) + { + this.name = "Blue Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 41; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 135) + { + this.name = "Blue Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 17; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 136) + { + this.name = "Chain Lantern"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + goto IL_2B846; + } + if (this.type == 137) + { + this.name = "Green Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 43; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 138) + { + this.name = "Green Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 18; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 139) + { + this.name = "Pink Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 44; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 140) + { + this.name = "Pink Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 19; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 141) + { + this.name = "Gold Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 45; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 142) + { + this.name = "Gold Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 10; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 143) + { + this.name = "Silver Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 46; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 144) + { + this.name = "Silver Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 11; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 145) + { + this.name = "Copper Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 47; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 146) + { + this.name = "Copper Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 12; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 147) + { + this.name = "Spike"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 48; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 148) + { + this.flame = true; + this.noWet = true; + this.name = "Water Candle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 49; + this.width = 8; + this.height = 18; + this.holdStyle = 1; + this.toolTip = "Holding this may attract unwanted attention"; + goto IL_2B846; + } + if (this.type == 149) + { + this.name = "Book"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 50; + this.width = 24; + this.height = 28; + this.toolTip = "'It contains strange symbols'"; + goto IL_2B846; + } + if (this.type == 150) + { + this.name = "Cobweb"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 51; + this.width = 20; + this.height = 24; + this.alpha = 100; + goto IL_2B846; + } + if (this.type == 151) + { + this.name = "Necro Helmet"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 7; + this.rare = 2; + this.value = 45000; + this.toolTip = "4% increased ranged damage."; + goto IL_2B846; + } + if (this.type == 152) + { + this.name = "Necro Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.bodySlot = 7; + this.rare = 2; + this.value = 30000; + this.toolTip = "4% increased ranged damage."; + goto IL_2B846; + } + if (this.type == 153) + { + this.name = "Necro Greaves"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.legSlot = 7; + this.rare = 2; + this.value = 30000; + this.toolTip = "4% increased ranged damage."; + goto IL_2B846; + } + if (this.type == 154) + { + this.name = "Bone"; + this.maxStack = 99; + this.consumable = true; + this.width = 12; + this.height = 14; + this.value = 50; + this.useAnimation = 12; + this.useTime = 12; + this.useStyle = 1; + this.useSound = 1; + this.shootSpeed = 8f; + this.noUseGraphic = true; + this.damage = 22; + this.knockBack = 4f; + this.shoot = 21; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 155) + { + this.autoReuse = true; + this.useTurn = true; + this.name = "Muramasa"; + this.useStyle = 1; + this.useAnimation = 20; + this.width = 40; + this.height = 40; + this.damage = 18; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 2; + this.value = 27000; + this.knockBack = 1f; + this.melee = true; + goto IL_2B846; + } + if (this.type == 156) + { + this.name = "Cobalt Shield"; + this.width = 24; + this.height = 28; + this.rare = 2; + this.value = 27000; + this.accessory = true; + this.defense = 1; + this.toolTip = "Grants immunity to knockback"; + goto IL_2B846; + } + if (this.type == 157) + { + this.mana = 4; + this.autoReuse = true; + this.name = "Aqua Scepter"; + this.useStyle = 5; + this.useAnimation = 16; + this.useTime = 8; + this.knockBack = 5f; + this.width = 38; + this.height = 10; + this.damage = 15; + this.scale = 1f; + this.shoot = 22; + this.shootSpeed = 11f; + this.useSound = 13; + this.rare = 2; + this.value = 27000; + this.toolTip = "Sprays out a shower of water"; + this.magic = true; + goto IL_2B846; + } + if (this.type == 158) + { + this.name = "Lucky Horseshoe"; + this.width = 20; + this.height = 22; + this.rare = 1; + this.value = 27000; + this.accessory = true; + this.toolTip = "Negates fall damage"; + goto IL_2B846; + } + if (this.type == 159) + { + this.name = "Shiny Red Balloon"; + this.width = 14; + this.height = 28; + this.rare = 1; + this.value = 27000; + this.accessory = true; + this.toolTip = "Increases jump height"; + goto IL_2B846; + } + if (this.type == 160) + { + this.autoReuse = true; + this.name = "Harpoon"; + this.useStyle = 5; + this.useAnimation = 30; + this.useTime = 30; + this.knockBack = 6f; + this.width = 30; + this.height = 10; + this.damage = 25; + this.scale = 1.1f; + this.shoot = 23; + this.shootSpeed = 11f; + this.useSound = 10; + this.rare = 2; + this.value = 27000; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 161) + { + this.useStyle = 1; + this.name = "Spiky Ball"; + this.shootSpeed = 5f; + this.shoot = 24; + this.knockBack = 1f; + this.damage = 15; + this.width = 10; + this.height = 10; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 80; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 162) + { + this.name = "Ball O' Hurt"; + this.useStyle = 5; + this.useAnimation = 45; + this.useTime = 45; + this.knockBack = 6.5f; + this.width = 30; + this.height = 10; + this.damage = 15; + this.scale = 1.1f; + this.noUseGraphic = true; + this.shoot = 25; + this.shootSpeed = 12f; + this.useSound = 1; + this.rare = 1; + this.value = 27000; + this.melee = true; + this.channel = true; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 163) + { + this.name = "Blue Moon"; + this.useStyle = 5; + this.useAnimation = 45; + this.useTime = 45; + this.knockBack = 7f; + this.width = 30; + this.height = 10; + this.damage = 23; + this.scale = 1.1f; + this.noUseGraphic = true; + this.shoot = 26; + this.shootSpeed = 12f; + this.useSound = 1; + this.rare = 2; + this.value = 27000; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 164) + { + this.autoReuse = false; + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.name = "Handgun"; + this.width = 24; + this.height = 24; + this.shoot = 14; + this.knockBack = 3f; + this.useAmmo = 14; + this.useSound = 41; + this.damage = 15; + this.shootSpeed = 10f; + this.noMelee = true; + this.value = 50000; + this.scale = 0.85f; + this.rare = 2; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 165) + { + this.autoReuse = true; + this.rare = 2; + this.mana = 10; + this.useSound = 21; + this.name = "Water Bolt"; + this.useStyle = 5; + this.damage = 17; + this.useAnimation = 17; + this.useTime = 17; + this.width = 24; + this.height = 28; + this.shoot = 27; + this.scale = 0.9f; + this.shootSpeed = 4.5f; + this.knockBack = 5f; + this.toolTip = "Casts a slow moving bolt of water"; + this.magic = true; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 166) + { + this.useStyle = 1; + this.name = "Bomb"; + this.shootSpeed = 5f; + this.shoot = 28; + this.width = 20; + this.height = 20; + this.maxStack = 100; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 25; + this.useTime = 25; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.buyPrice(0, 0, 3, 0); + this.damage = 0; + this.toolTip = "A small explosion that will destroy some tiles"; + goto IL_2B846; + } + if (this.type == 167) + { + this.useStyle = 1; + this.name = "Dynamite"; + this.shootSpeed = 4f; + this.shoot = 29; + this.width = 8; + this.height = 28; + this.maxStack = 30; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 40; + this.useTime = 40; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.sellPrice(0, 0, 30, 0); + this.rare = 1; + this.toolTip = "A large explosion that will destroy most tiles"; + goto IL_2B846; + } + if (this.type == 168) + { + this.useStyle = 5; + this.name = "Grenade"; + this.shootSpeed = 5.5f; + this.shoot = 30; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 45; + this.useTime = 45; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 75; + this.damage = 60; + this.knockBack = 8f; + this.toolTip = "A small explosion that will not destroy tiles"; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 169) + { + this.name = "Sand Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 53; + this.width = 12; + this.height = 12; + this.ammo = 42; + goto IL_2B846; + } + if (this.type == 170) + { + this.name = "Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 54; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 171) + { + this.name = "Sign"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 55; + this.width = 28; + this.height = 28; + goto IL_2B846; + } + if (this.type == 172) + { + this.name = "Ash Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 57; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 173) + { + this.name = "Obsidian"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 56; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 174) + { + this.name = "Hellstone"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 58; + this.width = 12; + this.height = 12; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 175) + { + this.name = "Hellstone Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.rare = 2; + this.toolTip = "'Hot to the touch'"; + this.value = 20000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 10; + goto IL_2B846; + } + if (this.type == 176) + { + this.name = "Mud Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 59; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 181) + { + this.name = "Amethyst"; + this.createTile = 178; + this.placeStyle = 0; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 1875; + goto IL_2B846; + } + if (this.type == 180) + { + this.name = "Topaz"; + this.createTile = 178; + this.placeStyle = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 3750; + goto IL_2B846; + } + if (this.type == 177) + { + this.name = "Sapphire"; + this.createTile = 178; + this.placeStyle = 2; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 5625; + goto IL_2B846; + } + if (this.type == 179) + { + this.name = "Emerald"; + this.createTile = 178; + this.placeStyle = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 7500; + goto IL_2B846; + } + if (this.type == 178) + { + this.name = "Ruby"; + this.createTile = 178; + this.placeStyle = 4; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 11250; + goto IL_2B846; + } + if (this.type == 182) + { + this.name = "Diamond"; + this.createTile = 178; + this.placeStyle = 5; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 15000; + goto IL_2B846; + } + if (this.type == 183) + { + this.name = "Glowing Mushroom"; + this.width = 16; + this.height = 18; + this.value = 50; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 190; + goto IL_2B846; + } + if (this.type == 184) + { + this.name = "Star"; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 185) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Ivy Whip"; + this.shootSpeed = 13f; + this.shoot = 32; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 186) + { + this.name = "Breathing Reed"; + this.width = 44; + this.height = 44; + this.rare = 1; + this.value = 10000; + this.holdStyle = 2; + this.toolTip = "'Because not drowning is kinda nice'"; + goto IL_2B846; + } + if (this.type == 187) + { + this.name = "Flipper"; + this.width = 28; + this.height = 28; + this.rare = 1; + this.value = 10000; + this.accessory = true; + this.toolTip = "Grants the ability to swim"; + goto IL_2B846; + } + if (this.type == 188) + { + this.name = "Healing Potion"; + this.useSound = 3; + this.healLife = 100; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.rare = 1; + this.potion = true; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 189) + { + this.name = "Mana Potion"; + this.useSound = 3; + this.healMana = 100; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 25; + this.consumable = true; + this.width = 14; + this.height = 24; + this.rare = 1; + this.value = 500; + goto IL_2B846; + } + if (this.type == 190) + { + this.name = "Blade of Grass"; + this.useStyle = 1; + this.useAnimation = 30; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 28; + this.scale = 1.4f; + this.useSound = 1; + this.rare = 3; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 191) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Thorn Chakram"; + this.shootSpeed = 11f; + this.shoot = 33; + this.damage = 25; + this.knockBack = 8f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.rare = 3; + this.value = 50000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 192) + { + this.name = "Obsidian Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 75; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 193) + { + this.name = "Obsidian Skull"; + this.width = 20; + this.height = 22; + this.rare = 2; + this.value = 27000; + this.accessory = true; + this.defense = 1; + this.toolTip = "Grants immunity to fire blocks"; + goto IL_2B846; + } + if (this.type == 194) + { + this.name = "Mushroom Grass Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 70; + this.width = 14; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 195) + { + this.name = "Jungle Grass Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 60; + this.width = 14; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 196) + { + this.name = "Wooden Hammer"; + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 37; + this.useTime = 25; + this.hammer = 25; + this.width = 24; + this.height = 28; + this.damage = 2; + this.knockBack = 5.5f; + this.scale = 1.2f; + this.useSound = 1; + this.tileBoost = -1; + this.value = 50; + this.melee = true; + goto IL_2B846; + } + if (this.type == 197) + { + this.autoReuse = true; + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.name = "Star Cannon"; + this.width = 50; + this.height = 18; + this.shoot = 12; + this.useAmmo = 15; + this.useSound = 9; + this.damage = 55; + this.shootSpeed = 14f; + this.noMelee = true; + this.value = 500000; + this.rare = 2; + this.toolTip = "Shoots fallen stars"; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 198) + { + this.name = "Blue Phaseblade"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 21; + this.scale = 1f; + this.useSound = 15; + this.rare = 1; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 199) + { + this.name = "Red Phaseblade"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 21; + this.scale = 1f; + this.useSound = 15; + this.rare = 1; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 200) + { + this.name = "Green Phaseblade"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 21; + this.scale = 1f; + this.useSound = 15; + this.rare = 1; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 201) + { + this.name = "Purple Phaseblade"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 21; + this.scale = 1f; + this.useSound = 15; + this.rare = 1; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 202) + { + this.name = "White Phaseblade"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 21; + this.scale = 1f; + this.useSound = 15; + this.rare = 1; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 203) + { + this.name = "Yellow Phaseblade"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 3f; + this.width = 40; + this.height = 40; + this.damage = 21; + this.scale = 1f; + this.useSound = 15; + this.rare = 1; + this.value = 27000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 204) + { + this.name = "Meteor Hamaxe"; + this.useTurn = true; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 30; + this.useTime = 16; + this.hammer = 60; + this.axe = 20; + this.width = 24; + this.height = 28; + this.damage = 20; + this.knockBack = 7f; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 1; + this.value = 15000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 205) + { + this.name = "Empty Bucket"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.width = 20; + this.height = 20; + this.headSlot = 13; + this.defense = 1; + goto IL_2B846; + } + if (this.type == 206) + { + this.name = "Water Bucket"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 207) + { + this.name = "Lava Bucket"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 208) + { + this.name = "Jungle Rose"; + this.width = 20; + this.height = 20; + this.value = 100; + this.headSlot = 23; + this.toolTip = "'It's pretty, oh so pretty'"; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 209) + { + this.name = "Stinger"; + this.width = 16; + this.height = 18; + this.maxStack = 99; + this.value = 200; + goto IL_2B846; + } + if (this.type == 210) + { + this.name = "Vine"; + this.width = 14; + this.height = 20; + this.maxStack = 99; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 211) + { + this.name = "Feral Claws"; + this.width = 20; + this.height = 20; + this.accessory = true; + this.rare = 3; + this.toolTip = "12% increased melee speed"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 212) + { + this.name = "Anklet of the Wind"; + this.width = 20; + this.height = 20; + this.accessory = true; + this.rare = 3; + this.toolTip = "10% increased movement speed"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 213) + { + this.name = "Staff of Regrowth"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 25; + this.useTime = 13; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 7; + this.createTile = 2; + this.scale = 1.2f; + this.useSound = 1; + this.knockBack = 3f; + this.rare = 3; + this.value = 2000; + this.toolTip = "Creates grass on dirt"; + this.melee = true; + goto IL_2B846; + } + if (this.type == 214) + { + this.name = "Hellstone Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 76; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 215) + { + this.name = "Whoopie Cushion"; + this.width = 18; + this.height = 18; + this.useTurn = true; + this.useTime = 30; + this.useAnimation = 30; + this.noUseGraphic = true; + this.useStyle = 10; + this.useSound = 16; + this.rare = 2; + this.toolTip = "'May annoy others'"; + this.value = 100; + goto IL_2B846; + } + if (this.type == 216) + { + this.name = "Shackle"; + this.width = 20; + this.height = 20; + this.rare = 1; + this.value = 1500; + this.accessory = true; + this.defense = 1; + goto IL_2B846; + } + if (this.type == 217) + { + this.name = "Molten Hamaxe"; + this.useTurn = true; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 27; + this.useTime = 14; + this.hammer = 70; + this.axe = 30; + this.width = 24; + this.height = 28; + this.damage = 20; + this.knockBack = 7f; + this.scale = 1.4f; + this.useSound = 1; + this.rare = 3; + this.value = 15000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 218) + { + this.mana = 16; + this.channel = true; + this.damage = 34; + this.useStyle = 1; + this.name = "Flamelash"; + this.shootSpeed = 6f; + this.shoot = 34; + this.width = 26; + this.height = 28; + this.useSound = 20; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.knockBack = 6.5f; + this.toolTip = "Summons a controllable ball of fire"; + this.value = 10000; + this.magic = true; + goto IL_2B846; + } + if (this.type == 219) + { + this.autoReuse = false; + this.useStyle = 5; + this.useAnimation = 11; + this.useTime = 11; + this.name = "Phoenix Blaster"; + this.width = 24; + this.height = 22; + this.shoot = 14; + this.knockBack = 2f; + this.useAmmo = 14; + this.useSound = 41; + this.damage = 23; + this.shootSpeed = 13f; + this.noMelee = true; + this.value = 50000; + this.scale = 0.85f; + this.rare = 3; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 220) + { + this.name = "Sunfury"; + this.noMelee = true; + this.useStyle = 5; + this.useAnimation = 45; + this.useTime = 45; + this.knockBack = 7f; + this.width = 30; + this.height = 10; + this.damage = 33; + this.scale = 1.1f; + this.noUseGraphic = true; + this.shoot = 35; + this.shootSpeed = 12f; + this.useSound = 1; + this.rare = 3; + this.value = 27000; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 221) + { + this.name = "Hellforge"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 77; + this.width = 26; + this.height = 24; + this.value = 3000; + goto IL_2B846; + } + if (this.type == 222) + { + this.name = "Clay Pot"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 78; + this.width = 14; + this.height = 14; + this.value = 100; + this.toolTip = "Grows plants"; + goto IL_2B846; + } + if (this.type == 223) + { + this.name = "Nature's Gift"; + this.width = 20; + this.height = 22; + this.rare = 3; + this.value = 27000; + this.accessory = true; + this.toolTip = "6% reduced mana usage"; + goto IL_2B846; + } + if (this.type == 224) + { + this.name = "Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 225) + { + this.name = "Silk"; + this.maxStack = 99; + this.width = 22; + this.height = 22; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 226) + { + this.name = "Lesser Restoration Potion"; + this.useSound = 3; + this.healMana = 50; + this.healLife = 50; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 20; + this.consumable = true; + this.width = 14; + this.height = 24; + this.potion = true; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 227) + { + this.name = "Restoration Potion"; + this.useSound = 3; + this.healMana = 100; + this.healLife = 100; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 20; + this.consumable = true; + this.width = 14; + this.height = 24; + this.potion = true; + this.value = 4000; + goto IL_2B846; + } + if (this.type == 228) + { + this.name = "Jungle Hat"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 8; + this.rare = 3; + this.value = 45000; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "3% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 229) + { + this.name = "Jungle Shirt"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.bodySlot = 8; + this.rare = 3; + this.value = 30000; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "3% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 230) + { + this.name = "Jungle Pants"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.legSlot = 8; + this.rare = 3; + this.value = 30000; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "3% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 231) + { + this.name = "Molten Helmet"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.headSlot = 9; + this.rare = 3; + this.value = 45000; + goto IL_2B846; + } + if (this.type == 232) + { + this.name = "Molten Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 9; + this.bodySlot = 9; + this.rare = 3; + this.value = 30000; + goto IL_2B846; + } + if (this.type == 233) + { + this.name = "Molten Greaves"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.legSlot = 9; + this.rare = 3; + this.value = 30000; + goto IL_2B846; + } + if (this.type == 234) + { + this.name = "Meteor Shot"; + this.shootSpeed = 3f; + this.shoot = 36; + this.damage = 9; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 1f; + this.value = 8; + this.rare = 1; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 235) + { + this.useStyle = 1; + this.name = "Sticky Bomb"; + this.shootSpeed = 5f; + this.shoot = 37; + this.width = 20; + this.height = 20; + this.maxStack = 50; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 25; + this.useTime = 25; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 500; + this.damage = 0; + this.toolTip = "'Tossing may be difficult.'"; + goto IL_2B846; + } + if (this.type == 236) + { + this.name = "Black Lens"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 237) + { + this.name = "Sunglasses"; + this.width = 28; + this.height = 12; + this.headSlot = 12; + this.rare = 2; + this.value = 10000; + this.toolTip = "'Makes you look cool!'"; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 238) + { + this.name = "Wizard Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 14; + this.rare = 2; + this.value = 10000; + this.defense = 2; + this.toolTip = "15% increased magic damage"; + goto IL_2B846; + } + if (this.type == 239) + { + this.name = "Top Hat"; + this.width = 18; + this.height = 18; + this.headSlot = 15; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 240) + { + this.name = "Tuxedo Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 10; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 241) + { + this.name = "Tuxedo Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 10; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 242) + { + this.name = "Summer Hat"; + this.width = 18; + this.height = 18; + this.headSlot = 16; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 243) + { + this.name = "Bunny Hood"; + this.width = 18; + this.height = 18; + this.headSlot = 17; + this.value = 20000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 244) + { + this.name = "Plumber's Hat"; + this.width = 18; + this.height = 12; + this.headSlot = 18; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 245) + { + this.name = "Plumber's Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 11; + this.value = 250000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 246) + { + this.name = "Plumber's Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 11; + this.value = 250000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 247) + { + this.name = "Hero's Hat"; + this.width = 18; + this.height = 12; + this.headSlot = 19; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 248) + { + this.name = "Hero's Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 12; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 249) + { + this.name = "Hero's Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 12; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 250) + { + this.name = "Fish Bowl"; + this.width = 18; + this.height = 18; + this.headSlot = 20; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 251) + { + this.name = "Archaeologist's Hat"; + this.width = 18; + this.height = 12; + this.headSlot = 21; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 252) + { + this.name = "Archaeologist's Jacket"; + this.width = 18; + this.height = 18; + this.bodySlot = 13; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 253) + { + this.name = "Archaeologist's Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 13; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 254) + { + this.name = "Black Thread"; + this.maxStack = 99; + this.width = 12; + this.height = 20; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 255) + { + this.name = "Green Thread"; + this.maxStack = 99; + this.width = 12; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 256) + { + this.name = "Ninja Hood"; + this.width = 18; + this.height = 12; + this.headSlot = 22; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 257) + { + this.name = "Ninja Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 14; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 258) + { + this.name = "Ninja Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 14; + this.value = 5000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 259) + { + this.name = "Leather"; + this.width = 18; + this.height = 20; + this.maxStack = 99; + this.value = 50; + goto IL_2B846; + } + if (this.type == 260) + { + this.name = "Red Hat"; + this.width = 18; + this.height = 14; + this.headSlot = 24; + this.value = 1000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 261) + { + this.name = "Goldfish"; + this.useStyle = 2; + this.useSound = 2; + this.useTurn = false; + this.useAnimation = 17; + this.useTime = 17; + this.width = 20; + this.height = 10; + this.maxStack = 99; + this.healLife = 20; + this.consumable = true; + this.value = Item.sellPrice(0, 0, 1, 0); + this.potion = true; + this.toolTip = "'It's smiling, might be a good snack'"; + goto IL_2B846; + } + if (this.type == 262) + { + this.name = "Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 15; + this.value = 2000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 263) + { + this.name = "Robot Hat"; + this.width = 18; + this.height = 18; + this.headSlot = 25; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 264) + { + this.name = "Gold Crown"; + this.width = 18; + this.height = 18; + this.headSlot = 26; + this.value = 10000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 265) + { + this.name = "Hellfire Arrow"; + this.shootSpeed = 6.5f; + this.shoot = 41; + this.damage = 10; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 8f; + this.value = 100; + this.rare = 2; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 266) + { + this.useStyle = 5; + this.useAnimation = 16; + this.useTime = 16; + this.autoReuse = true; + this.name = "Sandgun"; + this.width = 40; + this.height = 20; + this.shoot = 42; + this.useAmmo = 42; + this.useSound = 11; + this.damage = 30; + this.shootSpeed = 12f; + this.noMelee = true; + this.knockBack = 5f; + this.value = 10000; + this.rare = 2; + this.toolTip = "'This is a good idea!'"; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 267) + { + this.accessory = true; + this.name = "Guide Voodoo Doll"; + this.width = 14; + this.height = 26; + this.value = 1000; + this.toolTip = "'You are a terrible person.'"; + goto IL_2B846; + } + if (this.type == 268) + { + this.headSlot = 27; + this.defense = 2; + this.name = "Diving Helmet"; + this.width = 20; + this.height = 20; + this.value = 1000; + this.rare = 2; + this.toolTip = "Greatly extends underwater breathing"; + goto IL_2B846; + } + if (this.type == 269) + { + this.name = "Familiar Shirt"; + this.bodySlot = 0; + this.width = 20; + this.height = 20; + this.value = 10000; + this.color = Main.player[Main.myPlayer].shirtColor; + goto IL_2B846; + } + if (this.type == 270) + { + this.name = "Familiar Pants"; + this.legSlot = 0; + this.width = 20; + this.height = 20; + this.value = 10000; + this.color = Main.player[Main.myPlayer].pantsColor; + goto IL_2B846; + } + if (this.type == 271) + { + this.name = "Familiar Wig"; + this.headSlot = 0; + this.width = 20; + this.height = 20; + this.value = 10000; + this.color = Main.player[Main.myPlayer].hairColor; + goto IL_2B846; + } + if (this.type == 272) + { + this.mana = 14; + this.damage = 35; + this.useStyle = 5; + this.name = "Demon Scythe"; + this.shootSpeed = 0.2f; + this.shoot = 45; + this.width = 26; + this.height = 28; + this.useSound = 8; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.knockBack = 5f; + this.scale = 0.9f; + this.toolTip = "Casts a demon scythe"; + this.value = 10000; + this.magic = true; + goto IL_2B846; + } + if (this.type == 273) + { + this.name = "Night's Edge"; + this.useStyle = 1; + this.useAnimation = 27; + this.useTime = 27; + this.knockBack = 4.5f; + this.width = 40; + this.height = 40; + this.damage = 42; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 3; + this.value = 54000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 274) + { + this.name = "Dark Lance"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 25; + this.shootSpeed = 5f; + this.knockBack = 4f; + this.width = 40; + this.height = 40; + this.damage = 27; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 46; + this.rare = 3; + this.value = 27000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 275) + { + this.name = "Coral"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 81; + this.width = 20; + this.height = 22; + this.value = 400; + goto IL_2B846; + } + if (this.type == 276) + { + this.name = "Cactus"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 188; + this.width = 12; + this.height = 12; + this.value = 10; + goto IL_2B846; + } + if (this.type == 277) + { + this.name = "Trident"; + this.useStyle = 5; + this.useAnimation = 31; + this.useTime = 31; + this.shootSpeed = 4f; + this.knockBack = 5f; + this.width = 40; + this.height = 40; + this.damage = 10; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 47; + this.rare = 1; + this.value = 10000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 278) + { + this.name = "Silver Bullet"; + this.shootSpeed = 4.5f; + this.shoot = 14; + this.damage = 9; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 3f; + this.value = 15; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 279) + { + this.useStyle = 1; + this.name = "Throwing Knife"; + this.shootSpeed = 10f; + this.shoot = 48; + this.damage = 12; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 50; + this.knockBack = 2f; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 280) + { + this.name = "Spear"; + this.useStyle = 5; + this.useAnimation = 31; + this.useTime = 31; + this.shootSpeed = 3.7f; + this.knockBack = 6.5f; + this.width = 32; + this.height = 32; + this.damage = 8; + this.scale = 1f; + this.useSound = 1; + this.shoot = 49; + this.value = 1000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 281) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Blowpipe"; + this.width = 38; + this.height = 6; + this.shoot = 10; + this.useAmmo = 51; + this.useSound = 5; + this.damage = 9; + this.shootSpeed = 11f; + this.noMelee = true; + this.value = 10000; + this.knockBack = 3.5f; + this.useAmmo = 51; + this.toolTip = "Allows the collection of seeds for ammo"; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 282) + { + this.useStyle = 1; + this.name = "Glowstick"; + this.shootSpeed = 6f; + this.shoot = 50; + this.width = 12; + this.height = 12; + this.maxStack = 99; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.value = 10; + this.holdStyle = 1; + this.toolTip = "Works when wet"; + goto IL_2B846; + } + if (this.type == 283) + { + this.name = "Seed"; + this.shoot = 51; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.ammo = 51; + this.toolTip = "For use with Blowpipe"; + this.damage = 1; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 284) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Wooden Boomerang"; + this.shootSpeed = 6.5f; + this.shoot = 52; + this.damage = 7; + this.knockBack = 5f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 16; + this.useTime = 16; + this.noUseGraphic = true; + this.value = 5000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 285) + { + this.name = "Aglet"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "5% increased movement speed"; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 286) + { + this.useStyle = 1; + this.name = "Sticky Glowstick"; + this.shootSpeed = 6f; + this.shoot = 53; + this.width = 12; + this.height = 12; + this.maxStack = 99; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.value = 20; + this.holdStyle = 1; + goto IL_2B846; + } + if (this.type == 287) + { + this.useStyle = 1; + this.name = "Poisoned Knife"; + this.shootSpeed = 11f; + this.shoot = 54; + this.damage = 13; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 60; + this.knockBack = 2f; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 288) + { + this.name = "Obsidian Skin Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 1; + this.buffTime = 14400; + this.toolTip = "Provides immunity to lava"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 289) + { + this.name = "Regeneration Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 2; + this.buffTime = 18000; + this.toolTip = "Provides life regeneration"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 290) + { + this.name = "Swiftness Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 3; + this.buffTime = 14400; + this.toolTip = "25% increased movement speed"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 291) + { + this.name = "Gills Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 4; + this.buffTime = 7200; + this.toolTip = "Breathe water instead of air"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 292) + { + this.name = "Ironskin Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 5; + this.buffTime = 18000; + this.toolTip = "Increase defense by 8"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 293) + { + this.name = "Mana Regeneration Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 6; + this.buffTime = 7200; + this.toolTip = "Increased mana regeneration"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 294) + { + this.name = "Magic Power Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 7; + this.buffTime = 7200; + this.toolTip = "20% increased magic damage"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 295) + { + this.name = "Featherfall Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 8; + this.buffTime = 18000; + this.toolTip = "Slows falling speed"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 296) + { + this.name = "Spelunker Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 9; + this.buffTime = 18000; + this.toolTip = "Shows the location of treasure and ore"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 297) + { + this.name = "Invisibility Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 10; + this.buffTime = 7200; + this.toolTip = "Grants invisibility"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 298) + { + this.name = "Shine Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 11; + this.buffTime = 18000; + this.toolTip = "Emits an aura of light"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 299) + { + this.name = "Night Owl Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 12; + this.buffTime = 14400; + this.toolTip = "Increases night vision"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 300) + { + this.name = "Battle Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 13; + this.buffTime = 25200; + this.toolTip = "Increases enemy spawn rate"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 301) + { + this.name = "Thorns Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 14; + this.buffTime = 7200; + this.toolTip = "Attackers also take damage"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 302) + { + this.name = "Water Walking Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 15; + this.buffTime = 18000; + this.toolTip = "Allows the ability to walk on water"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 303) + { + this.name = "Archery Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 16; + this.buffTime = 14400; + this.toolTip = "20% increased arrow speed and damage"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 304) + { + this.name = "Hunter Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 17; + this.buffTime = 18000; + this.toolTip = "Shows the location of enemies"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 305) + { + this.name = "Gravitation Potion"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 18; + this.buffTime = 10800; + this.toolTip = "Allows the control of gravity"; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 306) + { + this.name = "Gold Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 1; + this.width = 26; + this.height = 22; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 307) + { + this.name = "Daybloom Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 82; + this.placeStyle = 0; + this.width = 12; + this.height = 14; + this.value = 80; + goto IL_2B846; + } + if (this.type == 308) + { + this.name = "Moonglow Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 82; + this.placeStyle = 1; + this.width = 12; + this.height = 14; + this.value = 80; + goto IL_2B846; + } + if (this.type == 309) + { + this.name = "Blinkroot Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 82; + this.placeStyle = 2; + this.width = 12; + this.height = 14; + this.value = 80; + goto IL_2B846; + } + if (this.type == 310) + { + this.name = "Deathweed Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 82; + this.placeStyle = 3; + this.width = 12; + this.height = 14; + this.value = 80; + goto IL_2B846; + } + if (this.type == 311) + { + this.name = "Waterleaf Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 82; + this.placeStyle = 4; + this.width = 12; + this.height = 14; + this.value = 80; + goto IL_2B846; + } + if (this.type == 312) + { + this.name = "Fireblossom Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 82; + this.placeStyle = 5; + this.width = 12; + this.height = 14; + this.value = 80; + goto IL_2B846; + } + if (this.type == 313) + { + this.name = "Daybloom"; + this.maxStack = 99; + this.width = 12; + this.height = 14; + this.value = 100; + goto IL_2B846; + } + if (this.type == 314) + { + this.name = "Moonglow"; + this.maxStack = 99; + this.width = 12; + this.height = 14; + this.value = 100; + goto IL_2B846; + } + if (this.type == 315) + { + this.name = "Blinkroot"; + this.maxStack = 99; + this.width = 12; + this.height = 14; + this.value = 100; + goto IL_2B846; + } + if (this.type == 316) + { + this.name = "Deathweed"; + this.maxStack = 99; + this.width = 12; + this.height = 14; + this.value = 100; + goto IL_2B846; + } + if (this.type == 317) + { + this.name = "Waterleaf"; + this.maxStack = 99; + this.width = 12; + this.height = 14; + this.value = 100; + goto IL_2B846; + } + if (this.type == 318) + { + this.name = "Fireblossom"; + this.maxStack = 99; + this.width = 12; + this.height = 14; + this.value = 100; + goto IL_2B846; + } + if (this.type == 319) + { + this.name = "Shark Fin"; + this.maxStack = 99; + this.width = 16; + this.height = 14; + this.value = 200; + goto IL_2B846; + } + if (this.type == 320) + { + this.name = "Feather"; + this.maxStack = 99; + this.width = 16; + this.height = 14; + this.value = 50; + goto IL_2B846; + } + if (this.type == 321) + { + this.name = "Tombstone"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 322) + { + this.name = "Mime Mask"; + this.headSlot = 28; + this.width = 20; + this.height = 20; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 323) + { + this.name = "Antlion Mandible"; + this.width = 10; + this.height = 20; + this.maxStack = 99; + this.value = 50; + goto IL_2B846; + } + if (this.type == 324) + { + this.name = "Illegal Gun Parts"; + this.width = 10; + this.height = 20; + this.maxStack = 99; + this.value = 250000; + this.toolTip = "'Banned in most places'"; + goto IL_2B846; + } + if (this.type == 325) + { + this.name = "The Doctor's Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 16; + this.value = 200000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 326) + { + this.name = "The Doctor's Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 15; + this.value = 200000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 327) + { + this.name = "Golden Key"; + this.width = 14; + this.height = 20; + this.maxStack = 99; + this.toolTip = "Opens one Gold Chest"; + goto IL_2B846; + } + if (this.type == 328) + { + this.name = "Shadow Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 3; + this.width = 26; + this.height = 22; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 329) + { + this.name = "Shadow Key"; + this.width = 14; + this.height = 20; + this.maxStack = 1; + this.toolTip = "Opens all Shadow Chests"; + this.value = 75000; + goto IL_2B846; + } + if (this.type == 330) + { + this.name = "Obsidian Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 20; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 331) + { + this.name = "Jungle Spores"; + this.width = 18; + this.height = 16; + this.maxStack = 99; + this.value = 100; + goto IL_2B846; + } + if (this.type == 332) + { + this.name = "Loom"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 86; + this.width = 20; + this.height = 20; + this.value = 300; + this.toolTip = "Used for crafting cloth"; + goto IL_2B846; + } + if (this.type == 333) + { + this.name = "Piano"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 334) + { + this.name = "Dresser"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 335) + { + this.name = "Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 336) + { + this.name = "Bathtub"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 90; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 337) + { + this.name = "Red Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 0; + this.width = 10; + this.height = 24; + this.value = 500; + goto IL_2B846; + } + if (this.type == 338) + { + this.name = "Green Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 1; + this.width = 10; + this.height = 24; + this.value = 500; + goto IL_2B846; + } + if (this.type == 339) + { + this.name = "Blue Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 2; + this.width = 10; + this.height = 24; + this.value = 500; + goto IL_2B846; + } + if (this.type == 340) + { + this.name = "Yellow Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 3; + this.width = 10; + this.height = 24; + this.value = 500; + goto IL_2B846; + } + if (this.type == 341) + { + this.name = "Lamp Post"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 92; + this.width = 10; + this.height = 24; + this.value = 500; + goto IL_2B846; + } + if (this.type == 342) + { + this.name = "Tiki Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.width = 10; + this.height = 24; + this.value = 500; + goto IL_2B846; + } + if (this.type == 343) + { + this.name = "Barrel"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 5; + this.width = 20; + this.height = 20; + this.value = 500; + goto IL_2B846; + } + if (this.type == 344) + { + this.name = "Chinese Lantern"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 95; + this.width = 20; + this.height = 20; + this.value = 500; + goto IL_2B846; + } + if (this.type == 345) + { + this.name = "Cooking Pot"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 96; + this.width = 20; + this.height = 20; + this.value = 500; + goto IL_2B846; + } + if (this.type == 346) + { + this.name = "Safe"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 97; + this.width = 20; + this.height = 20; + this.value = 200000; + goto IL_2B846; + } + if (this.type == 347) + { + this.name = "Skull Lantern"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 98; + this.width = 20; + this.height = 20; + this.value = 500; + goto IL_2B846; + } + if (this.type == 348) + { + this.name = "Trash Can"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 6; + this.width = 20; + this.height = 20; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 349) + { + this.name = "Candelabra"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.width = 20; + this.height = 20; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 350) + { + this.name = "Pink Vase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 13; + this.placeStyle = 3; + this.width = 16; + this.height = 24; + this.value = 70; + goto IL_2B846; + } + if (this.type == 351) + { + this.name = "Mug"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 13; + this.placeStyle = 4; + this.width = 16; + this.height = 24; + this.value = 20; + goto IL_2B846; + } + if (this.type == 352) + { + this.name = "Keg"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 94; + this.width = 24; + this.height = 24; + this.value = 600; + this.toolTip = "Used for brewing ale"; + goto IL_2B846; + } + if (this.type == 353) + { + this.name = "Ale"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 25; + this.buffTime = 7200; + this.value = 100; + goto IL_2B846; + } + if (this.type == 354) + { + this.name = "Bookcase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 355) + { + this.name = "Throne"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 102; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 356) + { + this.name = "Bowl"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 103; + this.width = 16; + this.height = 24; + this.value = 20; + goto IL_2B846; + } + if (this.type == 357) + { + this.name = "Bowl of Soup"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 36000; + this.rare = 1; + this.toolTip = "Minor improvements to all stats"; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 358) + { + this.name = "Toilet"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 1; + this.width = 12; + this.height = 30; + this.value = 150; + goto IL_2B846; + } + if (this.type == 359) + { + this.name = "Grandfather Clock"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 104; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 360) + { + this.name = "Armor Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 361) + { + this.useStyle = 4; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Goblin Battle Standard"; + this.width = 28; + this.height = 28; + this.toolTip = "Summons a Goblin Army"; + goto IL_2B846; + } + if (this.type == 362) + { + this.name = "Tattered Cloth"; + this.maxStack = 99; + this.width = 24; + this.height = 24; + this.value = 30; + goto IL_2B846; + } + if (this.type == 363) + { + this.name = "Sawmill"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 106; + this.width = 20; + this.height = 20; + this.value = 300; + this.toolTip = "Used for advanced wood crafting"; + goto IL_2B846; + } + if (this.type == 364) + { + this.name = "Cobalt Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 107; + this.width = 12; + this.height = 12; + this.value = 3500; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 365) + { + this.name = "Mythril Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 108; + this.width = 12; + this.height = 12; + this.value = 5500; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 366) + { + this.name = "Adamantite Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 111; + this.width = 12; + this.height = 12; + this.value = 7500; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 367) + { + this.name = "Pwnhammer"; + this.useTurn = true; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 27; + this.useTime = 14; + this.hammer = 80; + this.width = 24; + this.height = 28; + this.damage = 26; + this.knockBack = 7.5f; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 4; + this.value = 39000; + this.melee = true; + this.toolTip = "Strong enough to destroy Demon Altars"; + goto IL_2B846; + } + if (this.type == 368) + { + this.autoReuse = true; + this.name = "Excalibur"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 25; + this.knockBack = 4.5f; + this.width = 40; + this.height = 40; + this.damage = 47; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 5; + this.value = 230000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 369) + { + this.name = "Hallowed Seeds"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 109; + this.width = 14; + this.height = 14; + this.value = 2000; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 370) + { + this.name = "Ebonsand Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 112; + this.width = 12; + this.height = 12; + this.ammo = 42; + goto IL_2B846; + } + if (this.type == 371) + { + this.name = "Cobalt Hat"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.headSlot = 29; + this.rare = 4; + this.value = 75000; + this.toolTip = "Increases maximum mana by 40"; + this.toolTip2 = "9% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 372) + { + this.name = "Cobalt Helmet"; + this.width = 18; + this.height = 18; + this.defense = 11; + this.headSlot = 30; + this.rare = 4; + this.value = 75000; + this.toolTip = "7% increased movement speed"; + this.toolTip2 = "12% increased melee speed"; + goto IL_2B846; + } + if (this.type == 373) + { + this.name = "Cobalt Mask"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 31; + this.rare = 4; + this.value = 75000; + this.toolTip = "10% increased ranged damage"; + this.toolTip2 = "6% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 374) + { + this.name = "Cobalt Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.bodySlot = 17; + this.rare = 4; + this.value = 60000; + this.toolTip2 = "3% increased critical strike chance"; + goto IL_2B846; + } + if (this.type == 375) + { + this.name = "Cobalt Leggings"; + this.width = 18; + this.height = 18; + this.defense = 7; + this.legSlot = 16; + this.rare = 4; + this.value = 45000; + this.toolTip2 = "10% increased movement speed"; + goto IL_2B846; + } + if (this.type == 376) + { + this.name = "Mythril Hood"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.headSlot = 32; + this.rare = 4; + this.value = 112500; + this.toolTip = "Increases maximum mana by 60"; + this.toolTip2 = "15% increased magic damage"; + goto IL_2B846; + } + if (this.type == 377) + { + this.name = "Mythril Helmet"; + this.width = 18; + this.height = 18; + this.defense = 16; + this.headSlot = 33; + this.rare = 4; + this.value = 112500; + this.toolTip = "5% increased melee critical strike chance"; + this.toolTip2 = "10% increased melee damage"; + goto IL_2B846; + } + if (this.type == 378) + { + this.name = "Mythril Hat"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.headSlot = 34; + this.rare = 4; + this.value = 112500; + this.toolTip = "12% increased ranged damage"; + this.toolTip2 = "7% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 379) + { + this.name = "Mythril Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 12; + this.bodySlot = 18; + this.rare = 4; + this.value = 90000; + this.toolTip2 = "5% increased damage"; + goto IL_2B846; + } + if (this.type == 380) + { + this.name = "Mythril Greaves"; + this.width = 18; + this.height = 18; + this.defense = 9; + this.legSlot = 17; + this.rare = 4; + this.value = 67500; + this.toolTip2 = "3% increased critical strike chance"; + goto IL_2B846; + } + if (this.type == 381) + { + this.name = "Cobalt Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10500; + this.rare = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 11; + goto IL_2B846; + } + if (this.type == 382) + { + this.name = "Mythril Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 22000; + this.rare = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 13; + goto IL_2B846; + } + if (this.type == 383) + { + this.name = "Cobalt Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 8; + this.shootSpeed = 40f; + this.knockBack = 2.75f; + this.width = 20; + this.height = 12; + this.damage = 23; + this.axe = 14; + this.useSound = 23; + this.shoot = 57; + this.rare = 4; + this.value = 54000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 384) + { + this.name = "Mythril Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 8; + this.shootSpeed = 40f; + this.knockBack = 3f; + this.width = 20; + this.height = 12; + this.damage = 29; + this.axe = 17; + this.useSound = 23; + this.shoot = 58; + this.rare = 4; + this.value = 81000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 385) + { + this.name = "Cobalt Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 13; + this.shootSpeed = 32f; + this.knockBack = 0f; + this.width = 20; + this.height = 12; + this.damage = 10; + this.pick = 110; + this.useSound = 23; + this.shoot = 59; + this.rare = 4; + this.value = 54000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.toolTip = "Can mine Mythril and Orichalcum"; + goto IL_2B846; + } + if (this.type == 386) + { + this.name = "Mythril Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 10; + this.shootSpeed = 32f; + this.knockBack = 0f; + this.width = 20; + this.height = 12; + this.damage = 15; + this.pick = 150; + this.useSound = 23; + this.shoot = 60; + this.rare = 4; + this.value = 81000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.toolTip = "Can mine Adamantite and Titanium"; + goto IL_2B846; + } + if (this.type == 387) + { + this.name = "Adamantite Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 6; + this.shootSpeed = 40f; + this.knockBack = 4.5f; + this.width = 20; + this.height = 12; + this.damage = 33; + this.axe = 20; + this.useSound = 23; + this.shoot = 61; + this.rare = 4; + this.value = 108000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 388) + { + this.name = "Adamantite Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 32f; + this.knockBack = 0f; + this.width = 20; + this.height = 12; + this.damage = 20; + this.pick = 180; + this.useSound = 23; + this.shoot = 62; + this.rare = 4; + this.value = 108000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 389) + { + this.name = "Dao of Pow"; + this.noMelee = true; + this.useStyle = 5; + this.useAnimation = 45; + this.useTime = 45; + this.knockBack = 7f; + this.width = 30; + this.height = 10; + this.damage = 49; + this.scale = 1.1f; + this.noUseGraphic = true; + this.shoot = 63; + this.shootSpeed = 15f; + this.useSound = 1; + this.rare = 5; + this.value = 144000; + this.melee = true; + this.channel = true; + this.toolTip = "Has a chance to confuse"; + this.toolTip2 = "'Find your inner pieces'"; + goto IL_2B846; + } + if (this.type == 390) + { + this.name = "Mythril Halberd"; + this.useStyle = 5; + this.useAnimation = 26; + this.useTime = 26; + this.shootSpeed = 4.5f; + this.knockBack = 5f; + this.width = 40; + this.height = 40; + this.damage = 35; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 64; + this.rare = 4; + this.value = 67500; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 391) + { + this.name = "Adamantite Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 37500; + this.rare = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 15; + goto IL_2B846; + } + if (this.type == 392) + { + this.name = "Glass Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 21; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 393) + { + this.name = "Compass"; + this.width = 24; + this.height = 28; + this.rare = 3; + this.value = 100000; + this.accessory = true; + this.toolTip = "Shows horizontal position"; + goto IL_2B846; + } + if (this.type == 394) + { + this.name = "Diving Gear"; + this.width = 24; + this.height = 28; + this.rare = 4; + this.value = 100000; + this.accessory = true; + this.toolTip = "Grants the ability to swim"; + this.toolTip2 = "Greatly extends underwater breathing"; + goto IL_2B846; + } + if (this.type == 395) + { + this.name = "GPS"; + this.width = 24; + this.height = 28; + this.rare = 4; + this.value = 150000; + this.accessory = true; + this.toolTip = "Shows position"; + this.toolTip2 = "Tells the time"; + goto IL_2B846; + } + if (this.type == 396) + { + this.name = "Obsidian Horseshoe"; + this.width = 24; + this.height = 28; + this.rare = 4; + this.value = 100000; + this.accessory = true; + this.toolTip = "Negates fall damage"; + this.toolTip2 = "Grants immunity to fire blocks"; + goto IL_2B846; + } + if (this.type == 397) + { + this.name = "Obsidian Shield"; + this.width = 24; + this.height = 28; + this.rare = 4; + this.value = 100000; + this.accessory = true; + this.defense = 2; + this.toolTip = "Grants immunity to knockback"; + this.toolTip2 = "Grants immunity to fire blocks"; + goto IL_2B846; + } + if (this.type == 398) + { + this.name = "Tinkerer's Workshop"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 114; + this.width = 26; + this.height = 20; + this.value = 100000; + this.toolTip = "Allows the combining of some accessories"; + goto IL_2B846; + } + if (this.type == 399) + { + this.name = "Cloud in a Balloon"; + this.width = 14; + this.height = 28; + this.rare = 4; + this.value = 150000; + this.accessory = true; + this.toolTip = "Allows the holder to double jump"; + this.toolTip2 = "Increases jump height"; + goto IL_2B846; + } + if (this.type == 400) + { + this.name = "Adamantite Headgear"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 35; + this.rare = 4; + this.value = 150000; + this.toolTip = "Increases maximum mana by 80"; + this.toolTip2 = "11% increased magic damage and critical strike chance"; + goto IL_2B846; + } + if (this.type == 401) + { + this.name = "Adamantite Helmet"; + this.width = 18; + this.height = 18; + this.defense = 22; + this.headSlot = 36; + this.rare = 4; + this.value = 150000; + this.toolTip = "7% increased melee critical strike chance"; + this.toolTip2 = "14% increased melee damage"; + goto IL_2B846; + } + if (this.type == 402) + { + this.name = "Adamantite Mask"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.headSlot = 37; + this.rare = 4; + this.value = 150000; + this.toolTip = "14% increased ranged damage"; + this.toolTip2 = "8% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 403) + { + this.name = "Adamantite Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 14; + this.bodySlot = 19; + this.rare = 4; + this.value = 120000; + this.toolTip = "6% increased damage"; + goto IL_2B846; + } + if (this.type == 404) + { + this.name = "Adamantite Leggings"; + this.width = 18; + this.height = 18; + this.defense = 10; + this.legSlot = 18; + this.rare = 4; + this.value = 90000; + this.toolTip = "4% increased critical strike chance"; + this.toolTip2 = "5% increased movement speed"; + goto IL_2B846; + } + if (this.type == 405) + { + this.name = "Spectre Boots"; + this.width = 28; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Allows flight"; + this.toolTip2 = "The wearer can run super fast"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 406) + { + this.name = "Adamantite Glaive"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 25; + this.shootSpeed = 5f; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 38; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 66; + this.rare = 4; + this.value = 90000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 407) + { + this.name = "Toolbelt"; + this.width = 28; + this.height = 24; + this.accessory = true; + this.rare = 3; + this.toolTip = "Increases block placement range"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 408) + { + this.name = "Pearlsand Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 116; + this.width = 12; + this.height = 12; + this.ammo = 42; + goto IL_2B846; + } + if (this.type == 409) + { + this.name = "Pearlstone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 117; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 410) + { + this.name = "Mining Shirt"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.bodySlot = 20; + this.value = 5000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 411) + { + this.name = "Mining Pants"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 19; + this.value = 5000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 412) + { + this.name = "Pearlstone Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 118; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 413) + { + this.name = "Iridescent Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 119; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 414) + { + this.name = "Mudstone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 120; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 415) + { + this.name = "Cobalt Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 121; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 416) + { + this.name = "Mythril Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 122; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 417) + { + this.name = "Pearlstone Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 22; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 418) + { + this.name = "Iridescent Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 23; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 419) + { + this.name = "Mudstone Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 24; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 420) + { + this.name = "Cobalt Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 25; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 421) + { + this.name = "Mythril Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 26; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 422) + { + this.useStyle = 1; + this.name = "Holy Water"; + this.shootSpeed = 9f; + this.rare = 3; + this.damage = 20; + this.shoot = 69; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.knockBack = 3f; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 200; + this.toolTip = "Spreads the Hallow to some blocks"; + goto IL_2B846; + } + if (this.type == 423) + { + this.useStyle = 1; + this.name = "Unholy Water"; + this.shootSpeed = 9f; + this.rare = 3; + this.damage = 20; + this.shoot = 70; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.knockBack = 3f; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 200; + this.toolTip = "Spreads the corruption to some blocks"; + goto IL_2B846; + } + if (this.type == 424) + { + this.name = "Silt Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 123; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 425) + { + this.channel = true; + this.damage = 0; + this.useStyle = 1; + this.name = "Fairy Bell"; + this.shoot = 72; + this.width = 24; + this.height = 24; + this.useSound = 25; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 5; + this.noMelee = true; + this.toolTip = "Summons a magical fairy"; + this.value = (this.value = 250000); + this.buffType = 27; + goto IL_2B846; + } + if (this.type == 426) + { + this.name = "Breaker Blade"; + this.useStyle = 1; + this.useAnimation = 30; + this.knockBack = 8f; + this.width = 60; + this.height = 70; + this.damage = 39; + this.scale = 1.05f; + this.useSound = 1; + this.rare = 4; + this.value = 150000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 427) + { + this.flame = true; + this.noWet = true; + this.name = "Blue Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 1; + this.width = 10; + this.height = 12; + this.value = 200; + goto IL_2B846; + } + if (this.type == 428) + { + this.flame = true; + this.noWet = true; + this.name = "Red Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 2; + this.width = 10; + this.height = 12; + this.value = 200; + goto IL_2B846; + } + if (this.type == 429) + { + this.flame = true; + this.noWet = true; + this.name = "Green Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 3; + this.width = 10; + this.height = 12; + this.value = 200; + goto IL_2B846; + } + if (this.type == 430) + { + this.flame = true; + this.noWet = true; + this.name = "Purple Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 4; + this.width = 10; + this.height = 12; + this.value = 200; + goto IL_2B846; + } + if (this.type == 431) + { + this.flame = true; + this.noWet = true; + this.name = "White Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 5; + this.width = 10; + this.height = 12; + this.value = 500; + goto IL_2B846; + } + if (this.type == 432) + { + this.flame = true; + this.noWet = true; + this.name = "Yellow Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 6; + this.width = 10; + this.height = 12; + this.value = 200; + goto IL_2B846; + } + if (this.type == 433) + { + this.flame = true; + this.noWet = true; + this.name = "Demon Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 7; + this.width = 10; + this.height = 12; + this.value = 300; + goto IL_2B846; + } + if (this.type == 434) + { + this.autoReuse = true; + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 4; + this.reuseDelay = 14; + this.name = "Clockwork Assault Rifle"; + this.width = 50; + this.height = 18; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 31; + this.damage = 19; + this.shootSpeed = 7.75f; + this.noMelee = true; + this.value = 150000; + this.rare = 4; + this.ranged = true; + this.toolTip = "Three round burst"; + this.toolTip2 = "Only the first shot consumes ammo"; + goto IL_2B846; + } + if (this.type == 435) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 25; + this.useTime = 25; + this.name = "Cobalt Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 30; + this.shootSpeed = 9f; + this.noMelee = true; + this.value = 60000; + this.ranged = true; + this.rare = 4; + this.knockBack = 1.5f; + goto IL_2B846; + } + if (this.type == 436) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 23; + this.useTime = 23; + this.name = "Mythril Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 34; + this.shootSpeed = 9.5f; + this.noMelee = true; + this.value = 90000; + this.ranged = true; + this.rare = 4; + this.knockBack = 2f; + goto IL_2B846; + } + if (this.type == 437) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Dual Hook"; + this.shootSpeed = 14f; + this.shoot = 73; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 4; + this.noMelee = true; + this.value = 200000; + goto IL_2B846; + } + if (this.type == 438) + { + this.name = "Star Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 2; + goto IL_2B846; + } + if (this.type == 439) + { + this.name = "Sword Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 3; + goto IL_2B846; + } + if (this.type == 440) + { + this.name = "Slime Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 4; + goto IL_2B846; + } + if (this.type == 441) + { + this.name = "Goblin Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 5; + goto IL_2B846; + } + if (this.type == 442) + { + this.name = "Shield Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 6; + goto IL_2B846; + } + if (this.type == 443) + { + this.name = "Bat Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 7; + goto IL_2B846; + } + if (this.type == 444) + { + this.name = "Fish Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 8; + goto IL_2B846; + } + if (this.type == 445) + { + this.name = "Bunny Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 9; + goto IL_2B846; + } + if (this.type == 446) + { + this.name = "Skeleton Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 10; + goto IL_2B846; + } + if (this.type == 447) + { + this.name = "Reaper Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 11; + goto IL_2B846; + } + if (this.type == 448) + { + this.name = "Woman Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 12; + goto IL_2B846; + } + if (this.type == 449) + { + this.name = "Imp Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 13; + goto IL_2B846; + } + if (this.type == 450) + { + this.name = "Gargoyle Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 14; + goto IL_2B846; + } + if (this.type == 451) + { + this.name = "Gloom Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 15; + goto IL_2B846; + } + if (this.type == 452) + { + this.name = "Hornet Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 16; + goto IL_2B846; + } + if (this.type == 453) + { + this.name = "Bomb Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 17; + goto IL_2B846; + } + if (this.type == 454) + { + this.name = "Crab Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 18; + goto IL_2B846; + } + if (this.type == 455) + { + this.name = "Hammer Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 19; + goto IL_2B846; + } + if (this.type == 456) + { + this.name = "Potion Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 20; + goto IL_2B846; + } + if (this.type == 457) + { + this.name = "Spear Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 21; + goto IL_2B846; + } + if (this.type == 458) + { + this.name = "Cross Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 22; + goto IL_2B846; + } + if (this.type == 459) + { + this.name = "Jellyfish Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 23; + goto IL_2B846; + } + if (this.type == 460) + { + this.name = "Bow Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 24; + goto IL_2B846; + } + if (this.type == 461) + { + this.name = "Boomerang Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 25; + goto IL_2B846; + } + if (this.type == 462) + { + this.name = "Boot Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 26; + goto IL_2B846; + } + if (this.type == 463) + { + this.name = "Chest Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 27; + goto IL_2B846; + } + if (this.type == 464) + { + this.name = "Bird Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 28; + goto IL_2B846; + } + if (this.type == 465) + { + this.name = "Axe Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 29; + goto IL_2B846; + } + if (this.type == 466) + { + this.name = "Corrupt Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 30; + goto IL_2B846; + } + if (this.type == 467) + { + this.name = "Tree Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 31; + goto IL_2B846; + } + if (this.type == 468) + { + this.name = "Anvil Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 32; + goto IL_2B846; + } + if (this.type == 469) + { + this.name = "Pickaxe Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 33; + goto IL_2B846; + } + if (this.type == 470) + { + this.name = "Mushroom Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 34; + goto IL_2B846; + } + if (this.type == 471) + { + this.name = "Eyeball Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 35; + goto IL_2B846; + } + if (this.type == 472) + { + this.name = "Pillar Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 36; + goto IL_2B846; + } + if (this.type == 473) + { + this.name = "Heart Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 37; + goto IL_2B846; + } + if (this.type == 474) + { + this.name = "Pot Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 38; + goto IL_2B846; + } + if (this.type == 475) + { + this.name = "Sunflower Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 39; + goto IL_2B846; + } + if (this.type == 476) + { + this.name = "King Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 40; + goto IL_2B846; + } + if (this.type == 477) + { + this.name = "Queen Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 41; + goto IL_2B846; + } + if (this.type == 478) + { + this.name = "Pirahna Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 42; + goto IL_2B846; + } + if (this.type == 479) + { + this.name = "Planked Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 27; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 480) + { + this.name = "Wooden Beam"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 124; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 481) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 20; + this.useTime = 20; + this.name = "Adamantite Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 37; + this.shootSpeed = 10f; + this.noMelee = true; + this.value = 120000; + this.ranged = true; + this.rare = 4; + this.knockBack = 2.5f; + goto IL_2B846; + } + if (this.type == 482) + { + this.name = "Adamantite Sword"; + this.useStyle = 1; + this.useAnimation = 27; + this.useTime = 27; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 44; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 4; + this.value = 138000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 483) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Cobalt Sword"; + this.useStyle = 1; + this.useAnimation = 23; + this.useTime = 23; + this.knockBack = 3.85f; + this.width = 40; + this.height = 40; + this.damage = 34; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 4; + this.value = 69000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 484) + { + this.name = "Mythril Sword"; + this.useStyle = 1; + this.useAnimation = 26; + this.useTime = 26; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 39; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 4; + this.value = 103500; + this.melee = true; + goto IL_2B846; + } + if (this.type == 485) + { + this.rare = 4; + this.name = "Moon Charm"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Turns the holder into a werewolf on full moons"; + this.value = 150000; + goto IL_2B846; + } + if (this.type == 486) + { + this.name = "Ruler"; + this.width = 10; + this.height = 26; + this.accessory = true; + this.toolTip = "Creates a grid on screen for block placement"; + this.value = 10000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 487) + { + this.name = "Crystal Ball"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 125; + this.width = 22; + this.height = 22; + this.value = 100000; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 488) + { + this.name = "Disco Ball"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 126; + this.width = 22; + this.height = 26; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 489) + { + this.name = "Sorcerer Emblem"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "15% increased magic damage"; + this.value = 100000; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 491) + { + this.name = "Ranger Emblem"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "15% increased ranged damage"; + this.value = 100000; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 490) + { + this.name = "Warrior Emblem"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "15% increased melee damage"; + this.value = 100000; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 492) + { + this.name = "Demon Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 493) + { + this.name = "Angel Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 494) + { + this.rare = 5; + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.name = "Magical Harp"; + this.width = 12; + this.height = 28; + this.shoot = 76; + this.holdStyle = 3; + this.autoReuse = true; + this.damage = 30; + this.shootSpeed = 4.5f; + this.noMelee = true; + this.value = 200000; + this.mana = 4; + this.magic = true; + goto IL_2B846; + } + if (this.type == 495) + { + this.rare = 5; + this.mana = 10; + this.channel = true; + this.damage = 53; + this.useStyle = 1; + this.name = "Rainbow Rod"; + this.shootSpeed = 6f; + this.shoot = 79; + this.width = 26; + this.height = 28; + this.useSound = 28; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.knockBack = 5f; + this.toolTip = "Casts a controllable rainbow"; + this.value = 200000; + this.magic = true; + goto IL_2B846; + } + if (this.type == 496) + { + this.rare = 4; + this.mana = 7; + this.damage = 26; + this.useStyle = 1; + this.name = "Ice Rod"; + this.shootSpeed = 12f; + this.shoot = 80; + this.width = 26; + this.height = 28; + this.useSound = 28; + this.useAnimation = 17; + this.useTime = 17; + this.rare = 4; + this.autoReuse = true; + this.noMelee = true; + this.knockBack = 0f; + this.toolTip = "Summons a block of ice"; + this.value = 1000000; + this.magic = true; + this.knockBack = 2f; + goto IL_2B846; + } + if (this.type == 497) + { + this.name = "Neptune's Shell"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Transforms the holder into merfolk when entering water"; + this.value = 150000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 498) + { + this.name = "Mannequin"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 128; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 499) + { + this.name = "Greater Healing Potion"; + this.useSound = 3; + this.healLife = 150; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.rare = 3; + this.potion = true; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 500) + { + this.name = "Greater Mana Potion"; + this.useSound = 3; + this.healMana = 200; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 50; + this.consumable = true; + this.width = 14; + this.height = 24; + this.rare = 3; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 501) + { + this.name = "Pixie Dust"; + this.width = 16; + this.height = 14; + this.maxStack = 99; + this.value = 500; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 502) + { + this.name = "Crystal Shard"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 129; + this.width = 24; + this.height = 24; + this.value = 8000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 503) + { + this.name = "Clown Hat"; + this.width = 18; + this.height = 18; + this.headSlot = 40; + this.value = 20000; + this.vanity = true; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 504) + { + this.name = "Clown Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 23; + this.value = 10000; + this.vanity = true; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 505) + { + this.name = "Clown Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 22; + this.value = 10000; + this.vanity = true; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 506) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 30; + this.useTime = 6; + this.name = "Flamethrower"; + this.width = 50; + this.height = 18; + this.shoot = 85; + this.useAmmo = 23; + this.useSound = 34; + this.damage = 27; + this.knockBack = 0.3f; + this.shootSpeed = 7f; + this.noMelee = true; + this.value = 500000; + this.rare = 5; + this.ranged = true; + this.toolTip = "Uses gel for ammo"; + goto IL_2B846; + } + if (this.type == 507) + { + this.rare = 3; + this.useStyle = 1; + this.useAnimation = 12; + this.useTime = 12; + this.name = "Bell"; + this.width = 12; + this.height = 28; + this.autoReuse = true; + this.noMelee = true; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 508) + { + this.rare = 3; + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.name = "Harp"; + this.width = 12; + this.height = 28; + this.autoReuse = true; + this.noMelee = true; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 509) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.name = "Wrench"; + this.width = 24; + this.height = 28; + this.rare = 1; + this.toolTip = "Places red wire"; + this.value = 20000; + this.mech = true; + this.tileBoost = 3; + goto IL_2B846; + } + if (this.type == 510) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.name = "Wire Cutter"; + this.width = 24; + this.height = 28; + this.rare = 1; + this.toolTip = "Removes wire"; + this.value = 20000; + this.mech = true; + this.tileBoost = 3; + goto IL_2B846; + } + if (this.type == 511) + { + this.name = "Active Stone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 130; + this.width = 12; + this.height = 12; + this.value = 1000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 512) + { + this.name = "Inactive Stone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 131; + this.width = 12; + this.height = 12; + this.value = 1000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 513) + { + this.name = "Lever"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 132; + this.width = 24; + this.height = 24; + this.value = 3000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 514) + { + this.autoReuse = true; + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.name = "Laser Rifle"; + this.width = 36; + this.height = 22; + this.shoot = 88; + this.mana = 8; + this.useSound = 12; + this.knockBack = 2.5f; + this.damage = 29; + this.shootSpeed = 17f; + this.noMelee = true; + this.rare = 4; + this.magic = true; + this.value = 150000; + goto IL_2B846; + } + if (this.type == 515) + { + this.name = "Crystal Bullet"; + this.shootSpeed = 5f; + this.shoot = 89; + this.damage = 8; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 1f; + this.value = 30; + this.ranged = true; + this.rare = 3; + this.toolTip = "Creates several crystal shards on impact"; + goto IL_2B846; + } + if (this.type == 516) + { + this.name = "Holy Arrow"; + this.shootSpeed = 3.5f; + this.shoot = 91; + this.damage = 6; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 2f; + this.value = 80; + this.ranged = true; + this.rare = 3; + this.toolTip = "Summons falling stars on impact"; + goto IL_2B846; + } + if (this.type == 517) + { + this.useStyle = 1; + this.name = "Magic Dagger"; + this.shootSpeed = 12f; + this.shoot = 93; + this.damage = 40; + this.width = 18; + this.height = 20; + this.mana = 6; + this.useSound = 1; + this.useAnimation = 8; + this.useTime = 8; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 1000000; + this.knockBack = 3.75f; + this.magic = true; + this.rare = 4; + this.toolTip = "A magical returning dagger"; + goto IL_2B846; + } + if (this.type == 518) + { + this.autoReuse = true; + this.rare = 4; + this.mana = 5; + this.useSound = 9; + this.name = "Crystal Storm"; + this.useStyle = 5; + this.damage = 26; + this.useAnimation = 7; + this.useTime = 7; + this.width = 24; + this.height = 28; + this.shoot = 94; + this.scale = 0.9f; + this.shootSpeed = 16f; + this.knockBack = 5f; + this.toolTip = "Summons rapid fire crystal shards"; + this.magic = true; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 519) + { + this.autoReuse = true; + this.rare = 4; + this.mana = 14; + this.useSound = 20; + this.name = "Cursed Flames"; + this.useStyle = 5; + this.damage = 35; + this.useAnimation = 20; + this.useTime = 20; + this.width = 24; + this.height = 28; + this.shoot = 95; + this.scale = 0.9f; + this.shootSpeed = 10f; + this.knockBack = 6.5f; + this.toolTip = "Summons unholy fire balls"; + this.magic = true; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 520) + { + this.name = "Soul of Light"; + this.width = 18; + this.height = 18; + this.maxStack = 999; + this.value = 1000; + this.rare = 3; + this.toolTip = "'The essence of light creatures'"; + goto IL_2B846; + } + if (this.type == 521) + { + this.name = "Soul of Night"; + this.width = 18; + this.height = 18; + this.maxStack = 999; + this.value = 1000; + this.rare = 3; + this.toolTip = "'The essence of dark creatures'"; + goto IL_2B846; + } + if (this.type == 522) + { + this.name = "Cursed Flame"; + this.width = 12; + this.height = 14; + this.maxStack = 99; + this.value = 4000; + this.rare = 3; + this.toolTip = "'Not even water can put the flame out'"; + goto IL_2B846; + } + if (this.type == 523) + { + this.flame = true; + this.name = "Cursed Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 8; + this.width = 10; + this.height = 12; + this.value = 300; + this.rare = 1; + this.toolTip = "Can be placed in water"; + goto IL_2B846; + } + if (this.type == 524) + { + this.name = "Adamantite Forge"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 133; + this.width = 44; + this.height = 30; + this.value = 50000; + this.toolTip = "Used to smelt adamantite ore"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 525) + { + this.name = "Mythril Anvil"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 134; + this.width = 28; + this.height = 14; + this.value = 25000; + this.toolTip = "Used to craft items from mythril and adamantite bars"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 526) + { + this.name = "Unicorn Horn"; + this.width = 14; + this.height = 14; + this.maxStack = 99; + this.value = 15000; + this.rare = 1; + this.toolTip = "'Sharp and magical!'"; + goto IL_2B846; + } + if (this.type == 527) + { + this.name = "Dark Shard"; + this.width = 14; + this.height = 14; + this.maxStack = 99; + this.value = 4500; + this.rare = 2; + this.toolTip = "'Sometimes carried by creatures in corrupt deserts'"; + goto IL_2B846; + } + if (this.type == 528) + { + this.name = "Light Shard"; + this.width = 14; + this.height = 14; + this.maxStack = 99; + this.value = 4500; + this.rare = 2; + this.toolTip = "'Sometimes carried by creatures in light deserts'"; + goto IL_2B846; + } + if (this.type == 529) + { + this.name = "Red Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 0; + this.mech = true; + this.value = 5000; + this.mech = true; + this.toolTip = "Activates when stepped on"; + goto IL_2B846; + } + if (this.type == 530) + { + this.name = "Wire"; + this.width = 12; + this.height = 18; + this.maxStack = 999; + this.value = 500; + this.mech = true; + goto IL_2B846; + } + if (this.type == 531) + { + this.name = "Spell Tome"; + this.width = 12; + this.height = 18; + this.maxStack = 99; + this.value = 50000; + this.rare = 1; + this.toolTip = "Can be enchanted"; + goto IL_2B846; + } + if (this.type == 532) + { + this.name = "Star Cloak"; + this.width = 20; + this.height = 24; + this.value = 100000; + this.toolTip = "Causes stars to fall when injured"; + this.accessory = true; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 533) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 7; + this.useTime = 7; + this.name = "Megashark"; + this.width = 50; + this.height = 18; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 23; + this.shootSpeed = 10f; + this.noMelee = true; + this.value = 300000; + this.rare = 5; + this.toolTip = "50% chance to not consume ammo"; + this.toolTip2 = "'Minishark's older brother'"; + this.knockBack = 1f; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 534) + { + this.knockBack = 6.5f; + this.useStyle = 5; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Shotgun"; + this.width = 50; + this.height = 14; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 36; + this.damage = 21; + this.shootSpeed = 6f; + this.noMelee = true; + this.value = 250000; + this.rare = 4; + this.ranged = true; + this.toolTip = "Fires a spread of bullets"; + goto IL_2B846; + } + if (this.type == 535) + { + this.name = "Philosopher's Stone"; + this.width = 12; + this.height = 18; + this.value = 100000; + this.toolTip = "Reduces the cooldown of healing potions"; + this.accessory = true; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 536) + { + this.name = "Titan Glove"; + this.width = 12; + this.height = 18; + this.value = 100000; + this.toolTip = "Increases melee knockback"; + this.rare = 4; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 537) + { + this.name = "Cobalt Naginata"; + this.useStyle = 5; + this.useAnimation = 28; + this.useTime = 28; + this.shootSpeed = 4.3f; + this.knockBack = 4f; + this.width = 40; + this.height = 40; + this.damage = 29; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 97; + this.rare = 4; + this.value = 45000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 538) + { + this.name = "Switch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 136; + this.width = 12; + this.height = 12; + this.value = 2000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 539) + { + this.name = "Dart Trap"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 137; + this.width = 12; + this.height = 12; + this.value = 10000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 540) + { + this.name = "Boulder"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 138; + this.width = 12; + this.height = 12; + this.mech = true; + goto IL_2B846; + } + if (this.type == 541) + { + this.name = "Green Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 1; + this.mech = true; + this.value = 5000; + this.toolTip = "Activates when stepped on"; + goto IL_2B846; + } + if (this.type == 542) + { + this.name = "Gray Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 2; + this.mech = true; + this.value = 5000; + this.toolTip = "Activates when a player steps on it on"; + goto IL_2B846; + } + if (this.type == 543) + { + this.name = "Brown Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 3; + this.mech = true; + this.value = 5000; + this.toolTip = "Activates when a player steps on it on"; + goto IL_2B846; + } + if (this.type == 544) + { + this.useStyle = 4; + this.name = "Mechanical Eye"; + this.width = 22; + this.height = 14; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.maxStack = 20; + this.toolTip = "Summons The Twins"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 545) + { + this.name = "Cursed Arrow"; + this.shootSpeed = 4f; + this.shoot = 103; + this.damage = 14; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 3f; + this.value = 80; + this.ranged = true; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 546) + { + this.name = "Cursed Bullet"; + this.shootSpeed = 5f; + this.shoot = 104; + this.damage = 12; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 4f; + this.value = 30; + this.rare = 1; + this.ranged = true; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 547) + { + this.name = "Soul of Fright"; + this.width = 18; + this.height = 18; + this.maxStack = 999; + this.value = 100000; + this.rare = 5; + this.toolTip = "'The essence of pure terror'"; + goto IL_2B846; + } + if (this.type == 548) + { + this.name = "Soul of Might"; + this.width = 18; + this.height = 18; + this.maxStack = 999; + this.value = 100000; + this.rare = 5; + this.toolTip = "'The essence of the destroyer'"; + goto IL_2B846; + } + if (this.type == 549) + { + this.name = "Soul of Sight"; + this.width = 18; + this.height = 18; + this.maxStack = 999; + this.value = 100000; + this.rare = 5; + this.toolTip = "'The essence of omniscient watchers'"; + goto IL_2B846; + } + if (this.type == 550) + { + this.name = "Gungnir"; + this.useStyle = 5; + this.useAnimation = 22; + this.useTime = 22; + this.shootSpeed = 5.6f; + this.knockBack = 6.4f; + this.width = 40; + this.height = 40; + this.damage = 42; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 105; + this.rare = 5; + this.value = 1500000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 551) + { + this.name = "Hallowed Plate Mail"; + this.width = 18; + this.height = 18; + this.defense = 15; + this.bodySlot = 24; + this.rare = 5; + this.value = 200000; + this.toolTip = "7% increased critical strike chance"; + goto IL_2B846; + } + if (this.type == 552) + { + this.name = "Hallowed Greaves"; + this.width = 18; + this.height = 18; + this.defense = 11; + this.legSlot = 23; + this.rare = 5; + this.value = 150000; + this.toolTip = "7% increased damage"; + this.toolTip2 = "8% increased movement speed"; + goto IL_2B846; + } + if (this.type == 553) + { + this.name = "Hallowed Helmet"; + this.width = 18; + this.height = 18; + this.defense = 9; + this.headSlot = 41; + this.rare = 5; + this.value = 250000; + this.toolTip = "15% increased ranged damage"; + this.toolTip2 = "8% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 558) + { + this.name = "Hallowed Headgear"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 42; + this.rare = 5; + this.value = 250000; + this.toolTip = "Increases maximum mana by 100"; + this.toolTip2 = "12% increased magic damage and critical strike chance"; + goto IL_2B846; + } + if (this.type == 559) + { + this.name = "Hallowed Mask"; + this.width = 18; + this.height = 18; + this.defense = 24; + this.headSlot = 43; + this.rare = 5; + this.value = 250000; + this.toolTip = "10% increased melee damage and critical strike chance"; + this.toolTip2 = "10% increased melee haste"; + goto IL_2B846; + } + if (this.type == 554) + { + this.name = "Cross Necklace"; + this.width = 20; + this.height = 24; + this.value = 1500; + this.toolTip = "Increases length of invincibility after taking damage"; + this.accessory = true; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 555) + { + this.name = "Mana Flower"; + this.width = 20; + this.height = 24; + this.value = 50000; + this.toolTip = "8% reduced mana usage"; + this.toolTip2 = "Automatically use mana potions when needed"; + this.accessory = true; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 556) + { + this.useStyle = 4; + this.name = "Mechanical Worm"; + this.width = 22; + this.height = 14; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.maxStack = 20; + this.toolTip = "Summons Destroyer"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 557) + { + this.useStyle = 4; + this.name = "Mechanical Skull"; + this.width = 22; + this.height = 14; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.maxStack = 20; + this.toolTip = "Summons Skeletron Prime"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 560) + { + this.useStyle = 4; + this.name = "Slime Crown"; + this.width = 22; + this.height = 14; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.maxStack = 20; + this.toolTip = "Summons King Slime"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 561) + { + this.melee = true; + this.autoReuse = true; + this.noMelee = true; + this.useStyle = 1; + this.name = "Light Disc"; + this.shootSpeed = 13f; + this.shoot = 106; + this.damage = 35; + this.knockBack = 8f; + this.width = 24; + this.height = 24; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.rare = 5; + this.maxStack = 5; + this.value = 500000; + this.toolTip = "Stacks up to 5"; + goto IL_2B846; + } + if (this.type == 562) + { + this.name = "Music Box (Overworld Day)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 0; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 563) + { + this.name = "Music Box (Eerie)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 1; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 564) + { + this.name = "Music Box (Night)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 2; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 565) + { + this.name = "Music Box (Title)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 3; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 566) + { + this.name = "Music Box (Underground)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 4; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 567) + { + this.name = "Music Box (Boss 1)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 5; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 568) + { + this.name = "Music Box (Jungle)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 6; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 569) + { + this.name = "Music Box (Corruption)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 7; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 570) + { + this.name = "Music Box (Underground Corruption)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 8; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 571) + { + this.name = "Music Box (The Hallow)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 9; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 572) + { + this.name = "Music Box (Boss 2)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 10; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 573) + { + this.name = "Music Box (Underground Hallow)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 11; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 574) + { + this.name = "Music Box (Boss 3)"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 12; + this.width = 24; + this.height = 24; + this.rare = 3; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 575) + { + this.name = "Soul of Flight"; + this.width = 18; + this.height = 18; + this.maxStack = 999; + this.value = 1000; + this.rare = 3; + this.toolTip = "'The essence of powerful flying creatures'"; + goto IL_2B846; + } + if (this.type == 576) + { + this.name = "Music Box"; + this.width = 24; + this.height = 24; + this.rare = 3; + this.toolTip = "Has a chance to record songs"; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 577) + { + this.name = "Demonite Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 140; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 578) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 19; + this.useTime = 19; + this.name = "Hallowed Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 39; + this.shootSpeed = 11f; + this.noMelee = true; + this.value = 200000; + this.ranged = true; + this.rare = 4; + this.knockBack = 2.5f; + goto IL_2B846; + } + if (this.type == 579) + { + this.name = "Drax"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 36f; + this.knockBack = 4.75f; + this.width = 20; + this.height = 12; + this.damage = 35; + this.pick = 200; + this.axe = 22; + this.useSound = 23; + this.shoot = 107; + this.rare = 4; + this.value = 220000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.toolTip = "'Not to be confused with a picksaw'"; + goto IL_2B846; + } + if (this.type == 580) + { + this.mech = true; + this.name = "Explosives"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 141; + this.width = 12; + this.height = 12; + this.toolTip = "Explodes when activated"; + goto IL_2B846; + } + if (this.type == 581) + { + this.mech = true; + this.name = "Inlet Pump"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 142; + this.width = 12; + this.height = 12; + this.toolTip = "Sends water to outlet pumps"; + goto IL_2B846; + } + if (this.type == 582) + { + this.mech = true; + this.name = "Outlet Pump"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 143; + this.width = 12; + this.height = 12; + this.toolTip = "Receives water from inlet pumps"; + goto IL_2B846; + } + if (this.type == 583) + { + this.mech = true; + this.noWet = true; + this.name = "1 Second Timer"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 144; + this.placeStyle = 0; + this.width = 10; + this.height = 12; + this.value = 50; + this.toolTip = "Activates every second"; + goto IL_2B846; + } + if (this.type == 584) + { + this.mech = true; + this.noWet = true; + this.name = "3 Second Timer"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 144; + this.placeStyle = 1; + this.width = 10; + this.height = 12; + this.value = 50; + this.toolTip = "Activates every 3 seconds"; + goto IL_2B846; + } + if (this.type == 585) + { + this.mech = true; + this.noWet = true; + this.name = "5 Second Timer"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 144; + this.placeStyle = 2; + this.width = 10; + this.height = 12; + this.value = 50; + this.toolTip = "Activates every 5 seconds"; + goto IL_2B846; + } + if (this.type == 586) + { + this.name = "Candy Cane Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 145; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 587) + { + this.name = "Candy Cane Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 29; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 588) + { + this.name = "Santa Hat"; + this.width = 18; + this.height = 12; + this.headSlot = 44; + this.value = 150000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 589) + { + this.name = "Santa Shirt"; + this.width = 18; + this.height = 18; + this.bodySlot = 25; + this.value = 150000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 590) + { + this.name = "Santa Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 24; + this.value = 150000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 591) + { + this.name = "Green Candy Cane Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 146; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 592) + { + this.name = "Green Candy Cane Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 30; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 593) + { + this.name = "Snow Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 147; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 594) + { + this.name = "Snow Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 148; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 595) + { + this.name = "Snow Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 31; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 596) + { + this.name = "Blue Light"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 149; + this.placeStyle = 0; + this.width = 12; + this.height = 12; + this.value = 500; + goto IL_2B846; + } + if (this.type == 597) + { + this.name = "Red Light"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 149; + this.placeStyle = 1; + this.width = 12; + this.height = 12; + this.value = 500; + goto IL_2B846; + } + if (this.type == 598) + { + this.name = "Green Light"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 149; + this.placeStyle = 2; + this.width = 12; + this.height = 12; + this.value = 500; + goto IL_2B846; + } + if (this.type == 599) + { + this.name = "Blue Present"; + this.width = 12; + this.height = 12; + this.rare = 1; + this.toolTip = "Right click to open"; + goto IL_2B846; + } + if (this.type == 600) + { + this.name = "Green Present"; + this.width = 12; + this.height = 12; + this.rare = 1; + this.toolTip = "Right click to open"; + goto IL_2B846; + } + if (this.type == 601) + { + this.name = "Yellow Present"; + this.width = 12; + this.height = 12; + this.rare = 1; + this.toolTip = "Right click to open"; + goto IL_2B846; + } + if (this.type == 602) + { + this.name = "Snow Globe"; + this.useStyle = 4; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.width = 28; + this.height = 28; + this.toolTip = "Summons the Frost Legion"; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 603) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Carrot"; + this.shoot = 111; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a pet bunny"; + this.value = 0; + this.buffType = 40; + goto IL_2B846; + } + if (this.type == 604) + { + this.name = "Adamantite Beam"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 150; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 605) + { + this.name = "Adamantite Beam Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 32; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 606) + { + this.name = "Demonite Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 33; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 607) + { + this.name = "Sandstone Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 151; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 608) + { + this.name = "Sandstone Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 34; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 609) + { + this.name = "Ebonstone Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 152; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 610) + { + this.name = "Ebonstone Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 35; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 611) + { + this.name = "Red Stucco"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 153; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 612) + { + this.name = "Yellow Stucco"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 154; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 613) + { + this.name = "Green Stucco"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 155; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 614) + { + this.name = "Gray Stucco"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 156; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 615) + { + this.name = "Red Stucco Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 36; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 616) + { + this.name = "Yellow Stucco Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 37; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 617) + { + this.name = "Green Stucco Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 38; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 618) + { + this.name = "Gray Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 39; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 619) + { + this.name = "Ebonwood"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 157; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 620) + { + this.name = "Rich Mahogany"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 158; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 621) + { + this.name = "Pearlwood"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 159; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 622) + { + this.name = "Ebonwood Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 41; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 623) + { + this.name = "Rich Mahogany Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 42; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 624) + { + this.name = "Pearlwood Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 43; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 625) + { + this.name = "Ebonwood Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 7; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 626) + { + this.name = "Rich Mahogany Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 8; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 627) + { + this.name = "Pearlwood Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 9; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 628) + { + this.name = "Ebonwood Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 2; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 629) + { + this.name = "Rich Mahogany Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 3; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 630) + { + this.name = "Pearlwood Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 4; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 631) + { + this.name = "Ebonwood Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 1; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 632) + { + this.name = "Rich Mahogany Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 2; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 633) + { + this.name = "Pearlwood Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 3; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 634) + { + this.name = "Bone Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 4; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 635) + { + this.name = "Ebonwood Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 1; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 636) + { + this.name = "Rich Mahogany Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 2; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 637) + { + this.name = "Pearlwood Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 3; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 638) + { + this.name = "Ebonwood Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 1; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 639) + { + this.name = "Rich Mahogany Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 2; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 640) + { + this.name = "Pearlwood Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 3; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 641) + { + this.name = "Ebonwood Piano"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 1; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 642) + { + this.name = "Rich Mahogany Piano"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 2; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 643) + { + this.name = "Pearlwood Piano"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 3; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 644) + { + this.name = "Ebonwood Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 1; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 645) + { + this.name = "Rich Mahogany Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 2; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 646) + { + this.name = "Pearlwood Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 3; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 647) + { + this.name = "Ebonwood Dresser"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 1; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 648) + { + this.name = "Rich Mahogany Dresser"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 2; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 649) + { + this.name = "Pearlwood Dresser"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 3; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 650) + { + this.name = "Ebonwood Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 1; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 651) + { + this.name = "Rich Mahogany Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 2; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 652) + { + this.name = "Pearlwood Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 3; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 653) + { + this.name = "Ebonwood Sword"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 21; + this.useTime = 21; + this.width = 24; + this.height = 28; + this.damage = 10; + this.knockBack = 5f; + this.useSound = 1; + this.scale = 1f; + this.value = 100; + this.melee = true; + goto IL_2B846; + } + if (this.type == 654) + { + this.name = "Ebonwood Hammer"; + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 30; + this.useTime = 20; + this.hammer = 40; + this.width = 24; + this.height = 28; + this.damage = 7; + this.knockBack = 5.5f; + this.scale = 1.2f; + this.useSound = 1; + this.value = 50; + this.melee = true; + goto IL_2B846; + } + if (this.type == 655) + { + this.name = "Ebonwood Bow"; + this.useStyle = 5; + this.useAnimation = 28; + this.useTime = 28; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 8; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 656) + { + this.name = "Rich Mahogany Sword"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 23; + this.useTime = 23; + this.width = 24; + this.height = 28; + this.damage = 8; + this.knockBack = 5f; + this.useSound = 1; + this.scale = 1f; + this.value = 100; + this.melee = true; + goto IL_2B846; + } + if (this.type == 657) + { + this.name = "Rich Mahogany Hammer"; + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 33; + this.useTime = 23; + this.hammer = 35; + this.width = 24; + this.height = 28; + this.damage = 4; + this.knockBack = 5.5f; + this.scale = 1.1f; + this.useSound = 1; + this.value = 50; + this.melee = true; + goto IL_2B846; + } + if (this.type == 658) + { + this.name = "Rich Mahogany Bow"; + this.useStyle = 5; + this.useAnimation = 29; + this.useTime = 29; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 6; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 659) + { + this.name = "Pearlwood Sword"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 21; + this.useTime = 21; + this.width = 24; + this.height = 28; + this.damage = 11; + this.knockBack = 5f; + this.useSound = 1; + this.scale = 1f; + this.value = 100; + this.melee = true; + goto IL_2B846; + } + if (this.type == 660) + { + this.name = "Pearlwood Hammer"; + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 29; + this.useTime = 19; + this.hammer = 45; + this.width = 24; + this.height = 28; + this.damage = 9; + this.knockBack = 5.5f; + this.scale = 1.25f; + this.useSound = 1; + this.value = 50; + this.melee = true; + goto IL_2B846; + } + if (this.type == 661) + { + this.name = "Pearlwood Bow"; + this.useStyle = 5; + this.useAnimation = 27; + this.useTime = 27; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 9; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 662) + { + this.name = "Rainbow Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 160; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 663) + { + this.name = "Rainbow Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 44; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 664) + { + this.name = "Ice Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 161; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 665) + { + this.name = "Red's Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "You shouldn't have this"; + this.rare = 9; + goto IL_2B846; + } + if (this.type == 666) + { + this.name = "Red's Helmet"; + this.width = 18; + this.height = 18; + this.headSlot = 45; + this.rare = 9; + this.toolTip = "You shouldn't have this"; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 667) + { + this.name = "Red's Breastplate"; + this.width = 18; + this.height = 18; + this.bodySlot = 26; + this.rare = 9; + this.toolTip = "You shouldn't have this"; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 668) + { + this.name = "Red's Leggings"; + this.width = 18; + this.height = 18; + this.legSlot = 25; + this.rare = 9; + this.toolTip = "You shouldn't have this"; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 669) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Fish"; + this.shoot = 112; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a baby penguin"; + this.buffType = 41; + this.value = Item.sellPrice(0, 2, 0, 0); + goto IL_2B846; + } + if (this.type == 670) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Ice Boomerang"; + this.shootSpeed = 11.5f; + this.shoot = 113; + this.damage = 14; + this.knockBack = 8.5f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.rare = 1; + this.value = 50000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 671) + { + this.name = "Lockblade"; + this.useStyle = 1; + this.useAnimation = 22; + this.useTime = 22; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 55; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 8; + this.value = 138000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 672) + { + this.name = "Cutlass"; + this.useStyle = 1; + this.useAnimation = 17; + this.knockBack = 4f; + this.width = 24; + this.height = 28; + this.damage = 51; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 4; + this.value = 180000; + this.melee = true; + this.autoReuse = true; + this.useTurn = true; + goto IL_2B846; + } + if (this.type == 673) + { + this.name = "Icemourne"; + this.useStyle = 1; + this.useAnimation = 32; + this.knockBack = 8f; + this.width = 60; + this.height = 70; + this.damage = 44; + this.scale = 1.05f; + this.useSound = 1; + this.rare = 4; + this.value = 150000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 674) + { + this.name = "True Excalibur"; + this.useStyle = 1; + this.useAnimation = 16; + this.useTime = 30; + this.shoot = 156; + this.shootSpeed = 11f; + this.knockBack = 4.5f; + this.width = 40; + this.height = 40; + this.damage = 55; + this.scale = 1.05f; + this.useSound = 1; + this.rare = 8; + this.value = Item.sellPrice(0, 10, 0, 0); + this.melee = true; + goto IL_2B846; + } + if (this.type == 675) + { + this.name = "True Night's Edge"; + this.useStyle = 1; + this.useAnimation = 24; + this.useTime = 45; + this.shoot = 157; + this.shootSpeed = 10f; + this.knockBack = 4.75f; + this.width = 40; + this.height = 40; + this.damage = 70; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 8; + this.value = Item.sellPrice(0, 10, 0, 0); + this.melee = true; + goto IL_2B846; + } + if (this.type == 676) + { + this.name = "Frostbrand"; + this.useStyle = 1; + this.useAnimation = 23; + this.useTime = 59; + this.knockBack = 4.5f; + this.width = 24; + this.height = 28; + this.damage = 49; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 5; + this.shoot = 119; + this.shootSpeed = 12f; + this.value = 250000; + this.toolTip = "Shoots an icy bolt"; + this.melee = true; + goto IL_2B846; + } + if (this.type == 677) + { + this.name = "Scythe"; + this.useStyle = 1; + this.useAnimation = 26; + this.useTime = 26; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 39; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 4; + this.value = 103500; + this.melee = true; + goto IL_2B846; + } + if (this.type == 678) + { + this.name = "Soul Scythe"; + this.useStyle = 1; + this.useAnimation = 37; + this.knockBack = 8.75f; + this.width = 60; + this.height = 70; + this.damage = 55; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 4; + this.value = 150000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 679) + { + this.autoReuse = true; + this.knockBack = 7f; + this.useStyle = 5; + this.useAnimation = 34; + this.useTime = 34; + this.name = "Tactical Shotgun"; + this.width = 50; + this.height = 14; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 38; + this.damage = 29; + this.shootSpeed = 6f; + this.noMelee = true; + this.value = 700000; + this.rare = 8; + this.ranged = true; + this.toolTip = "Fires a spread of bullets"; + goto IL_2B846; + } + if (this.type == 680) + { + this.name = "Bamboo Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 10; + this.width = 26; + this.height = 22; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 681) + { + this.name = "Ice Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 11; + this.width = 26; + this.height = 22; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 682) + { + this.useStyle = 5; + this.useAnimation = 20; + this.useTime = 20; + this.name = "Marrow"; + this.width = 14; + this.height = 32; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 36; + this.shootSpeed = 11f; + this.knockBack = 4.7f; + this.rare = 5; + this.noMelee = true; + this.scale = 1.1f; + this.value = 27000; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 683) + { + this.rare = 7; + this.mana = 14; + this.useSound = 20; + this.name = "Unholy Trident"; + this.useStyle = 5; + this.damage = 65; + this.useAnimation = 40; + this.useTime = 40; + this.width = 30; + this.height = 30; + this.shoot = 114; + this.shootSpeed = 13f; + this.knockBack = 6.5f; + this.toolTip = "Summons the Devil's trident"; + this.magic = true; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 684) + { + this.name = "Frost Helmet"; + this.width = 18; + this.height = 18; + this.defense = 10; + this.headSlot = 46; + this.rare = 5; + this.value = 250000; + this.toolTip = "16% increased melee and ranged damage"; + goto IL_2B846; + } + if (this.type == 685) + { + this.name = "Frost Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 20; + this.bodySlot = 27; + this.rare = 5; + this.value = 200000; + this.toolTip = "11% increased melee and ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 686) + { + this.name = "Frost Leggings"; + this.width = 18; + this.height = 18; + this.defense = 13; + this.legSlot = 26; + this.rare = 5; + this.value = 150000; + this.toolTip = "8% increased movement speed"; + this.toolTip = "7% increased melee attack speed"; + goto IL_2B846; + } + if (this.type == 687) + { + this.name = "Tin Helmet"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.headSlot = 47; + this.value = 1875; + goto IL_2B846; + } + if (this.type == 688) + { + this.name = "Tin Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.bodySlot = 28; + this.value = Item.sellPrice(0, 0, 0, 50); + goto IL_2B846; + } + if (this.type == 689) + { + this.name = "Tin Greaves"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 27; + this.value = 1125; + goto IL_2B846; + } + if (this.type == 690) + { + this.name = "Lead Helmet"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.headSlot = 48; + this.value = 7500; + goto IL_2B846; + } + if (this.type == 691) + { + this.name = "Lead Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.bodySlot = 29; + this.value = 6000; + goto IL_2B846; + } + if (this.type == 692) + { + this.name = "Lead Greaves"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.legSlot = 28; + this.value = 4500; + goto IL_2B846; + } + if (this.type == 693) + { + this.name = "Tungsten Helmet"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 49; + this.value = 7500; + goto IL_2B846; + } + if (this.type == 694) + { + this.name = "Tungsten Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.bodySlot = 30; + this.value = 6000; + goto IL_2B846; + } + if (this.type == 695) + { + this.name = "Tungsten Greaves"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.legSlot = 29; + this.value = 4500; + goto IL_2B846; + } + if (this.type == 696) + { + this.name = "Platinum Helmet"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 50; + this.value = 7500; + goto IL_2B846; + } + if (this.type == 697) + { + this.name = "Platinum Chainmail"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.bodySlot = 31; + this.value = 6000; + goto IL_2B846; + } + if (this.type == 698) + { + this.name = "Platinum Greaves"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.legSlot = 30; + this.value = 4500; + goto IL_2B846; + } + if (this.type == 699) + { + this.name = "Tin Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 166; + this.width = 12; + this.height = 12; + this.value = 375; + goto IL_2B846; + } + if (this.type == 700) + { + this.name = "Lead Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 167; + this.width = 12; + this.height = 12; + this.value = 750; + goto IL_2B846; + } + if (this.type == 701) + { + this.name = "Tungsten Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 168; + this.width = 12; + this.height = 12; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 702) + { + this.name = "Platinum Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 169; + this.width = 12; + this.height = 12; + this.value = 3000; + goto IL_2B846; + } + if (this.type == 703) + { + this.name = "Tin Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 1125; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 1; + goto IL_2B846; + } + if (this.type == 704) + { + this.name = "Lead Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 2250; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 3; + goto IL_2B846; + } + if (this.type == 705) + { + this.name = "Tungsten Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 4500; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 5; + goto IL_2B846; + } + if (this.type == 706) + { + this.name = "Platinum Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 9000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 7; + goto IL_2B846; + } + if (this.type == 707) + { + this.name = "Tin Watch"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Tells the time"; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 708) + { + this.name = "Tungsten Watch"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Tells the time"; + this.value = 7500; + goto IL_2B846; + } + if (this.type == 709) + { + this.name = "Platinum Watch"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.rare = 1; + this.toolTip = "Tells the time"; + this.value = 15000; + goto IL_2B846; + } + if (this.type == 710) + { + this.name = "Tin Chandelier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 170; + this.width = 26; + this.height = 26; + this.value = 4500; + goto IL_2B846; + } + if (this.type == 711) + { + this.name = "Tungsten Chandelier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 171; + this.width = 26; + this.height = 26; + this.value = 18000; + goto IL_2B846; + } + if (this.type == 712) + { + this.name = "Platinum Chandelier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 172; + this.width = 26; + this.height = 26; + this.value = 36000; + goto IL_2B846; + } + if (this.type == 713) + { + this.flame = true; + this.name = "Platinum Candle"; + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 174; + this.width = 8; + this.height = 18; + this.holdStyle = 1; + goto IL_2B846; + } + if (this.type == 714) + { + this.name = "Platinum Candelabra"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 173; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 715) + { + this.name = "Platinum Crown"; + this.width = 18; + this.height = 18; + this.headSlot = 51; + this.value = 15000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 716) + { + this.name = "Lead Anvil"; + this.placeStyle = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 16; + this.width = 28; + this.height = 14; + this.value = 7500; + this.toolTip = "Used to craft items from metal bars"; + goto IL_2B846; + } + if (this.type == 717) + { + this.name = "Tin Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 175; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 718) + { + this.name = "Tungsten Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 176; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 719) + { + this.name = "Platinum Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 177; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 720) + { + this.name = "Tin Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 45; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 721) + { + this.name = "Tungsten Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 46; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 722) + { + this.name = "Platinum Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 47; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 723) + { + this.rare = 4; + this.useSound = 1; + this.name = "Beam Sword"; + this.useStyle = 1; + this.damage = 52; + this.useAnimation = 15; + this.useTime = 60; + this.width = 30; + this.height = 30; + this.shoot = 116; + this.shootSpeed = 11f; + this.knockBack = 6.5f; + this.toolTip = "Shoots a beam of light"; + this.melee = true; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 724) + { + this.rare = 1; + this.useSound = 1; + this.name = "Ice Blade"; + this.useStyle = 1; + this.damage = 13; + this.useAnimation = 20; + this.useTime = 70; + this.width = 30; + this.height = 30; + this.shoot = 118; + this.shootSpeed = 8f; + this.knockBack = 4.75f; + this.toolTip = "Shoots an icy bolt"; + this.melee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 725) + { + this.useStyle = 5; + this.useAnimation = 22; + this.useTime = 22; + this.name = "Icy Bow"; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 43; + this.shootSpeed = 10f; + this.knockBack = 4.5f; + this.alpha = 30; + this.rare = 5; + this.noMelee = true; + this.value = Item.sellPrice(0, 3, 50, 0); + this.toolTip = "Shoots frost arrows"; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 726) + { + this.autoReuse = true; + this.rare = 5; + this.mana = 10; + this.useSound = 20; + this.name = "Frost Staff"; + this.useStyle = 5; + this.damage = 53; + this.useAnimation = 20; + this.useTime = 20; + this.width = 30; + this.height = 30; + this.shoot = 119; + this.shootSpeed = 16f; + this.knockBack = 5f; + this.toolTip = "Shoots a stream of frost"; + this.magic = true; + this.value = 500000; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 727) + { + this.name = "Wood Helmet"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 52; + goto IL_2B846; + } + if (this.type == 728) + { + this.name = "Wood Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.bodySlot = 32; + goto IL_2B846; + } + if (this.type == 729) + { + this.name = "Wood Greaves"; + this.width = 18; + this.height = 18; + this.defense = 0; + this.legSlot = 31; + goto IL_2B846; + } + if (this.type == 730) + { + this.name = "Ebonwood Helmet"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 53; + goto IL_2B846; + } + if (this.type == 731) + { + this.name = "Ebonwood Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.bodySlot = 33; + goto IL_2B846; + } + if (this.type == 732) + { + this.name = "Ebonwood Greaves"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 32; + goto IL_2B846; + } + if (this.type == 733) + { + this.name = "Rich Mahogany Helmet"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 54; + goto IL_2B846; + } + if (this.type == 734) + { + this.name = "Rich Mahogany Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.bodySlot = 34; + goto IL_2B846; + } + if (this.type == 735) + { + this.name = "Rich Mahogany Greaves"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 33; + goto IL_2B846; + } + if (this.type == 736) + { + this.name = "Pearlwood Helmet"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.headSlot = 55; + goto IL_2B846; + } + if (this.type == 737) + { + this.name = "Pearlwood Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.bodySlot = 35; + goto IL_2B846; + } + if (this.type == 738) + { + this.name = "Pearlwood Greaves"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.legSlot = 34; + goto IL_2B846; + } + if (this.type == 739) + { + this.name = "Amethyst Staff"; + this.mana = 3; + this.useSound = 43; + this.useStyle = 5; + this.damage = 14; + this.useAnimation = 40; + this.useTime = 40; + this.width = 40; + this.height = 40; + this.shoot = 121; + this.shootSpeed = 6f; + this.knockBack = 3.25f; + this.value = 2000; + this.magic = true; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 740) + { + this.name = "Topaz Staff"; + this.mana = 3; + this.useSound = 43; + this.useStyle = 5; + this.damage = 16; + this.useAnimation = 38; + this.useTime = 38; + this.width = 40; + this.height = 40; + this.shoot = 122; + this.shootSpeed = 6.5f; + this.knockBack = 3.5f; + this.value = 3000; + this.magic = true; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 741) + { + this.name = "Sapphire Staff"; + this.mana = 4; + this.useSound = 43; + this.useStyle = 5; + this.damage = 19; + this.useAnimation = 34; + this.useTime = 34; + this.width = 40; + this.height = 40; + this.shoot = 123; + this.shootSpeed = 7.5f; + this.knockBack = 4f; + this.value = 10000; + this.magic = true; + this.rare = 1; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 742) + { + this.name = "Emerald Staff"; + this.mana = 4; + this.useSound = 43; + this.useStyle = 5; + this.damage = 21; + this.useAnimation = 32; + this.useTime = 32; + this.width = 40; + this.height = 40; + this.shoot = 124; + this.shootSpeed = 8f; + this.knockBack = 4.25f; + this.magic = true; + this.autoReuse = true; + this.value = 15000; + this.rare = 1; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 743) + { + this.name = "Ruby Staff"; + this.mana = 5; + this.useSound = 43; + this.useStyle = 5; + this.damage = 24; + this.useAnimation = 28; + this.useTime = 28; + this.width = 40; + this.height = 40; + this.shoot = 125; + this.shootSpeed = 9f; + this.knockBack = 4.75f; + this.magic = true; + this.autoReuse = true; + this.value = 20000; + this.rare = 1; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 744) + { + this.name = "Diamond Staff"; + this.mana = 5; + this.useSound = 43; + this.useStyle = 5; + this.damage = 26; + this.useAnimation = 26; + this.useTime = 26; + this.width = 40; + this.height = 40; + this.shoot = 126; + this.shootSpeed = 9.5f; + this.knockBack = 5.5f; + this.magic = true; + this.autoReuse = true; + this.value = 30000; + this.rare = 2; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 745) + { + this.name = "Grass Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 66; + this.width = 12; + this.height = 12; + this.value = 10; + goto IL_2B846; + } + if (this.type == 746) + { + this.name = "Jungle Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 67; + this.width = 12; + this.height = 12; + this.value = 10; + goto IL_2B846; + } + if (this.type == 747) + { + this.name = "Flower Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 68; + this.width = 12; + this.height = 12; + this.value = 10; + goto IL_2B846; + } + if (this.type == 748) + { + this.name = "Jetpack"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.toolTip2 = "Hold up to rocket faster"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 749) + { + this.name = "Butterfly Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 750) + { + this.name = "Cactus Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 72; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 751) + { + this.name = "Cloud"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 189; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 752) + { + this.name = "Cloud Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 73; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 753) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Seaweed"; + this.shoot = 127; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a turtle"; + this.value = Item.sellPrice(0, 2, 0, 0); + this.buffType = 42; + goto IL_2B846; + } + if (this.type == 754) + { + this.name = "Rune Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 56; + this.rare = 5; + this.value = 50000; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 755) + { + this.name = "Rune Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 36; + this.value = 50000; + this.vanity = true; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 756) + { + this.rare = 7; + this.name = "Mushroom Spear"; + this.useStyle = 5; + this.useAnimation = 40; + this.useTime = 40; + this.shootSpeed = 5.5f; + this.knockBack = 6.8f; + this.width = 32; + this.height = 32; + this.damage = 60; + this.scale = 1f; + this.useSound = 1; + this.shoot = 130; + this.value = Item.buyPrice(0, 30, 0, 0); + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 757) + { + this.rare = 8; + this.useSound = 1; + this.name = "Terra Blade"; + this.useStyle = 1; + this.damage = 80; + this.useAnimation = 16; + this.useTime = 30; + this.width = 30; + this.height = 30; + this.shoot = 132; + this.scale = 1.1f; + this.shootSpeed = 12f; + this.knockBack = 6.5f; + this.melee = true; + this.value = Item.sellPrice(0, 20, 0, 0); + goto IL_2B846; + } + if (this.type == 758) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 30; + this.useTime = 30; + this.name = "Grenade Launcher"; + this.useAmmo = 771; + this.width = 50; + this.height = 20; + this.shoot = 133; + this.useSound = 11; + this.damage = 55; + this.shootSpeed = 10f; + this.noMelee = true; + this.value = 100000; + this.knockBack = 4f; + this.rare = 8; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 759) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 30; + this.useTime = 30; + this.name = "Rocket Launcher"; + this.useAmmo = 771; + this.width = 50; + this.height = 20; + this.shoot = 134; + this.useSound = 11; + this.damage = 50; + this.shootSpeed = 5f; + this.noMelee = true; + this.value = 100000; + this.knockBack = 4f; + this.rare = 8; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 760) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 30; + this.useTime = 30; + this.name = "Proximity Mine Launcher"; + this.useAmmo = 771; + this.width = 50; + this.height = 20; + this.shoot = 135; + this.useSound = 11; + this.damage = 45; + this.shootSpeed = 11f; + this.noMelee = true; + this.value = Item.buyPrice(0, 35, 0, 0); + this.knockBack = 4f; + this.rare = 8; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 761) + { + this.name = "Fairy Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 762) + { + this.name = "Slime Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 193; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 763) + { + this.name = "Flesh Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 195; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 764) + { + this.name = "Mushroom Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 74; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 765) + { + this.name = "Rain Cloud"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 196; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 766) + { + this.name = "Bone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 194; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 767) + { + this.name = "Frozen Slime Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 197; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 768) + { + this.name = "Bone Block Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 75; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 769) + { + this.name = "Slime Block Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 76; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 770) + { + this.name = "Flesh Block Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 77; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 771) + { + this.name = "Rocket I"; + this.shoot = 0; + this.damage = 35; + this.width = 20; + this.height = 14; + this.maxStack = 999; + this.consumable = true; + this.ammo = 771; + this.knockBack = 4f; + this.value = Item.buyPrice(0, 0, 0, 50); + this.ranged = true; + this.toolTip = "Small blast radius. Will not destroy tiles"; + goto IL_2B846; + } + if (this.type == 772) + { + this.name = "Rocket II"; + this.shoot = 3; + this.damage = 40; + this.width = 20; + this.height = 14; + this.maxStack = 999; + this.consumable = true; + this.ammo = 771; + this.knockBack = 4f; + this.value = Item.buyPrice(0, 0, 2, 50); + this.ranged = true; + this.toolTip = "Small blast radius. Will destroy tiles"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 773) + { + this.name = "Rocket III"; + this.shoot = 6; + this.damage = 55; + this.width = 20; + this.height = 14; + this.maxStack = 999; + this.consumable = true; + this.ammo = 771; + this.knockBack = 6f; + this.value = Item.buyPrice(0, 0, 1, 0); + this.ranged = true; + this.toolTip = "Large blast radius. Will not destroy tiles"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 774) + { + this.name = "Rocket IV"; + this.shoot = 9; + this.damage = 60; + this.width = 20; + this.height = 14; + this.maxStack = 999; + this.consumable = true; + this.ammo = 771; + this.knockBack = 6f; + this.value = (this.value = Item.buyPrice(0, 0, 5, 0)); + this.ranged = true; + this.toolTip = "Large blast radius. Will destroy tiles"; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 775) + { + this.name = "Asphalt Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 198; + this.width = 12; + this.height = 12; + this.toolTip = "Increases running speed"; + goto IL_2B846; + } + if (this.type == 776) + { + this.name = "Cobalt Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.autoReuse = true; + this.useAnimation = 25; + this.useTime = 13; + this.knockBack = 5f; + this.width = 20; + this.height = 12; + this.damage = 10; + this.pick = 110; + this.useSound = 1; + this.rare = 4; + this.value = 54000; + this.melee = true; + this.toolTip = "Can mine Mythril and Orichalcum"; + this.scale = 1.15f; + goto IL_2B846; + } + if (this.type == 777) + { + this.name = "Mythril Pickaxe"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 10; + this.knockBack = 5f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 15; + this.pick = 150; + this.useSound = 1; + this.rare = 4; + this.value = 81000; + this.melee = true; + this.toolTip = "Can mine Adamantite and Titanium"; + this.scale = 1.15f; + goto IL_2B846; + } + if (this.type == 778) + { + this.name = "Adamantite Pickaxe"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 7; + this.knockBack = 5f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 20; + this.pick = 180; + this.useSound = 1; + this.rare = 4; + this.value = 108000; + this.melee = true; + this.scale = 1.15f; + goto IL_2B846; + } + if (this.type == 779) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 30; + this.useTime = 5; + this.name = "Clentaminator"; + this.width = 50; + this.height = 18; + this.shoot = 145; + this.useAmmo = 780; + this.useSound = 34; + this.knockBack = 0.3f; + this.shootSpeed = 7f; + this.noMelee = true; + this.value = Item.buyPrice(2, 0, 0, 0); + this.rare = 5; + this.toolTip = "Creates and destroys biomes when sprayed"; + this.toolTip2 = "Uses colored solution"; + goto IL_2B846; + } + if (this.type == 780) + { + this.name = "Green Solutiuon"; + this.shoot = 0; + this.ammo = 780; + this.width = 10; + this.height = 12; + this.value = Item.buyPrice(0, 0, 25, 0); + this.rare = 3; + this.maxStack = 999; + this.toolTip = "Used by the Clentaminator"; + this.toolTip2 = "Spreads the purity"; + goto IL_2B846; + } + if (this.type == 781) + { + this.name = "Blue Solutiuon"; + this.shoot = 1; + this.ammo = 780; + this.width = 10; + this.height = 12; + this.value = Item.buyPrice(0, 0, 25, 0); + this.rare = 3; + this.maxStack = 999; + this.toolTip = "Used by the Clentaminator"; + this.toolTip2 = "Spreads the hallow"; + goto IL_2B846; + } + if (this.type == 782) + { + this.name = "Purple Solutiuon"; + this.shoot = 2; + this.ammo = 780; + this.width = 10; + this.height = 12; + this.value = Item.buyPrice(0, 0, 25, 0); + this.rare = 3; + this.maxStack = 999; + this.toolTip = "Used by the Clentaminator"; + this.toolTip2 = "Spreads the corruption"; + goto IL_2B846; + } + if (this.type == 783) + { + this.name = "Dark Blue Solution"; + this.shoot = 3; + this.ammo = 780; + this.width = 10; + this.height = 12; + this.value = Item.buyPrice(0, 0, 25, 0); + this.rare = 3; + this.maxStack = 999; + this.toolTip = "Used by the Clentaminator"; + this.toolTip2 = "Spreads glowing mushrooms"; + goto IL_2B846; + } + if (this.type == 784) + { + this.name = "Red Solution"; + this.shoot = 4; + this.ammo = 780; + this.width = 10; + this.height = 12; + this.value = Item.buyPrice(0, 0, 25, 0); + this.rare = 3; + this.maxStack = 999; + this.toolTip = "Used by the Clentaminator"; + this.toolTip2 = "Spreads the crimson"; + goto IL_2B846; + } + if (this.type == 785) + { + this.name = "Harpy Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 786) + { + this.name = "Bone Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 787) + { + this.name = "Hammush"; + this.useTurn = true; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 27; + this.useTime = 14; + this.hammer = 85; + this.width = 24; + this.height = 28; + this.damage = 26; + this.knockBack = 7.5f; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 7; + this.value = Item.buyPrice(0, 40, 0, 0); + this.melee = true; + this.toolTip = "Strong enough to destroy Demon Altars"; + goto IL_2B846; + } + if (this.type == 788) + { + this.mana = 12; + this.damage = 24; + this.useStyle = 5; + this.name = "Nettle Burst"; + this.shootSpeed = 32f; + this.shoot = 150; + this.width = 26; + this.height = 28; + this.useSound = 8; + this.useAnimation = 25; + this.useTime = 25; + this.autoReuse = true; + this.rare = 7; + this.noMelee = true; + this.knockBack = 1f; + this.toolTip = "Summons a thorn spear"; + this.value = 200000; + this.magic = true; + goto IL_2B846; + } + if (this.type == 789) + { + this.name = "Ankh Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 4; + this.width = 10; + this.height = 24; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 790) + { + this.name = "Snake Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 5; + this.width = 10; + this.height = 24; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 791) + { + this.name = "Omega Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 6; + this.width = 10; + this.height = 24; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 792) + { + this.name = "Crimson Helmet"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.headSlot = 57; + this.value = 50000; + this.toolTip = "2% increased damage"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 793) + { + this.name = "Crimson Scalemail"; + this.width = 18; + this.height = 18; + this.defense = 7; + this.bodySlot = 37; + this.value = 40000; + this.toolTip = "2% increased damage"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 794) + { + this.name = "Crimson Greaves"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.legSlot = 35; + this.value = 30000; + this.toolTip = "2% increased damage"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 795) + { + this.name = "Blood Butcherer"; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 5f; + this.width = 24; + this.height = 28; + this.damage = 22; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 1; + this.value = 13500; + this.melee = true; + goto IL_2B846; + } + if (this.type == 796) + { + this.useStyle = 5; + this.useAnimation = 30; + this.useTime = 30; + this.name = "Tendon Bow"; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 19; + this.shootSpeed = 6.7f; + this.knockBack = 1f; + this.alpha = 30; + this.rare = 1; + this.noMelee = true; + this.value = 18000; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 797) + { + this.name = "Flesh Grinder"; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 40; + this.useTime = 19; + this.hammer = 55; + this.width = 24; + this.height = 28; + this.damage = 23; + this.knockBack = 6f; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 1; + this.value = 15000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 798) + { + this.name = "Deathbringer Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 22; + this.useTime = 14; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 12; + this.pick = 70; + this.useSound = 1; + this.knockBack = 3.5f; + this.rare = 1; + this.value = 18000; + this.scale = 1.15f; + this.toolTip = "Able to mine Hellstone"; + this.melee = true; + goto IL_2B846; + } + if (this.type == 799) + { + this.name = "Blood Lust Cluster"; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 32; + this.knockBack = 6f; + this.useTime = 15; + this.width = 24; + this.height = 28; + this.damage = 22; + this.axe = 15; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 1; + this.value = 13500; + this.melee = true; + goto IL_2B846; + } + if (this.type == 800) + { + this.useStyle = 5; + this.useAnimation = 24; + this.useTime = 24; + this.name = "The Undertaker"; + this.width = 24; + this.height = 28; + this.shoot = 14; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 15; + this.shootSpeed = 5f; + this.noMelee = true; + this.value = 50000; + this.scale = 0.9f; + this.rare = 1; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 801) + { + this.name = "The Meatball"; + this.useStyle = 5; + this.useAnimation = 45; + this.useTime = 45; + this.knockBack = 6.5f; + this.width = 30; + this.height = 10; + this.damage = 16; + this.scale = 1.1f; + this.noUseGraphic = true; + this.shoot = 154; + this.shootSpeed = 12f; + this.useSound = 1; + this.rare = 1; + this.value = 27000; + this.melee = true; + this.channel = true; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 802) + { + this.name = "The Rotted Fork"; + this.useStyle = 5; + this.useAnimation = 31; + this.useTime = 31; + this.shootSpeed = 4f; + this.knockBack = 5f; + this.width = 40; + this.height = 40; + this.damage = 14; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 153; + this.rare = 1; + this.value = 10000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 803) + { + this.name = "Eskimo Hood"; + this.width = 18; + this.height = 18; + this.headSlot = 58; + this.value = 50000; + this.defense = 1; + goto IL_2B846; + } + if (this.type == 804) + { + this.name = "Eskimo Coat"; + this.width = 18; + this.height = 18; + this.bodySlot = 38; + this.value = 40000; + this.defense = 2; + goto IL_2B846; + } + if (this.type == 805) + { + this.name = "Eskimo Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 36; + this.value = 30000; + this.defense = 1; + goto IL_2B846; + } + if (this.type == 806) + { + this.name = "Living Wood Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 5; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 807) + { + this.name = "Cactus Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 6; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 808) + { + this.name = "Bone Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 7; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 809) + { + this.name = "Flesh Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 8; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 810) + { + this.name = "Mushroom Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 9; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 811) + { + this.name = "Bone Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 4; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 812) + { + this.name = "Cactus Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 5; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 813) + { + this.name = "Flesh Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 6; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 814) + { + this.name = "Mushroom Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 7; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 815) + { + this.name = "Slime Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 8; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 816) + { + this.name = "Cactus Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 4; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 817) + { + this.name = "Flesh Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 5; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 818) + { + this.name = "Mushroom Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 6; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 819) + { + this.name = "Living Wood Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 7; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 820) + { + this.name = "Bone Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 8; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 821) + { + this.name = "Flame Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 822) + { + this.name = "Frozen Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 823) + { + this.name = "Ghost Wings"; + this.color = new Color(255, 255, 255, 0); + this.alpha = 255; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 824) + { + this.name = "Sunplate Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 202; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 825) + { + this.name = "Disc Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 82; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 826) + { + this.name = "Skyware Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 10; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 827) + { + this.name = "Bone Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 4; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 828) + { + this.name = "Flesh Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 5; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 829) + { + this.name = "Living Wood Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 6; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 830) + { + this.name = "Skyware Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 7; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 831) + { + this.name = "Living Wood Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 12; + this.width = 26; + this.height = 22; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 832) + { + this.name = "Living Wood Wand"; + this.tileWand = 9; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.createTile = 191; + this.width = 8; + this.height = 10; + this.rare = 1; + this.toolTip = "Places living wood"; + goto IL_2B846; + } + if (this.type == 833) + { + this.name = "Purple Ice Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 163; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 834) + { + this.name = "Pink Ice Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 164; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 835) + { + this.name = "Red Ice Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 200; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 836) + { + this.name = "Crimstone"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 203; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 837) + { + this.name = "Skyware Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 9; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 838) + { + this.name = "Skyware Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 13; + this.width = 26; + this.height = 22; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 839) + { + this.name = "Steampunk Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 59; + this.rare = 2; + this.vanity = true; + this.value = Item.buyPrice(0, 1, 50, 0); + goto IL_2B846; + } + if (this.type == 840) + { + this.name = "Steampunk Shirt"; + this.width = 18; + this.height = 14; + this.bodySlot = 39; + this.rare = 2; + this.vanity = true; + this.value = Item.buyPrice(0, 1, 50, 0); + goto IL_2B846; + } + if (this.type == 841) + { + this.name = "Steampunk Pants"; + this.width = 18; + this.height = 14; + this.legSlot = 37; + this.rare = 2; + this.vanity = true; + this.value = Item.buyPrice(0, 1, 50, 0); + goto IL_2B846; + } + if (this.type == 842) + { + this.name = "Bee Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 60; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 843) + { + this.name = "Bee Shirt"; + this.width = 18; + this.height = 14; + this.bodySlot = 40; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 844) + { + this.name = "Bee Pants"; + this.width = 18; + this.height = 14; + this.legSlot = 38; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 845) + { + this.name = "World Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 7; + this.width = 10; + this.height = 24; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 846) + { + this.name = "Sun Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 8; + this.width = 10; + this.height = 24; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 847) + { + this.name = "Gravity Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 9; + this.width = 10; + this.height = 24; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 848) + { + this.name = "Pharaoh's Mask"; + this.width = 28; + this.height = 20; + this.headSlot = 61; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 849) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.name = "Actuator"; + this.width = 24; + this.height = 28; + this.toolTip = "Enables solid blocks to be toggled on and off"; + this.maxStack = 999; + this.mech = true; + this.value = Item.buyPrice(0, 0, 10, 0); + goto IL_2B846; + } + if (this.type == 850) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.name = "Blue Wrench"; + this.width = 24; + this.height = 28; + this.rare = 1; + this.toolTip = "Places blue wire"; + this.value = 20000; + this.mech = true; + this.tileBoost = 3; + goto IL_2B846; + } + if (this.type == 851) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.name = "Green Wrench"; + this.width = 24; + this.height = 28; + this.rare = 1; + this.toolTip = "Places green wire"; + this.value = 20000; + this.mech = true; + this.tileBoost = 3; + goto IL_2B846; + } + if (this.type == 852) + { + this.name = "Blue Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 4; + this.mech = true; + this.value = 5000; + this.toolTip = "Activates when a player steps on it on"; + goto IL_2B846; + } + if (this.type == 853) + { + this.name = "Yellow Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 5; + this.mech = true; + this.value = 5000; + this.toolTip = "Activates when anything but a player steps on it on"; + goto IL_2B846; + } + if (this.type == 854) + { + this.name = "Discount Card"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Shops have lower prices"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 855) + { + this.name = "Lucky Coin"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Hitting enemies will sometimes drop extra coins"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 856) + { + this.noWet = true; + this.name = "Stick Unicorn"; + this.holdStyle = 1; + this.width = 30; + this.height = 30; + this.toolTip = "'Having a wonderful time!'"; + this.value = 500; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 857) + { + this.name = "Sandstorm in a Bottle"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 2; + this.toolTip = "Allows the holder to double jump"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 858) + { + this.name = "bl"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "Allows the holder to double jump"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 859) + { + this.useStyle = 1; + this.name = "Beach Ball"; + this.shootSpeed = 6f; + this.shoot = 155; + this.width = 44; + this.height = 44; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 20; + goto IL_2B846; + } + if (this.type == 860) + { + this.name = "Charm of Myths"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 6; + this.lifeRegen = 1; + this.toolTip = "Provides life regeneration and reduces the cooldown of healing potions"; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 861) + { + this.name = "Moon Shell"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 6; + this.toolTip = "Turns the holder into a werewolf on full moons and a merfolk when entering water"; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 862) + { + this.name = "Star Veil"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 6; + this.toolTip = "Causes stars to fall and increases length of invincibility after taking damage"; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 863) + { + this.name = "Water Walking Boots"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Provides the ability to walk on water"; + this.value = 200000; + goto IL_2B846; + } + if (this.type == 864) + { + this.name = "Tiara"; + this.width = 28; + this.height = 20; + this.headSlot = 62; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 25, 0, 0); + goto IL_2B846; + } + if (this.type == 865) + { + this.name = "Princess Dress"; + this.width = 18; + this.height = 14; + this.bodySlot = 41; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 10, 0, 0); + goto IL_2B846; + } + if (this.type == 866) + { + this.name = "Pharaoh's Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 42; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 867) + { + this.name = "Green Cap"; + this.width = 28; + this.height = 20; + this.headSlot = 63; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 868) + { + this.name = "Mushroom Cap"; + this.width = 28; + this.height = 20; + this.headSlot = 64; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 2, 0, 0); + goto IL_2B846; + } + if (this.type == 869) + { + this.name = "Tam O' Shanter"; + this.width = 28; + this.height = 20; + this.headSlot = 65; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 2, 50, 0); + goto IL_2B846; + } + if (this.type == 870) + { + this.name = "Mummy Mask"; + this.width = 28; + this.height = 20; + this.headSlot = 66; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 871) + { + this.name = "Mummy Shirt"; + this.width = 28; + this.height = 20; + this.bodySlot = 43; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 872) + { + this.name = "Mummy Pants"; + this.width = 28; + this.height = 20; + this.legSlot = 39; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 873) + { + this.name = "Cowboy Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 67; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 5, 0, 0); + goto IL_2B846; + } + if (this.type == 874) + { + this.name = "Cowboy Jacket"; + this.width = 28; + this.height = 20; + this.bodySlot = 44; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 5, 0, 0); + goto IL_2B846; + } + if (this.type == 875) + { + this.name = "Cowboy Pants"; + this.width = 28; + this.height = 20; + this.legSlot = 40; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 5, 0, 0); + goto IL_2B846; + } + if (this.type == 876) + { + this.name = "Pirate Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 68; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 5, 0, 0); + goto IL_2B846; + } + if (this.type == 877) + { + this.name = "Pirate Shirt"; + this.width = 28; + this.height = 20; + this.bodySlot = 45; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 5, 0, 0); + goto IL_2B846; + } + if (this.type == 878) + { + this.name = "Pirate Pants"; + this.width = 28; + this.height = 20; + this.legSlot = 41; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(0, 5, 0, 0); + goto IL_2B846; + } + if (this.type == 879) + { + this.name = "Viking Helmet"; + this.width = 28; + this.height = 20; + this.headSlot = 69; + this.rare = 1; + this.defense = 4; + this.value = Item.sellPrice(0, 0, 50, 0); + goto IL_2B846; + } + if (this.type == 880) + { + this.name = "Crimtane"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 204; + this.width = 12; + this.height = 12; + this.rare = 1; + this.value = 4500; + goto IL_2B846; + } + if (this.type == 881) + { + this.name = "Cactus Sword"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 25; + this.useTime = 25; + this.width = 24; + this.height = 28; + this.damage = 9; + this.knockBack = 5f; + this.useSound = 1; + this.scale = 1f; + this.value = 1800; + this.melee = true; + goto IL_2B846; + } + if (this.type == 882) + { + this.name = "Cactus Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 23; + this.useTime = 15; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 5; + this.pick = 35; + this.useSound = 1; + this.knockBack = 2f; + this.value = 2000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 883) + { + this.name = "Ice Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 206; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 884) + { + this.name = "Ice Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 84; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 885) + { + this.name = "Adhesive Bandage"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Bleeding"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 886) + { + this.name = "Armor Polish"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Broken Armor"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 887) + { + this.name = "Bezoar"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Poison"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 888) + { + this.name = "Blindfold"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Darkness"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 889) + { + this.name = "Fast Clock"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Slow"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 890) + { + this.name = "Megaphone"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Silence"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 891) + { + this.name = "Nazar"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 2; + this.toolTip = "Immunity to Curse"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 892) + { + this.name = "Vitamins"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Weakness"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 893) + { + this.name = "Trifold Map"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Immunity to Confusion"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 894) + { + this.name = "Cactus Helmet"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 70; + goto IL_2B846; + } + if (this.type == 895) + { + this.name = "Cactus Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.bodySlot = 46; + goto IL_2B846; + } + if (this.type == 896) + { + this.name = "Cactus Leggings"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 42; + goto IL_2B846; + } + if (this.type == 897) + { + this.name = "Power Glove"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Increases melee knockback"; + this.toolTip = "12% increased melee speed"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 898) + { + this.name = "Lightning Boots"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Allows flight and super fast running"; + this.toolTip = "7% increased movement speed"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 899) + { + this.name = "Sun Stone"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 7; + this.toolTip = "Increases all stats if worn during the day"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 900) + { + this.name = "Moon Stone"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Increases all stats if worn during the night"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 901) + { + this.name = "Armor Bracing"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Immunity to Weakness and Broken Armor"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 902) + { + this.name = "Medicated Bandage"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Immunity to Poison and Bleeding"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 903) + { + this.name = "The Plan"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Immunity to Slow and Confusion"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 904) + { + this.name = "Countercurse Mantra"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 5; + this.toolTip = "Immunity to Silence and Curse"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 905) + { + this.name = "Coin Gun"; + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 8; + this.useTime = 8; + this.width = 50; + this.height = 18; + this.shoot = 158; + this.useAmmo = 71; + this.useSound = 11; + this.damage = 0; + this.shootSpeed = 10f; + this.noMelee = true; + this.value = 300000; + this.rare = 6; + this.toolTip = "Uses coins for ammo"; + this.toolTip2 = "Higher valued coins do more damage"; + this.knockBack = 2f; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 906) + { + this.name = "Lava Charm"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 3; + this.toolTip = "Provides 7 seconds of immunity to lava"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 907) + { + this.name = "Obsidian Water Walking Boots"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 4; + this.toolTip = "Provides the ability to walk on water"; + this.toolTip = "Grants immunity to fire blocks"; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 908) + { + this.name = "Lava Waders"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 7; + this.toolTip = "Provides the ability to walk on water and lava"; + this.toolTip = "Grants immunity to fire blocks and 7 seconds of immunity to lava"; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 909) + { + this.name = "Pure Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 0; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 910) + { + this.name = "Desert Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 1; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 911) + { + this.name = "Shadewood"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 208; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 912) + { + this.name = "Shadewood Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 10; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 913) + { + this.name = "Shadewood Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 5; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 914) + { + this.name = "Shadewood Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 14; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 915) + { + this.name = "Shadewood Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 11; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 916) + { + this.name = "Shadewood Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 9; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 917) + { + this.name = "Shadewood Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 8; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 918) + { + this.name = "Shadewood Dresser"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 4; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 919) + { + this.name = "Shadewood Piano"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 4; + this.width = 20; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 920) + { + this.name = "Shadewood Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 4; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 921) + { + this.name = "Shadewood Sword"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 21; + this.useTime = 21; + this.width = 24; + this.height = 28; + this.damage = 10; + this.knockBack = 5f; + this.useSound = 1; + this.scale = 1f; + this.value = 100; + this.melee = true; + goto IL_2B846; + } + if (this.type == 922) + { + this.name = "Shadewood Hammer"; + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 30; + this.useTime = 20; + this.hammer = 40; + this.width = 24; + this.height = 28; + this.damage = 7; + this.knockBack = 5.5f; + this.scale = 1.2f; + this.useSound = 1; + this.value = 50; + this.melee = true; + goto IL_2B846; + } + if (this.type == 923) + { + this.name = "Shadewood Bow"; + this.useStyle = 5; + this.useAnimation = 28; + this.useTime = 28; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 8; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 924) + { + this.name = "Shadewood Helmet"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 71; + goto IL_2B846; + } + if (this.type == 925) + { + this.name = "Shadewood Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.bodySlot = 47; + goto IL_2B846; + } + if (this.type == 926) + { + this.name = "Shadewood Greaves"; + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 43; + goto IL_2B846; + } + if (this.type == 927) + { + this.name = "Shadewood Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 85; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 928) + { + this.name = "Cannon"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 209; + this.width = 12; + this.height = 12; + this.rare = 3; + this.value = Item.buyPrice(0, 25, 0, 0); + goto IL_2B846; + } + if (this.type == 929) + { + this.name = "Cannonball"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 20; + this.useTime = 20; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.width = 12; + this.height = 12; + this.damage = 300; + this.noMelee = true; + this.value = Item.buyPrice(0, 0, 15, 0); + goto IL_2B846; + } + if (this.type == 930) + { + this.useStyle = 5; + this.useAnimation = 18; + this.useTime = 18; + this.name = "Flare Gun"; + this.width = 24; + this.height = 28; + this.shoot = 163; + this.useAmmo = 931; + this.useSound = 11; + this.damage = 2; + this.shootSpeed = 6f; + this.noMelee = true; + this.value = 50000; + this.scale = 0.9f; + this.rare = 1; + this.holdStyle = 1; + goto IL_2B846; + } + if (this.type == 931) + { + this.name = "Flare"; + this.shootSpeed = 6f; + this.shoot = 163; + this.damage = 1; + this.width = 12; + this.height = 12; + this.maxStack = 999; + this.consumable = true; + this.ammo = 931; + this.knockBack = 1.5f; + this.value = 7; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 932) + { + this.name = "Bone Wand"; + this.tileWand = 154; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.createTile = 194; + this.width = 8; + this.height = 10; + this.rare = 1; + this.toolTip = "Places bone"; + goto IL_2B846; + } + if (this.type == 933) + { + this.name = "Leaf Wand"; + this.tileWand = 9; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.createTile = 192; + this.width = 8; + this.height = 10; + this.rare = 1; + this.toolTip = "Places leaves"; + goto IL_2B846; + } + if (this.type == 934) + { + this.name = "Flying Carpet"; + this.width = 34; + this.height = 12; + this.accessory = true; + this.rare = 2; + this.toolTip = "Allows the owner to float for a few seconds"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 935) + { + this.name = "Avenger Emblem"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "12% increased damage"; + this.value = 300000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 936) + { + this.name = "Mechanical Glove"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.rare = 6; + this.toolTip = "Increases melee knockback"; + this.toolTip = "10% increased damage and melee speed"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 937) + { + this.name = "Land Mine"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 210; + this.width = 12; + this.height = 12; + this.placeStyle = 0; + this.mech = true; + this.value = 50000; + this.mech = true; + this.toolTip = "Explodes when stepped on"; + goto IL_2B846; + } + if (this.type == 938) + { + this.name = "Paladin's Shield"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.rare = 8; + this.defense = 6; + this.toolTip = "Absorbs 25% of damage done to players on your team when above 25% life"; + this.toolTip = "Grants immunity to knockback"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 939) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Web Slinger"; + this.shootSpeed = 10f; + this.shoot = 165; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 2; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 940) + { + this.name = "Jungle Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 2; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 941) + { + this.name = "Icy Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 3; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 942) + { + this.name = "Corrupt Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 4; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 943) + { + this.name = "Crimson Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 5; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 944) + { + this.name = "Hallowed Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 6; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 945) + { + this.name = "Blood Water Fountain"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 207; + this.placeStyle = 7; + this.width = 26; + this.height = 36; + goto IL_2B846; + } + if (this.type == 946) + { + this.name = "Umbrella"; + this.width = 44; + this.height = 44; + this.rare = 1; + this.value = 10000; + this.holdStyle = 2; + this.toolTip = "You will fall slower while holding this"; + goto IL_2B846; + } + if (this.type == 947) + { + this.name = "Chlorophyte Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 211; + this.width = 12; + this.height = 12; + this.rare = 7; + this.value = 250; + this.toolTip = "Reacts to the light"; + goto IL_2B846; + } + if (this.type == 948) + { + this.name = "Steampunk Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 8; + goto IL_2B846; + } + if (this.type == 949) + { + this.useStyle = 1; + this.name = "Snowball"; + this.shootSpeed = 7f; + this.shoot = 166; + this.ammo = 949; + this.damage = 4; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 19; + this.useTime = 19; + this.noUseGraphic = true; + this.noMelee = true; + this.ranged = true; + this.knockBack = 4.5f; + goto IL_2B846; + } + if (this.type == 950) + { + this.name = "Ice Skates"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "Provides extra mobility on ice"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 951) + { + this.name = "Snowball Launcher"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 212; + this.width = 20; + this.height = 20; + this.value = 50000; + this.rare = 2; + this.toolTip = "Rapidly launches snowballs"; + goto IL_2B846; + } + if (this.type == 952) + { + this.name = "Web Covered Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 15; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 953) + { + this.name = "Climbing Claws"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "Allows the ability to slide down walls"; + this.toolTip = "Improved ability if combined with Shoe Spikes"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 954) + { + this.name = "Ancient Iron Helmet"; + this.width = 18; + this.height = 18; + this.defense = 2; + this.headSlot = 72; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 955) + { + this.name = "Ancient Gold Helmet"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 73; + this.value = 25000; + goto IL_2B846; + } + if (this.type == 956) + { + this.name = "Ancient Shadow Helmet"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.headSlot = 74; + this.rare = 1; + this.value = 37500; + this.toolTip = "7% increased melee speed"; + goto IL_2B846; + } + if (this.type == 957) + { + this.name = "Ancient Shadow Scalemail"; + this.width = 18; + this.height = 18; + this.defense = 7; + this.bodySlot = 48; + this.rare = 1; + this.value = 30000; + this.toolTip = "7% increased melee speed"; + goto IL_2B846; + } + if (this.type == 958) + { + this.name = "Ancient Shadow Greaves"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.legSlot = 44; + this.rare = 1; + this.value = 22500; + this.toolTip = "7% increased melee speed"; + goto IL_2B846; + } + if (this.type == 959) + { + this.name = "Ancient Necro Helmet"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 75; + this.rare = 2; + this.value = 45000; + this.toolTip = "4% increased ranged damage."; + goto IL_2B846; + } + if (this.type == 960) + { + this.name = "Ancient Cobalt Helmet"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 76; + this.rare = 3; + this.value = 45000; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "3% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 961) + { + this.name = "Ancient Cobalt Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.bodySlot = 49; + this.rare = 3; + this.value = 30000; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "3% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 962) + { + this.name = "Ancient Cobalt Leggings"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.legSlot = 45; + this.rare = 3; + this.value = 30000; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "3% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 963) + { + this.name = "Black Belt"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 7; + this.toolTip = "Gives a chance to dodge attacks"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 964) + { + this.knockBack = 5.5f; + this.useStyle = 5; + this.useAnimation = 42; + this.useTime = 42; + this.name = "Boomstick"; + this.width = 50; + this.height = 14; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 36; + this.damage = 12; + this.shootSpeed = 5.25f; + this.noMelee = true; + this.value = Item.sellPrice(0, 2, 0, 0); + this.rare = 2; + this.ranged = true; + this.toolTip = "Fires a spread of bullets"; + goto IL_2B846; + } + if (this.type == 965) + { + this.name = "Rope"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 8; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 213; + this.width = 12; + this.height = 12; + this.value = 10; + this.tileBoost += 2; + this.toolTip = "Can be climbed on"; + goto IL_2B846; + } + if (this.type == 966) + { + this.name = "Campfire"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 215; + this.width = 12; + this.height = 12; + this.toolTip = "Life regen is increased when near a campfire"; + goto IL_2B846; + } + if (this.type == 967) + { + this.name = "Marshmellow"; + this.width = 12; + this.height = 12; + this.maxStack = 99; + this.value = 100; + goto IL_2B846; + } + if (this.type == 968) + { + this.name = "Marshmellow on a Stick"; + this.holdStyle = 1; + this.width = 12; + this.height = 12; + this.value = 200; + goto IL_2B846; + } + if (this.type == 969) + { + this.name = "Cooked Marshmellow"; + this.useSound = 2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 12; + this.height = 12; + this.buffType = 26; + this.buffTime = 36000; + this.rare = 1; + this.toolTip = "Minor improvements to all stats"; + this.value = 1000; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 970) + { + this.name = "Red Rocket"; + this.createTile = 216; + this.placeStyle = 0; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.width = 12; + this.height = 30; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 971) + { + this.name = "Green Rocket"; + this.createTile = 216; + this.placeStyle = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.width = 12; + this.height = 30; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 972) + { + this.name = "Blue Rocket"; + this.createTile = 216; + this.placeStyle = 2; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.width = 12; + this.height = 30; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 973) + { + this.name = "Yellow Rocket"; + this.createTile = 216; + this.placeStyle = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.width = 12; + this.height = 30; + this.value = 1500; + goto IL_2B846; + } + if (this.type == 974) + { + this.flame = true; + this.name = "Ice Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 9; + this.width = 10; + this.height = 12; + this.value = 60; + this.noWet = true; + goto IL_2B846; + } + if (this.type == 975) + { + this.name = "Shoe Spikes"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "Allows the ability to slide down walls"; + this.toolTip = "Improved ability if combined with Climbing Claws"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 976) + { + this.name = "Tiger Climbing Gear"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 2; + this.toolTip = "Allows the ability to climb walls"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 977) + { + this.name = "Tabi"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 7; + this.toolTip = "Allows the ability to dash"; + this.toolTip = "Double tap a direction"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 978) + { + this.name = "Pink Eskimo Hood"; + this.width = 18; + this.height = 18; + this.headSlot = 77; + this.value = 50000; + this.defense = 1; + goto IL_2B846; + } + if (this.type == 979) + { + this.name = "Pink Eskimo Coat"; + this.width = 18; + this.height = 18; + this.bodySlot = 50; + this.value = 40000; + this.defense = 2; + goto IL_2B846; + } + if (this.type == 980) + { + this.name = "Pink Eskimo Pants"; + this.width = 18; + this.height = 18; + this.legSlot = 46; + this.value = 30000; + this.defense = 1; + goto IL_2B846; + } + if (this.type == 981) + { + this.name = "Pink Thread"; + this.maxStack = 99; + this.width = 12; + this.height = 20; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 982) + { + this.name = "Mana Regeneration Band"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 1; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "Increases mana regeneration rate"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 983) + { + this.name = "Sandstorm in a Balloon"; + this.width = 14; + this.height = 28; + this.rare = 4; + this.value = 150000; + this.accessory = true; + this.toolTip = "Allows the holder to double jump"; + this.toolTip2 = "Increases jump height"; + goto IL_2B846; + } + if (this.type == 984) + { + this.name = "Master Ninja Gear"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 8; + this.toolTip = "Allows the ability to climb walls and dash"; + this.toolTip2 = "Gives a chance to dodge attacks"; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 985) + { + this.useStyle = 1; + this.name = "Rope Coil"; + this.shootSpeed = 10f; + this.shoot = 171; + this.damage = 0; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 100; + this.toolTip = "Throw to create a climbable line of rope"; + goto IL_2B846; + } + if (this.type == 986) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 35; + this.useTime = 35; + this.name = "Blowgun"; + this.width = 38; + this.height = 6; + this.shoot = 10; + this.useAmmo = 51; + this.useSound = 5; + this.damage = 25; + this.shootSpeed = 13f; + this.noMelee = true; + this.value = Item.buyPrice(0, 5, 0, 0); + this.knockBack = 4f; + this.useAmmo = 51; + this.toolTip = "Allows the collection of seeds for ammo"; + this.ranged = true; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 987) + { + this.name = "Blizzard in a Bottle"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "Allows the holder to double jump"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 988) + { + this.name = "Frostburn Arrow"; + this.shootSpeed = 3.75f; + this.shoot = 172; + this.damage = 7; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 2.2f; + this.value = 15; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 989) + { + this.rare = 2; + this.useSound = 1; + this.name = "Enchanted Sword"; + this.useStyle = 1; + this.damage = 18; + this.useAnimation = 19; + this.useTime = 60; + this.scale = 1.1f; + this.width = 30; + this.height = 30; + this.shoot = 173; + this.shootSpeed = 9f; + this.knockBack = 5f; + this.toolTip = "Shoots an echanted beam"; + this.melee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 990) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Pickaxe Axe"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 7; + this.knockBack = 4.75f; + this.width = 20; + this.height = 12; + this.damage = 35; + this.pick = 200; + this.axe = 22; + this.useSound = 1; + this.rare = 4; + this.value = 220000; + this.melee = true; + this.scale = 1.1f; + this.toolTip = "'Not to be confused with a hamdrill'"; + goto IL_2B846; + } + if (this.type == 991) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Cobalt Waraxe"; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 8; + this.knockBack = 5f; + this.width = 20; + this.height = 12; + this.damage = 33; + this.axe = 14; + this.useSound = 1; + this.rare = 4; + this.value = 54000; + this.melee = true; + this.scale = 1.1f; + goto IL_2B846; + } + if (this.type == 992) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Mythril Waraxe"; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 8; + this.knockBack = 6f; + this.width = 20; + this.height = 12; + this.damage = 39; + this.axe = 17; + this.useSound = 1; + this.rare = 4; + this.value = 81000; + this.melee = true; + this.scale = 1.1f; + goto IL_2B846; + } + if (this.type == 993) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Adamantite Waraxe"; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 6; + this.knockBack = 7f; + this.width = 20; + this.height = 12; + this.damage = 43; + this.axe = 20; + this.useSound = 1; + this.rare = 4; + this.value = 108000; + this.melee = true; + this.scale = 1.1f; + goto IL_2B846; + } + if (this.type == 994) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Eater's Bone"; + this.shoot = 175; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Baby Eater of Souls"; + this.value = 0; + this.buffType = 45; + goto IL_2B846; + } + if (this.type == 995) + { + this.name = "Blend-O-Matic"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 217; + this.width = 26; + this.height = 20; + this.value = 100000; + this.toolTip = "Used to craft objects"; + goto IL_2B846; + } + if (this.type == 996) + { + this.name = "Meat Grinder"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 218; + this.width = 26; + this.height = 20; + this.value = 100000; + this.toolTip = "Used to craft objects"; + goto IL_2B846; + } + if (this.type == 997) + { + this.name = "Silt Extractinator"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 219; + this.width = 26; + this.height = 20; + this.value = 100000; + this.toolTip = "Turns silt into something more useful"; + this.toolTip2 = "'To use: Place silt in the extractinator'"; + goto IL_2B846; + } + if (this.type == 998) + { + this.name = "Solidifier"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 220; + this.width = 26; + this.height = 20; + this.value = 100000; + this.toolTip = "Used to craft objects"; + goto IL_2B846; + } + if (this.type == 999) + { + this.name = "Amber"; + this.createTile = 178; + this.placeStyle = 6; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.alpha = 50; + this.width = 10; + this.height = 14; + this.value = 15000; + goto IL_2B846; + } + if (this.type == 1000) + { + this.useStyle = 5; + this.name = "Confetti Gun"; + this.shootSpeed = 10f; + this.shoot = 178; + this.damage = 0; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 11; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.value = 100; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1001) + { + this.name = "Chlorophyte Mask"; + this.width = 18; + this.height = 18; + this.defense = 25; + this.headSlot = 78; + this.rare = 7; + this.value = 300000; + this.toolTip = "16% increased melee damage"; + this.toolTip2 = "6% increased melee critical strike chance"; + goto IL_2B846; + } + if (this.type == 1002) + { + this.name = "Chlorophyte Helmet"; + this.width = 18; + this.height = 18; + this.defense = 13; + this.headSlot = 79; + this.rare = 7; + this.value = 300000; + this.toolTip = "16% increased ranged damage"; + this.toolTip2 = "20% chance to not consume ammo"; + goto IL_2B846; + } + if (this.type == 1003) + { + this.name = "Chlorophyte Headgear"; + this.width = 18; + this.height = 18; + this.defense = 7; + this.headSlot = 80; + this.rare = 7; + this.value = 300000; + this.toolTip = "Increases maximum mana by 80 and reduces mana usage by 17%"; + this.toolTip2 = "16% increased magic damage"; + goto IL_2B846; + } + if (this.type == 1004) + { + this.name = "Chlorophyte Plate Mail"; + this.width = 18; + this.height = 18; + this.defense = 18; + this.bodySlot = 51; + this.rare = 7; + this.value = 240000; + this.toolTip = "5% increased damage"; + this.toolTip = "7% increased critical strike chance"; + goto IL_2B846; + } + if (this.type == 1005) + { + this.name = "Chlorophyte Greaves"; + this.width = 18; + this.height = 18; + this.defense = 13; + this.legSlot = 47; + this.rare = 7; + this.value = 180000; + this.toolTip = "8% increased critical strike chance"; + this.toolTip = "5% increased movement speed"; + goto IL_2B846; + } + if (this.type == 1006) + { + this.name = "Chlorophyte Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(0, 0, 90, 0); + this.rare = 7; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 17; + goto IL_2B846; + } + if (this.type == 1007) + { + this.name = "Red Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 1; + goto IL_2B846; + } + if (this.type == 1008) + { + this.name = "Orange Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 2; + goto IL_2B846; + } + if (this.type == 1009) + { + this.name = "Yellow Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 3; + goto IL_2B846; + } + if (this.type == 1010) + { + this.name = "Lime Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 4; + goto IL_2B846; + } + if (this.type == 1011) + { + this.name = "Green Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 5; + goto IL_2B846; + } + if (this.type == 1012) + { + this.name = "Teal Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 6; + goto IL_2B846; + } + if (this.type == 1013) + { + this.name = "Cyan Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 7; + goto IL_2B846; + } + if (this.type == 1014) + { + this.name = "Sky Blue Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 8; + goto IL_2B846; + } + if (this.type == 1015) + { + this.name = "Blue Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 9; + goto IL_2B846; + } + if (this.type == 1016) + { + this.name = "Purple Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 10; + goto IL_2B846; + } + if (this.type == 1017) + { + this.name = "Violet Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 11; + goto IL_2B846; + } + if (this.type == 1018) + { + this.name = "Pink Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 12; + goto IL_2B846; + } + if (this.type == 1019) + { + this.name = "Red and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 13; + goto IL_2B846; + } + if (this.type == 1020) + { + this.name = "Orange and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 14; + goto IL_2B846; + } + if (this.type == 1021) + { + this.name = "Yellow and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 15; + goto IL_2B846; + } + if (this.type == 1022) + { + this.name = "Lime and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 16; + goto IL_2B846; + } + if (this.type == 1023) + { + this.name = "Green and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 17; + goto IL_2B846; + } + if (this.type == 1024) + { + this.name = "Teal and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 18; + goto IL_2B846; + } + if (this.type == 1025) + { + this.name = "Cyan and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 19; + goto IL_2B846; + } + if (this.type == 1026) + { + this.name = "Sky Blue and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 20; + goto IL_2B846; + } + if (this.type == 1027) + { + this.name = "Blue and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 21; + goto IL_2B846; + } + if (this.type == 1028) + { + this.name = "Purple and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 22; + goto IL_2B846; + } + if (this.type == 1029) + { + this.name = "Violet and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 23; + goto IL_2B846; + } + if (this.type == 1030) + { + this.name = "Pink and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 24; + goto IL_2B846; + } + if (this.type == 1031) + { + this.name = "Flame Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 25; + goto IL_2B846; + } + if (this.type == 1032) + { + this.name = "Flame and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 26; + goto IL_2B846; + } + if (this.type == 1033) + { + this.name = "Green Flame Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 27; + goto IL_2B846; + } + if (this.type == 1034) + { + this.name = "Green Flame and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 28; + goto IL_2B846; + } + if (this.type == 1035) + { + this.name = "Blue Flame Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 29; + goto IL_2B846; + } + if (this.type == 1036) + { + this.name = "Blue Flame and Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 30; + goto IL_2B846; + } + if (this.type == 1037) + { + this.name = "Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 31; + goto IL_2B846; + } + if (this.type == 1038) + { + this.name = "Bright Red Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 32; + goto IL_2B846; + } + if (this.type == 1039) + { + this.name = "Bright Orange Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 33; + goto IL_2B846; + } + if (this.type == 1040) + { + this.name = "Bright Yellow Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 34; + goto IL_2B846; + } + if (this.type == 1041) + { + this.name = "Bright Lime Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 35; + goto IL_2B846; + } + if (this.type == 1042) + { + this.name = "Bright Green Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 36; + goto IL_2B846; + } + if (this.type == 1043) + { + this.name = "Bright Teal Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 37; + goto IL_2B846; + } + if (this.type == 1044) + { + this.name = "Bright Cyan Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 38; + goto IL_2B846; + } + if (this.type == 1045) + { + this.name = "Bright Sky Blue Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 39; + goto IL_2B846; + } + if (this.type == 1046) + { + this.name = "Bright Blue Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 40; + goto IL_2B846; + } + if (this.type == 1047) + { + this.name = "Bright Purple Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 41; + goto IL_2B846; + } + if (this.type == 1048) + { + this.name = "Bright Violet Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 42; + goto IL_2B846; + } + if (this.type == 1049) + { + this.name = "Bright Pink Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 43; + goto IL_2B846; + } + if (this.type == 1050) + { + this.name = "Black Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 44; + goto IL_2B846; + } + if (this.type == 1051) + { + this.name = "Red and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 45; + goto IL_2B846; + } + if (this.type == 1052) + { + this.name = "Orange and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 46; + goto IL_2B846; + } + if (this.type == 1053) + { + this.name = "Yellow and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 47; + goto IL_2B846; + } + if (this.type == 1054) + { + this.name = "Lime and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 48; + goto IL_2B846; + } + if (this.type == 1055) + { + this.name = "Green and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 49; + goto IL_2B846; + } + if (this.type == 1056) + { + this.name = "Teal and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 50; + goto IL_2B846; + } + if (this.type == 1057) + { + this.name = "Cyan and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 51; + goto IL_2B846; + } + if (this.type == 1058) + { + this.name = "Sky Blue and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 52; + goto IL_2B846; + } + if (this.type == 1059) + { + this.name = "Blue and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 53; + goto IL_2B846; + } + if (this.type == 1060) + { + this.name = "Purple and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 54; + goto IL_2B846; + } + if (this.type == 1061) + { + this.name = "Violet and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 55; + goto IL_2B846; + } + if (this.type == 1062) + { + this.name = "Pink and Silver Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 56; + goto IL_2B846; + } + if (this.type == 1063) + { + this.name = "Intense Flame Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 57; + goto IL_2B846; + } + if (this.type == 1064) + { + this.name = "Intense Green Flame Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 58; + goto IL_2B846; + } + if (this.type == 1065) + { + this.name = "Intense Blue Flame Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 59; + goto IL_2B846; + } + if (this.type == 1066) + { + this.name = "Rainbow Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 60; + goto IL_2B846; + } + if (this.type == 1067) + { + this.name = "Intense Rainbow Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 61; + goto IL_2B846; + } + if (this.type == 1068) + { + this.name = "Yellow Gradient Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 62; + goto IL_2B846; + } + if (this.type == 1069) + { + this.name = "Cyan Gradient Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 63; + goto IL_2B846; + } + if (this.type == 1070) + { + this.name = "Violet Gradient Dye"; + this.width = 20; + this.height = 20; + this.maxStack = 1; + this.value = 10000; + this.rare = 1; + this.dye = 64; + goto IL_2B846; + } + if (this.type == 1071) + { + this.name = "Paintbrush"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.width = 24; + this.height = 24; + this.toolTip = "Used with paint to color blocks"; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 1072) + { + this.name = "Paint Roller"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.width = 24; + this.height = 24; + this.toolTip = "Used with paint to color walls"; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 1073) + { + this.name = "Red Paint"; + this.paint = 1; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1074) + { + this.name = "Orange Paint"; + this.paint = 2; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1075) + { + this.name = "Yellow Paint"; + this.paint = 3; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1076) + { + this.name = "Lime Paint"; + this.paint = 4; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1077) + { + this.name = "Green Paint"; + this.paint = 5; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1078) + { + this.name = "Teal Paint"; + this.paint = 6; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1079) + { + this.name = "Cyan Paint"; + this.paint = 7; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1080) + { + this.name = "Sky Blue Paint"; + this.paint = 8; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1081) + { + this.name = "Blue Paint"; + this.paint = 9; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1082) + { + this.name = "Purple Paint"; + this.paint = 10; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1083) + { + this.name = "Violet Paint"; + this.paint = 11; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1084) + { + this.name = "Pink Paint"; + this.paint = 12; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1085) + { + this.name = "Deep Red Paint"; + this.paint = 13; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1086) + { + this.name = "Deep Orange Paint"; + this.paint = 14; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1087) + { + this.name = "Deep Yellow Paint"; + this.paint = 15; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1088) + { + this.name = "Deep Lime Paint"; + this.paint = 16; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1089) + { + this.name = "Deep Green Paint"; + this.paint = 17; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1090) + { + this.name = "Deep Teal Paint"; + this.paint = 18; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1091) + { + this.name = "Deep Cyan Paint"; + this.paint = 19; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1092) + { + this.name = "Deep Sky Blue Paint"; + this.paint = 20; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1093) + { + this.name = "Deep Blue Paint"; + this.paint = 21; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1094) + { + this.name = "Deep Purple Paint"; + this.paint = 22; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1095) + { + this.name = "Deep Violet Paint"; + this.paint = 23; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1096) + { + this.name = "Deep Pink Paint"; + this.paint = 24; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1097) + { + this.name = "Black Paint"; + this.paint = 25; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1098) + { + this.name = "White Paint"; + this.paint = 26; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1099) + { + this.name = "Grey Paint"; + this.paint = 27; + this.width = 24; + this.height = 24; + this.value = 25; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1100) + { + this.name = "Paint Scraper"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.width = 24; + this.height = 24; + this.toolTip = "Used to remove paint"; + this.value = 10000; + goto IL_2B846; + } + if (this.type == 1101) + { + this.name = "Lihzahrd Brick"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 226; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1102) + { + this.name = "Lihzahrd Brick Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 112; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1103) + { + this.name = "Slush Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 224; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1104) + { + this.name = "Palladium Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 221; + this.width = 12; + this.height = 12; + this.value = 4500; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1105) + { + this.name = "Orichalcum Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 222; + this.width = 12; + this.height = 12; + this.value = 6500; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1106) + { + this.name = "Titanium Ore"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 223; + this.width = 12; + this.height = 12; + this.value = 8500; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1107) + { + this.name = "Teal Mushroom"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Teal Dye"; + this.placeStyle = 0; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1108) + { + this.name = "Green Mushroom"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Green Dye"; + this.placeStyle = 1; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1109) + { + this.name = "Sky Blue Flower"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Sky Blue Dye"; + this.placeStyle = 2; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1110) + { + this.name = "Yellow Marigold"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Yellow Dye"; + this.placeStyle = 3; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1111) + { + this.name = "Blue Berries"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Blue Dye"; + this.placeStyle = 4; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1112) + { + this.name = "Lime Kelp"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Lime Dye"; + this.placeStyle = 5; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1113) + { + this.name = "Pink Prickly Pear"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Pink Dye"; + this.placeStyle = 6; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1114) + { + this.name = "Orange Bloodroot"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Orange Dye"; + this.placeStyle = 7; + this.createTile = 227; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + goto IL_2B846; + } + if (this.type == 1115) + { + this.name = "Red Husk"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Red Dye"; + goto IL_2B846; + } + if (this.type == 1116) + { + this.name = "Cyan Husk"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Cyan Dye"; + goto IL_2B846; + } + if (this.type == 1117) + { + this.name = "Violet Husk"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Violet Dye"; + goto IL_2B846; + } + if (this.type == 1118) + { + this.name = "Purple Mucus"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Purple Dye"; + goto IL_2B846; + } + if (this.type == 1119) + { + this.name = "Black Ink"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + this.toolTip = "Used to make Black Dye"; + goto IL_2B846; + } + if (this.type == 1120) + { + this.name = "Dye Vat"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 228; + this.width = 26; + this.height = 20; + this.value = Item.buyPrice(0, 5, 0, 0); + this.toolTip = "Used to craft dyes"; + goto IL_2B846; + } + if (this.type == 1121) + { + this.name = "Beegun"; + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 12; + this.useTime = 12; + this.mana = 5; + this.width = 50; + this.height = 18; + this.shoot = 181; + this.useSound = 11; + this.damage = 7; + this.shootSpeed = 8f; + this.noMelee = true; + this.value = 350000; + this.rare = 2; + this.magic = true; + this.scale = 0.8f; + goto IL_2B846; + } + if (this.type == 1122) + { + this.useStyle = 1; + this.name = "Possessed Hatchet"; + this.shootSpeed = 12f; + this.shoot = 182; + this.damage = 90; + this.width = 18; + this.height = 20; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 500000; + this.knockBack = 5f; + this.melee = true; + this.rare = 7; + this.toolTip = "A magical returning hatchet"; + goto IL_2B846; + } + if (this.type == 1123) + { + this.name = "Bee Keeper"; + this.useStyle = 1; + this.useAnimation = 22; + this.knockBack = 5.2f; + this.width = 40; + this.height = 40; + this.damage = 22; + this.scale = 1.1f; + this.useSound = 1; + this.rare = 3; + this.value = 27000; + this.melee = true; + this.toolTip = "Summons killer bees after striking your foe"; + this.toolTip2 = "Small chance to cause confusion"; + goto IL_2B846; + } + if (this.type == 1124) + { + this.name = "Hive"; + this.width = 12; + this.height = 12; + this.maxStack = 999; + goto IL_2B846; + } + if (this.type == 1125) + { + this.name = "Honey Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 229; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1126) + { + this.name = "Hive Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 108; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1127) + { + this.name = "Crispy Honey Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 230; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1128) + { + this.name = "Honey Bucket"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 1129) + { + this.name = "Hive Wand"; + this.tileWand = 1124; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.createTile = 225; + this.width = 8; + this.height = 10; + this.rare = 1; + this.toolTip = "Places hives"; + goto IL_2B846; + } + if (this.type == 1130) + { + this.useStyle = 1; + this.name = "Beenade"; + this.shootSpeed = 6f; + this.shoot = 183; + this.knockBack = 1f; + this.damage = 14; + this.width = 10; + this.height = 10; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 200; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1131) + { + this.name = "Gravity Globe"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 8; + this.toolTip = "Allows the holder to reverse gravity"; + this.toolTip2 = "Press UP to change gravity"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 1132) + { + this.name = "Honey Comb"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 2; + this.toolTip = "Releases bees when damaged"; + this.value = 100000; + goto IL_2B846; + } + if (this.type == 1133) + { + this.useStyle = 4; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Abeemination"; + this.width = 28; + this.height = 28; + this.maxStack = 20; + this.toolTip = "Summons the Queen Bee"; + goto IL_2B846; + } + if (this.type == 1134) + { + this.name = "Bottled Honey"; + this.useSound = 3; + this.healLife = 80; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.potion = true; + this.value = 40; + goto IL_2B846; + } + if (this.type == 1135) + { + this.name = "Rain Hat"; + this.width = 18; + this.height = 18; + this.headSlot = 81; + this.value = 1000; + this.vanity = true; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1136) + { + this.name = "Rain Coat"; + this.width = 18; + this.height = 18; + this.bodySlot = 52; + this.value = 1000; + this.vanity = true; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1137) + { + this.name = "Lihzahrd Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 12; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1138) + { + this.name = "Dungeon Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 13; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1139) + { + this.name = "Lead Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 14; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1140) + { + this.name = "Iron Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 15; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1141) + { + this.name = "Temple Key"; + this.width = 14; + this.height = 20; + this.maxStack = 99; + this.toolTip = "Opens the jungle temple door"; + this.rare = 7; + goto IL_2B846; + } + if (this.type == 1142) + { + this.name = "Lihzahrd Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 16; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 1143) + { + this.name = "Lihzahrd Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 12; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1144) + { + this.name = "Lihzahrd Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 9; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1145) + { + this.name = "Lihzahrd Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 10; + this.width = 28; + this.height = 14; + this.value = 150; + this.toolTip = "Used for basic crafting"; + goto IL_2B846; + } + if (this.type == 1146) + { + this.name = "Super Dart Trap"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 137; + this.placeStyle = 1; + this.width = 12; + this.height = 12; + this.value = 10000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 1147) + { + this.name = "Flame Trap"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 137; + this.placeStyle = 2; + this.width = 12; + this.height = 12; + this.value = 10000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 1148) + { + this.name = "Spiky Ball Trap"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 137; + this.placeStyle = 3; + this.width = 12; + this.height = 12; + this.value = 10000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 1149) + { + this.name = "Spear Trap"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 137; + this.placeStyle = 4; + this.width = 12; + this.height = 12; + this.value = 10000; + this.mech = true; + goto IL_2B846; + } + if (this.type == 1150) + { + this.name = "Wooden Spike"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 232; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1151) + { + this.name = "Lihzahrd Pressure Plate"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 135; + this.width = 12; + this.height = 12; + this.placeStyle = 6; + this.mech = true; + this.value = 5000; + this.toolTip = "Activates when a player steps on it on"; + goto IL_2B846; + } + if (this.type == 1152) + { + this.name = "Lihzahrd Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 43; + goto IL_2B846; + } + if (this.type == 1153) + { + this.name = "Lihzahrd Watcher Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 44; + goto IL_2B846; + } + if (this.type == 1154) + { + this.name = "Lihzahrd Guardian Statue"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 45; + goto IL_2B846; + } + if (this.type == 1155) + { + this.name = "Wasp Gun"; + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 11; + this.useTime = 11; + this.mana = 6; + this.width = 50; + this.height = 18; + this.shoot = 189; + this.useSound = 11; + this.damage = 14; + this.shootSpeed = 9f; + this.noMelee = true; + this.value = 500000; + this.rare = 8; + this.magic = true; + goto IL_2B846; + } + if (this.type == 1156) + { + this.channel = true; + this.name = "Piranha Gun"; + this.useStyle = 5; + this.useAnimation = 30; + this.useTime = 30; + this.knockBack = 1f; + this.width = 30; + this.height = 10; + this.damage = 33; + this.scale = 1.1f; + this.shoot = 190; + this.shootSpeed = 14f; + this.useSound = 10; + this.rare = 8; + this.value = Item.sellPrice(0, 5, 50, 0); + this.ranged = true; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 1157) + { + this.mana = 10; + this.damage = 25; + this.useStyle = 1; + this.name = "Pygmy Staff"; + this.shootSpeed = 10f; + this.shoot = 191; + this.width = 26; + this.height = 28; + this.useSound = 44; + this.useAnimation = 28; + this.useTime = 28; + this.rare = 7; + this.noMelee = true; + this.knockBack = 3f; + this.toolTip = "Summons a pygmy to fight for you"; + this.buffType = 49; + this.value = 100000; + this.summon = true; + goto IL_2B846; + } + if (this.type == 1158) + { + this.name = "Pygmy Necklace"; + this.rare = 7; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Increases your max number of minions"; + this.value = Item.buyPrice(0, 40, 0, 0); + goto IL_2B846; + } + if (this.type == 1159) + { + this.name = "Tiki Mask"; + this.width = 18; + this.height = 18; + this.defense = 6; + this.headSlot = 82; + this.rare = 7; + this.value = Item.buyPrice(0, 50, 0, 0); + this.toolTip = "Increases your max number of minions"; + this.toolTip2 = "Increases minion damage by 10%"; + goto IL_2B846; + } + if (this.type == 1160) + { + this.name = "Tiki Shirt"; + this.width = 18; + this.height = 18; + this.defense = 17; + this.bodySlot = 53; + this.rare = 7; + this.value = Item.buyPrice(0, 50, 0, 0); + this.toolTip = "Increases your max number of minions"; + this.toolTip2 = "Increases minion damage by 10%"; + goto IL_2B846; + } + if (this.type == 1161) + { + this.name = "Tiki Pants"; + this.width = 18; + this.height = 18; + this.defense = 12; + this.legSlot = 48; + this.rare = 7; + this.value = Item.buyPrice(0, 50, 0, 0); + this.toolTip = "Increases your max number of minions"; + this.toolTip2 = "Increases minion damage by 10%"; + goto IL_2B846; + } + if (this.type == 1162) + { + this.name = "Leaf Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = Item.buyPrice(1, 0, 0, 0); + this.rare = 5; + goto IL_2B846; + } + if (this.type == 1163) + { + this.name = "Blizzard in a Balloon"; + this.width = 14; + this.height = 28; + this.rare = 4; + this.value = 150000; + this.accessory = true; + this.toolTip = "Allows the holder to double jump"; + this.toolTip2 = "Increases jump height"; + goto IL_2B846; + } + if (this.type == 1164) + { + this.name = "Bundle of Balloons"; + this.width = 14; + this.height = 28; + this.rare = 8; + this.value = 150000; + this.accessory = true; + this.toolTip = "Allows the holder to quadruple jump"; + this.toolTip2 = "Increases jump height"; + goto IL_2B846; + } + if (this.type == 1165) + { + this.name = "Bat Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 1166) + { + this.name = "Bone Sword"; + this.useStyle = 1; + this.useAnimation = 22; + this.knockBack = 4.5f; + this.width = 24; + this.height = 28; + this.damage = 16; + this.scale = 1.05f; + this.useSound = 1; + this.rare = 3; + this.value = 9000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1167) + { + this.name = "Hercules Beetle"; + this.rare = 7; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Increases the damage and knockback of your minions"; + this.value = Item.buyPrice(0, 40, 0, 0); + goto IL_2B846; + } + if (this.type == 1168) + { + this.useStyle = 1; + this.name = "Smoke Bomb"; + this.shootSpeed = 6f; + this.shoot = 196; + this.width = 18; + this.height = 20; + this.maxStack = 999; + this.consumable = true; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 20; + goto IL_2B846; + } + if (this.type == 1169) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Bone Key"; + this.shoot = 197; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Baby Skeletron Head"; + this.value = Item.sellPrice(0, 5, 0, 0); + this.buffType = 50; + goto IL_2B846; + } + if (this.type == 1170) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Nectar"; + this.shoot = 198; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Baby Hornet"; + this.value = Item.sellPrice(0, 3, 0, 0); + this.buffType = 51; + goto IL_2B846; + } + if (this.type == 1171) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Tiki Totem"; + this.shoot = 199; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Tiki Spirit"; + this.buffType = 52; + this.value = Item.buyPrice(2, 0, 0, 0); + goto IL_2B846; + } + if (this.type == 1172) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Lizard Egg"; + this.shoot = 200; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Pet Lizard"; + this.value = Item.sellPrice(0, 2, 0, 0); + this.buffType = 53; + goto IL_2B846; + } + if (this.type == 1173) + { + this.name = "Grave Marker"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.placeStyle = 1; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 1174) + { + this.name = "Cross Grave Marker"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.placeStyle = 2; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 1175) + { + this.name = "Headstone"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.placeStyle = 3; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 1176) + { + this.name = "Gravestone"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.placeStyle = 4; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 1177) + { + this.name = "Obelisk"; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.placeStyle = 5; + this.width = 20; + this.height = 20; + goto IL_2B846; + } + if (this.type == 1178) + { + this.useStyle = 5; + this.mana = 4; + this.autoReuse = true; + this.useAnimation = 8; + this.useTime = 8; + this.name = "Leaf Blower"; + this.width = 24; + this.height = 18; + this.shoot = 206; + this.useSound = 7; + this.damage = 42; + this.shootSpeed = 11f; + this.noMelee = true; + this.value = 350000; + this.knockBack = 3f; + this.rare = 7; + this.toolTip = "Rapidly shoots razor sharp leaves"; + this.magic = true; + goto IL_2B846; + } + if (this.type == 1179) + { + this.name = "Chlorophyte Bullet"; + this.shootSpeed = 5f; + this.shoot = 207; + this.damage = 15; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 4.5f; + this.value = 50; + this.ranged = true; + this.rare = 7; + goto IL_2B846; + } + if (this.type == 1180) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Parrot Cracker"; + this.shoot = 208; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Pet Parrot"; + this.buffType = 54; + this.value = Item.sellPrice(0, 75, 0, 0); + goto IL_2B846; + } + if (this.type == 1181) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Strange Glowing Mushroom"; + this.shoot = 209; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Baby Truffle"; + this.value = Item.buyPrice(0, 45, 0, 0); + this.buffType = 55; + goto IL_2B846; + } + if (this.type == 1182) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Seedling"; + this.shoot = 210; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Pet Sapling"; + this.value = Item.sellPrice(0, 2, 0, 0); + this.buffType = 56; + goto IL_2B846; + } + if (this.type == 1183) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Wisp in a Bottle"; + this.shoot = 211; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 8; + this.noMelee = true; + this.toolTip = "Summons a Wisp to provide light"; + this.value = Item.sellPrice(0, 5, 50, 0); + this.buffType = 57; + goto IL_2B846; + } + if (this.type == 1184) + { + this.name = "Palladium Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 13500; + this.rare = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 12; + goto IL_2B846; + } + if (this.type == 1185) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Palladium Sword"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 25; + this.knockBack = 4.75f; + this.width = 40; + this.height = 40; + this.damage = 36; + this.scale = 1.125f; + this.useSound = 1; + this.rare = 4; + this.value = 92000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1186) + { + this.name = "Palladium Pike"; + this.useStyle = 5; + this.useAnimation = 27; + this.useTime = 27; + this.shootSpeed = 4.4f; + this.knockBack = 4.5f; + this.width = 40; + this.height = 40; + this.damage = 32; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 212; + this.rare = 4; + this.value = 60000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1187) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 24; + this.useTime = 24; + this.name = "Palladium Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 32; + this.shootSpeed = 9.25f; + this.noMelee = true; + this.value = 80000; + this.ranged = true; + this.rare = 4; + this.knockBack = 1.75f; + goto IL_2B846; + } + if (this.type == 1188) + { + this.name = "Palladium Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.autoReuse = true; + this.useAnimation = 25; + this.useTime = 11; + this.knockBack = 5f; + this.width = 20; + this.height = 12; + this.damage = 12; + this.pick = 130; + this.useSound = 1; + this.rare = 4; + this.value = 72000; + this.melee = true; + this.toolTip = "Can mine Mythril and Orichalcum"; + this.scale = 1.15f; + goto IL_2B846; + } + if (this.type == 1189) + { + this.name = "Palladium Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 11; + this.shootSpeed = 32f; + this.knockBack = 0f; + this.width = 20; + this.height = 12; + this.damage = 12; + this.pick = 130; + this.useSound = 23; + this.shoot = 213; + this.rare = 4; + this.value = 72000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.toolTip = "Can mine Mythril and Orichalcum"; + goto IL_2B846; + } + if (this.type == 1190) + { + this.name = "Palladium Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 8; + this.shootSpeed = 40f; + this.knockBack = 2.9f; + this.width = 20; + this.height = 12; + this.damage = 26; + this.axe = 15; + this.useSound = 23; + this.shoot = 214; + this.rare = 4; + this.value = 72000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 1191) + { + this.name = "Orichalcum Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 22000; + this.rare = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 14; + goto IL_2B846; + } + if (this.type == 1192) + { + this.name = "Orichalcum Sword"; + this.useStyle = 1; + this.useAnimation = 26; + this.useTime = 26; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 41; + this.scale = 1.17f; + this.useSound = 1; + this.rare = 4; + this.value = 126500; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1193) + { + this.name = "Orichalcum Halberd"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 25; + this.shootSpeed = 4.5f; + this.knockBack = 5.5f; + this.width = 40; + this.height = 40; + this.damage = 36; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 215; + this.rare = 4; + this.value = 82500; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1194) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 22; + this.useTime = 22; + this.name = "Orichalcum Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 36; + this.shootSpeed = 9.75f; + this.noMelee = true; + this.value = 110000; + this.ranged = true; + this.rare = 4; + this.knockBack = 2f; + goto IL_2B846; + } + if (this.type == 1195) + { + this.name = "Orichalcum Pickaxe"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 8; + this.knockBack = 5f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 17; + this.pick = 165; + this.useSound = 1; + this.rare = 4; + this.value = 99000; + this.melee = true; + this.toolTip = "Can mine Adamantite and Titanium"; + this.scale = 1.15f; + goto IL_2B846; + } + if (this.type == 1196) + { + this.name = "Orichalcum Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 10; + this.shootSpeed = 32f; + this.knockBack = 0f; + this.width = 20; + this.height = 12; + this.damage = 17; + this.pick = 165; + this.useSound = 23; + this.shoot = 216; + this.rare = 4; + this.value = 99000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.toolTip = "Can mine Adamantite and Titanium"; + goto IL_2B846; + } + if (this.type == 1197) + { + this.name = "Orichalcum Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 40f; + this.knockBack = 3.75f; + this.width = 20; + this.height = 12; + this.damage = 31; + this.axe = 18; + this.useSound = 23; + this.shoot = 217; + this.rare = 4; + this.value = 99000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 1198) + { + this.name = "Titanium Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 37500; + this.rare = 3; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 16; + goto IL_2B846; + } + if (this.type == 1199) + { + this.name = "Titanium Sword"; + this.useStyle = 1; + this.useAnimation = 26; + this.useTime = 26; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 46; + this.scale = 1.2f; + this.useSound = 1; + this.rare = 4; + this.value = 161000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1200) + { + this.name = "Titanium Trident"; + this.useStyle = 5; + this.useAnimation = 23; + this.useTime = 23; + this.shootSpeed = 5f; + this.knockBack = 6.2f; + this.width = 40; + this.height = 40; + this.damage = 40; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 218; + this.rare = 4; + this.value = 105000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1201) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 19; + this.useTime = 19; + this.name = "Titanium Repeater"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 38; + this.shootSpeed = 10.5f; + this.noMelee = true; + this.value = 140000; + this.ranged = true; + this.rare = 4; + this.knockBack = 2.5f; + goto IL_2B846; + } + if (this.type == 1202) + { + this.name = "Titanium Pickaxe"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 7; + this.knockBack = 5f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 27; + this.pick = 190; + this.useSound = 1; + this.rare = 4; + this.value = 126000; + this.melee = true; + this.scale = 1.15f; + goto IL_2B846; + } + if (this.type == 1203) + { + this.name = "Titanium Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 32f; + this.knockBack = 0f; + this.width = 20; + this.height = 12; + this.damage = 27; + this.pick = 190; + this.useSound = 23; + this.shoot = 219; + this.rare = 4; + this.value = 126000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 1204) + { + this.name = "Titanium Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 6; + this.shootSpeed = 40f; + this.knockBack = 4.6f; + this.width = 20; + this.height = 12; + this.damage = 34; + this.axe = 21; + this.useSound = 23; + this.shoot = 220; + this.rare = 4; + this.value = 126000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 1205) + { + this.name = "Palladium Mask"; + this.width = 18; + this.height = 18; + this.defense = 14; + this.headSlot = 83; + this.rare = 4; + this.value = 75000; + this.toolTip = "7% increased movement speed"; + this.toolTip2 = "12% increased melee speed"; + goto IL_2B846; + } + if (this.type == 1206) + { + this.name = "Palladium Helmet"; + this.width = 18; + this.height = 18; + this.defense = 5; + this.headSlot = 84; + this.rare = 4; + this.value = 75000; + this.toolTip = "10% increased ranged damage"; + this.toolTip2 = "6% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 1207) + { + this.name = "Palladium Headgear"; + this.width = 18; + this.height = 18; + this.defense = 3; + this.headSlot = 85; + this.rare = 4; + this.value = 75000; + this.toolTip = "Increases maximum mana by 40"; + this.toolTip2 = "9% increased magic critical strike chance"; + goto IL_2B846; + } + if (this.type == 1208) + { + this.name = "Palladium Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 10; + this.bodySlot = 54; + this.rare = 4; + this.value = 60000; + this.toolTip2 = "3% increased critical strike chance"; + goto IL_2B846; + } + if (this.type == 1209) + { + this.name = "Palladium Leggings"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.legSlot = 49; + this.rare = 4; + this.value = 45000; + this.toolTip2 = "10% increased movement speed"; + goto IL_2B846; + } + if (this.type == 1210) + { + this.name = "Orichalcum Mask"; + this.width = 18; + this.height = 18; + this.defense = 19; + this.headSlot = 86; + this.rare = 4; + this.value = 112500; + this.toolTip = "5% increased melee critical strike chance"; + this.toolTip2 = "10% increased melee damage"; + goto IL_2B846; + } + if (this.type == 1211) + { + this.name = "Orichalcum Helmet"; + this.width = 18; + this.height = 18; + this.defense = 7; + this.headSlot = 87; + this.rare = 4; + this.value = 112500; + this.toolTip = "12% increased ranged damage"; + this.toolTip2 = "7% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 1212) + { + this.name = "Orichalcum Headgear"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 88; + this.rare = 4; + this.value = 112500; + this.toolTip = "Increases maximum mana by 60"; + this.toolTip2 = "15% increased magic damage"; + goto IL_2B846; + } + if (this.type == 1213) + { + this.name = "Orichalcum Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 13; + this.bodySlot = 55; + this.rare = 4; + this.value = 90000; + this.toolTip2 = "5% increased damage"; + goto IL_2B846; + } + if (this.type == 1214) + { + this.name = "Orichalcum Leggings"; + this.width = 18; + this.height = 18; + this.defense = 10; + this.legSlot = 50; + this.rare = 4; + this.value = 67500; + this.toolTip2 = "3% increased critical strike chance"; + goto IL_2B846; + } + if (this.type == 1215) + { + this.name = "Titanium Mask"; + this.width = 18; + this.height = 18; + this.defense = 23; + this.headSlot = 89; + this.rare = 4; + this.value = 150000; + this.toolTip = "7% increased melee critical strike chance"; + this.toolTip2 = "14% increased melee damage"; + goto IL_2B846; + } + if (this.type == 1216) + { + this.name = "Titanium Helmet"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.headSlot = 90; + this.rare = 4; + this.value = 150000; + this.toolTip = "14% increased ranged damage"; + this.toolTip2 = "8% increased ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 1217) + { + this.name = "Titanium Headgear"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 91; + this.rare = 4; + this.value = 150000; + this.toolTip = "Increases maximum mana by 80"; + this.toolTip2 = "11% increased magic damage and critical strike chance"; + goto IL_2B846; + } + if (this.type == 1218) + { + this.name = "Titanium Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 15; + this.bodySlot = 56; + this.rare = 4; + this.value = 120000; + this.toolTip = "6% increased damage"; + goto IL_2B846; + } + if (this.type == 1219) + { + this.name = "Titanium Leggings"; + this.width = 18; + this.height = 18; + this.defense = 11; + this.legSlot = 51; + this.rare = 4; + this.value = 90000; + this.toolTip = "4% increased critical strike chance"; + this.toolTip2 = "5% increased movement speed"; + goto IL_2B846; + } + if (this.type == 1220) + { + this.name = "Mythril Anvil"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 134; + this.placeStyle = 1; + this.width = 28; + this.height = 14; + this.value = 25000; + this.toolTip = "Used to craft items from mythril, orichalcum, adamantite, and titanium bars"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1221) + { + this.name = "Orichalcum Forge"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 133; + this.placeStyle = 1; + this.width = 44; + this.height = 30; + this.value = 50000; + this.toolTip = "Used to smelt adamantite and titanium ore"; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1222) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Palladium Waraxe"; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 8; + this.knockBack = 5.5f; + this.width = 20; + this.height = 12; + this.damage = 36; + this.axe = 15; + this.useSound = 1; + this.rare = 4; + this.value = 72000; + this.melee = true; + this.scale = 1.1f; + goto IL_2B846; + } + if (this.type == 1223) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Orichalcum Waraxe"; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 7; + this.knockBack = 6.5f; + this.width = 20; + this.height = 12; + this.damage = 41; + this.axe = 18; + this.useSound = 1; + this.rare = 4; + this.value = 99000; + this.melee = true; + this.scale = 1.1f; + goto IL_2B846; + } + if (this.type == 1224) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Titanium Waraxe"; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 6; + this.knockBack = 7.5f; + this.width = 20; + this.height = 12; + this.damage = 44; + this.axe = 21; + this.useSound = 1; + this.rare = 4; + this.value = 108000; + this.melee = true; + this.scale = 1.1f; + goto IL_2B846; + } + if (this.type == 1225) + { + this.name = "Hallowed Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(0, 0, 80, 0); + this.rare = 4; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 18; + goto IL_2B846; + } + if (this.type == 1226) + { + this.name = "Chlorophyte Claymore"; + this.useStyle = 1; + this.useAnimation = 28; + this.useTime = 60; + this.shoot = 229; + this.shootSpeed = 8f; + this.knockBack = 6f; + this.width = 40; + this.height = 40; + this.damage = 65; + this.useSound = 1; + this.rare = 7; + this.value = 276000; + this.scale = 1.25f; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1227) + { + this.name = "Chlorophyte Saber"; + this.autoReuse = true; + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 17; + this.useTime = 42; + this.shoot = 228; + this.shootSpeed = 8f; + this.knockBack = 4f; + this.width = 40; + this.height = 40; + this.damage = 43; + this.useSound = 1; + this.rare = 7; + this.value = 276000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1228) + { + this.name = "Chlorophyte Partisan"; + this.useStyle = 5; + this.useAnimation = 23; + this.useTime = 23; + this.shootSpeed = 5f; + this.knockBack = 6.2f; + this.width = 40; + this.height = 40; + this.damage = 49; + this.scale = 1.1f; + this.useSound = 1; + this.shoot = 222; + this.rare = 7; + this.value = 180000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1229) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 19; + this.useTime = 19; + this.name = "Chlorophyte Shotbow"; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = 1; + this.useSound = 5; + this.damage = 34; + this.shootSpeed = 11.5f; + this.noMelee = true; + this.value = 240000; + this.ranged = true; + this.rare = 7; + this.knockBack = 2.75f; + goto IL_2B846; + } + if (this.type == 1230) + { + this.name = "Chlorophyte Pickaxe"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 7; + this.knockBack = 5f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 40; + this.pick = 200; + this.useSound = 1; + this.rare = 7; + this.value = 216000; + this.melee = true; + this.scale = 1.15f; + this.tileBoost++; + goto IL_2B846; + } + if (this.type == 1231) + { + this.name = "Chlorophyte Drill"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 40f; + this.knockBack = 1f; + this.width = 20; + this.height = 12; + this.damage = 35; + this.pick = 200; + this.useSound = 23; + this.shoot = 223; + this.rare = 7; + this.value = 216000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.tileBoost++; + goto IL_2B846; + } + if (this.type == 1232) + { + this.name = "Chlorophyte Chainsaw"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 46f; + this.knockBack = 4.6f; + this.width = 20; + this.height = 12; + this.damage = 50; + this.axe = 23; + this.useSound = 23; + this.shoot = 224; + this.rare = 7; + this.value = 216000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.tileBoost++; + goto IL_2B846; + } + if (this.type == 1233) + { + this.useTurn = true; + this.autoReuse = true; + this.name = "Chlorophyte Greataxe"; + this.useStyle = 1; + this.useAnimation = 30; + this.useTime = 6; + this.knockBack = 7f; + this.width = 20; + this.height = 12; + this.damage = 70; + this.axe = 23; + this.useSound = 1; + this.rare = 7; + this.value = 216000; + this.melee = true; + this.scale = 1.15f; + this.tileBoost++; + goto IL_2B846; + } + if (this.type == 1234) + { + this.name = "Chlorophyte Warhammer"; + this.useTurn = true; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 35; + this.useTime = 14; + this.hammer = 90; + this.width = 24; + this.height = 28; + this.damage = 80; + this.knockBack = 8f; + this.scale = 1.25f; + this.useSound = 1; + this.rare = 7; + this.value = 216000; + this.melee = true; + this.tileBoost++; + goto IL_2B846; + } + if (this.type == 1235) + { + this.name = "Chlorophyte Arrow"; + this.shootSpeed = 4.5f; + this.shoot = 225; + this.damage = 16; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 3.5f; + this.value = 100; + this.ranged = true; + this.rare = 7; + goto IL_2B846; + } + if (this.type == 1236) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Amethyst Hook"; + this.shootSpeed = 10f; + this.shoot = 230; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 1237) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Topaz Hook"; + this.shootSpeed = 10.5f; + this.shoot = 231; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 1238) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Sapphire Hook"; + this.shootSpeed = 11f; + this.shoot = 232; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 1239) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Emerald Hook"; + this.shootSpeed = 11.5f; + this.shoot = 233; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 1240) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Ruby Hook"; + this.shootSpeed = 12f; + this.shoot = 234; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 1241) + { + this.noUseGraphic = true; + this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.name = "Diamond Hook"; + this.shootSpeed = 12.5f; + this.shoot = 235; + this.width = 18; + this.height = 28; + this.useSound = 1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 1; + this.noMelee = true; + this.value = 20000; + goto IL_2B846; + } + if (this.type == 1242) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Amber Mosquito"; + this.shoot = 236; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.toolTip = "Summons a Baby Dinosaur"; + this.value = Item.sellPrice(0, 7, 50, 0); + this.buffType = 61; + goto IL_2B846; + } + if (this.type == 1243) + { + this.name = "Umbrella Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 92; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1244) + { + this.mana = 10; + this.damage = 36; + this.useStyle = 1; + this.name = "Nimbus Rod"; + this.shootSpeed = 16f; + this.shoot = 237; + this.width = 26; + this.height = 28; + this.useSound = 8; + this.useAnimation = 22; + this.useTime = 22; + this.rare = 6; + this.noMelee = true; + this.knockBack = 0f; + this.toolTip = "Summons a cloud to rain down on your foes"; + this.value = Item.sellPrice(0, 3, 50, 0); + this.magic = true; + goto IL_2B846; + } + if (this.type == 1245) + { + this.name = "Orange Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 10; + this.width = 10; + this.height = 12; + this.value = 60; + this.noWet = true; + goto IL_2B846; + } + if (this.type == 1246) + { + this.name = "Crimsand Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 234; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1247) + { + this.name = "Bee Cloak"; + this.width = 20; + this.height = 24; + this.value = 150000; + this.toolTip = "Causes stars to fall and releases bees when injured"; + this.accessory = true; + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1248) + { + this.name = "Eye of the Golem"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "10% increased critical strike chance"; + this.value = 100000; + this.rare = 7; + goto IL_2B846; + } + if (this.type == 1249) + { + this.name = "Honey Balloon"; + this.width = 14; + this.height = 28; + this.rare = 2; + this.value = 54000; + this.accessory = true; + this.toolTip = "Increases jump height"; + this.toolTip2 = "Releases bees when damaged"; + goto IL_2B846; + } + if (this.type == 1250) + { + this.name = "Blue Horseshoe Balloon"; + this.width = 20; + this.height = 22; + this.rare = 4; + this.value = 45000; + this.accessory = true; + this.toolTip = "Allows the holder to double jump"; + this.toolTip = "Increases jump height and negates fall damage"; + goto IL_2B846; + } + if (this.type == 1251) + { + this.name = "White Horseshoe Balloon"; + this.width = 20; + this.height = 22; + this.rare = 4; + this.value = 45000; + this.accessory = true; + this.toolTip = "Allows the holder to double jump"; + this.toolTip = "Increases jump height and negates fall damage"; + goto IL_2B846; + } + if (this.type == 1252) + { + this.name = "Yellow Horseshoe Balloon"; + this.width = 20; + this.height = 22; + this.rare = 4; + this.value = 45000; + this.accessory = true; + this.toolTip = "Allows the holder to double jump"; + this.toolTip = "Increases jump height and negates fall damage"; + goto IL_2B846; + } + if (this.type == 1253) + { + this.name = "Frozen Turtle Scale"; + this.width = 20; + this.height = 24; + this.value = 225000; + this.toolTip = "Puts a shell around the owner when below 20% life"; + this.accessory = true; + this.rare = 5; + goto IL_2B846; + } + if (this.type == 1254) + { + this.useStyle = 5; + this.useAnimation = 60; + this.useTime = 60; + this.name = "Sniper Rifle"; + this.crit += 15; + this.width = 44; + this.height = 14; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 40; + this.damage = 125; + this.shootSpeed = 16f; + this.noMelee = true; + this.value = 100000; + this.knockBack = 8f; + this.rare = 8; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1255) + { + this.autoReuse = false; + this.useStyle = 5; + this.useAnimation = 9; + this.useTime = 9; + this.name = "Venus Magnum"; + this.width = 24; + this.height = 22; + this.shoot = 14; + this.knockBack = 5.5f; + this.useAmmo = 14; + this.useSound = 41; + this.damage = 36; + this.shootSpeed = 13.5f; + this.noMelee = true; + this.value = Item.sellPrice(0, 5, 0, 0); + this.scale = 0.85f; + this.rare = 7; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1256) + { + this.mana = 10; + this.damage = 12; + this.useStyle = 1; + this.name = "Crimson Rod"; + this.shootSpeed = 12f; + this.shoot = 243; + this.width = 26; + this.height = 28; + this.useSound = 8; + this.useAnimation = 24; + this.useTime = 24; + this.rare = 1; + this.noMelee = true; + this.knockBack = 0f; + this.toolTip = "Summons a cloud to rain blood on your foes"; + this.value = 10000; + this.magic = true; + goto IL_2B846; + } + if (this.type == 1257) + { + this.name = "Crimtane Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.rare = 1; + this.value = 20000; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 19; + goto IL_2B846; + } + if (this.type == 1258) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 22; + this.useTime = 22; + this.name = "Stynger"; + this.width = 50; + this.height = 18; + this.shoot = 246; + this.useAmmo = 246; + this.useSound = 11; + this.damage = 43; + this.knockBack = 5f; + this.shootSpeed = 9f; + this.noMelee = true; + this.value = 350000; + this.rare = 7; + this.ranged = true; + this.toolTip = "Shoots a bolt that explodes into deadly shrapnel"; + goto IL_2B846; + } + if (this.type == 1259) + { + this.name = "Flower Pow"; + this.noMelee = true; + this.useStyle = 5; + this.useAnimation = 40; + this.useTime = 40; + this.knockBack = 7.5f; + this.width = 30; + this.height = 10; + this.damage = 52; + this.scale = 1.1f; + this.noUseGraphic = true; + this.shoot = 247; + this.shootSpeed = 15.9f; + this.useSound = 1; + this.rare = 7; + this.value = Item.sellPrice(0, 6, 0, 0); + this.melee = true; + this.channel = true; + goto IL_2B846; + } + if (this.type == 1260) + { + this.useStyle = 5; + this.useAnimation = 40; + this.useTime = 40; + this.name = "Rainbow Gun"; + this.width = 50; + this.height = 18; + this.shoot = 250; + this.useSound = 9; + this.damage = 40; + this.knockBack = 2f; + this.shootSpeed = 16f; + this.noMelee = true; + this.value = 350000; + this.rare = 8; + this.magic = true; + this.mana = 20; + goto IL_2B846; + } + if (this.type == 1261) + { + this.name = "Stynger Bolt"; + this.shootSpeed = 2f; + this.shoot = 246; + this.damage = 15; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 246; + this.knockBack = 1f; + this.value = 75; + this.rare = 5; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1262) + { + this.name = "Chlorophyte Jackhammer"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 46f; + this.knockBack = 5.2f; + this.width = 20; + this.height = 12; + this.damage = 45; + this.hammer = 90; + this.useSound = 23; + this.shoot = 252; + this.rare = 7; + this.value = 216000; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.tileBoost++; + goto IL_2B846; + } + if (this.type == 1263) + { + this.name = "Teleporter"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 235; + this.width = 12; + this.height = 12; + this.value = Item.buyPrice(0, 2, 50, 0); + this.mech = true; + goto IL_2B846; + } + if (this.type == 1264) + { + this.mana = 17; + this.damage = 50; + this.useStyle = 1; + this.name = "Flower of Frost"; + this.shootSpeed = 7f; + this.shoot = 253; + this.width = 26; + this.height = 28; + this.useSound = 20; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 6; + this.noMelee = true; + this.knockBack = 6.5f; + this.toolTip = "Throws balls of frost"; + this.value = 10000; + this.magic = true; + goto IL_2B846; + } + if (this.type == 1265) + { + this.autoReuse = true; + this.useStyle = 5; + this.useAnimation = 9; + this.useTime = 9; + this.name = "Uzi"; + this.width = 24; + this.height = 22; + this.shoot = 14; + this.knockBack = 3.5f; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 30; + this.shootSpeed = 13f; + this.noMelee = true; + this.value = 50000; + this.scale = 0.75f; + this.rare = 7; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1266) + { + this.rare = 8; + this.mana = 14; + this.useSound = 20; + this.name = "Magnet Sphere"; + this.useStyle = 5; + this.damage = 48; + this.knockBack = 6f; + this.useAnimation = 20; + this.useTime = 20; + this.width = 24; + this.height = 28; + this.shoot = 254; + this.shootSpeed = 2f; + this.toolTip = "Summons something to do stuff and things"; + this.magic = true; + this.value = 500000; + goto IL_2B846; + } + if (this.type == 1267) + { + this.name = "Purple Stained Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 88; + this.width = 12; + this.height = 12; + this.value = Item.sellPrice(0, 0, 5, 0); + goto IL_2B846; + } + if (this.type == 1268) + { + this.name = "Yellow Stained Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 89; + this.width = 12; + this.height = 12; + this.value = Item.sellPrice(0, 0, 5, 0); + goto IL_2B846; + } + if (this.type == 1269) + { + this.name = "Blue Stained Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 90; + this.width = 12; + this.height = 12; + this.value = Item.sellPrice(0, 0, 5, 0); + goto IL_2B846; + } + if (this.type == 1270) + { + this.name = "Green Stained Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 91; + this.width = 12; + this.height = 12; + this.value = Item.sellPrice(0, 0, 5, 0); + goto IL_2B846; + } + if (this.type == 1271) + { + this.name = "Red Stained Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 92; + this.width = 12; + this.height = 12; + this.value = Item.sellPrice(0, 0, 5, 0); + goto IL_2B846; + } + if (this.type == 1272) + { + this.name = "Multicolored Stained Glass"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 93; + this.width = 12; + this.height = 12; + this.value = Item.sellPrice(0, 0, 5, 0); + goto IL_2B846; + } + if (this.type == 1273) + { + this.name = "Skeletron Hand"; + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 25; + this.width = 30; + this.height = 10; + this.noUseGraphic = true; + this.shoot = 256; + this.shootSpeed = 15f; + this.useSound = 1; + this.rare = 2; + this.value = 45000; + goto IL_2B846; + } + if (this.type == 1274) + { + this.name = "Skull"; + this.width = 28; + this.height = 20; + this.headSlot = 93; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1275) + { + this.name = "Balla Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 94; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1276) + { + this.name = "Gangsta Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 95; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1277) + { + this.name = "Sailor Hat"; + this.width = 28; + this.height = 20; + this.headSlot = 96; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1278) + { + this.name = "Eye Patch"; + this.width = 28; + this.height = 20; + this.headSlot = 97; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1279) + { + this.name = "Sailor Shirt"; + this.width = 28; + this.height = 20; + this.bodySlot = 57; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1280) + { + this.name = "Sailor Pants"; + this.width = 28; + this.height = 20; + this.legSlot = 52; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1281) + { + this.name = "Skeletron Mask"; + this.width = 28; + this.height = 20; + this.headSlot = 98; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1282) + { + this.name = "Amethyst Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 58; + this.value = Item.sellPrice(0, 0, 50, 0); + this.toolTip = "Increases maximum mana by 20"; + this.toolTip = "Reduces mana usage by 5%"; + goto IL_2B846; + } + if (this.type == 1283) + { + this.name = "Topaz Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 59; + this.defense = 1; + this.value = Item.sellPrice(0, 0, 50, 0) * 2; + this.toolTip = "Increases maximum mana by 40"; + this.toolTip2 = "Reduces mana usage by 7%"; + goto IL_2B846; + } + if (this.type == 1284) + { + this.name = "Sapphire Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 60; + this.defense = 1; + this.value = Item.sellPrice(0, 0, 50, 0) * 3; + this.toolTip = "Increases maximum mana by 40"; + this.toolTip2 = "Reduces mana usage by 9%"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1285) + { + this.name = "Emerald Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 61; + this.defense = 2; + this.value = Item.sellPrice(0, 0, 50, 0) * 4; + this.toolTip = "Increases maximum mana by 60"; + this.toolTip2 = "Reduces mana usage by 11%"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1286) + { + this.name = "Ruby Robe"; + this.width = 18; + this.height = 14; + this.bodySlot = 62; + this.defense = 2; + this.value = Item.sellPrice(0, 0, 50, 0) * 5; + this.toolTip = "Increases maximum mana by 60"; + this.toolTip2 = "Reduces mana usage by 13%"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1287) + { + this.name = "Diamond Robe"; + this.defense = 3; + this.width = 18; + this.height = 14; + this.bodySlot = 63; + this.value = Item.sellPrice(0, 0, 50, 0) * 6; + this.toolTip = "Increases maximum mana by 80"; + this.toolTip2 = "Reduces mana usage by 15%"; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 1288) + { + this.name = "White Tuxedo Shirt"; + this.width = 28; + this.height = 20; + this.bodySlot = 64; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1289) + { + this.name = "White Tuxedo Pants"; + this.width = 28; + this.height = 20; + this.legSlot = 53; + this.rare = 1; + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1290) + { + this.name = "Panic Necklace"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 1; + this.toolTip = "Increases movement speed after being struck"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 1291) + { + this.name = "Heart Fruit"; + this.maxStack = 99; + this.consumable = true; + this.width = 18; + this.height = 18; + this.useStyle = 4; + this.useTime = 30; + this.useSound = 4; + this.useAnimation = 30; + this.toolTip = "Permanently increases maximum life by 5"; + this.rare = 7; + this.value = Item.sellPrice(0, 2, 0, 0); + goto IL_2B846; + } + if (this.type == 1292) + { + this.name = "Lihzahrd Altar"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 237; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1293) + { + this.name = "Lihzahrd Power Cell"; + this.maxStack = 99; + this.consumable = true; + this.width = 22; + this.height = 10; + this.value = Item.sellPrice(0, 1, 0, 0); + goto IL_2B846; + } + if (this.type == 1294) + { + this.name = "Picksaw"; + this.useStyle = 1; + this.useAnimation = 16; + this.useTime = 6; + this.knockBack = 5.5f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 34; + this.pick = 210; + this.axe = 25; + this.useSound = 1; + this.rare = 7; + this.value = 216000; + this.melee = true; + this.scale = 1.15f; + this.tileBoost++; + this.toolTip = "Capable of mining Lihzahrd Bricks"; + goto IL_2B846; + } + if (this.type == 1295) + { + this.mana = 8; + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 16; + this.useTime = 16; + this.name = "Heat Ray"; + this.width = 24; + this.height = 18; + this.shoot = 260; + this.useSound = 12; + this.damage = 55; + this.shootSpeed = 15f; + this.noMelee = true; + this.value = 350000; + this.knockBack = 3f; + this.rare = 7; + this.magic = true; + this.toolTip = "Shoots a piercing beam of heat"; + goto IL_2B846; + } + if (this.type == 1296) + { + this.mana = 17; + this.damage = 45; + this.useStyle = 1; + this.name = "Staff of Earth"; + this.shootSpeed = 11f; + this.shoot = 261; + this.width = 26; + this.height = 28; + this.useSound = 20; + this.useAnimation = 40; + this.useTime = 40; + this.rare = 7; + this.noMelee = true; + this.knockBack = 7.5f; + this.value = Item.sellPrice(0, 10, 0, 0); + this.magic = true; + this.toolTip = "Summons a powerful boulder"; + goto IL_2B846; + } + if (this.type == 1297) + { + this.autoReuse = true; + this.name = "Golem Fist"; + this.useStyle = 5; + this.useAnimation = 30; + this.useTime = 30; + this.knockBack = 8f; + this.width = 30; + this.height = 10; + this.damage = 50; + this.scale = 0.9f; + this.shoot = 262; + this.shootSpeed = 14f; + this.useSound = 10; + this.rare = 7; + this.value = Item.sellPrice(0, 5, 0, 0); + this.melee = true; + this.noMelee = true; + this.toolTip = "Punches with the force of a golem"; + goto IL_2B846; + } + if (this.type == 1298) + { + this.name = "Water Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 17; + this.width = 26; + this.height = 22; + this.value = 500; + goto IL_2B846; + } + if (this.type == 1299) + { + this.name = "Binoculars"; + this.width = 14; + this.height = 28; + this.rare = 4; + this.value = 150000; + this.toolTip = "Increases view range when held"; + goto IL_2B846; + } + if (this.type == 1300) + { + this.name = "Rifle Scope"; + this.width = 14; + this.height = 28; + this.rare = 4; + this.value = 150000; + this.accessory = true; + this.toolTip = "Increases view range for guns"; + this.toolTip2 = "Right click to zoom out"; + goto IL_2B846; + } + if (this.type == 1301) + { + this.name = "Destroyer Emblem"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "10% increased damage"; + this.toolTip2 = "8% increased critical strike chance"; + this.value = 300000; + this.rare = 7; + goto IL_2B846; + } + if (this.type == 1302) + { + this.name = "High Velocity Bullet"; + this.shootSpeed = 4f; + this.shoot = 242; + this.damage = 10; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 4f; + this.value = 40; + this.ranged = true; + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1303) + { + this.name = "Jellyfish Necklace"; + this.width = 24; + this.height = 24; + this.accessory = true; + this.toolTip = "Provides light under water"; + this.value = Item.sellPrice(0, 1, 0, 0); + this.rare = 2; + goto IL_2B846; + } + if (this.type == 1304) + { + this.name = "Zombie Arm"; + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 20; + this.useTime = 20; + this.width = 24; + this.height = 28; + this.damage = 12; + this.knockBack = 4.5f; + this.useSound = 1; + this.scale = 1f; + this.value = 2000; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1305) + { + this.name = "The Axe"; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 23; + this.knockBack = 7.25f; + this.useTime = 7; + this.width = 24; + this.height = 28; + this.damage = 72; + this.axe = 35; + this.hammer = 100; + this.tileBoost = 1; + this.scale = 1.15f; + this.useSound = 47; + this.rare = 8; + this.value = Item.sellPrice(0, 10, 0, 0); + this.melee = true; + goto IL_2B846; + } + if (this.type == 1306) + { + this.name = "Ice Sickle"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 25; + this.knockBack = 5.5f; + this.width = 24; + this.height = 28; + this.damage = 40; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 5; + this.shoot = 263; + this.shootSpeed = 8f; + this.value = 250000; + this.toolTip = "Shoots an icy sickle"; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1307) + { + this.accessory = true; + this.name = "Clothier Voodoo Doll"; + this.width = 14; + this.height = 26; + this.value = 1000; + this.toolTip = "'You are a terrible person.'"; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1308) + { + this.name = "Poison Staff"; + this.mana = 12; + this.useSound = 43; + this.useStyle = 5; + this.damage = 59; + this.useAnimation = 35; + this.useTime = 35; + this.width = 40; + this.height = 40; + this.shoot = 265; + this.shootSpeed = 13.5f; + this.knockBack = 6f; + this.magic = true; + this.autoReuse = true; + this.rare = 6; + this.noMelee = true; + this.value = Item.sellPrice(0, 4, 0, 0); + goto IL_2B846; + } + if (this.type == 1309) + { + this.mana = 10; + this.damage = 8; + this.useStyle = 1; + this.name = "Slime Staff"; + this.shootSpeed = 10f; + this.shoot = 266; + this.width = 26; + this.height = 28; + this.useSound = 44; + this.useAnimation = 28; + this.useTime = 28; + this.rare = 4; + this.noMelee = true; + this.knockBack = 2f; + this.toolTip = "Summons a baby slime to fight for you"; + this.buffType = 64; + this.value = 100000; + this.summon = true; + goto IL_2B846; + } + if (this.type == 1310) + { + this.name = "Poison Dart"; + this.shoot = 267; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.ammo = 51; + this.toolTip = "Inflicts poison on enemies"; + this.toolTip2 = "For use with Blowpipe and Blowgun"; + this.damage = 8; + this.knockBack = 2f; + this.shootSpeed = 2f; + this.ranged = true; + this.rare = 2; + goto IL_2B846; + } + if (this.type == 1311) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Eyespring"; + this.shoot = 268; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 6; + this.noMelee = true; + this.toolTip = "Summons an eye spring"; + this.value = Item.sellPrice(0, 3, 0, 0); + this.buffType = 65; + goto IL_2B846; + } + if (this.type == 1312) + { + this.damage = 0; + this.useStyle = 1; + this.name = "Toy Sled"; + this.shoot = 269; + this.width = 16; + this.height = 30; + this.useSound = 2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 6; + this.noMelee = true; + this.toolTip = "Summons a baby snowman"; + this.value = Item.sellPrice(0, 2, 50, 0); + this.buffType = 66; + goto IL_2B846; + } + if (this.type == 1313) + { + this.autoReuse = true; + this.rare = 2; + this.mana = 12; + this.useSound = 8; + this.name = "Book of Skulls"; + this.useStyle = 5; + this.damage = 35; + this.useAnimation = 25; + this.useTime = 25; + this.width = 24; + this.height = 28; + this.shoot = 270; + this.scale = 0.9f; + this.shootSpeed = 4f; + this.knockBack = 6f; + this.toolTip = "Shoots a skull"; + this.magic = true; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 1314) + { + this.autoReuse = true; + this.name = "KO Cannon"; + this.useStyle = 5; + this.useAnimation = 28; + this.useTime = 28; + this.knockBack = 6.5f; + this.width = 30; + this.height = 10; + this.damage = 35; + this.scale = 0.9f; + this.shoot = 271; + this.shootSpeed = 15f; + this.useSound = 10; + this.rare = 4; + this.value = 27000; + this.melee = true; + this.noMelee = true; + this.toolTip = "Shoots a boxing glove"; + goto IL_2B846; + } + if (this.type == 1315) + { + this.useStyle = 4; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Pirate Map"; + this.width = 28; + this.height = 28; + this.toolTip = "Summons a Pirate Invasion"; + goto IL_2B846; + } + if (this.type == 1316) + { + this.name = "Turtle Helmet"; + this.width = 18; + this.height = 18; + this.defense = 21; + this.headSlot = 99; + this.rare = 8; + this.value = 300000; + this.toolTip = "5% increased melee damage"; + this.toolTip2 = "Enemies are more likely to target you"; + goto IL_2B846; + } + if (this.type == 1317) + { + this.name = "Turtle Scale Mail"; + this.width = 18; + this.height = 18; + this.defense = 27; + this.bodySlot = 65; + this.rare = 8; + this.value = 240000; + this.toolTip = "7% increased melee damage and critical strike chance"; + this.toolTip2 = "Enemies are more likely to target you"; + goto IL_2B846; + } + if (this.type == 1318) + { + this.name = "Turtle Leggings"; + this.width = 18; + this.height = 18; + this.defense = 17; + this.legSlot = 54; + this.rare = 8; + this.value = 180000; + this.toolTip = "3% increased melee critical strike chance"; + this.toolTip2 = "Enemies are more likely to target you"; + goto IL_2B846; + } + if (this.type == 1319) + { + this.name = "Snowball Cannon"; + this.autoReuse = true; + this.useStyle = 5; + this.useAnimation = 18; + this.useTime = 18; + this.width = 44; + this.height = 14; + this.shoot = 166; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 4; + this.shootSpeed = 11f; + this.noMelee = true; + this.value = 100000; + this.knockBack = 4.5f; + this.rare = 1; + this.ranged = true; + this.useAmmo = 949; + this.shoot = 166; + goto IL_2B846; + } + if (this.type == 1320) + { + this.name = "Bone Pickaxe"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 19; + this.useTime = 11; + this.autoReuse = true; + this.width = 24; + this.height = 28; + this.damage = 8; + this.pick = 50; + this.useSound = 1; + this.knockBack = 3f; + this.rare = 1; + this.value = 18000; + this.scale = 1.15f; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1321) + { + this.name = "Magic Quiver"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Increase arrow speed and damage by 10%"; + this.toolTip2 = "20% chance to not consume arrow"; + this.value = Item.sellPrice(0, 5, 0, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1322) + { + this.name = "Magma Stone"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Chance to inflict fire damage on attack"; + this.value = Item.sellPrice(0, 2, 0, 0); + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1323) + { + this.name = "Lava Rose"; + this.width = 24; + this.height = 28; + this.accessory = true; + this.toolTip = "Reduced damage from touching lava"; + this.value = Item.sellPrice(0, 2, 0, 0); + this.rare = 3; + goto IL_2B846; + } + if (this.type == 1324) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Bananarang"; + this.shootSpeed = 14f; + this.shoot = 272; + this.damage = 40; + this.knockBack = 8.5f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 8; + this.useTime = 8; + this.noUseGraphic = true; + this.rare = 5; + this.value = 75000; + this.melee = true; + this.maxStack = 10; + goto IL_2B846; + } + if (this.type == 1325) + { + this.autoReuse = false; + this.name = "Chain Knife"; + this.useStyle = 5; + this.useAnimation = 20; + this.useTime = 20; + this.knockBack = 3.5f; + this.width = 30; + this.height = 10; + this.damage = 11; + this.shoot = 273; + this.shootSpeed = 12f; + this.useSound = 1; + this.rare = 2; + this.value = 1000; + this.melee = true; + this.noUseGraphic = true; + goto IL_2B846; + } + if (this.type == 1326) + { + this.autoReuse = false; + this.name = "Rod of Discord"; + this.useStyle = 1; + this.useAnimation = 20; + this.useTime = 20; + this.width = 20; + this.height = 20; + this.useSound = 8; + this.rare = 7; + this.value = Item.sellPrice(0, 10, 0, 0); + this.toolTip = "Teleports to a new location"; + goto IL_2B846; + } + if (this.type == 1327) + { + this.autoReuse = true; + this.name = "Death Sickle"; + this.useStyle = 1; + this.useAnimation = 25; + this.useTime = 25; + this.knockBack = 7f; + this.width = 24; + this.height = 28; + this.damage = 57; + this.scale = 1.15f; + this.useSound = 1; + this.rare = 6; + this.shoot = 274; + this.shootSpeed = 9f; + this.value = 250000; + this.toolTip = "Shoots a deathly sickle"; + this.melee = true; + goto IL_2B846; + } + if (this.type == 1328) + { + this.name = "Turtle Scale"; + this.width = 14; + this.height = 18; + this.maxStack = 99; + this.rare = 7; + this.value = 5000; + goto IL_2B846; + } + if (this.type == 1329) + { + this.name = "Tissue Sample"; + this.width = 14; + this.height = 18; + this.maxStack = 99; + this.rare = 1; + this.value = 750; + goto IL_2B846; + } + if (this.type == 1330) + { + this.name = "Vertebrae"; + this.width = 18; + this.height = 20; + this.maxStack = 99; + this.value = 12; + goto IL_2B846; + } + if (this.type == 1331) + { + this.useStyle = 4; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.name = "Bloody Spine"; + this.width = 28; + this.height = 28; + this.maxStack = 20; + this.toolTip = "Summons the Brain of Cthulhu"; + goto IL_2B846; + } + if (this.type == 1332) + { + this.name = "Ichor"; + this.width = 12; + this.height = 14; + this.maxStack = 99; + this.value = 4500; + this.rare = 3; + this.toolTip = "'The blood of gods'"; + goto IL_2B846; + } + if (this.type == 1333) + { + this.flame = true; + this.name = "Ichor Torch"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.holdStyle = 1; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 4; + this.placeStyle = 11; + this.width = 10; + this.height = 12; + this.value = 330; + this.rare = 1; + this.toolTip = "Can be placed in water"; + goto IL_2B846; + } + if (this.type == 1334) + { + this.name = "Ichor Arrow"; + this.shootSpeed = 4.25f; + this.shoot = 278; + this.damage = 15; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 3f; + this.value = 80; + this.ranged = true; + this.rare = 3; + this.toolTip = "Decreases target's defense"; + goto IL_2B846; + } + if (this.type == 1335) + { + this.name = "Ichor Bullet"; + this.shootSpeed = 5.25f; + this.shoot = 279; + this.damage = 13; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 4f; + this.value = 30; + this.ranged = true; + this.rare = 3; + this.toolTip = "Decreases target's defense"; + goto IL_2B846; + } + if (this.type == 1336) + { + this.mana = 6; + this.autoReuse = true; + this.name = "Golden Shower"; + this.useStyle = 5; + this.useAnimation = 18; + this.useTime = 6; + this.knockBack = 4f; + this.width = 38; + this.height = 10; + this.damage = 28; + this.shoot = 280; + this.shootSpeed = 10f; + this.useSound = 13; + this.rare = 4; + this.value = 500000; + this.toolTip = "Sprays out a shower of ichor"; + this.magic = true; + goto IL_2B846; + } + if (this.type == 1337) + { + this.name = "Bunny Cannon"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 209; + this.placeStyle = 1; + this.width = 12; + this.height = 12; + this.value = Item.buyPrice(0, 50, 0, 0); + goto IL_2B846; + } + if (this.type == 1338) + { + this.name = "Explosive Bunny"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 20; + this.useTime = 20; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.width = 12; + this.height = 12; + this.damage = 350; + this.noMelee = true; + this.value = Item.buyPrice(0, 0, 35, 0); + goto IL_2B846; + } + if (this.type == 1339) + { + this.name = "Vial of Venom"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = Item.buyPrice(0, 0, 10, 0); + goto IL_2B846; + } + if (this.type == 1340) + { + this.name = "Flask of Venom"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 71; + this.buffTime = 54000; + this.toolTip = "Melee attacks inflict venom on enemies"; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1341) + { + this.name = "Venom Arrow"; + this.shootSpeed = 4.3f; + this.shoot = 282; + this.damage = 17; + this.width = 10; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.ammo = 1; + this.knockBack = 4.2f; + this.value = 90; + this.ranged = true; + this.rare = 3; + this.toolTip = "Inflicts target with venom"; + goto IL_2B846; + } + if (this.type == 1342) + { + this.name = "Venom Bullet"; + this.shootSpeed = 5.3f; + this.shoot = 283; + this.damage = 14; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 4.1f; + this.value = 40; + this.ranged = true; + this.rare = 3; + this.toolTip = "Inflicts target with venom"; + goto IL_2B846; + } + if (this.type == 1343) + { + this.name = "Fire Gauntlet"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 7; + this.toolTip = "Increases melee knockback and inflicts fire damage on attack"; + this.toolTip = "9% increased melee damage and speed"; + this.value = 300000; + goto IL_2B846; + } + if (this.type == 1344) + { + this.name = "Cog"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = Item.buyPrice(0, 0, 7, 0); + goto IL_2B846; + } + if (this.type == 1345) + { + this.name = "Confetti"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = Item.buyPrice(0, 0, 1, 0); + goto IL_2B846; + } + if (this.type == 1346) + { + this.name = "Nanites"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = Item.buyPrice(0, 0, 10, 0); + goto IL_2B846; + } + if (this.type == 1347) + { + this.name = "Explosive Powder"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = Item.buyPrice(0, 0, 12, 0); + goto IL_2B846; + } + if (this.type == 1348) + { + this.name = "Gold Dust"; + this.width = 12; + this.height = 20; + this.maxStack = 99; + this.value = Item.buyPrice(0, 0, 17, 0); + goto IL_2B846; + } + if (this.type == 1349) + { + this.name = "Party Bullet"; + this.shootSpeed = 5.1f; + this.shoot = 284; + this.damage = 10; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 5f; + this.value = 40; + this.ranged = true; + this.rare = 3; + this.toolTip = "Explodes into confetti on impact"; + goto IL_2B846; + } + if (this.type == 1350) + { + this.name = "Nano Bullet"; + this.shootSpeed = 4.6f; + this.shoot = 285; + this.damage = 10; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 3.6f; + this.value = 40; + this.ranged = true; + this.rare = 3; + this.toolTip = "Causes confusion"; + goto IL_2B846; + } + if (this.type == 1351) + { + this.name = "Exploding Bullet"; + this.shootSpeed = 4.7f; + this.shoot = 286; + this.damage = 10; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 6.6f; + this.value = 40; + this.ranged = true; + this.rare = 3; + this.toolTip = "Explodes on impact"; + goto IL_2B846; + } + if (this.type == 1352) + { + this.name = "Golden Bullet"; + this.shootSpeed = 4.6f; + this.shoot = 287; + this.damage = 10; + this.width = 8; + this.height = 8; + this.maxStack = 999; + this.consumable = true; + this.ammo = 14; + this.knockBack = 3.6f; + this.value = 40; + this.ranged = true; + this.rare = 3; + this.toolTip = "Enemies killed will drop more money"; + goto IL_2B846; + } + if (this.type == 1353) + { + this.name = "Flask of Cursed Flames"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 73; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1354) + { + this.name = "Flask of Fire"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 74; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1355) + { + this.name = "Flask of Gold"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 75; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1356) + { + this.name = "Flask of Ichor"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 76; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1357) + { + this.name = "Flask of Nanites"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 77; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1358) + { + this.name = "Flask of Party"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 78; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1359) + { + this.name = "Flask of Poison"; + this.useSound = 3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.buffType = 79; + this.buffTime = 54000; + this.value = Item.sellPrice(0, 0, 5, 0); + this.rare = 4; + goto IL_2B846; + } + if (this.type == 1360) + { + this.name = "Eye of Cthulhu Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 0; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1361) + { + this.name = "Eater of Worlds Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 1; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1362) + { + this.name = "Brain of Cthulhu Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 2; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1363) + { + this.name = "Skeletron Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 3; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1364) + { + this.name = "Queen Bee Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 4; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1365) + { + this.name = "Wall of Flesh Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 5; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1366) + { + this.name = "Destroyer Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 6; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1367) + { + this.name = "Skeletron Prime Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 7; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1368) + { + this.name = "Retinazer Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 8; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1369) + { + this.name = "Spazmatism Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 9; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1370) + { + this.name = "Plantera Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 10; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1371) + { + this.name = "Golem Trophy"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 1, 0, 0); + this.placeStyle = 11; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1372) + { + this.name = "Blood Moon Rising"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 12; + goto IL_2B846; + } + if (this.type == 1373) + { + this.name = "The Hanged Man"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 13; + goto IL_2B846; + } + if (this.type == 1374) + { + this.name = "Glory of the Fire"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 14; + goto IL_2B846; + } + if (this.type == 1375) + { + this.name = "Bone Warp"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 15; + goto IL_2B846; + } + if (this.type == 1376) + { + this.name = "Wall Skeleton"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.placeStyle = 16; + goto IL_2B846; + } + if (this.type == 1377) + { + this.name = "Hanging Skeleton"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.placeStyle = 17; + goto IL_2B846; + } + if (this.type == 1378) + { + this.name = "Blue Slab Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 100; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1379) + { + this.name = "Blue Tiled Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 101; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1380) + { + this.name = "Pink Slab Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 102; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1381) + { + this.name = "Pink Tiled Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 103; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1382) + { + this.name = "Green Slab Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 104; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1383) + { + this.name = "Green Tiled Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 105; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1384) + { + this.name = "Blue Brick Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 6; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1385) + { + this.name = "Pink Brick Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 7; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1386) + { + this.name = "Green Brick Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 8; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1387) + { + this.name = "Dungeon Shelf 1"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 9; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1388) + { + this.name = "Dungeon Shelf 2"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 10; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1389) + { + this.name = "Dungeon Shelf 3"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 11; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1390) + { + this.name = "Lantern 1"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 1; + goto IL_2B846; + } + if (this.type == 1391) + { + this.name = "Lantern 2"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 2; + goto IL_2B846; + } + if (this.type == 1392) + { + this.name = "Lantern 3"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 3; + goto IL_2B846; + } + if (this.type == 1393) + { + this.name = "Lantern 4"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 4; + goto IL_2B846; + } + if (this.type == 1394) + { + this.name = "Lantern 5"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 5; + goto IL_2B846; + } + if (this.type == 1395) + { + this.name = "Lantern 6"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 6; + goto IL_2B846; + } + if (this.type == 1396) + { + this.name = "Blue Dungeon Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 13; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1397) + { + this.name = "Blue Dungeon Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 10; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1398) + { + this.name = "Blue Dungeon Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 11; + this.width = 28; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 1399) + { + this.name = "Green Dungeon Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 14; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1400) + { + this.name = "Green Dungeon Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 11; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1401) + { + this.name = "Green Dungeon Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 12; + this.width = 28; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 1402) + { + this.name = "Pink Dungeon Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 15; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1403) + { + this.name = "Pink Dungeon Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 12; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1404) + { + this.name = "Pink Dungeon Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 13; + this.width = 28; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 1405) + { + this.noWet = true; + this.name = "Blue Dungeon Candle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.width = 8; + this.height = 18; + this.placeStyle = 1; + goto IL_2B846; + } + if (this.type == 1406) + { + this.noWet = true; + this.name = "Green Dungeon Candle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.width = 8; + this.height = 18; + this.placeStyle = 2; + goto IL_2B846; + } + if (this.type == 1407) + { + this.noWet = true; + this.name = "Pink Dungeon Candle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.width = 8; + this.height = 18; + this.placeStyle = 3; + goto IL_2B846; + } + if (this.type == 1408) + { + this.name = "Blue Dungeon Vase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 46; + goto IL_2B846; + } + if (this.type == 1409) + { + this.name = "Green Dungeon Vase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 47; + goto IL_2B846; + } + if (this.type == 1410) + { + this.name = "Pink Dungeon Vase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 48; + goto IL_2B846; + } + if (this.type == 1411) + { + this.name = "Blue Dungeon Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 16; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1412) + { + this.name = "Green Dungeon Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 17; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1413) + { + this.name = "Pink Dungeon Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 18; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1414) + { + this.name = "Blue Dungeon Bookcase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 1; + goto IL_2B846; + } + if (this.type == 1415) + { + this.name = "Green Dungeon Bookcase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 2; + goto IL_2B846; + } + if (this.type == 1416) + { + this.name = "Pink Dungeon Bookcase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 3; + goto IL_2B846; + } + if (this.type == 1417) + { + this.name = "Catacomb"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 241; + this.placeStyle = 0; + this.width = 30; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1418) + { + this.name = "Dungeon Shelf 4"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 12; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1419) + { + this.name = "Skellington J Skellingsworth"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 18; + goto IL_2B846; + } + if (this.type == 1420) + { + this.name = "The Cursed Man"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 19; + goto IL_2B846; + } + if (this.type == 1421) + { + this.name = "The Eye Sees the End"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 0; + goto IL_2B846; + } + if (this.type == 1422) + { + this.name = "Something Evil is Watching You"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 1; + goto IL_2B846; + } + if (this.type == 1423) + { + this.name = "The Twins Have Awoken"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 2; + goto IL_2B846; + } + if (this.type == 1424) + { + this.name = "The Screamer"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 3; + goto IL_2B846; + } + if (this.type == 1425) + { + this.name = "Goblins Playing Poker"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 4; + goto IL_2B846; + } + if (this.type == 1426) + { + this.name = "Dryadisque"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 5; + goto IL_2B846; + } + if (this.type == 1427) + { + this.name = "Sunflowers"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 20; + goto IL_2B846; + } + if (this.type == 1428) + { + this.name = "Terrarian Gothic"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 21; + goto IL_2B846; + } + if (this.type == 1429) + { + this.name = "Beanie"; + this.width = 18; + this.height = 18; + this.headSlot = 100; + this.vanity = true; + this.value = Item.buyPrice(0, 1, 0, 0); + goto IL_2B846; + } + if (this.type == 1430) + { + this.name = "Imbuing Station"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 243; + this.width = 26; + this.height = 20; + this.value = Item.buyPrice(0, 7, 0, 0); + this.rare = 2; + goto IL_2B846; + } + if (this.type == 1431) + { + this.name = "Star in a Bottle"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 7; + goto IL_2B846; + } + if (this.type == 1432) + { + this.name = "Empty Bullet"; + this.width = 12; + this.height = 20; + this.maxStack = 999; + this.value = Item.buyPrice(0, 0, 0, 3); + goto IL_2B846; + } + if (this.type == 1433) + { + this.name = "Impact"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 6; + goto IL_2B846; + } + if (this.type == 1434) + { + this.name = "Powered by Birds"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 7; + goto IL_2B846; + } + if (this.type == 1435) + { + this.name = "The Destroyer"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 8; + goto IL_2B846; + } + if (this.type == 1436) + { + this.name = "The Persistency of Eyes"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 9; + goto IL_2B846; + } + if (this.type == 1437) + { + this.name = "Unicorn Crossing the Hallows"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 10; + goto IL_2B846; + } + if (this.type == 1438) + { + this.name = "Great Wave"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 11; + goto IL_2B846; + } + if (this.type == 1439) + { + this.name = "Starry Night"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 12; + goto IL_2B846; + } + if (this.type == 1440) + { + this.name = "Guide Picasso"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 22; + goto IL_2B846; + } + if (this.type == 1441) + { + this.name = "The Guardian's Gaze"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 23; + goto IL_2B846; + } + if (this.type == 1442) + { + this.name = "Father of Someone"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 24; + goto IL_2B846; + } + if (this.type == 1443) + { + this.name = "Nurse Lisa"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 25; + goto IL_2B846; + } + if (this.type == 1444) + { + this.name = "Shadowbeam Staff"; + this.mana = 7; + this.useSound = 8; + this.useStyle = 5; + this.damage = 53; + this.useAnimation = 16; + this.useTime = 16; + this.autoReuse = true; + this.width = 40; + this.height = 40; + this.shoot = 294; + this.shootSpeed = 6f; + this.knockBack = 3.25f; + this.value = Item.sellPrice(0, 6, 0, 0); + this.magic = true; + this.rare = 8; + this.noMelee = true; + goto IL_2B846; + } + if (this.type == 1445) + { + this.name = "Inferno Fork"; + this.mana = 14; + this.useSound = 45; + this.useStyle = 5; + this.damage = 65; + this.useAnimation = 30; + this.useTime = 30; + this.width = 40; + this.height = 40; + this.shoot = 295; + this.shootSpeed = 8f; + this.knockBack = 8f; + this.value = Item.sellPrice(0, 6, 0, 0); + this.magic = true; + this.noMelee = true; + this.rare = 8; + goto IL_2B846; + } + if (this.type == 1446) + { + this.name = "Spectre Staff"; + this.mana = 14; + this.useSound = 43; + this.useStyle = 5; + this.damage = 68; + this.autoReuse = true; + this.useAnimation = 24; + this.useTime = 24; + this.width = 40; + this.height = 40; + this.shoot = 297; + this.shootSpeed = 6f; + this.knockBack = 6f; + this.value = Item.sellPrice(0, 6, 0, 0); + this.magic = true; + this.noMelee = true; + this.rare = 8; + goto IL_2B846; + } + if (this.type == 1447) + { + this.name = "Wooden Fence"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 106; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1448) + { + this.name = "Metal Fence"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 107; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1449) + { + this.name = "Bubble Machine"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 244; + this.width = 26; + this.height = 20; + this.value = Item.buyPrice(0, 4, 0, 0); + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1450) + { + this.name = "Bubble Wand"; + this.useStyle = 1; + this.autoReuse = true; + this.useTurn = false; + this.useAnimation = 25; + this.useTime = 25; + this.width = 24; + this.height = 28; + this.scale = 1f; + this.value = Item.buyPrice(0, 5, 0, 0); + this.noMelee = true; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1451) + { + this.name = "Marching Bones Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 10; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1452) + { + this.name = "Necromantic Sign"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 11; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1453) + { + this.name = "Rusted Company Standard"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 12; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1454) + { + this.name = "Ragged Brotherhood Sigil"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 13; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1455) + { + this.name = "Molten Legion Flag"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 14; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1456) + { + this.name = "Diabolic Sigil"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 15; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1457) + { + this.name = "Obsidian Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 13; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type == 1458) + { + this.name = "Obsidian Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 19; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type == 1459) + { + this.name = "Obsidian Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 16; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1460) + { + this.name = "Obsidian Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 13; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1461) + { + this.name = "Obsidian Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 14; + this.width = 28; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 1462) + { + this.name = "Obsidian Vase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 49; + goto IL_2B846; + } + if (this.type == 1463) + { + this.name = "Obsidian Bookcase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 4; + goto IL_2B846; + } + if (this.type == 1464) + { + this.name = "Hellbound Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 16; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1465) + { + this.name = "Hell Hammer Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 17; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1466) + { + this.name = "Helltower Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 18; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1467) + { + this.name = "Lost Hopes of Man Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 19; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1468) + { + this.name = "Obsidian Watcher Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 20; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1469) + { + this.name = "Lava Erupts Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 21; + this.width = 10; + this.height = 24; + this.value = 1000; + goto IL_2B846; + } + if (this.type == 1470) + { + this.name = "Blue Dungeon Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 5; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 1471) + { + this.name = "Green Dungeon Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 6; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 1472) + { + this.name = "Red Dungeon Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 7; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 1473) + { + this.name = "Obsidian Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 8; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type >= 1474 && this.type <= 1478) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 245; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = this.type - 1474; + goto IL_2B846; + } + if (this.type >= 1479 && this.type <= 1494) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 246; + this.width = 30; + this.height = 30; + if (this.type >= 1481 && this.type <= 1494) + { + this.value = Item.buyPrice(0, 1, 0, 0); + goto IL_29567; + } + this.value = Item.sellPrice(0, 0, 10, 0); + IL_29567: + this.placeStyle = this.type - 1479; + goto IL_2B846; + } + if (this.type == 1495) + { + this.name = "American Explosive"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 245; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 5; + goto IL_2B846; + } + if (this.type >= 1496 && this.type <= 1499) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 26 + this.type - 1496; + goto IL_2B846; + } + if (this.type >= 1500 && this.type <= 1502) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 13 + this.type - 1500; + goto IL_2B846; + } + if (this.type == 1503) + { + this.name = "Spectre Hood"; + this.width = 18; + this.height = 18; + this.defense = 4; + this.headSlot = 101; + this.rare = 8; + this.value = 375000; + this.toolTip = "Increases maximum mana by 80 and reduces mana usage by 17%"; + this.toolTip2 = "10% increased magic damage and critical strike chance"; + goto IL_2B846; + } + if (this.type == 1504) + { + this.name = "Spectre Robe"; + this.width = 18; + this.height = 18; + this.defense = 12; + this.bodySlot = 66; + this.rare = 8; + this.value = 300000; + this.toolTip = "7% increased magic damage and critical strike chance"; + goto IL_2B846; + } + if (this.type == 1505) + { + this.name = "Spectre Pants"; + this.width = 18; + this.height = 18; + this.defense = 8; + this.legSlot = 55; + this.rare = 8; + this.value = 225000; + this.toolTip = "8% increased magic damage"; + this.toolTip2 = "8% increased movement speed"; + goto IL_2B846; + } + if (this.type == 1506) + { + this.name = "Spirit Pickaxe"; + this.useStyle = 1; + this.useAnimation = 24; + this.useTime = 10; + this.knockBack = 5.25f; + this.useTurn = true; + this.autoReuse = true; + this.width = 20; + this.height = 12; + this.damage = 32; + this.pick = 200; + this.useSound = 1; + this.rare = 8; + this.value = 216000; + this.melee = true; + this.scale = 1.15f; + this.tileBoost += 3; + goto IL_2B846; + } + if (this.type == 1507) + { + this.name = "Spirit Hamaxe"; + this.useTurn = true; + this.autoReuse = true; + this.useStyle = 1; + this.useAnimation = 28; + this.useTime = 8; + this.knockBack = 7f; + this.width = 20; + this.height = 12; + this.damage = 60; + this.axe = 23; + this.hammer = 90; + this.useSound = 1; + this.rare = 8; + this.value = 216000; + this.melee = true; + this.scale = 1.05f; + this.tileBoost += 3; + goto IL_2B846; + } + if (this.type == 1508) + { + this.name = "Ectoplasm"; + this.maxStack = 99; + this.width = 16; + this.height = 14; + this.value = Item.sellPrice(0, 0, 50, 0); + this.rare = 8; + goto IL_2B846; + } + if (this.type == 1509) + { + this.name = "Gothic Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 17; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type == 1510) + { + this.name = "Gothic Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 14; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type == 1511) + { + this.name = "Gothic Work Bench"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 15; + this.width = 28; + this.height = 14; + this.value = 150; + goto IL_2B846; + } + if (this.type == 1512) + { + this.name = "Gothic Bookcase"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 5; + goto IL_2B846; + } + if (this.type == 1513) + { + this.noMelee = true; + this.useStyle = 1; + this.name = "Paladin's Hammer"; + this.shootSpeed = 14f; + this.shoot = 301; + this.damage = 90; + this.knockBack = 9f; + this.width = 14; + this.height = 28; + this.useSound = 1; + this.useAnimation = 15; + this.useTime = 15; + this.noUseGraphic = true; + this.rare = 8; + this.value = Item.sellPrice(0, 10, 0, 0); + this.melee = true; + goto IL_2B846; + } + if (this.type == 1514) + { + this.name = "SWAT Helmet"; + this.width = 18; + this.height = 18; + this.headSlot = 102; + this.rare = 1; + this.value = Item.sellPrice(0, 1, 0, 0); + this.vanity = true; + goto IL_2B846; + } + if (this.type == 1515) + { + this.name = "Bee Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.toolTip = "Allows flight and slow fall"; + this.value = 400000; + this.rare = 5; + goto IL_2B846; + } + if (this.type >= 1516 && this.type <= 1521) + { + this.name = "Feather"; + this.maxStack = 99; + this.width = 16; + this.height = 14; + this.value = Item.sellPrice(0, 2, 50, 0); + this.rare = 5; + goto IL_2B846; + } + if (this.type >= 1522 && this.type <= 1527) + { + this.name = "Large Gem"; + this.width = 20; + this.height = 20; + this.rare = 1; + goto IL_2B846; + } + if (this.type >= 1528 && this.type <= 1532) + { + this.name = "Dungeon Chest"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 18 + this.type - 1528; + this.width = 26; + this.height = 22; + this.value = 2500; + goto IL_2B846; + } + if (this.type >= 1533 && this.type <= 1537) + { + this.name = "Dungeon Key"; + this.width = 14; + this.height = 20; + this.maxStack = 99; + this.rare = 8; + goto IL_2B846; + } + if (this.type >= 1538 && this.type <= 1540) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 30 + this.type - 1538; + goto IL_2B846; + } + if (this.type >= 1541 && this.type <= 1542) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 246; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 16 + this.type - 1541; + goto IL_2B846; + } + if (this.type >= 1543 && this.type <= 1545) + { + this.name = "Spectre Paintbrush"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.width = 24; + this.height = 24; + this.value = 10000; + this.tileBoost += 3; + goto IL_2B846; + } + if (this.type == 1546) + { + this.name = "Shroomite Headgear"; + this.width = 18; + this.height = 18; + this.defense = 11; + this.headSlot = 103; + this.rare = 8; + this.value = 375000; + this.toolTip = "15% increased arrow damage"; + this.toolTip2 = "5% ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 1547) + { + this.name = "Shroomite Mask"; + this.width = 18; + this.height = 18; + this.defense = 11; + this.headSlot = 104; + this.rare = 8; + this.value = 375000; + this.toolTip = "15% increased bullet damage"; + this.toolTip2 = "5% ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 1548) + { + this.name = "Shroomite Helmet"; + this.width = 18; + this.height = 18; + this.defense = 11; + this.headSlot = 105; + this.rare = 8; + this.value = 375000; + this.toolTip = "15% increased rocket damage"; + this.toolTip2 = "5% ranged critical strike chance"; + goto IL_2B846; + } + if (this.type == 1549) + { + this.name = "Shroomite Breastplate"; + this.width = 18; + this.height = 18; + this.defense = 24; + this.bodySlot = 67; + this.rare = 8; + this.value = 300000; + this.toolTip = "13% increased ranged critical strike chance"; + this.toolTip2 = "20% chance to not consume ammo"; + goto IL_2B846; + } + if (this.type == 1550) + { + this.name = "Shroomite Leggings"; + this.width = 18; + this.height = 18; + this.defense = 16; + this.legSlot = 56; + this.rare = 8; + this.value = 225000; + this.toolTip = "7% increased ranged critical strike chance"; + this.toolTip2 = "12% increased movement speed"; + goto IL_2B846; + } + if (this.type == 1551) + { + this.name = "Autohammer"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 247; + this.width = 26; + this.height = 24; + this.value = Item.buyPrice(1, 0, 0, 0); + this.toolTip = "Converts Chlorophyte Bars into Shroomite Bars"; + goto IL_2B846; + } + if (this.type == 1552) + { + this.name = "Shroomite Bar"; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.rare = 7; + this.value = Item.sellPrice(0, 1, 0, 0); + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 239; + this.placeStyle = 20; + goto IL_2B846; + } + if (this.type == 1553) + { + this.useStyle = 5; + this.autoReuse = true; + this.useAnimation = 7; + this.useTime = 6; + this.name = "S.D.M.G."; + this.crit += 5; + this.width = 60; + this.height = 26; + this.shoot = 10; + this.useAmmo = 14; + this.useSound = 11; + this.damage = 35; + this.shootSpeed = 12f; + this.noMelee = true; + this.value = 750000; + this.rare = 8; + this.toolTip = "50% chance to not consume ammo"; + this.toolTip2 = "'Space Dolphin Machine Gun'"; + this.knockBack = 2.5f; + this.ranged = true; + goto IL_2B846; + } + if (this.type == 1554) + { + this.name = "Cenx's Tiara"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.headSlot = 106; + goto IL_2B846; + } + if (this.type == 1555) + { + this.name = "Cenx's Breastplate"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 68; + goto IL_2B846; + } + if (this.type == 1556) + { + this.name = "Cenx's Leggings"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 57; + goto IL_2B846; + } + if (this.type == 1557) + { + this.name = "Crowno's Mask"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.headSlot = 107; + goto IL_2B846; + } + if (this.type == 1558) + { + this.name = "Crowno's Breastplate"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 69; + goto IL_2B846; + } + if (this.type == 1559) + { + this.name = "Crowno's Leggings"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 58; + goto IL_2B846; + } + if (this.type == 1560) + { + this.name = "Will's Helmet"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.headSlot = 108; + goto IL_2B846; + } + if (this.type == 1561) + { + this.name = "Will's Breastplate"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 70; + goto IL_2B846; + } + if (this.type == 1562) + { + this.name = "Will's Leggings"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 59; + goto IL_2B846; + } + if (this.type == 1563) + { + this.name = "Jim's Helmet"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.headSlot = 109; + goto IL_2B846; + } + if (this.type == 1564) + { + this.name = "Jim's Breastplate"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 71; + goto IL_2B846; + } + if (this.type == 1565) + { + this.name = "Jim's Leggings"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 60; + goto IL_2B846; + } + if (this.type == 1566) + { + this.name = "Aaron's Helmet"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.headSlot = 110; + goto IL_2B846; + } + if (this.type == 1567) + { + this.name = "Aaron's Breastplate"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 72; + goto IL_2B846; + } + if (this.type == 1568) + { + this.name = "Aaron's Leggings"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 61; + goto IL_2B846; + } + if (this.type == 1569) + { + this.autoReuse = true; + this.useStyle = 1; + this.name = "Vampire Knives"; + this.shootSpeed = 15f; + this.shoot = 304; + this.damage = 29; + this.width = 18; + this.height = 20; + this.useSound = 39; + this.useAnimation = 16; + this.useTime = 16; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.sellPrice(0, 20, 0, 0); + this.knockBack = 2.75f; + this.melee = true; + this.rare = 8; + this.toolTip = "Rapidly shoot life stealing daggers"; + goto IL_2B846; + } + if (this.type == 1570) + { + this.name = "Broken Hero Sword"; + this.width = 14; + this.height = 18; + this.maxStack = 99; + this.rare = 8; + this.value = Item.sellPrice(0, 2, 0, 0); + goto IL_2B846; + } + if (this.type == 1571) + { + this.autoReuse = true; + this.useStyle = 5; + this.name = "Eater's Bite"; + this.shootSpeed = 14f; + this.shoot = 306; + this.damage = 57; + this.width = 18; + this.height = 20; + this.useSound = 39; + this.useAnimation = 20; + this.useTime = 20; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.sellPrice(0, 20, 0, 0); + this.knockBack = 5f; + this.melee = true; + this.rare = 8; + goto IL_2B846; + } + if (this.type == 1572) + { + this.name = "Hydra Staff"; + this.useStyle = 1; + this.shootSpeed = 14f; + this.shoot = 308; + this.damage = 100; + this.width = 18; + this.height = 20; + this.useSound = 1; + this.useAnimation = 30; + this.useTime = 30; + this.noMelee = true; + this.value = Item.sellPrice(0, 20, 0, 0); + this.knockBack = 7.5f; + this.rare = 8; + this.summon = true; + this.mana = 20; + goto IL_2B846; + } + if (this.type == 1573) + { + this.name = "The Creation of the Guide"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 16; + goto IL_2B846; + } + if (this.type >= 1574 && this.type <= 1576) + { + this.name = "Picture"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 33 + this.type - 1574; + goto IL_2B846; + } + if (this.type == 1577) + { + this.name = "Glorious Night"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 245; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(0, 0, 10, 0); + this.placeStyle = 6; + goto IL_2B846; + } + if (this.type == 1578) + { + this.name = "Sweetheart Necklace"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 3; + this.toolTip = "Releases bees and increases movement speed when damaged"; + this.value = 200000; + goto IL_2B846; + } + if (this.type == 1579) + { + this.name = "Flurry Boots"; + this.width = 28; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.toolTip = "The wearer can run super fast"; + this.value = 50000; + goto IL_2B846; + } + if (this.type == 1580) + { + this.name = "D-Town's Helmet"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.headSlot = 111; + goto IL_2B846; + } + if (this.type == 1581) + { + this.name = "D-Town's Breastplate"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 73; + goto IL_2B846; + } + if (this.type == 1582) + { + this.name = "D-Town's Leggings"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 62; + goto IL_2B846; + } + if (this.type == 1583) + { + this.name = "D-Town's Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.rare = 9; + goto IL_2B846; + } + if (this.type == 1584) + { + this.name = "Will's Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.rare = 9; + goto IL_2B846; + } + if (this.type == 1585) + { + this.name = "Crowno's Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.rare = 9; + goto IL_2B846; + } + if (this.type == 1586) + { + this.name = "Cenx's Wings"; + this.width = 24; + this.height = 8; + this.accessory = true; + this.rare = 9; + goto IL_2B846; + } + if (this.type == 1587) + { + this.name = "Cenx's Dress"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.bodySlot = 74; + goto IL_2B846; + } + if (this.type == 1588) + { + this.name = "Cenx's Dress Pants"; + this.width = 18; + this.height = 18; + this.rare = 9; + this.vanity = true; + this.legSlot = 63; + goto IL_2B846; + } + if (this.type == 1589) + { + this.name = "Palladium Column"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 248; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1590) + { + this.name = "Palladium Column Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 109; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1591) + { + this.name = "Bubblegum Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 249; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1592) + { + this.name = "Bubblegum Block Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 110; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1593) + { + this.name = "Titanstone Block"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 250; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1594) + { + this.name = "Titanstone Block Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 111; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1595) + { + this.name = "Magic Cuffs"; + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 2; + this.toolTip = "Increases maximum mana by 20"; + this.toolTip2 = "Restores mana when damaged"; + this.value = 100000; + goto IL_2B846; + } + if (this.type >= 1596 && this.type <= 1610) + { + this.name = "Music Box"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = this.type - 1596 + 13; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; + this.accessory = true; + goto IL_2B846; + } + if (this.type == 1611) + { + this.name = "Butterfly Dust"; + this.maxStack = 99; + this.width = 16; + this.height = 14; + this.value = Item.sellPrice(0, 2, 50, 0); + this.rare = 5; + goto IL_2B846; + } + if (this.type == 1612) + { + this.name = "Ankh Charm"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 6; + this.toolTip = "Grants immunity to most debuffs"; + this.value = Item.sellPrice(0, 3, 0, 0); + goto IL_2B846; + } + if (this.type == 1613) + { + this.name = "Ankh Shield"; + this.width = 24; + this.height = 28; + this.rare = 7; + this.value = Item.sellPrice(0, 5, 0, 0); + this.accessory = true; + this.defense = 4; + this.toolTip = "Grants immunity to knockback and fire blocks"; + this.toolTip2 = "Grants immunity to most debuffs"; + goto IL_2B846; + } + if (this.type == 1614) + { + this.name = "Blue Flare"; + this.shootSpeed = 6f; + this.shoot = 310; + this.damage = 1; + this.width = 12; + this.height = 12; + this.maxStack = 999; + this.consumable = true; + this.ammo = 931; + this.knockBack = 1.5f; + this.value = 7; + this.ranged = true; + goto IL_2B846; + } + if (this.type >= 1615 && this.type <= 1701) + { + this.name = "Monster Banner"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 22 + this.type - 1615; + this.width = 10; + this.height = 24; + this.value = 1000; + this.rare = 1; + goto IL_2B846; + } + if (this.type == 1702) + { + this.name = "Glass Platform"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 14; + this.width = 8; + this.height = 10; + goto IL_2B846; + } + if (this.type >= 1703 && this.type <= 1708) + { + this.name = "Chair"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 18 + this.type - 1703; + this.width = 12; + this.height = 30; + goto IL_2B846; + } + if (this.type >= 1709 && this.type <= 1712) + { + this.name = "Door"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 20 + this.type - 1709; + this.width = 14; + this.height = 28; + this.value = 200; + goto IL_2B846; + } + if (this.type >= 1713 && this.type <= 1718) + { + this.name = "Table"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 15 + this.type - 1713; + this.width = 26; + this.height = 20; + this.value = 300; + goto IL_2B846; + } + if (this.type >= 1719 && this.type <= 1722) + { + this.name = "Bed"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 79; + this.placeStyle = 9 + this.type - 1719; + this.width = 28; + this.height = 20; + this.value = 2000; + goto IL_2B846; + } + if (this.type == 1723) + { + this.name = "Living Wood Wall"; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 78; + this.width = 12; + this.height = 12; + goto IL_2B846; + } + if (this.type == 1724) + { + this.name = "Fart in a Jar"; + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 2; + this.toolTip = "Allows the holder to double jump"; + this.value = 75000; + } + IL_2B846: + this.netID = this.type; + if (!noMatCheck) + { + this.checkMat(); + } + this.name = Lang.itemName(this.netID, false); + this.CheckTip(); + } + public static string VersionName(string oldName, int release) + { + string result = oldName; + if (release <= 4) + { + if (oldName == "Cobalt Helmet") + { + result = "Jungle Hat"; + } + else + { + if (oldName == "Cobalt Breastplate") + { + result = "Jungle Shirt"; + } + else + { + if (oldName == "Cobalt Greaves") + { + result = "Jungle Pants"; + } + } + } + } + if (release <= 13 && oldName == "Jungle Rose") + { + result = "Jungle Spores"; + } + if (release <= 20) + { + if (oldName == "Gills potion") + { + result = "Gills Potion"; + } + else + { + if (oldName == "Thorn Chakrum") + { + result = "Thorn Chakram"; + } + else + { + if (oldName == "Ball 'O Hurt") + { + result = "Ball O' Hurt"; + } + } + } + } + if (release <= 41 && oldName == "Iron Chain") + { + result = "Chain"; + } + if (release <= 44 && oldName == "Orb of Light") + { + result = "Shadow Orb"; + } + if (release <= 46) + { + if (oldName == "Black Dye") + { + result = "Black Thread"; + } + if (oldName == "Green Dye") + { + result = "Green Thread"; + } + } + return result; + } + public Color GetAlpha(Color newColor) + { + if (this.type == 75) + { + return new Color(255, 255, 255, (int)newColor.A - this.alpha); + } + if (this.type == 121 || this.type == 122 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 220 || this.type == 120 || this.type == 119) + { + return new Color(255, 255, 255, 255); + } + if (this.type == 501) + { + return new Color(200, 200, 200, 50); + } + if (this.type == 757) + { + return new Color(255, 255, 255, 200); + } + if (this.type == 1306) + { + return new Color(255, 255, 255, 200); + } + if (this.type == 520 || this.type == 521 || this.type == 522 || this.type == 547 || this.type == 548 || this.type == 549 || this.type == 575 || this.type == 1332) + { + return new Color(255, 255, 255, 50); + } + if (this.type == 58 || this.type == 184) + { + return new Color(200, 200, 200, 2000); + } + if (this.type == 1572) + { + return new Color(200, 200, 255, 125); + } + if (this.type == 787) + { + return new Color(255, 255, 255, 175); + } + if (this.type == 1508) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 502) + { + return new Color(255, 255, 255, 150); + } + if (this.type == 51) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 1260) + { + return new Color(255, 255, 255, 175); + } + if (this.type == 1508) + { + return new Color((int)newColor.R, (int)newColor.G, (int)newColor.B, (int)Main.gFade); + } + if (this.type == 1506 || this.type == 1507) + { + return new Color((int)newColor.R, (int)newColor.G, (int)newColor.B, (int)Main.gFade); + } + if (this.type == 1446 || (this.type >= 1543 && this.type <= 1545)) + { + return new Color((int)newColor.R, (int)newColor.G, (int)newColor.B, (int)Main.gFade); + } + float num = (float)(255 - this.alpha) / 255f; + int r = (int)((float)newColor.R * num); + int g = (int)((float)newColor.G * num); + int b = (int)((float)newColor.B * num); + int num2 = (int)newColor.A - this.alpha; + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + if (this.type >= 198 && this.type <= 203) + { + return Color.White; + } + return new Color(r, g, b, num2); + } + public Color GetColor(Color newColor) + { + int num = (int)(this.color.R - (255 - newColor.R)); + int num2 = (int)(this.color.G - (255 - newColor.G)); + int num3 = (int)(this.color.B - (255 - newColor.B)); + int num4 = (int)(this.color.A - (255 - newColor.A)); + if (num < 0) + { + num = 0; + } + if (num > 255) + { + num = 255; + } + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + if (num3 < 0) + { + num3 = 0; + } + if (num3 > 255) + { + num3 = 255; + } + if (num4 < 0) + { + num4 = 0; + } + if (num4 > 255) + { + num4 = 255; + } + return new Color(num, num2, num3, num4); + } + public static bool MechSpawn(float x, float y, int type) + { + int num = 0; + int num2 = 0; + int num3 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.item[i].active && Main.item[i].type == type) + { + num++; + Vector2 vector = new Vector2(x, y); + float num4 = Main.item[i].position.X - vector.X; + float num5 = Main.item[i].position.Y - vector.Y; + float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); + if (num6 < 300f) + { + num2++; + } + if (num6 < 800f) + { + num3++; + } + } + } + return num2 < 3 && num3 < 6 && num < 10; + } + public static int buyPrice(int platinum = 0, int gold = 0, int silver = 0, int copper = 0) + { + int num = copper + silver * 100; + num += gold * 100 * 100; + return num + platinum * 100 * 100 * 100; + } + public static int sellPrice(int platinum = 0, int gold = 0, int silver = 0, int copper = 0) + { + int num = copper + silver * 100; + num += gold * 100 * 100; + num += platinum * 100 * 100 * 100; + return num * 5; + } + public void UpdateItem(int i) + { + if (this.active) + { + if (Main.netMode == 0) + { + this.owner = Main.myPlayer; + } + float num = 0.1f; + float num2 = 7f; + if (Main.netMode == 1) + { + int num3 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num4 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (num3 >= 0 && num4 >= 0 && num3 < Main.maxTilesX && num4 < Main.maxTilesY && Main.tile[num3, num4] == null) + { + num = 0f; + this.velocity.X = 0f; + this.velocity.Y = 0f; + } + } + if (this.honeyWet) + { + num = 0.05f; + num2 = 3f; + } + else + { + if (this.wet) + { + num2 = 5f; + num = 0.08f; + } + } + Vector2 value = this.velocity * 0.5f; + if (this.ownTime > 0) + { + this.ownTime--; + } + else + { + this.ownIgnore = -1; + } + if (this.keepTime > 0) + { + this.keepTime--; + } + if (!this.beingGrabbed) + { + if (this.owner == Main.myPlayer && (this.createTile >= 0 || this.createWall > 0 || (this.ammo > 0 && !this.notAmmo) || this.consumable || (this.type >= 71 && this.type <= 74)) && this.stack < this.maxStack) + { + for (int j = i + 1; j < 400; j++) + { + if (Main.item[j].active && Main.item[j].type == this.type && Main.item[j].stack > 0 && Main.item[j].owner == this.owner) + { + float num5 = Math.Abs(this.position.X + (float)(this.width / 2) - (Main.item[j].position.X + (float)(Main.item[j].width / 2))) + Math.Abs(this.position.Y + (float)(this.height / 2) - (Main.item[j].position.Y + (float)(Main.item[j].height / 2))); + if (num5 < 30f) + { + this.position = (this.position + Main.item[j].position) / 2f; + this.velocity = (this.velocity + Main.item[j].velocity) / 2f; + int num6 = Main.item[j].stack; + if (num6 > this.maxStack - this.stack) + { + num6 = this.maxStack - this.stack; + } + Main.item[j].stack -= num6; + this.stack += num6; + if (Main.item[j].stack <= 0) + { + Main.item[j].SetDefaults(0, false); + Main.item[j].active = false; + } + if (Main.netMode != 0) + { + NetMessage.SendData(21, -1, -1, "", i, 0f, 0f, 0f, 0); + NetMessage.SendData(21, -1, -1, "", j, 0f, 0f, 0f, 0); + } + } + } + } + } + if (this.type == 520 || this.type == 521 || this.type == 547 || this.type == 548 || this.type == 549 || this.type == 575) + { + this.velocity.X = this.velocity.X * 0.95f; + if ((double)this.velocity.X < 0.1 && (double)this.velocity.X > -0.1) + { + this.velocity.X = 0f; + } + this.velocity.Y = this.velocity.Y * 0.95f; + if ((double)this.velocity.Y < 0.1 && (double)this.velocity.Y > -0.1) + { + this.velocity.Y = 0f; + } + } + else + { + this.velocity.Y = this.velocity.Y + num; + if (this.velocity.Y > num2) + { + this.velocity.Y = num2; + } + this.velocity.X = this.velocity.X * 0.95f; + if ((double)this.velocity.X < 0.1 && (double)this.velocity.X > -0.1) + { + this.velocity.X = 0f; + } + } + bool flag = Collision.LavaCollision(this.position, this.width, this.height); + if (flag) + { + this.lavaWet = true; + } + bool flag2 = Collision.WetCollision(this.position, this.width, this.height); + if (Collision.honey) + { + this.honeyWet = true; + } + if (flag2) + { + if (!this.wet) + { + if (this.wetCount == 0) + { + this.wetCount = 20; + if (!flag) + { + if (this.honeyWet) + { + for (int k = 0; k < 5; k++) + { + int num7 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_62C_cp_0 = Main.dust[num7]; + expr_62C_cp_0.velocity.Y = expr_62C_cp_0.velocity.Y - 1f; + Dust expr_64A_cp_0 = Main.dust[num7]; + expr_64A_cp_0.velocity.X = expr_64A_cp_0.velocity.X * 2.5f; + Main.dust[num7].scale = 1.3f; + Main.dust[num7].alpha = 100; + Main.dust[num7].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + for (int l = 0; l < 10; l++) + { + int num8 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_734_cp_0 = Main.dust[num8]; + expr_734_cp_0.velocity.Y = expr_734_cp_0.velocity.Y - 4f; + Dust expr_752_cp_0 = Main.dust[num8]; + expr_752_cp_0.velocity.X = expr_752_cp_0.velocity.X * 2.5f; + Main.dust[num8].scale *= 0.8f; + Main.dust[num8].alpha = 100; + Main.dust[num8].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + for (int m = 0; m < 5; m++) + { + int num9 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_841_cp_0 = Main.dust[num9]; + expr_841_cp_0.velocity.Y = expr_841_cp_0.velocity.Y - 1.5f; + Dust expr_85F_cp_0 = Main.dust[num9]; + expr_85F_cp_0.velocity.X = expr_85F_cp_0.velocity.X * 2.5f; + Main.dust[num9].scale = 1.3f; + Main.dust[num9].alpha = 100; + Main.dust[num9].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + this.wet = true; + } + } + else + { + if (this.wet) + { + this.wet = false; + } + } + if (!this.wet) + { + this.lavaWet = false; + this.honeyWet = false; + } + if (this.wetCount > 0) + { + this.wetCount -= 1; + } + if (this.wet) + { + if (this.wet) + { + Vector2 vector = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, false, false); + if (this.velocity.X != vector.X) + { + value.X = this.velocity.X; + } + if (this.velocity.Y != vector.Y) + { + value.Y = this.velocity.Y; + } + } + } + else + { + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, false, false); + } + Vector4 vector2 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, num); + this.position.X = vector2.X; + this.position.Y = vector2.Y; + this.velocity.X = vector2.Z; + this.velocity.Y = vector2.W; + if (this.lavaWet) + { + if (this.type == 267) + { + if (Main.netMode != 1) + { + this.active = false; + this.type = 0; + this.name = ""; + this.stack = 0; + for (int n = 0; n < 200; n++) + { + if (Main.npc[n].active && Main.npc[n].type == 22) + { + if (Main.netMode == 2) + { + NetMessage.SendData(28, -1, -1, "", n, 9999f, 10f, (float)(-(float)Main.npc[n].direction), 0); + } + Main.npc[n].StrikeNPC(9999, 10f, -Main.npc[n].direction, false, false); + NPC.SpawnWOF(this.position); + } + } + NetMessage.SendData(21, -1, -1, "", i, 0f, 0f, 0f, 0); + } + } + else + { + if (this.owner == Main.myPlayer && this.type != 312 && this.type != 318 && this.type != 173 && this.type != 174 && this.type != 175 && this.rare == 0) + { + this.active = false; + this.type = 0; + this.name = ""; + this.stack = 0; + if (Main.netMode != 0) + { + NetMessage.SendData(21, -1, -1, "", i, 0f, 0f, 0f, 0); + } + } + } + } + if (this.type == 520) + { + float num10 = (float)Main.rand.Next(90, 111) * 0.01f; + num10 *= Main.essScale; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.5f * num10, 0.1f * num10, 0.25f * num10); + } + else + { + if (this.type == 521) + { + float num11 = (float)Main.rand.Next(90, 111) * 0.01f; + num11 *= Main.essScale; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.25f * num11, 0.1f * num11, 0.5f * num11); + } + else + { + if (this.type == 547) + { + float num12 = (float)Main.rand.Next(90, 111) * 0.01f; + num12 *= Main.essScale; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.5f * num12, 0.3f * num12, 0.05f * num12); + } + else + { + if (this.type == 548) + { + float num13 = (float)Main.rand.Next(90, 111) * 0.01f; + num13 *= Main.essScale; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.1f * num13, 0.1f * num13, 0.6f * num13); + } + else + { + if (this.type == 575) + { + float num14 = (float)Main.rand.Next(90, 111) * 0.01f; + num14 *= Main.essScale; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.1f * num14, 0.3f * num14, 0.5f * num14); + } + else + { + if (this.type == 549) + { + float num15 = (float)Main.rand.Next(90, 111) * 0.01f; + num15 *= Main.essScale; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.1f * num15, 0.5f * num15, 0.2f * num15); + } + else + { + if (this.type == 58) + { + float num16 = (float)Main.rand.Next(90, 111) * 0.01f; + num16 *= Main.essScale * 0.5f; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.5f * num16, 0.1f * num16, 0.1f * num16); + } + else + { + if (this.type == 184) + { + float num17 = (float)Main.rand.Next(90, 111) * 0.01f; + num17 *= Main.essScale * 0.5f; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.1f * num17, 0.1f * num17, 0.5f * num17); + } + else + { + if (this.type == 522) + { + float num18 = (float)Main.rand.Next(90, 111) * 0.01f; + num18 *= Main.essScale * 0.2f; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.5f * num18, 1f * num18, 0.1f * num18); + } + else + { + if (this.type == 1332) + { + float num19 = (float)Main.rand.Next(90, 111) * 0.01f; + num19 *= Main.essScale * 0.2f; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 1f * num19, 1f * num19, 0.1f * num19); + } + } + } + } + } + } + } + } + } + } + if (this.type == 75 && Main.dayTime) + { + for (int num20 = 0; num20 < 10; num20++) + { + Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X, this.velocity.Y, 150, default(Color), 1.2f); + } + for (int num21 = 0; num21 < 3; num21++) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X, this.velocity.Y), Main.rand.Next(16, 18), 1f); + } + this.active = false; + this.type = 0; + this.stack = 0; + if (Main.netMode == 2) + { + NetMessage.SendData(21, -1, -1, "", i, 0f, 0f, 0f, 0); + } + } + } + else + { + this.beingGrabbed = false; + } + if (this.type == 501) + { + if (Main.rand.Next(6) == 0) + { + int num22 = Dust.NewDust(this.position, this.width, this.height, 55, 0f, 0f, 200, this.color, 1f); + Main.dust[num22].velocity *= 0.3f; + Main.dust[num22].scale *= 0.5f; + } + } + else + { + if (this.type == 8 || this.type == 105) + { + if (!this.wet) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 1f, 0.95f, 0.8f); + } + } + else + { + if (this.type == 523) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.85f, 1f, 0.7f); + } + else + { + if (this.type == 1333) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 1.25f, 1.25f, 0.8f); + } + else + { + if (this.type >= 427 && this.type <= 432) + { + if (!this.wet) + { + float r = 0f; + float g = 0f; + float b = 0f; + int num23 = this.type - 426; + if (num23 == 1) + { + r = 0.1f; + g = 0.2f; + b = 1.1f; + } + if (num23 == 2) + { + r = 1f; + g = 0.1f; + b = 0.1f; + } + if (num23 == 3) + { + r = 0f; + g = 1f; + b = 0.1f; + } + if (num23 == 4) + { + r = 0.9f; + g = 0f; + b = 0.9f; + } + if (num23 == 5) + { + r = 1.3f; + g = 1.3f; + b = 1.3f; + } + if (num23 == 6) + { + r = 0.9f; + g = 0.9f; + b = 0f; + } + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), r, g, b); + } + } + else + { + if (this.type == 41) + { + if (!this.wet) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 1f, 0.75f, 0.55f); + } + } + else + { + if (this.type == 988) + { + if (!this.wet) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.35f, 0.65f, 1f); + } + } + else + { + if (this.type == 282) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.7f, 1f, 0.8f); + } + else + { + if (this.type == 286) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.7f, 0.8f, 1f); + } + else + { + if (this.type == 331) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.55f, 0.75f, 0.6f); + } + else + { + if (this.type == 183) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.15f, 0.45f, 0.9f); + } + else + { + if (this.type == 75) + { + Lighting.addLight((int)((this.position.X + (float)this.width) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.8f, 0.7f, 0.1f); + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type == 75) + { + if (Main.rand.Next(25) == 0) + { + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f); + } + if (Main.rand.Next(50) == 0) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.2f, this.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); + } + } + if (this.spawnTime < 2147483646) + { + this.spawnTime++; + } + if (Main.netMode == 2 && this.owner != Main.myPlayer) + { + this.release++; + if (this.release >= 300) + { + this.release = 0; + NetMessage.SendData(39, this.owner, -1, "", i, 0f, 0f, 0f, 0); + } + } + if (this.wet) + { + this.position += value; + } + else + { + this.position += this.velocity; + } + if (this.noGrabDelay > 0) + { + this.noGrabDelay--; + } + } + } + public static int NewItem(int X, int Y, int Width, int Height, int Type, int Stack = 1, bool noBroadcast = false, int pfix = 0, bool noGrabDelay = false) + { + if (Main.rand == null) + { + Main.rand = new Random(); + } + if (WorldGen.gen) + { + return 0; + } + int num = 400; + Main.item[400] = new Item(); + if (Main.netMode != 1) + { + for (int i = 0; i < 400; i++) + { + if (!Main.item[i].active) + { + num = i; + break; + } + } + } + if (num == 400 && Main.netMode != 1) + { + int num2 = 0; + for (int j = 0; j < 400; j++) + { + if (Main.item[j].spawnTime > num2) + { + num2 = Main.item[j].spawnTime; + num = j; + } + } + } + Main.item[num] = new Item(); + Main.item[num].SetDefaults(Type, false); + Main.item[num].Prefix(pfix); + Main.item[num].position.X = (float)(X + Width / 2 - Main.item[num].width / 2); + Main.item[num].position.Y = (float)(Y + Height / 2 - Main.item[num].height / 2); + Main.item[num].wet = Collision.WetCollision(Main.item[num].position, Main.item[num].width, Main.item[num].height); + Main.item[num].velocity.X = (float)Main.rand.Next(-30, 31) * 0.1f; + Main.item[num].velocity.Y = (float)Main.rand.Next(-40, -15) * 0.1f; + if (Type == 859) + { + Main.item[num].velocity *= 0f; + } + if (Type == 520 || Type == 521) + { + Main.item[num].velocity.X = (float)Main.rand.Next(-30, 31) * 0.1f; + Main.item[num].velocity.Y = (float)Main.rand.Next(-30, 31) * 0.1f; + } + Main.item[num].active = true; + Main.item[num].spawnTime = 0; + Main.item[num].stack = Stack; + if (Main.netMode == 2 && !noBroadcast) + { + int num3 = 0; + if (noGrabDelay) + { + num3 = 1; + } + NetMessage.SendData(21, -1, -1, "", num, (float)num3, 0f, 0f, 0); + Main.item[num].FindOwner(num); + } + else + { + if (Main.netMode == 0) + { + Main.item[num].owner = Main.myPlayer; + } + } + return num; + } + public void FindOwner(int whoAmI) + { + if (this.keepTime > 0) + { + return; + } + int num = this.owner; + this.owner = 255; + float num2 = -1f; + for (int i = 0; i < 255; i++) + { + if (this.ownIgnore != i && Main.player[i].active && Main.player[i].ItemSpace(Main.item[whoAmI])) + { + float num3 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - this.position.X - (float)(this.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - this.position.Y - (float)this.height); + if (num3 < (float)NPC.sWidth && (num2 == -1f || num3 < num2)) + { + num2 = num3; + this.owner = i; + } + } + } + if (this.owner != num && ((num == Main.myPlayer && Main.netMode == 1) || (num == 255 && Main.netMode == 2) || !Main.player[num].active)) + { + NetMessage.SendData(21, -1, -1, "", whoAmI, 0f, 0f, 0f, 0); + if (this.active) + { + NetMessage.SendData(22, -1, -1, "", whoAmI, 0f, 0f, 0f, 0); + } + } + } + public object Clone() + { + return base.MemberwiseClone(); + } + public bool IsTheSameAs(Item compareItem) + { + return this.netID == compareItem.netID && this.type == compareItem.type; + } + public bool IsNotTheSameAs(Item compareItem) + { + return this.netID != compareItem.netID || this.stack != compareItem.stack || this.prefix != compareItem.prefix; + } + } +} diff --git a/Terraria/ItemText.cs b/Terraria/ItemText.cs new file mode 100644 index 0000000..563f509 --- /dev/null +++ b/Terraria/ItemText.cs @@ -0,0 +1,311 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class ItemText + { + public Vector2 position; + public Vector2 velocity; + public float alpha; + public int alphaDir = 1; + public string name; + public int stack; + public float scale = 1f; + public float rotation; + public Color color; + public bool active; + public int lifeTime; + public static int activeTime = 60; + public static int numActive; + public static void NewText(Item newItem, int stack) + { + if (!Main.showItemText) + { + return; + } + if (newItem.name == null || !newItem.active) + { + return; + } + if (Main.netMode == 2) + { + return; + } + for (int i = 0; i < 20; i++) + { + if (Main.itemText[i].active && Main.itemText[i].name == newItem.name) + { + string text = string.Concat(new object[] + { + newItem.name, + " (", + Main.itemText[i].stack + stack, + ")" + }); + string text2 = newItem.name; + if (Main.itemText[i].stack > 1) + { + object obj = text2; + text2 = string.Concat(new object[] + { + obj, + " (", + Main.itemText[i].stack, + ")" + }); + } + Vector2 vector = Main.fontMouseText.MeasureString(text2); + vector = Main.fontMouseText.MeasureString(text); + if (Main.itemText[i].lifeTime < 0) + { + Main.itemText[i].scale = 1f; + } + Main.itemText[i].lifeTime = 60; + Main.itemText[i].stack += stack; + Main.itemText[i].scale = 0f; + Main.itemText[i].rotation = 0f; + Main.itemText[i].position.X = newItem.position.X + (float)newItem.width * 0.5f - vector.X * 0.5f; + Main.itemText[i].position.Y = newItem.position.Y + (float)newItem.height * 0.25f - vector.Y * 0.5f; + Main.itemText[i].velocity.Y = -7f; + return; + } + } + int num = -1; + for (int j = 0; j < 20; j++) + { + if (!Main.itemText[j].active) + { + num = j; + break; + } + } + if (num == -1) + { + double num2 = (double)Main.bottomWorld; + for (int k = 0; k < 20; k++) + { + if (num2 > (double)Main.itemText[k].position.Y) + { + num = k; + num2 = (double)Main.itemText[k].position.Y; + } + } + } + if (num >= 0) + { + string text3 = newItem.AffixName(); + if (stack > 1) + { + object obj2 = text3; + text3 = string.Concat(new object[] + { + obj2, + " (", + stack, + ")" + }); + } + Vector2 vector2 = Main.fontMouseText.MeasureString(text3); + Main.itemText[num].alpha = 1f; + Main.itemText[num].alphaDir = -1; + Main.itemText[num].active = true; + Main.itemText[num].scale = 0f; + Main.itemText[num].rotation = 0f; + Main.itemText[num].position.X = newItem.position.X + (float)newItem.width * 0.5f - vector2.X * 0.5f; + Main.itemText[num].position.Y = newItem.position.Y + (float)newItem.height * 0.25f - vector2.Y * 0.5f; + Main.itemText[num].color = Color.White; + if (newItem.rare == 1) + { + Main.itemText[num].color = new Color(150, 150, 255); + } + else + { + if (newItem.rare == 2) + { + Main.itemText[num].color = new Color(150, 255, 150); + } + else + { + if (newItem.rare == 3) + { + Main.itemText[num].color = new Color(255, 200, 150); + } + else + { + if (newItem.rare == 4) + { + Main.itemText[num].color = new Color(255, 150, 150); + } + else + { + if (newItem.rare == 5) + { + Main.itemText[num].color = new Color(255, 150, 255); + } + else + { + if (newItem.rare == -1) + { + Main.itemText[num].color = new Color(130, 130, 130); + } + else + { + if (newItem.rare == 6) + { + Main.itemText[num].color = new Color(210, 160, 255); + } + else + { + if (newItem.rare == 7) + { + Main.itemText[num].color = new Color(150, 255, 10); + } + else + { + if (newItem.rare == 8) + { + Main.itemText[num].color = new Color(255, 255, 10); + } + else + { + if (newItem.rare >= 9) + { + Main.itemText[num].color = new Color(5, 200, 255); + } + } + } + } + } + } + } + } + } + } + Main.itemText[num].name = newItem.AffixName(); + Main.itemText[num].stack = stack; + Main.itemText[num].velocity.Y = -7f; + Main.itemText[num].lifeTime = 60; + } + } + public void Update(int whoAmI) + { + if (this.active) + { + this.alpha += (float)this.alphaDir * 0.01f; + if ((double)this.alpha <= 0.7) + { + this.alpha = 0.7f; + this.alphaDir = 1; + } + if (this.alpha >= 1f) + { + this.alpha = 1f; + this.alphaDir = -1; + } + bool flag = false; + string text = this.name; + if (this.stack > 1) + { + object obj = text; + text = string.Concat(new object[] + { + obj, + " (", + this.stack, + ")" + }); + } + Vector2 value = Main.fontMouseText.MeasureString(text); + value *= this.scale; + value.Y *= 0.8f; + Rectangle rectangle = new Rectangle((int)(this.position.X - value.X / 2f), (int)(this.position.Y - value.Y / 2f), (int)value.X, (int)value.Y); + for (int i = 0; i < 20; i++) + { + if (Main.itemText[i].active && i != whoAmI) + { + string text2 = Main.itemText[i].name; + if (Main.itemText[i].stack > 1) + { + object obj2 = text2; + text2 = string.Concat(new object[] + { + obj2, + " (", + Main.itemText[i].stack, + ")" + }); + } + Vector2 value2 = Main.fontMouseText.MeasureString(text2); + value2 *= Main.itemText[i].scale; + value2.Y *= 0.8f; + Rectangle value3 = new Rectangle((int)(Main.itemText[i].position.X - value2.X / 2f), (int)(Main.itemText[i].position.Y - value2.Y / 2f), (int)value2.X, (int)value2.Y); + if (rectangle.Intersects(value3) && (this.position.Y < Main.itemText[i].position.Y || (this.position.Y == Main.itemText[i].position.Y && whoAmI < i))) + { + flag = true; + int num = ItemText.numActive; + if (num > 3) + { + num = 3; + } + Main.itemText[i].lifeTime = ItemText.activeTime + 15 * num; + this.lifeTime = ItemText.activeTime + 15 * num; + } + } + } + if (!flag) + { + this.velocity.Y = this.velocity.Y * 0.86f; + if (this.scale == 1f) + { + this.velocity.Y = this.velocity.Y * 0.4f; + } + } + else + { + if (this.velocity.Y > -6f) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + else + { + this.velocity.Y = this.velocity.Y * 0.86f; + } + } + this.velocity.X = this.velocity.X * 0.93f; + this.position += this.velocity; + this.lifeTime--; + if (this.lifeTime <= 0) + { + this.scale -= 0.03f; + if ((double)this.scale < 0.1) + { + this.active = false; + } + this.lifeTime = 0; + return; + } + if (this.scale < 1f) + { + this.scale += 0.1f; + } + if (this.scale > 1f) + { + this.scale = 1f; + } + } + } + public static void UpdateItemText() + { + int num = 0; + for (int i = 0; i < 20; i++) + { + if (Main.itemText[i].active) + { + num++; + Main.itemText[i].Update(i); + } + } + ItemText.numActive = num; + } + } +} diff --git a/Terraria/Lang.cs b/Terraria/Lang.cs new file mode 100644 index 0000000..93eb68d --- /dev/null +++ b/Terraria/Lang.cs @@ -0,0 +1,28510 @@ +using System; +namespace Terraria +{ + internal class Lang + { + public static int lang = 0; + public static string[] misc = new string[31]; + public static string[] menu = new string[114]; + public static string[] gen = new string[73]; + public static string[] inter = new string[59]; + public static string[] tip = new string[56]; + public static string[] mp = new string[22]; + public static string[] dt = new string[3]; + public static string the; + public static string dialog(int l, bool english = false) + { + string text = Main.chrName[18]; + string str = Main.chrName[17]; + string text2 = Main.chrName[19]; + string text3 = Main.chrName[20]; + string str2 = Main.chrName[38]; + string arg_36_0 = Main.chrName[54]; + string str3 = Main.chrName[22]; + string arg_49_0 = Main.chrName[108]; + string text4 = Main.chrName[107]; + string text5 = Main.chrName[124]; + string str4 = Main.chrName[160]; + string arg_76_0 = Main.chrName[178]; + string arg_82_0 = Main.chrName[207]; + string str5 = Main.chrName[208]; + string str6 = Main.chrName[209]; + string arg_A8_0 = Main.chrName[227]; + string arg_B4_0 = Main.chrName[228]; + string str7 = Main.chrName[229]; + if (Lang.lang <= 1 || english) + { + switch (l) + { + case 1: + return "I hope a scrawny kid like you isn't all that is standing between us and Cthulu's Eye."; + case 2: + return "Look at that shoddy armor you're wearing. Better buy some more healing potions."; + case 3: + return "I feel like an evil presence is watching me."; + case 4: + return "Sword beats paper! Get one today."; + case 5: + return "You want apples? You want carrots? You want pineapples? We got torches."; + case 6: + return "Lovely morning, wouldn't you say? Was there something you needed?"; + case 7: + return "Night will be upon us soon, friend. Make your choices while you can."; + case 8: + return "You have no idea how much Dirt Blocks sell for overseas."; + case 9: + return "Ah, they will tell tales of " + Main.player[Main.myPlayer].name + " some day... good ones I'm sure."; + case 10: + return "Check out my dirt blocks; they are extra dirty."; + case 11: + return "Boy, that sun is hot! I do have some perfectly ventilated armor."; + case 12: + return "The sun is high, but my prices are not."; + case 13: + return string.Concat(new string[] + { + "Oh, great. I can hear ", + text5, + " and ", + text, + " arguing from here." + }); + case 14: + return "Have you seen Chith...Shith.. Chat... The big eye?"; + case 15: + return "Hey, this house is secure, right? Right? " + Main.player[Main.myPlayer].name + "?"; + case 16: + return "Not even a blood moon can stop capitalism. Let's do some business."; + case 17: + return "Keep your eye on the prize, buy a lense!"; + case 18: + return "Kosh, kapleck Mog. Oh sorry, that's klingon for 'Buy something or die.'"; + case 19: + return Main.player[Main.myPlayer].name + " is it? I've heard good things, friend!"; + case 20: + return "I hear there's a secret treasure... oh never mind."; + case 21: + return "Angel Statue you say? I'm sorry, I'm not a junk dealer."; + case 22: + return "The last guy who was here left me some junk... er I mean... treasures!"; + case 23: + return "I wonder if the moon is made of cheese...huh, what? Oh yes, buy something!"; + case 24: + return "Did you say gold? I'll take that off of ya."; + case 25: + return "You better not get blood on me."; + case 26: + return "Hurry up and stop bleeding."; + case 27: + return "If you're going to die, do it outside."; + case 28: + return "What is that supposed to mean?!"; + case 29: + return "I don't think I like your tone."; + case 30: + return "Why are you even here? If you aren't bleeding, you don't need to be here. Get out."; + case 31: + return "WHAT?!"; + case 32: + return "Have you seen that old man pacing around the dungeon? He looks troubled."; + case 33: + return "I wish " + str2 + " would be more careful. I'm getting tired of having to sew his limbs back on every day."; + case 34: + return "Hey, has " + text2 + " mentioned needing to go to the doctor for any reason? Just wondering."; + case 35: + return "I need to have a serious talk with " + str3 + ". How many times a week can you come in with severe lava burns?"; + case 36: + return "I think you look better this way."; + case 37: + return "Eww... What happened to your face?"; + case 38: + return "MY GOODNESS! I'm good, but I'm not THAT good."; + case 39: + return "Dear friends we are gathered here today to bid farewell... Oh, you'll be fine."; + case 40: + return "You left your arm over there. Let me get that for you..."; + case 41: + return "Quit being such a baby! I've seen worse."; + case 42: + return "That's gonna need stitches!"; + case 43: + return "Trouble with those bullies again?"; + case 44: + return "Hold on, I've got some cartoon bandages around here somewhere."; + case 45: + return "Walk it off, " + Main.player[Main.myPlayer].name + ", you'll be fine. Sheesh."; + case 46: + return "Does it hurt when you do that? Don't do that."; + case 47: + return "You look half digested. Have you been chasing slimes again?"; + case 48: + return "Turn your head and cough."; + case 49: + return "That's not the biggest I've ever seen... Yes, I've seen bigger wounds for sure."; + case 50: + return "Would you like a lollipop?"; + case 51: + return "Show me where it hurts."; + case 52: + return "I'm sorry, but you can't afford me."; + case 53: + return "I'm gonna need more gold than that."; + case 54: + return "I don't work for free you know."; + case 55: + return "I don't give happy endings."; + case 56: + return "I can't do anymore for you without plastic surgery."; + case 57: + return "Quit wasting my time."; + case 58: + return "I heard there is a doll that looks very similar to " + str3 + " somewhere in the underworld. I'd like to put a few rounds in it."; + case 59: + return "Make it quick! I've got a date with " + text + " in an hour."; + case 60: + return "I want what " + text + " is sellin'. What do you mean, she doesn't sell anything?"; + case 61: + return text3 + " is a looker. Too bad she's such a prude."; + case 62: + return "Don't bother with " + str2 + ", I've got all you need right here."; + case 63: + return "What's " + str2 + "'s problem? Does he even realize we sell completely different stuff?"; + case 64: + return "Man, it's a good night not to talk to anybody, don't you think, " + Main.player[Main.myPlayer].name + "?"; + case 65: + return "I love nights like tonight. There is never a shortage of things to kill!"; + case 66: + return "I see you're eyeballin' the Minishark.. You really don't want to know how it was made."; + case 67: + return "Hey, this ain't a movie, pal. Ammo is extra."; + case 68: + return "Keep your hands off my gun, buddy!"; + case 69: + return "Have you tried using purification powder on the ebonstone of the corruption?"; + case 70: + return "I wish " + text2 + " would stop flirting with me. Doesn't he realize I'm 500 years old?"; + case 71: + return "Why does " + str + " keep trying to sell me an angel statues? Everyone knows that they don't do anything."; + case 72: + return "Have you seen the old man walking around the dungeon? He doesn't look well at all..."; + case 73: + return "I sell what I want! If you don't like it, too bad."; + case 74: + return "Why do you have to be so confrontational during a time like this?"; + case 75: + return "I don't want you to buy my stuff. I want you to want to buy my stuff, ok?"; + case 76: + return "Dude, is it just me or is there like a million zombies out tonight?"; + case 77: + return "You must cleanse the world of this corruption."; + case 78: + return "Be safe; Terraria needs you!"; + case 79: + return "The sands of time are flowing. And well, you are not aging very gracefully."; + case 80: + return "What's this about me having more 'bark' than bite?"; + case 81: + return "So two goblins walk into a bar, and one says to the other, 'Want to get a Goblet of beer?!"; + case 82: + return "I cannot let you enter until you free me of my curse."; + case 83: + return "Come back at night if you wish to enter."; + case 84: + return "My master cannot be summoned under the light of day."; + case 85: + return "You are far too weak to defeat my curse. Come back when you aren't so worthless."; + case 86: + return "You pathetic fool. You cannot hope to face my master as you are now."; + case 87: + return "I hope you have like six friends standing around behind you."; + case 88: + return "Please, no, stranger. You'll only get yourself killed."; + case 89: + return "You just might be strong enough to free me from my curse..."; + case 90: + return "Stranger, do you possess the strength to defeat my master?"; + case 91: + return "Please! Battle my captor and free me! I beg you!"; + case 92: + return "Defeat my master, and I will grant you passage into the Dungeon."; + case 93: + return "Trying to get past that ebonrock, eh? Why not introduce it to one of these explosives!"; + case 94: + return "Hey, have you seen a clown around?"; + case 95: + return "There was a bomb sitting right here, and now I can't seem to find it..."; + case 96: + return "I've got something for them zombies alright!"; + case 97: + return "Even " + text2 + " wants what I'm selling!"; + case 98: + return "Would you rather have a bullet hole or a grenade hole? That's what I thought."; + case 99: + return "I'm sure " + text + " will help if you accidentally lose a limb to these."; + case 100: + return "Why purify the world when you can just blow it up?"; + case 101: + return "If you throw this one in the bathtub and close all the windows, it'll clear your sinuses and pop your ears!"; + case 102: + return "Wanna play Fuse Chicken?"; + case 103: + return "Hey, could you sign this Griefing Waiver?"; + case 104: + return "NO SMOKING IN HERE!!"; + case 105: + return "Explosives are da' bomb these days. Buy some now!"; + case 106: + return "It's a good day to die!"; + case 107: + return "I wonder what happens if I... (BOOM!)... Oh, sorry, did you need that leg?"; + case 108: + return "Dynamite, my own special cure-all for what ails ya."; + case 109: + return "Check out my goods; they have explosive prices!"; + case 110: + return "I keep having vague memories of tying up a woman and throwing her in a dungeon."; + case 111: + return "... we have a problem! Its a blood moon out there!"; + case 112: + return "T'were I younger, I would ask " + text + " out. I used to be quite the lady killer."; + case 113: + return "That Red Hat of yours looks familiar..."; + case 114: + return "Thanks again for freeing me from my curse. Felt like something jumped up and bit me."; + case 115: + return "Mama always said I would make a great tailor."; + case 116: + return "Life's like a box of clothes; you never know what you are gonna wear!"; + case 117: + return "Of course embroidery is hard! If it wasn't hard, no one would do it! That's what makes it great."; + case 118: + return "I know everything they is to know about the clothierin' business."; + case 119: + return "Being cursed was lonely, so I once made a friend out of leather. I named him Wilson."; + case 120: + return "Thank you for freeing me, human. I was tied up and left here by the other goblins. You could say that we didn't get along very well."; + case 121: + return "I can't believe they tied me up and left me here just for pointing out that they weren't going east!"; + case 122: + return "Now that I'm an outcast, can I throw away the spiked balls? My pockets hurt."; + case 123: + return "Looking for a gadgets expert? I'm your goblin!"; + case 124: + return "Thanks for your help. Now, I have to finish pacing around aimlessly here. I'm sure we'll meet again."; + case 125: + return "I thought you'd be taller."; + case 126: + return "Hey...what's " + text5 + " up to? Have you...have you talked to her, by chance?"; + case 127: + return "Hey, does your hat need a motor? I think I have a motor that would fit exactly in that hat."; + case 128: + return "Yo, I heard you like rockets and running boots, so I put some rockets in your running boots."; + case 129: + return "Silence is golden. Duct tape is silver."; + case 130: + return "YES, gold is stronger than iron. What are they teaching these humans nowadays?"; + case 131: + return "You know, that mining helmet-flipper combination was a much better idea on paper."; + case 132: + return "Goblins are surprisingly easy to anger. In fact, they could start a war over cloth!"; + case 133: + return "To be honest, most goblins aren't exactly rocket scientists. Well, some are."; + case 134: + return "Do you know why we all carry around these spiked balls? Because I don't."; + case 135: + return "I just finished my newest creation! This version doesn't explode violently if you breathe on it too hard."; + case 136: + return "Goblin thieves aren't very good at their job. They can't even steal from an unlocked chest!"; + case 137: + return "Thanks for saving me, friend! This bondage was starting to chafe."; + case 138: + return "Ohh, my hero!"; + case 139: + return "Oh, how heroic! Thank you for saving me, young lady!"; + case 140: + return "Oh, how heroic! Thank you for saving me, young man!"; + case 141: + return "Now that we know each other, I can move in with you, right?"; + case 142: + return "Well, hi there, " + str3 + "! What can I do for you today?"; + case 143: + return "Well, hi there, " + str2 + "! What can I do for you today?"; + case 144: + return "Well, hi there, " + text4 + "! What can I do for you today?"; + case 145: + return "Well, hi there, " + text + "! What can I do for you today?"; + case 146: + return "Well, hi there, " + text5 + "! What can I do for you today?"; + case 147: + return "Well, hi there, " + text3 + "! What can I do for you today?"; + case 148: + return "Want me to pull a coin from behind your ear? No? Ok."; + case 149: + return "Do you want some magic candy? No? Ok."; + case 150: + return "I make a rather enchanting hot chocolate if you'd be inter...No? Ok."; + case 151: + return "Are you here for a peek at my crystal ball?"; + case 152: + return "Ever wanted an enchanted ring that turns rocks into slimes? Well neither did I."; + case 153: + return "Someone once told me friendship is magic. That's ridiculous. You can't turn people into frogs with friendship."; + case 154: + return "I can see your future now... You will buy a lot of items from me!"; + case 155: + return "I once tried to bring an Angel Statue to life. It didn't do anything."; + case 156: + return "Thanks! It was just a matter of time before I ended up like the rest of the skeletons down here."; + case 157: + return "Hey, watch where you're going! I was over there a little while ago!"; + case 158: + return "Hold on, I've almost got wifi going down here."; + case 159: + return "But I was almost done putting blinking lights up here!"; + case 160: + return "DON'T MOVE. I DROPPED MY CONTACT."; + case 161: + return "All I want is for the switch to make the... What?!"; + case 162: + return "Oh, let me guess. Didn't buy enough wire. Idiot."; + case 163: + return "Just-could you just... Please? Ok? Ok. Ugh."; + case 164: + return "I don't appreciate the way you're looking at me. I am WORKING right now."; + case 165: + return string.Concat(new string[] + { + "Hey, ", + Main.player[Main.myPlayer].name, + ", did you just come from ", + text4, + "'s? Did he say anything about me by chance?" + }); + case 166: + return text2 + " keeps talking about pressing my pressure plate. I told him it was for stepping on."; + case 167: + return "Always buy more wire than you need!"; + case 168: + return "Did you make sure your device was plugged in?"; + case 169: + return "Oh, you know what this house needs? More blinking lights."; + case 170: + return "You can tell a Blood Moon is out when the sky turns red. There is something about it that causes monsters to swarm."; + case 171: + return "Hey, buddy, do you know where any deathweed is? Oh, no reason; just wondering, is all."; + case 172: + return "If you were to look up, you'd see that the moon is red right now."; + case 173: + return "You should stay indoors at night. It is very dangerous to be wandering around in the dark."; + case 174: + return "Greetings, " + Main.player[Main.myPlayer].name + ". Is there something I can help you with?"; + case 175: + return "I am here to give you advice on what to do next. It is recommended that you talk with me anytime you get stuck."; + case 176: + return "They say there is a person who will tell you how to survive in this land... oh wait. That's me."; + case 177: + return "You can use your pickaxe to dig through dirt, and your axe to chop down trees. Just place your cursor over the tile and click!"; + case 178: + return "If you want to survive, you will need to create weapons and shelter. Start by chopping down trees and gathering wood."; + case 179: + return "Press ESC to access your crafting menu. When you have enough wood, create a workbench. This will allow you to create more complicated things, as long as you are standing close to it."; + case 180: + return "You can build a shelter by placing wood or other blocks in the world. Don't forget to create and place walls."; + case 181: + return "Once you have a wooden sword, you might try to gather some gel from the slimes. Combine wood and gel to make a torch!"; + case 182: + return "To interact with backgrounds, use a hammer!"; + case 183: + return "You should do some mining to find metal ore. You can craft very useful things with it."; + case 184: + return "Now that you have some ore, you will need to turn it into a bar in order to make items with it. This requires a furnace!"; + case 185: + return "You can create a furnace out of torches, wood, and stone. Make sure you are standing near a work bench."; + case 186: + return "You will need an anvil to make most things out of metal bars."; + case 187: + return "Anvils can be crafted out of iron, or purchased from a merchant."; + case 188: + return "Underground are crystal hearts that can be used to increase your max life. You can smash them with a pickaxe."; + case 189: + return "If you gather 5 fallen stars, they can be combined to create an item that will increase your magic capacity."; + case 190: + return "Stars fall all over the world at night. They can be used for all sorts of usefull things. If you see one, be sure to grab it because they disappear after sunrise."; + case 191: + return "There are many different ways you can attract people to move in to our town. They will of course need a home to live in."; + case 192: + return "In order for a room to be considered a home, it needs to have a door, chair, table, and a light source. Make sure the house has walls as well."; + case 193: + return "Two people will not live in the same home. Also, if their home is destroyed, they will look for a new place to live."; + case 194: + return "You can use the housing interface to assign and view housing. Open your inventory and click the house icon."; + case 195: + return "If you want a merchant to move in, you will need to gather plenty of money. 50 silver coins should do the trick!"; + case 196: + return "For a nurse to move in, you might want to increase your maximum life."; + case 197: + return "If you had a gun, I bet an arms dealer might show up to sell you some ammo!"; + case 198: + return "You should prove yourself by defeating a strong monster. That will get the attention of a dryad."; + case 199: + return "Make sure to explore the dungeon thoroughly. There may be prisoners held deep within."; + case 200: + return "Perhaps the old man by the dungeon would like to join us now that his curse has been lifted."; + case 201: + return "Hang on to any bombs you might find. A demolitionist may want to have a look at them."; + case 202: + return "Are goblins really so different from us that we couldn't live together peacefully?"; + case 203: + return "I heard there was a powerfully wizard who lives in these parts. Make sure to keep an eye out for him next time you go underground."; + case 204: + return "If you combine lenses at a demon altar, you might be able to find a way to summon a powerful monster. You will want to wait until night before using it, though."; + case 205: + return "You can create worm bait with rotten chunks and vile powder. Make sure you are in a corrupt area before using it."; + case 206: + return "Demonic altars can usually be found in the corruption. You will need to be near them to craft some items."; + case 207: + return "You can make a grappling hook from a hook and 3 chains. Skeletons found deep underground usually carry hooks, and chains can be made from iron bars."; + case 208: + return "If you see a pot, be sure to smash it open. They contain all sorts of useful supplies."; + case 209: + return "There is treasure hidden all over the world. Some amazing things can be found deep underground!"; + case 210: + return "Smashing a shadow orb will sometimes cause a meteor to fall out of the sky. Shadow orbs can usually be found in the chasms around corrupt areas."; + case 211: + return "You should focus on gathering more heart crystals to increase your maximum life."; + case 212: + return "Your current equipment simply won't do. You need to make better armor."; + case 213: + return "I think you are ready for your first major battle. Gather some lenses from the eyeballs at night and take them to a demon altar."; + case 214: + return "You will want to increase your life before facing your next challenge. Fifteen hearts should be enough."; + case 215: + return "The ebonstone in the corruption can be purified using some powder from a dryad, or it can be destroyed with explosives."; + case 216: + return "Your next step should be to explore the corrupt chasms. Find and destroy any shadow orb you find."; + case 217: + return "There is a old dungeon not far from here. Now would be a good time to go check it out."; + case 218: + return "You should make an attempt to max out your available life. Try to gather twenty hearts."; + case 219: + return "There are many treasures to be discovered in the jungle, if you are willing to dig deep enough."; + case 220: + return "The underworld is made of a material called hellstone. It's perfect for making weapons and armor."; + case 221: + return "When you are ready to challenge the keeper of the underworld, you will have to make a living sacrifice. Everything you need for it can be found in the underworld."; + case 222: + return "Make sure to smash any demon altar you can find. Something good is bound to happen if you do!"; + case 223: + return "Souls can sometimes be gathered from fallen creatures in places of extreme light or dark."; + case 224: + return "Ho ho ho, and a bottle of... Egg Nog!"; + case 225: + return "Care to bake me some cookies?"; + case 226: + return "What? You thought I wasn't real?"; + case 227: + return "I managed to sew your face back on. Be more careful next time."; + case 228: + return "That's probably going to leave a scar."; + case 229: + return "All better. I don't want to see you jumping off anymore cliffs."; + case 230: + return "That didn't hurt too bad, now did it?"; + case 231: + return "As if living underground wasn't bad enough, jerks like you come in while I'm sleeping and steal my children."; + case 232: + return "Between you and me, " + text3 + " is the only one I trust. She is the only one here who hasn't tried to eat me or use me in a potion."; + case 233: + return "I tried to lick myself the other day to see what the big deal was, everything started glowing blue."; + case 234: + return "Everytime I see the color blue, it makes me depressed and lazy."; + case 235: + return "You haven't seen any pigs around here have you? My brother lost his leg to one."; + case 236: + return "Everyone in this town feels a bit off. I woke up to the clothier chewing on my foot last night."; + case 237: + return "I'll give you a discount on your wears if you can convince " + str4 + " to come over for a...sizing."; + case 238: + return "I feel like " + str4 + " is a bit misunderstood, he really is a fun guy."; + case 240: + return "I don't know the 'Truffle Shuffle,' so stop asking!"; + case 241: + return "There's been such a huge rumor that's being spread about me, 'If you can't beat him, eat him!'"; + case 242: + return "Oy, whatchu got in you jiminy fluffer?"; + case 243: + return "Should I become an air pirate? I've considered becoming an air pirate."; + case 244: + return "Be it what it would, a jetpack would suit you nicely!"; + case 245: + return "I'm feeling a bit peevish as of late, so enough with your palaver you ragamuffin!"; + case 246: + return "I'm mighty curious about that " + str6 + " fellow. By what manner of consumption does he maintain such locomotion?"; + case 247: + return "That captain fellow seems to me to be 'pretty well over the bay' if you know what mean!"; + case 248: + return "Show me some gears!"; + case 249: + return "I like your... gear. Does it come in brass?"; + case 250: + return "Once you enter hallowed land, you will see a rainbow in the sky. I can help you with painting that if you want."; + case 251: + return "Check out " + str5 + ". Now that's a girl who can paint the town red!"; + case 252: + return "I know the difference between turquoise and blue-green. But I won't tell you."; + case 253: + return "I'm all out of titanium white, so don't even ask."; + case 254: + return "Try swirly pink and purple, it works, I swear!"; + case 255: + return "No, no, no... There's TONS of different grays! Don't get me started..."; + case 256: + return "I hope it doesn't rain again until this paint dries. That would be a disaster!"; + case 257: + return "I bring you the richest colors in exchange for your riches!"; + case 258: + return "My dear, what you're wearing is much too drab. You absolutely must take a lesson in dyeing your tired attire!"; + case 259: + return "The only kind of wood I would bother dyeing is RICH Mahogany. Dyeing any other wood is such a waste."; + case 260: + return "You must do something about " + str7 + ". Everytime he comes over here, it takes me a week to get the smell off!"; + case 261: + return "Which doctor am I? The Witch Doctor am I."; + case 262: + return "The heart of magic is nature. The nature of hearts is magic."; + case 263: + return text + " may help heal your body, but I can make you embody healing."; + case 264: + return "Choose wisely, " + Main.player[Main.myPlayer].name + ", my commodities are volatile and my dark arts, mysterious."; + case 265: + return "We have to talk. It's... it's about parties."; + case 266: + return "I can't decide what I like more: parties, or after-parties."; + case 267: + return "We should set up a blinkroot party, and we should also set up an after-party."; + case 268: + return "Wow, " + Main.player[Main.myPlayer].name + ", meeting an adventurous man like you makes me want to party!"; + case 269: + return "Put up a disco ball and then I'll show you how to party."; + case 270: + return "I went to Sweden once, they party hard, why aren't you like that?"; + case 271: + return "My name's " + str5 + " but people call me party pooper. Yeah I don't know, it sounds cool though"; + case 272: + return "Do you party? Sometimes? Hm, okay then we can talk..."; + case 273: + return "I'm no landlubber, but it's better to have lubbed and lost than never to have lubbed at all."; + case 274: + return "Yo ho ho and a bottle of....blinkroots!"; + case 275: + return "YAR! Funny ye should be mentionin' parrots b'cause...um...What t'were we talkin' 'bout?"; + case 276: + return Main.player[Main.myPlayer].name + ", Ye be one o' the finest lookin' lassies this here captain's seen in many a fortnight!"; + case 277: + return "Stay off me booty, ya scallywag!"; + case 278: + return "What in blazes are ye talkin' about? Moby Dick is mine!"; + case 279: + return "*Yarr Blarr Harrdarr*"; + case 280: + return "And then Unit 492-8 said, 'Who do you think I am, Unit 472-6?' HA. HA. HA."; + case 281: + return "My expedition efficiency was critically reduced when a projectile impacted my locomotive actuator."; + case 282: + return "This sentence is false , or is it?"; + case 283: + return "So that 'punk' lookin' chick is an inventor, eh? I think I could show her a thing or two!"; + case 284: + return "Sure, me and " + str7 + " are pals, but I hate it when his parrot does his business on me. That stuff's corrosive!"; + case 285: + return "I built myself a taste mechanism, so I can drink some ale!"; + case 286: + return "Sometimes I come off a bit... Get it? a bit?"; + } + } + else + { + if (Lang.lang == 2) + { + switch (l) + { + case 1: + return "Ich hoffe, du duennes Hemd bist nicht das Einzige, was zwischen Chtulus Auge und uns steht."; + case 2: + return "Was fuer eine schaebige Ruestung du traegst. Kaufe lieber ein paar Heiltraenke."; + case 3: + return "Ich habe das Gefuehl, dass mich eine boese Kraft beobachtet."; + case 4: + return "Schwert schlaegt Papier! Hol dir noch heute eins."; + case 5: + return "Du moechtest Aepfel? Du willst Karotten? Ananas? Wir haben Fackeln."; + case 6: + return "Ein schoener Morgen, nicht wahr? War da noch was, was du brauchst?"; + case 7: + return "Die Nacht wird bald hereinbrechen. Entscheide dich, solange du kannst."; + case 8: + return "Du hast keine Ahnung, wie gut sich Dreckbloecke nach Uebersee verkaufen."; + case 9: + return "Ach, eines Tages werden sie Geschichten ueber" + Main.player[Main.myPlayer].name + " erzaehlen ... sicher gute"; + case 10: + return "Schau dir mal meine Schmutzbloecke an; die sind wirklich super-dreckig."; + case 11: + return "Junge, Junge, wie die Sonne brennt! Ich hab da eine tolle klimatisierte Ruestung."; + case 12: + return "Die Sonne steht zwar hoch, meine Preise sind's aber nicht."; + case 13: + return string.Concat(new string[] + { + "Toll. Ich kann ", + text5, + " und ", + text, + " von hier aus diskutieren hoeren." + }); + case 14: + return "Hast du Chith ... Shith.. Chat... Das grosse Auge gesehen?"; + case 15: + return "Heh, dieses Haus ist doch wohl sicher? Oder? " + Main.player[Main.myPlayer].name + "?"; + case 16: + return "Nicht mal ein Blutmond kann den Kapitalismus stoppen. Lass uns also Geschaefte machen."; + case 17: + return "Achte auf den Preis, kaufe eine Linse!"; + case 18: + return "Kosh, kapleck Mog. Oha, sorry. Das ist klingonisch fuer: Kauf oder stirb!"; + case 19: + return Main.player[Main.myPlayer].name + " ist es? Ich habe nur Gutes ueber dich gehoert!"; + case 20: + return "Ich hoerte, es gibt einen geheimen Schatz ... oh, vergiss es!"; + case 21: + return "Engelsstatue, sagst du? Tut mir Leid, ich bin kein Nippesverkaeufer."; + case 22: + return "Der letzte Typ, der hier war, hinterliess mir einigen Nippes, aeh, ... Schaetze!"; + case 23: + return "Ich frage mich, ob der Mond aus Kaese ist ... huch, was? Oh, ja, kauf etwas!"; + case 24: + return "Hast du Gold gesagt? Ich nehm dir das ab."; + case 25: + return "Blute mich bloss nicht voll!"; + case 26: + return "Mach schon und hoer mit dem Bluten auf!"; + case 27: + return "Wenn du stirbst, dann bitte draussen."; + case 28: + return "Was soll das heissen?!"; + case 29: + return "Irgendwie gefaellt mir dein Ton nicht."; + case 30: + return "Warum bist du ueberhaupt hier? Wenn du nicht blutest, gehoerst du nicht her. Raus jetzt!"; + case 31: + return "WAS?!"; + case 32: + return "Hast du den Greis um den Dungeon schreiten sehen? Der scheint Probleme zu haben."; + case 33: + return "Ich wuenschte, " + str2 + " waere vorsichtiger. Es nervt mich, taeglich seine Glieder zusammennaehen zu muessen."; + case 34: + return "Heh, hat " + text2 + " den Grund fuer einen notwendigen Arztbesuch erwaehnt? Ich wundere mich nur."; + case 35: + return "Ich muss mal ein ernsthaftes Wort mit " + str3 + " reden. Wie oft kann man in einer Woche mit schweren Lava-Verbrennungen hereinkommen?"; + case 36: + return "Ich finde, du siehst so besser aus."; + case 37: + return "Aehhh ... Was ist denn mit deinem Gesicht passiert?"; + case 38: + return "MEINE GUeTE! Ich bin gut, aber ich bin nicht SO gut."; + case 39: + return "Liebe Freunde, wir sind zusammengekommen, um Aufwiedersehen zu sagen ... Ach, es wird schon werden."; + case 40: + return "Du hast deinen Arm da drueben gelassen. Lass ihn mich holen ..."; + case 41: + return "Hoer schon auf, wie ein Baby zu plaerren! Ich habe Schlimmeres gesehen."; + case 42: + return "Das geht nicht ohne ein paar Stiche!"; + case 43: + return "Schon wieder Aerger mit diesen Rabauken?"; + case 44: + return "Halt aus. Ich hab hier irgendwo ein paar huebsch bedruckte Pflaster."; + case 45: + return "Hoer schon auf, " + Main.player[Main.myPlayer].name + ", du ueberstehst das schon. Mist."; + case 46: + return "Tut es weh, wenn ich das mache? Tu das nicht."; + case 47: + return "Du siehst halb verdaut aus. Hast du schon wieder Schleimis gejagt?"; + case 48: + return "Drehe deinen Kopf und huste!"; + case 49: + return "Ich habe schon Schlimmeres gesehen ... ja, ganz sicher habe ich schon groessere Wunden gesehen."; + case 50: + return "Moechtest du einen Lollipop?"; + case 51: + return "Zeig mir, wo es schmerzt."; + case 52: + return "Tut mir Leid, aber du kannst mich dir gar nicht leisten."; + case 53: + return "Dafuer brauche ich mehr Gold."; + case 54: + return "Ich arbeite schliesslich nicht umsonst."; + case 55: + return "Ich verschenke keine Happy-Ends."; + case 56: + return "Ich kann nicht mehr fuer dich tun ohne Schoenheitsoperation."; + case 57: + return "Verschwende meine Zeit nicht laenger!"; + case 58: + return "Ich habe gehoert, es gibt eine Puppe in der Unterwelt, die " + str3 + " sehr aehnlich sieht. Ich wuerde gern ein bisschen schiessen."; + case 59: + return "Mach schnell! Ich habe in einer Stunde ein Date mit " + text + "."; + case 60: + return "Ich moechte das, was " + text + " verkauft. Was heisst, sie verkauft nichts?"; + case 61: + return text3 + " ist ein Huebscher. Zu dumm, dass sie so pruede ist."; + case 62: + return "Halte dich nicht mit " + str2 + " auf, ich habe alles, was du brauchst hier."; + case 63: + return "Was ist eigentlich mit " + str2 + " los? Kriegt der mal mit, dass wir ganz andere Sachen verkaufen?"; + case 64: + return "Das ist eine gute Nacht, um mit niemandem zu sprechen, denkst du nicht, " + Main.player[Main.myPlayer].name + "?"; + case 65: + return "Ich liebe Naechte wie diese. Es gibt immer genug zu toeten!"; + case 66: + return "Wie ich sehe, starrst du den Minihai an ... Du solltest lieber nicht fragen, wie der entstand."; + case 67: + return "Moment, das ist kein Film, Freundchen. Munition geht extra."; + case 68: + return "Haende weg von meinem Gewehr, Kumpel!"; + case 69: + return "Hast du versucht, das Reinigungspulver auf dem Ebenstein des Verderbens auszuprobieren?"; + case 70: + return "Ich wuenschte, " + text2 + " wuerde die Flirterei lassen. Versteht er nicht, dass ich 500 Jahre alt bin?"; + case 71: + return "Warum versucht " + str + " , mir Engelsstatuen zu verkaufen? Jeder weiss, dass sie nutzlos sind."; + case 72: + return "Hast du den Greis um den Dungeon herumgehen sehen? Der sieht gar nicht gut aus ..."; + case 73: + return "Ich verkaufe, was ich will! Dein Pech, wenn du es nicht magst."; + case 74: + return "Warum bist du in einer Zeit wie dieser so aggressiv?"; + case 75: + return "Ich moechte nicht, dass du meine Sachen kaufst, sondern dass du dir wuenschst, sie zu kaufen."; + case 76: + return "Kommt es mir nur so vor oder sind heute Nacht eine Million Zombies draussen?"; + case 77: + return "Du musst die Welt von diesem Verderben befreien."; + case 78: + return "Verlass dich darauf, Terraria braucht dich!"; + case 79: + return "Der Zahn der Zeit nagt und du alterst nicht gerade wuerdevoll."; + case 80: + return "Was soll das heissen: Ich belle mehr als ich beisse?"; + case 81: + return "Zwei Goblins kommen in einen Stoffladen. Sagt der eine zum anderen: Sitzt du gerne auf Gobelin?"; + case 82: + return "Ich kann dich nicht hineinlassen, bevor du mich von meinem Fluch befreit hast."; + case 83: + return "Komm in der Nacht wieder, wenn du hinein willst."; + case 84: + return "Mein Meister kann nicht bei Tageslicht herbeigerufen werden."; + case 85: + return "Du bist viel zu schwach, um meinen Fluch zu brechen. Komm wieder, wenn du was aus dir gemacht hast."; + case 86: + return "Du armseliger Wicht. So kannst du meinem Meister nicht gegenuebertreten."; + case 87: + return "Ich hoffe, du hast mindestens sechs Freunde, die hinter dir stehen."; + case 88: + return "Bitte nicht, Fremdling. Du bringst dich nur selbst um."; + case 89: + return "Du koenntest tatsaechlich stark genug sein, um meinen Fluch aufzuheben ..."; + case 90: + return "Fremdling, hast du die Kraft, meinen Meister zu besiegen?"; + case 91: + return "Bitte! Bezwinge meinen Kerkermeister und befreie mich! Ich flehe dich an!"; + case 92: + return "Besiege meinen Meister und ich gewaehre dir den Zutritt in den Dungeon."; + case 93: + return "Du versuchst, den Ebenstein in den Griff zu kriegen? Warum fuehrst du ihn nicht mit diesen Explosiva zusammen?"; + case 94: + return "Heh, hast du hier in der Gegend einen Clown gesehen?"; + case 95: + return "Genau hier war doch eine Bombe und jetzt kann ich sie nicht finden ..."; + case 96: + return "Ich habe etwas fuer diese Zombies!"; + case 97: + return "Sogar " + text2 + " ist scharf auf meine Waren!"; + case 98: + return "Haettest du lieber das Einschussloch eines Gewehrs oder einer Granate? Das dachte ich mir."; + case 99: + return "Ich bin sicher, dass " + text + " dir helfen wird, wenn du versehentlich ein Glied verlierst."; + case 100: + return "Warum willst du die Welt reinigen, wenn du sie einfach in die Luft jagen kannst?"; + case 101: + return "Wenn du das hier in die Badewanne schmeisst und alle Fenster schliesst, durchpustet es deine Nasenhoehlen und dir fliegen die Ohren weg!"; + case 102: + return "Moechtest du mal Grillhaehnchen spielen?"; + case 103: + return "Koenntest du hier unterschreiben, dass du nicht jammern wirst?"; + case 104: + return "RAUCHEN IST HIER NICHT ERLAUBT!!"; + case 105: + return "Explosiva sind zur Zeit der Knaller. Kaufe dir jetzt welche!"; + case 106: + return "Ein schoener Tag, um zu sterben!"; + case 107: + return "Ich frage mich, was passiert, wenn ich ... (BUMM!) ... Oha, sorry, brauchtest du dieses Bein noch?"; + case 108: + return "Dynamit, mein ganz spezielles Heilmittelchen - fuer alles, was schmerzt."; + case 109: + return "Schau dir meine Waren an - mit hochexplosiven Preisen!"; + case 110: + return "Ich erinnere mich vage an eine Frau, die ich fesselte und in den Dungeon warf."; + case 111: + return "... wir haben ein Problem! Es ist Blutmond!"; + case 112: + return "Wenn ich juenger waere, wuerde ich mit " + text + " ausgehen wollen. Ich war mal ein Womanizer."; + case 113: + return "Dein roter Hut kommt mir bekannt vor ..."; + case 114: + return "Danke nochmals, dass du mich vom Fluch befreit hast. Es fuehlte sich an, als wenn mich etwas angesprungen und gebissen hat."; + case 115: + return "Mama sagte immer, dass ich einen guten Schneider abgeben wuerde."; + case 116: + return "Das Leben ist wie ein Kleiderschrank; du weisst nie, was du tragen wirst!"; + case 117: + return "Natuerlich ist die Stickerei schwierig! Wenn es nicht schwierig waere, wuerde es niemand machen! Das macht es so grossartig."; + case 118: + return "Ich weiss alles, was man ueber das Kleidergeschaeft wissen muss."; + case 119: + return "Das Leben mit dem Fluch war einsam, deshalb fertigte ich mir aus Leder einen Freund. Ich nannte ihn Wilson."; + case 120: + return "Danke fuer die Befreiung, Mensch. Ich wurde gefesselt und von den anderen Goblins hier zurueckgelassen. Man kann sagen, dass wir nicht besonders gut miteinander auskamen."; + case 121: + return "Ich kann nicht glauben, dass sie mich fesselten und hier liessen, nur um anzuzeigen, dass sie nicht nach Osten gehen."; + case 122: + return "Nun da ich zu den Verstossenen gehoere, darf ich doch meine Stachelkugeln wegwerfen? Es piekt durch die Taschen."; + case 123: + return "Suchst du einen Bastelexperten? Dann bin ich dein Goblin!"; + case 124: + return "Danke fuer deine Hilfe. Jetzt muss ich erst mal aufhoeren, hier ziellos herumzuschreiten. Wir begegnen uns sicher wieder."; + case 125: + return "Ich hielt dich fuer groesser."; + case 126: + return "Heh ... was macht " + text5 + " so? Hast du ... hast du vielleicht mit ihr gesprochen?"; + case 127: + return "Waer ein Motor fuer deinen Hut nicht schick? Ich glaube, ich habe einen Motor, der genau hineinpasst."; + case 128: + return "Ja, ich hab schon gehoert, dass du Raketen und Laufstiefel magst. Deshalb habe ich ein paar Raketen in deine Laufstiefel montiert."; + case 129: + return "Schweigen ist Gold. Klebeband ist Silber."; + case 130: + return "Ja! Gold ist staerker als Eisen. Was bringt man den Menschen heutzutage eigentlich bei?"; + case 131: + return "Diese Helm-Flossen-Kombination sah auf dem Papier viel besser aus."; + case 132: + return "Goblins kann man erstaunlich leicht auf die Palme bringen. Die wuerden sogar wegen Kleidern einen Krieg anfangen."; + case 133: + return "Um die Wahrheit zu sagen, Goblins sind nicht gerade Genies oder Astroforscher. Aber einige schon."; + case 134: + return "Weisst du eigentlich, warum wir alle diese Stachelkugeln mit uns herumtragen? Ich weiss es jedenfalls nicht."; + case 135: + return "Meine neuste Erfindung ist fertig! Diese Version explodiert nicht, wenn du sie heftig anhauchst."; + case 136: + return "Goblin-Diebe sind nicht besonders gut in ihrem Job. Sie koennen nicht mal aus einer unverschlossenen Truhe klauen."; + case 137: + return "Danke fuer die Rettung, mein Freund! Die Fesseln fingen an, zu scheuern."; + case 138: + return "Oh, mein Held!"; + case 139: + return "Oh, wie heroisch! Danke fuer die Rettung, Lady!"; + case 140: + return "Oh, wie heroisch! Danke fuer die Rettung, mein Herr!"; + case 141: + return "Nun da wir uns kennen, kann ich doch bei dir einziehen?"; + case 142: + return "Hallo, " + str3 + "! Was kann ich heute fuer dich tun?"; + case 143: + return "Hallo, " + str2 + "! Was kann ich heute fuer dich tun?"; + case 144: + return "Hallo, " + text4 + "! Was kann ich heute fuer dich tun?"; + case 145: + return "Hallo, " + text + "! Was kann ich heute fuer dich tun?"; + case 146: + return "Hallo, " + text5 + "! Was kann ich heute fuer dich tun?"; + case 147: + return "Hallo, " + text3 + "! Was kann ich heute fuer dich tun?"; + case 148: + return "Moechtest du, dass ich eine Muenze hinter deinem Ohr hervorziehe? Nein? Gut."; + case 149: + return "Moechtest du vielleicht magische Suessigkeiten? Nein? Gut."; + case 150: + return "Ich braue eine heisse Zauber-Schokolade, wenn du inter ... Nein? Gut."; + case 151: + return "Bist du hier, um einen Blick in meine Kristallkugel zu werfen?"; + case 152: + return "Hast du dir je einen verzauberten Ring gewuenscht, der Steine in Schleimis verwandelt? Ich auch nicht."; + case 153: + return "Jemand sagte mir mal, Freundschaft sei magisch. Das ist laecherlich. Du kannst mit Freundschaft nicht Menschen in Froesche verwandeln."; + case 154: + return "Jetzt kann ich deine Zukunft sehen ... Du wirst mir eine Menge Items abkaufen!"; + case 155: + return "Ich habe mal versucht, eine Engelsstatue zu beleben. Hat ueberhaupt nichts gebracht!"; + case 156: + return "Danke! Es waere nur eine Frage Zeit gewesen, bis aus mir eines der Skelette hier geworden waere."; + case 157: + return "Pass auf, wo du hingehst! Ich war vor einer Weile dort drueben."; + case 158: + return "Warte, ich habe es fast geschafft, hier unten Wifi zu installieren."; + case 159: + return "Aber ich habe es fast geschafft, hier oben blinkende Lichter anzubringen."; + case 160: + return "BEWEGE DICH NICHT. ICH HABE MEINE KONTAKTLINSE VERLOREN."; + case 161: + return "Ich moechte nur den Schalter ... Was?!"; + case 162: + return "Oh, lass mich raten. Nicht genuegend Kabel gekauft, Idiot."; + case 163: + return "Koenntest du vielleicht ... bitte? Ja? Gut. Uff!"; + case 164: + return "Mir gefaellt nicht, wie du mich anschaust. Ich ARBEITE gerade."; + case 165: + return string.Concat(new string[] + { + "Sag, ", + Main.player[Main.myPlayer].name, + ", kommst du gerade von ", + text4, + "? Hat er vielleicht etwas ueber mich gesagt?" + }); + case 166: + return text2 + " spricht immer davon, auf meine Druckplatten zu druecken. Ich habe ihm gesagt, die ist zum Drauftreten."; + case 167: + return "Kaufe immer etwas mehr Kabel als benoetigt!"; + case 168: + return "Hast du dich vergewissert, dass dein Geraet angeschlossen ist?"; + case 169: + return "Oh, weisst du was dieses Haus noch braucht? Mehr blinkende Lichter."; + case 170: + return "Du erkennst den Blutmond an der Rotfaerbung des Himmels. Irgendetwas daran laesst Monster ausschwaermen."; + case 171: + return "Weisst du vielleicht, wo Todeskraut ist? Nein, es hat keinen Grund. Ich frag mich das bloss."; + case 172: + return "Wenn du mal hochschauen wuerdest, wuerdest du bemerken, dass der Mond rot ist."; + case 173: + return "Du solltest in der Nacht drinnen bleiben. Es ist sehr gefaehrlich, in der Dunkelheit umherzustreifen."; + case 174: + return "Sei gegruesst, " + Main.player[Main.myPlayer].name + ". Gibt es etwas, das ich fuer dich tun kann?"; + case 175: + return "Ich bin hier, um dir zu raten, was du als Naechstes tust. Du solltest immer zu mir kommen, wenn du feststeckst."; + case 176: + return "Man sagt, es gibt jemanden, der dir erklaert, wie man in diesem Land ueberlebt ... oh, Moment. Das bin ja ich."; + case 177: + return "Du kannst deine Spitzhacke zum Graben im Dreck verwenden und deine Axt zum Holz faellen. Bewege einfach deinen Zeiger ueber das Feld und klicke!"; + case 178: + return "Wenn du ueberleben willst, musst du Waffen und Zufluchten bauen. Faelle dazu Baeume und sammele das Holz."; + case 179: + return "Druecke ESC zum Aufrufen des Handwerksmenues. Wenn du genuegend Holz hast, stelle eine Werkbank zusammen. Damit kannst du komplexere Sachen herstellen, solange du nahe genug bei ihr stehst. "; + case 180: + return "Du kannst durch Platzieren von Holz oder anderen Bloecken in der Welt eine Zuflucht bauen. Vergiss dabei nicht, auch Waende zu bauen und aufzustellen."; + case 181: + return "Wenn du einmal ein Holzschwert hast, kannst du versuchen, etwas Glibber von den Schleimis zu sammeln. Kombiniere Holz und Glibber zur Herstellung einer Fackel."; + case 182: + return "Zum Interagieren mit Hintergruenden und platzierten Objekten verwende einen Hammer!"; + case 183: + return "Du solltest ein bisschen Bergbau betreiben, um Gold zu finden. Du kannst sehr nuetzliche Dinge damit herstellen."; + case 184: + return "Jetzt, da du etwas Gold hast, musst du es in einen Barren verwandeln, um damit Items zu erschaffen. Dazu brauchst du einen Hochofen!"; + case 185: + return "Du kannst einen Hochofen aus Fackeln, Holz und Steinen herstellen. Achte dabei darauf, dass du neben einer Werkbank stehst."; + case 186: + return "Zum Herstellen der meisten Sachen aus einem Metallbarren wirst du einen Amboss brauchen."; + case 187: + return "Ambosse koennen aus Eisen hergestellt oder von einem Haendler gekauft werden."; + case 188: + return "Unterirdisch finden sich Kristallherzen, die verwendet werden koennen, um deine maximale Lebensspanne zu erhoehen. Um sie zu erhalten, benoetigst du einen Hammer."; + case 189: + return "Wenn du 10 Sternschnuppen gesammelt hast, koennen sie zur Herstellung eines Items kombiniert werden. Dieses Item erhoeht deine magische Faehigkeit."; + case 190: + return "Sterne fallen nachts auf der ganzen Welt herunter. Sie koennen fuer alle moeglichen nuetzlichen Dinge verwendet werden. Wenn du einen erspaeht hast, dann greif ihn dir schnell - sie verschwinden nach Sonnenaufgang."; + case 191: + return "Es gibt viele Moeglichkeiten, wie du Menschen dazu bewegen kannst, in unsere Stadt zu ziehen. Sie brauchen zuallererst ein Zuhause."; + case 192: + return "Damit ein Raum wie ein Heim wirkt, braucht es eine Tuer, einen Stuhl, einen Tisch und eine Lichtquelle. Achte darauf, dass das Haus auch Waende hat."; + case 193: + return "Zwei Menschen werden nicht im selben Haus leben wollen. Ausserdem brauchen sie ein neues Zuhause, wenn ihr Heim zerstoert wurde."; + case 194: + return "Du kannst das Behausungsinterface verwenden, um ein Haus zuzuweisen und anzuschauen. Oeffne dein Inventar und klicke auf das Haus-Symbol."; + case 195: + return "Wenn du willst, dass ein Haendler einzieht, brauchst du eine Menge Geld. 50 Silbermuenzen sollten aber reichen."; + case 196: + return "Damit eine Krankenschwester einzieht, solltest du deine maximale Lebensspanne erhoehen."; + case 197: + return "Wenn du ein Gewehr hast, sollte ein Waffenhaendler auftauchen, um dir Munition zu verkaufen."; + case 198: + return "Du solltest dich selbst testen, indem du ein starkes Monster besiegst. Das wird die Aufmerksamkeit eines Dryaden erregen."; + case 199: + return "Erforsche den Dungeon wirklich sorgfaeltig. Tief unten koennte sich ein Gefangener befinden."; + case 200: + return "Vielleicht hat der Greis vom Dungeon Lust, bei uns mitzumachen - jetzt da sein Fluch aufgehoben wurde."; + case 201: + return "Behalte alle Bomben, die du findest. Ein Sprengmeister moechte vielleicht einen Blick darauf werfen."; + case 202: + return "Sind Goblins wirklich so anders als wir, dass wir nicht in Frieden zusammenleben koennen?"; + case 203: + return "Ich hoerte, dass ein maechtiger Zauberer in diesen Gebieten lebt. Achte bei deiner naechsten unterirdischen Expedition auf ihn."; + case 204: + return "Wenn du Linsen an einem Daemonenaltar kombinieren moechtest, solltest du einen Weg finden koennen, ein maechtiges Monster herbeizurufen. Du solltest jedoch bis zur Nacht warten, bevor du es verwendest."; + case 205: + return "Du kannst einen Wurmkoeder mit Verfaultem und Ekelpulver erzeugen. Achte aber darauf, dass du dich vor der Verwendung in einem verderbten Gebiet befindest."; + case 206: + return "Daemonenaltaere sind gewoehnlich im Verderben zu finden. Du musst aber nahe bei ihnen stehen, um Items herstellen zu koennen."; + case 207: + return "Du kannst einen Enterhaken aus einem Haken und 3 Ketten herstellen. Die Skelette tief unter der Erde tragen gewoehnlich Haken bei sich. Die Ketten dazu koennen aus Eisenbarren gefertigt werden."; + case 208: + return "Wenn du einen Topf siehst, so schlage ihn auf. Toepfe enthalten alle moeglichen Sorten von nuetzlichem Zubehoer."; + case 209: + return "Verborgene Schaetze sind auf der ganzen Welt zu finden! Einige erstaunliche Dinge sind auch tief unter der Erde aufzuspueren!"; + case 210: + return "Beim Zerschlagen einer Schattenkugel faellt mitunter ein Meteor vom Himmel. Schattenkugeln koennen normalerweise in den Schluchten bei verderbten Gebieten gefunden werden."; + case 211: + return "Du solltest dich darauf konzentrieren, mehr Kristallherzen zur Erhoehung deiner maximalen Lebensspanne zu sammeln."; + case 212: + return "Deine jetzige Ausruestung wird einfach nicht ausreichen. Du musst eine bessere Ruestung fertigen."; + case 213: + return "Ich denke, du bist bereit fuer deinen ersten grossen Kampf. Sammele in der Nacht ein paar Linsen von den Augaepfeln und bringe sie zum Daemonenaltar."; + case 214: + return "Du solltest dein Leben verlaengern, bevor du die naechste Herausforderung annimmst. 15 Herzen sollten ausreichen."; + case 215: + return "Der Ebenstein im Verderben kann durch Verwendung von etwas Pulver des Dryaden gereinigt werden oder er kann durch Explosiva zerstoert werden."; + case 216: + return "Dein naechster Schritt ist, die verderbten Schluchten zu untersuchen. Suche nach Schattenkugeln und zerstoere sie!"; + case 217: + return "Nicht weit von hier gibt es einen alten Dungeon. Jetzt waere ein guter Zeitpunkt, um ihn zu untersuchen."; + case 218: + return "Du solltest versuchen, deine Lebensspanne auf das Maximum anzuheben. Versuche, 20 Herzen zu finden."; + case 219: + return "Im Dschungel lassen sich viele Schaetze finden, wenn du bereit bist, tief genug zu graben."; + case 220: + return "Die Unterwelt entstand aus einem Material, welches sich Hoellenstein nennt. Es ist perfekt geeignet fuer die Produktion von Waffen und Ruestungen."; + case 221: + return "Wenn du bereit bist, den Waechter der Unterwelt herauszufordern, musst du ein Opfer bringen. Alles was du brauchst, findest du in der Unterwelt."; + case 222: + return "Zerschlage jeden Daemonenaltar, den du findest. Etwas Gutes wird sich ereignen!"; + case 223: + return "Seelen koennen manchmal von gefallenen Kreaturen an Orten extremen Lichts oder Finsternis aufgesammelt werden."; + case 224: + return "Ho ho ho, und eine Flasche ... Egg Nog!"; + case 225: + return "Pflege zu backen mir ein paar Kekse?"; + case 226: + return "Was? Sie dachte, ich wäre nicht real?"; + case 227: + return "Es gelang mir, dein Gesicht wieder annähen. Vorsichtiger sein beim nächsten Mal."; + case 228: + return "Das ist wahrscheinlich eine Narbe hinterlassen."; + case 229: + return "Alle besser. Ich will nicht, dass du springen mehr Klippen."; + case 230: + return "Das tat nicht weh zu schlecht, jetzt hat es getan?"; + case 231: + return "Als ob im Untergrund leben nicht schon schlimm genug, wie Sie in Zuckungen, während ich schlafe kommen und stehlen meine Kinder."; + case 232: + return "Zwischen Ihnen und mir, " + text3 + " ist der einzige, der ich vertraue. Sie ist die einzige hier, die nicht versucht hat, mich zu essen oder benutzen Sie mich in einem Trank."; + case 233: + return "Ich versuchte, mich lecken den anderen Tag zu sehen, was die große Sache war, begann alles leuchtend blaue."; + case 234: + return "Jedesmal, wenn ich die Farbe Blau sehen, es macht mich depressiv und faul."; + case 235: + return "Sie haben nicht gesehen, alle Schweine hier haben Sie? Mein Bruder verlor sein Bein zu eins."; + case 236: + return "Jeder in dieser Stadt fühlt sich ein bisschen aus. Ich wachte auf der Tuchmacher Kauen auf meinen Fuß letzte Nacht."; + case 237: + return "Ich gebe Ihnen einen Rabatt auf Ihre trägt, wenn Sie " + str4 + " überzeugen können, zu kommen für eine ... Sizing."; + case 238: + return "Ich fühle mich wie " + str4 + " ein wenig missverstanden wird, er ist wirklich ein lustiger Kerl."; + case 240: + return "Ich weiß nicht, die Truffle Shuffle, so aufhören zu fragen!"; + case 241: + return "Es ist schon so ein großes Gerücht, das über mich verbreitet ist: 'Wenn du sie nicht schlagen ihn, ihn essen!'"; + case 242: + return "Oy, was Sie in Ihrem jiminy fluffer haben?"; + case 243: + return "Sollte ich eine Luft Pirat zu werden? Ich habe als zu einem Luft-Pirat."; + case 244: + return "Sei es, wie es wäre, ein Jetpack würden Sie gut zu entsprechen!"; + case 245: + return "Ich fühle mich ein bisschen ärgerlich wie der spät, so genug mit Ihren Palaver Sie Lump!"; + case 246: + return "Ich bin mächtig neugierig auf dieser " + str6 + " Kerl. Durch welche Art und Weise der Verbrauch hat er beibehalten, wie Fortbewegung?"; + case 247: + return "Dass Kapitän Kerl scheint mir zu ziemlich gut über die Bucht 'sein, wenn Sie, was bedeuten wissen!"; + case 248: + return "Zeigen Sie mir ein paar Gänge!"; + case 249: + return "Ich mag deine ... Gang. Ist es in Messing kommen?"; + case 250: + return "Sobald Sie geheiligten Land zu betreten, sehen Sie einen Regenbogen in den Himmel. Ich kann Ihnen mit der Malerei, dass, wenn Sie wollen helfen."; + case 251: + return "Schauen Sie sich " + str5 + ". Nun, das ist ein Mädchen, das die Stadt rot malen kann!"; + case 252: + return "Ich kenne den Unterschied zwischen türkis und blau-grün. Aber ich werde Ihnen nicht sagen."; + case 253: + return "Ich bin ganz aus Titan weiß, also nicht einmal fragen."; + case 254: + return "Versuchen swirly rosa und lila, es funktioniert, ich schwöre!"; + case 255: + return "Nein, nein, nein ... Es gibt Unmengen an verschiedenen Grautönen! Verstehen Sie mich nicht begonnen ..."; + case 256: + return "Ich hoffe, dass es nicht wieder zu regnen, bis diese Farbe trocknet. Das wäre eine Katastrophe!"; + case 257: + return "Ich bringe euch die reichsten Farben im Austausch für Ihr Reichtum!"; + case 258: + return "Mein Lieber, was du trägst ist viel zu eintönig. Sie müssen unbedingt eine Lektion in Färben Sie Ihre müden Kleidung zu nehmen!"; + case 259: + return "Die einzige Art von Holz I Färben stören würde, ist Mahagoni. Färben andere Holz ist so eine Verschwendung. "; + case 260: + return "Sie müssen etwas über " + str7 + " zu tun. Jedes Mal, wenn er kommt hierher, dauert es mir eine Woche, um den Geruch zu steigen!"; + case 261: + return "Welcher Arzt bin ich? Der Witch Doctor ich bin."; + case 262: + return "Das Herz der Magie ist die Natur. Die Natur der Herzen ist Magie."; + case 263: + return text + " kann helfen, Ihren Körper zu heilen, aber ich kann Sie verkörpern Heilung."; + case 264: + return "Wählen Sie mit Bedacht, " + Main.player[Main.myPlayer].name + ", meine Rohstoffe sind volatil und meine dunklen Künste, geheimnisvoll."; + case 265: + return "Wir müssen reden. Es ist ... es geht um Parteien."; + case 266: + return "Ich kann mich nicht entscheiden, was ich mehr mag: Partys oder After-Partys."; + case 267: + return "Wir sollten ein blinkroot Partei, und wir sollten auch die Einrichtung eines nach der Party."; + case 268: + return "Wow, " + Main.player[Main.myPlayer].name + ", Treffen Sie eine abenteuerliche Mann wie Sie macht mich wollen Party!"; + case 269: + return "Biete eine Disco-Kugel und dann werde ich Ihnen zeigen, wie man feiert."; + case 270: + return "Ich ging nach Schweden einmal, sie Partei schwer, warum bist du nicht so?"; + case 271: + return "Mein Name ist " + str5 + " aber die Leute nennen mich Partei Popper. Ja, ich weiß es nicht, es klingt aber kühl"; + case 272: + return "Haben Sie Party? Manchmal? Hm, okay, dann können wir reden ..."; + case 273: + return "Ich bin kein Liebhaber Land, aber es ist besser, geliebt und verloren haben, als nie, überhaupt zu lieben."; + case 274: + return "Yo ho ho und eine Flasche... Blinkroots!"; + case 275: + return "YAR! Lustige sollten Sie erwähnen, Papageien, weil ... ähm ... Was haben wir hier reden?"; + case 276: + return Main.player[Main.myPlayer].name + ", Sie können eine der schönsten Blick lassies diese hier Kapitän in vielen vierzehn Tagen gesehen hat sein!"; + case 277: + return "Bleib weg von mir Beute, scallywag ye!"; + case 278: + return "Was zum Teufel redest du? Moby Dick ist mein!"; + case 279: + return "*Yarr Blarr Harrdarr*"; + case 280: + return "Und dann Einheit 492-8 sagte: Wer glaubst du denkst, ich bin, Referat 472-6? HA. HA. HA."; + case 281: + return "Meine Expedition Effizienz kritisch wurde reduziert, wenn ein Projektil beeinflusst meine Lok Antrieb."; + case 282: + return "Dieser Satz ist falsch, oder ist es?"; + case 283: + return "Damit 'punk' suchen Küken ein Erfinder ist, eh? Ich glaube, ich könnte ihr zeigen, eine Sache oder zwei!"; + case 284: + return "Sicher, mir und " + str7 + " sind Kumpels, aber ich hasse es, wenn seinem Papagei macht sein Geschäft auf mich. Das Zeug ist ätzend!"; + case 285: + return "Ich baute mir einen Vorgeschmack Mechanismus, so kann ich einige Bier trinken!"; + case 286: + return "Manchmal komme ich aus ein bisschen ... Holen Sie sich das? ein bisschen?"; + } + } + else + { + if (Lang.lang == 3) + { + switch (l) + { + case 1: + return "Spero che tra noi e l'Occhio di Cthulhu non ci sia solo un bimbo scarno come te."; + case 2: + return "Guarda la pessima armatura che indossi. Faresti meglio a comprare più pozioni curative."; + case 3: + return "Ho la sensazione che una presenza malvagia mi stia guardando."; + case 4: + return "Spada batte carta! Prendine una oggi."; + case 5: + return "Desideri mele? Carote? Ananas? Abbiamo delle fiaccole."; + case 6: + return "Bella mattina, no? C'era qualcosa di cui avevi bisogno?"; + case 7: + return "Presto si farà notte, amico. Fai le tue scelte finché puoi."; + case 8: + return "Non immagini quanti blocchi di terra si vendono oltreoceano."; + case 9: + return "Ah, racconteranno storie di " + Main.player[Main.myPlayer].name + " un giorno... belle storie ovviamente."; + case 10: + return "Guarda i miei blocchi di terra: sono super terrosi."; + case 11: + return "Ragazzo, quel sole scotta! Ho un'armatura perfettamente ventilata."; + case 12: + return "Il sole è alto, ma i miei prezzi no."; + case 13: + return string.Concat(new string[] + { + "Fantastico. Sento ", + text5, + " e ", + text, + " discutere da qui." + }); + case 14: + return "Hai visto Chith... Shith... Chat... Il grande occhio?"; + case 15: + return "Ehi, questa casa è sicura, no? Giusto? " + Main.player[Main.myPlayer].name + "?"; + case 16: + return "Nemmeno una luna di sangue può arrestare il capitalismo. Facciamo un po' di affari."; + case 17: + return "Tieni d'occhio il premio, compra una lente!"; + case 18: + return "Kosh, kapleck Mog. Oh scusa, in klingon significa 'Compra qualcosa o muori.'"; + case 19: + return "Sei, " + Main.player[Main.myPlayer].name + ", vero? Ho sentito belle cose su di te!"; + case 20: + return "Sento che c'è un tesoro segreto... non importa."; + case 21: + return "Una statua d'angelo, dici? Scusa, non tratto cianfrusaglie."; + case 22: + return "L'ultimo ragazzo venuto qui mi lasciò delle cianfrusaglie... o meglio... tesori!"; + case 23: + return "Mi chiedo se la luna sia fatta di formaggio... Uhm, cosa? Oh sì, compra qualcosa!"; + case 24: + return "Hai detto oro? Te lo tolgo io."; + case 25: + return "Niente sangue su di me."; + case 26: + return "Sbrigati e smettila di sanguinare."; + case 27: + return "Se stai per morire, fallo fuori."; + case 28: + return "Cosa vorresti insinuare?!"; + case 29: + return "Quel tuo tono non mi piace."; + case 30: + return "Che ci fai qui? Se non sanguini, non devi stare qui. Via."; + case 31: + return "COSA?!"; + case 32: + return "Hai visto il vecchio che gira intorno alla segreta? Sembra agitato."; + case 33: + return "Vorrei che " + str2 + " fosse più attento. Mi sto stancando di dovergli ricucire gli arti ogni giorno."; + case 34: + return "Ehi, " + text2 + " ha detto di dover andare dal dottore per qualche ragione? Solo per chiedere."; + case 35: + return "Devo parlare seriamente con " + str3 + ". Quante volte a settimana si può venire con gravi ustioni da lava?"; + case 36: + return "Penso che tu stia meglio così."; + case 37: + return "Ehm... Che ti è successo alla faccia?"; + case 38: + return "SANTO CIELO! Sono brava, ma non fino a questo punto."; + case 39: + return "Cari amici, siamo qui riuniti, oggi, per congedarci... Oh, ti riprenderai."; + case 40: + return "Hai lasciato il braccio laggiù. Te lo prendo io..."; + case 41: + return "Smettila di fare il bambino! Ho visto di peggio."; + case 42: + return "Serviranno dei punti!"; + case 43: + return "Di nuovo problemi con quei bulli?"; + case 44: + return "Aspetta, ho i cerotti con i cartoni animati da qualche parte."; + case 45: + return "Cammina, " + Main.player[Main.myPlayer].name + " starai bene. Fiuu."; + case 46: + return "Ti fa male quando lo fai? Non farlo."; + case 47: + return "Sembri mezzo digerito. Hai di nuovo inseguito gli slime?"; + case 48: + return "Gira la testa e tossisci."; + case 49: + return "Non è la più grande ferita che abbia mai visto... Ne ho viste certamente di più grandi."; + case 50: + return "Vuoi un lecca-lecca?"; + case 51: + return "Dimmi dove ti fa male."; + case 52: + return "Scusa, ma non puoi permetterti di avermi."; + case 53: + return "Avrò bisogno di più soldi."; + case 54: + return "Sai che non lavoro gratis."; + case 55: + return "Non faccio lieti fini."; + case 56: + return "Non posso fare più nulla per te senza chirurgia plastica."; + case 57: + return "Smettila di sprecare il mio tempo."; + case 58: + return "Ho sentito che c'è una bambola molto simile a " + str3 + " nel sottomondo. Vorrei metterci dei proiettili."; + case 59: + return "Veloce! Ho un appuntamento con " + text + " tra un'ora."; + case 60: + return "Voglio quello che vende " + text + ". In che senso, non vende niente?"; + case 61: + return text3 + " è uno spettacolo. Peccato sia così bigotta."; + case 62: + return "Lascia stare " + str2 + ", ho tutto ciò che ti serve qui."; + case 63: + return "Qual è il problema di " + str2 + "? Almeno lo sa che vendiamo oggetti diversi?"; + case 64: + return "Beh, è una bella notte per non parlare con nessuno, non credi, " + Main.player[Main.myPlayer].name + "?"; + case 65: + return "Mi piacciono le notti come questa. Non mancano mai cose da demolire!"; + case 66: + return "Vedo che stai addocchiando il Minishark... Meglio che non ti dica di cosa è fatto."; + case 67: + return "Ehi, non è un film, amico. Le munizioni sono extra."; + case 68: + return "Giù le mani dalla mia pistola, amico!"; + case 69: + return "Hai provato a usare la polvere purificatrice sulla pietra d'ebano della distruzione?"; + case 70: + return "Vorrei che " + text2 + " la smettesse di flirtare con me. Non sa che ho 500 anni?"; + case 71: + return "Perché " + str + " continua a vendermi statue d'angelo? Lo sanno tutti che non servono a nulla."; + case 72: + return "Hai visto il vecchio che gira intorno alla segreta? Non ha per niente un bell'aspetto..."; + case 73: + return "Vendo ciò che voglio! Se non ti piace, pazienza."; + case 74: + return "Perché devi essere così conflittuale in un momento come questo?"; + case 75: + return "Non voglio che tu compri la mia roba. Voglio che tu desideri comprarla, ok?"; + case 76: + return "Amico, sbaglio o ci sono tipo un milione di zombi in giro, stanotte?"; + case 77: + return "Devi purificare il mondo da questa empietà."; + case 78: + return "Sii cauto: Terraria ha bisogno di te!"; + case 79: + return "Il tempo vola e tu, ahimé, non stai invecchiando molto bene."; + case 80: + return "Cos'è questa storia di me che abbaio, ma non mordo?"; + case 81: + return "Due goblin entrano in un bar e uno dice all'altro: 'Vuoi un calice di birra?!' "; + case 82: + return "Non posso farti entrare finché non mi libererai dalla maledizione."; + case 83: + return "Torna di notte se vuoi entrare."; + case 84: + return "Il mio capo non può essere convocato di giorno."; + case 85: + return "Sei decisamente troppo debole per sconfiggere la mia maledizione. Torna quando sarai più forte."; + case 86: + return "Tu, pazzo patetico. Non puoi sperare di affrontare il mio padrone ora come ora."; + case 87: + return "Spero che tu abbia almeno sei amici dietro di te."; + case 88: + return "No, ti prego, straniero. Finirai per essere ucciso."; + case 89: + return "Potresti essere abbastanza forte da liberarmi dalla mia maledizione..."; + case 90: + return "Straniero, hai la forza per sconfiggere il mio padrone?"; + case 91: + return "Ti prego! Sconfiggi chi mi ha catturato e liberami, ti supplico!"; + case 92: + return "Sconfiggi il mio padrone e ti farò passare nella segreta."; + case 93: + return "Stai provando a superare quella pietra d'ebano, eh? Perché non metterci questi esplosivi!"; + case 94: + return "Ehi, hai visto un clown in giro?"; + case 95: + return "C'era una bomba qui e ora non riesco a trovarla..."; + case 96: + return "Ho qualcosa per quegli zombi, altroché!"; + case 97: + return "Persino " + text2 + " vuole ciò che sto vendendo!"; + case 98: + return "Preferisci avere un buco da proiettile o granata? Ecco ciò che pensavo."; + case 99: + return "Sono sicuro che " + text + " ti aiuterà se per caso perderai un arto."; + case 100: + return "Perché purificare il mondo quando potresti farlo saltare in aria?"; + case 101: + return "Se verserai questo nella vasca da bagno e chiuderai tutte le finestre, ti pulirà le cavità nasali e ti sturerà le orecchie."; + case 102: + return "Vuoi giocare a Esplodi-Pollo?"; + case 103: + return "Ehi, potresti firmare questa rinuncia al dolore?"; + case 104: + return "VIETATO FUMARE QUI DENTRO!!"; + case 105: + return "Gli esplosivi vanno a ruba di questi tempi. Comprane un po'!"; + case 106: + return "È un buon giorno per morire!"; + case 107: + return "Mi chiedo cosa succederà se io... (BUM!) ... Oh, scusa, ti serviva quella gamba?"; + case 108: + return "La dinamite, la mia cura speciale per tutto ciò che ti affligge."; + case 109: + return "Guarda i miei prodotti: hanno prezzi esplosivi!"; + case 110: + return "Continuo ad avere vaghi ricordi di aver legato una donna e averla gettata in una segreta."; + case 111: + return "... abbiamo un problema! C'è una luna di sangue là fuori!"; + case 112: + return "Fossi più giovane, chiederei a NURSE di uscire. Avevo un successone con le ragazze."; + case 113: + return "Quel tuo cappello rosso mi sembra familiare..."; + case 114: + return "Grazie ancora per avermi liberato dalla maledizione. Sentivo come qualcosa che saltava e mi mordeva."; + case 115: + return "Mia mamma mi diceva sempre che sarei stato un grande sarto."; + case 116: + return "La vita è come una scatola di vestiti; non sai mai ciò che indosserai!"; + case 117: + return "Ricamare è difficile! Se non fosse così, nessuno lo farebbe! È ciò che lo rende fantastico."; + case 118: + return "So tutto ciò che c'è da sapere riguardo alle attività di sartoria."; + case 119: + return "Nella maledizione ero solo, perciò una volta mi creai un amico di pelle. Lo chiamai Wilson."; + case 120: + return "Grazie per avermi liberato, umano. Sono stato legato e lasciato qui da altri goblin. Si potrebbe dire che non andavamo proprio d'accordo."; + case 121: + return "Non posso credere che mi hanno legato e lasciato qui soltanto per far notare che non andavano verso est!"; + case 122: + return "Ora che sono un escluso, posso buttar via le palle chiodate? Mi fanno male le tasche."; + case 123: + return "Cerchi un esperto di gadget? Sono il tuo goblin!"; + case 124: + return "Grazie per l'aiuto. Ora devo smetterla di gironzolare senza scopo qui attorno. Sono sicuro che ci incontreremo di nuovo."; + case 125: + return "Pensavo fossi più alto."; + case 126: + return "Ehi... cosa sta combinando " + text5 + "? Hai... hai parlato con lei, per caso?"; + case 127: + return "Ehi, il tuo cappello ha bisogno di un motore? Credo di averne uno perfettamente adatto."; + case 128: + return "Ciao, ho sentito che ti piacciono i razzi e gli stivali da corsa, così ho messo dei missili nei tuoi stivali."; + case 129: + return "Il silenzio è d'oro. Il nastro adesivo è d'argento."; + case 130: + return "SÌ, l'oro è più forte del ferro. Cosa insegnano al giorno d'oggi a questi umani?"; + case 131: + return "Sai, quella combinazione casco da minatore-pinne era un'idea molto migliore sulla carta."; + case 132: + return "I goblin si irritano molto facilmente. Potrebbero persino scatenare una guerra per i tessuti!"; + case 133: + return "A dire il vero, la maggior parte dei goblin non sono ingegneri aerospaziali. Beh, alcuni sì."; + case 134: + return "Sai perché noi tutti ci portiamo dietro queste palle chiodate? Perché io non lo faccio."; + case 135: + return "Ho appena finito la mia ultima creazione! Questa versione non esplode violentemente se ci si respira troppo forte sopra."; + case 136: + return "I ladri goblin non sono molto furbi. Non sanno nemmeno rubare da una cassa aperta!"; + case 137: + return "Grazie per avermi salvato, amico! Questi legacci iniziavano a irritarmi."; + case 138: + return "Ohh, mio eroe!"; + case 139: + return "Oh, eroica! Grazie per avermi salvato, ragazza!"; + case 140: + return "Oh, eroico! Grazie per avermi salvato, ragazzo!"; + case 141: + return "Ora che ci conosciamo, posso trasferirmi da te?"; + case 142: + return "Bene, ciao, " + str3 + "! Cosa posso fare per te oggi?"; + case 143: + return "Bene, ciao, " + str2 + "! Cosa posso fare per te oggi?"; + case 144: + return "Bene, ciao, " + text4 + "! Cosa posso fare per te oggi?"; + case 145: + return "Bene, ciao, " + text + "! Cosa posso fare per te oggi?"; + case 146: + return "Bene, ciao, " + text5 + "! Cosa posso fare per te oggi?"; + case 147: + return "Bene, ciao, " + text3 + "! Cosa posso fare per te oggi?"; + case 148: + return "Vuoi che tiri fuori una moneta da dietro il tuo orecchio? No? Ok."; + case 149: + return "Vuoi dei dolci magici? No? Ok."; + case 150: + return "Posso preparare una cioccalata calda proprio deliziosa se sei inter...No? Ok."; + case 151: + return "Sei qui per dare un'ochiata alla mia sfera di cristallo?"; + case 152: + return "Mai desiderato un anello incantato che trasforma le rocce in slime? Neanch'io."; + case 153: + return "Una volta qualcuno mi disse che l'amicizia è magica. Sciocchezze. Non puoi trasformare le persone in rane con l'amicizia."; + case 154: + return "Ora vedo il tuo futuro... Comprerai molti prodotti da me!"; + case 155: + return "Una volta ho provato a dare la vita a una statua d'angelo. Invano."; + case 156: + return "Grazie! Era solo questione di tempo prima che facessi la stessa fine degli scheletri laggiù."; + case 157: + return "Ehi, guarda dove stai andando! Ero laggiù un attimo fa!"; + case 158: + return "Resisti, sono quasi riuscita a portare fin qui il wifi."; + case 159: + return "Ma ero quasi riuscita a mettere luci intermettenti quassù!"; + case 160: + return "NON MUOVERTI. MI È CADUTA UNA LENTE A CONTATTO."; + case 161: + return "Tutto ciò che voglio è che l'interruttore faccia... Cosa?!"; + case 162: + return "Oh, fammi indovinare. Non hai comprato abbastanza filo metallico. Idiota."; + case 163: + return "Soltanto-potresti soltanto... Per favore? Ok? Ok. Puah."; + case 164: + return "Non apprezzo il modo in cui mi guardi. Sto LAVORANDO ora."; + case 165: + return string.Concat(new string[] + { + "Ehi, ", + Main.player[Main.myPlayer].name, + ", sei appena stato da ", + text4, + "? Ha detto qualcosa di me, per caso?" + }); + case 166: + return text2 + " continua a dire di aver schiacciato la mia piastra a pressione. Gli ho spiegato che serve proprio a quello."; + case 167: + return "Compra sempre più filo metallico di quello necessario!"; + case 168: + return "Ti sei assicurato che il tuo dispositivo fosse collegato?"; + case 169: + return "Oh, sai di cosa ha bisogno questa casa? Di più luci intermittenti."; + case 170: + return "Si può dire che appare una luna di sangue quando il cielo si fa rosso. C'è qualcosa in lei che ridesta i mostri."; + case 171: + return "Ehi, amico, sai dov'è un po' di erba della morte? Scusa, me lo stavo solo chiedendo, tutto qua."; + case 172: + return "Se dovessi alzare lo sguardo, vedresti che la luna è rossa ora."; + case 173: + return "Dovresti stare dentro di notte. Sai, è molto pericoloso girare al buio."; + case 174: + return "Saluti, " + Main.player[Main.myPlayer].name + ". Come posso esserti utile?"; + case 175: + return "Sono qui per darti consigli su cosa fare dopo. Ti consiglio di parlare con me ogni volta che sarai nei guai."; + case 176: + return "Si dice ci sia una persona che ti dirà come sopravvivere in questa terra... Aspetta. Sono io."; + case 177: + return "Puoi utilizzare il piccone per scavare nell'immondizia e l'ascia per abbattere gli alberi. Posiziona il cursore sulla mattonella e clicca!"; + case 178: + return "Se vuoi sopravvivere, dovrai creare armi e un riparo. Inizia abbattendo gli alberi e raccogliendo legna."; + case 179: + return "Clicca su ESC per accedere al menu artigianato. Quando avrai abbastanza legna, crea un banco di lavoro. Così potrai creare oggetti più sofisticati, finché sarai vicino ad esso."; + case 180: + return "Puoi costruirti un riparo con legna o altri blocchi nel mondo. Non dimenticare di creare e sistemare le pareti."; + case 181: + return "Una volta che possiederai una spada di legno, puoi provare a raccogliere gel dagli slime. Metti assieme legna e gel per creare una fiaccola!"; + case 182: + return "Per interagire con gli ambienti e gli oggetti posizionati, usa un martello!"; + case 183: + return "Devi praticare un po' di estrazione per trovare minerale metallico. Puoi crearci oggetti molto utili."; + case 184: + return "Ora che hai un po' di minerale, dovrai trasformarlo in una sbarra per poterci fare degli oggetti. Per questo serve un forno!"; + case 185: + return "Puoi creare una forno con fiaccole, legna e pietra. Assicurati di essere vicino a un banco di lavoro."; + case 186: + return "Avrai bisogno di un'incudine per creare la maggior parte degli oggetti dalle sbarre metalliche."; + case 187: + return "Le incudini possono essere create con del ferro o acquistate da un mercante."; + case 188: + return "Sottoterra vi sono cuori di cristallo che possono essere utilizzati per allungare la tua vita massima. Dovrai avere un martello per ottenerli."; + case 189: + return "Se raccoglierai 10 stelle cadenti, potrai combinarle per creare un oggetto che aumenterà le tue abilità magiche."; + case 190: + return "Le stelle cadono sul mondo di notte. Possono essere utilizzate per ogni tipo di oggetto utile. Se ne vedi una, cerca di afferrarla, poiché scomparirà dopo l'alba."; + case 191: + return "Ci sono diversi modi per convincere le persone a trasferirsi nella tua città. Di sicuro dovranno avere una casa in cui vivere."; + case 192: + return "Perché una stanza sia considerata una casa, ha bisogno di una porta, una sedia, un tavolo e una fonte luminosa. Assicurati che la casa abbia anche delle pareti."; + case 193: + return "Due persone non possono vivere nella stessa casa. Inoltre, se la loro casa verrà distrutta, cercheranno un nuovo posto in cui vivere."; + case 194: + return "Puoi utilizzare l'interfaccia abitazioni per visualizzare e assegnare gli alloggi. Apri l'inventario e clicca sull'icona della casa."; + case 195: + return "Se vuoi che un mercante si trasferisca, dovrai raccogliere molto denaro. Servono 50 monete d'argento!"; + case 196: + return "Se vuoi che un'infermiera si traferisca, dovrai essere intenzionato ad allungare la tua vita massima."; + case 197: + return "Se avessi una pistola, scommetto che potrebbe apparire un mercante d'armi per venderti munizioni!"; + case 198: + return "Dovresti metterti alla prova sconfiggendo un mostro forte. Così attirerai l'attenzione di una driade."; + case 199: + return "Esplora attentamente tutta la segreta. Potrebbero esserci prigionieri nelle zone più profonde."; + case 200: + return "Forse il vecchio della segreta vorrebbe unirsi a noi, ora che la maledizione è terminata."; + case 201: + return "Arraffa tutte le bombe che potresti trovare. Un esperto in demolizioni potrebbe volerci dare un'occhiata."; + case 202: + return "I goblin sono così diversi da noi che non possiamo convivere in maniera pacifica?"; + case 203: + return "Ho sentito che c'era un potente stregone da queste parti. Tienilo d'occhio la prossima volta che scenderai sottoterra."; + case 204: + return "Se combinerai le lenti a un altare demoniaco, potresti trovare un modo per chiamare un mostro potente. Ma aspetta che si faccia buio prima di utilizzarlo."; + case 205: + return "Puoi creare un'esca di vermi con pezzi marci e polvere disgustosa. Assicurati di essere in una zona distrutta prima di utilizzarla."; + case 206: + return "Gli altari demoniaci si trovano generalmente nella distruzione. Dovrai essere vicino ad essi per creare oggetti."; + case 207: + return "Puoi creare un rampino con un uncino e tre catene. Gli scheletri sottoterra di solito trasportano gli uncini, mentre le catene possono essere ricavate dalle sbarre di ferro."; + case 208: + return "Se vedi un vaso, demoliscilo e aprilo. Contiene una serie di utili provviste."; + case 209: + return "Vi sono tesori nascosti in tutto il mondo. Alcuni oggetti fantastici si possono trovare nelle zone sotterranee più profonde."; + case 210: + return "Demolire un'orbita d'ombra provocherà a volte la caduta di un meteorite dal cielo. Le orbite d'ombra si possono generalmente trovare negli abissi attorno alle zone distrutte."; + case 211: + return "Dovresti cercare di raccogliere più cuori di cristallo per allungare la tua vita massima."; + case 212: + return "La tua attrezzatura attuale non è sufficiente. Hai bisogno di un'armatura migliore."; + case 213: + return "Credo tu sia pronto per la tua prima grande battaglia. Raccogli lenti dai bulbi oculari di notte e portale a un altare demoniaco."; + case 214: + return "Allunga la tua vita prima di affrontare la prossima sfida. Quindici cuori dovrebbero bastare."; + case 215: + return "La pietra d'ebano nella distruzione può essere purificata con polvere di driade o distrutta con esplosivi."; + case 216: + return "La prossima tappa consiste nell'esplorazione degli abissi distrutti. Trova e distruggi ogni orbita d'ombra che incontrerai."; + case 217: + return "C'è una vecchia segreta non lontano da qui. Sarebbe il momento giusto per visitarla."; + case 218: + return "Dovresti tentare di massimizzare la vita disponibile. Prova a raccogliere venti cuori."; + case 219: + return "Ci sono molti tesori da scroprire nella giungla, se sei disposto a scavare abbastanza in profondità."; + case 220: + return "Il sottomondo è composto da un materiale detto pietra infernale, perfetto per creare armi e armatura."; + case 221: + return "Quando sarai pronto a sfidare il custode del sottomondo, dovrai fare un enorme sacrificio. Tutto ciò che ti serve si trova nel mondo di sotto."; + case 222: + return "Assicurati di demolire ogni altare demoniaco che incontri. Se lo farai, ti succederà qualcosa di bello!"; + case 223: + return "A volte è possibile riunire le anime delle creature morte in luoghi estremamente luminosi o bui."; + case 224: + return "Ho ho ho e una bottiglia di ... Egg Nog!"; + case 225: + return "Cura di cuocere dei biscotti me?"; + case 226: + return "Che cosa? Credevi che non era reale?"; + case 227: + return "Sono riuscito a cucire la tua faccia di nuovo. Essere più attento la prossima volta."; + case 228: + return "Che probabilmente lascerà una cicatrice."; + case 229: + return "Tutti i migliori. Non voglio vederti saltare fuori più scogliere."; + case 230: + return "Che non ha fatto male troppo male, ora lo ha fatto?"; + case 231: + return "Come se vivere sottoterra non bastasse, cretini come si arriva in mentre dormo e rubato i miei figli."; + case 232: + return "Tra me e te, " + text3 + " è l'unico di cui mi fido. Lei è l'unico qui che non ha cercato di mangiare me o utilizzare in una pozione."; + case 233: + return "Ho provato a leccare me l'altro giorno per vedere che cosa il grosso problema era, tutto ha cominciato blu incandescente. "; + case 234: + return "Ogni volta che vedo il colore blu, mi rende depresso e pigro."; + case 235: + return "Non hai visto tutti i suini da queste parti hanno di te? Mio fratello ha perso la gamba a uno."; + case 236: + return "Ognuno in questa città si sente un po 'fuori. Mi sono svegliato al clothier masticare sul mio piede ieri sera."; + case 237: + return "Ti darò uno sconto sul tuo capo se si può convincere " + str4 + " di venire per un ... dimensionamento."; + case 238: + return "Mi sento come " + str4 + " è un po 'incompreso, lui è davvero un tipo divertente."; + case 240: + return "Non so il 'Tartufo Shuffle', così smettere di chiedere! "; + case 241: + return "C'è stato un enorme diceria che viene diffuso su di me, 'Se non lo puoi battere, lui mangiare!'"; + case 242: + return "Oy, che cosa avete nel vostro Fluffer Grillo Parlante?"; + case 243: + return "Devo diventare un pirata dell'aria? Ho pensato di diventare un pirata dell'aria."; + case 244: + return "Che si tratti di cosa sarebbe, un jetpack che si adattano bene!"; + case 245: + return "Mi sento un po 'scontroso come di ritardo, in modo sufficiente con il tuo chiacchiere si ragamuffin!"; + case 246: + return "Sono possente curioso di quel " + str6 + " compagno. Con che tipo di consumo fa a mantenere tale locomozione?"; + case 247: + return "Quel tipo capitano mi sembra di essere 'abbastanza bene sulla baia' se sai cosa vuol dire! "; + case 248: + return "Mostrami alcuni ingranaggi! "; + case 249: + return "Mi piace il tuo ... ingranaggio. Le viene in ottone?"; + case 250: + return "Una volta che si entra in terra consacrata, si vedrà un arcobaleno nel cielo. Io posso aiutarti con la pittura che, se si vuole."; + case 251: + return "Scopri " + str5 + ". Ora che è una ragazza che può dipingere di rosso la città!"; + case 252: + return "Conosco la differenza tra il turchese e blu-verde. Ma io non lo dirò."; + case 253: + return "Sono tutti fuori di bianco di titanio, quindi non hanno nemmeno chiedere."; + case 254: + return "Prova swirly rosa e viola, funziona, lo giuro!"; + case 255: + return "No, no, no ... Ci sono tonnellate di diversi grigi! Non fatemi parlare ..."; + case 256: + return "Spero che non piova di nuovo fino a quando questa vernice si asciuga. Sarebbe un disastro! "; + case 257: + return "Vi porto i colori più ricchi in cambio della tua ricchezza!"; + case 258: + return "Mio caro, quello che indossi è troppo triste. È assolutamente necessario prendere una lezione di tintura vostro abbigliamento stanco!"; + case 259: + return "L'unico tipo di legno io mi preoccuperei di tintura è mogano ricco. Tintura qualsiasi altro legno è un tale spreco."; + case 260: + return "Devi fare qualcosa per " + str7 + ". Ogni volta che viene qui, mi ci vuole una settimana per ottenere l'odore di sconto!"; + case 261: + return "Quale dottore sono io? Il Witch Doctor sono."; + case 262: + return "Il cuore della magia è la natura. La natura del cuore è magia."; + case 263: + return text + " può aiutare a guarire il corpo, ma posso farti incarnano guarigione."; + case 264: + return "Scegli con saggezza, " + Main.player[Main.myPlayer].name + ", le mie materie prime sono volatili e la mia arte oscura, misteriosa."; + case 265: + return "Dobbiamo parlare. E '... si tratta di feste."; + case 266: + return "Non riesco a decidere quello che mi piace di più: feste, o post-feste."; + case 267: + return "Dovremmo creare un gruppo di blinkroot, e dovremmo anche istituito una festa dopo."; + case 268: + return "Wow, " + Main.player[Main.myPlayer].name + ", incontrare un uomo avventuroso come te mi fa venire voglia di festa!"; + case 269: + return "Mettere su una palla da discoteca e poi ti faccio vedere come far festa."; + case 270: + return "Sono andato alla Svezia una volta, party hard, perche 'non ti piace?"; + case 271: + return "Il mio nome di " + str5 + " ma le persone mi chiamano partito popper. Si. Non lo so, suona freddo comunque."; + case 272: + return "Ti partito? A volte? Hm, ok allora possiamo parlare..."; + case 273: + return "Io non sono un amante del territorio, ma è meglio aver amato e perso che non amare affatto."; + case 274: + return "Yo ho ho e una bottiglia di ...blinkroots!"; + case 275: + return "YAR! Divertente si dovrebbe essere accennando pappagalli perché ... ehm ... cosa stavamo parlando?"; + case 276: + return Main.player[Main.myPlayer].name + ", Siete di una delle più belle fanciulle che cercano questo qui capitano visto in molti una quindicina di giorni!"; + case 277: + return "Rimanere fuori mi bottino, si scallywag!"; + case 278: + return "Cosa diamine stai parlando? Moby Dick è mio!"; + case 279: + return "*Yarr Blarr Harrdarr*"; + case 280: + return "E poi Unità 492-8 disse: 'Chi pensi che io sono, Unità 472-6?' HA. HA. HA."; + case 281: + return "Il mio rendimento spedizione è stata criticamente ridotta quando un proiettile influenzato la mia locomotiva attuatore."; + case 282: + return "Questa frase è falsa, o è?"; + case 283: + return "Così che il 'punk' cercando pulcino è un inventore, eh? Penso che avrei potuto mostrare una cosa o due!"; + case 284: + return "Certo, io e " + str7 + " sono amici, ma odio quando il suo pappagallo fa il suo lavoro su di me. Corrosiva che roba!"; + case 285: + return "Io stesso ho costruito un meccanismo di gusto, così posso bere qualche birra!"; + case 286: + return "A volte mi si stacca un po '... Capito? un po '?"; + } + } + else + { + if (Lang.lang == 4) + { + switch (l) + { + case 1: + return "Rassurez-moi, on ne doit pas compter que sur vous pour nous protéger de l'œil de Cthulhu."; + case 2: + return "Regardez-moi cette armure bas de gamme que vous avez sur le dos. Vous avez intérêt à acheter davantage de potions de soin."; + case 3: + return "Je sens une présence maléfique m'observer."; + case 4: + return "L'épée est plus forte que la plume. Achetez-en une dès aujourd'hui."; + case 5: + return "Vous voulez des pommes ? Vous voulez des poires ? Vous voulez des scoubidous ? Nous avons des torches."; + case 6: + return "Quelle belle matinée, n'est-ce pas ? Vous voulez quelque chose?"; + case 7: + return "La nuit va bientôt tomber, alors faites votre choix tant qu'il est encore temps."; + case 8: + return "Vous n'avez pas idée du nombre de blocs de terre qui sont vendus à l'étranger."; + case 9: + return "Un jour, des légendes étonnantes circuleront sur " + Main.player[Main.myPlayer].name + "."; + case 10: + return "Jetez un œil à mes blocs de terre, c'est de la terre de premier choix."; + case 11: + return "Voyez comme le soleil tape. J'ai des armures parfaitement ventilées."; + case 12: + return "Le soleil est haut dans le ciel, mais mes prix sont bas."; + case 13: + return string.Concat(new string[] + { + "Oh, génial ! J'entends ", + text5, + " et ", + text, + " se disputer d'ici." + }); + case 14: + return "Avez-vous vu Chult... Cthuch... Le truc avec le gros œil?"; + case 15: + return "Cette maison est sûre, n'est-ce pas ? Hein, " + Main.player[Main.myPlayer].name + "?"; + case 16: + return "Même la Lune de Sang ne peut arrêter le capitalisme. Alors, faisons affaires."; + case 17: + return "Pour garder un œil sur les prix, achetez une lentille."; + case 18: + return "Kosh, kapleck Mog. Oh désolé, ça veut dire « Achetez-moi quelque chose ou allez au diable » en klingon."; + case 19: + return "Vous êtes " + Main.player[Main.myPlayer].name + ", n'est-ce pas ? J'ai entendu de bonnes choses à votre sujet."; + case 20: + return "J'ai entendu dire qu'il y avait un trésor caché... Bon, laissez tomber."; + case 21: + return "Une statue d'ange, dites-vous ? Désolé, ce n'est pas une boutique de souvenirs ici."; + case 22: + return "Le dernier type qui est venu m'a vendu quelques sales... Je veux dire, de vrais trésors."; + case 23: + return "Je me demande si la lune est un gros fromage... Hein, quoi ? Oh , bien sûr, achetez ce que vous voulez!"; + case 24: + return "Vous avez dit or ? Je vais vous en débarrasser."; + case 25: + return "Faites attention de ne pas me mettre du sang partout."; + case 26: + return "Dépêchez-vous et arrêtez de saigner."; + case 27: + return "Si vous comptez mourir, faites-le dehors."; + case 28: + return "Qu'est-ce que ça veut dire ?"; + case 29: + return "Je n'aime pas beaucoup votre ton."; + case 30: + return "Qu'est-ce que vous faites là ? Si vous ne saignez pas, sortez d'ici. Dehors !"; + case 31: + return "Quoi ?"; + case 32: + return "Vous avez vu ce vieil homme qui se pressait autour du donjon ? Il semblait avoir des ennuis."; + case 33: + return "J'aimerais bien que " + str2 + " fasse plus attention. J'en ai assez de lui faire des points de suture chaque jour."; + case 34: + return "Je me demande si " + text2 + " a dit qu'il avait besoin d'un docteur."; + case 35: + return "Il va falloir que je discute sérieusement avec " + str3 + ". Combien de fois par semaine allez-vous revenir ici avec des brûlures au second degré ?"; + case 36: + return "Vous avez meilleure mine comme ça."; + case 37: + return "Que vous est-il arrivé au visage ?"; + case 38: + return "Bon sang, je suis une bonne infirmière, mais pas à ce point."; + case 39: + return "Mes chers amis, nous sommes rassemblés aujourd'hui pour faire nos adieux... Bon, tout se passera bien."; + case 40: + return "Vous avez laissé votre bras là-bas. Laissez-moi arranger ça."; + case 41: + return "Arrêtez de vous comporter comme une mauviette. J'ai déjà vu bien pire."; + case 42: + return "Cela va demander quelques points de suture."; + case 43: + return "Encore des soucis avec ces brutes ?"; + case 44: + return "Attendez, je dois avoir quelques pansements pour enfants quelque part."; + case 45: + return "Allez faire quelques pas, " + Main.player[Main.myPlayer].name + ", ça devrait aller. Allez, ouste !"; + case 46: + return "Ça vous fait mal quand vous faites ça ? Eh bien, ne le faites pas."; + case 47: + return "On dirait qu'on a commencé à vous digérer. Vous avez encore chassé des slimes ?"; + case 48: + return "Tournez votre tête et toussez."; + case 49: + return "Ce n'est pas la plus grave blessure que j'ai vue... Oui, j'ai déjà vu des blessures bien plus graves que ça."; + case 50: + return "Vous voulez une sucette ?"; + case 51: + return "Montrez-moi où vous avez mal."; + case 52: + return "Je suis désolée, mais vous n'avez pas les moyens."; + case 53: + return "Il va me falloir plus d'or que cela."; + case 54: + return "Je ne travaille pas gratuitement, vous savez."; + case 55: + return "Je ne vous garantis pas le résultat."; + case 56: + return "Je ne peux rien faire de plus pour vous sans chirurgie esthétique."; + case 57: + return "Arrêtez de me faire perdre mon temps."; + case 58: + return "J'ai entendu dire qu'il y aurait une poupée qui ressemblerait beaucoup à " + str3 + " dans le monde inférieur. J'aimerais bien lui coller quelques pruneaux."; + case 59: + return "Dépêchez-vous, j'ai un rencard avec " + text + " d'ici une heure."; + case 60: + return "Je veux ce que vend" + text + ". Comment ça, elle ne vend rien !"; + case 61: + return text3 + " est vraiment canon. Dommage qu'elle soit aussi prude."; + case 62: + return "Ne vous embêtez pas avec " + str2 + ", j'ai tout ce qu'il vous faut ici."; + case 63: + return "C'est quoi le problème de " + str2 + " ? Est-ce qu'il réalise seulement que l'on vend du matériel complètement différent ?"; + case 64: + return "Eh bien, c'est la nuit idéale pour ne pas parler à n'importe qui, n'est-ce pas, " + Main.player[Main.myPlayer].name + " ?"; + case 65: + return "J'adore les nuits comme celle-ci, car il y a toujours des choses à tuer."; + case 66: + return "Je vois que vous êtes en train de zieuter le minishark... Mieux vaut ne pas savoir comment c'est fabriqué."; + case 67: + return "Eh, c'est pas du cinéma. Les munitions sont superflues."; + case 68: + return "Retirez les mains de mon flingue."; + case 69: + return "Avez-vous essayé d'utiliser de la poudre de purification sur la pierre d'ébène de corruption ?"; + case 70: + return "Ce serait bien si " + text2 + " cessait de me courtiser. J'ai quand même 500 ans, mais ça n'a pas l'air de lui faire peur."; + case 71: + return "Pourquoi " + str + " essaie-t-il toujours de me vendre des statues d'ange ? Tout le monde sait qu'elles sont sans intérêt."; + case 72: + return "Avez-vous vu le vieil homme en train de marcher autour du donjon ? Il n'avait vraiment pas l'air bien."; + case 73: + return "Je vends ce que je veux, et si cela ne vous plaît pas, tant pis pour vous."; + case 74: + return "Pourquoi adopter un comportement aussi conflictuel en cette période ?"; + case 75: + return "Je ne veux pas que vous achetiez mes marchandises, je veux que vous vouliez acheter mes marchandises, vous saisissez la nuance ?"; + case 76: + return "Dites, c'est moi ou il y a un million de zombies qui déambulent cette nuit ?"; + case 77: + return "Je veux que vous purifiiez le monde de la corruption."; + case 78: + return "Soyez prudent, Terraria a besoin de vous."; + case 79: + return "Les sables du temps s'écoulent et il faut bien avouer que vous vieillissez plutôt mal."; + case 80: + return "Comment ça, j'aboie plus que je ne mords ?"; + case 81: + return "C'est l'histoire de deux gobelins qui entrent dans une taverne et l'un dit à l'autre : « Tu veux un gobelet de bière ? »"; + case 82: + return "Je ne peux pas vous laisser entrer tant que vous ne m'aurez pas débarrassé de ma malédiction."; + case 83: + return "Revenez à la nuit tombée si vous voulez entrer."; + case 84: + return "Mon maître ne peut pas être invoqué à la lumière du jour."; + case 85: + return "Vous êtes bien trop faible pour me débarrasser de ma malédiction. Revenez quand vous serez de taille."; + case 86: + return "C'est pathétique ! Vous n'espérez quand même pas affronter mon maître pour l'instant dans votre état."; + case 87: + return "J'espère que vous avez au moins six amis pour vous épauler."; + case 88: + return "Je vous en prie, ne faites pas ça. Vous allez vous faire tuer."; + case 89: + return "Votre puissance semble suffisante pour me débarrasser de ma malédiction."; + case 90: + return "Disposez-vous de la force nécessaire pour vaincre mon maître ?"; + case 91: + return "S'il vous plaît, je vous en conjure, affrontez mon ravisseur et libérez-moi."; + case 92: + return "Terrassez mon maître et je vous ouvrirai la voie du donjon."; + case 93: + return "Vous essayez d'écouler cette pierre d'ébène, hein ? Pourquoi ne pas l'intégrer à l'un de ces explosifs ?"; + case 94: + return "Dites donc, vous n'auriez pas vu un clown dans le coin ?"; + case 95: + return "Il y avait une bombe juste là et je n'arrive plus à remettre la main dessus."; + case 96: + return "J'ai quelque chose dont les zombies raffolent."; + case 97: + return "Même " + text2 + " raffole de mes marchandises."; + case 98: + return "Vous préférez un trou de balle ou un trou de grenade ? C'est bien ce que je pensais."; + case 99: + return text + " vous aidera si jamais vous perdez un membre avec ça."; + case 100: + return "Pourquoi purifier le monde alors que vous pouvez tout faire sauter ?"; + case 101: + return "Si vous lancez ça dans votre baignoire et que vous fermez les fenêtres, ça vous débouchera les sinus et les oreilles en moins de deux."; + case 102: + return "Vous voulez jouer au poulet-fusée ?"; + case 103: + return "Pourriez-vous signer cette clause de non-responsabilité ?"; + case 104: + return "INTERDICTION FORMELLE DE FUMER."; + case 105: + return "Les explosifs, c'est de la bombe en ce moment. Achetez-en dès maintenant."; + case 106: + return "C'est un bon jour pour mourir."; + case 107: + return "Je me demande ce qui va se passer si je... (BOUM !)... Désolé, vous aviez besoin de cette jambe ?"; + case 108: + return "La dynamite, c'est mon remède spécial à tous vos petits problèmes."; + case 109: + return "Jetez un œil à mes marchandises, mes prix sont explosifs."; + case 110: + return "J'ai encore le vague souvenir d'avoir attaché une femme et de l'avoir balancée dans un donjon."; + case 111: + return "Il y a un problème, c'est la lune de sang."; + case 112: + return "Si j'avais été plus jeune, j'aurais proposé un rencard à " + text + ". J'étais un bourreau des cœurs dans le temps."; + case 113: + return "Ce chapeau rouge que vous portez me dit quelque chose."; + case 114: + return "Merci de m'avoir débarrassé de cette malédiction. J'avais l'impression que quelque chose m'avait mordu et ne me lâchait plus."; + case 115: + return "Ma mère m'a toujours dit que je ferais un bon tailleur."; + case 116: + return "La vie est comme le chapeau d'un magicien, on ne sait jamais ce qui va en sortir."; + case 117: + return "La broderie, c'est très difficile. Si ça ne l'était pas, personne n'en ferait. C'est ce qui la rend si intéressante."; + case 118: + return "Le commerce du prêt-à-porter n'a aucun secret pour moi."; + case 119: + return "Quand on est maudit, ça n’aide pas à se faire des amis. Alors un jour, je m'en suis fait un avec un morceau de cuir et je l'ai appelé Wilson."; + case 120: + return "Merci de m'avoir libéré, humain. J'ai été attaché et laissé ici par les autres gobelins. On peut dire qu'on ne s'entendait pas très bien, eux et moi."; + case 121: + return "Je n'arrive pas à croire qu'ils m'aient attaché et planté ici juste pour montrer qu'ils ne voulaient pas aller vers l'est."; + case 122: + return "Puisque je suis devenu un paria, puis-je jeter mes boules piquantes ? Mes poches me font mal."; + case 123: + return "Vous cherchez un expert en gadgets ? Je suis votre gobelin."; + case 124: + return "Merci de votre aide. À présent, je dois continuer à errer sans but dans les environs. Je suis sûr qu'on se reverra."; + case 125: + return "Je ne vous imaginais pas comme ça."; + case 126: + return "Et comment va " + text5 + "? Lui auriez-vous parlé, par hasard ?"; + case 127: + return "Est-ce que votre chapeau a besoin d'un moteur ? Je crois en avoir un en stock qui ferait parfaitement l'affaire."; + case 128: + return "J'ai entendu dire que vous aimiez les bottes de course et les roquettes, du coup, j'ai installé des roquettes dans vos bottes de course."; + case 129: + return "Le silence est d'or, mais le chatterton reste très efficace."; + case 130: + return "Oui, l'or est plus précieux que le fer. Mais qu'est-ce qu'ils vous apprennent chez les humains ?"; + case 131: + return "C'est vrai que ce casque de mineur combiné à une palme rendait mieux sur le papier."; + case 132: + return "Les gobelins sont étonnamment soupe au lait. Ils pourraient déclencher une guerre pour un mot de travers."; + case 133: + return "Il faut bien avouer que les gobelins n'ont pas inventé la poudre, mais il y a des exceptions à la règle."; + case 134: + return "Savez-vous pourquoi on trimballe toujours ces boules piquantes ? Parce que moi, je n'en sais fichtre rien."; + case 135: + return "Je viens de mettre la touche finale à ma dernière invention. Et ce modèle n'explosera pas si vous soufflez trop fort dessus."; + case 136: + return "Les voleurs gobelins sont des vrais manchots. Ils ne sont même pas capables de dérober le contenu d'un coffre non verrouillé."; + case 137: + return "Merci de m'avoir secouru. Ces liens commençaient à m'irriter la peau."; + case 138: + return "Mon héros !"; + case 139: + return "Quel héroïsme ! Merci de m'avoir sauvé, belle dame."; + case 140: + return "Quel héroïsme ! Merci de m'avoir sauvé, fringant jeune homme."; + case 141: + return "Maintenant que nous avons fait connaissance, je peux venir avec vous, n'est-ce pas ?"; + case 142: + return "Bonjour, " + str3 + "! Que puis-je pour vous, aujourd'hui ?"; + case 143: + return "Bonjour, " + str2 + "! Que puis-je pour vous, aujourd'hui ?"; + case 144: + return "Bonjour, " + text4 + "! Que puis-je pour vous, aujourd'hui ?"; + case 145: + return "Bonjour, " + text + "! Que puis-je pour vous, aujourd'hui ?"; + case 146: + return "Bonjour, " + text5 + "! Que puis-je pour vous, aujourd'hui ?"; + case 147: + return "Bonjour, " + text3 + "! Que puis-je pour vous, aujourd'hui ?"; + case 148: + return "Voulez-vous que je fasse apparaître une pièce de monnaie de derrière votre oreille ? Non ? Bon."; + case 149: + return "Est-ce qu'un berlingot magique vous ferait plaisir ? Non ? Bon."; + case 150: + return "Je peux concocter un merveilleux chocolat chaud magique, si cela vous intéresse... Non ? OK."; + case 151: + return "Souhaitez-vous jeter un œil à ma boule de cristal ?"; + case 152: + return "N'avez-vous jamais rêvé de posséder un anneau magique qui transformerait les rochers en vase ? Moi non plus, à vrai dire."; + case 153: + return "Un jour, quelqu'un m'a dit que l'amitié était quelque chose de magique. C'est n'importe quoi. On ne peut pas transformer quelqu'un en grenouille avec l'amitié."; + case 154: + return "À présent, votre avenir m'apparaît clairement... Vous allez m'acheter de nombreux objets."; + case 155: + return "Une fois, j'ai tenté de ramener une statue d'ange à la vie. Il ne s'est rien passé."; + case 156: + return "Merci. C'était moins une, j'ai failli terminer comme tous ces squelettes."; + case 157: + return "Attention où vous mettez les pieds. J'étais encore là-bas il y a peu."; + case 158: + return "Attendez, je suis en train de perdre ma connexion Wi-Fi par ici."; + case 159: + return "Mais j'avais presque terminé d'installer des stroboscopes ici."; + case 160: + return "Que personne ne bouge ! J'ai perdu une lentille."; + case 161: + return "Tout ce que je veux, c'est que l'interrupteur... Quoi ?"; + case 162: + return "Je parie que vous n'avez pas acheté assez de câbles. Décidément, vous n'êtes vraiment pas une lumière."; + case 163: + return "Est-ce que vous pourriez juste... S'il vous plaît ? OK ? OK."; + case 164: + return "Je n'aime pas trop la façon dont vous me regardez. Je suis en train de travailler, moi."; + case 165: + return string.Concat(new string[] + { + "Au fait, ", + Main.player[Main.myPlayer].name, + ", vous venez de voir ", + text4, + " ? Est-ce qu'il aurait parlé de moi, par hasard ?" + }); + case 166: + return text2 + " parle toujours de pressuriser mes plaques de pression. Je lui ai dit que c'était pour marcher dessus."; + case 167: + return "Il faut toujours acheter plus de câbles que prévu."; + case 168: + return "Vous vous êtes assuré que votre matériel était bien branché ?"; + case 169: + return "Vous savez ce qu'il faudrait à cette maison ? Plus de stroboscopes."; + case 170: + return "La lune de sang se remarque lorsque le ciel vire au rouge et quelque chose fait que les monstres pullulent."; + case 171: + return "Dites donc, vous savez où je peux trouver de la mauvaise herbe morte. Non, pour rien, je me demandais, c'est tout."; + case 172: + return "Si vous regardiez en l'air, vous verriez que là, la lune est toute rouge."; + case 173: + return "La nuit, vous devriez rester à l'intérieur. C'est très dangereux de se balader dans le noir."; + case 174: + return "Bienvenue, " + Main.player[Main.myPlayer].name + ". Je peux faire quelque chose pour vous ?"; + case 175: + return "Je suis là pour vous conseiller et vous aider dans vos prochaines actions. Vous devriez venir me parler au moindre problème."; + case 176: + return "On dit qu'il y a une personne capable de vous aider à survivre sur ces terres... Oh, attendez, c'est moi."; + case 177: + return "Vous pouvez utiliser votre pioche pour creuser dans la terre, et votre hache pour abattre des arbres. Placez simplement le curseur à l'emplacement souhaité et cliquez."; + case 178: + return "Si vous voulez survivre, vous allez devoir fabriquer des armes et un abri. Commencez par abattre des arbres et récolter du bois."; + case 179: + return "Appuyez sur ÉCHAP pour accéder au menu d'artisanat. Lorsque vous avez assez de bois, créez un établi. Tant que vous vous tiendrez à proximité, il vous permettra de fabriquer des objets plus complexes."; + case 180: + return "Vous pouvez construire un abri en plaçant du bois ou d'autres blocs dans le monde. N'oubliez pas de créer des murs et de les placer."; + case 181: + return "Une fois que vous aurez une épée de bois, vous pourriez essayer de récupérer du gel grâce aux slimes. Combinez ensuite le bois et le gel pour faire une torche."; + case 182: + return "Pour interagir avec les arrière-plans et les objets placés, utilisez un marteau."; + case 183: + return "Vous devriez creuser pour trouver du minerai. Cela vous permet de fabriquer des objets très utiles."; + case 184: + return "Maintenant que vous avez du minerai, vous allez devoir le transformer en lingot pour pouvoir en faire des objets. Il vous faut un fourneau."; + case 185: + return "Vous pouvez fabriquer un fourneau avec des torches, du bois et de la pierre. Assurez-vous de vous tenir près d'un établi."; + case 186: + return "Vous aurez besoin d'une enclume pour pouvoir fabriquer la plupart des choses à partir des lingots de métal."; + case 187: + return "Une enclume peut être fabriquée avec du fer ou bien achetée chez les marchands."; + case 188: + return "Le souterrain est un cœur de cristal utilisé pour augmenter votre maximum de vie. Il vous faudra un marteau pour pouvoir en extraire."; + case 189: + return "Si vous récupérez dix étoiles filantes, elles peuvent être combinées pour fabriquer un objet qui augmentera votre capacité de magie."; + case 190: + return "Les étoiles tombent sur le monde durant la nuit. Elles peuvent être utilisées pour toutes sortes de choses utiles. Si vous en voyez une, dépêchez-vous de la ramasser, car elles disparaissent l'aube venue."; + case 191: + return "Il existe de nombreux moyens pour attirer du monde dans notre ville. Bien sûr, une fois sur place, ces nouveaux arrivants auront besoin d'une maison pour s'abriter."; + case 192: + return "Pour qu'une pièce puisse être considérée comme un foyer, elle doit comporter une porte, une chaise, une table et une source de lumière. Assurez-vous que la maison dispose également de murs."; + case 193: + return "Deux personnes distinctes ne vivront pas dans le même foyer. De plus, si leur foyer est détruit, ils chercheront un nouveau lieu où habiter."; + case 194: + return "Vous pouvez utiliser l'interface de logement pour attribuer des logements et les visualiser. Ouvrez votre inventaire et cliquez sur l'icône de maison."; + case 195: + return "Si vous souhaitez qu'un marchand emménage, vous devrez avoir une quantité d'argent suffisante. 50 pièces d'argent devraient suffire."; + case 196: + return "Pour qu'une infirmière emménage, vous pourriez augmenter votre maximum de vie."; + case 197: + return "Si vous avez un mousquet, il se peut qu'un marchand d'armes fasse son apparition pour vous vendre des munitions."; + case 198: + return "Vous devriez montrer de quoi vous êtes capable en triomphant d'un monstre. Cela attirera l'attention d'une dryade."; + case 199: + return "Assurez-vous d'explorer minutieusement les donjons. Il pourrait y avoir des prisonniers retenus captifs dans les profondeurs."; + case 200: + return "Peut-être que le vieil homme du donjon voudra se joindre à nous maintenant que sa malédiction a été levée."; + case 201: + return "Récupérez toutes les bombes que vous pourrez trouver. Un démolisseur voudra sûrement y jeter un œil."; + case 202: + return "Les gobelins sont-ils si différents de nous pour que nous ne puissions pas vivre ensemble de manière paisible ?"; + case 203: + return "J'ai entendu dire qu'un puissant magicien vivait dans les environs. Assurez-vous de le trouver la prochaine fois que vous irez dans le souterrain."; + case 204: + return "Si vous combinez des lentilles à un autel de démon, vous pourrez trouver un moyen d'invoquer un monstre très puissant. Cependant, il vous faudra attendre la tombée de la nuit avant de pouvoir l'utiliser."; + case 205: + return "Vous pouvez fabriquer de la nourriture pour ver avec des morceaux pourris et de la poudre infecte. Assurez-vous de vous trouver dans une zone corrompue avant de l'utiliser."; + case 206: + return "Les autels démoniaques peuvent généralement être trouvés dans la corruption. Il vous faudra vous tenir près d'eux pour fabriquer certains objets."; + case 207: + return "Vous pouvez fabriquer un grappin avec un crochet et trois chaînes. Les squelettes trouvés dans les profondeurs portent souvent des crochets sur eux. Les chaînes peuvent être fabriquées à l'aide de lingots de fer."; + case 208: + return "Si vous voyez des pots, détruisez-les pour les ouvrir, car ils contiennent souvent des objets très utiles."; + case 209: + return "Des trésors sont disséminés un peu partout dans le monde et vous pouvez trouver des objets fantastiques dans les profondeurs."; + case 210: + return "Lorsqu'on écrase un orbe d'ombre, il arrive qu'une météorite tombe du ciel. Les orbes d'ombre peuvent généralement être trouvés dans les gouffres des zones corrompues."; + case 211: + return "Vous devriez vous employer à récolter davantage de cœurs de cristal pour augmenter votre maximum de vie."; + case 212: + return "Votre équipement actuel ne suffira pas. Il vous faut une meilleure armure."; + case 213: + return "Je crois que vous pouvez maintenant prendre part à votre première grande bataille. De nuit, rassemblez des lentilles récupérées à la mort des démons et portez-les sur un autel de démon."; + case 214: + return "Vous devriez augmenter votre vie avant votre prochaine épreuve. Quinze cœurs devraient suffire."; + case 215: + return "La pierre d'ébène dans la corruption peut être purifiée en utilisant de la poudre issue d'une dryade, ou bien peut être détruite avec des explosifs."; + case 216: + return "Votre prochaine épreuve sera d'explorer les gouffres corrompus. Trouvez et détruisez tous les orbes d'ombre que vous trouverez."; + case 217: + return "Il existe un vieux donjon situé pas très loin d'ici. Vous devriez aller y faire un tour dès maintenant."; + case 218: + return "Vous devriez essayer d'augmenter votre vie maximum. Essayez de rassembler vingt cœurs."; + case 219: + return "Si vous pouvez creuser assez profondément, il y a de nombreux trésors à découvrir dans la jungle."; + case 220: + return "Le monde inférieur est fait d'un matériau appelé pierre de l'enfer. Ce matériau est parfait pour la fabrication d'armes et d'armures."; + case 221: + return "Lorsque vous voudrez affronter le gardien du monde inférieur, vous devrez faire le sacrifice d'un être vivant. Tout ce dont vous avez besoin pour cela se trouve dans le monde inférieur."; + case 222: + return "Assurez-vous d'écraser tous les autels de démon que vous trouverez. Vous pourrez en tirer quelque chose de bénéfique."; + case 223: + return "Des âmes peuvent être parfois récupérées des créatures déchues dans des lieux de lumière ou d'ombre extrême."; + case 224: + return "Ho ho ho et une bouteille de ... Egg Nog!"; + case 225: + return "Soins pour cuire des biscuits moi?"; + case 226: + return "Qu'est-ce? Vous pensiez que je n'étais pas réel?"; + case 227: + return "J'ai réussi à coudre votre visage sur le dos. Soyez plus prudent la prochaine fois."; + case 228: + return "Cela va probablement laisser une cicatrice."; + case 229: + return "Toutes les meilleures. Je ne veux pas vous voir sauter plus falaises."; + case 230: + return "Cela n'a pas fait trop de mal, maintenant c'est fait?"; + case 231: + return "Comme si vivre souterrain n'était pas assez, saccades comme vous venez pendant que je dors et volé mes enfants."; + case 232: + return "Entre vous et moi, " + text3 + " est le seul en qui j'ai confiance. Elle est la seule personne ici qui n'a pas essayé de me manger ou m'utiliser dans une potion."; + case 233: + return "J'ai essayé de me lécher l'autre jour pour voir ce que le gros problème était, tout a commencé bleu éclatant."; + case 234: + return "Chaque fois que je vois la couleur bleue, ça me rend dépressif et paresseux."; + case 235: + return "Vous n'avez pas vu des porcs par ici vous? Mon frère a perdu sa jambe à un."; + case 236: + return "Tout le monde dans cette ville se sent un peu à l'écart. Je me suis réveillé au drapier à mâcher sur mon pied hier soir."; + case 237: + return "Je vais vous donner un rabais sur votre usures si vous pouvez convaincre " + str4 + " à venir pour un ... dimensionnement."; + case 238: + return "Je me sens comme " + str4 + " est un peu mal compris, il est vraiment un gars amusant."; + case 240: + return "Je ne sais pas le «Truffle Shuffle» pour cesser de demander!"; + case 241: + return "Il ya eu une énorme rumeur qui a été répandu sur moi: «Si vous ne pouvez pas le battre, le manger!»"; + case 242: + return "Oy, qu'est-ce que vous avez dans votre fluffer Jiminy?"; + case 243: + return "Devrais-je devenir un pirate air? J'ai envisagé de devenir un pirate air."; + case 244: + return "Que ce soit ce que ce serait, un jetpack qui vous conviendrait bien!"; + case 245: + return "Je me sens un peu maussade de la fin, assez pour vous avec votre palabre gueux!"; + case 246: + return "Je suis curieux de savoir ce puissant " + str6 + " camarade. Par ce mode de consommation-t-il maintenir cette locomotion?"; + case 247: + return "Ce garçon de capitaine me semble être «assez bien sur la baie» si vous savez ce que signifie!"; + case 248: + return "Montrez-moi certains engins!"; + case 249: + return "J'aime votre ... engrenages. Cela vient-il en laiton?"; + case 250: + return "Une fois que vous entrez dans la terre sainte, et vous verrez un arc en ciel dans le ciel. Je peux vous aider avec de la peinture qui, si vous voulez."; + case 251: + return "Découvrez " + str5 + ". Maintenant, c'est une fille qui peut peindre la ville rouge!"; + case 252: + return "Je connais la différence entre turquoise et bleu-vert. Mais je ne vais pas vous le dire."; + case 253: + return "Je suis tout de blanc de titane, alors ne vous demande même pas."; + case 254: + return "Essayez tourbillonnant rose et violet, cela fonctionne, je le jure!"; + case 255: + return "Non, non, non ... Il ya des tonnes de différents gris! Ne me lancez pas ..."; + case 256: + return "J'espère qu'il ne pleuve pas à nouveau jusqu'à ce que cette peinture sèche. Ce serait une catastrophe!"; + case 257: + return "Je vous apporte les couleurs les plus riches en échange de vos richesses!"; + case 258: + return "Mon cher, ce que vous portez est beaucoup trop terne. Vous devez absolument prendre une leçon de teinture de votre tenue vestimentaire fatigué!"; + case 259: + return "Le seul type de bois je dérange teinture est acajou. Teinture tout autre bois est un tel gaspillage."; + case 260: + return "Vous devez faire quelque chose pour " + str7 + ". Chaque fois qu'il vient ici, il me faut une semaine pour obtenir l'odeur off!"; + case 261: + return "Quel médecin suis-je? Le sorcier je suis."; + case 262: + return "Le cœur de la magie est la nature. La nature des cœurs est magique."; + case 263: + return text + " peut aider à guérir votre corps, mais je peux vous faire incarner la guérison."; + case 264: + return "Choisissez judicieusement, " + Main.player[Main.myPlayer].name + ", mes produits sont volatils et ma magie noire, mystérieuse."; + case 265: + return "Nous devons parler. C'est ... il s'agit de parties."; + case 266: + return "Je ne peux pas décider ce que je veux de plus: les parties, ou l'après que les parties."; + case 267: + return "Nous devons mettre en place une partie blinkroot, et nous devrions également mettre en place une après la fête."; + case 268: + return "Wow, " + Main.player[Main.myPlayer].name + ", rencontrer un homme aventureux comme vous me donne envie de faire la fête!"; + case 269: + return "Mettre en place une boule disco et puis je vais vous montrer comment faire la fête."; + case 270: + return "Je suis allé en Suède une fois, ils la fête dure, pourquoi n'êtes-vous pas comme ça?"; + case 271: + return "Je m'appelle " + str5 + " mais les gens m'appellent Party Pooper. Ouais, je ne sais pas, c'est assez cool si"; + case 272: + return "Pensez-vous parti? Parfois? Hm, ok alors nous pouvons parler ..."; + case 273: + return "Je ne suis pas amoureux de la terre, mais c'est mieux d'avoir aimé et perdu que ne jamais aimer du tout."; + case 274: + return "Yo ho ho et une bouteille de ...blinkroots!"; + case 275: + return "YAR! C'est drôle que vous devriez être mentionnez perroquets parce que ... euh ... quoi parlions-nous sur?"; + case 276: + return Main.player[Main.myPlayer].name + ", Vous être l'une des plus belles gamines qui cherchent ce ici le capitaine a vu dans beaucoup de quinze jours!"; + case 277: + return "Restez en dehors de moi butin, vous voyou!"; + case 278: + return "Quel en flammes êtes-vous parlez? Moby Dick est le mien!"; + case 279: + return "*Yarr Blarr Harrdarr*"; + case 280: + return "Et puis Unit 492-8 dit: «Qui pensez-vous que je suis, Unité 472-6?» HA. HA. HA."; + case 281: + return "Mon efficacité de l'expédition a été gravement réduite lorsqu'un projectile impact sur ma actionneur de locomotive."; + case 282: + return "Cette phrase est fausse, ou est-il?"; + case 283: + return "Alors que «punk» poussin de lookin est un inventeur, hein? Je pense que je pourrais lui montrer une chose ou deux!"; + case 284: + return "Bien sûr, " + str7 + " et moi sommes copains, mais je déteste quand son perroquet fait ses affaires sur moi. Le corrosif de ce genre de choses!"; + case 285: + return "Je me suis construit un mécanisme de goût, donc je peux boire un soda!"; + case 286: + return "Parfois, je me dégage un peu ... Get it? un peu?"; + } + } + else + { + if (Lang.lang == 5) + { + switch (l) + { + case 1: + return "Espero que un canijo como tú no sea lo único que se interpone entre nosotros y el Ojo de Cthulu."; + case 2: + return "Vaya un arma más mal hecha que llevas. Te conviene comprar más pociones curativas."; + case 3: + return "Siento como si una presencia maligna me observara."; + case 4: + return "¡La espada siempre gana! Cómprate una ahora."; + case 5: + return "¿Quieres manzanas? ¿Zanahorias? ¿Unas piñas? Tenemos antorchas."; + case 6: + return "Una mañana estupenda, ¿verdad? ¿No necesitas nada?"; + case 7: + return "La noche caerá pronto, amigo. Haz tus compras mientras puedas."; + case 8: + return "Ni te imaginas lo bien que se venden los Bloques de tierra en el extranjero."; + case 9: + return "Oh, algún día narrarán las aventuras de " + Main.player[Main.myPlayer].name + "... y seguro que acaban bien."; + case 10: + return "Echa un vistazo a estos Bloques de tierra; tienen extra de tierra."; + case 11: + return "¡Oye, cómo pega el sol! Pero yo tengo una armadura totalmente ventilada."; + case 12: + return "El sol está alto, al contrario que mis precios."; + case 13: + return string.Concat(new string[] + { + "¡Vaya! Desde aquí se oye cómo discuten ", + text5, + " y ", + text, + "." + }); + case 14: + return "¿Has visto a Chith... esto... Shith... eh... Chat...? Vamos, ¿al gran Ojo?"; + case 15: + return "Oye, esta casa es segura, ¿verdad? ¿Verdad? " + Main.player[Main.myPlayer].name + "..."; + case 16: + return "Ni siquiera una luna sangrienta detendría el capitalismo. Así que vamos a hacer negocios."; + case 17: + return "¡Fíjate bien en el premio, compra una lente!"; + case 18: + return "Kosh, kapleck Mog. Lo siento, hablaba en klingon... quiere decir \"Compra algo o muere\"."; + case 19: + return "¿Eres tú, " + Main.player[Main.myPlayer].name + "? ¡Me han hablado bien de ti, amigo!"; + case 20: + return "Dicen que aquí hay un tesoro escondido... oh, olvídalo..."; + case 21: + return "¿La estatua de un ángel? Lo siento pero no vendo cosas de segunda mano."; + case 22: + return "El último tipo que estuvo aquí me dejó algunos trastos viejos... ¡bueno, en realidad eran tesoros!"; + case 23: + return "Me pregunto si la luna estará hecha de queso... Eh... esto. ¡Ah, claro, compre aquí!"; + case 24: + return "¿Has dicho oro? Me lo quedo."; + case 25: + return "Será mejor que no me manches de sangre."; + case 26: + return "Date prisa... y deja ya de sangrar."; + case 27: + return "Si te vas a morir, hazlo fuera por favor."; + case 28: + return "¿Y eso qué quiere decir?"; + case 29: + return "No me gusta el tono que empleas."; + case 30: + return "¿Por qué sigues aquí? Si no te estás desangrando, aquí no pintas nada. Lárgate."; + case 31: + return "¡CÓMO!"; + case 32: + return "¿Has visto a ese anciano deambulando por la mazmorra? Parece que tiene problemas."; + case 33: + return "Ojalá " + str2 + " tuviera más cuidado. Ya me estoy hartando de tener que coserle las extremidades todos los días."; + case 34: + return "Oye, por curiosidad, ¿ha dicho " + text2 + " por qué tiene que ir al médico?"; + case 35: + return "Debo hablar en serio con " + str3 + ". ¿Cuántas veces crees que puedes venir en una semana con quemaduras de lava graves?"; + case 36: + return "Creo que así estarás mejor."; + case 37: + return "Eh... ¿Qué te ha pasado en la cara?"; + case 38: + return "¡DIOS MÍO! Soy buena, pero no tanto."; + case 39: + return "Queridos amigos, nos hemos reunido hoy aquí para decir adiós a... Vaya, te vas a poner bien."; + case 40: + return "Te dejaste el brazo por ahí. Deja que te ayude..."; + case 41: + return "¡Deja de comportarte como un bebé! He visto cosas peores."; + case 42: + return "¡Voy a tener que darte puntos!"; + case 43: + return "¿Ya te has vuelto a meter en líos?"; + case 44: + return "Aguanta, por aquí tengo unas tiritas infantiles chulísimas."; + case 45: + return "Anda ya, " + Main.player[Main.myPlayer].name + ", te pondrás bien. Serás nenaza..."; + case 46: + return "¿Así que te duele cuando haces eso? ... Pues no lo hagas."; + case 47: + return "Parece un corte de digestión. ¿Has estado cazando babosas otra vez?"; + case 48: + return "Gira la cabeza y tose."; + case 49: + return "No es de las peores heridas que he visto... Sin duda, he visto heridas más grandes que esta."; + case 50: + return "¿Quieres una piruleta, chiquitín?"; + case 51: + return "A ver... ¿dónde te duele?"; + case 52: + return "Lo siento, pero no puedes pagarme."; + case 53: + return "Vas a necesitar más oro del que traes."; + case 54: + return "Oye, yo no trabajo gratis."; + case 55: + return "No tengo una varita mágica."; + case 56: + return "Esto es todo lo que puedo hacer por ti... necesitas cirugía plástica."; + case 57: + return "No me hagas perder el tiempo."; + case 58: + return "Dicen que en alguna parte del Inframundo hay una muñeca que se parece mucho a" + str3 + " Me gustaría dejarme caer por ahí."; + case 59: + return "¡Date prisa! Tengo una cita con " + text + " dentro de una hora."; + case 60: + return "Quiero lo que vende " + text + ". ¿Cómo dices? ¿Que no vende nada?"; + case 61: + return text3 + " es una monada. Es una lástima que sea tan mojigata."; + case 62: + return "Olvídate de " + str2 + ", yo tengo todo lo que necesitas aquí y ahora."; + case 63: + return "¿Qué mosca le ha picado a " + str2 + "? ¿Aún no sabe que vendemos cosas totalmente distintas?"; + case 64: + return "Oye, hace una noche magnífica para no hablar con nadie, ¿no crees, " + Main.player[Main.myPlayer].name + "?"; + case 65: + return "Me encantan estas noches. ¡Siempre encuentras algo que matar!"; + case 66: + return "Sé que le has echado el ojo al Minitiburón. Será mejor que no sepas de qué está hecho."; + case 67: + return "Eh, amigo, que esto no es una película. La munición va aparte."; + case 68: + return "¡Aparta esas manos de mi pistola, colega!"; + case 69: + return "¿Has probado a usar polvos de purificación sobre la piedra de ébano corrupta?"; + case 70: + return "Ojalá " + text2 + " dejara de flirtear conmigo. ¿No se da cuenta de que tengo 500 años?"; + case 71: + return "¿Por qué se empeña " + str + " en intentar venderme una estatua de ángel? Todo el mundo sabe que no hacen nada."; + case 72: + return "¿Has visto a ese anciano deambulando por la mazmorra? No tiene muy buen aspecto..."; + case 73: + return "¡Yo vendo lo que quiero! Si no te gusta, mala suerte."; + case 74: + return "¿Por qué tienes que ser tan polémico en estos tiempos que corren?"; + case 75: + return "No quiero que compres mis artículos. Quiero que desees comprar mis artículos, ¿entiendes?"; + case 76: + return "Tío, ¿soy yo o esta noche han salido de juerga un millón de zombis?"; + case 77: + return "Debes erradicar la corrupción de este mundo."; + case 78: + return "Ponte a salvo; ¡Terraria te necesita!"; + case 79: + return "Fluyen las arenas del tiempo. Y la verdad... no estás envejeciendo con mucha elegancia."; + case 80: + return "¿Qué tiene que ver conmigo eso de perro ladrador?"; + case 81: + return "Entra un duende en un bar y dice el dueño: \"A ver, quiero control, ¿eh?\". Y dice el duende: \"No, sin trol, sin trol\"."; + case 82: + return "No puedo dejarte entrar hasta que me liberes de esta maldición."; + case 83: + return "Si quieres entrar, vuelve por la noche."; + case 84: + return "No se puede invocar al maestro a la luz del día."; + case 85: + return "Eres demasiado débil para romper esta maldición. Vuelve cuando seas de más utilidad."; + case 86: + return "Eres patético. No esperes presentarte ante el maestro tal como eres."; + case 87: + return "Espero que hayas venido con varios amigos..."; + case 88: + return "Extraño, no, por favor. Esto es un suicidio."; + case 89: + return "Debes ser lo bastante fuerte para poder librarme de esta maldición..."; + case 90: + return "Extraño, ¿te crees con fuerzas para derrotar al maestro?"; + case 91: + return "¡Por favor! ¡Lucha con mi raptor y libérame! ¡Te lo suplico!"; + case 92: + return "Derrota al maestro y te garantizaré la entrada a la Mazmorra."; + case 93: + return "¿Conque intentando dominar esa piedra de ébano, eh? ¿Por qué no la metes en uno de estos explosivos?"; + case 94: + return "Eh, ¿has visto a un payaso por aquí?"; + case 95: + return "Había una bomba aquí mismo, y ahora no soy capaz de encontrarla..."; + case 96: + return "¡Yo les daré a esos zombis lo que necesitan!"; + case 97: + return "¡Incluso " + text2 + " quiere lo que vendo!"; + case 98: + return "Y pensé: ¿Qué prefieres? ¿Un agujero de bala o de granada?"; + case 99: + return "Seguro que " + text + " te ayudará si pierdes una extremidad con uno de estos por accidente."; + case 100: + return "¿Por qué purificar el mundo cuando puedes volarlo en pedazos?"; + case 101: + return "¡Si los lanzas a la bañera y cierras todas las ventanas, te despejará la nariz y los oídos!"; + case 102: + return "¿Quieres jugar con fuego, gallina?"; + case 103: + return "Oye, ¿firmarías esta renuncia de daños y perjuicios?"; + case 104: + return "¡AQUÍ NO SE PUEDE FUMAR!"; + case 105: + return "Los explosivos están de moda hoy en día. ¡Llévate algunos!"; + case 106: + return "¡Es un buen día para morir!"; + case 107: + return "Y qué pasa si... (¡BUM!)... Oh, lo siento, ¿usabas mucho esa pierna?"; + case 108: + return "Dinamita, mi propia panacea para todos los males."; + case 109: + return "Echa un vistazo a este género; ¡los precios son una bomba!"; + case 110: + return "Recuerdo vagamente haber atado a una mujer y haberla arrojado a una mazmorra."; + case 111: + return "¡Tenemos un problema! ¡Hoy tenemos luna sangrienta!"; + case 112: + return "Si fuera más joven, invitaría a " + text + " a salir. Yo antes era todo un galán."; + case 113: + return "Ese sombrero rojo me resulta familiar..."; + case 114: + return "Gracias otra vez por librarme de esta maldición. Sentí como si algo me hubiera saltado encima y me hubiera mordido."; + case 115: + return "Mamá siempre dijo que yo sería un buen sastre."; + case 116: + return "La vida es como un cajón de la ropa; ¡nunca sabes qué te vas a poner!"; + case 117: + return "¡Desde luego bordar es una tarea difícil! ¡Si no fuera así, nadie lo haría! Eso es lo que la hace tan genial."; + case 118: + return "Sé todo lo que hay que saber sobre el negocio de la confección."; + case 119: + return "La maldición me ha convertido en un ser solitario; una vez me hice amigo de un muñeco de cuero. Lo llamaba Wilson."; + case 120: + return "Gracias por liberarme, humano. Otros duendes me ataron y me dejaron aquí. Te puedes imaginar que no nos llevamos muy bien."; + case 121: + return "¡No puedo creer que me ataran y me dejaran aquí solo por decirles que no se dirigían al este!"; + case 122: + return "Ahora que soy un proscrito, ¿puedo tirar ya estas bolas de pinchos? Tengo los bolsillos destrozados."; + case 123: + return "¿Buscas un experto en artilugios? ¡Yo soy tu duende!"; + case 124: + return "Gracias por tu ayuda. Tengo que dejar de vagar por ahí sin rumbo. Seguro que nos volvemos a ver."; + case 125: + return "Creía que eras más alto."; + case 126: + return "Oye... ¿Qué trama " + text5 + "? ¿Tú... has hablado con ella, por un casual?"; + case 127: + return "Eh, ¿quieres un motor para tu sombrero? Creo que tengo un motor que quedaría de perlas en ese sombrero."; + case 128: + return "Ey, he oído que te gustan los cohetes y las bota de correr, ¿por qué no te pongo unos cohetes en las botas?"; + case 129: + return "El silencio es oro. Lo que daría por un poco de cinta adhesiva..."; + case 130: + return "Pues claro, el oro es más resistente que el hierro. ¿Pero qué os enseñan estos humanos de hoy?"; + case 131: + return "En fin, la idea de un casco de minero con alas quedaba mucho mejor sobre el papel."; + case 132: + return "Los duendes tienen un increíble predisposición al enfado. ¡De hecho, podrían declarar una guerra por una discusión sobre ropa!"; + case 133: + return "Sinceramente, la mayoría de los duendes no son precisamente ingenieros de cohetes. Bueno, algunos sí."; + case 134: + return "¿Tú sabes por qué llevamos estas bolas con pinchos? Porque yo no."; + case 135: + return "¡Acabo de terminar mi última creación! Esta versión no explota con violencia si respiras encima con fuerza."; + case 136: + return "Los duendes ladrones no son muy buenos en lo suyo. ¡Ni siquiera saben robar un cofre abierto!"; + case 137: + return "¡Gracias por salvarme, amigo! Estas ataduras me estaban haciendo rozaduras."; + case 138: + return "¡Oh, mi héroe!"; + case 139: + return "¡Oh, qué heroico! ¡Gracias por salvarme, jovencita!"; + case 140: + return "¡Oh, qué heroico por su parte! ¡Gracias por salvarme, jovencito!"; + case 141: + return "Ahora que nos conocemos, ¿me puedo ir a vivir contigo, verdad?"; + case 142: + return "¡Eh, hola, " + str3 + " ! ¿Qué puedo hacer hoy por ti?"; + case 143: + return "¡Eh, hola, " + str2 + "! ¿Qué puedo hacer hoy por ti?"; + case 144: + return "¡Eh, hola, " + text4 + "! ¿Qué puedo hacer hoy por ti?"; + case 145: + return "¡Eh, hola, " + text + "! ¿Qué puedo hacer hoy por ti?"; + case 146: + return "¡Eh, hola, " + text5 + "! ¿Qué puedo hacer hoy por ti?"; + case 147: + return "¡Eh, hola, " + text3 + "! ¿Qué puedo hacer hoy por ti?"; + case 148: + return "¿Quieres que saque una moneda de detrás de tu oreja? ¿No? Está bien."; + case 149: + return "¿Quieres un caramelo mágico? ¿No? Vale."; + case 150: + return "Si te gusta, mejor te hago un delicioso chocolate calentito... ¿Tampoco? Vale, está bien."; + case 151: + return "¿Has venido a echar un ojo a mi bola de cristal?"; + case 152: + return "¿Nunca has deseado tener un anillo mágico que convierta las piedras en babosas? La verdad es que yo tampoco."; + case 153: + return "Una vez me dijeron que la amistad es algo mágico. ¡Ridículo! No puedes convertir a nadie en rana con la amistad."; + case 154: + return "Veo tu futuro... ¡Vas a comprarme un montón de artículos!"; + case 155: + return "En cierta ocasión intenté devolverle la vida a una estatua de ángel. Pero no pasó nada."; + case 156: + return "¡Gracias! Era cuestión de tiempo que acabar como los demás esqueletos de ahí abajo."; + case 157: + return "¡Eh, mira por donde vas! ¡Llevo ahí desde hace... un rato!"; + case 158: + return "Espera un momento, más abajo tengo wifi."; + case 159: + return "¡Casi había acabado de poner luces intermitentes aquí arriba!"; + case 160: + return "NO TE MUEVAS. DEJÉ CAER MI LENTE DE CONTACTO."; + case 161: + return "Lo único que quiero es que el conmutador haga... ¿Qué?"; + case 162: + return "A ver si lo adivino. No has comprado suficiente cable. ¡Serás tonto!"; + case 163: + return "¿Podrías...? Solo... ¿Por favor...? ¿Vale? Está bien. Arrg."; + case 164: + return "No me gusta cómo me miras. Ahora estoy TRABAJANDO."; + case 165: + return string.Concat(new string[] + { + "Eh, ", + Main.player[Main.myPlayer].name, + "¿acabas de llegar de la casa de ", + text4, + "? ¿Por casualidad no te hablaría de mí?" + }); + case 166: + return text2 + " sigue insistiendo en pulir mi chapa de presión. Ya le he dicho que funciona pisándola."; + case 167: + return "¡Siempre compras más cable del que necesitas!"; + case 168: + return "¿Has comprobado que ese dispositivo esté enchufado?"; + case 169: + return "Oh, ¿sabes lo que necesita esta casa? Más luces intermitentes."; + case 170: + return "Sabrás que se avecina una luna sangrienta cuando el cielo se tiña de rojo. Hay algo en ella que hace que los monstruos ataquen en grupo."; + case 171: + return "Eh, amigo, ¿sabes dónde hay por aquí malahierba? Oh, no es por nada, solo preguntaba, nada más."; + case 172: + return "Si miraras hacia arriba, verías que ahora mismo la luna está roja."; + case 173: + return "Deberías quedarte en casa por la noche. Es muy peligroso andar por ahí en la oscuridad."; + case 174: + return "Saludos, " + Main.player[Main.myPlayer].name + ". ¿Te puedo ayudar en algo?"; + case 175: + return "Estoy aquí para aconsejarte sobre lo que debes ir haciendo. Te aconsejo que hables conmigo cuando estés atascado."; + case 176: + return "Dicen que hay una persona que te dirá cómo sobrevivir en esta tierra... oh, espera, sí soy yo."; + case 177: + return "Puedes usar el pico para cavar en la tierra y el hacha para talar árboles. Sitúa el cursor sobre el ladrillo y haz clic."; + case 178: + return "Si quieres sobrevivir, tendrás que crear armas y un refugio. Empieza talando árboles y recogiendo madera."; + case 179: + return "Pulsa ESC para acceder al menú de producción. Cuando tengas suficiente madera, crea un banco de trabajo, de este modo podrás crear otros objetos más elaborados siempre que permanezcas cerca del banco."; + case 180: + return "Puedes construir un refugio juntando madera y otros bloques que hay por el mundo. No olvides levantar y colocar paredes."; + case 181: + return "En cuanto tengas una espada de madera, puedes intentar recoger la baba de las babosas. Mezcla madera y baba para hacer una antorcha."; + case 182: + return "Para interactuar con el entorno y colocar objetos usa un martillo."; + case 183: + return "Deberías cavar una mina para encontrar mena de oro, con ella puedes crear objetos muy útiles."; + case 184: + return "Ahora que tienes un poco de oro, tendrás que convertirlo en un lingote para poder hacer objetos con él. Para ello necesitas un horno."; + case 185: + return "Puedes construir un horno con antorchas, madera y piedra. Asegúrate de no alejarte del banco de trabajo."; + case 186: + return "Necesitarás un yunque para crear objetos con los lingotes de metal."; + case 187: + return "Los yunques se pueden hacer de hierro o bien comprarse a un mercader."; + case 188: + return "En el Subsuelo hay corazones de cristal que puedes usar para aumentar al máximo tu vida. Para recogerlos, necesitarás un martillo."; + case 189: + return "Si recoges 10 estrellas caídas, podrás combinarlas para crear un objeto que aumente tu poder mágico."; + case 190: + return "Las estrellas caen del cielo a la tierra por la noche. Se pueden utilizar para toda clase de objetos útiles. Si ves una, date prisa en cogerla ya que desaparecen al amanecer."; + case 191: + return "Hay muchas formas de hacer que los demás se muden a nuestra ciudad. Por supuesto, necesitarán una casa en la que vivir."; + case 192: + return "Para que una habitación pueda ser considerada un hogar, debe tener una puerta, una silla, una mesa y una fuente de luz. No te olvides de las paredes de la casa."; + case 193: + return "En la misma casa no pueden vivir dos personas. Además, si se destruye una casa, esa persona deberá buscar un nuevo lugar donde vivir."; + case 194: + return "En la interfaz de vivienda puedes ver y asignar viviendas. Abre tu inventario y haz clic en el icono de casa."; + case 195: + return "Si quieres que un mercader se mude a una casa, deberás recoger una gran cantidad de dinero. Bastarán con 50 monedas de plata."; + case 196: + return "Para que se mude una enfermera, tendrías que aumentar al máximo tu nivel de vida."; + case 197: + return "Si tuvieras alguna pistola, seguro que aparecería algún traficante de armas para venderte municiones."; + case 198: + return "Deberías ponerte a prueba y derrotar a un monstruo corpulento. Eso llamaría la atención de una dríada."; + case 199: + return "Asegúrate de explorar la mazmorra a fondo. Podría haber prisioneros retenidos en la parte más profunda."; + case 200: + return "Quizás el anciano de la mazmorra quiera unirse a nosotros ahora que su maldición ha desaparecido."; + case 201: + return "Guarda bien las bombas que encuentres. Algún dinamitero querrá echarles un vistazo."; + case 202: + return "¿En realidad los duendes son tan distintos a nosotros que no podríamos vivir juntos en paz?"; + case 203: + return "He oído que por esta región vive un poderoso mago. Estate muy atento por si lo ves la próxima vez que viajes al Subsuelo."; + case 204: + return "Si juntas varios lentes en un altar demoníaco, probablemente encuentres la forma de invocar a un monstruo poderoso. Aunque te conviene esperar hasta la noche para hacerlo."; + case 205: + return "Puedes hacer cebo de gusanos con trozos podridos y polvo vil. Asegúrate de estar en una zona corrompida antes de usarlo."; + case 206: + return "Los altares demoníacos se suelen encontrar en La Corrupción. Deberás estar cerca de los altares para crear objetos nuevos."; + case 207: + return "Puedes hacerte un garfio extensible con un garfio y 3 cadenas. Los esqueletos se encuentran en las profundidades del Subsuelo y suelen llevar garfios; se pueden hacer cadenas con lingotes de hierro."; + case 208: + return "Si ves un jarron, ábrelo aunque sea a golpes. Contienen toda clase de suministros de utilidad."; + case 209: + return "Hay un tesoro escondido por el mundo. ¡En las profundidades del Subsuelo se pueden encontrar objetos maravillosos!"; + case 210: + return "Romper un orbe de las sombras a veces provoca la caída de un meteorito del cielo. Los orbes de las sombras se suelen encontrar en los abismos que rodean las zonas corrompidas"; + case 211: + return "Deberías dedicarte a recoger más corazones de cristal para aumentar tu nivel de vida hasta el máximo."; + case 212: + return "El equipo que llevas sencillamente no sirve. Debes mejorar tu armadura."; + case 213: + return "Creo que ya estás listo para tu primer gran batalla. Recoge de noche algunas lentes de los ojos y llévalas a un altar demoníaco."; + case 214: + return "Te conviene aumentar tu nivel de vida antes de enfrentarte al siguiente desafío. Con 15 corazones bastará."; + case 215: + return "La piedra de ébano que se encuentra en La Corrupción se puede purificar usando un poco de polvo de una dríada, o bien puedes destruirla con explosivos."; + case 216: + return "El siguiente paso debería ser explorar los abismos corrompidos. Encuentra y destruye todos los orbes de las sombras que encuentres."; + case 217: + return "No muy lejos de aquí hay una antigua mazmorra. Ahora sería un buen momento para ir a echar un vistazo."; + case 218: + return "Deberías intentar aumentar al máximo el nivel de vida que te queda. Prueba con 20 corazones."; + case 219: + return "Hay muchos tesoros por descubrir en la selva si estás dispuesto a cavar a suficiente profundidad."; + case 220: + return "El Inframundo se compone de un material llamado piedra infernal, perfecta para hacer armas y armaduras."; + case 221: + return "Cuando estés preparado para desafiar al guardián del Inframundo, tendrás que hacer un sacrificio viviente. Todo lo que necesitas para hacerlo lo encontrarás en el Inframundo."; + case 222: + return "No dejes de destruir todos los altares demoníacos que encuentres. ¡Algo bueno te sucederá si lo haces!"; + case 223: + return "A veces las almas se congregan en las criaturas caídas, en lugares de extrema luminosidad u oscuridad."; + case 224: + return "Ho ho ho y una botella de ... Ponche de huevo!"; + case 225: + return "Cuidado que me galletitas?"; + case 226: + return "¿Qué? Pensaste que no era real?"; + case 227: + return "Me las arreglé para coser la cara de nuevo. Tener más cuidado la próxima vez."; + case 228: + return "Que probablemente va a dejar una cicatriz."; + case 229: + return "Todos los mejores. No quiero verte saltar ya los acantilados."; + case 230: + return "Que no le dolía demasiado malo, ya lo hizo?"; + case 231: + return "Como si vivir bajo tierra no fuera suficientemente malo, idiotas como tú vienes mientras duermo y robar mis hijos."; + case 232: + return "Entre tú y yo, " + text3 + " es el único en quien confío. Ella es el único aquí que no se ha probado a comer o me utilice en una poción."; + case 233: + return "Traté de lamer mi mismo el otro día para ver lo que era la gran cosa, todo empezó azul brillante."; + case 234: + return "Cada vez que veo el color azul, que me hace deprimido y perezoso."; + case 235: + return "Usted no ha visto ningún cerdo de por aquí tienen ustedes? Mi hermano perdió la pierna a uno."; + case 236: + return "Todo el mundo en esta ciudad se siente un poco fuera. Me desperté a la fabricante de ropa de mascar en mi pie anoche."; + case 237: + return "Te voy a dar un descuento en su desgastes si se puede convencer a " + str4 + " venir a un ... tamaño."; + case 238: + return "Me siento como " + str4 + " es un poco incomprendido, que realmente es un tipo divertido."; + case 240: + return "No sé la Truffle Shuffle, así que deja de preguntar!"; + case 241: + return "Ha habido un enorme rumor de tal manera que está siendo difundida por mí, 'Si no puedes vencerlo, comérselo!"; + case 242: + return "Oy, ¿qué tienes en tu fluffer jiminy?"; + case 243: + return "Debería convertirse en un pirata del aire? He pensado en convertirse en un pirata del aire."; + case 244: + return "Ya se trate de lo que sería, un jetpack que se adapte muy bien!"; + case 245: + return "Me siento un poco mal humor en los últimos tiempos, por lo que basta con su palabrería que ragamuffin!"; + case 246: + return "Estoy muy curioso acerca de ese tipo " + str6 + ". ¿Con qué tipo de consumo no se mantiene como la locomoción?"; + case 247: + return "Ese tipo capitán me parece ser bastante bien a la bahía si sabes lo que significa!"; + case 248: + return "Muéstrame algunas artes!"; + case 249: + return "Me gusta su ... engranajes. ¿Viene en bronce?"; + case 250: + return "Una vez que ingrese la tierra santificada, verá un arco iris en el cielo. Te puedo ayudar con la pintura que, si lo desea."; + case 251: + return "Echa un vistazo a " + str5 + ". Eso sí que es una chica que es capaz de pintar la ciudad de rojo!"; + case 252: + return "Conozco la diferencia entre turquesa y azul-verde. Pero no voy a decirte."; + case 253: + return "Estoy de blanco de titanio, por lo que ni siquiera preguntar."; + case 254: + return "Pruebe swirly rosa y púrpura, que funciona, lo juro!"; + case 255: + return "No, no, no ... Hay toneladas de diferentes grises! No me refiero a ..."; + case 256: + return "Espero que no llueva otra vez hasta que esta pintura seca. Eso sería un desastre!"; + case 257: + return "Les traigo los colores más ricos a cambio de sus riquezas!"; + case 258: + return "Querida, lo que llevas puesto es demasiado monótono. Es absolutamente necesario tomar una lección en el teñido de su traje cansado!"; + case 259: + return "El único tipo de madera me molesta es teñido de caoba. Teñido cualquier otra madera es un desperdicio."; + case 260: + return "Tienes que hacer algo con " + str7 + ". Cada vez que venga por aquí, me lleva una semana para conseguir el olor de descuento!"; + case 261: + return "¿Qué médico soy yo? El médico brujo que soy."; + case 262: + return "El corazón de la magia es la naturaleza. La naturaleza de los corazones es magia."; + case 263: + return text + " puede ayudar a sanar su cuerpo, pero puedo hacer que encarnan la curación."; + case 264: + return "Elija con cuidado, " + Main.player[Main.myPlayer].name + ", mis productos son volátiles y mi arte oscuro, misterioso."; + case 265: + return "Tenemos que hablar. Es ... se trata de los partidos."; + case 266: + return "No puedo decidir lo que me gusta más: las partes, o después de los partidos."; + case 267: + return "Debemos crear un grupo de blinkroot, y también hay que establecer un después de la fiesta."; + case 268: + return "Wow, " + Main.player[Main.myPlayer].name + ", encontrarse con un hombre aventurero como tú me da ganas de fiesta!"; + case 269: + return "Ponga una bola de discoteca y luego te voy a mostrar cómo divertirse."; + case 270: + return "Fui a Suecia una vez, el partido duro, ¿por qué no te parece?"; + case 271: + return "Mi nombre es " + str5 + " pero la gente me llama partido popper. Sí. No sé, suena guay"; + case 272: + return "¿Es usted parte? A veces? Hm, bien entonces podemos hablar ..."; + case 273: + return "No soy un amante de la tierra, pero es mejor haber amado y perdido que nunca de amar a todos."; + case 274: + return "Yo ho ho y una botella de ...blinkroots!"; + case 275: + return "YAR! Es curioso que lo mencionaremos loros porque ... um ... ¿De qué estábamos hablando?"; + case 276: + return Main.player[Main.myPlayer].name + ", Vosotros sois una de las mejores jovencitas buscan esto aquí capitán ha visto en muchas de quince días!"; + case 277: + return "Manténgase fuera de mí botín, que Canalla!"; + case 278: + return "Lo que en llamas estás hablando? Moby Dick es la mía!"; + case 279: + return "*Yarr Blarr Harrdarr*"; + case 280: + return "Y entonces Unidad 492-8 dijo: Quién te crees que soy, Unidad 472-6? HA. HA. HA."; + case 281: + return "Mi eficiencia expedición se redujo crítica cuando un proyectil impactó mi locomotora actuador."; + case 282: + return "Esta oración es falsa, ¿o no?"; + case 283: + return "Así que 'punk chick buscando es un inventor, eh? Creo que ella pudiera mostrarle una cosa o dos!"; + case 284: + return "Claro, " + str7 + " y yo somos amigos, pero no me gusta cuando su loro hace su negocio en mí. Corrosiva es esa cosa!"; + case 285: + return "Yo mismo construí un mecanismo gusto, así que me puedo beber un poco de cerveza!"; + case 286: + return "A veces salgo un poco ... ¿Lo entiendes? un poco?"; + } + } + } + } + } + } + if (!english && Lang.lang > 1) + { + return Lang.dialog(l, true); + } + return ""; + } + public static string setBonus(int l, bool english = false) + { + if (Lang.lang <= 1 || english) + { + switch (l) + { + case 0: + return "2 defense"; + case 1: + return "3 defense"; + case 2: + return "15% increased movement speed"; + case 3: + return "Space Gun costs 0 mana"; + case 4: + return "20% chance to not consume ammo"; + case 5: + return "16% reduced mana usage"; + case 6: + return "17% extra melee damage"; + case 7: + return "30% increased mining speed"; + case 8: + return "14% reduced mana usage"; + case 9: + return "15% increased melee speed"; + case 10: + return "20% chance to not consume ammo"; + case 11: + return "17% reduced mana usage"; + case 12: + return "5% increased melee critical strike chance"; + case 13: + return "20% chance to not consume ammo"; + case 14: + return "19% reduced mana usage"; + case 15: + return "18% increased melee and movement speed"; + case 16: + return "25% chance to not consume ammo"; + case 17: + return "20% reduced mana usage"; + case 18: + return "19% increased melee and movement speed"; + case 19: + return "25% chance to not consume ammo"; + case 20: + return "1 defense"; + case 21: + return "Greatly increased life regen"; + case 22: + return "Melee and ranged attacks cause frostburn"; + case 23: + return "Increases your max number of minions"; + case 24: + return "Greatly increases life regeneration after striking an enemy"; + case 25: + return "Flower petals will fall on your target for extra damage"; + case 26: + return "Become immune after striking an enemy"; + case 27: + return "Summons a powerful leaf crystal to shoot at nearby enemies"; + case 28: + return "10% increased magic critical strike chance"; + case 29: + return "Attackers also take full damage"; + case 30: + return "Magic damage done to enemies heals the player with lowest health"; + case 31: + return "Not moving puts you stealth, increasing ranged ability and reducing chance for enemies to target you"; + case 32: + return "4 defense"; + } + } + else + { + if (Lang.lang == 2) + { + switch (l) + { + case 0: + return "2 Abwehr"; + case 1: + return "3 Abwehr"; + case 2: + return "Um 15% erhoehtes Bewegungstempo"; + case 3: + return "Astralpistole kostet 0 Mana"; + case 4: + return "20%ige Chance, Munition nicht zu verbrauchen"; + case 5: + return "Um 16% reduzierte Mananutzung"; + case 6: + return "17% Extra Nahkampfschaden"; + case 7: + return "Um 20% erhoehtes Abbautempo"; + case 8: + return "Um 14% reduzierte Mananutzung"; + case 9: + return "Um 15% erhoehtes Nahkampftempo"; + case 10: + return "20%ige Chance, Munition nicht zu verbrauchen"; + case 11: + return "Um 17% reduzierte Mananutzung"; + case 12: + return "5% Erhoehte kritische Nahkampf-Trefferchance"; + case 13: + return "20%ige Chance, Munition nicht zu verbrauchen"; + case 14: + return "Um 19% reduzierte Mananutzung"; + case 15: + return "18% Erhoehtes Nahkampf-und Bewegungstempo"; + case 16: + return "25%ige Chance, Munition nicht zu verbrauchen"; + case 17: + return "Um 20% reduzierte Mananutzung"; + case 18: + return "19% Erhoehtes Nahkampf-und Bewegungstempo"; + case 19: + return "25%ige Chance, Munition nicht zu verbrauchen"; + case 20: + return "4 defense"; + } + } + else + { + if (Lang.lang == 3) + { + switch (l) + { + case 0: + return "2 difesa"; + case 1: + return "3 difesa"; + case 2: + return "Velocità di movimento aumentata del 15%"; + case 3: + return "La pistola spaziale costa 0 mana"; + case 4: + return "20% di possibilità di non consumare munizioni"; + case 5: + return "Consumo mana ridotto del 16%"; + case 6: + return "17% i danni melee in più"; + case 7: + return "Velocità di estrazione aumentata del 20%"; + case 8: + return "Consumo mana ridotto del 14%"; + case 9: + return "Velocità del corpo a corpo aumentata del 15%"; + case 10: + return "20% di possibilità di non consumare munizioni"; + case 11: + return "Consumo mana ridotto del 17%"; + case 12: + return "5% Possibilità di colpo critico nel corpo a corpo aumentata"; + case 13: + return "20% di possibilità di non consumare munizioni"; + case 14: + return "Consumo mana ridotto del 19%"; + case 15: + return "18% Velocità di corpo a corpo e movimento aumentata"; + case 16: + return "25% di possibilità di non consumare munizioni"; + case 17: + return "Consumo mana ridotto del 20%"; + case 18: + return "19% Velocità di corpo a corpo e movimento aumentata"; + case 19: + return "25% di possibilità di non consumare munizioni"; + } + } + else + { + if (Lang.lang == 4) + { + switch (l) + { + case 0: + return "2 de défense"; + case 1: + return "3 de défense"; + case 2: + return "Vitesse de déplacement augmentée de 15 %"; + case 3: + return "Le fusil de l'espace coûte 0 mana"; + case 4: + return "20 % de chance de n'utiliser aucune munition"; + case 5: + return "Utilisation de mana réduite de 16 %"; + case 6: + return "17% de dégâts de mêlée supplémentaires"; + case 7: + return "Vitesse d'extraction minière augmentée de 20 %"; + case 8: + return "Utilisation de mana réduite de 14 %"; + case 9: + return "Vitesse de mêlée augmentée de 15 %"; + case 10: + return "20 % de chance de n'utiliser aucune munition"; + case 11: + return "Utilisation de mana réduite de 17 %"; + case 12: + return "5% Chance de coup critique de mêlée augmentée"; + case 13: + return "20 % de chance de n'utiliser aucune munition"; + case 14: + return "Utilisation de mana réduite de 19 %"; + case 15: + return "18% Vitesse de mouvement et de mêlée augmentée"; + case 16: + return "25 % de chance de n'utiliser aucune munition"; + case 17: + return "Utilisation de mana réduite de 20 %"; + case 18: + return "19% Vitesse de mouvement et de mêlée augmentée"; + case 19: + return "25 % de chance de n'utiliser aucune munition"; + } + } + else + { + if (Lang.lang == 5) + { + switch (l) + { + case 0: + return "2 defensa"; + case 1: + return "3 defensa"; + case 2: + return "Aumenta en un 15% la velocidad de movimiento"; + case 3: + return "La pistola espacial no cuesta maná"; + case 4: + return "Probabilidad del 20% de no gastar munición"; + case 5: + return "Reduce el uso de maná en un 16%"; + case 6: + return "17% de daño cuerpo a cuerpo adicional"; + case 7: + return "Aumenta en un 20% la velocidad de excavación"; + case 8: + return "Reduce el uso de maná en un 14%"; + case 9: + return "Aumenta un 15% la velocidad en el cuerpo a cuerpo"; + case 10: + return "Probabilidad del 20% de no gastar munición"; + case 11: + return "Reduce el uso de maná en un 17%"; + case 12: + return "Aumenta la probabilidad de ataque crítico en el cuerpo a cuerpo"; + case 13: + return "Probabilidad del 20% de no gastar munición"; + case 14: + return "Reduce el uso de maná en un 19%"; + case 15: + return "18% Aumenta la velocidad de movimiento y en el cuerpo a cuerpo"; + case 16: + return "Probabilidad del 25% de no gastar munición"; + case 17: + return "Reduce el uso de maná en un 20%"; + case 18: + return "19% Aumenta la velocidad de movimiento y en el cuerpo a cuerpo"; + case 19: + return "Probabilidad del 25% de no gastar munición"; + } + } + } + } + } + } + if (!english && Lang.lang > 1) + { + return Lang.setBonus(l, true); + } + return ""; + } + public static string npcName(int l, bool english = false) + { + if (Lang.lang <= 1 || english) + { + switch (l) + { + case -65: + return "Hornet"; + case -64: + return "Hornet"; + case -63: + return "Hornet"; + case -62: + return "Hornet"; + case -61: + return "Hornet"; + case -60: + return "Hornet"; + case -59: + return "Hornet"; + case -58: + return "Hornet"; + case -57: + return "Hornet"; + case -56: + return "Hornet"; + case -55: + return "Zombie"; + case -54: + return "Zombie"; + case -53: + return "Skeleton"; + case -52: + return "Skeleton"; + case -51: + return "Skeleton"; + case -50: + return "Skeleton"; + case -49: + return "Skeleton"; + case -48: + return "Skeleton"; + case -47: + return "Skeleton"; + case -46: + return "Skeleton"; + case -45: + return "Zombie"; + case -44: + return "Zombie"; + case -43: + return "Demon Eye"; + case -42: + return "Demon Eye"; + case -41: + return "Demon Eye"; + case -40: + return "Demon Eye"; + case -39: + return "Demon Eye"; + case -38: + return "Demon Eye"; + case -37: + return "Zombie"; + case -36: + return "Zombie"; + case -35: + return "Zombie"; + case -34: + return "Zombie"; + case -33: + return "Zombie"; + case -32: + return "Zombie"; + case -31: + return "Zombie"; + case -30: + return "Zombie"; + case -29: + return "Zombie"; + case -28: + return "Zombie"; + case -27: + return "Zombie"; + case -26: + return "Zombie"; + case -25: + return "Crimslime"; + case -24: + return "Crimslime"; + case -23: + return "Crimera"; + case -22: + return "Crimera"; + case -21: + return "Moss Hornet"; + case -20: + return "Moss Hornet"; + case -19: + return "Moss Hornet"; + case -18: + return "Moss Hornet"; + case -17: + return "Hornet"; + case -16: + return "Hornet"; + case -15: + return "Armored Skeleton"; + case -14: + return "Angry Bones"; + case -13: + return "Angry Bones"; + case -12: + return "Eater of Souls"; + case -11: + return "Eater of Souls"; + case -10: + return "Jungle Slime"; + case -9: + return "Yellow Slime"; + case -8: + return "Red Slime"; + case -7: + return "Purple Slime"; + case -6: + return "Black Slime"; + case -5: + return "Baby Slime"; + case -4: + return "Pinky"; + case -3: + return "Green Slime"; + case -2: + return "Slimer"; + case -1: + return "Slimeling"; + case 1: + return "Blue Slime"; + case 2: + return "Demon Eye"; + case 3: + return "Zombie"; + case 4: + return "Eye of Cthulhu"; + case 5: + return "Servant of Cthulhu"; + case 6: + return "Eater of Souls"; + case 7: + return "Devourer"; + case 8: + return "Devourer"; + case 9: + return "Devourer"; + case 10: + return "Giant Worm"; + case 11: + return "Giant Worm"; + case 12: + return "Giant Worm"; + case 13: + return "Eater of Worlds"; + case 14: + return "Eater of Worlds"; + case 15: + return "Eater of Worlds"; + case 16: + return "Mother Slime"; + case 17: + return "Merchant"; + case 18: + return "Nurse"; + case 19: + return "Arms Dealer"; + case 20: + return "Dryad"; + case 21: + return "Skeleton"; + case 22: + return "Guide"; + case 23: + return "Meteor Head"; + case 24: + return "Fire Imp"; + case 25: + return "Burning Sphere"; + case 26: + return "Goblin Peon"; + case 27: + return "Goblin Thief"; + case 28: + return "Goblin Warrior"; + case 29: + return "Goblin Sorcerer"; + case 30: + return "Chaos Ball"; + case 31: + return "Angry Bones"; + case 32: + return "Dark Caster"; + case 33: + return "Water Sphere"; + case 34: + return "Cursed Skull"; + case 35: + return "Skeletron"; + case 36: + return "Skeletron"; + case 37: + return "Old Man"; + case 38: + return "Demolitionist"; + case 39: + return "Bone Serpent"; + case 40: + return "Bone Serpent"; + case 41: + return "Bone Serpent"; + case 42: + return "Hornet"; + case 43: + return "Man Eater"; + case 44: + return "Undead Miner"; + case 45: + return "Tim"; + case 46: + return "Bunny"; + case 47: + return "Corrupt Bunny"; + case 48: + return "Harpy"; + case 49: + return "Cave Bat"; + case 50: + return "King Slime"; + case 51: + return "Jungle Bat"; + case 52: + return "Doctor Bones"; + case 53: + return "The Groom"; + case 54: + return "Clothier"; + case 55: + return "Goldfish"; + case 56: + return "Snatcher"; + case 57: + return "Corrupt Goldfish"; + case 58: + return "Piranha"; + case 59: + return "Lava Slime"; + case 60: + return "Hellbat"; + case 61: + return "Vulture"; + case 62: + return "Demon"; + case 63: + return "Blue Jellyfish"; + case 64: + return "Pink Jellyfish"; + case 65: + return "Shark"; + case 66: + return "Voodoo Demon"; + case 67: + return "Crab"; + case 68: + return "Dungeon Guardian"; + case 69: + return "Antlion"; + case 70: + return "Spike Ball"; + case 71: + return "Dungeon Slime"; + case 72: + return "Blazing Wheel"; + case 73: + return "Goblin Scout"; + case 74: + return "Bird"; + case 75: + return "Pixie"; + case 77: + return "Armored Skeleton"; + case 78: + return "Mummy"; + case 79: + return "Dark Mummy"; + case 80: + return "Light Mummy"; + case 81: + return "Corrupt Slime"; + case 82: + return "Wraith"; + case 83: + return "Cursed Hammer"; + case 84: + return "Enchanted Sword"; + case 85: + return "Mimic"; + case 86: + return "Unicorn"; + case 87: + return "Wyvern"; + case 88: + return "Wyvern"; + case 89: + return "Wyvern"; + case 90: + return "Wyvern"; + case 91: + return "Wyvern"; + case 92: + return "Wyvern"; + case 93: + return "Giant Bat"; + case 94: + return "Corruptor"; + case 95: + return "Digger"; + case 96: + return "Digger"; + case 97: + return "Digger"; + case 98: + return "World Feeder"; + case 99: + return "World Feeder"; + case 100: + return "World Feeder"; + case 101: + return "Clinger"; + case 102: + return "Angler Fish"; + case 103: + return "Green Jellyfish"; + case 104: + return "Werewolf"; + case 105: + return "Bound Goblin"; + case 106: + return "Bound Wizard"; + case 107: + return "Goblin Tinkerer"; + case 108: + return "Wizard"; + case 109: + return "Clown"; + case 110: + return "Skeleton Archer"; + case 111: + return "Goblin Archer"; + case 112: + return "Vile Spit"; + case 113: + return "Wall of Flesh"; + case 114: + return "Wall of Flesh"; + case 115: + return "The Hungry"; + case 116: + return "The Hungry"; + case 117: + return "Leech"; + case 118: + return "Leech"; + case 119: + return "Leech"; + case 120: + return "Chaos Elemental"; + case 121: + return "Slimer"; + case 122: + return "Gastropod"; + case 123: + return "Bound Mechanic"; + case 124: + return "Mechanic"; + case 125: + return "Retinazer"; + case 126: + return "Spazmatism"; + case 127: + return "Skeletron Prime"; + case 128: + return "Prime Cannon"; + case 129: + return "Prime Saw"; + case 130: + return "Prime Vice"; + case 131: + return "Prime Laser"; + case 132: + return "Zombie"; + case 133: + return "Wandering Eye"; + case 134: + return "The Destroyer"; + case 135: + return "The Destroyer"; + case 136: + return "The Destroyer"; + case 137: + return "Illuminant Bat"; + case 138: + return "Illuminant Slime"; + case 139: + return "Probe"; + case 140: + return "Possessed Armor"; + case 141: + return "Toxic Sludge"; + case 142: + return "Santa Claus"; + case 143: + return "Snowman Gangsta"; + case 144: + return "Mister Stabby"; + case 145: + return "Snow Balla"; + case 147: + return "Ice Slime"; + case 148: + return "Penguin"; + case 149: + return "Penguin"; + case 150: + return "Ice Bat"; + case 151: + return "Lava Bat"; + case 152: + return "Giant Flying Fox"; + case 153: + return "Giant Tortoise"; + case 154: + return "Ice Tortoise"; + case 155: + return "Wolf"; + case 156: + return "Red Devil"; + case 157: + return "Arapaima"; + case 158: + return "Vampire"; + case 159: + return "Vampire"; + case 160: + return "Truffle"; + case 161: + return "Zombie Eskimo"; + case 162: + return "Frankenstein"; + case 163: + return "Black Recluse"; + case 164: + return "Wall Creeper"; + case 165: + return "Wall Creeper"; + case 166: + return "Swamp Thing"; + case 167: + return "Undead Viking"; + case 168: + return "Corrupt Penguin"; + case 169: + return "Ice Elemental"; + case 170: + return "Pigron"; + case 171: + return "Pigron"; + case 172: + return "Rune Wizard"; + case 173: + return "Crimera"; + case 174: + return "Herpling"; + case 175: + return "Angry Trapper"; + case 176: + return "Moss Hornet"; + case 177: + return "Derpling"; + case 178: + return "Steampunker"; + case 179: + return "Crimson Axe"; + case 180: + return "Pigron"; + case 181: + return "Face Monster"; + case 182: + return "Floaty Gross"; + case 183: + return "Crimslime"; + case 184: + return "Spiked Ice Slime"; + case 185: + return "Snow Flinx"; + case 186: + return "Zombie"; + case 187: + return "Zombie"; + case 188: + return "Zombie"; + case 189: + return "Zombie"; + case 190: + return "Demon Eye"; + case 191: + return "Demon Eye"; + case 192: + return "Demon Eye"; + case 193: + return "Demon Eye"; + case 194: + return "Demon Eye"; + case 195: + return "Lost Girl"; + case 196: + return "Nymph"; + case 197: + return "Armored Viking"; + case 198: + return "Lihzahrd"; + case 199: + return "Lihzahrd"; + case 200: + return "Zombie"; + case 201: + return "Skeleton"; + case 202: + return "Skeleton"; + case 203: + return "Skeleton"; + case 204: + return "Spiked Jungle Slime"; + case 205: + return "Moth"; + case 206: + return "Icy Merman"; + case 207: + return "Dye Trader"; + case 208: + return "Party Girl"; + case 209: + return "Cyborg"; + case 210: + return "Bee"; + case 211: + return "Bee"; + case 212: + return "Pirate Deckhand"; + case 213: + return "Pirate Corsair"; + case 214: + return "Pirate Deadeye"; + case 215: + return "Pirate Crossbower"; + case 216: + return "Pirate Captain"; + case 217: + return "Cochineal Beetle"; + case 218: + return "Cyan Beetle"; + case 219: + return "Lac Beetle"; + case 220: + return "Sea Snail"; + case 221: + return "Squid"; + case 222: + return "Queen Bee"; + case 223: + return "Zombie"; + case 224: + return "Flying Fish"; + case 225: + return "Umbrella Slime"; + case 226: + return "Flying Snake"; + case 227: + return "Painter"; + case 228: + return "Witch Doctor"; + case 229: + return "Pirate"; + case 230: + return "Goldfish"; + case 231: + return "Hornet"; + case 232: + return "Hornet"; + case 233: + return "Hornet"; + case 234: + return "Hornet"; + case 235: + return "Hornet"; + case 236: + return "Jungle Creeper"; + case 237: + return "Jungle Creeper"; + case 238: + return "Black Recluse"; + case 239: + return "Blood Crawler"; + case 240: + return "Blood Crawler"; + case 241: + return "Blood Feeder"; + case 242: + return "Blood Jelly"; + case 243: + return "Ice Golem"; + case 244: + return "Rainbow Slime"; + case 245: + return "Golem"; + case 246: + return "Golem Head"; + case 247: + return "Golem Fist"; + case 248: + return "Golem Fist"; + case 249: + return "Golem Head"; + case 250: + return "Angry Nimbus"; + case 251: + return "Eyezor"; + case 252: + return "Parrot"; + case 253: + return "Reaper"; + case 254: + return "Zombie"; + case 255: + return "Zombie"; + case 256: + return "Fungo Fish"; + case 257: + return "Anomura Fungus"; + case 258: + return "Mushi Ladybug"; + case 259: + return "Fungi Bulb"; + case 260: + return "Giant Fungi Bulb"; + case 261: + return "Fungi Spore"; + case 262: + return "Plantera"; + case 263: + return "Plantera's Hook"; + case 264: + return "Plantera's Tentacle"; + case 265: + return "Spore"; + case 266: + return "Brain of Cthulhu"; + case 267: + return "Creeper"; + case 268: + return "Ichor Sticker"; + case 269: + return "Rusty Armored Bones"; + case 270: + return "Rusty Armored Bones"; + case 271: + return "Rusty Armored Bones"; + case 272: + return "Rusty Armored Bones"; + case 273: + return "Blue Armored Bones"; + case 274: + return "Blue Armored Bones"; + case 275: + return "Blue Armored Bones"; + case 276: + return "Blue Armored Bones"; + case 277: + return "Hell Armored Bones"; + case 278: + return "Hell Armored Bones"; + case 279: + return "Hell Armored Bones"; + case 280: + return "Hell Armored Bones"; + case 281: + return "Ragged Caster"; + case 282: + return "Ragged Caster"; + case 283: + return "Necromancer"; + case 284: + return "Necromancer"; + case 285: + return "Diabolist"; + case 286: + return "Diabolist"; + case 287: + return "Bone Lee"; + case 288: + return "Dungeon Spirit"; + case 289: + return "Giant Cursed Skull"; + case 290: + return "Paladin"; + case 291: + return "Skeleton Sniper"; + case 292: + return "Tactical Skeleton"; + case 293: + return "Skeleton Commando"; + case 294: + return "Angry Bones"; + case 295: + return "Angry Bones"; + case 296: + return "Angry Bones"; + case 297: + return "Blue Jay"; + case 298: + return "Cardinal"; + case 299: + return "Squirrel"; + case 300: + return "Mouse"; + } + } + else + { + if (Lang.lang == 2) + { + switch (l) + { + case -17: + return "Riesenhornisse"; + case -16: + return "Minihornisse"; + case -15: + return "Mammutskelett"; + case -14: + return "Grossknochen"; + case -13: + return "Kleinknochen"; + case -12: + return "Maxifresser"; + case -11: + return "Minifresser"; + case -10: + return "Dschungelschleimi"; + case -9: + return "Gelbschleimi"; + case -8: + return "Rotschleimi"; + case -7: + return "Lila Schleimi"; + case -6: + return "Schwarzschleimi"; + case -5: + return "Schleimbaby"; + case -4: + return "Pinky"; + case -3: + return "Gruenschleimi"; + case -2: + return "Flugschleimi"; + case -1: + return "Schleimling"; + case 1: + return "Blauschleimi"; + case 2: + return "Daemonenauge"; + case 3: + return "Zombie"; + case 4: + return "Auge von Cthulhu"; + case 5: + return "Diener von Cthulhu"; + case 6: + return "Seelenfresser"; + case 7: + return "Verschlinger"; + case 8: + return "Verschlinger"; + case 9: + return "Verschlinger"; + case 10: + return "Riesenwurm"; + case 11: + return "Riesenwurm"; + case 12: + return "Riesenwurm"; + case 13: + return "Weltenfresser"; + case 14: + return "Weltenfresser"; + case 15: + return "Weltenfresser"; + case 16: + return "Schleimmami"; + case 17: + return "Haendler"; + case 18: + return "Krankenschwester"; + case 19: + return "Waffenhaendler"; + case 20: + return "Dryade"; + case 21: + return "Skelett"; + case 22: + return "Fremdenfuehrer"; + case 23: + return "Meteorenkopf"; + case 24: + return "Feuer-Imp"; + case 25: + return "Flammenkugel"; + case 26: + return "Goblin-Arbeiter"; + case 27: + return "Goblin-Dieb"; + case 28: + return "Goblin-Krieger"; + case 29: + return "Goblin-Hexer"; + case 30: + return "Chaoskugel"; + case 31: + return "Wutknochen"; + case 32: + return "Duestermagier"; + case 33: + return "Wasserkugel"; + case 34: + return "Fluchschaedel"; + case 35: + return "Skeletron"; + case 36: + return "Skeletron"; + case 37: + return "Greis"; + case 38: + return "Sprengmeister"; + case 39: + return "Knochenschlange"; + case 40: + return "Knochenschlange"; + case 41: + return "Knochenschlange"; + case 42: + return "Hornisse"; + case 43: + return "Menschenfresser"; + case 44: + return "Bergmann-Untoter"; + case 45: + return "Tim"; + case 46: + return "Haeschen"; + case 47: + return "Verderbnishaeschen"; + case 48: + return "Harpyie"; + case 49: + return "Hoehlenfledermaus"; + case 50: + return "Schleimi-Koenig"; + case 51: + return "Dschungelfledermaus"; + case 52: + return "Doktor Bones"; + case 53: + return "Braeutigam"; + case 54: + return "Kleiderhaendler"; + case 55: + return "Goldfisch"; + case 56: + return "Schnapper"; + case 57: + return "Verderbnisgoldfisch"; + case 58: + return "Piranha"; + case 59: + return "Lava-Schleimi"; + case 60: + return "Hoellenfledermaus"; + case 61: + return "Geier"; + case 62: + return "Daemon"; + case 63: + return "Blauqualle"; + case 64: + return "Pinkqualle"; + case 65: + return "Hai"; + case 66: + return "Voodoo-Daemon"; + case 67: + return "Krabbe"; + case 68: + return "Dungeon-Waechter"; + case 69: + return "Ameisenloewe"; + case 70: + return "Nagelball"; + case 71: + return "Dungeon-Schleimi"; + case 72: + return "Flammenrad"; + case 73: + return "Goblin-Spaeher"; + case 74: + return "Vogel"; + case 75: + return "Pixie"; + case 76: + return ""; + case 77: + return "Ruestungsskelett"; + case 78: + return "Mumie"; + case 79: + return "Finstermumie"; + case 80: + return "Lichtmumie"; + case 81: + return "Verderbnisschleimi"; + case 82: + return "Monstergeist"; + case 83: + return "Fluchhammer"; + case 84: + return "Zauberschwert"; + case 85: + return "Imitator"; + case 86: + return "Einhorn"; + case 87: + return "Lindwurm"; + case 88: + return "Lindwurm"; + case 89: + return "Lindwurm"; + case 90: + return "Lindwurm"; + case 91: + return "Lindwurm"; + case 92: + return "Lindwurm"; + case 93: + return "Riesenfledermaus"; + case 94: + return "Verderber"; + case 95: + return "Wuehler"; + case 96: + return "Wuehler"; + case 97: + return "Wuehler"; + case 98: + return "Weltspeiser"; + case 99: + return "Weltspeiser"; + case 100: + return "Weltspeiser"; + case 101: + return "Klette"; + case 102: + return "Seeteufel"; + case 103: + return "Gruenqualle"; + case 104: + return "Werwolf"; + case 105: + return "Gebundener Goblin"; + case 106: + return "Gebundener Zauberer"; + case 107: + return "Goblin-Tueftler"; + case 108: + return "Zauberer"; + case 109: + return "Clown"; + case 110: + return "Skelettbogenschuetze"; + case 111: + return "Goblin-Bogenschuetze"; + case 112: + return "Ekelspeichel"; + case 113: + return "Fleischwand"; + case 114: + return "Fleischwand"; + case 115: + return "Fressmaul"; + case 116: + return "Fressmaul"; + case 117: + return "Blutegel"; + case 118: + return "Blutegel"; + case 119: + return "Blutegel"; + case 120: + return "Elementarchaos"; + case 121: + return "Flugschleimi"; + case 122: + return "Bauchfuessler"; + case 123: + return "Gebundene Mechanikerin"; + case 124: + return "Mechanikerin"; + case 125: + return "Retinator"; + case 126: + return "Spasmator"; + case 127: + return "Super-Skeletron"; + case 128: + return "Super-Kanone"; + case 129: + return "Super-Saege"; + case 130: + return "Super-Zange"; + case 131: + return "Super-Laser"; + case 132: + return "Zombie"; + case 133: + return "Wanderauge"; + case 134: + return "Zerstoerer"; + case 135: + return "Zerstoerer"; + case 136: + return "Zerstoerer"; + case 137: + return "Leuchtledermaus"; + case 138: + return "Leuchtschleimi"; + case 139: + return "Sonde"; + case 140: + return "Geisterruestung"; + case 141: + return "Giftschlamm"; + case 142: + return "Weihnachtsmann"; + case 143: + return "Snowman Gangsta"; + case 144: + return "Herr Stabby"; + case 145: + return "Schnee Balla"; + } + } + else + { + if (Lang.lang == 3) + { + switch (l) + { + case -17: + return "Vespa grande"; + case -16: + return "Vespa piccola"; + case -15: + return "Scheletro pesante"; + case -14: + return "Disossato"; + case -13: + return "Ossa corte"; + case -12: + return "Grande mangiatore"; + case -11: + return "Piccolo mangiatore"; + case -10: + return "Slime della giungla"; + case -9: + return "Slime giallo"; + case -8: + return "Slime rosso"; + case -7: + return "Slime viola"; + case -6: + return "Slime nero"; + case -5: + return "Slime baby"; + case -4: + return "Mignolo"; + case -3: + return "Slime verde"; + case -2: + return "Slimer"; + case -1: + return "Slimeling"; + case 1: + return "Slime blu"; + case 2: + return "Occhio demoniaco"; + case 3: + return "Zombi"; + case 4: + return "Occhio di Cthulhu"; + case 5: + return "Servo di Cthulhu"; + case 6: + return "Mangiatore di anime"; + case 7: + return "Divoratore"; + case 8: + return "Divoratore"; + case 9: + return "Divoratore"; + case 10: + return "Verme gigante"; + case 11: + return "Verme gigante"; + case 12: + return "Verme gigante"; + case 13: + return "Mangiatore di mondi"; + case 14: + return "Mangiatore di mondi"; + case 15: + return "Mangiatore di mondi"; + case 16: + return "Slime madre"; + case 17: + return "Mercante"; + case 18: + return "Infermiera"; + case 19: + return "Mercante di armi"; + case 20: + return "Driade"; + case 21: + return "Scheletro"; + case 22: + return "Guida"; + case 23: + return "Testa di meteorite"; + case 24: + return "Diavoletto di fuoco"; + case 25: + return "Sfera infuocata"; + case 26: + return "Goblin operaio"; + case 27: + return "Goblin ladro"; + case 28: + return "Goblin guerriero"; + case 29: + return "Goblin stregone"; + case 30: + return "Palla del caos"; + case 31: + return "Ossa arrabbiate"; + case 32: + return "Lanciatore oscuro"; + case 33: + return "Sfera d'acqua"; + case 34: + return "Teschio maledetto"; + case 35: + return "Skeletron"; + case 36: + return "Skeletron"; + case 37: + return "Vecchio"; + case 38: + return "Esperto in demolizioni"; + case 39: + return "Serpente di ossa"; + case 40: + return "Serpente di ossa"; + case 41: + return "Serpente di ossa"; + case 42: + return "Calabrone"; + case 43: + return "Mangiauomini"; + case 44: + return "Minatore non-morto"; + case 45: + return "Tim"; + case 46: + return "Coniglio"; + case 47: + return "Coniglio distrutto"; + case 48: + return "Arpia"; + case 49: + return "Pipistrello della caverna"; + case 50: + return "Slime re"; + case 51: + return "Pipistrello della giungla"; + case 52: + return "Dottor ossa"; + case 53: + return "Lo sposo"; + case 54: + return "Mercante di abiti"; + case 55: + return "Pesce rosso"; + case 56: + return "Pianta afferratrice"; + case 57: + return "Pesce rosso distrutto"; + case 58: + return "Piranha"; + case 59: + return "Slime di lava"; + case 60: + return "Pipistrello dell'inferno"; + case 61: + return "Avvoltoio"; + case 62: + return "Demone"; + case 63: + return "Medusa blu"; + case 64: + return "Medusa rosa"; + case 65: + return "Squalo"; + case 66: + return "Demone voodoo"; + case 67: + return "Granchio"; + case 68: + return "Guardiano delle segrete"; + case 69: + return "Formicaleone"; + case 70: + return "Sfera con spuntoni"; + case 71: + return "Slime delle segrete"; + case 72: + return "Ruota ardente"; + case 73: + return "Goblin ricognitore"; + case 74: + return "Uccello"; + case 75: + return "Folletto"; + case 76: + return ""; + case 77: + return "Scheletro corazzato"; + case 78: + return "Mummia"; + case 79: + return "Mummia oscura"; + case 80: + return "Mummia chiara"; + case 81: + return "Slime distrutto"; + case 82: + return "Fantasma"; + case 83: + return "Martello maledetto"; + case 84: + return "Spada incantata"; + case 85: + return "Sosia"; + case 86: + return "Unicorno"; + case 87: + return "Viverna"; + case 88: + return "Viverna"; + case 89: + return "Viverna"; + case 90: + return "Viverna"; + case 91: + return "Viverna"; + case 92: + return "Viverna"; + case 93: + return "Pipistrello gigante"; + case 94: + return "Distruttore"; + case 95: + return "Scavatore"; + case 96: + return "Scavatore"; + case 97: + return "Scavatore"; + case 98: + return "Alimentatore del mondo"; + case 99: + return "Alimentatore del mondo"; + case 100: + return "Alimentatore del mondo"; + case 101: + return "Appiccicoso"; + case 102: + return "Rana pescatrice"; + case 103: + return "Medusa verde"; + case 104: + return "Lupo mannaro"; + case 105: + return "Goblin legato"; + case 106: + return "Stregone legato"; + case 107: + return "Goblin inventore"; + case 108: + return "Stregone"; + case 109: + return "Clown"; + case 110: + return "Scheletro arciere"; + case 111: + return "Goblin arciere"; + case 112: + return "Bava disgustosa"; + case 113: + return "Muro di carne"; + case 114: + return "Muro di carne"; + case 115: + return "L'Affamato"; + case 116: + return "L'Affamato"; + case 117: + return "Sanguisuga"; + case 118: + return "Sanguisuga"; + case 119: + return "Sanguisuga"; + case 120: + return "Elementale del caos"; + case 121: + return "Slimer"; + case 122: + return "Gasteropodo"; + case 123: + return "Meccanico legata"; + case 124: + return "Meccanico"; + case 125: + return "Retinazer"; + case 126: + return "Spazmatism"; + case 127: + return "Skeletron primario"; + case 128: + return "Cannone primario"; + case 129: + return "Sega primaria"; + case 130: + return "Morsa primaria"; + case 131: + return "Laser primario"; + case 132: + return "Zombi"; + case 133: + return "Occhio errante"; + case 134: + return "Il Distruttore"; + case 135: + return "Il Distruttore"; + case 136: + return "Il Distruttore"; + case 137: + return "Pipistrello illuminante"; + case 138: + return "Slime illuminante"; + case 139: + return "Sonda"; + case 140: + return "Armatura posseduta"; + case 141: + return "Fango tossico"; + case 142: + return "Babbo Natale"; + case 143: + return "pupazzo di neve Gangsta"; + case 144: + return "signor Stabby"; + case 145: + return "neve Balla"; + } + } + else + { + if (Lang.lang == 4) + { + switch (l) + { + case -17: + return "Gros frelon"; + case -16: + return "Petit frelon"; + case -15: + return "Squelette lourd"; + case -14: + return "Grand squelette"; + case -13: + return "Petit squelette"; + case -12: + return "Grand dévoreur"; + case -11: + return "Petit dévoreur"; + case -10: + return "Slime de la jungle"; + case -9: + return "Slime jaune"; + case -8: + return "Slime rouge"; + case -7: + return "Slime violet"; + case -6: + return "Slime noir"; + case -5: + return "Bébé slime"; + case -4: + return "Pinky"; + case -3: + return "Slime vert"; + case -2: + return "Slimer"; + case -1: + return "Slimeling"; + case 1: + return "Slime bleu"; + case 2: + return "Œil de démon"; + case 3: + return "Zombie"; + case 4: + return "Œil de Cthulhu"; + case 5: + return "Servant de Cthulhu"; + case 6: + return "Dévoreur d'âmes"; + case 7: + return "Dévoreur"; + case 8: + return "Dévoreur"; + case 9: + return "Dévoreur"; + case 10: + return "Ver géant"; + case 11: + return "Ver géant"; + case 12: + return "Ver géant"; + case 13: + return "Dévoreur de mondes"; + case 14: + return "Dévoreur de mondes"; + case 15: + return "Dévoreur de mondes"; + case 16: + return "Mère slime"; + case 17: + return "Marchand"; + case 18: + return "Infirmière"; + case 19: + return "Marchand d'armes"; + case 20: + return "Dryade"; + case 21: + return "Squelette"; + case 22: + return "Guide"; + case 23: + return "Tête de météorite"; + case 24: + return "Diablotin de feu"; + case 25: + return "Sphère brûlante"; + case 26: + return "Péon gobelin"; + case 27: + return "Voleur gobelin"; + case 28: + return "Guerrier gobelin"; + case 29: + return "Sorcier gobelin"; + case 30: + return "Boule de chaos"; + case 31: + return "Squelette furieux"; + case 32: + return "Magicien noir"; + case 33: + return "Sphère d'eau"; + case 34: + return "Crâne maudit"; + case 35: + return "Squeletron"; + case 36: + return "Squeletron"; + case 37: + return "Vieil homme"; + case 38: + return "Démolisseur"; + case 39: + return "Serpent d'os"; + case 40: + return "Serpent d'os"; + case 41: + return "Serpent d'os"; + case 42: + return "Frelon"; + case 43: + return "Mangeur d'hommes"; + case 44: + return "Mineur mort-vivant"; + case 45: + return "Tim"; + case 46: + return "Lapin"; + case 47: + return "Lapin corrompu"; + case 48: + return "Harpie"; + case 49: + return "Chauve-souris"; + case 50: + return "Roi slime"; + case 51: + return "Chauve-souris de la jungle"; + case 52: + return "Docteur Bones"; + case 53: + return "Le jeune marié"; + case 54: + return "Tailleur"; + case 55: + return "Poisson doré"; + case 56: + return "Ravisseur"; + case 57: + return "Poisson doré corrompu"; + case 58: + return "Piranha"; + case 59: + return "Slime de l'enfer"; + case 60: + return "Chauve-souris de l'enfer"; + case 61: + return "Vautour"; + case 62: + return "Démon"; + case 63: + return "Méduse bleue"; + case 64: + return "Méduse rose"; + case 65: + return "Requin"; + case 66: + return "Démon vaudou"; + case 67: + return "Crabe"; + case 68: + return "Gardien du donjon"; + case 69: + return "Fourmilion"; + case 70: + return "Boule piquante"; + case 71: + return "Slime des donjons"; + case 72: + return "Roue de feu"; + case 73: + return "Scout gobelin"; + case 74: + return "Oiseau"; + case 75: + return "Lutin"; + case 76: + return ""; + case 77: + return "Squelette en armure"; + case 78: + return "Momie"; + case 79: + return "Momie de l'ombre"; + case 80: + return "Momie de lumière"; + case 81: + return "Slime corrompu"; + case 82: + return "Spectre"; + case 83: + return "Marteau maudit"; + case 84: + return "Épée enchantée"; + case 85: + return "Imitateur"; + case 86: + return "Licorne"; + case 87: + return "Wyverne"; + case 88: + return "Wyverne"; + case 89: + return "Wyverne"; + case 90: + return "Wyverne"; + case 91: + return "Wyverne"; + case 92: + return "Wyverne"; + case 93: + return "Chauve-souris géante"; + case 94: + return "Corrupteur"; + case 95: + return "Fouisseur"; + case 96: + return "Fouisseur"; + case 97: + return "Fouisseur"; + case 98: + return "Nourricier"; + case 99: + return "Nourricier"; + case 100: + return "Nourricier"; + case 101: + return "Cracheur"; + case 102: + return "Baudroie"; + case 103: + return "Méduse verte"; + case 104: + return "Loup-garou"; + case 105: + return "Gobelin attaché"; + case 106: + return "Magicien attaché"; + case 107: + return "Gobelin bricoleur"; + case 108: + return "Magicien"; + case 109: + return "Clown"; + case 110: + return "Archer squelette"; + case 111: + return "Archer gobelin"; + case 112: + return "Immonde crachat"; + case 113: + return "Mur de chair"; + case 114: + return "Mur de chair"; + case 115: + return "L'affamé"; + case 116: + return "L'affamé"; + case 117: + return "Sangsue"; + case 118: + return "Sangsue"; + case 119: + return "Sangsue"; + case 120: + return "Élémentaire du chaos"; + case 121: + return "Slimer"; + case 122: + return "Gastropode"; + case 123: + return "Mécanicienne attachée"; + case 124: + return "Mécanicienne"; + case 125: + return "Rétinazer"; + case 126: + return "Spazmatisme"; + case 127: + return "Squeletron primaire"; + case 128: + return "Canon primaire"; + case 129: + return "Scie primaire"; + case 130: + return "Étau principal"; + case 131: + return "Laser principal"; + case 132: + return "Zombie"; + case 133: + return "Œil vagabond"; + case 134: + return "Le destructeur"; + case 135: + return "Le destructeur"; + case 136: + return "Le destructeur"; + case 137: + return "Chauve-souris illuminée"; + case 138: + return "Slime illuminé"; + case 139: + return "Sonde"; + case 140: + return "Armure possédée"; + case 141: + return "Boue toxique"; + case 142: + return "Père Noël"; + case 143: + return "Snowman Gangsta"; + case 144: + return "Monsieur Stabby"; + case 145: + return "neige Balla"; + } + } + else + { + if (Lang.lang == 5) + { + switch (l) + { + case -17: + return "Gran avispa"; + case -16: + return "Avispa pequeña"; + case -15: + return "Esqueleto pesado"; + case -14: + return "Gran deshuesado"; + case -13: + return "Pequeño deshuesado"; + case -12: + return "Gran devorador"; + case -11: + return "Pequeño devorador"; + case -10: + return "Babosa de selva"; + case -9: + return "Babosa amarilla"; + case -8: + return "Babosa roja"; + case -7: + return "Babosa morada"; + case -6: + return "Babosa negra"; + case -5: + return "Bebé babosa"; + case -4: + return "Babosa rosa"; + case -3: + return "Babosa verde"; + case -2: + return "Baboseadora"; + case -1: + return "Babosas"; + case 1: + return "Babosa azul"; + case 2: + return "Ojo demoníaco"; + case 3: + return "Zombi"; + case 4: + return "Ojo Cthulhu"; + case 5: + return "Siervo de Cthulhu"; + case 6: + return "Devoraalmas"; + case 7: + return "Gusano devorador"; + case 8: + return "Gusano devorador"; + case 9: + return "Gusano devorador"; + case 10: + return "Gusano gigante"; + case 11: + return "Gusano gigante"; + case 12: + return "Gusano gigante"; + case 13: + return "Devoramundos"; + case 14: + return "Devoramundos"; + case 15: + return "Devoramundos"; + case 16: + return "Mamá babosa"; + case 17: + return "Mercader"; + case 18: + return "Enfermera"; + case 19: + return "Traficante de armas"; + case 20: + return "Dríada"; + case 21: + return "Esqueleto"; + case 22: + return "Guía"; + case 23: + return "Cabeza meteorito"; + case 24: + return "Diablillo de fuego"; + case 25: + return "Esfera ardiente"; + case 26: + return "Duende Peón"; + case 27: + return "Duende ladrón"; + case 28: + return "Duende guerrero"; + case 29: + return "Duende hechicero"; + case 30: + return "Bola del caos"; + case 31: + return "Deshuesado furioso"; + case 32: + return "Fundidor siniestro"; + case 33: + return "Esfera de agua"; + case 34: + return "Cráneo maldito"; + case 35: + return "Esqueletrón"; + case 36: + return "Esqueletrón"; + case 37: + return "Anciano"; + case 38: + return "Dinamitero"; + case 39: + return "Esqueleto de serpiente"; + case 40: + return "Esqueleto de serpiente"; + case 41: + return "Esqueleto de serpiente"; + case 42: + return "Avispón"; + case 43: + return "Devorahombres"; + case 44: + return "Minero zombi"; + case 45: + return "Tim"; + case 46: + return "Conejito"; + case 47: + return "Conejito corrompido"; + case 48: + return "Arpía"; + case 49: + return "Murciélago de cueva"; + case 50: + return "Babosa rey"; + case 51: + return "Murciélago de selva"; + case 52: + return "Doctor Látigo"; + case 53: + return "El novio zombi"; + case 54: + return "Buhonero"; + case 55: + return "Pececillo"; + case 56: + return "Atrapadora"; + case 57: + return "Pececillo corrompido"; + case 58: + return "Piraña"; + case 59: + return "Babosa de lava"; + case 60: + return "Murciélago infernal"; + case 61: + return "Buitre"; + case 62: + return "Demonio"; + case 63: + return "Medusa azul"; + case 64: + return "Medusa rosa"; + case 65: + return "Tiburón"; + case 66: + return "Demonio vudú"; + case 67: + return "Cangrejo"; + case 68: + return "Guardián de la mazmorra"; + case 69: + return "Hormiga león"; + case 70: + return "Bola Gancho"; + case 71: + return "Babosa de la mazmorra"; + case 72: + return "Rueda ardiente"; + case 73: + return "Duende explorador"; + case 74: + return "Pájaro"; + case 75: + return "Duendecillo"; + case 76: + return ""; + case 77: + return "Esqueleto con armadura"; + case 78: + return "Momia"; + case 79: + return "Momia de la oscuridad"; + case 80: + return "Momia de la luz"; + case 81: + return "Babosa corrompida"; + case 82: + return "Espectro"; + case 83: + return "Martillo maldito"; + case 84: + return "Espada encantada"; + case 85: + return "Cofre falso"; + case 86: + return "Unicornio"; + case 87: + return "Guiverno"; + case 88: + return "Guiverno"; + case 89: + return "Guiverno"; + case 90: + return "Guiverno"; + case 91: + return "Guiverno"; + case 92: + return "Guiverno"; + case 93: + return "Murciélago gigante"; + case 94: + return "Corruptor"; + case 95: + return "Excavador"; + case 96: + return "Excavador"; + case 97: + return "Excavador"; + case 98: + return "Tragamundos"; + case 99: + return "Tragamundos"; + case 100: + return "Tragamundos"; + case 101: + return "Lapa"; + case 102: + return "Rape"; + case 103: + return "Medusa verde"; + case 104: + return "Hombre lobo"; + case 105: + return "Duende cautivo"; + case 106: + return "Mago cautivo"; + case 107: + return "Duende reparador"; + case 108: + return "Mago"; + case 109: + return "Payaso"; + case 110: + return "Esqueleto arquero"; + case 111: + return "Duende arquero"; + case 112: + return "Escupitajo vil"; + case 113: + return "Muro carnoso"; + case 114: + return "Muro carnoso"; + case 115: + return "El Famélico"; + case 116: + return "El Famélico"; + case 117: + return "Sanguijuela"; + case 118: + return "Sanguijuela"; + case 119: + return "Sanguijuela"; + case 120: + return "Caos elemental"; + case 121: + return "Baboseadora"; + case 122: + return "Gasterópodo"; + case 123: + return "Mecánico cautivo"; + case 124: + return "Mecánico"; + case 125: + return "Retinator"; + case 126: + return "Espasmatizador"; + case 127: + return "Esqueleto mayor"; + case 128: + return "Cañón mayor"; + case 129: + return "Sierra mayor"; + case 130: + return "Torno mayor"; + case 131: + return "Láser mayor"; + case 132: + return "Zombi"; + case 133: + return "Ojo errante"; + case 134: + return "El Destructor"; + case 135: + return "El Destructor"; + case 136: + return "El Destructor"; + case 137: + return "Murciélago luminoso"; + case 138: + return "Babosa luminosa"; + case 139: + return "Sonda"; + case 140: + return "Armadura poseída"; + case 141: + return "Fango tóxico"; + case 142: + return "Papá Noel"; + case 143: + return "muñeco de nieve Gangsta"; + case 144: + return "señor Stabby"; + case 145: + return "Balla nieve"; + } + } + } + } + } + } + if (!english && Lang.lang > 1) + { + return Lang.npcName(l, true); + } + return ""; + } + public static void tTip() + { + for (int i = 1; i < 1725; i++) + { + Item item = new Item(); + item.SetDefaults(i, false); + if (item.toolTip2 != "" && item.toolTip2 != null) + { + string.Concat(new object[] + { + "case ", + i, + ": return \"", + item.toolTip2, + "\";" + }); + } + } + } + public static string toolTip(int l, bool english = false) + { + if (l == 1372) + { + return "'W. Garner'"; + } + if (l == 1373) + { + return "'W. Garner'"; + } + if (l == 1374) + { + return "'W. Garner'"; + } + if (l == 1375) + { + return "'W. Garner'"; + } + if (l == 1419) + { + return "'W. Garner'"; + } + if (l == 1420) + { + return "'W. Garner'"; + } + if (l == 1421) + { + return "'W. Garner'"; + } + if (l == 1425) + { + return "'W. Garner'"; + } + if (l == 1426) + { + return "'W. Garner'"; + } + if (l == 1427) + { + return "'W. Garner'"; + } + if (l == 1428) + { + return "'W. Garner'"; + } + if (l == 1443) + { + return "'W. Garner'"; + } + if (l == 1501) + { + return "'W. Garner'"; + } + if (l == 1573) + { + return "'W. Garner'"; + } + if (l == 1574) + { + return "'W. Garner'"; + } + if (l == 1575) + { + return "'W. Garner'"; + } + if (l == 1422) + { + return "'R. Moosdijk'"; + } + if (l == 1423) + { + return "'R. Moosdijk'"; + } + if (l == 1435) + { + return "'R. Moosdijk'"; + } + if (l == 1424) + { + return "'V. Costa Moura'"; + } + if (l == 1436) + { + return "'V. Costa Moura'"; + } + if (l == 1437) + { + return "'V. Costa Moura'"; + } + if (l == 1438) + { + return "'V. Costa Moura'"; + } + if (l == 1439) + { + return "'V. Costa Moura'"; + } + if (l == 1440) + { + return "'V. Costa Moura'"; + } + if (l == 1442) + { + return "'V. Costa Moura'"; + } + if (l >= 1481 && l <= 1494) + { + return "'V. Costa Moura'"; + } + if (l >= 1476 && l <= 1480) + { + return "'J. T. Myhre'"; + } + if (l >= 1496 && l <= 1499) + { + return "'J. T. Myhre'"; + } + if (l == 1538) + { + return "'J. T. Myhre'"; + } + if (l >= 1539 && l <= 1542) + { + return "'A. Craig'"; + } + if (l == 1433) + { + return "'K. Wright'"; + } + if (l == 1441) + { + return "'A. G. Kolf'"; + } + if (l == 1500) + { + return "'A. G. Kolf'"; + } + if (l == 1495) + { + return "'A. G. Kolf'"; + } + if (l == 1576) + { + return "'D. Phelps'"; + } + if (l == 1577) + { + return "'M. J. Duncan'"; + } + if (l == 1434) + { + return "'C. J. Ness'"; + } + if (l == 1502) + { + return "'C. Burczyk'"; + } + if (Lang.lang <= 1 || english) + { + if (l <= 332) + { + if (l <= 128) + { + if (l <= 29) + { + if (l <= -1) + { + if (l == -43) + { + return "Can mine Meteorite"; + } + if (l == -37) + { + return "Can mine Meteorite"; + } + if (l == -1) + { + return "Can mine Meteorite"; + } + } + else + { + if (l == 8) + { + return "Provides light"; + } + switch (l) + { + case 15: + return "Tells the time"; + case 16: + return "Tells the time"; + case 17: + return "Tells the time"; + case 18: + return "Shows depth"; + case 19: + case 20: + case 21: + case 22: + break; + case 23: + return "'Both tasty and flammable'"; + default: + if (l == 29) + { + return "Permanently increases maximum life by 20"; + } + break; + } + } + } + else + { + if (l <= 70) + { + switch (l) + { + case 33: + return "Used for smelting ore"; + case 34: + break; + case 35: + return "Used to craft items from metal bars"; + case 36: + return "Used for basic crafting"; + default: + if (l == 43) + { + return "Summons the Eye of Cthulhu"; + } + switch (l) + { + case 49: + return "Slowly regenerates life"; + case 50: + return "Gaze in the mirror to return home"; + case 53: + return "Allows the holder to double jump"; + case 54: + return "The wearer can run super fast"; + case 56: + return "'Pulsing with dark energy'"; + case 57: + return "'Pulsing with dark energy'"; + case 64: + return "Summons a vile thorn"; + case 65: + return "Causes stars to rain from the sky"; + case 66: + return "Cleanses the corruption"; + case 67: + return "Removes the Hallow"; + case 68: + return "'Looks tasty!'"; + case 70: + return "Summons the Eater of Worlds"; + } + break; + } + } + else + { + if (l == 75) + { + return "Disappears after the sunrise"; + } + switch (l) + { + case 84: + return "'Get over here!'"; + case 85: + return "Can be climbed on"; + case 86: + case 87: + break; + case 88: + return "Provides light when worn"; + default: + switch (l) + { + case 98: + return "33% chance to not consume ammo"; + case 100: + return "7% increased melee speed"; + case 101: + return "7% increased melee speed"; + case 102: + return "7% increased melee speed"; + case 103: + return "Able to mine Hellstone"; + case 109: + return "Permanently increases maximum mana by 20"; + case 111: + return "Increases maximum mana by 20"; + case 112: + return "Throws balls of fire"; + case 113: + return "Casts a controllable missile"; + case 114: + return "Magically moves dirt"; + case 115: + return "Creates a magical shadow orb"; + case 117: + return "'Warm to the touch'"; + case 118: + return "Sometimes dropped by Skeletons and Piranha"; + case 120: + return "Lights wooden arrows ablaze"; + case 121: + return "'It's made out of fire!'"; + case 123: + return "7% increased magic damage"; + case 124: + return "7% increased magic damage"; + case 125: + return "7% increased magic damage"; + case 128: + return "Allows flight"; + } + break; + } + } + } + } + else + { + if (l <= 218) + { + if (l <= 190) + { + switch (l) + { + case 148: + return "Holding this may attract unwanted attention"; + case 149: + return "'It contains strange symbols'"; + case 150: + case 154: + case 155: + case 160: + case 161: + case 162: + case 163: + case 164: + break; + case 151: + return "4% increased ranged damage."; + case 152: + return "4% increased ranged damage."; + case 153: + return "4% increased ranged damage."; + case 156: + return "Grants immunity to knockback"; + case 157: + return "Sprays out a shower of water"; + case 158: + return "Negates fall damage"; + case 159: + return "Increases jump height"; + case 165: + return "Casts a slow moving bolt of water"; + case 166: + return "A small explosion that will destroy some tiles"; + case 167: + return "A large explosion that will destroy most tiles"; + case 168: + return "A small explosion that will not destroy tiles"; + default: + if (l == 175) + { + return "'Hot to the touch'"; + } + switch (l) + { + case 186: + return "Increases breath time and allows breathing in water"; + case 187: + return "Grants the ability to swim"; + case 190: + return "Has a chance to poison enemies"; + } + break; + } + } + else + { + if (l == 193) + { + return "Grants immunity to fire blocks"; + } + if (l == 197) + { + return "Shoots fallen stars"; + } + switch (l) + { + case 208: + return "'It's pretty, oh so pretty'"; + case 211: + return "12% increased melee speed"; + case 212: + return "10% increased movement speed"; + case 213: + return "Creates grass on dirt"; + case 215: + return "'May annoy others'"; + case 218: + return "Summons a controllable ball of fire"; + } + } + } + else + { + if (l <= 305) + { + switch (l) + { + case 222: + return "Grows plants"; + case 223: + return "6% reduced mana usage"; + case 224: + case 225: + case 226: + case 227: + break; + case 228: + return "Increases maximum mana by 20"; + case 229: + return "Increases maximum mana by 20"; + case 230: + return "Increases maximum mana by 20"; + default: + switch (l) + { + case 235: + return "'Tossing may be difficult.'"; + case 236: + break; + case 237: + return "'Makes you look cool!'"; + case 238: + return "15% increased magic damage"; + default: + switch (l) + { + case 261: + return "'It's smiling, might be a good snack'"; + case 266: + return "'This is a good idea!'"; + case 267: + return "'You are a terrible person.'"; + case 268: + return "Greatly extends underwater breathing"; + case 272: + return "Casts a demon scythe"; + case 281: + return "Allows the collection of seeds for ammo"; + case 282: + return "Works when wet"; + case 283: + return "For use with Blowpipe"; + case 285: + return "5% increased movement speed"; + case 288: + return "Provides immunity to lava"; + case 289: + return "Provides life regeneration"; + case 290: + return "25% increased movement speed"; + case 291: + return "Breathe water instead of air"; + case 292: + return "Increase defense by 8"; + case 293: + return "Increased mana regeneration"; + case 294: + return "20% increased magic damage"; + case 295: + return "Slows falling speed"; + case 296: + return "Shows the location of treasure and ore"; + case 297: + return "Grants invisibility"; + case 298: + return "Emits an aura of light"; + case 299: + return "Increases night vision"; + case 300: + return "Increases enemy spawn rate"; + case 301: + return "Attackers also take damage"; + case 302: + return "Allows the ability to walk on water"; + case 303: + return "20% increased arrow speed and damage"; + case 304: + return "Shows the location of enemies"; + case 305: + return "Allows the control of gravity"; + } + break; + } + break; + } + } + else + { + if (l == 324) + { + return "'Banned in most places'"; + } + switch (l) + { + case 327: + return "Opens one Gold Chest"; + case 328: + break; + case 329: + return "Opens all Shadow Chests"; + default: + if (l == 332) + { + return "Used for crafting cloth"; + } + break; + } + } + } + } + } + else + { + if (l <= 749) + { + if (l <= 669) + { + if (l <= 425) + { + if (l == 352) + { + return "Used for brewing ale"; + } + switch (l) + { + case 357: + return "Minor improvements to all stats"; + case 358: + case 359: + case 360: + case 362: + case 364: + case 365: + case 366: + case 368: + case 369: + case 370: + case 374: + case 375: + case 379: + case 380: + case 381: + case 382: + case 383: + case 384: + case 387: + case 388: + case 390: + case 391: + case 392: + case 406: + break; + case 361: + return "Summons a Goblin Army"; + case 363: + return "Used for advanced wood crafting"; + case 367: + return "Strong enough to destroy Demon Altars"; + case 371: + return "Increases maximum mana by 40"; + case 372: + return "7% increased movement speed"; + case 373: + return "10% increased ranged damage"; + case 376: + return "Increases maximum mana by 60"; + case 377: + return "5% increased melee critical strike chance"; + case 378: + return "12% increased ranged damage"; + case 385: + return "Can mine Mythril and Orichalcum"; + case 386: + return "Can mine Adamantite and Titanium"; + case 389: + return "Has a chance to confuse"; + case 393: + return "Shows horizontal position"; + case 394: + return "Grants the ability to swim"; + case 395: + return "Shows position"; + case 396: + return "Negates fall damage"; + case 397: + return "Grants immunity to knockback"; + case 398: + return "Allows the combining of some accessories"; + case 399: + return "Allows the holder to double jump"; + case 400: + return "Increases maximum mana by 80"; + case 401: + return "7% increased melee critical strike chance"; + case 402: + return "14% increased ranged damage"; + case 403: + return "6% increased damage"; + case 404: + return "4% increased critical strike chance"; + case 405: + return "Allows flight"; + case 407: + return "Increases block placement range"; + default: + switch (l) + { + case 422: + return "Spreads the Hallow to some blocks"; + case 423: + return "Spreads the corruption to some blocks"; + case 425: + return "Summons a magical fairy"; + } + break; + } + } + else + { + if (l == 434) + { + return "Three round burst"; + } + switch (l) + { + case 485: + return "Turns the holder into a werewolf at night"; + case 486: + return "Creates a grid on screen for block placement"; + case 487: + case 488: + case 494: + case 498: + case 499: + case 500: + case 501: + case 502: + case 503: + case 504: + case 505: + case 507: + case 508: + case 511: + case 512: + case 513: + case 514: + case 530: + case 537: + case 538: + case 539: + case 540: + case 545: + case 546: + case 550: + case 562: + case 563: + case 564: + case 565: + case 566: + case 567: + case 568: + case 569: + case 570: + case 571: + case 572: + case 573: + case 574: + case 577: + case 578: + case 586: + case 587: + case 588: + case 589: + case 590: + case 591: + case 592: + case 593: + case 594: + case 595: + case 596: + case 597: + case 598: + break; + case 489: + return "15% increased magic damage"; + case 490: + return "15% increased melee damage"; + case 491: + return "15% increased ranged damage"; + case 492: + return "Allows flight and slow fall"; + case 493: + return "Allows flight and slow fall"; + case 495: + return "Casts a controllable rainbow"; + case 496: + return "Summons a block of ice"; + case 497: + return "Transforms the holder into merfolk when entering water"; + case 506: + return "Uses gel for ammo"; + case 509: + return "Places red wire"; + case 510: + return "Removes wire"; + case 515: + return "Creates several crystal shards on impact"; + case 516: + return "Summons falling stars on impact"; + case 517: + return "A magical returning dagger"; + case 518: + return "Summons rapid fire crystal shards"; + case 519: + return "Summons unholy fire balls"; + case 520: + return "'The essence of light creatures'"; + case 521: + return "'The essence of dark creatures'"; + case 522: + return "'Not even water can put the flame out'"; + case 523: + return "Can be placed in water"; + case 524: + return "Used to smelt adamantite and titanium ore"; + case 525: + return "Used to craft items from mythril, orichalcum, adamantite, and titanium bars"; + case 526: + return "'Sharp and magical!'"; + case 527: + return "'Sometimes carried by creatures in corrupt deserts'"; + case 528: + return "'Sometimes carried by creatures in light deserts'"; + case 529: + return "Activates when stepped on"; + case 531: + return "Can be enchanted"; + case 532: + return "Causes stars to fall when injured"; + case 533: + return "50% chance to not consume ammo"; + case 534: + return "Fires a spread of bullets"; + case 535: + return "Reduces the cooldown of healing potions"; + case 536: + return "Increases melee knockback"; + case 541: + return "Activates when stepped on"; + case 542: + return "Activates when a player steps on it"; + case 543: + return "Activates when a player steps on it"; + case 544: + return "Summons The Twins"; + case 547: + return "'The essence of pure terror'"; + case 548: + return "'The essence of the destroyer'"; + case 549: + return "'The essence of omniscient watchers'"; + case 551: + return "7% increased critical strike chance"; + case 552: + return "7% increased damage"; + case 553: + return "15% increased ranged damage"; + case 554: + return "Increases length of invincibility after taking damage"; + case 555: + return "8% reduced mana usage"; + case 556: + return "Summons Destroyer"; + case 557: + return "Summons Skeletron Prime"; + case 558: + return "Increases maximum mana by 100"; + case 559: + return "10% increased melee damage and critical strike chance"; + case 560: + return "Summons King Slime"; + case 561: + return "Stacks up to 5"; + case 575: + return "'The essence of powerful flying creatures'"; + case 576: + return "Has a chance to record songs"; + case 579: + return "'Not to be confused with a picksaw'"; + case 580: + return "Explodes when activated"; + case 581: + return "Sends water to outlet pumps"; + case 582: + return "Receives water from inlet pumps"; + case 583: + return "Activates every second"; + case 584: + return "Activates every 3 seconds"; + case 585: + return "Activates every 5 seconds"; + case 599: + return "Right click to open"; + case 600: + return "Right click to open"; + case 601: + return "Right click to open"; + case 602: + return "Summons the Frost Legion"; + case 603: + return "Summons a pet bunny"; + default: + switch (l) + { + case 665: + return "You shouldn't have this"; + case 666: + return "You shouldn't have this"; + case 667: + return "You shouldn't have this"; + case 668: + return "You shouldn't have this"; + case 669: + return "Summons a baby penguin"; + } + break; + } + } + } + else + { + if (l <= 709) + { + if (l == 676) + { + return "Shoots an icy bolt"; + } + switch (l) + { + case 683: + return "Summons the Devil's trident"; + case 684: + return "16% increased melee and ranged damage"; + case 685: + return "11% increased melee and ranged critical strike chance"; + case 686: + return "8% increased movement speed"; + default: + switch (l) + { + case 707: + return "Tells the time"; + case 708: + return "Tells the time"; + case 709: + return "Tells the time"; + } + break; + } + } + else + { + if (l == 716) + { + return "Used to craft items from metal bars"; + } + switch (l) + { + case 723: + return "Shoots a beam of light"; + case 724: + return "Shoots an icy bolt"; + case 725: + return "Shoots frost arrows"; + case 726: + return "Shoots a stream of frost"; + default: + switch (l) + { + case 748: + return "Allows flight and slow fall"; + case 749: + return "Allows flight and slow fall"; + } + break; + } + } + } + } + else + { + if (l <= 1006) + { + if (l <= 798) + { + if (l == 753) + { + return "Summons a pet turtle"; + } + if (l == 761) + { + return "Allows flight and slow fall"; + } + switch (l) + { + case 779: + return "Creates and destroys biomes when sprayed"; + case 780: + return "Used by the Clentaminator"; + case 781: + return "Used by the Clentaminator"; + case 782: + return "Used by the Clentaminator"; + case 783: + return "Used by the Clentaminator"; + case 784: + return "Used by the Clentaminator"; + case 785: + return "Allows flight and slow fall"; + case 786: + return "Allows flight and slow fall"; + case 787: + return "Strong enough to destroy Demon Altars"; + case 788: + return "Summons a thorn spear"; + case 792: + return "2% increased damage"; + case 793: + return "2% increased damage"; + case 794: + return "2% increased damage"; + case 798: + return "Able to mine Hellstone"; + } + } + else + { + switch (l) + { + case 821: + return "Allows flight and slow fall"; + case 822: + return "Allows flight and slow fall"; + case 823: + return "Allows flight and slow fall"; + default: + if (l == 832) + { + return "Places living wood"; + } + switch (l) + { + case 849: + return "Enables solid blocks to be toggled on and off"; + case 850: + return "Places blue wire"; + case 851: + return "Places green wire"; + case 852: + return "Activates when a player steps on it"; + case 853: + return "Activates when anything but a player steps on it"; + case 854: + return "Shops have lower prices"; + case 855: + return "Hitting enemies will sometimes drop extra coins"; + case 856: + return "'Having a wonderful time!'"; + case 857: + return "Allows the holder to do an improved double jump"; + case 860: + return "Provides life regeneration and reduces the cooldown of healing potions"; + case 861: + return "Turns the holder into a werewolf at night and a merfolk when entering water"; + case 862: + return "Causes stars to fall and increases length of invincibility after taking damage"; + case 863: + return "Provides the ability to walk on water"; + case 885: + return "Immunity to Bleeding"; + case 886: + return "Immunity to Broken Armor"; + case 887: + return "Immunity to Poison"; + case 888: + return "Immunity to Darkness"; + case 889: + return "Immunity to Slow"; + case 890: + return "Immunity to Silence"; + case 891: + return "Immunity to Curse"; + case 892: + return "Immunity to Weakness"; + case 893: + return "Immunity to Confusion"; + case 897: + return "Increases melee knockback"; + case 898: + return "Allows flight"; + case 899: + return "Increases all stats if worn during the day"; + case 900: + return "Increases all stats if worn during the night"; + case 901: + return "Immunity to Weakness and Broken Armor"; + case 902: + return "Immunity to Poison and Bleeding"; + case 903: + return "Immunity to Slow and Confusion"; + case 904: + return "Immunity to Silence and Curse"; + case 905: + return "Uses coins for ammo"; + case 906: + return "Provides 7 seconds of immunity to lava"; + case 907: + return "Provides the ability to walk on water"; + case 908: + return "Provides the ability to walk on water and lava"; + case 932: + return "Places bone"; + case 933: + return "Places leaves"; + case 934: + return "Allows the owner to float for a few seconds"; + case 935: + return "12% increased damage"; + case 936: + return "Increases melee knockback"; + case 937: + return "Explodes when stepped on"; + case 938: + return "Absorbs 25% of damage done to players on your team"; + case 946: + return "You will fall slower while holding this"; + case 947: + return "Reacts to the light"; + case 948: + return "Allows flight and slowfall"; + case 950: + return "Provides extra mobility on ice"; + case 951: + return "Rapidly launches snowballs"; + case 953: + return "Allows the ability to slide down walls"; + case 956: + return "7% increased melee speed"; + case 957: + return "7% increased melee speed"; + case 958: + return "7% increased melee speed"; + case 959: + return "4% increased ranged damage."; + case 960: + return "Increases maximum mana by 20"; + case 961: + return "Increases maximum mana by 20"; + case 962: + return "Increases maximum mana by 20"; + case 963: + return "Gives a chance to dodge attacks"; + case 964: + return "Fires a spread of bullets"; + case 965: + return "Can be climbed on"; + case 966: + return "Life regen is increased when near a campfire"; + case 967: + return "Put it on a stick and roast over a campfire"; + case 968: + return "Roast it over a campfire!"; + case 969: + return "Minor improvements to all stats"; + case 975: + return "Allows the ability to slide down walls"; + case 976: + return "Allows the ability to climb walls"; + case 977: + return "Allows the ability to dash"; + case 982: + return "Increases maximum mana by 20"; + case 983: + return "Allows the holder to double jump"; + case 984: + return "Allows the ability to climb walls and dash"; + case 985: + return "Throw to create a climbable line of rope"; + case 986: + return "Allows the collection of seeds for ammo"; + case 987: + return "Allows the holder to double jump"; + case 989: + return "Shoots an enchanted sword beam"; + case 990: + return "'Not to be confused with a hamdrill'"; + case 994: + return "Summons a Baby Eater of Souls"; + case 995: + return "Used to craft objects"; + case 996: + return "Used to craft objects"; + case 997: + return "Turns silt/slush into something more useful"; + case 998: + return "Used to craft objects"; + case 1000: + return "Shoots confetti everywhere!"; + case 1001: + return "16% increased melee damage"; + case 1002: + return "16% increased ranged damage"; + case 1003: + return "Increases maximum mana by 80 and reduces mana usage by 17%"; + case 1004: + return "5% increased damage"; + case 1005: + return "8% increased critical strike chance"; + case 1006: + return "Reacts to the light"; + } + break; + } + } + } + else + { + if (l <= 1432) + { + switch (l) + { + case 1071: + return "Used with paint to color blocks"; + case 1072: + return "Used with paint to color walls"; + default: + switch (l) + { + case 1100: + return "Used to remove paint"; + case 1101: + case 1102: + case 1103: + case 1104: + case 1105: + case 1106: + case 1124: + case 1125: + case 1126: + case 1127: + case 1128: + case 1134: + case 1135: + case 1136: + case 1137: + case 1138: + case 1139: + case 1140: + case 1142: + case 1143: + case 1144: + case 1146: + case 1147: + case 1148: + case 1149: + case 1150: + case 1152: + case 1153: + case 1154: + case 1155: + case 1166: + case 1168: + case 1173: + case 1174: + case 1175: + case 1176: + case 1177: + case 1184: + case 1185: + case 1186: + case 1187: + case 1190: + case 1191: + case 1192: + case 1193: + case 1194: + case 1197: + case 1198: + case 1199: + case 1200: + case 1201: + case 1202: + case 1203: + case 1204: + case 1222: + case 1223: + case 1224: + case 1225: + case 1229: + case 1230: + case 1231: + case 1232: + case 1233: + case 1234: + case 1236: + case 1237: + case 1238: + case 1239: + case 1240: + case 1241: + case 1243: + case 1245: + case 1246: + case 1257: + case 1262: + case 1263: + case 1266: + case 1267: + case 1268: + case 1269: + case 1270: + case 1271: + case 1272: + case 1273: + case 1274: + case 1275: + case 1276: + case 1277: + case 1278: + case 1279: + case 1280: + case 1281: + case 1288: + case 1289: + case 1292: + case 1298: + case 1302: + case 1304: + case 1305: + case 1319: + case 1320: + case 1324: + case 1325: + case 1328: + case 1329: + case 1330: + case 1337: + case 1338: + case 1339: + case 1340: + case 1341: + case 1342: + break; + case 1107: + return "Used to make Teal Dye"; + case 1108: + return "Used to make Green Dye"; + case 1109: + return "Used to make Sky Blue Dye"; + case 1110: + return "Used to make Yellow Dye"; + case 1111: + return "Used to make Blue Dye"; + case 1112: + return "Used to make Lime Dye"; + case 1113: + return "Used to make Pink Dye"; + case 1114: + return "Used to make Orange Dye"; + case 1115: + return "Used to make Red Dye"; + case 1116: + return "Used to make Cyan Dye"; + case 1117: + return "Used to make Violet Dye"; + case 1118: + return "Used to make Purple Dye"; + case 1119: + return "Used to make Black Dye"; + case 1120: + return "Used to Craft Dyes"; + case 1121: + return "Shoots bees that will chase your enemy"; + case 1122: + return "Chases after your enemy"; + case 1123: + return "Summons killer bees after striking your foe"; + case 1129: + return "Places Hives"; + case 1130: + return "Explodes into a swarm of bees"; + case 1131: + return "Allows the holder to reverse gravity"; + case 1132: + return "Releases bees when damaged"; + case 1133: + return "Summons the Queen Bee"; + case 1141: + return "Opens the jungle temple door"; + case 1145: + return "Used for basic crafting"; + case 1151: + return "Activates when a player steps on it"; + case 1156: + return "Latches on to enemies for continuous damage"; + case 1157: + return "Summons a Pygmy to fight for you"; + case 1158: + return "Increases your max number of minions"; + case 1159: + return "Increases your max number of minions"; + case 1160: + return "Increases your max number of minions"; + case 1161: + return "Increases your max number of minions"; + case 1162: + return "Allows flight and slow fall"; + case 1163: + return "Allows the holder to double jump"; + case 1164: + return "Allows the holder to quadruple jump"; + case 1165: + return "Allows flight and slow fall"; + case 1167: + return "Increases the damage of your minions by 15"; + case 1169: + return "Summons a Baby Skeletron Head"; + case 1170: + return "Summons a Baby Hornet"; + case 1171: + return "Summons a Tiki Spirit"; + case 1172: + return "Summons a Pet Lizard"; + case 1178: + return "Rapidly shoots razor sharp leaves"; + case 1179: + return "Chases after your enemy"; + case 1180: + return "Summons a Pet Parrot"; + case 1181: + return "Summons a Baby Truffle"; + case 1182: + return "Summons a Pet Sapling"; + case 1183: + return "Summons a Wisp to provide light"; + case 1188: + return "Can mine Mythril, Orichalcum, Adamantite, and Titanium"; + case 1189: + return "Can mine Mythril, Orichalcum, Adamantite, and Titanium"; + case 1195: + return "Can mine Adamantite and Titanium"; + case 1196: + return "Can mine Adamantite and Titanium"; + case 1205: + return "8% increased melee damage"; + case 1206: + return "9% increased ranged damage"; + case 1207: + return "7% increased magic damage and critical strike chance"; + case 1208: + return "3% increased damage"; + case 1209: + return "2% increased damage"; + case 1210: + return "7% increased melee damage"; + case 1211: + return "15% increased ranged critical strike chance"; + case 1212: + return "18% increased magic critical strike chance"; + case 1213: + return "6% increased critical strike chance"; + case 1214: + return "11% increased movement speed"; + case 1215: + return "8% increased melee damage and critical strike chance"; + case 1216: + return "16% increased ranged damage"; + case 1217: + return "16% increased magic damage and 7% increased magic critical strike chance"; + case 1218: + return "4% increased damage"; + case 1219: + return "3% increased damage and critical strike chance"; + case 1220: + return "Used to craft items from mythril, orichalcum, adamantite, and titanium bars"; + case 1221: + return "Used to smelt adamantite and titanium ore"; + case 1226: + return "Shoots a powerful orb"; + case 1227: + return "Shoots a spore cloud"; + case 1228: + return "Shoots a spore cloud"; + case 1235: + return "Bounces back after hitting a wall"; + case 1242: + return "Summons a Baby Dinosaur"; + case 1244: + return "Summons a cloud to rain down on your foes"; + case 1247: + return "Causes stars to fall and releases bees when injured"; + case 1248: + return "10% increased critical strike chance"; + case 1249: + return "Increases jump height"; + case 1250: + return "Allows the holder to double jump"; + case 1251: + return "Allows the holder to double jump"; + case 1252: + return "Allows the holder to double jump"; + case 1253: + return "Puts a shell around the owner when below 25% life that reduces damage"; + case 1254: + return "Shoots a powerful, high velocity bullet"; + case 1255: + return "Shoots a powerful, high velocity bullet"; + case 1256: + return "Summons a cloud to rain blood on your foes"; + case 1258: + return "Shoots an explosive bolt"; + case 1259: + return "Shoots razor sharp flower petals at nearby enemies"; + case 1260: + return "Shoots a rainbow that does continuous damage"; + case 1261: + return "Explodes into deadly shrapnel"; + case 1264: + return "Shoots a ball of frost"; + case 1265: + return "Shoots a powerful, high velocity bullet"; + case 1282: + return "Increases maximum mana by 20"; + case 1283: + return "Increases maximum mana by 40"; + case 1284: + return "Increases maximum mana by 40"; + case 1285: + return "Increases maximum mana by 60"; + case 1286: + return "Increases maximum mana by 60"; + case 1287: + return "Increases maximum mana by 80"; + case 1290: + return "Increases movement speed after being struck"; + case 1291: + return "Permanently increases maximum life by 5"; + case 1293: + return "Used at the Lihzahrd Altar"; + case 1294: + return "Capable of mining Lihzahrd Bricks"; + case 1295: + return "Shoots a piercing ray of heat"; + case 1296: + return "Summons a powerful boulder"; + case 1297: + return "Punches with the force of a golem"; + case 1299: + return "Increases view range when held"; + case 1300: + return "Increases view range for guns"; + case 1301: + return "10% increased damage"; + case 1303: + return "Provides light under water"; + case 1306: + return "Shoots an icy sickle"; + case 1307: + return "'You are a terrible person'"; + case 1308: + return "Shoots a poison fang that pierces multiple enemies"; + case 1309: + return "Summons a baby slime to fight for you"; + case 1310: + return "Inflicts poison on enemies"; + case 1311: + return "Summons an eyeball spring"; + case 1312: + return "Summons a baby snowman"; + case 1313: + return "Shoots a skull"; + case 1314: + return "Shoots a boxing glove"; + case 1315: + return "Summons a pirate invasion"; + case 1316: + return "6% increased melee damage"; + case 1317: + return "8% increased melee damage and critical strike chance"; + case 1318: + return "4% increased melee critical strike chance"; + case 1321: + return "Increase arrow speed and damage by 10%"; + case 1322: + return "Inflicts fire damage on attack"; + case 1323: + return "Reduces damage from touching lava"; + case 1326: + return "Teleports to the position of the mouse"; + case 1327: + return "Shoots a deathly sickle"; + case 1331: + return "Summons the Brain of Cthulhu"; + case 1332: + return "'The blood of gods'"; + case 1333: + return "Can be placed in water"; + case 1334: + return "Decreases target's defense"; + case 1335: + return "Decreases target's defense"; + case 1336: + return "Sprays a shower of ichor"; + case 1343: + return "Increases melee knockback and inflicts fire damage on attack"; + default: + switch (l) + { + case 1430: + return "Used to craft weapon imbuement flasks"; + case 1432: + return "Used to craft various types of ammo"; + } + break; + } + break; + } + } + else + { + switch (l) + { + case 1444: + return "Creates a shadow beam that bounces off walls"; + case 1445: + return "Launches a ball of fire that explodes into a raging inferno"; + case 1446: + return "Summons a lost soul to chase your foes"; + case 1447: + case 1448: + break; + case 1449: + return "Blows bubbles"; + case 1450: + return "Blows bubbles"; + default: + switch (l) + { + case 1503: + return "Increases maximum mana by 80 and reduces mana usage by 17%"; + case 1504: + return "7% increased magic damage and critical strike chance"; + case 1505: + return "8% increased magic damage"; + case 1506: + case 1507: + case 1508: + case 1509: + case 1510: + case 1511: + case 1512: + case 1514: + case 1516: + case 1517: + case 1518: + case 1519: + case 1520: + case 1521: + case 1528: + case 1529: + case 1530: + case 1531: + case 1532: + case 1538: + case 1539: + case 1540: + case 1541: + case 1542: + case 1552: + case 1570: + case 1573: + case 1574: + case 1575: + case 1576: + case 1577: + case 1589: + case 1590: + case 1591: + case 1592: + case 1593: + case 1594: + case 1596: + case 1597: + case 1598: + case 1599: + case 1600: + case 1601: + case 1602: + case 1603: + case 1604: + case 1605: + case 1606: + case 1607: + case 1608: + case 1609: + case 1610: + case 1611: + break; + case 1513: + return "A powerful returning hammer"; + case 1515: + return "Allows flight and slow fall"; + case 1522: + return "For Capture the Gem. It drops when you die"; + case 1523: + return "For Capture the Gem. It drops when you die"; + case 1524: + return "For Capture the Gem. It drops when you die"; + case 1525: + return "For Capture the Gem. It drops when you die"; + case 1526: + return "For Capture the Gem. It drops when you die"; + case 1527: + return "For Capture the Gem. It drops when you die"; + case 1533: + return "Unlocks a Jungle Chest in the dungeon"; + case 1534: + return "Unlocks a Corruption Chest in the dungeon"; + case 1535: + return "Unlocks a Crimson Chest in the dungeon"; + case 1536: + return "Unlocks a Hallowed Chest in the dungeon"; + case 1537: + return "Unlocks a Frozen Chest in the dungeon"; + case 1543: + return "Used with paint to color blocks"; + case 1544: + return "Used with paint to color walls"; + case 1545: + return "Used to remove paint"; + case 1546: + return "15% increased arrow damage"; + case 1547: + return "15% increased bullet damage"; + case 1548: + return "15% increased rocket damage"; + case 1549: + return "13% increased ranged critical strike chance"; + case 1550: + return "7% increased ranged critical strike chance"; + case 1551: + return "Converts Chlorophyte Bars into Shroomite Bars"; + case 1553: + return "50% chance to not consume ammo"; + case 1554: + return "You shouldn't have this"; + case 1555: + return "You shouldn't have this"; + case 1556: + return "You shouldn't have this"; + case 1557: + return "You shouldn't have this"; + case 1558: + return "You shouldn't have this"; + case 1559: + return "You shouldn't have this"; + case 1560: + return "You shouldn't have this"; + case 1561: + return "You shouldn't have this"; + case 1562: + return "You shouldn't have this"; + case 1563: + return "You shouldn't have this"; + case 1564: + return "You shouldn't have this"; + case 1565: + return "You shouldn't have this"; + case 1566: + return "You shouldn't have this"; + case 1567: + return "You shouldn't have this"; + case 1568: + return "You shouldn't have this"; + case 1569: + return "Rapidly throw life stealing daggers"; + case 1571: + return "A powerful javalin that unleashes tiny eaters"; + case 1572: + return "Summons a powerful frost hydra to spit ice at your enemies"; + case 1578: + return "Releases bees and increases movement speed when damaged"; + case 1579: + return "The wearer can run super fast"; + case 1580: + return "You shouldn't have this"; + case 1581: + return "You shouldn't have this"; + case 1582: + return "You shouldn't have this"; + case 1583: + return "You shouldn't have this"; + case 1584: + return "You shouldn't have this"; + case 1585: + return "You shouldn't have this"; + case 1586: + return "You shouldn't have this"; + case 1587: + return "You shouldn't have this"; + case 1588: + return "You shouldn't have this"; + case 1595: + return "Increases maximum mana by 20"; + case 1612: + return "Grants immunity to most debuffs"; + case 1613: + return "Grants immunity to knockback and fire blocks"; + default: + if (l == 1724) + { + return "Allows the holder to double jump"; + } + break; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 2) + { + if (l <= 332) + { + if (l <= 128) + { + if (l <= 36) + { + if (l <= 8) + { + if (l == -1) + { + return "Kann Meteorite abbauen"; + } + if (l == 8) + { + return "Verstroemt Licht"; + } + } + else + { + switch (l) + { + case 15: + return "Zeigt die Zeit an"; + case 16: + return "Zeigt die Zeit an"; + case 17: + return "Zeigt die Zeit an"; + case 18: + return "Zeigt die Tiefe an"; + case 19: + case 20: + case 21: + case 22: + break; + case 23: + return "'Lecker und brennbar'"; + default: + if (l == 29) + { + return "Erhoeht dauerhaft die maximale Lebensspanne um 20"; + } + switch (l) + { + case 33: + return "Wird fuer die Verhuettung von Erz verwendet"; + case 35: + return "Wird verwendet, um Items aus Metallbarren herzustellen"; + case 36: + return "Wird zur einfachen Herstellung verwendet"; + } + break; + } + } + } + else + { + if (l <= 75) + { + if (l == 43) + { + return "Ruft das Auge von Cthulhu herbei"; + } + switch (l) + { + case 49: + return "Belebt langsam wieder"; + case 50: + return "Ein Blick in den Spiegel bringt einen nach Hause zurueck"; + case 51: + case 52: + case 55: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 69: + break; + case 53: + return "Berechtigt den Inhaber zum Doppelsprung"; + case 54: + return "Der Traeger kann superschnell rennen"; + case 56: + return "'Durchpulst von dunkler Energie'"; + case 57: + return "'Durchpulst von dunkler Energie'"; + case 64: + return "Ruft einen Ekeldorn herbei"; + case 65: + return "Laesst Sterne vom Himmel regen"; + case 66: + return "Reinigt das Verderben"; + case 67: + return "Entfernt den Segen"; + case 68: + return "'Sieht lecker aus!'"; + case 70: + return "Ruft den Weltenfresser herbei"; + default: + if (l == 75) + { + return "Verschwindet nach Sonnenaufgang"; + } + break; + } + } + else + { + if (l == 84) + { + return "'Komm hier rueber!'"; + } + if (l == 88) + { + return "Verstroemt beim Tragen Licht"; + } + switch (l) + { + case 98: + return "33%ige Chance, Munition nicht zu verbrauchen"; + case 100: + return "Um 7% erhoehtes Nahkampftempo"; + case 101: + return "Um 7% erhoehtes Nahkampftempo"; + case 102: + return "Um 7% erhoehtes Nahkampftempo"; + case 103: + return "Kann Hoellenstein abbauen"; + case 109: + return "Erhoeht maximales Mana um 20"; + case 111: + return "Erhoeht die maximale Mana um 20"; + case 112: + return "Schiesst Feuerbaelle ab"; + case 113: + return "Wirft eine steuerbare Rakete aus"; + case 114: + return "Bewegt magisch Dreck"; + case 115: + return "Erschafft eine magische Lichtkugel"; + case 117: + return "'Fuehlt sich warm an'"; + case 118: + return "Faellt mitunter von Skeletten und Piranhas herab"; + case 120: + return "Entfacht lodernde Holzpfeile"; + case 121: + return "'Ist ganz aus Feuer!'"; + case 123: + return "Um 5% erhoehter magischer Schaden"; + case 124: + return "Um 5% erhoehter magischer Schaden"; + case 125: + return "Um 5% erhoehter magischer Schaden"; + case 128: + return "Laesst fliegen"; + } + } + } + } + else + { + if (l <= 218) + { + if (l <= 187) + { + switch (l) + { + case 148: + return "Kann unerwuenschte Aufmerksamkeit erwecken"; + case 149: + return "'Es enthaelt seltsame Symbole'"; + case 150: + case 154: + case 155: + case 160: + case 161: + case 162: + case 163: + case 164: + break; + case 151: + return "Um 4% erhoehter Fernkampf-Schaden"; + case 152: + return "Um 4% erhoehter Fernkampf-Schaden"; + case 153: + return "Um 4% erhoehter Fernkampf-Schaden"; + case 156: + return "Macht immun gegen Rueckstoss"; + case 157: + return "Versprueht eine Wasserdusche"; + case 158: + return "Hebt Sturzschaden auf"; + case 159: + return "Vergroessert die Sprunghoehe"; + case 165: + return "Wirft einen sich langsam bewegenden Wasserbolzen aus"; + case 166: + return "Eine kleine Explosion, die einige Felder zerstoeren wird"; + case 167: + return "Eine grosse Explosion, die die meisten Felder zerstoert"; + case 168: + return "Eine kleine Explosion, die keine Felder zerstoert"; + default: + if (l == 175) + { + return "'Heiss, heiss, heiss!'"; + } + switch (l) + { + case 186: + return "'Ganz nett, nicht ertrinken zu muessen'"; + case 187: + return "Befaehigt zum Schwimmen"; + } + break; + } + } + else + { + if (l == 193) + { + return "Macht immun gegen Feuer-Bloecke"; + } + if (l == 197) + { + return "Schiesst Sternschnuppen herunter"; + } + switch (l) + { + case 208: + return "'Oh, ist die huebsch!'"; + case 211: + return "Um 12% erhoehtes Nahkampftempo"; + case 212: + return "Um 10% erhoehtes Bewegungstempo"; + case 213: + return "Laesst Gras auf Schmutz wachsen"; + case 215: + return "'Kann Aerger erregen'"; + case 218: + return "Ruft einen steuerbaren Feuerball herbei"; + } + } + } + else + { + if (l <= 305) + { + switch (l) + { + case 222: + return "Laesst Pflanzen wachsen"; + case 223: + return "Um 6% reduzierte Mana-Nutzung"; + case 224: + case 225: + case 226: + case 227: + break; + case 228: + return "Erhoeht die maximale Mana um 20"; + case 229: + return "Erhoeht die maximale Mana um 20"; + case 230: + return "Erhoeht die maximale Mana um 20"; + default: + switch (l) + { + case 235: + return "'Werfen koennte schwierig werden.'"; + case 236: + break; + case 237: + return "'Damit siehst du cool aus!'"; + case 238: + return "Um 15% erhoehter magischer Schaden"; + default: + switch (l) + { + case 261: + return "'Er laechelt - vielleicht schmeckt er auch gut...'"; + case 266: + return "'Das ist eine gute Idee!'"; + case 267: + return "'Du bist ein schrecklicher Mensch.'"; + case 268: + return "Verlaengert das Atmen unter Wasser deutlich"; + case 272: + return "Wirft eine Daemonensense aus"; + case 281: + return "Zum Erstellen einer Saatsammlung als Munition"; + case 282: + return "Funktioniert bei Naesse"; + case 283: + return "Zur Verwendung im Blasrohr"; + case 285: + return "Um 5% erhoehtes Bewegungstempo"; + case 288: + return "Macht immun gegen Lava"; + case 289: + return "Belebt wieder"; + case 290: + return "Erhoeht Bewegungstempo um 25%"; + case 291: + return "Wasser statt Luft atmen"; + case 292: + return "Erhoeht die Abwehr um 8"; + case 293: + return "Erhoehte Mana-Wiederherstellung"; + case 294: + return "Erhoeht magischen Schaden um 20%"; + case 295: + return "Verlangsamt das Sturztempo"; + case 296: + return "Zeigt den Fundort von Schatz und Erz"; + case 297: + return "Macht unsichtbar"; + case 298: + return "Verstroemt eine Aura aus Licht"; + case 299: + return "Erhoeht die Nachtsicht"; + case 300: + return "Erhoeht Feind-Spawnquote"; + case 301: + return "Auch die Angreifer erleiden Schaden"; + case 302: + return "Befaehigt, auf dem Wasser zu gehen"; + case 303: + return "Erhoeht Pfeiltempo und Schaden um 20%"; + case 304: + return "Zeigt die Position von Feinden"; + case 305: + return "Zur Steuerung der Schwerkraft"; + } + break; + } + break; + } + } + else + { + if (l == 324) + { + return "'An den meisten Orten verboten'"; + } + switch (l) + { + case 327: + return "Oeffnet eine Goldtruhe"; + case 328: + break; + case 329: + return "Oeffnet alle Schattentruhen"; + default: + if (l == 332) + { + return "Verwendet fuer die Tuchherstellung "; + } + break; + } + } + } + } + } + else + { + if (l <= 726) + { + if (l <= 603) + { + if (l <= 407) + { + if (l == 352) + { + return "Zum Bierbrauen"; + } + switch (l) + { + case 357: + return "Geringe Anhebung aller Werte"; + case 361: + return "Ruft eine Goblin-Armee herbei"; + case 363: + return "Fuer fortgeschrittene Holzherstellung"; + case 367: + return "Stark genug, um Daemonenaltaere zu zerstoeren"; + case 371: + return "Erhoeht die maximale Mana um 40"; + case 372: + return "Um 7% erhoehtes Bewegungstempo"; + case 373: + return "Um 10% erhoehter Fernkampfschaden"; + case 376: + return "Erhoeht die maximale Mana um 60"; + case 377: + return "Um 5% erhoehte kritische Nahkampf-Trefferchance"; + case 378: + return "Um 12% erhoehter Fernkampf-Schaden"; + case 385: + return "Kann Mithril abbauen"; + case 386: + return "Kann Adamantit abbauen"; + case 389: + return "Kann Verwirrung stiften"; + case 393: + return "Zeigt horizontale Position"; + case 394: + return "Befaehigt zum Schwimmen"; + case 395: + return "Zeigt Position an"; + case 396: + return "Hebt Sturzschaden auf"; + case 397: + return "Macht immun gegen Rueckstoss"; + case 398: + return "Ermoeglicht die Kombination von Zubehoer"; + case 399: + return "Berechtigt den Inhaber zum Doppelsprung"; + case 400: + return "Erhoeht die maximale Mana um 80"; + case 401: + return "Um 7% erhoehte kritische Nahkampf-Trefferchance"; + case 402: + return "Um 14% erhoehter Fernkampfschaden"; + case 403: + return "Um 6% erhoehter Schaden"; + case 404: + return "Um 4% erhoehte kritische Trefferchance"; + case 405: + return "Laesst fliegen"; + case 407: + return "Erweitert den Platzierbereich von Bloecken"; + } + } + else + { + switch (l) + { + case 422: + return "Verspritzt Segen auf einige Bloecke"; + case 423: + return "Verteilt Verderben auf einige Bloecke"; + case 424: + break; + case 425: + return "Ruft eine magische Fee herbei"; + default: + if (l == 434) + { + return "Dreifachschuss"; + } + switch (l) + { + case 485: + return "Verwandelt den Inhaber bei Vollmond in einen Werwolf"; + case 486: + return "Erstellt ein Raster auf dem Bildschirm zum Platzieren der Bloecke"; + case 489: + return "Um 15% erhoehter magischer Schaden"; + case 490: + return "Um 15% erhoehter Nahkampfschaden"; + case 491: + return "Um 15% erhoehter Fernkampfschaden"; + case 492: + return "Ermoeglicht Flug und langsamen Fall"; + case 493: + return "Ermoeglicht Flug und langsamen Fall"; + case 495: + return "Wirft einen steuerbaren Regenbogen aus"; + case 496: + return "Ruft einen Eisblock herbei"; + case 497: + return "Verwandelt den Besitzer beim Hineingehen ins Wasser in Meermenschen"; + case 506: + return "Verwendet Glibber als Munition"; + case 509: + return "Platziert Kabel"; + case 510: + return "Entfernt Kabel"; + case 515: + return "Erzeugt beim Aufprall mehrere Kristallscherben"; + case 516: + return "Ruft beim Aufprall Sternschnuppen herbei"; + case 517: + return "Ein Dolch, der magisch zurueckkehrt"; + case 518: + return "Ruft schnelle Feuerkristallscherben herbei"; + case 519: + return "Ruft unheilige Feuerbaelle herbei"; + case 520: + return "'Die Essenz von Lichtkreaturen'"; + case 521: + return "'Die Essenz von Finsterkreaturen'"; + case 522: + return "'Nicht einmal Wasser loescht diese Flamme'"; + case 523: + return "Kann in Wasser platziert werden"; + case 524: + return "Zum Schmelzen von Adamantiterz"; + case 525: + return "Zur Herstellung von Items aus Mithril- und Adamantitbarren"; + case 526: + return "'Scharf und magisch!'"; + case 527: + return "'Kreaturen in verderbten Wuesten tragen sie mitunter'"; + case 528: + return "'Werden mitunter von Kreaturen in Lichtwuesten getragen'"; + case 529: + return "Wird beim Betreten aktiviert"; + case 531: + return "Zum Zaubern"; + case 532: + return "Laesst Sterne bei Verletzung herabfallen"; + case 533: + return "50%ige Chance, Munition nicht zu verbrauchen"; + case 534: + return "Feuert einen Kugelregen ab"; + case 535: + return "Verringert die Abklingzeit von Heiltraenken"; + case 536: + return "Erhoeht Nahkampf-Rueckstoss"; + case 541: + return "Wird beim Betreten aktiviert"; + case 542: + return "Wird beim Betreten aktiviert"; + case 543: + return "Wird beim Betreten aktiviert"; + case 544: + return "Ruft die Zwillinge herbei"; + case 547: + return "'Die Essenz reinen Schreckens'"; + case 548: + return "'Die Essenz des Zerstoerers'"; + case 549: + return "'Die Essenz der allwissenden Beobachter'"; + case 551: + return "Um 7% erhoehte kritische Trefferchance"; + case 552: + return "Um 7% erhoehter Schaden"; + case 553: + return "Um 15% erhoehter Fernkampfschaden"; + case 554: + return "Verlaengert die Unbesiegbarkeit nach erlittenem Schaden"; + case 555: + return "Um 8% reduzierte Mananutzung"; + case 556: + return "Ruft den Zerstoerer"; + case 557: + return "Ruft Super-Skeletron herbei"; + case 558: + return "Erhoeht die maximale Mana um 100"; + case 559: + return "Nahkampfschaden und kritische Trefferchance um 10% erhoeht"; + case 560: + return "Ruft Schleimi-Koenig herbei"; + case 561: + return "Kann bis zu 5 stapeln"; + case 575: + return "'Essenz maechtiger fliegender Kreaturen'"; + case 576: + return "Kann Songs aufzeichnen"; + case 579: + return "'Nicht mit einer Hamsaege zu verwechseln'"; + case 580: + return "Explodiert bei Aktivierung"; + case 581: + return "Sendet Wasser zu Auslasspumpen"; + case 582: + return "Empfaengt Wasser vom Einlasspumpen"; + case 583: + return "Aktiviert jede Sekunde"; + case 584: + return "Aktiviert alle 3 Sekunden"; + case 585: + return "Aktiviert alle 5 Sekunden"; + case 599: + return "Rechter Mausklick zu öffnen"; + case 600: + return "Rechter Mausklick zu öffnen"; + case 601: + return "Rechter Mausklick zu öffnen"; + case 602: + return "Beschwört den Frost Legion"; + case 603: + return "Vorladung ein Haustier Hase"; + } + break; + } + } + } + else + { + if (l <= 686) + { + switch (l) + { + case 665: + return "Sie sollten nicht diese"; + case 666: + return "Sie sollten nicht diese"; + case 667: + return "Sie sollten nicht diese"; + case 668: + return "Sie sollten nicht diese"; + case 669: + return "Beschwört einen Baby-Pinguin"; + default: + if (l == 676) + { + return "Schießt ein eisiger Bolzen"; + } + switch (l) + { + case 683: + return "Summons des Teufels Dreizack"; + case 684: + return "16% erhöht Nahkampf-und Fernkampf Schaden"; + case 685: + return "11% erhöht Nahkampf-und Fernkampf kritische Trefferchance"; + case 686: + return "8% erhöht Bewegungsgeschwindigkeit"; + } + break; + } + } + else + { + switch (l) + { + case 707: + return "Teilt die Zeit"; + case 708: + return "Teilt die Zeit"; + case 709: + return "Teilt die Zeit"; + default: + if (l == 716) + { + return "Wird verwendet, um kunstgewerbliche Gegenstände aus Metall Bars"; + } + switch (l) + { + case 723: + return "Schießt einen Lichtstrahl"; + case 724: + return "Schießt ein eisiger Bolzen"; + case 725: + return "Shoots frost Pfeile"; + case 726: + return "Schießt einen Strom von frost"; + } + break; + } + } + } + } + else + { + if (l <= 832) + { + if (l <= 761) + { + switch (l) + { + case 748: + return "Ermöglicht Flug und langsam fallen"; + case 749: + return "Ermöglicht Flug und langsam fallen"; + default: + if (l == 753) + { + return "Beschwört ein Haustier Schildkröte"; + } + if (l == 761) + { + return "Ermöglicht Flug und langsam fallen"; + } + break; + } + } + else + { + switch (l) + { + case 779: + return "Erstellt und zerstört Biome beim Sprühen"; + case 780: + return "Wird von der Clentaminator"; + case 781: + return "Wird von der Clentaminator"; + case 782: + return "Wird von der Clentaminator"; + case 783: + return "Wird von der Clentaminator"; + case 784: + return "Wird von der Clentaminator"; + case 785: + return "Ermöglicht Flug und langsam fallen"; + case 786: + return "Ermöglicht Flug und langsam fallen"; + case 787: + return "Stark genug, um Dämonen Altare zerstören"; + case 788: + return "Summons ein Dorn Speer"; + case 789: + case 790: + case 791: + case 795: + case 796: + case 797: + break; + case 792: + return "2% mehr Schaden"; + case 793: + return "2% mehr Schaden"; + case 794: + return "2% mehr Schaden"; + case 798: + return "Kann Hellstone abbauen"; + default: + switch (l) + { + case 821: + return "Ermöglicht Flug und langsam fallen"; + case 822: + return "Ermöglicht Flug und langsam fallen"; + case 823: + return "Ermöglicht Flug und langsam fallen"; + default: + if (l == 832) + { + return "Orte lebendes Holz"; + } + break; + } + break; + } + } + } + else + { + if (l <= 1343) + { + switch (l) + { + case 849: + return "Ermöglicht feste Blöcke auf umgeschaltet werden und ausschalten"; + case 850: + return "Orte blauen Draht"; + case 851: + return "Orte grünen Draht"; + case 852: + return "Aktiviert, wenn ein Spieler auf sie"; + case 853: + return "Aktiviert, wenn alles andere als ein Spieler auf sie"; + case 854: + return "Shops haben niedrigere Preise"; + case 855: + return "Schlagen Feinde manchmal fallen zusätzliche Münzen"; + case 856: + return "'Nachdem eine wunderbare Zeit!'"; + case 857: + return "Ermöglicht dem Halter, einen verbesserten doppelten Sprung tun"; + case 858: + case 859: + case 864: + case 865: + case 866: + case 867: + case 868: + case 869: + case 870: + case 871: + case 872: + case 873: + case 874: + case 875: + case 876: + case 877: + case 878: + case 879: + case 880: + case 881: + case 882: + case 883: + case 884: + case 894: + case 895: + case 896: + case 909: + case 910: + case 911: + case 912: + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 939: + case 940: + case 941: + case 942: + case 943: + case 944: + case 945: + case 949: + case 952: + case 954: + case 955: + case 970: + case 971: + case 972: + case 973: + case 974: + case 978: + case 979: + case 980: + case 981: + case 988: + case 991: + case 992: + case 993: + case 999: + break; + case 860: + return "Bietet das Leben Regeneration und verringert die Abklingzeit Heiltränke"; + case 861: + return "Schaltet den Halter in einen Werwolf in der Nacht und einem merfolk beim Betreten Wasser"; + case 862: + return "Verursacht Sternen zu fallen und steigt Länge der Unbesiegbarkeit nach Schaden zu nehmen"; + case 863: + return "Bietet die Möglichkeit, auf dem Wasser gehen"; + case 885: + return "Immunität gegen Blutungen"; + case 886: + return "Immunität gegen gebrochene Rüstung"; + case 887: + return "Immunität gegen Gift"; + case 888: + return "Immunität gegen dunklen"; + case 889: + return "Immunität zu verlangsamen"; + case 890: + return "Immunität zum Schweigen"; + case 891: + return "Immunität zu verfluchen"; + case 892: + return "Immunität gegen Schwäche"; + case 893: + return "Immunität Verwirrung"; + case 897: + return "Erhöht Nahkampf knockback"; + case 898: + return "ermöglicht Flug"; + case 899: + return "Erhöht alle Statistiken, wenn tagsüber getragen"; + case 900: + return "Erhöht alle Statistiken, wenn während der Nacht getragen"; + case 901: + return "Immunität gegen Schwäche und zerbrochene Rüstung"; + case 902: + return "Immunität gegen Gift und Blutung"; + case 903: + return "Immunität zu verlangsamen und Verwirrung"; + case 904: + return "Immunität zum Schweigen zu bringen und fluchen"; + case 905: + return "Verwendet Münzen für Munition"; + case 906: + return "Bietet 7 Sekunden Immunität gegen Lava"; + case 907: + return "Bietet die Möglichkeit, auf dem Wasser gehen"; + case 908: + return "Bietet die Möglichkeit, auf dem Wasser und Lava zu Fuß"; + case 932: + return "Orte Knochen"; + case 933: + return "Orte verlässt"; + case 934: + return "Ermöglicht der Besitzer für ein paar Sekunden schweben"; + case 935: + return "12% mehr Schaden"; + case 936: + return "Erhöht Nahkampf knockback"; + case 937: + return "Explodiert beim Betreten"; + case 938: + return "Absorbiert 25% Schaden an Spielern in Ihrem Team"; + case 946: + return "Sie fallen langsamer, während diese"; + case 947: + return "Reacts to the light"; + case 948: + return "Ermöglicht Flug und langsam fallen"; + case 950: + return "Bietet zusätzliche Mobilität auf Eis"; + case 951: + return "Schnell startet Schneebälle"; + case 953: + return "Allows the ability to slide down walls"; + case 956: + return "7% erhöht Nahkampfsangriffstempo"; + case 957: + return "7% erhöht Nahkampfsangriffstempo"; + case 958: + return "7% erhöht Nahkampfsangriffstempo"; + case 959: + return "4% erhöht Fernkampfschaden."; + case 960: + return "Erhöht die maximale Mana um 20"; + case 961: + return "Erhöht die maximale Mana um 20"; + case 962: + return "Erhöht die maximale Mana um 20"; + case 963: + return "Gewährt Euch eine Chance, Angriffe auszuweichen"; + case 964: + return "Feuert eine Verbreitung von Kugeln"; + case 965: + return "Kann auf bestiegen werden"; + case 966: + return "Leben Regeneration erhöht wird, wenn in der Nähe ein Lagerfeuer"; + case 967: + return "Legen Sie es auf einem Stock und Braten über dem Lagerfeuer"; + case 968: + return "Braten Sie es über dem Lagerfeuer!"; + case 969: + return "Kleinere Verbesserungen zu sämtlichen Statistiken"; + case 975: + return "Ermöglicht die Fähigkeit, abrutschen Wände"; + case 976: + return "Ermöglicht die Fähigkeit, Wände zu klettern"; + case 977: + return "Ermöglicht die Fähigkeit zu stürzen"; + case 982: + return "Erhöht die maximale Mana um 20"; + case 983: + return "Ermöglicht dem Halter, Sprung verdoppeln"; + case 984: + return "Ermöglicht die Fähigkeit, Wände und dash klettern"; + case 985: + return "Werfen Sie einen climbable Linie des Seils erstellen"; + case 986: + return "Ermöglicht die Sammlung von Saatgut für Munition"; + case 987: + return "Ermöglicht dem Halter, Sprung verdoppeln"; + case 989: + return "Schießt ein verzaubertes Schwert Strahl"; + case 990: + return "'Nicht mit einem hamdrill verwechseln'"; + case 994: + return "Beschwört einen Baby-Eater of Souls"; + case 995: + return "Wird verwendet, um Objekte Handwerk"; + case 996: + return "Wird verwendet, um Objekte Handwerk"; + case 997: + return "Schaltet Schlamm und Matsch in etwas nützlich"; + case 998: + return "Wird verwendet, um Objekte Handwerk"; + case 1000: + return "schießt Konfetti überall!"; + case 1001: + return "16% erhöht Nahkampfschaden"; + case 1002: + return "16% erhöht Fernkampfschaden"; + case 1003: + return "Erhöht die maximale Mana um 80 und verringert Manaverbrauchs um 17%"; + case 1004: + return "5% mehr Schaden"; + case 1005: + return "8% Chance auf kritische Treffer"; + case 1006: + return "Reagiert auf das Licht"; + default: + switch (l) + { + case 1071: + return "Gebrauchte mit Farbe um Farbe Blöcke"; + case 1072: + return "Gebrauchte mit Farbe um Farbe Wände"; + default: + switch (l) + { + case 1100: + return "Wird verwendet, um Farbe zu entfernen"; + case 1107: + return "Gebrauchte und türkis Farbstoff machen"; + case 1108: + return "Dient zum grünen Farbstoff machen"; + case 1109: + return "Dient zum Himmel blauer Farbstoff machen"; + case 1110: + return "Wird verwendet, um einen gelben Farbstoff machen"; + case 1111: + return "Dient zum blauen Farbstoff machen"; + case 1112: + return "Wird verwendet, um Kalk Farbstoff machenWird verwendet, um rosa Farbstoff machen"; + case 1113: + return "Wird verwendet, um rosa Farbstoff machen"; + case 1114: + return "Dient zum orangen Farbstoff machen"; + case 1115: + return "Wird verwendet, um roten Farbstoff zu machen"; + case 1116: + return "Wird verwendet, um Blaugrünfarbstoff machen"; + case 1117: + return "Dient zum violetten Farbstoff machen"; + case 1118: + return "Wird verwendet, um Purpur machen"; + case 1119: + return "Dient zum schwarzen Farbstoff machen"; + case 1120: + return "Wird verwendet, um Farbstoffe Craft"; + case 1121: + return "Shoots Bienen, die den Feind jagen wird"; + case 1122: + return "Jagt deinen Feind"; + case 1123: + return "Summons Killer-Bienen nach dem Auftreffen auf deinen Gegner"; + case 1129: + return "Orte Nesselsucht"; + case 1130: + return "Explodiert in einem Bienenschwarm"; + case 1131: + return "Ermöglicht dem Halter, der Schwerkraft umkehren"; + case 1132: + return "Gibt Bienen, wenn sie beschädigt"; + case 1133: + return "Summons die Bienenkönigin"; + case 1141: + return "Öffnet die Tür Dschungeltempel"; + case 1145: + return "Verwendet für Grundhandwerk"; + case 1151: + return "Aktiviert, wenn ein Spieler auf sie"; + case 1156: + return "Verriegelungen auf, um Feinde für die kontinuierliche Schäden"; + case 1157: + return "Beschwört einen Pygmäen, für Sie zu kämpfen"; + case 1158: + return "Erhöht Eure maximale Anzahl der Schergen"; + case 1159: + return "Erhöht Eure maximale Anzahl der Schergen"; + case 1160: + return "Erhöht Eure maximale Anzahl der Schergen"; + case 1161: + return "Erhöht Eure maximale Anzahl der Schergen"; + case 1162: + return "Ermöglicht Flug und langsam fallen"; + case 1163: + return "Ermöglicht dem Halter, Sprung verdoppeln"; + case 1164: + return "Ermöglicht dem Halter, vierfachen Sprung"; + case 1165: + return "Ermöglicht Flug und langsam fallen"; + case 1167: + return "Erhöht den Schaden Eurer Schergen von 15"; + case 1169: + return "Summons ein Baby Skeletron Kopf"; + case 1170: + return "Summons ein Baby Hornisse"; + case 1171: + return "Beschwört einen Geist tiki"; + case 1172: + return "Summons ein Haustier Eidechse"; + case 1178: + return "Schnell schießt gestochen scharfe Blätter"; + case 1179: + return "Jagt deinen Feind"; + case 1180: + return "Beschwört einen Papagei"; + case 1181: + return "Summons ein Baby Truffle"; + case 1182: + return "Summons ein Haustier Bäumchen"; + case 1183: + return "Beschwört einen Hauch um Licht zur Verfügung"; + case 1188: + return "Kann mir Mithril, Orichalcum, Adamantite und Titanium"; + case 1189: + return "Kann mir Mithril, Orichalcum, Adamantite und Titanium"; + case 1195: + return "Kann mir Adamantitbeschlagene und Titanium"; + case 1196: + return "Kann mir Adamantitbeschlagene und Titanium"; + case 1205: + return "8% erhöht Nahkampfschaden"; + case 1206: + return "9% erhöht Fernkampfschaden"; + case 1207: + return "7% erhöht magischen Schaden und kritische Trefferchance"; + case 1208: + return "3% Der Schaden wurde erhöht"; + case 1209: + return "2% Der Schaden wurde erhöht"; + case 1210: + return "7% erhöht Nahkampfschaden"; + case 1211: + return "15% erhöhte Chance auf kritische Treffer reichte"; + case 1212: + return "18% Magie erhöht Chance auf kritische Treffer"; + case 1213: + return "6% erhöhte Chance auf kritische Treffer"; + case 1214: + return "11% erhöhte Bewegungsgeschwindigkeit"; + case 1215: + return "8% erhöht Nahkampfschaden und Chance auf kritische Treffer"; + case 1216: + return "16% erhöht Fernkampfschaden"; + case 1217: + return "16% erhöht magischen Schaden und 7% erhöht Magie Chance auf kritische Treffer"; + case 1218: + return "4% Der Schaden wurde erhöht"; + case 1219: + return "3% erhöhten Schaden und kritische Trefferchance"; + case 1220: + return "Wird verwendet, um Elemente aus Mithril, orichalcum, Adamant und Titan Bars Handwerk"; + case 1221: + return "Gebraucht zu schmelzen Adamant und Titanerz"; + case 1226: + return "Schießt eine leistungsstarke Kugel"; + case 1227: + return "Schießt eine Spore Cloud"; + case 1228: + return "Schießt eine Spore Cloud"; + case 1235: + return "Prallt zurück nach der Kollision mit einer Wand"; + case 1242: + return "Beschwört einen Baby-Dinosaurier"; + case 1244: + return "Beschwört eine Wolke zu regnen auf deine Feinde"; + case 1247: + return "Verursacht Sternen zu fallen und gibt Bienen, wenn sie verletzt"; + case 1248: + return "10% erhöhte Chance auf kritische Treffer"; + case 1249: + return "Erhöht Sprunghöhe"; + case 1250: + return "Ermöglicht dem Halter, Sprung verdoppeln"; + case 1251: + return "Ermöglicht dem Halter, Sprung verdoppeln"; + case 1252: + return "Ermöglicht dem Halter, Sprung verdoppeln"; + case 1253: + return "Legt eine Schale um den Eigentümer, wenn weniger als 25% Leben, reduziert Schäden"; + case 1254: + return "Schießt ein leistungsfähiges, mit hoher Geschwindigkeit Kugel"; + case 1255: + return "Schießt ein leistungsfähiges, mit hoher Geschwindigkeit Kugel"; + case 1256: + return "Beschwört eine Wolke, um Blut auf deine Feinde regnen"; + case 1258: + return "Schießt eine explosive Bolzen"; + case 1259: + return "Schießt gestochen scharfe Blütenblätter in der Nähe befindliche Feinde"; + case 1260: + return "Schießt ein Regenbogen, der kontinuierliche Schaden anrichtet"; + case 1261: + return "Explodes in tödliche Splitter"; + case 1264: + return "Schießt einen Ball von Frost"; + case 1265: + return "Schießt ein leistungsfähiges, mit hoher Geschwindigkeit Kugel"; + case 1282: + return "Erhöht maximales Mana um 20"; + case 1283: + return "Erhöht maximales Mana um 40"; + case 1284: + return "Erhöht maximales Mana um 40"; + case 1285: + return "Erhöht maximales Mana um 60"; + case 1286: + return "Erhöht maximales Mana um 60"; + case 1287: + return "Erhöht maximales Mana um 80"; + case 1290: + return "Erhöht die Bewegungsgeschwindigkeit, nachdem er geschlagen"; + case 1291: + return "Erhöht dauerhaft die maximale Lebensdauer von 5"; + case 1293: + return "Eingesetzt bei den Lihzahrd Altar"; + case 1294: + return "Capable des Bergbaus Lihzahrd Ziegel"; + case 1295: + return "Schießt ein Piercing ray von Wärme"; + case 1296: + return "Beschwört einen mächtigen Felsblock"; + case 1297: + return "Locher mit der Kraft einer golem"; + case 1299: + return "Erhöht die Reichweite sehen, wenn statt"; + case 1300: + return "Erhöht die Reichweite sehen für Waffen"; + case 1301: + return "10% Der Schaden wurde erhöht"; + case 1303: + return "Bietet Licht Unterwasser"; + case 1306: + return "Schießt ein eisiger Sichel"; + case 1307: + return "'Sie sind eine schreckliche Person'"; + case 1308: + return "Schießt ein Gift fang, die mehrere Feinde durchbohrt"; + case 1309: + return "Beschwört ein Baby Schleim für dich kämpfen"; + case 1310: + return "Verursacht Gift auf Feinde"; + case 1311: + return "Summons an eyeball spring"; + case 1312: + return "Beschwört einen Baby-Schneemann"; + case 1313: + return "Schießt einen Schädel"; + case 1314: + return "Schießt ein Boxhandschuh"; + case 1315: + return "Beschwört einen Pirateninvasion"; + case 1316: + return "6% erhöht Nahkampfschaden"; + case 1317: + return "8% erhöht Nahkampfschaden und Chance auf kritische Treffer"; + case 1318: + return "4% erhöht Nahkampf kritische Trefferchance"; + case 1321: + return "Erhöht Pfeil Geschwindigkeit und Schaden um 10%"; + case 1322: + return "Verursacht Feuerschaden Angriff"; + case 1323: + return "Reduces damage from touching lava"; + case 1326: + return "Teleporte der Position der Maus"; + case 1327: + return "Schießt einen tödlichen Sichel"; + case 1331: + return "Vorladung der Brain of Cthulhu"; + case 1332: + return "'Das Blut der Götter'"; + case 1333: + return "Kann in Wasser gelegt werden"; + case 1334: + return "Verringert Verteidigung des Ziels"; + case 1335: + return "Verringert Verteidigung des Ziels"; + case 1336: + return "Sprays eine Dusche von Jauche"; + case 1343: + return "Erhöht die Nahkampf-Rückstoß und verursacht Feuerschaden Angriff"; + } + break; + } + break; + } + } + else + { + switch (l) + { + case 1430: + return "Dient zur Waffe imbuement Flaschen Handwerk"; + case 1431: + break; + case 1432: + return "Wird verwendet, um verschiedene Arten von Munition Handwerk"; + default: + switch (l) + { + case 1444: + return "Erzeugt einen Schatten Strahl, abprallt Wände"; + case 1445: + return "Startet einen Feuerball, der in einem rasenden Inferno explodiert"; + case 1446: + return "Beschwört eine verlorene Seele zu jagen Ihre Feinde"; + case 1447: + case 1448: + break; + case 1449: + return "bläst Seifenblasen"; + case 1450: + return "bläst Seifenblasen"; + default: + switch (l) + { + case 1503: + return "Erhöht die maximale Mana um 80 und verringert Manaverbrauchs um 17%"; + case 1504: + return "7% erhöht magischen Schaden und kritische Trefferchance"; + case 1505: + return "8% erhöht magischen Schaden"; + case 1513: + return "Ein leistungsfähiges Rückkehr Hammer"; + case 1515: + return "Ermöglicht Flug und langsam fallen"; + case 1522: + return "Für fangen die gem. Es fällt, wenn du stirbst"; + case 1523: + return "Für fangen die gem. Es fällt, wenn du stirbst"; + case 1524: + return "Für fangen die gem. Es fällt, wenn du stirbst"; + case 1525: + return "Für fangen die gem. Es fällt, wenn du stirbst"; + case 1526: + return "Für fangen die gem. Es fällt, wenn du stirbst"; + case 1527: + return "Für fangen die gem. Es fällt, wenn du stirbst"; + case 1533: + return "Freigeschaltet einen Jungle Brust in den Kerker"; + case 1534: + return "Freigeschaltet eine Korruption Brust in den Kerker"; + case 1535: + return "Freigeschaltet einen hochroten Brust in den Kerker"; + case 1536: + return "Freigeschaltet eine Hallowed Brust in den Kerker"; + case 1537: + return "Freischaltungen einem gefrorenen Brust in den Kerker"; + case 1543: + return "Gebrauchte mit Farbe um Farbe Blöcke"; + case 1544: + return "Gebrauchte mit Farbe um Farbe Wände"; + case 1545: + return "Wird verwendet, um Farbe zu entfernen"; + case 1546: + return "15% erhöht arrow Schaden"; + case 1547: + return "15% erhöht Kugel Schaden"; + case 1548: + return "15% erhöht Rakete Schaden"; + case 1549: + return "13% erhöhte Chance auf kritische Treffer reichte"; + case 1550: + return "7% erhöhte Chance auf kritische Treffer reichte"; + case 1551: + return "Konvertiert chlorophytischen Bars in Shroomite Bars"; + case 1553: + return "50% Chance, nicht verbrauchen Munition"; + case 1554: + return "Sie sollten nicht diese"; + case 1555: + return "Sie sollten nicht diese"; + case 1556: + return "Sie sollten nicht diese"; + case 1557: + return "Sie sollten nicht diese"; + case 1558: + return "Sie sollten nicht diese"; + case 1559: + return "Sie sollten nicht diese"; + case 1560: + return "Sie sollten nicht diese"; + case 1561: + return "Sie sollten nicht diese"; + case 1562: + return "Sie sollten nicht diese"; + case 1563: + return "Sie sollten nicht diese"; + case 1564: + return "Sie sollten nicht diese"; + case 1565: + return "Sie sollten nicht diese"; + case 1566: + return "Sie sollten nicht diese"; + case 1567: + return "Sie sollten nicht diese"; + case 1568: + return "Sie sollten nicht diese"; + case 1569: + return "Schnell werfen Leben stehlen Dolche"; + case 1571: + return "Ein leistungsfähiges Javalin die winzigen Esser entfesselt"; + case 1572: + return "Beschwört einen mächtigen Frost Hydra, um Eis auf eure Feinde spucken"; + case 1578: + return "Releases Bienen und erhöht die Bewegungsgeschwindigkeit bei Beschädigung"; + case 1579: + return "Der Träger kann laufen super schnell"; + case 1580: + return "Sie sollten nicht diese"; + case 1581: + return "Sie sollten nicht diese"; + case 1582: + return "Sie sollten nicht diese"; + case 1583: + return "Sie sollten nicht diese"; + case 1584: + return "Sie sollten nicht diese"; + case 1585: + return "Sie sollten nicht diese"; + case 1586: + return "Sie sollten nicht diese"; + case 1587: + return "Sie sollten nicht diese"; + case 1588: + return "Sie sollten nicht diese"; + case 1595: + return "Erhöht maximales Mana um 20"; + } + break; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 3) + { + if (l <= 332) + { + if (l <= 128) + { + if (l <= 36) + { + if (l <= 8) + { + if (l == -1) + { + return "Può estrarre meteorite"; + } + if (l == 8) + { + return "Fornisce luce"; + } + } + else + { + switch (l) + { + case 15: + return "Indica il tempo"; + case 16: + return "Indica il tempo"; + case 17: + return "Indica il tempo"; + case 18: + return "Mostra la profondità"; + case 19: + case 20: + case 21: + case 22: + break; + case 23: + return "'Sia gustoso che infiammabile'"; + default: + if (l == 29) + { + return "Aumenta in maniera permanente la vita massima di 20"; + } + switch (l) + { + case 33: + return "Usato per fondere il minerale"; + case 35: + return "Usata per creare oggetti dalle sbarre di metallo"; + case 36: + return "Usato per l'artigianato di base"; + } + break; + } + } + } + else + { + if (l <= 75) + { + if (l == 43) + { + return "Evoca l'Occhio di Cthulhu"; + } + switch (l) + { + case 49: + return "Rigenera la vita lentamente"; + case 50: + return "Guarda nello specchio per tornare a casa"; + case 51: + case 52: + case 55: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 69: + break; + case 53: + return "Permette il salto doppio"; + case 54: + return "Colui che li indossa può correre velocissimo"; + case 56: + return "'Pulsa di energia oscura'"; + case 57: + return "'Pulsa di energia oscura'"; + case 64: + return "Evoca una spina vile"; + case 65: + return "Fa piovere le stelle dal cielo"; + case 66: + return "Ripulisce la distruzione"; + case 67: + return "Rimuove il sacro"; + case 68: + return "'Gustoso!'"; + case 70: + return "Evoca il Mangiatore di mondi"; + default: + if (l == 75) + { + return "Sparisce dopo l'alba"; + } + break; + } + } + else + { + if (l == 84) + { + return "'Vieni qui!'"; + } + if (l == 88) + { + return "Fa luce una volta indossato"; + } + switch (l) + { + case 98: + return "33% di possibilità di non consumare munizioni"; + case 100: + return "Velocità del corpo a corpo aumentata del 7%"; + case 101: + return "Velocità del corpo a corpo aumentata del 7%"; + case 102: + return "Velocità del corpo a corpo aumentata del 7%"; + case 103: + return "In grado di estrarre la pietra infernale"; + case 109: + return "Aumenta in maniera permanente il mana massimo di 20"; + case 111: + return "Aumenta il mana massimo di 20"; + case 112: + return "Tira palle di fuoco"; + case 113: + return "Scaglia un missile guidato"; + case 114: + return "Muovi magicamente la terra"; + case 115: + return "Crea una sfera di luce magica"; + case 117: + return "'Calda al tocco'"; + case 118: + return "Lanciato a volte da Scheletri e Piranha"; + case 120: + return "Incendia le frecce di legno"; + case 121: + return "'Creato dal fuoco!'"; + case 123: + return "Danno magico aumentato del 5%"; + case 124: + return "Danno magico aumentato del 5%"; + case 125: + return "Danno magico aumentato del 5%"; + case 128: + return "Permettono il volo"; + } + } + } + } + else + { + if (l <= 218) + { + if (l <= 187) + { + switch (l) + { + case 148: + return "Avere questo oggetto potrebbe attirare attenzione non desiderata"; + case 149: + return "'Contiene simboli strani'"; + case 150: + case 154: + case 155: + case 160: + case 161: + case 162: + case 163: + case 164: + break; + case 151: + return "Danno a distanza aumentato del 4%"; + case 152: + return "Danno a distanza aumentato del 4%"; + case 153: + return "Danno a distanza aumentato del 4%"; + case 156: + return "Permette immunità allo spintone"; + case 157: + return "Spruzza una cascata d'acqua"; + case 158: + return "Annulla i danni da caduta"; + case 159: + return "Aumenta l'altezza del salto"; + case 165: + return "Lancia un dardo di acqua lento"; + case 166: + return "Una piccola esplosione che distruggerà alcune mattonelle"; + case 167: + return "Una grande esplosione che distruggerà molte mattonelle"; + case 168: + return "Una piccola esplosione che non distruggerà mattonelle"; + default: + if (l == 175) + { + return "'Calda al tocco'"; + } + switch (l) + { + case 186: + return "'Perché non annegare è alquanto piacevole'"; + case 187: + return "Abilita al nuoto"; + } + break; + } + } + else + { + if (l == 193) + { + return "Permette immunità ai blocchi di fuoco"; + } + if (l == 197) + { + return "Spara stelle cadenti"; + } + switch (l) + { + case 208: + return "'Graziosa, oh com'è graziosa'"; + case 211: + return "Velocità del corpo a corpo aumentata del 12%"; + case 212: + return "Velocità di movimento aumentata del 10%"; + case 213: + return "Crea erba dalla terra"; + case 215: + return "'Può disturbare gli altri'"; + case 218: + return "Evoca una palla di fuoco guidata"; + } + } + } + else + { + if (l <= 305) + { + switch (l) + { + case 222: + return "Fa crescere le piante"; + case 223: + return "Consumo mana ridotto del 6%"; + case 224: + case 225: + case 226: + case 227: + break; + case 228: + return "Aumenta il mana massimo di 20"; + case 229: + return "Aumenta il mana massimo di 20"; + case 230: + return "Aumenta il mana massimo di 20"; + default: + switch (l) + { + case 235: + return "'Lanciare potrebbe essere difficile.'"; + case 236: + break; + case 237: + return "'Migliora il tuo look!'"; + case 238: + return "Danno magico aumentato del 15%"; + default: + switch (l) + { + case 261: + return "'Sta ridendo, potrebbe essere uno spuntino appetitoso'"; + case 266: + return "'Buona idea!'"; + case 267: + return "'Sei una persona terribile.'"; + case 268: + return "Aumenta moltissimo il respiro sott'acqua"; + case 272: + return "Evoca una falce demoniaca"; + case 281: + return "Permette la raccolta di semi come munizioni"; + case 282: + return "Funziona da bagnato"; + case 283: + return "Da usare con la cerbottana"; + case 285: + return "Velocità di movimento aumentata del 5%"; + case 288: + return "Dà immunità alla lava"; + case 289: + return "Rigenera la vita"; + case 290: + return "Velocità di movimento aumentata del 25%"; + case 291: + return "Respira acqua invece di aria"; + case 292: + return "Aumenta la difesa di 8"; + case 293: + return "Aumenta la rigenerazione del mana"; + case 294: + return "Danno magico aumentato del 20%"; + case 295: + return "Velocità di caduta lenta"; + case 296: + return "Mostra l'ubicazione di tesori e minerale"; + case 297: + return "Rende invisibili"; + case 298: + return "Emette un'aura di luce"; + case 299: + return "Migliora la visione notturna"; + case 300: + return "Aumenta il ritmo di generazone dei nemici"; + case 301: + return "Anche gli aggressori subiscono danni"; + case 302: + return "Consente di camminare sull'acqua"; + case 303: + return "Velocità e danni della freccia aumentati del 20%"; + case 304: + return "Mostra la posizione dei nemici"; + case 305: + return "Permette il controllo della gravità"; + } + break; + } + break; + } + } + else + { + if (l == 324) + { + return "'Bandita in molti luoghi'"; + } + switch (l) + { + case 327: + return "Apre una cassa d'oro"; + case 328: + break; + case 329: + return "Apre tutte le casse ombra"; + default: + if (l == 332) + { + return "Usato per fabbricare abiti"; + } + break; + } + } + } + } + } + else + { + if (l <= 726) + { + if (l <= 603) + { + if (l <= 407) + { + if (l == 352) + { + return "Usato per produrre birra"; + } + switch (l) + { + case 357: + return "Migliorie minori a tutti i parametri"; + case 361: + return "Evoca un esercito di goblin"; + case 363: + return "Usata per un'avanzata lavorazione del legno"; + case 367: + return "Abbastanza forte per distruggere gli Altari dei demoni"; + case 371: + return "Aumenta il mana massimo di 40"; + case 372: + return "Velocità di movimento aumentata del 7%"; + case 373: + return "Danno a distanza aumentato del 10%"; + case 376: + return "Aumenta il mana massimo di 60"; + case 377: + return "Possibilità di colpo critico nel corpo a corpo aumentata del 5%"; + case 378: + return "Danno a distanza aumentato del 12%"; + case 385: + return "Può estrarre mitrilio"; + case 386: + return "Può estrarre adamantio"; + case 389: + return "Può confondere"; + case 393: + return "Mostra posizione orizzontale"; + case 394: + return "Abilita al nuoto"; + case 395: + return "Mostra posizione"; + case 396: + return "Annulla i danni da caduta"; + case 397: + return "Permette immunità allo spintone"; + case 398: + return "Permette la combinazione di alcuni accessori"; + case 399: + return "Permette il salto doppio"; + case 400: + return "Aumenta il mana massimo di 80"; + case 401: + return "Possibilità di colpo critico nel corpo a corpo aumentata del 7%"; + case 402: + return "Danno a distanza aumentato del 14%"; + case 403: + return "Danno aumentato del 6%"; + case 404: + return "Possibilità di colpo critico aumetata del 4%"; + case 405: + return "Permettono il volo"; + case 407: + return "Aumenta la possibilità di collocamento dei blocchi"; + } + } + else + { + switch (l) + { + case 422: + return "Spruzza acquasanta su alcuni blocchi"; + case 423: + return "Diffonde la distruzione su alcuni blocchi"; + case 424: + break; + case 425: + return "Evoca una fata magica"; + default: + if (l == 434) + { + return "Tre raffiche"; + } + switch (l) + { + case 485: + return "Durante la luna piena trasforma il portatore in un lupo mannaro"; + case 486: + return "Crea una griglia sullo schermo per sistemare i blocchi"; + case 489: + return "Danno magico aumentato del 15%"; + case 490: + return "Danno nel corpo a corpo aumentato del 15%"; + case 491: + return "Danno a distanza aumentato del 15%"; + case 492: + return "Permettono il volo e la caduta lenta"; + case 493: + return "Permettono il volo e la caduta lenta"; + case 495: + return "Genera un arcobaleno guidato"; + case 496: + return "Evoca un blocco di ghiaccio"; + case 497: + return "Trasforma il portatore in Tritone quando entra in acqua"; + case 506: + return "Usa il gel come munizione"; + case 509: + return "Sistema i cavi"; + case 510: + return "Rimuove i cavi"; + case 515: + return "Crea svariati frammenti di cristallo all'impatto"; + case 516: + return "Evoca stelle cadenti all'impatto"; + case 517: + return "Un pugnale magico che ritorna"; + case 518: + return "Evoca veloci frammenti di cristallo infuocati"; + case 519: + return "Evoca sfere di fuoco profane"; + case 520: + return "'L'essenza delle creature della luce'"; + case 521: + return "'L'essenza delle creature oscure'"; + case 522: + return "'Neanche l'acqua può spegnere la fiamma'"; + case 523: + return "Può essere messa in acqua"; + case 524: + return "Usata per fondere il minerale adamantio"; + case 525: + return "Usata per creare oggetti da sbarre di mitrilio e adamantio"; + case 526: + return "'Appuntito e magico!'"; + case 527: + return "'A volte portato dalle creature nei deserti distrutti'"; + case 528: + return "'A volte portato dalle creature nei deserti di luce'"; + case 529: + return "Si attiva quando calpestata"; + case 531: + return "Può essere incantato"; + case 532: + return "Causa la caduta delle stelle quando colpito"; + case 533: + return "50% di possibilità di non consumare munizioni"; + case 534: + return "Spara una rosa di proiettili"; + case 535: + return "Riduce la ricarica della pozione curativa"; + case 536: + return "Aumenta lo spintone in corpo a corpo"; + case 541: + return "Si attiva quando calpestata"; + case 542: + return "Si attiva quando calpestata"; + case 543: + return "Si attiva quando calpestata"; + case 544: + return "Evoca i gemelli"; + case 547: + return "'L'essenza del terrore puro'"; + case 548: + return "'L'essenza del distruttore'"; + case 549: + return "'L'essenza degli osservatori onniscienti'"; + case 551: + return "Possibilità di colpo critico aumentata del 7%"; + case 552: + return "Danno aumentato del 7%"; + case 553: + return "Danno a distanza aumentato del 15%"; + case 554: + return "Aumenta la durata dell'invincibilità dopo aver subito danni"; + case 555: + return "Consumo mana ridotto del 8%"; + case 556: + return "Evoca l'Distruttore"; + case 557: + return "Evoca lo Skeletron primario"; + case 558: + return "Aumenta il mana massimo di 100"; + case 559: + return "Possibilità di danno corpo a corpo e colpo critico aumentata del 10%"; + case 560: + return "Evoca lo slime re"; + case 561: + return "Raccoglie fino a 5"; + case 575: + return "'L'essenza delle potenti creature volanti'"; + case 576: + return "Ha una possibilità di registrare canzoni"; + case 579: + return "'Da non confondere con il Segartello'"; + case 580: + return "Esplodono quando attivati"; + case 581: + return "Invia acqua alle pompe esterne"; + case 582: + return "Riceve acqua dalle pompe interne"; + case 583: + return "Si attiva ogni secondo"; + case 584: + return "Si attiva ogni 3 secondi"; + case 585: + return "Si attiva ogni 5 secondi"; + case 599: + return "Tasto destro del mouse per aprire"; + case 600: + return "Tasto destro del mouse per aprire"; + case 601: + return "Tasto destro del mouse per aprire"; + case 602: + return "Evoca la Legione di Frost"; + case 603: + return "Evoca un coniglio domestico"; + } + break; + } + } + } + else + { + if (l <= 686) + { + switch (l) + { + case 665: + return "Non si dovrebbe avere questo"; + case 666: + return "Non si dovrebbe avere questo"; + case 667: + return "Non si dovrebbe avere questo"; + case 668: + return "Non si dovrebbe avere questo"; + case 669: + return "Evoca un bambino pinguino"; + default: + if (l == 676) + { + return "Spara un bullone di ghiaccio"; + } + switch (l) + { + case 683: + return "Evoca tridente del Diavolo"; + case 684: + return "16% aumentato mischia e danno a distanza"; + case 685: + return "11% aumentato mischia ea distanza possibilità di critico"; + case 686: + return "8% maggiore velocità di movimento"; + } + break; + } + } + else + { + switch (l) + { + case 707: + return "Indica il tempo di"; + case 708: + return "Indica il tempo di"; + case 709: + return "Indica il tempo di"; + default: + if (l == 716) + { + return "Usato per oggetti artigianali da barre metalliche"; + } + switch (l) + { + case 723: + return "Spara un fascio di luce"; + case 724: + return "Spara un bullone di ghiaccio"; + case 725: + return "Germogli gelo frecce"; + case 726: + return "Riprende un flusso di gelo"; + } + break; + } + } + } + } + else + { + if (l <= 832) + { + if (l <= 761) + { + switch (l) + { + case 748: + return "Permette di volo e la caduta lenta"; + case 749: + return "Permette di volo e la caduta lenta"; + default: + if (l == 753) + { + return "Summons a pet turtle"; + } + if (l == 761) + { + return "Permette di volo e la caduta lenta"; + } + break; + } + } + else + { + switch (l) + { + case 779: + return "Crea e distrugge biomi quando spruzzato"; + case 780: + return "Usato dal Clentaminator"; + case 781: + return "Usato dal Clentaminator"; + case 782: + return "Usato dal Clentaminator"; + case 783: + return "Usato dal Clentaminator"; + case 784: + return "Usato dal Clentaminator"; + case 785: + return "Permette di volo e la caduta lenta"; + case 786: + return "Permette di volo e la caduta lenta"; + case 787: + return "Abbastanza forte da distruggere Altari Demone"; + case 788: + return "Evoca una lancia spina"; + case 789: + case 790: + case 791: + case 795: + case 796: + case 797: + break; + case 792: + return "2% incrementato il danno"; + case 793: + return "2% incrementato il danno"; + case 794: + return "2% incrementato il danno"; + case 798: + return "In grado di estrarre Hellstone"; + default: + switch (l) + { + case 821: + return "Permette di volo e la caduta lenta"; + case 822: + return "Permette di volo e la caduta lenta"; + case 823: + return "Permette di volo e la caduta lenta"; + default: + if (l == 832) + { + return "Luoghi legno vivo"; + } + break; + } + break; + } + } + } + else + { + if (l <= 1343) + { + switch (l) + { + case 849: + return "Consente blocchi solidi di essere attivata e disattivata"; + case 850: + return "Luoghi filo blu"; + case 851: + return "Luoghi filo verde"; + case 852: + return "Attiva quando un giocatore passi su di esso"; + case 853: + return "Attiva quando tutt'altro che un giocatore passi su di essa"; + case 854: + return "Negozi hanno prezzi più bassi"; + case 855: + return "Colpire i nemici a volte cadere monete extra"; + case 856: + return "'Avere un tempo meraviglioso!'"; + case 857: + return "Consente al titolare di fare una migliore doppio salto"; + case 858: + case 859: + case 864: + case 865: + case 866: + case 867: + case 868: + case 869: + case 870: + case 871: + case 872: + case 873: + case 874: + case 875: + case 876: + case 877: + case 878: + case 879: + case 880: + case 881: + case 882: + case 883: + case 884: + case 894: + case 895: + case 896: + case 909: + case 910: + case 911: + case 912: + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 939: + case 940: + case 941: + case 942: + case 943: + case 944: + case 945: + case 949: + case 952: + case 954: + case 955: + case 970: + case 971: + case 972: + case 973: + case 974: + case 978: + case 979: + case 980: + case 981: + case 988: + case 991: + case 992: + case 993: + case 999: + break; + case 860: + return "Fornisce la rigenerazione della vita e riduce il cooldown delle pozioni di guarigione"; + case 861: + return "Attiva il supporto in un lupo mannaro di notte e un Tritone quando si entra in acqua"; + case 862: + return "Provoca stelle a cadere e aumenta la durata di invincibilità dopo l'assunzione di danni"; + case 863: + return "Offre la possibilità di camminare sull'acqua"; + case 885: + return "immunità alle emorragie"; + case 886: + return "immunità alle armature rotto"; + case 887: + return "immunità al veleno"; + case 888: + return "Immunità alle tenebre"; + case 889: + return "immunità per rallentare"; + case 890: + return "immunità al silenzio"; + case 891: + return "immunità a maledire"; + case 892: + return "immunità alla debolezza"; + case 893: + return "immunità alla confusione"; + case 897: + return "Aumenta mischia contraccolpo"; + case 898: + return "consente di volo"; + case 899: + return "Aumenta tutte le statistiche se consumato durante il giorno"; + case 900: + return "Aumenta tutte le statistiche se consumato durante la notte"; + case 901: + return "immunità alla debolezza e armatura rotto"; + case 902: + return "immunità al veleno e sanguinamento"; + case 903: + return "immunità a rallentare e la confusione"; + case 904: + return "immunità al silenzio e maledire"; + case 905: + return "Utilizza le monete per munizioni"; + case 906: + return "Fornisce 7 secondi di immunità ai lavica"; + case 907: + return "Offre la possibilità di camminare sull'acqua"; + case 908: + return "Offre la possibilità di camminare sulle acque e la lava"; + case 932: + return "luoghi osso"; + case 933: + return "luoghi lascia"; + case 934: + return "Consente al proprietario di galleggiare per qualche secondo"; + case 935: + return "12% incrementato il danno"; + case 936: + return "Aumenta mischia contraccolpo"; + case 937: + return "Esplode quando calpestato"; + case 938: + return "Assorbe il 25% del danno fatto ai giocatori per la tua squadra"; + case 946: + return "Si cadrà più lento mentre si tiene presente"; + case 947: + return "Reagisce alla luce"; + case 948: + return "Permette di volo e la caduta lenta"; + case 950: + return "Fornisce la mobilità in più sul ghiaccio"; + case 951: + return "Lancia rapidamente palle di neve"; + case 953: + return "Consente la possibilità di far scorrere verso il basso le pareti"; + case 956: + return "7% maggiore velocità di mischia"; + case 957: + return "7% maggiore velocità di mischia"; + case 958: + return "7% maggiore velocità di mischia"; + case 959: + return "4% incrementato il danno a distanza"; + case 960: + return "Aumenta mana massimo del 20"; + case 961: + return "Aumenta mana massimo del 20"; + case 962: + return "Aumenta mana massimo del 20"; + case 963: + return "Dà la possibilità di schivare l'attacco"; + case 964: + return "Spara una diffusione di proiettili"; + case 965: + return "Può essere salito sul"; + case 966: + return "Life regeneration is increased when near a campfire"; + case 967: + return "La vita di rigenerazione è aumentata quando vicino a un falò"; + case 968: + return "Arrostire su un fuoco!"; + case 969: + return "Piccoli miglioramenti a tutti stats"; + case 975: + return "Consente la possibilità di far scorrere verso il basso le pareti"; + case 976: + return "Consente la possibilità di scalare le pareti"; + case 977: + return "Consente la possibilità di precipitare"; + case 982: + return "Aumenta mana massimo del 20"; + case 983: + return "Consente al titolare di doppio salto"; + case 984: + return "Consente la possibilità di scalare muri e cruscotto"; + case 985: + return "Buttare per creare una linea scalabile di corda"; + case 986: + return "Permette la raccolta di semi per munizioni"; + case 987: + return "Consente al titolare di doppio salto"; + case 989: + return "Spara un fascio di spada incantata"; + case 990: + return "'Da non confondere con un hamdrill'"; + case 994: + return "Evoca un Mangiamorte Baby of Souls"; + case 995: + return "Usato per mestiere oggetti"; + case 996: + return "Usato per mestiere oggetti"; + case 997: + return "Attiva limo e fango in qualcosa di più utile"; + case 998: + return "Usato per mestiere oggetti"; + case 1000: + return "Spara coriandoli ovunque!"; + case 1001: + return "16% incrementato il danno melee"; + case 1002: + return "16% incrementato il danno a distanza"; + case 1003: + return "Aumenta mana massimo da 80 e riduce l'uso di mana del 17%"; + case 1004: + return "5% incrementato il danno"; + case 1005: + return "8% maggiore possibilità di critico"; + case 1006: + return "Reagisce alla luce"; + default: + switch (l) + { + case 1071: + return "Usato con vernice a blocchi di colore"; + case 1072: + return "Usato con la vernice per pareti di colore"; + default: + switch (l) + { + case 1100: + return "Usato per rimuovere la vernice"; + case 1107: + return "Usato per fare colorante verde acqua"; + case 1108: + return "Usato per fare colorante verde"; + case 1109: + return "Usato per fare cielo blu colorante"; + case 1110: + return "Usato per fare colorante giallo"; + case 1111: + return "Usato per fare colorante blu"; + case 1112: + return "Usato per fare tintura calce"; + case 1113: + return "Usato per fare colorante rosa"; + case 1114: + return "Usato per fare arancio colorante"; + case 1115: + return "Usato per fare colorante rosso"; + case 1116: + return "Usato per fare colorante ciano"; + case 1117: + return "Usato per fare viola colorante"; + case 1118: + return "Usato per fare porpora"; + case 1119: + return "Usato per fare tintura nera"; + case 1120: + return "Usato per mestiere coloranti"; + case 1121: + return "Shoots api che inseguirà il nemico"; + case 1122: + return "Insegue il tuo nemico"; + case 1123: + return "Convoca le api assassine dopo aver colpito il nemico"; + case 1129: + return "luoghi orticaria"; + case 1130: + return "Esplode in uno sciame di api"; + case 1131: + return "Consente al titolare di invertire la gravità"; + case 1132: + return "Rilascia le api se danneggiato"; + case 1133: + return "Evoca la Queen Bee"; + case 1141: + return "Apre la porta del tempio giungla"; + case 1145: + return "Usato per la lavorazione di base"; + case 1151: + return "Attiva quando un giocatore passi su di essa su"; + case 1156: + return "Chiusure a nemici per danni continua"; + case 1157: + return "Evoca un pigmeo a combattere per voi"; + case 1158: + return "Aumenta il numero massimo di servitori"; + case 1159: + return "Aumenta il numero massimo di servitori"; + case 1160: + return "Aumenta il numero massimo di servitori"; + case 1161: + return "Aumenta il numero massimo di servitori"; + case 1162: + return "Permette di volo e la caduta lenta"; + case 1163: + return "Consente al titolare di doppio salto"; + case 1164: + return "Consente al titolare di salto quadruplo"; + case 1165: + return "Permette di volo e la caduta lenta"; + case 1167: + return "Aumenta il danno dei tuoi servitori dal 15"; + case 1169: + return "Evoca un bambino Skeletron Testa"; + case 1170: + return "Evoca un bambino Hornet"; + case 1171: + return "Evoca un Spirito Tiki"; + case 1172: + return "Evoca una lucertola"; + case 1178: + return "Spara rapidamente foglie affilatissime"; + case 1179: + return "Insegue il tuo nemico"; + case 1180: + return "Evoca un pappagallo domestico"; + case 1181: + return "Evoca un bambino Tartufo"; + case 1182: + return "Evoca un Pet Alberello"; + case 1183: + return "Evoca un Wisp per fornire luce"; + case 1188: + return "Possono miniera Mythril, oricalco, Adamantite e titanio"; + case 1189: + return "Possono miniera Mythril, oricalco, Adamantite e titanio"; + case 1195: + return "Possono miniera Adamantite e Titanio"; + case 1196: + return "Possono miniera Adamantite e Titanio"; + case 1205: + return "8% incrementato il danno melee"; + case 1206: + return "9% incrementato il danno a distanza"; + case 1207: + return "7% maggiore danno magico e possibilità di critico"; + case 1208: + return "3% incrementato il danno"; + case 1209: + return "2% incrementato il danno"; + case 1210: + return "7% incrementato il danno melee"; + case 1211: + return "15% maggiore distanza possibilità di critico"; + case 1212: + return "18% aumento magico possibilità di critico"; + case 1213: + return "6% maggiore possibilità di critico"; + case 1214: + return "11% maggiore velocità di movimento"; + case 1215: + return "8% incrementato il danno melee e possibilità di critico"; + case 1216: + return "16% incrementato il danno a distanza"; + case 1217: + return "16% maggiore danno magico e il 7% è aumentato magico possibilità di critico"; + case 1218: + return "4% in più di danni"; + case 1219: + return "3% ha aumentato i danni e possibilità di critico"; + case 1220: + return "Usato per creare oggetti da mithril, oricalco, Adamantite, e barre di titanio"; + case 1221: + return "Usato per Adamantite odore e il minerale di titanio"; + case 1226: + return "Spara un potente globo"; + case 1227: + return "Spara una nuvola di spore"; + case 1228: + return "Spara una nuvola di spore"; + case 1235: + return "Rimbalza indietro dopo aver colpito un muro"; + case 1242: + return "Evoca un dinosauro del bambino"; + case 1244: + return "Evoca una nube a piovere sui vostri nemici"; + case 1247: + return "Provoca stelle a cadere e rilascia le api quando feriti"; + case 1248: + return "Il 10% ha aumentato la possibilità di critico feriti"; + case 1249: + return "Aumenta salto altezza"; + case 1250: + return "Consente al titolare di doppio salto"; + case 1251: + return "Consente al titolare di doppio salto"; + case 1252: + return "Consente al titolare di doppio salto"; + case 1253: + return "Mette un guscio attorno al proprietario quando la vita sotto il 25%, che riduce i danni"; + case 1254: + return "Spara un potente, ad alta velocità di proiettile"; + case 1255: + return "Spara un potente, ad alta velocità di proiettile"; + case 1256: + return "Evoca una nube a piovere sangue sui tuoi nemici"; + case 1258: + return "Spara un bullone esplosivo"; + case 1259: + return "Shoots nitidissime petali di fiori presso i nemici nelle vicinanze"; + case 1260: + return "Spara un arcobaleno che fa danni continua"; + case 1261: + return "Esplode in frammenti di proiettile mortale"; + case 1264: + return "Spara una palla di gelo"; + case 1265: + return "Spara un potente, ad alta velocità di proiettile"; + case 1282: + return "Aumenta mana massimo del 20"; + case 1283: + return "Aumenta mana massimo del 40"; + case 1284: + return "Aumenta mana massimo del 40"; + case 1285: + return "Aumenta mana massimo del 60"; + case 1286: + return "Aumenta mana massimo del 60"; + case 1287: + return "Aumenta mana massimo del 80"; + case 1290: + return "Aumenta la velocità di movimento dopo essere stato colpito"; + case 1291: + return "Permanente aumenta la durata massima di 5"; + case 1293: + return "Usato all'Altare Lihzahrd"; + case 1294: + return "Capace di estrazione Lihzahrd mattoni"; + case 1295: + return "Spara un raggio penetrante di calore"; + case 1296: + return "Evoca un potente masso"; + case 1297: + return "Pugni con la forza di un golem"; + case 1299: + return "Aumenta Visualizza linea quando si svolgono"; + case 1300: + return "Aumenta la visualizzazione della gamma di pistole"; + case 1301: + return "10% in più di danno"; + case 1303: + return "Fornisce luce sotto l'acqua"; + case 1306: + return "Spara una falce di ghiaccio"; + case 1307: + return "'Lei è una persona terribile'"; + case 1308: + return "Spara un veleno zanna che trafigge più nemici"; + case 1309: + return "Evoca un bambino melma per combattere per voi"; + case 1310: + return "Infligge veleno sui nemici"; + case 1311: + return "Evoca una primavera bulbo oculare"; + case 1312: + return "Evoca un bambino pupazzo di neve"; + case 1313: + return "Spara un teschio"; + case 1314: + return "Spara un guantone da boxe"; + case 1315: + return "Evoca un invasione dei pirati"; + case 1316: + return "6% aumento danni da mischia"; + case 1317: + return "8% ha aumentato i danni melee e possibilità di critico"; + case 1318: + return "4% in più di possibilità di critico melee"; + case 1321: + return "Aumentare la velocità della freccia e il danno del 10%"; + case 1322: + return "Infligge danni da fuoco in attacco"; + case 1323: + return "Riduce i danni da toccare lavica"; + case 1326: + return "Teleports alla posizione del mouse"; + case 1327: + return "Spara una falce mortale"; + case 1331: + return "Evoca il cervello di Cthulhu"; + case 1332: + return "'Il sangue degli dei'"; + case 1333: + return "Può essere posizionato in acqua"; + case 1334: + return "Diminuisce la Difesa del bersaglio"; + case 1335: + return "Diminuisce la Difesa del bersaglio"; + case 1336: + return "Spray una pioggia di ichor"; + case 1343: + return "Aumenta mischia contraccolpo e infligge danni da fuoco in attacco"; + } + break; + } + break; + } + } + else + { + switch (l) + { + case 1430: + return "Destinati alla costruzione di armi fiaschi imbuement"; + case 1431: + break; + case 1432: + return "Destinati alla costruzione di vari tipi di munizioni"; + default: + switch (l) + { + case 1444: + return "Crea un fascio di ombra che rimbalza muri"; + case 1445: + return "Lancia una palla di fuoco che esplode in un calore infernale"; + case 1446: + return "Evoca un anima persa per inseguire i nemici"; + case 1447: + case 1448: + break; + case 1449: + return "soffia bolle"; + case 1450: + return "soffia bolle"; + default: + switch (l) + { + case 1503: + return "Aumenta mana massimo da 80 e riduce l'uso di mana del 17%"; + case 1504: + return "7% maggiore danno magico e la possibilità di critico"; + case 1505: + return "8% in più di danno magico"; + case 1513: + return "Un potente martello di ritorno"; + case 1515: + return "Permette di volo e la caduta lenta"; + case 1522: + return "Per catturare la gemma. Che rilascia quando si muore"; + case 1523: + return "Per catturare la gemma. Che rilascia quando si muore"; + case 1524: + return "Per catturare la gemma. Che rilascia quando si muore"; + case 1525: + return "Per catturare la gemma. Che rilascia quando si muore"; + case 1526: + return "Per catturare la gemma. Che rilascia quando si muore"; + case 1527: + return "Per catturare la gemma. Che rilascia quando si muore"; + case 1533: + return "Sblocca una giungla Busto nel dungeon"; + case 1534: + return "Sblocca un Petto corruzione nel dungeon"; + case 1535: + return "Sblocca un Petto Crimson nel dungeon"; + case 1536: + return "Sblocca un Petto santificato nel dungeon"; + case 1537: + return "Sblocca un Petto congelato nel dungeon"; + case 1543: + return "Usato con vernice a blocchi di colore"; + case 1544: + return "Usato con la vernice per pareti di colore"; + case 1545: + return "Usato per rimuovere la vernice"; + case 1546: + return "15% in più di danno freccia"; + case 1547: + return "15% in più di danno proiettile"; + case 1548: + return "15% in più di danno razzo"; + case 1549: + return "Il 13% ha aumentato spaziato possibilità di critico"; + case 1550: + return "Il 13% ha aumentato spaziato possibilità di critico"; + case 1551: + return "Converte Bar Chlorophyte in bar Shroomite"; + case 1553: + return "50% di possibilità di non consumare munizioni"; + case 1554: + return "Non si dovrebbe avere questo"; + case 1555: + return "Non si dovrebbe avere questo"; + case 1556: + return "Non si dovrebbe avere questo"; + case 1557: + return "Non si dovrebbe avere questo"; + case 1558: + return "Non si dovrebbe avere questo"; + case 1559: + return "Non si dovrebbe avere questo"; + case 1560: + return "Non si dovrebbe avere questo"; + case 1561: + return "Non si dovrebbe avere questo"; + case 1562: + return "Non si dovrebbe avere questo"; + case 1563: + return "Non si dovrebbe avere questo"; + case 1564: + return "Non si dovrebbe avere questo"; + case 1565: + return "Non si dovrebbe avere questo"; + case 1566: + return "Non si dovrebbe avere questo"; + case 1567: + return "Non si dovrebbe avere questo"; + case 1568: + return "Non si dovrebbe avere questo"; + case 1569: + return "Rapidamente gettare vita pugnali rubare"; + case 1571: + return "Un potente Javalin che scatena piccolo mangiatori"; + case 1572: + return "Evoca un potente gelo idra a sputare ghiaccio ai nemici"; + case 1578: + return "Stampa le api e la velocità aumenta il movimento, se danneggiato"; + case 1579: + return "Chi lo indossa può correre super veloce"; + case 1580: + return "Non si dovrebbe avere questo"; + case 1581: + return "Non si dovrebbe avere questo"; + case 1582: + return "Non si dovrebbe avere questo"; + case 1583: + return "Non si dovrebbe avere questo"; + case 1584: + return "Non si dovrebbe avere questo"; + case 1585: + return "Non si dovrebbe avere questo"; + case 1586: + return "Non si dovrebbe avere questo"; + case 1587: + return "Non si dovrebbe avere questo"; + case 1588: + return "Non si dovrebbe avere questo"; + case 1595: + return "Aumenta mana massimo del 20"; + } + break; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 4) + { + if (l <= 332) + { + if (l <= 128) + { + if (l <= 36) + { + if (l <= 8) + { + if (l == -1) + { + return "Permet d'extraire la météorite"; + } + if (l == 8) + { + return "Procure de la lumière"; + } + } + else + { + switch (l) + { + case 15: + return "Donne l'heure"; + case 16: + return "Donne l'heure"; + case 17: + return "Donne l'heure"; + case 18: + return "Mesure l'altitude"; + case 19: + case 20: + case 21: + case 22: + break; + case 23: + return "'À la fois savoureux et inflammable'"; + default: + if (l == 29) + { + return "Augmente le maximum de vie de 20 de façon permanente"; + } + switch (l) + { + case 33: + return "Utilisé pour fondre le minerai"; + case 35: + return "Permet de forger des objets à partir de métal"; + case 36: + return "Utilisé pour l'artisanat de base"; + } + break; + } + } + } + else + { + if (l <= 75) + { + if (l == 43) + { + return "Invoque l'œil de Cthulhu"; + } + switch (l) + { + case 49: + return "Régénère lentement la vie"; + case 50: + return "Fixer le miroir pour regagner son foyer"; + case 51: + case 52: + case 55: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 69: + break; + case 53: + return "Permet de faire un double saut"; + case 54: + return "Le porteur peur courir super vite"; + case 56: + return "'Vibre d'une énergie sombre'"; + case 57: + return "'Vibre d'une énergie sombre'"; + case 64: + return "Invoque une vileronce"; + case 65: + return "Provoque une pluie d'étoiles"; + case 66: + return "Purifie la corruption"; + case 67: + return "Corrompt la sainteté"; + case 68: + return "'Ça a l'air bon !'"; + case 70: + return "Invoque le dévoreur de mondes"; + default: + if (l == 75) + { + return "Disparaît au coucher du soleil"; + } + break; + } + } + else + { + if (l == 84) + { + return "'Pour grimper tout là-haut'"; + } + if (l == 88) + { + return "Procure de la lumière lorsqu'il est porté"; + } + switch (l) + { + case 98: + return "33 % de chance de n'utiliser aucune munition"; + case 100: + return "Vitesse de mêlée augmentée de 7 %"; + case 101: + return "Vitesse de mêlée augmentée de 7 %"; + case 102: + return "Vitesse de mêlée augmentée de 7 %"; + case 103: + return "Permet d'extraire de la pierre de l'enfer"; + case 109: + return "Augmente le maximum de mana de 20 de façon permanente"; + case 111: + return "Augmente le maximum de mana de 20"; + case 112: + return "Lance des boules de feu"; + case 113: + return "Lance un missile contrôlable"; + case 114: + return "Déplace la terre par magie"; + case 115: + return "Crée un orbe magique de lumière"; + case 117: + return "'Chaude au toucher'"; + case 118: + return "Trouvé parfois sur les squelettes et les piranhas"; + case 120: + return "Transforme les flèches en bois tirées en flèches enflammées"; + case 121: + return "'Elle pète le feu !'"; + case 123: + return "Dégâts magiques accrus de 5 %"; + case 124: + return "Dégâts magiques accrus de 5 %"; + case 125: + return "Dégâts magiques accrus de 5 %"; + case 128: + return "Permet de voler"; + } + } + } + } + else + { + if (l <= 218) + { + if (l <= 187) + { + switch (l) + { + case 148: + return "Cet objet peut attirer une attention non désirée"; + case 149: + return "'Il contient d'étranges symboles'"; + case 150: + case 154: + case 155: + case 160: + case 161: + case 162: + case 163: + case 164: + break; + case 151: + return "Dégâts à distance augmentés de 4 %"; + case 152: + return "Dégâts à distance augmentés de 4 %"; + case 153: + return "Dégâts à distance augmentés de 4 %"; + case 156: + return "Annule tout effet de recul"; + case 157: + return "Lance de l'eau en continu"; + case 158: + return "Annule les dégâts de chute"; + case 159: + return "Augmente la hauteur des sauts"; + case 165: + return "Invoque une boule d'eau se déplaçant lentement"; + case 166: + return "Une petite explosion détruisant quelques blocs"; + case 167: + return "Une grosse explosion détruisant la plupart des blocs"; + case 168: + return "Une petite explosion ne détruisant pas de blocs"; + default: + if (l == 175) + { + return "'Chaud au toucher'"; + } + switch (l) + { + case 186: + return "'Ne pas se noyer, c'est quand même cool !'"; + case 187: + return "Permet de nager"; + } + break; + } + } + else + { + if (l == 193) + { + return "Permet de résister aux blocs de feu"; + } + if (l == 197) + { + return "Tire des étoiles filantes"; + } + switch (l) + { + case 208: + return "'Comme c'est joli !'"; + case 211: + return "La vitesse de mêlée est augmentée de 12 %"; + case 212: + return "La vitesse de déplacement est augmentée de 10 %"; + case 213: + return "Fait pousser de l'herbe sur la terre"; + case 215: + return "'Peut être incommodant'"; + case 218: + return "Invoque une boule de feu contrôlable"; + } + } + } + else + { + if (l <= 305) + { + switch (l) + { + case 222: + return "Fait pousser les plantes"; + case 223: + return "Réduit le coût de mana de 6 %"; + case 224: + case 225: + case 226: + case 227: + break; + case 228: + return "Augmente le maximum de mana de 20"; + case 229: + return "Augmente le maximum de mana de 20"; + case 230: + return "Augmente le maximum de mana de 20"; + default: + switch (l) + { + case 235: + return "'Peut s'avérer difficile à lancer'"; + case 236: + break; + case 237: + return "'Pour un look de star !'"; + case 238: + return "Augmente les dégâts magiques de 15 %"; + default: + switch (l) + { + case 261: + return "'Il sourit, ça ferait un casse-croûte sympa.'"; + case 266: + return "'Super idée !'"; + case 267: + return "'Vous êtes vraiment terrible.'"; + case 268: + return "Améliore grandement la respiration sous l'eau"; + case 272: + return "Lance une faux de démon"; + case 281: + return "Permet de récupérer des graines comme munitions"; + case 282: + return "Fonctionne même humide"; + case 283: + return "Utilisable avec la sarbacane"; + case 285: + return "La vitesse de déplacement est augmentée de 5 %"; + case 288: + return "Procure l'immunité à la lave"; + case 289: + return "Régénère la vie"; + case 290: + return "Augmente la vitesse de déplacement de 25 %"; + case 291: + return "Permet de respirer sous l'eau comme dans l'air"; + case 292: + return "Augmente la défense de 8"; + case 293: + return "Augmente la régénération de mana"; + case 294: + return "Augmente les dégâts de magie de 20 %"; + case 295: + return "Réduit la vitesse de chute"; + case 296: + return "Indique l'emplacement des trésors et du minerai"; + case 297: + return "Procure l'invisibilité"; + case 298: + return "Émet une aura de lumière"; + case 299: + return "Augmente la vision nocturne"; + case 300: + return "Augmente la fréquence d'apparition des ennemis"; + case 301: + return "Les attaquants subissent aussi des dégâts"; + case 302: + return "Permet de marcher sur l'eau"; + case 303: + return "La vitesse des flèches et leurs dégâts sont augmentés de 20 %"; + case 304: + return "Indique l'emplacement des ennemis"; + case 305: + return "Permet de contrôler la gravité"; + } + break; + } + break; + } + } + else + { + if (l == 324) + { + return "'Interdit quasiment partout'"; + } + switch (l) + { + case 327: + return "Ouvre un coffre d'or"; + case 328: + break; + case 329: + return "Ouvre tous les coffres sombres"; + default: + if (l == 332) + { + return "Utilisé pour la fabrication de vêtements"; + } + break; + } + } + } + } + } + else + { + if (l <= 726) + { + if (l <= 603) + { + if (l <= 407) + { + if (l == 352) + { + return "Utilisé pour brasser la bière."; + } + switch (l) + { + case 357: + return "Amélioration mineure de toutes les stats."; + case 361: + return "Invoque une armée de gobelins"; + case 363: + return "Permet un travail avancé du bois"; + case 367: + return "Suffisamment puissant pour détruire les autels démoniaques"; + case 371: + return "Augmente le maximum de mana de 40"; + case 372: + return "La vitesse de déplacement est augmentée de 7 %"; + case 373: + return "Les dégâts à distance sont augmentés de 10 %"; + case 376: + return "Augmente le maximum de mana de 60"; + case 377: + return "Les chances de coup critique de mêler sont augmentées de 5 %"; + case 378: + return "Les dégâts à distance sont augmentés de 12 %"; + case 385: + return "Permet d'extraire du mythril"; + case 386: + return "Permet d'extraire de l'adamantine"; + case 389: + return "Peut étourdir les ennemis"; + case 393: + return "Indique la position horizontale"; + case 394: + return "Permet de nager"; + case 395: + return "Indique la position"; + case 396: + return "Annule les dégâts de chute"; + case 397: + return "Annule tout effet de recul"; + case 398: + return "Permet de combiner certains accessoires"; + case 399: + return "Permet de faire un double saut"; + case 400: + return "Augmente le maximum de mana de 80"; + case 401: + return "Les chances de coup critique de mêlée sont augmentées de 7 %"; + case 402: + return "Les dégâts à distance sont augmentés de 14 %"; + case 403: + return "Les dégâts sont augmentés de 6 %"; + case 404: + return "Les chances de coup critique sont augmentées de 4 %"; + case 405: + return "Permet de voler"; + case 407: + return "Permet de construire un bloc plus loin"; + } + } + else + { + switch (l) + { + case 422: + return "Purifie certains blocs"; + case 423: + return "Corrompt certains blocs"; + case 424: + break; + case 425: + return "Invoque une fée magique"; + default: + if (l == 434) + { + return "Tire des rafales de trois coups"; + } + switch (l) + { + case 485: + return "Transforme le porteur en loup-garou à la pleine lune"; + case 486: + return "Crée une grille à l'écran pour le placement des blocs"; + case 489: + return "Augmente les dégâts magiques de 15 %"; + case 490: + return "Augmente les dégâts de mêlée de 15 %"; + case 491: + return "Dégâts à distance augmentés de 15 %"; + case 492: + return "Permet de voler et de ralentir la chute"; + case 493: + return "Permet de voler et de ralentir la chute"; + case 495: + return "Lance un arc-en-ciel contrôlable"; + case 496: + return "Invoque un bloc de glace"; + case 497: + return "Transforme le porteur en sirène lorsqu'il entre dans l'eau"; + case 506: + return "Utilise du gel comme carburant"; + case 509: + return "Joint les câbles"; + case 510: + return "Coupe les câbles"; + case 515: + return "Crée plusieurs éclats de cristal à l'impact"; + case 516: + return "Invoque des étoiles déchues à l'impact"; + case 517: + return "Une dague qui revient magiquement à son possesseur"; + case 518: + return "Invoque des éclats rapides de cristal de feu"; + case 519: + return "Invoque des boules de feu maudites"; + case 520: + return "'L'essence des créatures de lumière'"; + case 521: + return "'L'essence des créatures sombres'"; + case 522: + return "'Même l'eau ne peut l'éteindre'"; + case 523: + return "Peut être placée dans l'eau"; + case 524: + return "Utilisée pour fondre le minerai d'adamantine"; + case 525: + return "Utilisée pour forger des objets avec du mythril et de l'adamantite"; + case 526: + return "'Magique et coupante'"; + case 527: + return "'Porté parfois par les créatures dans le désert corrompu'"; + case 528: + return "'Porté parfois par les créatures dans le désert de lumière'"; + case 529: + return "S'active en marchant dessus"; + case 531: + return "Peut être enchanté"; + case 532: + return "Des étoiles tombent lorsque le porteur est blessé"; + case 533: + return "50 % de chance de n'utiliser aucune munition"; + case 534: + return "Disperse une salve de balles"; + case 535: + return "Réduit le temps d'utilisation entre les potions de soin"; + case 536: + return "Accroît le recul en mêlée"; + case 541: + return "S'active en marchant dessus"; + case 542: + return "S'active en marchant dessus"; + case 543: + return "S'active en marchant dessus"; + case 544: + return "Invoque les jumeaux"; + case 547: + return "'L'essence de la terreur pure'"; + case 548: + return "'L'essence du destructeur'"; + case 549: + return "'L'essence des observateurs omniscients'"; + case 551: + return "Augmente les chances de coup critique de 7 %"; + case 552: + return "Dégâts augmentés de 7 %"; + case 553: + return "Dégâts à distance augmentés de 15 %"; + case 554: + return "Augmente la durée d'invincibilité après avoir subi des dégâts"; + case 555: + return "Utilisation de mana réduite de 8 %"; + case 556: + return "Invoque l'destructeur"; + case 557: + return "Invoque le squeletron primaire"; + case 558: + return "Augmente le maximum de mana de 100"; + case 559: + return "Les chances de coup critique et les dégâts de mêlée sont augmentés de 10 %"; + case 560: + return "Invoque le roi slime"; + case 561: + return "Possibilité d'en lancer jusqu'à 5"; + case 575: + return "'L'essence des puissantes créatures volantes'"; + case 576: + return "A une chance d'enregistrer un morceau"; + case 579: + return "'À ne pas confondre avec le marteau-scie'"; + case 580: + return "Explosent lorsqu'ils sont activés"; + case 581: + return "Envoie de l'eau aux sorties de pompage"; + case 582: + return "Reçoit de l'eau des postes de pompage"; + case 583: + return "S'active chaque seconde"; + case 584: + return "S'active toutes les 3 secondes"; + case 585: + return "S'active toutes les 5 secondes"; + case 599: + return "Faites un clic droit pour ouvrir"; + case 600: + return "Faites un clic droit pour ouvrir"; + case 601: + return "Faites un clic droit pour ouvrir"; + case 602: + return "Invoque la Légion gel"; + case 603: + return "Convocation d'un lapin de compagnie"; + } + break; + } + } + } + else + { + if (l <= 686) + { + switch (l) + { + case 665: + return "Vous ne devriez pas avoir cette"; + case 666: + return "Vous ne devriez pas avoir cette"; + case 667: + return "Vous ne devriez pas avoir cette"; + case 668: + return "Vous ne devriez pas avoir cette"; + case 669: + return "Invoque un bébé pingouin"; + default: + if (l == 676) + { + return "Tire sur un boulon de glace"; + } + switch (l) + { + case 683: + return "Invoque trident du diable"; + case 684: + return "16% ont augmenté mêlée et à distance des dégâts"; + case 685: + return "11% ont augmenté mêlée et à distance chances de coup critique"; + case 686: + return "8% a augmenté la vitesse de déplacement"; + } + break; + } + } + else + { + switch (l) + { + case 707: + return "Indique le temps"; + case 708: + return "Indique le temps"; + case 709: + return "Indique le temps"; + default: + if (l == 716) + { + return "Utilisé pour des objets d'artisanat à partir de barres de métal"; + } + switch (l) + { + case 723: + return "Tire un faisceau de lumière"; + case 724: + return "Tire sur un boulon de glace"; + case 725: + return "Lance gel flèches"; + case 726: + return "De prendre un flux de gel"; + } + break; + } + } + } + } + else + { + if (l <= 832) + { + if (l <= 761) + { + switch (l) + { + case 748: + return "Permet de vol et de chute lente"; + case 749: + return "Permet de vol et de chute lente"; + default: + if (l == 753) + { + return "Summons a pet turtle"; + } + if (l == 761) + { + return "Permet de vol et de chute lente"; + } + break; + } + } + else + { + switch (l) + { + case 779: + return "Crée et détruit biomes lors de la pulvérisation"; + case 780: + return "Utilisé par le Clentaminator"; + case 781: + return "Utilisé par le Clentaminator"; + case 782: + return "Utilisé par le Clentaminator"; + case 783: + return "Utilisé par le Clentaminator"; + case 784: + return "Utilisé par le Clentaminator"; + case 785: + return "Permet de vol et de chute lente"; + case 786: + return "Permet de vol et de chute lente"; + case 787: + return "Assez fort pour détruire les autels de démon"; + case 788: + return "Invoque une lance d'épines"; + case 789: + case 790: + case 791: + case 795: + case 796: + case 797: + break; + case 792: + return "2% de dégâts"; + case 793: + return "2% de dégâts"; + case 794: + return "2% de dégâts"; + case 798: + return "Capable d'exploiter Hellstone"; + default: + switch (l) + { + case 821: + return "Permet de vol et de chute lente"; + case 822: + return "Permet de vol et de chute lente"; + case 823: + return "Permet de vol et de chute lente"; + default: + if (l == 832) + { + return "Places bois vivant"; + } + break; + } + break; + } + } + } + else + { + if (l <= 1343) + { + switch (l) + { + case 849: + return "Permet blocs solides pour être activée ou désactivée"; + case 850: + return "Places fil bleu"; + case 851: + return "Places fil vert"; + case 852: + return "Active quand un joueur marche sur-le"; + case 853: + return "Active quand quelque chose mais un joueur marche dessus sur"; + case 854: + return "Magasins ont des prix plus bas"; + case 855: + return "Ennemis frappeurs parfois tomber des pièces supplémentaires"; + case 856: + return "'Avoir un temps merveilleux!'"; + case 857: + return "Permet à son détenteur de faire un meilleur saut double"; + case 858: + case 859: + case 864: + case 865: + case 866: + case 867: + case 868: + case 869: + case 870: + case 871: + case 872: + case 873: + case 874: + case 875: + case 876: + case 877: + case 878: + case 879: + case 880: + case 881: + case 882: + case 883: + case 884: + case 894: + case 895: + case 896: + case 909: + case 910: + case 911: + case 912: + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 939: + case 940: + case 941: + case 942: + case 943: + case 944: + case 945: + case 949: + case 952: + case 954: + case 955: + case 970: + case 971: + case 972: + case 973: + case 974: + case 978: + case 979: + case 980: + case 981: + case 988: + case 991: + case 992: + case 993: + case 999: + break; + case 860: + return "Fournit la régénération de vie et réduit le temps de recharge de potions de guérison"; + case 861: + return "Active le support en loup-garou la nuit et un merfolk lors de l'entrée d'eau"; + case 862: + return "Provoque étoiles à tomber et augmente la longueur d'invincibilité après prendre des dommages"; + case 863: + return "Offre la possibilité de marcher sur l'eau"; + case 885: + return "immunité aux saignements"; + case 886: + return "immunité à l'armure brisée"; + case 887: + return "immunité au poison"; + case 888: + return "immunité à l'obscurité"; + case 889: + return "immunité à ralentir"; + case 890: + return "immunité au silence"; + case 891: + return "l'immunité de maudire"; + case 892: + return "l'immunité à la faiblesse"; + case 893: + return "immunité à confusion"; + case 897: + return "Augmente repoussement de mêlée"; + case 898: + return "permet vol"; + case 899: + return "Augmente tous les stats si usé pendant le jour"; + case 900: + return "Augmente tous les stats si usé pendant la nuit"; + case 901: + return "Immunité de la faiblesse et de l'armure brisée"; + case 902: + return "Immunité au poison et des saignements"; + case 903: + return "Immunité à ralentir et confusion"; + case 904: + return "Immunité au silence et ne maudissez"; + case 905: + return "Utilise des pièces de munitions"; + case 906: + return "Fournit de 7 secondes d'immunité aux lave"; + case 907: + return "Offre la possibilité de marcher sur l'eau"; + case 908: + return "Offre la possibilité de marcher sur l'eau et la lave"; + case 932: + return "places os"; + case 933: + return "places laisse"; + case 934: + return "Permet au propriétaire de flotter pendant quelques secondes"; + case 935: + return "12% de dégâts"; + case 936: + return "Augmente repoussement de mêlée"; + case 937: + return "Explose quand on marche dessus"; + case 938: + return "Absorbe 25% des dégâts infligés aux joueurs de votre équipe"; + case 946: + return "Vous allez tomber lentement tout en maintenant cette"; + case 947: + return "Réagit à la lumière"; + case 948: + return "Permet de vol et de chute lente"; + case 950: + return "Fournit la mobilité supplémentaire sur la glace"; + case 951: + return "Lance rapidement des boules de neige"; + case 953: + return "Permet la possibilité de glisser le long des murs"; + case 956: + return "7% ont augmenté la vitesse de mêlée"; + case 957: + return "7% ont augmenté la vitesse de mêlée"; + case 958: + return "7% ont augmenté la vitesse de mêlée"; + case 959: + return "4% ont augmenté les dégâts à distance."; + case 960: + return "Augmente mana maximum de 20"; + case 961: + return "Augmente mana maximum de 20"; + case 962: + return "Augmente mana maximum de 20"; + case 963: + return "Donne une chance d'esquiver les attaques"; + case 964: + return "Lance une propagation de balles"; + case 965: + return "Peut être monté sur"; + case 966: + return "Régénération de vie est augmentée lorsque près d'un feu de camp"; + case 967: + return "Mettez-le sur un bâton et rôti au feu de bois"; + case 968: + return "Rôtir sur un feu de camp!"; + case 969: + return "Améliorations mineures apportées à toutes les carac"; + case 975: + return "Permet la possibilité de glisser le long des murs"; + case 976: + return "Permet la possibilité d'escalader les murs"; + case 977: + return "Permet la possibilité de se lancer"; + case 982: + return "Augmente mana maximum de 20"; + case 983: + return "Permet au titulaire de double saut"; + case 984: + return "Permet la possibilité de grimper aux murs et tableau de bord"; + case 985: + return "Jeter de créer une ligne de corde climbable"; + case 986: + return "Permet la collecte de semences pour munitions"; + case 987: + return "Permet au titulaire de double saut"; + case 989: + return "Tire un faisceau d'épée enchantée"; + case 990: + return "'A ne pas confondre avec un hamdrill'"; + case 994: + return "Invoque un mangeur de bébé des âmes"; + case 995: + return "Utilisé pour fabriquer des objets"; + case 996: + return "Utilisé pour fabriquer des objets"; + case 997: + return "Met limon et de boue en quelque chose de plus utile"; + case 998: + return "Utilisé pour fabriquer des objets"; + case 1000: + return "Lance confettis partout!"; + case 1001: + return "16% ont augmenté les dégâts de mêlée"; + case 1002: + return "16% ont augmenté les dégâts à distance"; + case 1003: + return "Augmente mana maximum de 80 et réduit la consommation de mana de 17%"; + case 1004: + return "5% de dégâts"; + case 1005: + return "8% ont augmenté les chances de coup critique"; + case 1006: + return "Réagit à la lumière"; + default: + switch (l) + { + case 1071: + return "Utilisé avec de la peinture à blocs de couleur"; + case 1072: + return "Utilisé avec de la peinture sur les murs de couleur"; + default: + switch (l) + { + case 1100: + return "Utilisé pour enlever la peinture"; + case 1107: + return "Utilisé pour faire colorant bleu sarcelle"; + case 1108: + return "Utilisé pour faire colorant vert"; + case 1109: + return "Utilisé pour faire colorant bleu ciel"; + case 1110: + return "Utilisé pour faire colorant jaune"; + case 1111: + return "Utilisé pour faire colorant bleu"; + case 1112: + return "Utilisé pour fabriquer des colorants chaux"; + case 1113: + return "Utilisé pour faire colorant rose"; + case 1114: + return "Utilisé pour faire colorant d'orange"; + case 1115: + return "Utilisé pour faire colorant rouge"; + case 1116: + return "Utilisé pour faire colorant cyan"; + case 1117: + return "Utilisé pour fabriquer la teinture violette"; + case 1118: + return "Utilisé pour faire colorant violet"; + case 1119: + return "Utilisé pour faire colorant noir"; + case 1120: + return "Utilisé pour fabriquer des colorants"; + case 1121: + return "Shoots abeilles qui vont chasser vos ennemis"; + case 1122: + return "Poursuites après votre ennemi"; + case 1123: + return "Invoque abeilles tueuses après avoir frappé votre ennemi"; + case 1129: + return "Places urticaire"; + case 1130: + return "Explose en un essaim d'abeilles"; + case 1131: + return "Permet à son titulaire d'inverser la gravité"; + case 1132: + return "Libère les abeilles lorsqu'elles sont endommagées"; + case 1133: + return "Invoque le Queen Bee"; + case 1141: + return "Ouvre la porte du temple de la jungle"; + case 1145: + return "Utilisé pour l'artisanat de base"; + case 1151: + return "Active quand un joueur marche sur-le"; + case 1156: + return "Loquets situés sur les ennemis pour les dommages continu"; + case 1157: + return "Invoque un pygmée à se battre pour vous"; + case 1158: + return "Augmente votre nombre maximum de sous-fifres"; + case 1159: + return "Augmente votre nombre maximum de sous-fifres"; + case 1160: + return "Augmente votre nombre maximum de sous-fifres"; + case 1161: + return "Augmente votre nombre maximum de sous-fifres"; + case 1162: + return "Permet de vol et de chute lente"; + case 1163: + return "Permet au titulaire de double saut"; + case 1164: + return "Permet au titulaire de quadruple saut"; + case 1165: + return "Permet de vol et de chute lente"; + case 1167: + return "Augmente les dégâts de vos sbires d'ici le 15"; + case 1169: + return "Invoque un bébé Skeletron tête"; + case 1170: + return "Invoque un Hornet bébé"; + case 1171: + return "Invoque un esprit de Tiki"; + case 1172: + return "Invoque un lézard de compagnie"; + case 1178: + return "Pousses rapidement feuilles acérées"; + case 1179: + return "Chases after your enemy"; + case 1180: + return "Invoque un perroquet"; + case 1181: + return "Invoque un Truffle bébé"; + case 1182: + return "Invoque un jeune arbre Pet"; + case 1183: + return "Invoque un Wisp pour fournir la lumière"; + case 1188: + return "Peut-mines de mithril, orichalque, adamantite et Titane"; + case 1189: + return "Peut-mines de mithril, orichalque, adamantite et Titane"; + case 1195: + return "Peut mien adamantite et Titane"; + case 1196: + return "Peut mien adamantite et Titane"; + case 1205: + return "8% ont augmenté les dégâts de mêlée"; + case 1206: + return "9% ont augmenté les dégâts à distance"; + case 1207: + return "7% d'augmentation des dégâts magiques et les chances de coup critique"; + case 1208: + return "3% de dégâts"; + case 1209: + return "2% de dégâts"; + case 1210: + return "7% ont augmenté les dégâts de mêlée"; + case 1211: + return "15% ont augmenté varié chances de coup critique"; + case 1212: + return "18% ont augmenté magie chances de coup critique"; + case 1213: + return "6% ont augmenté les chances de coup critique"; + case 1214: + return "11% augmente la vitesse de déplacement"; + case 1215: + return "8% de dégâts au corps à corps et les chances de coup critique"; + case 1216: + return "16% ont augmenté les dégâts à distance"; + case 1217: + return "16% d'augmentation des dégâts magiques et 7% ont augmenté magie chances de coup critique"; + case 1218: + return "4% de dégâts"; + case 1219: + return "3% de dégâts et les chances de coup critique"; + case 1220: + return "Utilisé pour fabriquer des objets à partir de mithril, orichalque, adamantite, et des barres de titane"; + case 1221: + return "Utilisé pour adamante éperlan et du minerai de titane"; + case 1226: + return "Tire un puissant orbe"; + case 1227: + return "Tire un nuage de spores"; + case 1228: + return "Tire un nuage de spores"; + case 1235: + return "Rebondit après avoir heurté un mur"; + case 1242: + return "Invoque un bébé dinosaure"; + case 1244: + return "Invoque un nuage à pleuvoir sur vos ennemis"; + case 1247: + return "Provoque étoiles à tomber et libère les abeilles quand blessés"; + case 1248: + return "10% ont augmenté les chances de coup critique"; + case 1249: + return "Augmente la hauteur de saut"; + case 1250: + return "Permet au titulaire de double saut"; + case 1251: + return "Permet au titulaire de double saut"; + case 1252: + return "Permet au titulaire de double saut"; + case 1253: + return "Met une coquille autour de la propriétaire quand la vie dessous de 25% qui réduit les dommages"; + case 1254: + return "Tire une puissante balle à grande vitesse"; + case 1255: + return "Tire une puissante balle à grande vitesse"; + case 1256: + return "Invoque un nuage à pleuvoir du sang sur vos ennemis"; + case 1258: + return "Tire un boulon explosif"; + case 1259: + return "Pousses rasoir tranchant pétales de fleurs sur les ennemis proches"; + case 1260: + return "Tire un arc en ciel qui fait des dégâts en continu"; + case 1261: + return "Explose en éclats mortels"; + case 1264: + return "Tire une boule de gel"; + case 1265: + return "Tire une puissante balle à grande vitesse"; + case 1282: + return "Augmente mana maximum de 20"; + case 1283: + return "Augmente mana maximum de 40"; + case 1284: + return "Augmente mana maximum de 40"; + case 1285: + return "Augmente mana maximum de 60"; + case 1286: + return "Augmente mana maximum de 60"; + case 1287: + return "Augmente mana maximum de 80"; + case 1290: + return "Augmente la vitesse de déplacement après avoir été frappé"; + case 1291: + return "Augmente en permanence durée de vie maximale de 5"; + case 1293: + return "Utilisé à l'autel Lihzahrd"; + case 1294: + return "Capable de mines Lihzahrd briques"; + case 1295: + return "Tire un rayon perçant de chaleur"; + case 1296: + return "Invoque un puissant rocher"; + case 1297: + return "Coups de poing avec la force d'un golem"; + case 1299: + return "Augmente visualiser gamme lorsqu'il est maintenu"; + case 1300: + return "Augmente Afficher la gamme des pistolets"; + case 1301: + return "10% de dégâts"; + case 1303: + return "Fournit de la lumière sous l'eau"; + case 1306: + return "Tire une faucille glacial"; + case 1307: + return "'Vous êtes une personne épouvantable'"; + case 1308: + return "Tire un poison croc qui perce plusieurs ennemis"; + case 1309: + return "Invoque un bébé bave à se battre pour vous"; + case 1310: + return "Inflige poison sur les ennemis"; + case 1311: + return "Invoque un ressort de globe oculaire"; + case 1312: + return "Invoque un bébé bonhomme de neige"; + case 1313: + return "Tire un crâne"; + case 1314: + return "Tire un gant de boxe"; + case 1315: + return "Invoque une invasion de pirates"; + case 1316: + return "6% ont augmenté les dégâts de mêlée"; + case 1317: + return "8% de dégâts au corps à corps et les chances de coup critique"; + case 1318: + return "4% ont augmenté mêlée chances de coup critique"; + case 1321: + return "Augmenter la vitesse de flèche et les dommages de 10%"; + case 1322: + return "Inflige des dégâts de feu sur l'attaque"; + case 1323: + return "Réduit les dégâts de toucher lave"; + case 1326: + return "Téléports à la position de la souris"; + case 1327: + return "Tire une faucille mort"; + case 1331: + return "Invoque le cerveau de Cthulhu"; + case 1332: + return "'Le sang des dieux'"; + case 1333: + return "Peut être placé dans l'eau"; + case 1334: + return "Diminue la défense de la cible"; + case 1335: + return "Diminue la défense de la cible"; + case 1336: + return "Sprays une pluie de ichor"; + case 1343: + return "Augmente la mêlée repoussement et inflige des dégâts de feu sur l'attaque"; + } + break; + } + break; + } + } + else + { + switch (l) + { + case 1430: + return "Utilisé pour fabriquer des flacons de imbuement d'armes"; + case 1431: + break; + case 1432: + return "Utilisé pour fabriquer différents types de munitions"; + default: + switch (l) + { + case 1444: + return "Crée un faisceau d'ombre qui rebondit sur les murs"; + case 1445: + return "Lance une boule de feu qui explose dans un brasier"; + case 1446: + return "Invoque une âme perdue pour chasser vos ennemis"; + case 1447: + case 1448: + break; + case 1449: + return "souffle des bulles"; + case 1450: + return "souffle des bulles"; + default: + switch (l) + { + case 1503: + return "Augmente mana maximum de 80 et réduit la consommation de mana de 17%"; + case 1504: + return "7% d'augmentation des dégâts magiques et les chances de coup critique"; + case 1505: + return "8% d'augmentation des dégâts magiques"; + case 1513: + return "Un marteau retour puissant"; + case 1515: + return "Permet de vol et de chute lente"; + case 1522: + return "Pour capturer le Gem. Il tombe quand vous mourrez"; + case 1523: + return "Pour capturer le Gem. Il tombe quand vous mourrez"; + case 1524: + return "Pour capturer le Gem. Il tombe quand vous mourrez"; + case 1525: + return "Pour capturer le Gem. Il tombe quand vous mourrez"; + case 1526: + return "Pour capturer le Gem. Il tombe quand vous mourrez"; + case 1527: + return "Pour capturer le Gem. Il tombe quand vous mourrez"; + case 1533: + return "Débloque une jungle poitrine dans le donjon"; + case 1534: + return "Débloque un coffre de la corruption dans le donjon"; + case 1535: + return "Débloque un coffre Crimson dans le donjon"; + case 1536: + return "Débloque un coffre sanctifié dans le donjon"; + case 1537: + return "Débloque un coffre congelés dans le donjon"; + case 1543: + return "Utilisé avec de la peinture à blocs de couleur"; + case 1544: + return "Utilisé avec de la peinture sur les murs de couleur"; + case 1545: + return "Utilisé pour enlever la peinture"; + case 1546: + return "15% de dégâts supplémentaires flèche"; + case 1547: + return "15% de dégâts supplémentaires infligés par balle"; + case 1548: + return "15% de dégâts supplémentaires fusée"; + case 1549: + return "13% ont augmenté varié chances de coup critique"; + case 1550: + return "7% ont augmenté varié chances de coup critique"; + case 1551: + return "Convertit Bars Bars chlorophyte en Shroomite"; + case 1553: + return "50% de chances de ne pas consommer de munitions"; + case 1554: + return "Vous ne devriez pas avoir cette"; + case 1555: + return "Vous ne devriez pas avoir cette"; + case 1556: + return "Vous ne devriez pas avoir cette"; + case 1557: + return "Vous ne devriez pas avoir cette"; + case 1558: + return "Vous ne devriez pas avoir cette"; + case 1559: + return "Vous ne devriez pas avoir cette"; + case 1560: + return "Vous ne devriez pas avoir cette"; + case 1561: + return "Vous ne devriez pas avoir cette"; + case 1562: + return "Vous ne devriez pas avoir cette"; + case 1563: + return "Vous ne devriez pas avoir cette"; + case 1564: + return "Vous ne devriez pas avoir cette"; + case 1565: + return "Vous ne devriez pas avoir cette"; + case 1566: + return "Vous ne devriez pas avoir cette"; + case 1567: + return "Vous ne devriez pas avoir cette"; + case 1568: + return "Vous ne devriez pas avoir cette"; + case 1569: + return "Rapidement jeter des poignards qui volent de la vie"; + case 1571: + return "A javalin puissant qui libère petit mangeurs"; + case 1572: + return "Invoque un puissant gel hydre à cracher de la glace sur vos ennemis"; + case 1578: + return "Communiqués abeilles et augmente la vitesse de déplacement lorsqu'il a été endommagé"; + case 1579: + return "Le porteur peut fonctionner super rapide"; + case 1580: + return "Vous ne devriez pas avoir cette"; + case 1581: + return "Vous ne devriez pas avoir cette"; + case 1582: + return "Vous ne devriez pas avoir cette"; + case 1583: + return "Vous ne devriez pas avoir cette"; + case 1584: + return "Vous ne devriez pas avoir cette"; + case 1585: + return "Vous ne devriez pas avoir cette"; + case 1586: + return "Vous ne devriez pas avoir cette"; + case 1587: + return "Vous ne devriez pas avoir cette"; + case 1588: + return "Vous ne devriez pas avoir cette"; + case 1595: + return "Augmente mana maximum de 20"; + } + break; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 5) + { + if (l <= 332) + { + if (l <= 128) + { + if (l <= 36) + { + if (l <= 8) + { + if (l == -1) + { + return "Puede abrir meteoritos"; + } + if (l == 8) + { + return "Da luz"; + } + } + else + { + switch (l) + { + case 15: + return "Da la hora"; + case 16: + return "Da la hora"; + case 17: + return "Da la hora"; + case 18: + return "indica la profundidad"; + case 19: + case 20: + case 21: + case 22: + break; + case 23: + return "'Repugnante a la vez que inflamable'"; + default: + if (l == 29) + { + return "Aumenta al máximo la vida (20) de forma definitiva"; + } + switch (l) + { + case 33: + return "Se usa para fundir mineral"; + case 35: + return "Se usa para fabricar objetos con lingotes de metal"; + case 36: + return "Se usa para creaciones básicas"; + } + break; + } + } + } + else + { + if (l <= 75) + { + if (l == 43) + { + return "Invoca al Ojo de Cthulhu"; + } + switch (l) + { + case 49: + return "Regenera la vida poco a poco"; + case 50: + return "Al mirarse en él se regresa al hogar"; + case 51: + case 52: + case 55: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 69: + break; + case 53: + return "Su portador salta el doble"; + case 54: + return "Permite correr superrápido"; + case 56: + return "'Late de energía oscura'"; + case 57: + return "'Late de energía oscura'"; + case 64: + return "Lanza una espina vil"; + case 65: + return "Hace que lluevan estrellas del cielo"; + case 66: + return "Limpia la corrupción"; + case 67: + return "Elimina la bendición"; + case 68: + return "'¡Sabe asqueroso!'"; + case 70: + return "Invoca al Devoramundos"; + default: + if (l == 75) + { + return "Desaparece al amanecer"; + } + break; + } + } + else + { + if (l == 84) + { + return "'¡Te atrapé!'"; + } + if (l == 88) + { + return "Da luz a su portador"; + } + switch (l) + { + case 98: + return "Probabilidad del 33% de no gastar munición"; + case 100: + return "Aumenta un 7% la velocidad en el cuerpo a cuerpo"; + case 101: + return "Aumenta un 7% la velocidad en el cuerpo a cuerpo"; + case 102: + return "Aumenta un 7% la velocidad en el cuerpo a cuerpo"; + case 103: + return "Puede abrir la piedra infernal"; + case 109: + return "Aumenta al máximo el maná (20) de forma definitiva"; + case 111: + return "Aumenta al máximo el maná (20)"; + case 112: + return "Arroja bolas de fuego"; + case 113: + return "Lanza un misil dirigido"; + case 114: + return "Remueve la tierra por arte de magia"; + case 115: + return "Crea un orbe mágico de luz"; + case 117: + return "'Calienta la antorcha'"; + case 118: + return "A veces lo sueltan esqueletos y pirañas"; + case 120: + return "Enciende las flechas de madera"; + case 121: + return "'¡Hecha de fuego!'"; + case 123: + return "Aumenta el daño mágico en un 5%"; + case 124: + return "Aumenta el daño mágico en un 5%"; + case 125: + return "Aumenta el daño mágico en un 5%"; + case 128: + return "Permite volar"; + } + } + } + } + else + { + if (l <= 218) + { + if (l <= 187) + { + switch (l) + { + case 148: + return "Su portador llamará la atención de indeseables"; + case 149: + return "'Contiene extraños símbolos'"; + case 150: + case 154: + case 155: + case 160: + case 161: + case 162: + case 163: + case 164: + break; + case 151: + return "Aumenta el daño a distancia en un 4%"; + case 152: + return "Aumenta el daño a distancia en un 4%"; + case 153: + return "Aumenta el daño a distancia en un 4%"; + case 156: + return "Ofrece inmunidad ante el retroceso"; + case 157: + return "Pulveriza un chorro de agua"; + case 158: + return "Anula el daño al caer"; + case 159: + return "Aumenta la altura al saltar"; + case 165: + return "Lanza un rayo de agua a baja velocidad"; + case 166: + return "Pequeña explosión que rompe varios ladrillos"; + case 167: + return "Gran explosión que rompe casi todos los ladrillos"; + case 168: + return "Pequeña explosión que no rompe ningún ladrillo"; + default: + if (l == 175) + { + return "'Enciende la antorcha'"; + } + switch (l) + { + case 186: + return "'Está bien eso de no ahogarse'"; + case 187: + return "Permite nadar"; + } + break; + } + } + else + { + if (l == 193) + { + return "Ofrece inmunidad ante los bloques de fuego"; + } + if (l == 197) + { + return "Dispara estrellas caídas"; + } + switch (l) + { + case 208: + return "'Hermosa, muy hermosa'"; + case 211: + return "Aumenta un 12% la velocidad en el cuerpo a cuerpo"; + case 212: + return "Aumenta en un 10% la velocidad de movimiento"; + case 213: + return "Genera césped sobre la tierra"; + case 215: + return "'Una molestia para los demás'"; + case 218: + return "Lanza una bola de fuego dirigida"; + } + } + } + else + { + if (l <= 305) + { + switch (l) + { + case 222: + return "Cultiva plantas"; + case 223: + return "Reduce el uso de maná en un 6%"; + case 224: + case 225: + case 226: + case 227: + break; + case 228: + return "Aumenta al máximo el maná (20)"; + case 229: + return "Aumenta al máximo el maná (20)"; + case 230: + return "Aumenta al máximo el maná (20)"; + default: + switch (l) + { + case 235: + return "'Puede costar lanzarla'"; + case 236: + break; + case 237: + return "'¡Te quedan muy bien!'"; + case 238: + return "Aumenta el daño mágico en un 15%"; + default: + switch (l) + { + case 261: + return "'Sonríe y además es un buen aperitivo'"; + case 266: + return "'¡Una buena idea!'"; + case 267: + return "'Eres mala persona'"; + case 268: + return "Permite respirar bajo el agua mucho más tiempo"; + case 272: + return "Lanza una guadaña demoníaca"; + case 281: + return "Permite recoger semillas como munición"; + case 282: + return "Funciona con humedad"; + case 283: + return "Para la cerbatana"; + case 285: + return "Aumenta en un 5% la velocidad de movimiento"; + case 288: + return "Ofrece inmunidad ante la lava"; + case 289: + return "Regenera la vida"; + case 290: + return "Aumenta en un 25% la velocidad de movimiento"; + case 291: + return "Permite respirar agua en lugar de aire"; + case 292: + return "Aumenta la defensa en 8"; + case 293: + return "Aumenta la regeneración de maná"; + case 294: + return "Aumenta el daño mágico en un 20%"; + case 295: + return "Disminuye la velocidad de caída"; + case 296: + return "Muestra la ubicación de tesoros y minerales"; + case 297: + return "Proporciona invisibilidad"; + case 298: + return "Emite un aura de luz"; + case 299: + return "Aumenta la visión nocturna"; + case 300: + return "Aumenta el porcentaje de regeneración del enemigo"; + case 301: + return "Los atacantes también sufren daños"; + case 302: + return "Permite caminar sobre el agua"; + case 303: + return "Aumenta en un 20% la velocidad y el daño de las flechas"; + case 304: + return "Muestra la ubicación de los enemigos"; + case 305: + return "Permite controlar la gravedad"; + } + break; + } + break; + } + } + else + { + if (l == 324) + { + return "'Prohibidos en casi todas partes'"; + } + switch (l) + { + case 327: + return "Abre un cofre de oro"; + case 328: + break; + case 329: + return "Abre todos los cofres de las sombras"; + default: + if (l == 332) + { + return "Se usa para confeccionar ropa"; + } + break; + } + } + } + } + } + else + { + if (l <= 726) + { + if (l <= 603) + { + if (l <= 407) + { + if (l == 352) + { + return "Se usa para elaborar cerveza"; + } + switch (l) + { + case 357: + return "Pequeñas mejoras de todas las estadísticas"; + case 361: + return "Invoca a un ejército de duendes"; + case 363: + return "Se usa para realizar trabajos de madera avanzados"; + case 367: + return "Lo bastante sólido para destruir los altares demoníacos"; + case 371: + return "Aumenta al máximo el maná (40)"; + case 372: + return "Aumenta en un 7% la velocidad de movimiento"; + case 373: + return "Aumenta el daño a distancia en un 10%"; + case 376: + return "Aumenta al máximo el maná (60)"; + case 377: + return "Aumenta un 5% la probabilidad de ataque crítico en el cuerpo a cuerpo"; + case 378: + return "Aumenta el daño a distancia en un 12%"; + case 385: + return "Puede abrir el mithril"; + case 386: + return "Puede abrir la adamantita"; + case 389: + return "Puede llegar a confundir"; + case 393: + return "Indica el horizonte"; + case 394: + return "Permite nadar"; + case 395: + return "Indica la posición"; + case 396: + return "Anula el daño al caer"; + case 397: + return "Ofrece inmunidad ante el retroceso"; + case 398: + return "Permite combinar varios accesorios"; + case 399: + return "Su portador salta el doble"; + case 400: + return "Aumenta al máximo el maná (80)"; + case 401: + return "Aumenta un 7% la probabilidad de ataque crítico en el cuerpo a cuerpo"; + case 402: + return "Aumenta el daño a distancia en un 14%"; + case 403: + return "Aumenta el daño en un 6%"; + case 404: + return "Aumenta la probabilidad de ataque crítico en un 4%"; + case 405: + return "Permite volar"; + case 407: + return "Aumenta la distancia de colocación de bloques"; + } + } + else + { + switch (l) + { + case 422: + return "Extiende la bendición a algunos bloques"; + case 423: + return "Extiende la corrupción a algunos bloques"; + case 424: + break; + case 425: + return "Invoca a una hada mágica"; + default: + if (l == 434) + { + return "Dispara tres ráfagas"; + } + switch (l) + { + case 485: + return "Convierte a su portador en hombre lobo durante la luna llena"; + case 486: + return "Dibuja una rejilla en pantalla para colocar los bloques"; + case 489: + return "Aumenta el daño mágico en un 15%"; + case 490: + return "Aumenta un 15% el daño en el cuerpo a cuerpo"; + case 491: + return "Aumenta el daño a distancia en un 15%"; + case 492: + return "Permite volar y caer lentamente"; + case 493: + return "Permite volar y caer lentamente"; + case 495: + return "Lanza un arco iris dirigido"; + case 496: + return "Lanza un bloque de hielo"; + case 497: + return "Transforma a su portador en un tritón al sumergirse en el agua"; + case 506: + return "Utiliza baba como munición"; + case 509: + return "Permite colocar alambre"; + case 510: + return "Permite cortar alambre"; + case 515: + return "Crea varios fragmentos de cristal al impactar"; + case 516: + return "Lanza estrellas caídas al impactar"; + case 517: + return "Una daga mágica que vuelve al arrojarse"; + case 518: + return "Lanza fragmentos de cristal a toda velocidad"; + case 519: + return "Lanza bolas de fuego impuras"; + case 520: + return "'La esencia de las criaturas de la luz'"; + case 521: + return "'La esencia de las criaturas de la oscuridad'"; + case 522: + return "'Ni siquiera el agua puede apagarla'"; + case 523: + return "Se puede meter en el agua"; + case 524: + return "Se usa para fundir mineral de adamantita"; + case 525: + return "Se usa para fabricar objetos con lingotes de mithril y adamantita"; + case 526: + return "'¡Puntiagudo y mágico!'"; + case 527: + return "'A veces lo llevan las criaturas de los desiertos corrompidos'"; + case 528: + return "'A veces lo llevan las criaturas de los desiertos de luz'"; + case 529: + return "Se activa al pisarla"; + case 531: + return "Se puede hechizar"; + case 532: + return "Hace que las estrellas caigan cuando te hieren"; + case 533: + return "Probabilidad del 50% de no gastar munición"; + case 534: + return "Dispara una ráfaga de balas"; + case 535: + return "Reduce el tiempo de espera para las pociones curativas"; + case 536: + return "Aumenta el retroceso en el cuerpo a cuerpo"; + case 541: + return "Se activa al pisarla"; + case 542: + return "Se activa al pisarla"; + case 543: + return "Se activa al pisarla"; + case 544: + return "Invoca a los Gemelos"; + case 547: + return "'La esencia del terror en estado puro'"; + case 548: + return "'La esencia del Destructor'"; + case 549: + return "'La esencia de los observadores omniscientes'"; + case 551: + return "Aumenta la probabilidad de ataque crítico en un 7%"; + case 552: + return "Aumenta el daño en un 7%"; + case 553: + return "Aumenta el daño a distancia en un 15%"; + case 554: + return "Aumenta el tiempo de invencibilidad tras recibir daños"; + case 555: + return "Reduce el uso de maná en un 8%"; + case 556: + return "Invoca El Destructor"; + case 557: + return "Invoca al Esqueleto mayor"; + case 558: + return "Aumenta al máximo el maná (100)"; + case 559: + return "Aumenta un 10% la probabilidad de ataque crítico y daño en el cuerpo a cuerpo"; + case 560: + return "Invoca a la Babosa rey"; + case 561: + return "No apilar más de 5"; + case 575: + return "'La esencia de poderosas criaturas que vuelan'"; + case 576: + return "Puedes grabar canciones"; + case 579: + return "'No confundir con un cuchillo jamonero'"; + case 580: + return "Explota al activarse"; + case 581: + return "Envía agua a los colectores de salida"; + case 582: + return "Recibe agua de los colectores de entrada"; + case 583: + return "Se activa cada segundo"; + case 584: + return "Se activa cada 3 segundos"; + case 585: + return "Se activa cada 5 segundos"; + case 599: + return "Haga clic derecho para abrir"; + case 600: + return "Haga clic derecho para abrir"; + case 601: + return "Haga clic derecho para abrir"; + case 602: + return "Convoca a la Legión de Frost"; + case 603: + return "Convoca a un conejo de mascota"; + } + break; + } + } + } + else + { + if (l <= 686) + { + switch (l) + { + case 665: + return "Usted no debería tener este"; + case 666: + return "Usted no debería tener este"; + case 667: + return "Usted no debería tener este"; + case 668: + return "Usted no debería tener este"; + case 669: + return "Invoca a un bebé pingüino"; + default: + if (l == 676) + { + return "Dispara un tornillo de hielo"; + } + switch (l) + { + case 683: + return "Citación tridente del diablo"; + case 684: + return "16% más de daño cuerpo a cuerpo ya distancia"; + case 685: + return "11% más de cuerpo a cuerpo ya distancia probabilidad de golpe críticoe"; + case 686: + return "8% de aumento de la velocidad de movimiento"; + } + break; + } + } + else + { + switch (l) + { + case 707: + return "Indica el tiempo"; + case 708: + return "Indica el tiempo"; + case 709: + return "Indica el tiempo"; + default: + if (l == 716) + { + return "Se utiliza para artículos de artesanía a partir de barras de metal"; + } + switch (l) + { + case 723: + return "Dispara un rayo de luz"; + case 724: + return "Dispara un tornillo de hielo"; + case 725: + return "Dispara flechas heladas"; + case 726: + return "Dispara un chorro de heladas"; + } + break; + } + } + } + } + else + { + if (l <= 832) + { + if (l <= 761) + { + switch (l) + { + case 748: + return "Permite el vuelo y la caída lenta"; + case 749: + return "Permite el vuelo y la caída lenta"; + default: + if (l == 753) + { + return "Invoca una tortuga mascota"; + } + if (l == 761) + { + return "Permite el vuelo y la caída lenta"; + } + break; + } + } + else + { + switch (l) + { + case 779: + return "Crea y destruye biomas cuando se pulveriza"; + case 780: + return "Utilizado por el Clentaminator"; + case 781: + return "Utilizado por el Clentaminator"; + case 782: + return "Utilizado por el Clentaminator"; + case 783: + return "Utilizado por el Clentaminator"; + case 784: + return "Utilizado por el Clentaminator"; + case 785: + return "Permite el vuelo y la caída lenta"; + case 786: + return "Permite el vuelo y la caída lenta"; + case 787: + return "Lo suficientemente fuerte como para destruir los altares Demon"; + case 788: + return "Invoca una lanza espina"; + case 789: + case 790: + case 791: + case 795: + case 796: + case 797: + break; + case 792: + return "2% aumentado el daño"; + case 793: + return "2% aumentado el daño"; + case 794: + return "2% aumentado el daño"; + case 798: + return "Capaz de extraer Hellstone"; + default: + switch (l) + { + case 821: + return "Permite el vuelo y la caída lenta"; + case 822: + return "Permite el vuelo y la caída lenta"; + case 823: + return "Permite el vuelo y la caída lenta"; + default: + if (l == 832) + { + return "Lugares madera viva"; + } + break; + } + break; + } + } + } + else + { + if (l <= 1343) + { + switch (l) + { + case 849: + return "Permite bloques sólidos para activar y desactivar"; + case 850: + return "Lugares cable azul"; + case 851: + return "Lugares cable verde"; + case 852: + return "Se activa cuando un jugador pisa"; + case 853: + return "Se activa cuando cualquier cosa menos que un jugador pisa"; + case 854: + return "Tiendas tienen precios más bajos"; + case 855: + return "Golpear a los enemigos a veces caer más monedas"; + case 856: + return "'Tener un tiempo maravilloso!'"; + case 857: + return "Permite a su titular a hacer un doble salto mejorada"; + case 858: + case 859: + case 864: + case 865: + case 866: + case 867: + case 868: + case 869: + case 870: + case 871: + case 872: + case 873: + case 874: + case 875: + case 876: + case 877: + case 878: + case 879: + case 880: + case 881: + case 882: + case 883: + case 884: + case 894: + case 895: + case 896: + case 909: + case 910: + case 911: + case 912: + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 939: + case 940: + case 941: + case 942: + case 943: + case 944: + case 945: + case 949: + case 952: + case 954: + case 955: + case 970: + case 971: + case 972: + case 973: + case 974: + case 978: + case 979: + case 980: + case 981: + case 988: + case 991: + case 992: + case 993: + case 999: + break; + case 860: + return "Proporciona regeneración de vida y reduce el tiempo de reutilización de pociones curativas"; + case 861: + return "Activa el soporte en un hombre lobo en la noche y tritones al entrar en el agua"; + case 862: + return "Causas estrellas a caer y aumenta la longitud de la invencibilidad tras recibir daño"; + case 863: + return "Ofrece la posibilidad de caminar sobre el agua"; + case 885: + return "inmunidad a sangrado"; + case 886: + return "inmunidad a la armadura rota"; + case 887: + return "inmunidad al veneno"; + case 888: + return "inmunidad a la oscuridad"; + case 889: + return "inmunidad a reducir la velocidad"; + case 890: + return "inmunidad para silenciar"; + case 891: + return "inmunidad a maldecir"; + case 892: + return "inmunidad a la debilidad"; + case 893: + return "inmunidad a la confusión"; + case 897: + return "Aumenta melee llamar de nuevo"; + case 898: + return "permite vuelo"; + case 899: + return "Incrementa todas las estadísticas si se usan durante el día"; + case 900: + return "Incrementa todas las estadísticas si se usan durante la noche"; + case 901: + return "Inmunidad a la debilidad y la armadura rota"; + case 902: + return "Inmunidad al veneno y sangrado"; + case 903: + return "Inmunidad a disminuir y la confusión"; + case 904: + return "Inmunidad al silencio y la maldición"; + case 905: + return "Utiliza las monedas de munición"; + case 906: + return "Proporciona 7 segundos de inmunidad a la lava"; + case 907: + return "Ofrece la posibilidad de caminar sobre el agua"; + case 908: + return "Ofrece la posibilidad de caminar sobre el agua y la lava"; + case 932: + return "lugares ósea"; + case 933: + return "lugares hojas"; + case 934: + return "Permite al propietario para flotar durante unos segundos"; + case 935: + return "12% aumentado el daño"; + case 936: + return "Aumenta melee llamar de nuevo"; + case 937: + return "Explota cuando pisó"; + case 938: + return "Absorbe el 25% del daño hecho a los jugadores de su equipo"; + case 946: + return "Usted caerá más lento, mientras que la celebración de este"; + case 947: + return "Reacciona a la luz"; + case 948: + return "Permite el vuelo y la caída lenta"; + case 950: + return "Proporciona una mayor movilidad en el hielo"; + case 951: + return "Rápidamente lanza bolas de nieve"; + case 953: + return "Permite la posibilidad de deslizarse por las paredes"; + case 956: + return "7% aumento de la velocidad de cuerpo a cuerpo"; + case 957: + return "7% aumento de la velocidad de cuerpo a cuerpo"; + case 958: + return "7% aumento de la velocidad de cuerpo a cuerpo"; + case 959: + return "4% aumentado el daño a distancia."; + case 960: + return "Aumenta el maná máximo por 20"; + case 961: + return "Aumenta el maná máximo por 20"; + case 962: + return "Aumenta el maná máximo por 20"; + case 963: + return "Da la oportunidad de esquivar los ataques"; + case 964: + return "Dispara un diferencial de balas"; + case 965: + return "Puede ser escalado en"; + case 966: + return "La regeneración de la vida se incrementa cuando cerca de una fogata"; + case 967: + return "Póngalo en un palo y asado sobre un fuego de campamento"; + case 968: + return "Asar es sobre una hoguera!"; + case 969: + return "Pequeñas mejoras a todas las estadísticas"; + case 975: + return "Permite la posibilidad de deslizarse por las paredes"; + case 976: + return "Permite la posibilidad de escalar paredes"; + case 977: + return "Permite la posibilidad de lanzarse"; + case 982: + return "Aumenta el maná máximo por 20"; + case 983: + return "Permite al propietario el doble salto"; + case 984: + return "Permite la posibilidad de escalar paredes y guión"; + case 985: + return "Saque de banda para crear una línea escalable de la cuerda"; + case 986: + return "Permite la recolección de semillas para munición"; + case 987: + return "Permite al propietario el doble salto"; + case 989: + return "Dispara un rayo espada encantada"; + case 990: + return "'No se debe confundir con un hamdrill'"; + case 994: + return "Invoca una Eater bebé de las Almas"; + case 995: + return "Se utiliza para elaborar objetos"; + case 996: + return "Se utiliza para elaborar objetos"; + case 997: + return "Resulta cieno y lodo en algo más útil"; + case 998: + return "Se utiliza para elaborar objetos"; + case 1000: + return "Dispara confeti por todas partes!"; + case 1001: + return "16% aumentado el daño cuerpo a cuerpo"; + case 1002: + return "16% aumentado el daño a distancia"; + case 1003: + return "Aumenta el maná máximo en un 80 y reduce el uso de maná un 17%"; + case 1004: + return "5% aumentado el daño"; + case 1005: + return "8% mayor probabilidad de golpe crítico"; + case 1006: + return "Reacciona a la luz"; + default: + switch (l) + { + case 1071: + return "Utilizado con pintura a los bloques de color"; + case 1072: + return "Se utiliza con pintura de color a las paredes"; + default: + switch (l) + { + case 1100: + return "Se utiliza para quitar la pintura"; + case 1107: + return "Used to make teal dye"; + case 1108: + return "Used to make green dye"; + case 1109: + return "Se utiliza para hacer tinte verde azulado"; + case 1110: + return "Se utiliza para hacer colorante amarillo"; + case 1111: + return "Se utiliza para hacer un tinte azul"; + case 1112: + return "Se utiliza para hacer tintes cal"; + case 1113: + return "Se utiliza para hacer tinte rosa"; + case 1114: + return "Se utiliza para hacer tinte naranja"; + case 1115: + return "Se utiliza para hacer tinte rojo"; + case 1116: + return "Se utiliza para hacer colorante cian"; + case 1117: + return "Se utiliza para hacer tinte violeta"; + case 1118: + return "Se utiliza para hacer tinte púrpura"; + case 1119: + return "Se utiliza para hacer tinte negro"; + case 1120: + return "Se utiliza para elaborar tintes"; + case 1121: + return "Brotes de abejas que perseguir a su enemigo"; + case 1122: + return "Persigue a su enemigo"; + case 1123: + return "Invoca abejas asesinas después de golpear a tu enemigo"; + case 1129: + return "Lugares colmenas"; + case 1130: + return "Se descompone en un enjambre de abejas"; + case 1131: + return "Permite al propietario para revertir la gravedad"; + case 1132: + return "Libera las abejas cuando está dañado"; + case 1133: + return "Invoca la abeja reina"; + case 1141: + return "Abre la puerta del templo de la selva"; + case 1145: + return "Se utiliza para la elaboración básicas"; + case 1151: + return "Se activa cuando un jugador pisa"; + case 1156: + return "Prende a los enemigos por los daños continuos"; + case 1157: + return "Invoca un pigmeo para luchar por usted"; + case 1158: + return "Aumenta el número máximo de esbirros"; + case 1159: + return "Aumenta el número máximo de esbirros"; + case 1160: + return "Aumenta el número máximo de esbirros"; + case 1161: + return "Aumenta el número máximo de esbirros"; + case 1162: + return "Permite el vuelo y la caída lenta"; + case 1163: + return "Permite al propietario el doble salto"; + case 1164: + return "Permite al propietario salto cuádruple"; + case 1165: + return "Permite el vuelo y la caída lenta"; + case 1167: + return "Aumenta el daño de tus siervos por 15"; + case 1169: + return "Invoca una cabeza Skeletron bebé"; + case 1170: + return "Invoca un Hornet bebé"; + case 1171: + return "Invoca un espíritu Tiki"; + case 1172: + return "Invoca una lagartija"; + case 1178: + return "Dispara rápidamente hojas afiladas"; + case 1179: + return "Persigue a su enemigo"; + case 1180: + return "Invoca un loro"; + case 1181: + return "Invoca una trufa bebé"; + case 1182: + return "Invoca un árbol del animal doméstico"; + case 1183: + return "Invoca un Wisp para proporcionar luz"; + case 1188: + return "Puede mina Mythril, Orichalcum, adamantita y Titanium"; + case 1189: + return "Puede mina Mythril, Orichalcum, adamantita y Titanium"; + case 1195: + return "Puede mina adamantita y Titanio"; + case 1196: + return "Puede mina adamantita y Titanio"; + case 1205: + return "8% aumentado el daño cuerpo a cuerpo"; + case 1206: + return "9% aumentado el daño a distancia"; + case 1207: + return "7% aumento de daño mágico y probabilidad de golpe crítico"; + case 1208: + return "3% aumentado el daño"; + case 1209: + return "2% aumentado el daño"; + case 1210: + return "7% aumentado el daño cuerpo a cuerpo"; + case 1211: + return "15% mayor distancia probabilidad de golpe crítico"; + case 1212: + return "18% increased magic critical strike chance"; + case 1213: + return "6% mayor probabilidad de golpe crítico"; + case 1214: + return "11% increased movement speed"; + case 1215: + return "8% increased melee damage and critical strike chance"; + case 1216: + return "16% aumentado el daño a distancia"; + case 1217: + return "16% aumento de daño mágico y el 7% se incrementaron magia probabilidad de golpe crítico"; + case 1218: + return "4% aumentado el daño"; + case 1219: + return "3% aumentado el daño y la probabilidad de golpe crítico"; + case 1220: + return "Se utiliza para crear objetos de mythril, oricalco, adamantita y barras de titanio"; + case 1221: + return "Se utiliza para adamantite fundir y mineral de titanio"; + case 1226: + return "Dispara un poderoso orbe"; + case 1227: + return "Dispara una nube de esporas"; + case 1228: + return "Dispara una nube de esporas"; + case 1235: + return "Rebota después de golpear una pared"; + case 1242: + return "Invoca un dinosaurio bebé"; + case 1244: + return "Invoca una nube lloviendo sobre sus enemigos"; + case 1247: + return "Causas estrellas a caer y libera abejas cuando se lesionó"; + case 1248: + return "10% mayor probabilidad de golpe crítico"; + case 1249: + return "Aumenta la altura del salto"; + case 1250: + return "Permite al propietario el doble salto"; + case 1251: + return "Permite al propietario el doble salto"; + case 1252: + return "Permite al propietario el doble salto"; + case 1253: + return "Pone una capa alrededor del propietario cuando bajo la vida del 25% que reduce el daño"; + case 1254: + return "Dispara un potente y de alta velocidad de la bala"; + case 1255: + return "Dispara un potente y de alta velocidad de la bala"; + case 1256: + return "Invoca una nube a llover sangre en tus enemigos"; + case 1258: + return "Dispara un perno explosivo"; + case 1259: + return "Brotes de afeitar afiladas pétalos de flores a los enemigos cercanos"; + case 1260: + return "Dispara un arco iris que hace daño continuo"; + case 1261: + return "Se descompone en metralla mortal"; + case 1264: + return "Dispara una bola de hielo"; + case 1265: + return "Dispara un potente y de alta velocidad de la bala"; + case 1282: + return "Aumenta el maná máximo por 20"; + case 1283: + return "Aumenta el maná máximo por 40"; + case 1284: + return "Aumenta el maná máximo por 40"; + case 1285: + return "Aumenta el maná máximo por 60"; + case 1286: + return "Aumenta el maná máximo por 60"; + case 1287: + return "Aumenta el maná máximo por 80"; + case 1290: + return "Aumenta la velocidad de movimiento después de ser golpeado"; + case 1291: + return "Permanentemente aumenta la vida útil máxima de 5"; + case 1293: + return "Se utiliza en el Altar Lihzahrd"; + case 1294: + return "Capaz de minería Lihzahrd Ladrillos"; + case 1295: + return "Dispara un rayo penetrante calor"; + case 1296: + return "Invoca un poderoso canto rodado"; + case 1297: + return "Golpes con la fuerza de un golem"; + case 1299: + return "Aumenta la gama ver cuando se mantiene"; + case 1300: + return "Aumenta ver gama de armas de fuego"; + case 1301: + return "10% aumentado el daño"; + case 1303: + return "Proporciona luz bajo el agua"; + case 1306: + return "Dispara una hoz helada"; + case 1307: + return "'Usted es una persona terrible'"; + case 1308: + return "Dispara un veneno colmillo que atraviesa múltiples enemigos"; + case 1309: + return "Invoca un limo bebé para luchar por usted"; + case 1310: + return "Inflige veneno enemigos"; + case 1311: + return "Convoca a un resorte globo ocular"; + case 1312: + return "Invoca un muñeco de nieve del bebé"; + case 1313: + return "Dispara un cráneo"; + case 1314: + return "Dispara un guante de boxeo"; + case 1315: + return "Invoca una invasión pirata"; + case 1316: + return "6% aumentado el daño cuerpo a cuerpo"; + case 1317: + return "8% aumentado el daño cuerpo a cuerpo y la probabilidad de golpe crítico"; + case 1318: + return "4% mayor probabilidad de golpe crítico cuerpo a cuerpo"; + case 1321: + return "Aumentar la velocidad de la flecha y el daño en un 10%"; + case 1322: + return "Inflige daño de fuego en el ataque"; + case 1323: + return "Reduce el daño de no tocar la lava"; + case 1326: + return "Teletransporta a la posición del ratón"; + case 1327: + return "Dispara una hoz mortal"; + case 1331: + return "Invoca el cerebro de Cthulhu"; + case 1332: + return "'La sangre de los dioses'"; + case 1333: + return "Puede ser colocado en agua"; + case 1334: + return "Disminuye la defensa del objetivo"; + case 1335: + return "Disminuye la defensa del objetivo"; + case 1336: + return "Aplica una lluvia de icor"; + case 1343: + return "Aumenta melee llamar de nuevo e inflige daño de fuego en el ataque"; + } + break; + } + break; + } + } + else + { + switch (l) + { + case 1430: + return "Se utiliza para elaborar frascos imbuement armas"; + case 1431: + break; + case 1432: + return "Se utiliza para elaborar distintos tipos de munición"; + default: + switch (l) + { + case 1444: + return "Crea un haz de sombra que rebota en las paredes"; + case 1445: + return "Lanza una bola de fuego que explota en un infierno rugiente"; + case 1446: + return "Invoca un alma en pena para perseguir a sus enemigos"; + case 1447: + case 1448: + break; + case 1449: + return "sopla burbujas"; + case 1450: + return "sopla burbujas"; + default: + switch (l) + { + case 1503: + return "Aumenta el maná máximo en un 80 y reduce el uso de maná un 17%"; + case 1504: + return "7% más de daño mágico y la probabilidad de golpe crítico"; + case 1505: + return "8% mayor daño mágico"; + case 1513: + return "Un poderoso martillo regresar"; + case 1515: + return "Permite el vuelo y la caída lenta"; + case 1522: + return "Para la captura de la gema. Suelta cuando mueras"; + case 1523: + return "Para la captura de la gema. Suelta cuando mueras"; + case 1524: + return "Para la captura de la gema. Suelta cuando mueras"; + case 1525: + return "Para la captura de la gema. Suelta cuando mueras"; + case 1526: + return "Para la captura de la gema. Suelta cuando mueras"; + case 1527: + return "Para la captura de la gema. Suelta cuando mueras"; + case 1533: + return "Desbloquea un pecho Jungle en la mazmorra"; + case 1534: + return "Desbloquea un pecho Corrupción en el calabozo"; + case 1535: + return "Desbloquea un pecho carmesí en el calabozo"; + case 1536: + return "Abre un cofre sagrado en el calabozo"; + case 1537: + return "Desbloquea un pecho congelado en el calabozo"; + case 1543: + return "Utilizado con pintura a los bloques de color"; + case 1544: + return "Se utiliza con pintura de color a las paredes"; + case 1545: + return "Se utiliza para quitar la pintura"; + case 1546: + return "15% aumentado el daño flecha"; + case 1547: + return "15% aumentado el daño de bala"; + case 1548: + return "15% aumentado el daño de cohetes"; + case 1549: + return "13% mayor distancia probabilidad de golpe crítico"; + case 1550: + return "7% mayor distancia probabilidad de golpe crítico"; + case 1551: + return "Convierte Bares chlorophyte en Bares Shroomite"; + case 1553: + return "50% oportunidad de no consumir municiones"; + case 1554: + return "Usted no debería tener este"; + case 1555: + return "Usted no debería tener este"; + case 1556: + return "Usted no debería tener este"; + case 1557: + return "Usted no debería tener este"; + case 1558: + return "Usted no debería tener este"; + case 1559: + return "Usted no debería tener este"; + case 1560: + return "Usted no debería tener este"; + case 1561: + return "Usted no debería tener este"; + case 1562: + return "Usted no debería tener este"; + case 1563: + return "Usted no debería tener este"; + case 1564: + return "Usted no debería tener este"; + case 1565: + return "Usted no debería tener este"; + case 1566: + return "Usted no debería tener este"; + case 1567: + return "Usted no debería tener este"; + case 1568: + return "Usted no debería tener este"; + case 1569: + return "Tirar rápidamente dagas robando la vida"; + case 1571: + return "A javalin poderosa que libera pequeñas comedores"; + case 1572: + return "Invoca un poderoso heladas hydra de escupir hielo a sus enemigos"; + case 1578: + return "Lanzamientos abejas y aumenta la velocidad de movimiento cuando está dañado"; + case 1579: + return "El usuario puede correr muy rápido"; + case 1580: + return "Usted no debería tener este"; + case 1581: + return "Usted no debería tener este"; + case 1582: + return "Usted no debería tener este"; + case 1583: + return "Usted no debería tener este"; + case 1584: + return "Usted no debería tener este"; + case 1585: + return "Usted no debería tener este"; + case 1586: + return "Usted no debería tener este"; + case 1587: + return "Usted no debería tener este"; + case 1588: + return "Usted no debería tener este"; + case 1595: + return "Aumenta el maná máximo por 20"; + } + break; + } + break; + } + } + } + } + } + } + } + } + } + } + if (!english && Lang.lang > 1) + { + return Lang.toolTip(l, true); + } + return ""; + } + public static string toolTip2(int l, bool english = false) + { + if (Lang.lang <= 1 || english) + { + if (l <= 962) + { + if (l <= 686) + { + if (l <= 405) + { + if (l <= 98) + { + if (l == 65) + { + return "'Forged with the fury of heaven'"; + } + if (l == 98) + { + return "'Half shark, half gun, completely awesome.'"; + } + } + else + { + switch (l) + { + case 228: + return "3% increased magic critical strike chance"; + case 229: + return "3% increased magic critical strike chance"; + case 230: + return "3% increased magic critical strike chance"; + default: + switch (l) + { + case 371: + return "9% increased magic critical strike chance"; + case 372: + return "12% increased melee speed"; + case 373: + return "6% increased ranged critical strike chance"; + case 374: + return "3% increased critical strike chance"; + case 375: + return "10% increased movement speed"; + case 376: + return "15% increased magic damage"; + case 377: + return "10% increased melee damage"; + case 378: + return "7% increased ranged critical strike chance"; + case 379: + return "5% increased damage"; + case 380: + return "3% increased critical strike chance"; + case 389: + return "'Find your inner pieces'"; + case 394: + return "Greatly extends underwater breathing"; + case 395: + return "Tells the time"; + case 396: + return "Grants immunity to fire blocks"; + case 397: + return "Grants immunity to fire blocks"; + case 399: + return "Increases jump height"; + case 400: + return "11% increased magic damage and critical strike chance"; + case 401: + return "14% increased melee damage"; + case 402: + return "8% increased ranged critical strike chance"; + case 404: + return "5% increased movement speed"; + case 405: + return "The wearer can run super fast"; + } + break; + } + } + } + else + { + if (l <= 533) + { + if (l == 434) + { + return "Only the first shot consumes ammo"; + } + if (l == 533) + { + return "'Minishark's older brother'"; + } + } + else + { + switch (l) + { + case 552: + return "8% increased movement speed"; + case 553: + return "8% increased ranged critical strike chance"; + case 554: + case 556: + case 557: + break; + case 555: + return "Automatically use mana potions when needed"; + case 558: + return "12% increased magic damage and critical strike chance"; + case 559: + return "10% increased melee haste"; + default: + if (l == 686) + { + return "7% increased melee attack speed"; + } + break; + } + } + } + } + else + { + if (l <= 908) + { + if (l <= 784) + { + if (l == 748) + { + return "Hold up to rocket faster"; + } + switch (l) + { + case 771: + return "Small blast radius. Will not destroy tiles"; + case 772: + return "Small blast radius. Will destroy tiles"; + case 773: + return "Large blast radius. Will not destroy tiles"; + case 774: + return "Large blast radius. Will destroy tiles"; + case 775: + return "Increases running speed"; + case 776: + return "Can mine Mythril and Orichalcum"; + case 777: + return "Can mine Adamantite and Titanium"; + case 779: + return "Uses colored solution"; + case 780: + return "Spreads the Purity"; + case 781: + return "Spreads the Hallow"; + case 782: + return "Spreads the Corruption"; + case 783: + return "Spreads Glowing Mushrooms"; + case 784: + return "Spreads the Crimson"; + } + } + else + { + switch (l) + { + case 897: + return "12% increased melee speed"; + case 898: + return "The wearer can run incredibly fast"; + default: + switch (l) + { + case 905: + return "Higher valued coins do more damage"; + case 907: + return "Grants immunity to fire blocks"; + case 908: + return "Grants immunity to fire blocks and 7 seconds of immunity to lava"; + } + break; + } + } + } + else + { + if (l <= 938) + { + if (l == 929) + { + return "For use with cannon"; + } + switch (l) + { + case 936: + return "10% increased damage and melee speed"; + case 938: + return "Only active above 25% life"; + } + } + else + { + if (l == 950) + { + return "Ice will not break when you fall on it"; + } + if (l == 953) + { + return "Improved ability if combined with Shoe Spikes"; + } + switch (l) + { + case 960: + return "3% increased magic critical strike chance"; + case 961: + return "3% increased magic critical strike chance"; + case 962: + return "3% increased magic critical strike chance"; + } + } + } + } + } + else + { + if (l <= 1254) + { + if (l <= 1123) + { + if (l <= 984) + { + switch (l) + { + case 975: + return "Improved ability if combined with Climbing Claws"; + case 976: + break; + case 977: + return "Double tap a direction"; + default: + switch (l) + { + case 982: + return "Increases mana regeneration rate"; + case 983: + return "Increases jump height"; + case 984: + return "Gives a chance to dodge attacks"; + } + break; + } + } + else + { + switch (l) + { + case 997: + return "'To use: Place silt/slush in the extractinator'"; + case 998: + case 999: + case 1000: + break; + case 1001: + return "6% increased melee critical strike chance"; + case 1002: + return "20% chance to not consume ammo"; + case 1003: + return "16% increased magic damage"; + case 1004: + return "7% increased critical strike chance"; + case 1005: + return "5% increased movement speed"; + default: + if (l == 1123) + { + return "Small chance to cause confusion"; + } + break; + } + } + } + else + { + if (l <= 1167) + { + if (l == 1131) + { + return "Press UP to change gravity"; + } + switch (l) + { + case 1159: + return "Increases minion damage by 10%"; + case 1160: + return "Increases minion damage by 10%"; + case 1161: + return "Increases minion damage by 10%"; + case 1163: + return "Increases jump height"; + case 1164: + return "Increases jump height"; + case 1167: + return "Increases the knockback of your minions"; + } + } + else + { + switch (l) + { + case 1205: + return "12% increased melee speed"; + case 1206: + return "9% increased ranged critical strike chance"; + case 1207: + return "Increases maximum mana by 60"; + case 1208: + return "2% increased critical strike chance"; + case 1209: + return "1% increased critical strike chance"; + case 1210: + return "7% increased movement and melee speed"; + case 1211: + return "8% increased movement speed"; + case 1212: + return "Increases maximum mana by 80"; + case 1213: + case 1214: + break; + case 1215: + return "8% increased melee speed"; + case 1216: + return "7% increased ranged critical strike chance"; + case 1217: + return "Increases maximum mana by 100"; + case 1218: + return "3% increased critical strike chance"; + case 1219: + return "6% increased movement speed"; + default: + switch (l) + { + case 1249: + return "Releases bees when damaged"; + case 1250: + return "Increases jump height and negates fall damage"; + case 1251: + return "Increases jump height and negates fall damage"; + case 1252: + return "Increases jump height and negates fall damage"; + case 1254: + return "Right click to zoom out"; + } + break; + } + } + } + } + else + { + if (l <= 1321) + { + if (l <= 1295) + { + switch (l) + { + case 1282: + return "Reduces mana usage by 5%"; + case 1283: + return "Reduces mana usage by 7%"; + case 1284: + return "Reduces mana usage by 9%"; + case 1285: + return "Reduces mana usage by 11%"; + case 1286: + return "Reduces mana usage by 13%"; + case 1287: + return "Reduces mana usage by 15%"; + default: + if (l == 1295) + { + return "'Oolaa!!'"; + } + break; + } + } + else + { + switch (l) + { + case 1300: + return "Right click to zoom out"; + case 1301: + return "8% increased critical strike chance"; + default: + switch (l) + { + case 1316: + return "Enemies are more likely to target you"; + case 1317: + return "Enemies are more likely to target you"; + case 1318: + return "Enemies are more likely to target you"; + case 1321: + return "20% chance to not consume arrow"; + } + break; + } + } + } + else + { + if (l <= 1505) + { + switch (l) + { + case 1336: + return "Decreases target's defense"; + case 1337: + case 1344: + case 1345: + case 1346: + case 1347: + case 1348: + break; + case 1338: + return "For use with bunny cannon"; + case 1339: + return "'Extremely toxic'"; + case 1340: + return "Melee attacks inflict Venom on enemies"; + case 1341: + return "Inflicts target with Venom"; + case 1342: + return "Inflicts target with Venom"; + case 1343: + return "9% increased melee damage and speed"; + case 1349: + return "Explodes into confetti on impact"; + case 1350: + return "Causes confusion"; + case 1351: + return "Explodes on impact"; + case 1352: + return "Enemies killed will drop more money"; + case 1353: + return "Melee attacks inflict enemies with cursed flames"; + case 1354: + return "Melee attacks set enemies on fire"; + case 1355: + return "Melee attacks make enemies drop more gold"; + case 1356: + return "Melee attacks decrease enemies defense"; + case 1357: + return "Melee attacks confuse enemies"; + case 1358: + return "Melee attacks cause confetti to appear"; + case 1359: + return "Melee attacks poison enemies"; + default: + switch (l) + { + case 1503: + return "10% increased magic damage and critical strike chance"; + case 1505: + return "8% increased movement speed"; + } + break; + } + } + else + { + switch (l) + { + case 1546: + return "5% increased ranged critical strike chance"; + case 1547: + return "5% increased ranged critical strike chance"; + case 1548: + return "5% increased ranged critical strike chance"; + case 1549: + return "20% chance to not consume ammo"; + case 1550: + return "12% increased movement speed"; + case 1551: + case 1552: + break; + case 1553: + return "'It came from the edge of space'"; + default: + if (l == 1595) + { + return "Restores mana when damaged"; + } + if (l == 1613) + { + return "Grants immunity to most debuffs"; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 2) + { + if (l <= 962) + { + if (l <= 686) + { + if (l <= 405) + { + if (l <= 98) + { + if (l == 65) + { + return "'Geschmiedet mit Himmelswut'"; + } + if (l == 98) + { + return "'Halb Hai, halb Pistole - einfach toll!'"; + } + } + else + { + switch (l) + { + case 228: + return "Um 3% erhoehte kritische Magietrefferchance"; + case 229: + return "Um 3% erhoehte kritische Magietrefferchance"; + case 230: + return "Um 3% erhoehte kritische Magietrefferchance"; + default: + switch (l) + { + case 371: + return "Um 9% erhoehte kritische Magietrefferchance"; + case 372: + return "Um 12% erhoehtes Nahkampftempo"; + case 373: + return "Um 6% erhoehte kritische Fernkampf-Trefferchance"; + case 374: + return "Um 3% erhoehte kritische Trefferchance"; + case 375: + return "Um 10% erhoehtes Bewegungstempo"; + case 376: + return "Um 15% erhoehter magischer Schaden"; + case 377: + return "Um 10% erhoehter Nahkampfschaden"; + case 378: + return "Um 7% erhoehte kritische Fernkampf-Trefferchance"; + case 379: + return "Um 5% erhoehter Schaden"; + case 380: + return "Um 3% erhoehte kritische Trefferchance"; + case 389: + return "'Sammele dich!'"; + case 394: + return "Verlaengert das Atmen unter Wasser deutlich"; + case 395: + return "Zeigt die Zeit an"; + case 396: + return "Macht immun gegen Feuer-Bloecke"; + case 397: + return "Macht immun gegen Feuer-Bloecke"; + case 399: + return "Vergroessert die Sprunghoehe"; + case 400: + return "Magischer Schaden und kritische Trefferchance um 11% erhoeht"; + case 401: + return "Um 14% erhoehter Nahkampfschaden"; + case 402: + return "Um 8% erhoehte kritische Fernkampf-Trefferchance"; + case 404: + return "Um 5% erhoehtes Bewegungstempo"; + case 405: + return "Der Traeger kann superschnell rennen"; + } + break; + } + } + } + else + { + if (l <= 533) + { + if (l == 434) + { + return "Nur der erste Schuss verbraucht Munition "; + } + if (l == 533) + { + return "'Minihais grosser Bruder'"; + } + } + else + { + switch (l) + { + case 552: + return "Um 8% erhoehtes Bewegungstempo"; + case 553: + return "Um 8% erhoehte kritische Fernkampf-Trefferchance"; + case 554: + case 556: + case 557: + break; + case 555: + return "Bei Bedarf automatisch Manatraenke verwenden"; + case 558: + return "Magischer Schaden und kritische Trefferchance um 12% erhoeht"; + case 559: + return "Um 10% erhoehtes Nahkampftempo"; + default: + if (l == 686) + { + return "7% erhöht Nahkampfangriffstempo"; + } + break; + } + } + } + } + else + { + if (l <= 908) + { + if (l <= 784) + { + if (l == 748) + { + return "Halten bis zu Rakete schneller"; + } + switch (l) + { + case 771: + return "Kleine Explosion. Wird nicht zerstören Fliesen"; + case 772: + return "Kleine Explosion. Will Fliesen zu zerstören"; + case 773: + return "Große Sprengradius. Wird nicht zerstören Fliesen"; + case 774: + return "Große Sprengradius. Will Fliesen zu zerstören"; + case 775: + return "Erhöht Laufgeschwindigkeit"; + case 776: + return "Kann mir Mithril und Orichalcum"; + case 777: + return "Kann mir Adamantitbeschlagene und Titanium"; + case 779: + return "Verwendet gefärbte Lösung"; + case 780: + return "Verbreitet die Reinheit"; + case 781: + return "Verteilt den Hallow"; + case 782: + return "Verbreitet die Korruption"; + case 783: + return "Verbreitet leuchtende Pilze"; + case 784: + return "Verbreitet Crimson"; + } + } + else + { + switch (l) + { + case 897: + return "12% erhöht Nahkampfsangriffstempo"; + case 898: + return "Der Träger kann unglaublich schnell laufen"; + default: + switch (l) + { + case 905: + return "Höherwertigen Münzen mehr Schaden anrichten"; + case 907: + return "Grants Immunität gegen Feuer-Blöcke"; + case 908: + return "Grants Immunität gegen Feuer-Blöcke und 7 Sekunden Immunität gegen Lava"; + } + break; + } + } + } + else + { + if (l <= 938) + { + if (l == 929) + { + return "Für den Einsatz mit Kanone"; + } + switch (l) + { + case 936: + return "10% mehr Schaden und Nahkampfsangriffstempo"; + case 938: + return "Nur aktiv, über 25% Leben"; + } + } + else + { + if (l == 953) + { + return "Verbesserte Fähigkeit, wenn sie mit Schuh Spikes kombiniert"; + } + switch (l) + { + case 960: + return "3% Magie erhöht Chance auf kritische Treffer"; + case 961: + return "3% Magie erhöht Chance auf kritische Treffer"; + case 962: + return "3% Magie erhöht Chance auf kritische Treffer"; + } + } + } + } + } + else + { + if (l <= 1254) + { + if (l <= 1123) + { + if (l <= 984) + { + switch (l) + { + case 975: + return "Verbesserte Fähigkeit, wenn sie mit Klettern Claws kombiniert"; + case 976: + break; + case 977: + return "Tippen Sie zweimal auf eine Richtung"; + default: + switch (l) + { + case 982: + return "Erhöht Manaregenerationsrate"; + case 983: + return "Erhöht Sprunghöhe"; + case 984: + return "Gewährt Euch eine Chance, Angriffe auszuweichen"; + } + break; + } + } + else + { + switch (l) + { + case 997: + return "'So verwenden: Platz Schlick und Matsch in der extractinator'"; + case 998: + case 999: + case 1000: + break; + case 1001: + return "6% erhöht Nahkampf kritische Trefferchance"; + case 1002: + return "20% Chance, nicht verbrauchen Munition"; + case 1003: + return "16% erhöht magischen Schaden"; + case 1004: + return "7% erhöhte Chance auf kritische Treffer"; + case 1005: + return "5% erhöhte Bewegungsgeschwindigkeit"; + default: + if (l == 1123) + { + return "Geringe Chance zu Verwechslungen führen"; + } + break; + } + } + } + else + { + if (l <= 1167) + { + if (l == 1131) + { + return "Drücken Sie UP, um die Schwerkraft zu ändern"; + } + switch (l) + { + case 1159: + return "Erhöht Günstling Schäden, die durch 10%"; + case 1160: + return "Erhöht Günstling Schäden, die durch 10%"; + case 1161: + return "Erhöht Günstling Schäden, die durch 10%"; + case 1163: + return "Erhöht Sprunghöhe"; + case 1164: + return "Erhöht Sprunghöhe"; + case 1167: + return "Erhöht das Klopfen Rückseite Ihrer Schergen"; + } + } + else + { + switch (l) + { + case 1205: + return "12% erhöht Nahkampfsangriffstempo"; + case 1206: + return "9% erhöhte Chance auf kritische Treffer reichte"; + case 1207: + return "Erhöht die maximale Mana um 60"; + case 1208: + return "2% erhöhte Chance auf kritische Treffer"; + case 1209: + return "1% erhöhte Chance auf kritische Treffer"; + case 1210: + return "7% increased Bewegung und Nahkampfsangriffstempo"; + case 1211: + return "8% erhöhte Bewegungsgeschwindigkeit"; + case 1212: + return "Iincreases maximalen Manas um 80"; + case 1213: + case 1214: + break; + case 1215: + return "8% erhöht Nahkampfsangriffstempo"; + case 1216: + return "7% erhöhte Chance auf kritische Treffer reichte"; + case 1217: + return "Erhöht maximales Mana um 100"; + case 1218: + return "3% erhöhte Chance auf kritische Treffer"; + case 1219: + return "6% erhöhte Bewegungsgeschwindigkeit"; + default: + switch (l) + { + case 1249: + return "Gibt Bienen, wenn sie beschädigt"; + case 1250: + return "Erhöht Sprunghöhe und negiert fallen Schäden"; + case 1251: + return "Erhöht Sprunghöhe und negiert fallen Schäden"; + case 1252: + return "Erhöht Sprunghöhe und negiert fallen Schäden"; + case 1254: + return "Rechts klicken, um zu verkleinern"; + } + break; + } + } + } + } + else + { + if (l <= 1321) + { + if (l <= 1295) + { + switch (l) + { + case 1282: + return "Verringert Manaverbrauchs um 5%"; + case 1283: + return "Verringert Manaverbrauchs um 7%"; + case 1284: + return "Verringert Manaverbrauchs um 9%"; + case 1285: + return "Verringert Manaverbrauchs um 11%"; + case 1286: + return "Verringert Manaverbrauchs um 13%"; + case 1287: + return "Verringert Manaverbrauchs um 15%"; + default: + if (l == 1295) + { + return "'Oolaa!!'"; + } + break; + } + } + else + { + switch (l) + { + case 1300: + return "Rechts klicken, um zu verkleinern"; + case 1301: + return "8% Chance auf kritische Treffer"; + default: + switch (l) + { + case 1316: + return "Feinde sind eher Sie als Ziel"; + case 1317: + return "Feinde sind eher Sie als Ziel"; + case 1318: + return "Feinde sind eher Sie als Ziel"; + case 1321: + return "20% Chance, nicht verbrauchen arrow"; + } + break; + } + } + } + else + { + if (l <= 1505) + { + switch (l) + { + case 1336: + return "Verringert Verteidigung des Ziels"; + case 1337: + case 1344: + case 1345: + case 1346: + case 1347: + case 1348: + break; + case 1338: + return "Für den Einsatz mit Hase Kanone"; + case 1339: + return "'Extrem giftig'"; + case 1340: + return "Nahkampfangriffe verursachen Venom auf Feinde"; + case 1341: + return "Fügt Ziel mit Gift"; + case 1342: + return "Fügt Ziel mit Gift"; + case 1343: + return "9% erhöht Nahkampfschaden und Geschwindigkeit"; + case 1349: + return "Explodiert in Konfetti auf Auswirkungen"; + case 1350: + return "Verursacht Verwirrung"; + case 1351: + return "Explodiert beim Aufprall"; + case 1352: + return "Getötete Feinde sinkt mehr Geld"; + case 1353: + return "Nahkampfangriffe verursachen Feinde verflucht mit Flammen"; + case 1354: + return "Nahkampfangriffe gesetzt Feinde"; + case 1355: + return "Nahkampfangriffe Feinde machen fallen mehr Gold"; + case 1356: + return "Nahkampfangriffe verringern Feinde Verteidigung"; + case 1357: + return "Nahkampfangriffe verwirren Feinde"; + case 1358: + return "Nahkampfangriffe verursachen Konfetti zu erscheinen"; + case 1359: + return "Nahkampfangriffe Gift Feinde"; + default: + switch (l) + { + case 1503: + return "10% erhöht magischen Schaden und kritische Trefferchance"; + case 1505: + return "8% erhöhte Bewegungsgeschwindigkeit"; + } + break; + } + } + else + { + switch (l) + { + case 1546: + return "5% erhöhte Chance auf kritische Treffer reichte"; + case 1547: + return "5% erhöhte Chance auf kritische Treffer reichte"; + case 1548: + return "5% erhöhte Chance auf kritische Treffer reichte"; + case 1549: + return "20% Chance, nicht verbrauchen Munition"; + case 1550: + return "12% erhöhte Bewegungsgeschwindigkeit"; + case 1551: + case 1552: + break; + case 1553: + return "'Es kam aus den Rand des Weltraums'"; + default: + if (l == 1595) + { + return "Mana wieder her, wenn sie beschädigt"; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 3) + { + if (l <= 962) + { + if (l <= 686) + { + if (l <= 405) + { + if (l <= 98) + { + if (l == 65) + { + return "'Forgiato con la furia del cielo'"; + } + if (l == 98) + { + return "'Mezzo squalo, mezza arma, assolutamente terrificante.'"; + } + } + else + { + switch (l) + { + case 228: + return "Aumenta la possibilità di colpo critico magico del 3%"; + case 229: + return "Aumenta la possibilità di colpo critico magico del 3%"; + case 230: + return "Aumenta la possibilità di colpo critico magico del 3%"; + default: + switch (l) + { + case 371: + return "Possibilità colpo critico magico aumentate del 9%"; + case 372: + return "Velocità del corpo a corpo aumentata del 12%"; + case 373: + return "Possibilità di colpo critico magico aumentata del 6%"; + case 374: + return "Possibilità di colpo critico aumentata del 3%"; + case 375: + return "Velocità di movimento aumentata del 10%"; + case 376: + return "Danno magico aumentato del 15%"; + case 377: + return "Danno nel corpo a corpo aumentato del 10%"; + case 378: + return "Possibilità di colpo critico a distanza aumentata del 7%"; + case 379: + return "Danno aumentato del 5%"; + case 380: + return "Possibilità di colpo critico aumentata del 3%"; + case 389: + return "'Trova i pezzi interni'"; + case 394: + return "Aumenta moltissimo il respiro sott'acqua"; + case 395: + return "Indica il tempo"; + case 396: + return "Permette immunità ai blocchi di fuoco"; + case 397: + return "Permette immunità ai blocchi di fuoco"; + case 399: + return "Aumenta l'altezza del salto"; + case 400: + return "Possibilità di colpo critico e danno magico aumentata del 11%"; + case 401: + return "Danno del corpo a corpo aumentato del 14%"; + case 402: + return "Possibilità di colpo critico a distanza aumentata dell'8%"; + case 404: + return "Velocità di movimento aumentata del 5%"; + case 405: + return "Colui che li indossa può correre velocissimo"; + } + break; + } + } + } + else + { + if (l <= 533) + { + if (l == 434) + { + return "Solo il primo colpo consuma munizioni"; + } + if (l == 533) + { + return "'Fratello maggiore del Minishark'"; + } + } + else + { + switch (l) + { + case 552: + return "Velocità di movimento aumentata del 8%"; + case 553: + return "Possibilità di colpo critico a distanza aumentata dell'8%"; + case 554: + case 556: + case 557: + break; + case 555: + return "Usa le pozioni mana automaticamente in caso di bisogno"; + case 558: + return "Possibilità di danno magico e colpo critico aumentata del 12%"; + case 559: + return "Velocità del corpo a corpo aumentata del 10%"; + default: + if (l == 686) + { + return "7% nella velocità di attacco in mischia"; + } + break; + } + } + } + } + else + { + if (l <= 908) + { + if (l <= 784) + { + if (l == 748) + { + return "Contenere fino a razzo più veloce"; + } + switch (l) + { + case 771: + return "Piccolo raggio di esplosione. Non distruggerà le piastrelle"; + case 772: + return "Piccolo raggio di esplosione. Distruggerà le piastrelle"; + case 773: + return "Ampio raggio di esplosione. Non distruggerà le piastrelle"; + case 774: + return "Ampio raggio di esplosione. Distruggerà le piastrelle"; + case 775: + return "Aumenta la velocità di corsa"; + case 776: + return "Can miniera Mythril e oricalco"; + case 777: + return "Possono miniera Adamantite e Titanio"; + case 779: + return "Utilizza soluzione colorata"; + case 780: + return "Distribuisce il Purezza"; + case 781: + return "Distribuisce il Hallow"; + case 782: + return "Diffonde la corruzione"; + case 783: + return "Spreads Funghi Incandescente"; + case 784: + return "Distribuisce il Crimson"; + } + } + else + { + switch (l) + { + case 897: + return "12% nella velocità di mischia"; + case 898: + return "Chi lo indossa può funzionare incredibilmente veloce"; + default: + switch (l) + { + case 905: + return "Higher valued coins do more damage"; + case 907: + return "Borse di immunità ai blocchi di fuoco"; + case 908: + return "Borse di immunità ai blocchi di fuoco e 7 secondi di immunità ai lavica"; + } + break; + } + } + } + else + { + if (l <= 938) + { + if (l == 929) + { + return "Per l'utilizzo con cannone"; + } + switch (l) + { + case 936: + return "10% maggiore danno e la velocità mischia"; + case 938: + return "Solo attivo superiore al 25% della vita"; + } + } + else + { + if (l == 953) + { + return "Miglioramento della capacità, se combinato con Spikes scarpe"; + } + switch (l) + { + case 960: + return "3% aumento magico possibilità di critico"; + case 961: + return "3% aumento magico possibilità di critico"; + case 962: + return "3% aumento magico possibilità di critico"; + } + } + } + } + } + else + { + if (l <= 1254) + { + if (l <= 1123) + { + if (l <= 984) + { + switch (l) + { + case 975: + return "Miglioramento della capacità, se combinato con artigli Arrampicata"; + case 976: + break; + case 977: + return "Toccare due volte una direzione"; + default: + switch (l) + { + case 982: + return "Aumenta la velocità di rigenerazione di mana"; + case 983: + return "Aumenta salto altezza"; + case 984: + return "Dà la possibilità di schivare gli attacchi"; + } + break; + } + } + else + { + switch (l) + { + case 997: + return "'Per utilizzare: Luogo limo o fango nel extractinator'"; + case 998: + case 999: + case 1000: + break; + case 1001: + return "6% aumento mischia possibilità di critico"; + case 1002: + return "20% di possibilità di non consumare munizioni"; + case 1003: + return "16% in più di danno magico"; + case 1004: + return "7% maggiore probabilità di critico"; + case 1005: + return "5% nella velocità di movimento"; + default: + if (l == 1123) + { + return "Small chance to cause confusion"; + } + break; + } + } + } + else + { + if (l <= 1167) + { + if (l == 1131) + { + return "Premere fino a cambiare la gravità"; + } + switch (l) + { + case 1159: + return "Aumenta il danno minion del 10%"; + case 1160: + return "Aumenta il danno minion del 10%"; + case 1161: + return "Aumenta il danno minion del 10%"; + case 1163: + return "Aumenta salto altezza"; + case 1164: + return "Aumenta salto altezza"; + case 1167: + return "Aumenta il knock back dei tuoi servitori"; + } + } + else + { + switch (l) + { + case 1205: + return "12% nella velocità di mischia"; + case 1206: + return "9% ha aumentato spaziato possibilità di critico"; + case 1207: + return "Aumenta mana massimo del 60"; + case 1208: + return "2% maggiore possibilità di critico"; + case 1209: + return "1% maggiore possibilità di critico"; + case 1210: + return "7% increased movement and melee speed"; + case 1211: + return "8% increased movement speed"; + case 1212: + return "Aumenta mana massimo del 80"; + case 1213: + case 1214: + break; + case 1215: + return "8% increased melee speed"; + case 1216: + return "7% increased ranged critical strike chance"; + case 1217: + return "Aumenta mana massimo del 100"; + case 1218: + return "3% maggiore possibilità di critico"; + case 1219: + return "6% maggiore velocità di movimento"; + default: + switch (l) + { + case 1249: + return "Rilascia le api se danneggiato"; + case 1250: + return "Aumenta saltano altezza e nega danno da caduta"; + case 1251: + return "Aumenta saltano altezza e nega danno da caduta"; + case 1252: + return "Aumenta saltano altezza e nega danno da caduta"; + case 1254: + return "Fare clic destro per rimpicciolire"; + } + break; + } + } + } + } + else + { + if (l <= 1321) + { + if (l <= 1295) + { + switch (l) + { + case 1282: + return "Riduce l'uso di mana del 5%"; + case 1283: + return "Riduce l'uso di mana del 7%"; + case 1284: + return "Riduce l'uso di mana del 9%"; + case 1285: + return "Riduce l'uso di mana del 11%"; + case 1286: + return "Riduce l'uso di mana del 13%"; + case 1287: + return "Riduce l'uso di mana del 15%"; + default: + if (l == 1295) + { + return "'Oolaa!!'"; + } + break; + } + } + else + { + switch (l) + { + case 1300: + return "Fare clic destro per rimpicciolire"; + case 1301: + return "8% maggiore possibilità di critico"; + default: + switch (l) + { + case 1316: + return "I nemici sono più propensi a indirizzare voi"; + case 1317: + return "I nemici sono più propensi a indirizzare voi"; + case 1318: + return "I nemici sono più propensi a indirizzare voi"; + case 1321: + return "20% di possibilità di non consumare freccia"; + } + break; + } + } + } + else + { + if (l <= 1505) + { + switch (l) + { + case 1336: + return "Diminuisce la Difesa del bersaglio"; + case 1337: + case 1344: + case 1345: + case 1346: + case 1347: + case 1348: + break; + case 1338: + return "Per l'uso con il coniglietto di cannone"; + case 1339: + return "'estremamente tossico'"; + case 1340: + return "Attacchi in mischia infliggono Venom sui nemici"; + case 1341: + return "Infligge bersaglio con veleno"; + case 1342: + return "Infligge bersaglio con veleno"; + case 1343: + return "9% ha aumentato i danni melee e velocità"; + case 1349: + return "Esplode in coriandoli di impatto"; + case 1350: + return "provoca confusione"; + case 1351: + return "Esplode al momento dell'impatto"; + case 1352: + return "Nemici uccisi scenderanno più soldi"; + case 1353: + return "Attacchi in mischia infliggono nemici con fiamme maledette"; + case 1354: + return "Attacchi corpo a corpo impostati nemici in fiamme"; + case 1355: + return "Attacchi corpo a corpo i nemici fanno cadere più oro"; + case 1356: + return "Attacchi corpo a corpo diminuiscono nemici difesa"; + case 1357: + return "Attacchi corpo a corpo confondono i nemici"; + case 1358: + return "Attacchi melee causano appaia coriandoli"; + case 1359: + return "Mischia attacca nemici veleno"; + default: + switch (l) + { + case 1503: + return "10% aumento danno magico e possibilità di critico"; + case 1505: + return "8% in più di velocità di movimento"; + } + break; + } + } + else + { + switch (l) + { + case 1546: + return "5% aumentato spaziato possibilità di critico"; + case 1547: + return "5% aumentato spaziato possibilità di critico"; + case 1548: + return "5% aumentato spaziato possibilità di critico"; + case 1549: + return "20% di possibilità di non consumare munizioni"; + case 1550: + return "12% nella velocità di movimento"; + case 1551: + case 1552: + break; + case 1553: + return "'E 'venuto dal bordo dello spazio'"; + default: + if (l == 1595) + { + return "Ripristina mana se danneggiato"; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 4) + { + if (l <= 962) + { + if (l <= 686) + { + if (l <= 405) + { + if (l <= 98) + { + if (l == 65) + { + return "'Forgée dans la furie du ciel'"; + } + if (l == 98) + { + return "'Moitié requin, moitié fusil, c'est de la balle !'"; + } + } + else + { + switch (l) + { + case 228: + return "Chance de coup critique magique augmenté de 3 %"; + case 229: + return "Chance de coup critique magique augmenté de 3 %"; + case 230: + return "Chance de coup critique magique augmenté de 3 %"; + default: + switch (l) + { + case 371: + return "Les chances de coup critique magique sont augmentées de 9 %"; + case 372: + return "La vitesse de mêlée est augmentée de 12 %"; + case 373: + return "Les chances de coup critique des attaques à distance sont augmentées de 6 %"; + case 374: + return "Les chances de coup critique sont augmentées de 3 %"; + case 375: + return "La vitesse de déplacement est augmentée de 10 %"; + case 376: + return "Augmente les dégâts magiques de 15 %"; + case 377: + return "Les dégâts de mêlée sont augmentés de 10 %"; + case 378: + return "Les chances de coup critique des attaques à distance sont augmentées de 7 %"; + case 379: + return "Les dégâts sont augmentés de 5 %"; + case 380: + return "Les chances de coup critique sont augmentées de 3 %"; + case 389: + return "'Pour trouver la paix intérieure'"; + case 394: + return "Améliore grandement la respiration sous l'eau"; + case 395: + return "Donne l'heure"; + case 396: + return "Permet de résister aux blocs de feu"; + case 397: + return "Permet de résister aux blocs de feu"; + case 399: + return "Augmente la hauteur des sauts"; + case 400: + return "Les dégâts et les chances de coup critique de magie sont augmentés de 11 %"; + case 401: + return "Les dégâts de mêlée sont augmentés de 14 %"; + case 402: + return "Chances de coup critique des attaques à distance augmentées de 8 %"; + case 404: + return "La vitesse de déplacement est augmentée de 5 %"; + case 405: + return "Le porteur peur courir super vite"; + } + break; + } + } + } + else + { + if (l <= 533) + { + if (l == 434) + { + return "Seul le premier tir utilise des munitions"; + } + if (l == 533) + { + return "'La version améliorée du minishark'"; + } + } + else + { + switch (l) + { + case 552: + return "Vitesse de mouvement augmentée de 8 %"; + case 553: + return "Chances de coup critique des attaques à distance augmentées de 8 %"; + case 554: + case 556: + case 557: + break; + case 555: + return "Utilise des potions de mana automatiquement si besoin"; + case 558: + return "Les chances de coup critique et les dégâts magiques sont augmentés de 12 %"; + case 559: + return "Vitesse de mêlée augmentée de 10%"; + default: + if (l == 686) + { + return "7% ont augmenté la vitesse d'attaque en mêlée"; + } + break; + } + } + } + } + else + { + if (l <= 908) + { + if (l <= 784) + { + if (l == 748) + { + return "contenir jusqu'à fusée rapide"; + } + switch (l) + { + case 771: + return "Petit rayon de souffle. Ne va pas détruire tuiles"; + case 772: + return "Petit rayon de souffle. Détruira tuiles"; + case 773: + return "Grand rayon d'explosion. Ne va pas détruire tuiles"; + case 774: + return "Grand rayon d'explosion. Détruira tuiles"; + case 775: + return "Augmente la vitesse en cours d'exécution"; + case 776: + return "Can mine de mithril et orichalque"; + case 777: + return "Peut mien adamantite et Titane"; + case 779: + return "Utilise solution colorée"; + case 780: + return "Les spreads de la pureté"; + case 781: + return "Spreads le Hallow"; + case 782: + return "Répand la corruption"; + case 783: + return "Spreads Champignons rougeoyants"; + case 784: + return "Spreads le Crimson"; + } + } + else + { + switch (l) + { + case 897: + return "12% ont augmenté la vitesse de mêlée"; + case 898: + return "Le porteur peut courir à une vitesse incroyable"; + default: + switch (l) + { + case 905: + return "Pièces de plus grande valeur font plus de dégâts"; + case 907: + return "Accorde l'immunité à des blocs d'incendie"; + case 908: + return "Accorde l'immunité à des blocs d'incendie et de 7 secondes d'immunité de lave"; + } + break; + } + } + } + else + { + if (l <= 938) + { + if (l == 929) + { + return "Pour une utilisation avec des canons"; + } + switch (l) + { + case 936: + return "10% de dégâts supplémentaires et la vitesse de mêlée"; + case 938: + return "Seulement actif au-dessus de 25% vie"; + } + } + else + { + if (l == 953) + { + return "Amélioration de la capacité si elle est combinée avec des pointes de chaussures"; + } + switch (l) + { + case 960: + return "3% ont augmenté magie chances de coup critique"; + case 961: + return "3% ont augmenté magie chances de coup critique"; + case 962: + return "3% ont augmenté magie chances de coup critique"; + } + } + } + } + } + else + { + if (l <= 1254) + { + if (l <= 1123) + { + if (l <= 984) + { + switch (l) + { + case 975: + return "Amélioration de la capacité si elle est combinée avec des griffes d'escalade"; + case 976: + break; + case 977: + return "Appuyez deux fois sur une direction"; + default: + switch (l) + { + case 982: + return "Augmente la vitesse de régénération de mana"; + case 983: + return "Augmente la hauteur de saut"; + case 984: + return "Donne une chance d'esquiver les attaques"; + } + break; + } + } + else + { + switch (l) + { + case 997: + return "'Pour utiliser: La place limon ou de neige fondante dans la extractinator'"; + case 998: + case 999: + case 1000: + break; + case 1001: + return "6% ont augmenté mêlée chances de coup critique"; + case 1002: + return "20% de chances de ne pas consommer de munitions"; + case 1003: + return "16% d'augmentation des dégâts magiques"; + case 1004: + return "7% ont augmenté les chances de coup critique"; + case 1005: + return "5% ont augmenté la vitesse de déplacement"; + default: + if (l == 1123) + { + return "Petite chance de causer de la confusion"; + } + break; + } + } + } + else + { + if (l <= 1167) + { + if (l == 1131) + { + return "Appuyez jusqu'à changer la gravité"; + } + switch (l) + { + case 1159: + return "Augmente les dégâts des familiers de 10%"; + case 1160: + return "Augmente les dégâts des familiers de 10%"; + case 1161: + return "Augmente les dégâts des familiers de 10%"; + case 1163: + return "Augmente la hauteur de saut"; + case 1164: + return "Augmente la hauteur de saut"; + case 1167: + return "Augmente l'arrière coup de vos serviteurs"; + } + } + else + { + switch (l) + { + case 1205: + return "12% ont augmenté la vitesse de mêlée"; + case 1206: + return "9% ont augmenté varié chances de coup critique"; + case 1207: + return "Augmente mana maximum de 60"; + case 1208: + return "2% ont augmenté les chances de coup critique"; + case 1209: + return "1% ont augmenté les chances de coup critique"; + case 1210: + return "7% ont augmenté mouvement et la vitesse de mêlée"; + case 1211: + return "8% a augmenté la vitesse de déplacement"; + case 1212: + return "Augmente mana maximum de 80"; + case 1213: + case 1214: + break; + case 1215: + return "8% ont augmenté la vitesse de mêlée"; + case 1216: + return "7% ont augmenté varié chances de coup critique"; + case 1217: + return "Augmente mana maximum de 100"; + case 1218: + return "3% ont augmenté les chances de coup critique"; + case 1219: + return "6% ont augmenté la vitesse de déplacement"; + default: + switch (l) + { + case 1249: + return "Libère les abeilles lorsqu'elles sont endommagées"; + case 1250: + return "Augmente la hauteur de saut et nie dégâts de chute"; + case 1251: + return "Augmente la hauteur de saut et nie dégâts de chute"; + case 1252: + return "Augmente la hauteur de saut et nie dégâts de chute"; + case 1254: + return "Faites un clic droit pour dézoomer"; + } + break; + } + } + } + } + else + { + if (l <= 1321) + { + if (l <= 1295) + { + switch (l) + { + case 1282: + return "Réduit la consommation de mana de 5%"; + case 1283: + return "Réduit la consommation de mana de 7%"; + case 1284: + return "Réduit la consommation de mana de 9%"; + case 1285: + return "Réduit la consommation de mana de 11%"; + case 1286: + return "Réduit la consommation de mana de 13%"; + case 1287: + return "Réduit la consommation de mana de 15%"; + default: + if (l == 1295) + { + return "'Oolaa!!'"; + } + break; + } + } + else + { + switch (l) + { + case 1300: + return "Faites un clic droit pour dézoomer"; + case 1301: + return "8% ont augmenté les chances de coup critique"; + default: + switch (l) + { + case 1316: + return "Les ennemis sont plus enclins à vous cibler"; + case 1317: + return "Les ennemis sont plus enclins à vous cibler"; + case 1318: + return "Les ennemis sont plus enclins à vous cibler"; + case 1321: + return "20% de chances de ne pas consommer les flèches"; + } + break; + } + } + } + else + { + if (l <= 1505) + { + switch (l) + { + case 1336: + return "Diminue la défense de la cible"; + case 1337: + case 1344: + case 1345: + case 1346: + case 1347: + case 1348: + break; + case 1338: + return "Pour une utilisation avec le lapin canon"; + case 1339: + return "'extrêmement toxique'"; + case 1340: + return "Melee attacks inflict venom on enemies"; + case 1341: + return "Inflige cible avec du venin"; + case 1342: + return "Inflige cible avec du venin"; + case 1343: + return "9% de dégâts de mêlée et de la vitesse"; + case 1349: + return "Explose en confettis sur l'impact"; + case 1350: + return "Provoque une confusion"; + case 1351: + return "Explose à l'impact"; + case 1352: + return "Ennemis tués tomberont plus d'argent"; + case 1353: + return "Les attaques de mêlée infligent des ennemis avec des flammes maudits"; + case 1354: + return "Les attaques de mêlée des ennemis mis le feu"; + case 1355: + return "Les attaques de mêlée rendent ennemis laissent tomber plus d'or"; + case 1356: + return "Les attaques de mêlée réduire la défense des ennemis"; + case 1357: + return "Les attaques de mêlée confondent ennemis"; + case 1358: + return "Les attaques de mêlée causent des confettis à comparaître"; + case 1359: + return "Attaques de mêlée des ennemis de poison"; + default: + switch (l) + { + case 1503: + return "10% d'augmentation des dégâts magiques et les chances de coup critique"; + case 1505: + return "8% a augmenté la vitesse de déplacement"; + } + break; + } + } + else + { + switch (l) + { + case 1546: + return "5% ont augmenté varié chances de coup critique"; + case 1547: + return "5% ont augmenté varié chances de coup critique"; + case 1548: + return "5% ont augmenté varié chances de coup critique"; + case 1549: + return "20% de chances de ne pas consommer de munitions"; + case 1550: + return "12% ont augmenté la vitesse de déplacement"; + case 1551: + case 1552: + break; + case 1553: + return "'Il venait de la frontière de l'espace'"; + default: + if (l == 1595) + { + return "Restaure mana lorsqu'il est endommagé"; + } + break; + } + } + } + } + } + } + else + { + if (Lang.lang == 5) + { + if (l <= 962) + { + if (l <= 686) + { + if (l <= 405) + { + if (l <= 98) + { + if (l == 65) + { + return "'Forjada por la furia del cielo'"; + } + if (l == 98) + { + return "'Mitad tiburón, mitad arma; realmente asombroso'"; + } + } + else + { + switch (l) + { + case 228: + return "Aumenta la probabilidad de ataque mágico crítico en un 3%"; + case 229: + return "Aumenta la probabilidad de ataque mágico crítico en un 3%"; + case 230: + return "Aumenta la probabilidad de ataque mágico crítico en un 3%"; + default: + switch (l) + { + case 371: + return "Aumenta la probabilidad de ataque mágico crítico en un 9%"; + case 372: + return "Aumenta un 12% la velocidad en el cuerpo a cuerpo"; + case 373: + return "Aumenta la probabilidad de ataque a distancia crítico en un 6%"; + case 374: + return "Aumenta la probabilidad de ataque crítico en un 3%"; + case 375: + return "Aumenta en un 10% la velocidad de movimiento"; + case 376: + return "Aumenta el daño mágico en un 15%"; + case 377: + return "Aumenta un 10% el daño en el cuerpo a cuerpo"; + case 378: + return "Aumenta la probabilidad de ataque a distancia crítico en un 7%"; + case 379: + return "Aumenta el daño en un 5%"; + case 380: + return "Aumenta la probabilidad de ataque crítico en un 3%"; + case 389: + return "'Busca en tu interior'"; + case 394: + return "Permite respirar bajo el agua mucho más tiempo"; + case 395: + return "Da la hora"; + case 396: + return "Ofrece inmunidad ante los bloques de fuego"; + case 397: + return "Ofrece inmunidad ante los bloques de fuego"; + case 399: + return "Aumenta la altura al saltar"; + case 400: + return "Aumenta la probabilidad de ataque crítico y daño mágico en un 11%"; + case 401: + return "Aumenta un 14% el daño en el cuerpo a cuerpo"; + case 402: + return "Aumenta la probabilidad de ataque a distancia crítico en un 8%"; + case 404: + return "Aumenta en un 5% la velocidad de movimiento"; + case 405: + return "Permite correr superrápido"; + } + break; + } + } + } + else + { + if (l <= 533) + { + if (l == 434) + { + return "Solo gasta munición el primer disparo"; + } + if (l == 533) + { + return "'El hermano mayor del minitiburón'"; + } + } + else + { + switch (l) + { + case 552: + return "Aumenta en un 8% la velocidad de movimiento"; + case 553: + return "Aumenta la probabilidad de ataque a distancia crítico en un 8%"; + case 554: + case 556: + case 557: + break; + case 555: + return "Usa de forma automática pociones de maná cuando se necesitan"; + case 558: + return "Aumenta la probabilidad de ataque crítico y daño mágico en un 12%"; + case 559: + return "Aumenta un 10% la anticipación en el cuerpo a cuerpo"; + default: + if (l == 686) + { + return "7% más de velocidad de ataque cuerpo a cuerpo"; + } + break; + } + } + } + } + else + { + if (l <= 908) + { + if (l <= 784) + { + if (l == 748) + { + return "Sostenga hasta cohete más rápido"; + } + switch (l) + { + case 771: + return "Pequeño radio de explosión. No la destruiré azulejos"; + case 772: + return "Pequeño radio de explosión. Destruirá azulejos"; + case 773: + return "Radio de la explosión grande. No la destruiré azulejos"; + case 774: + return "Radio de la explosión grande. Destruirá azulejos"; + case 775: + return "Aumenta la velocidad de carrera"; + case 776: + return "Puede mina Mythril y Orichalcum"; + case 777: + return "Puede mina adamantita y Titanio"; + case 779: + return "Utiliza solución de color"; + case 780: + return "Extiende la Pureza"; + case 781: + return "Extiende el Hallow"; + case 782: + return "Extiende la Corrupción"; + case 783: + return "Spreads Setas que brillan intensamente"; + case 784: + return "Extiende el carmesí"; + } + } + else + { + switch (l) + { + case 897: + return "12% más de velocidad de cuerpo a cuerpo"; + case 898: + return "El usuario puede correr muy rápido"; + default: + switch (l) + { + case 905: + return "Monedas de mayor valor hacen más daño"; + case 907: + return "Otorga inmunidad a los bloques de fuego"; + case 908: + return "Otorga inmunidad a los bloques de fuego y 7 segundos de inmunidad a la lava"; + } + break; + } + } + } + else + { + if (l <= 938) + { + if (l == 929) + { + return "Para el uso con el cañón"; + } + switch (l) + { + case 936: + return "10% más de daño y velocidad de cuerpo a cuerpo"; + case 938: + return "Sólo se activa por encima de la vida 25%"; + } + } + else + { + if (l == 953) + { + return "Mejora de la capacidad si se combina con picos de zapatos"; + } + switch (l) + { + case 960: + return "3% más de probabilidad de golpe crítico mágico"; + case 961: + return "3% más de probabilidad de golpe crítico mágico"; + case 962: + return "3% más de probabilidad de golpe crítico mágico"; + } + } + } + } + } + else + { + if (l <= 1254) + { + if (l <= 1123) + { + if (l <= 984) + { + switch (l) + { + case 975: + return "Mejora de la capacidad si se combina con Garras Escalada"; + case 976: + break; + case 977: + return "Doble toque en una dirección"; + default: + switch (l) + { + case 982: + return "Aumenta la tasa de regeneración de maná"; + case 983: + return "Aumenta la altura del salto"; + case 984: + return "Da la oportunidad de esquivar los ataques"; + } + break; + } + } + else + { + switch (l) + { + case 997: + return "'Modo de empleo: Colocar cieno o lodo en el extractinator'"; + case 998: + case 999: + case 1000: + break; + case 1001: + return "6% más de probabilidad de golpe crítico cuerpo a cuerpo"; + case 1002: + return "20% de probabilidad de no consumir municiones"; + case 1003: + return "16% más de daño mágico"; + case 1004: + return "7% más de probabilidad de golpe crítico"; + case 1005: + return "5% de aumento de la velocidad de movimiento"; + default: + if (l == 1123) + { + return "Pocas posibilidades de causar confusión"; + } + break; + } + } + } + else + { + if (l <= 1167) + { + if (l == 1131) + { + return "Pulse para cambiar la gravedad"; + } + switch (l) + { + case 1159: + return "Aumenta el daño minion en un 10%"; + case 1160: + return "Aumenta el daño minion en un 10%"; + case 1161: + return "Aumenta el daño minion en un 10%"; + case 1163: + return "Aumenta la altura del salto"; + case 1164: + return "Aumenta la altura del salto"; + case 1167: + return "Aumenta la parte posterior golpe de sus secuaces"; + } + } + else + { + switch (l) + { + case 1205: + return "12% más de velocidad de cuerpo a cuerpo"; + case 1206: + return "9% más de probabilidad de golpe crítico a distancia"; + case 1207: + return "Aumenta el maná máximo en un 60"; + case 1208: + return "2% increased critical strike chance"; + case 1209: + return "1% increased critical strike chance"; + case 1210: + return "7% increased movement and melee speed"; + case 1211: + return "8% increased movement speed"; + case 1212: + return "Aumenta el maná máximo en un 80"; + case 1213: + case 1214: + break; + case 1215: + return "8% increased melee speed"; + case 1216: + return "7% increased ranged critical strike chance"; + case 1217: + return "Aumenta el maná máximo en un 100"; + case 1218: + return "3% más de probabilidad de golpe crítico"; + case 1219: + return "6% de aumento de la velocidad de movimiento"; + default: + switch (l) + { + case 1249: + return "Libera las abejas cuando está dañado"; + case 1250: + return "Aumenta saltar altura y niega daño por caída"; + case 1251: + return "Aumenta saltar altura y niega daño por caída"; + case 1252: + return "Aumenta saltar altura y niega daño por caída"; + case 1254: + return "Haga clic derecho para alejar"; + } + break; + } + } + } + } + else + { + if (l <= 1321) + { + if (l <= 1295) + { + switch (l) + { + case 1282: + return "Reduce el uso de maná un 5%"; + case 1283: + return "Reduce el uso de maná un 7%"; + case 1284: + return "Reduce el uso de maná un 9%"; + case 1285: + return "Reduce el uso de maná un 11%"; + case 1286: + return "Reduce el uso de maná un 13%"; + case 1287: + return "Reduce el uso de maná un 15%"; + default: + if (l == 1295) + { + return "'Oolaa!!'"; + } + break; + } + } + else + { + switch (l) + { + case 1300: + return "Haga clic derecho para alejar"; + case 1301: + return "8% más de probabilidad de golpe crítico"; + default: + switch (l) + { + case 1316: + return "Los enemigos son más propensos a que se dirige"; + case 1317: + return "Los enemigos son más propensos a que se dirige"; + case 1318: + return "Los enemigos son más propensos a que se dirige"; + case 1321: + return "20% de probabilidad de no consumir flechas"; + } + break; + } + } + } + else + { + if (l <= 1505) + { + switch (l) + { + case 1336: + return "Disminuye la defensa del objetivo"; + case 1337: + case 1344: + case 1345: + case 1346: + case 1347: + case 1348: + break; + case 1338: + return "Para el uso con el conejito de cañón"; + case 1339: + return "'Extremadamente tóxico'"; + case 1340: + return "Ataques cuerpo a cuerpo infligen veneno a los enemigos"; + case 1341: + return "Inflige objetivo con veneno"; + case 1342: + return "Inflige objetivo con veneno"; + case 1343: + return "9% más de daño cuerpo a cuerpo y la velocidad"; + case 1349: + return "Se descompone en confeti sobre el impacto"; + case 1350: + return "provoca confusión"; + case 1351: + return "Explota por impacto"; + case 1352: + return "Enemigos muertos caerán más dinero"; + case 1353: + return "Ataques cuerpo a cuerpo infligen los enemigos con llamas malditos"; + case 1354: + return "Ataques cuerpo a cuerpo establecen enemigos en llamas"; + case 1355: + return "Ataques cuerpo a cuerpo hacen enemigos caen más oro"; + case 1356: + return "Ataques cuerpo a cuerpo disminuyen defensa enemigos"; + case 1357: + return "Ataques cuerpo a cuerpo confunde enemigos"; + case 1358: + return "Ataques cuerpo a cuerpo infligen confetti que aparezca"; + case 1359: + return "Cuerpo a cuerpo ataca a los enemigos de veneno"; + default: + switch (l) + { + case 1503: + return "10% más de daño mágico y la probabilidad de golpe crítico"; + case 1505: + return "8% de aumento de la velocidad de movimiento"; + } + break; + } + } + else + { + switch (l) + { + case 1546: + return "5% más de probabilidad de golpe crítico a distancia"; + case 1547: + return "5% más de probabilidad de golpe crítico a distancia"; + case 1548: + return "5% más de probabilidad de golpe crítico a distancia"; + case 1549: + return "20% de probabilidad de no consumir municiones"; + case 1550: + return "12% de aumento de la velocidad de movimiento"; + case 1551: + case 1552: + break; + case 1553: + return "'Venía del borde del espacio'"; + default: + if (l == 1595) + { + return "Restaura mana cuando está dañado"; + } + break; + } + } + } + } + } + } + } + } + } + } + if (!english && Lang.lang > 1) + { + return Lang.toolTip2(l, true); + } + return ""; + } + public static string itemName(int l, bool english = false) + { + if (Lang.lang <= 1 || english) + { + switch (l) + { + case -48: + return "Platinum Bow"; + case -47: + return "Platinum Hammer"; + case -46: + return "Platinum Axe"; + case -45: + return "Platinum Shortsword"; + case -44: + return "Platinum Broadsword"; + case -43: + return "Platinum Pickaxe"; + case -42: + return "Tungsten Bow"; + case -41: + return "Tungsten Hammer"; + case -40: + return "Tungsten Axe"; + case -39: + return "Tungsten Shortsword"; + case -38: + return "Tungsten Broadsword"; + case -37: + return "Tungsten Pickaxe"; + case -36: + return "Lead Bow"; + case -35: + return "Lead Hammer"; + case -34: + return "Lead Axe"; + case -33: + return "Lead Shortsword"; + case -32: + return "Lead Broadsword"; + case -31: + return "Lead Pickaxe"; + case -30: + return "Tin Bow"; + case -29: + return "Tin Hammer"; + case -28: + return "Tin Axe"; + case -27: + return "Tin Shortsword"; + case -26: + return "Tin Broadsword"; + case -25: + return "Tin Pickaxe"; + case -24: + return "Yellow Phasesaber"; + case -23: + return "White Phasesaber"; + case -22: + return "Purple Phasesaber"; + case -21: + return "Green Phasesaber"; + case -20: + return "Red Phasesaber"; + case -19: + return "Blue Phasesaber"; + case -18: + return "Copper Bow"; + case -17: + return "Copper Hammer"; + case -16: + return "Copper Axe"; + case -15: + return "Copper Shortsword"; + case -14: + return "Copper Broadsword"; + case -13: + return "Copper Pickaxe"; + case -12: + return "Silver Bow"; + case -11: + return "Silver Hammer"; + case -10: + return "Silver Axe"; + case -9: + return "Silver Shortsword"; + case -8: + return "Silver Broadsword"; + case -7: + return "Silver Pickaxe"; + case -6: + return "Gold Bow"; + case -5: + return "Gold Hammer"; + case -4: + return "Gold Axe"; + case -3: + return "Gold Shortsword"; + case -2: + return "Gold Broadsword"; + case -1: + return "Gold Pickaxe"; + case 1: + return "Iron Pickaxe"; + case 2: + return "Dirt Block"; + case 3: + return "Stone Block"; + case 4: + return "Iron Broadsword"; + case 5: + return "Mushroom"; + case 6: + return "Iron Shortsword"; + case 7: + return "Iron Hammer"; + case 8: + return "Torch"; + case 9: + return "Wood"; + case 10: + return "Iron Axe"; + case 11: + return "Iron Ore"; + case 12: + return "Copper Ore"; + case 13: + return "Gold Ore"; + case 14: + return "Silver Ore"; + case 15: + return "Copper Watch"; + case 16: + return "Silver Watch"; + case 17: + return "Gold Watch"; + case 18: + return "Depth Meter"; + case 19: + return "Gold Bar"; + case 20: + return "Copper Bar"; + case 21: + return "Silver Bar"; + case 22: + return "Iron Bar"; + case 23: + return "Gel"; + case 24: + return "Wooden Sword"; + case 25: + return "Wooden Door"; + case 26: + return "Stone Wall"; + case 27: + return "Acorn"; + case 28: + return "Lesser Healing Potion"; + case 29: + return "Life Crystal"; + case 30: + return "Dirt Wall"; + case 31: + return "Bottle"; + case 32: + return "Wooden Table"; + case 33: + return "Furnace"; + case 34: + return "Wooden Chair"; + case 35: + return "Iron Anvil"; + case 36: + return "Work Bench"; + case 37: + return "Goggles"; + case 38: + return "Lens"; + case 39: + return "Wooden Bow"; + case 40: + return "Wooden Arrow"; + case 41: + return "Flaming Arrow"; + case 42: + return "Shuriken"; + case 43: + return "Suspicious Looking Eye"; + case 44: + return "Demon Bow"; + case 45: + return "War Axe of the Night"; + case 46: + return "Light's Bane"; + case 47: + return "Unholy Arrow"; + case 48: + return "Chest"; + case 49: + return "Band of Regeneration"; + case 50: + return "Magic Mirror"; + case 51: + return "Jester's Arrow"; + case 52: + return "Angel Statue"; + case 53: + return "Cloud in a Bottle"; + case 54: + return "Hermes Boots"; + case 55: + return "Enchanted Boomerang"; + case 56: + return "Demonite Ore"; + case 57: + return "Demonite Bar"; + case 58: + return "Heart"; + case 59: + return "Corrupt Seeds"; + case 60: + return "Vile Mushroom"; + case 61: + return "Ebonstone Block"; + case 62: + return "Grass Seeds"; + case 63: + return "Sunflower"; + case 64: + return "Vilethorn"; + case 65: + return "Starfury"; + case 66: + return "Purification Powder"; + case 67: + return "Vile Powder"; + case 68: + return "Rotten Chunk"; + case 69: + return "Worm Tooth"; + case 70: + return "Worm Food"; + case 71: + return "Copper Coin"; + case 72: + return "Silver Coin"; + case 73: + return "Gold Coin"; + case 74: + return "Platinum Coin"; + case 75: + return "Fallen Star"; + case 76: + return "Copper Greaves"; + case 77: + return "Iron Greaves"; + case 78: + return "Silver Greaves"; + case 79: + return "Gold Greaves"; + case 80: + return "Copper Chainmail"; + case 81: + return "Iron Chainmail"; + case 82: + return "Silver Chainmail"; + case 83: + return "Gold Chainmail"; + case 84: + return "Grappling Hook"; + case 85: + return "Chain"; + case 86: + return "Shadow Scale"; + case 87: + return "Piggy Bank"; + case 88: + return "Mining Helmet"; + case 89: + return "Copper Helmet"; + case 90: + return "Iron Helmet"; + case 91: + return "Silver Helmet"; + case 92: + return "Gold Helmet"; + case 93: + return "Wood Wall"; + case 94: + return "Wood Platform"; + case 95: + return "Flintlock Pistol"; + case 96: + return "Musket"; + case 97: + return "Musket Ball"; + case 98: + return "Minishark"; + case 99: + return "Iron Bow"; + case 100: + return "Shadow Greaves"; + case 101: + return "Shadow Scalemail"; + case 102: + return "Shadow Helmet"; + case 103: + return "Nightmare Pickaxe"; + case 104: + return "The Breaker"; + case 105: + return "Candle"; + case 106: + return "Copper Chandelier"; + case 107: + return "Silver Chandelier"; + case 108: + return "Gold Chandelier"; + case 109: + return "Mana Crystal"; + case 110: + return "Lesser Mana Potion"; + case 111: + return "Band of Starpower"; + case 112: + return "Flower of Fire"; + case 113: + return "Magic Missile"; + case 114: + return "Dirt Rod"; + case 115: + return "Shadow Orb"; + case 116: + return "Meteorite"; + case 117: + return "Meteorite Bar"; + case 118: + return "Hook"; + case 119: + return "Flamarang"; + case 120: + return "Molten Fury"; + case 121: + return "Fiery Greatsword"; + case 122: + return "Molten Pickaxe"; + case 123: + return "Meteor Helmet"; + case 124: + return "Meteor Suit"; + case 125: + return "Meteor Leggings"; + case 126: + return "Bottled Water"; + case 127: + return "Space Gun"; + case 128: + return "Rocket Boots"; + case 129: + return "Gray Brick"; + case 130: + return "Gray Brick Wall"; + case 131: + return "Red Brick"; + case 132: + return "Red Brick Wall"; + case 133: + return "Clay Block"; + case 134: + return "Blue Brick"; + case 135: + return "Blue Brick Wall"; + case 136: + return "Chain Lantern"; + case 137: + return "Green Brick"; + case 138: + return "Green Brick Wall"; + case 139: + return "Pink Brick"; + case 140: + return "Pink Brick Wall"; + case 141: + return "Gold Brick"; + case 142: + return "Gold Brick Wall"; + case 143: + return "Silver Brick"; + case 144: + return "Silver Brick Wall"; + case 145: + return "Copper Brick"; + case 146: + return "Copper Brick Wall"; + case 147: + return "Spike"; + case 148: + return "Water Candle"; + case 149: + return "Book"; + case 150: + return "Cobweb"; + case 151: + return "Necro Helmet"; + case 152: + return "Necro Breastplate"; + case 153: + return "Necro Greaves"; + case 154: + return "Bone"; + case 155: + return "Muramasa"; + case 156: + return "Cobalt Shield"; + case 157: + return "Aqua Scepter"; + case 158: + return "Lucky Horseshoe"; + case 159: + return "Shiny Red Balloon"; + case 160: + return "Harpoon"; + case 161: + return "Spiky Ball"; + case 162: + return "Ball O' Hurt"; + case 163: + return "Blue Moon"; + case 164: + return "Handgun"; + case 165: + return "Water Bolt"; + case 166: + return "Bomb"; + case 167: + return "Dynamite"; + case 168: + return "Grenade"; + case 169: + return "Sand Block"; + case 170: + return "Glass"; + case 171: + return "Sign"; + case 172: + return "Ash Block"; + case 173: + return "Obsidian"; + case 174: + return "Hellstone"; + case 175: + return "Hellstone Bar"; + case 176: + return "Mud Block"; + case 177: + return "Sapphire"; + case 178: + return "Ruby"; + case 179: + return "Emerald"; + case 180: + return "Topaz"; + case 181: + return "Amethyst"; + case 182: + return "Diamond"; + case 183: + return "Glowing Mushroom"; + case 184: + return "Star"; + case 185: + return "Ivy Whip"; + case 186: + return "Breathing Reed"; + case 187: + return "Flipper"; + case 188: + return "Healing Potion"; + case 189: + return "Mana Potion"; + case 190: + return "Blade of Grass"; + case 191: + return "Thorn Chakram"; + case 192: + return "Obsidian Brick"; + case 193: + return "Obsidian Skull"; + case 194: + return "Mushroom Grass Seeds"; + case 195: + return "Jungle Grass Seeds"; + case 196: + return "Wooden Hammer"; + case 197: + return "Star Cannon"; + case 198: + return "Blue Phaseblade"; + case 199: + return "Red Phaseblade"; + case 200: + return "Green Phaseblade"; + case 201: + return "Purple Phaseblade"; + case 202: + return "White Phaseblade"; + case 203: + return "Yellow Phaseblade"; + case 204: + return "Meteor Hamaxe"; + case 205: + return "Empty Bucket"; + case 206: + return "Water Bucket"; + case 207: + return "Lava Bucket"; + case 208: + return "Jungle Rose"; + case 209: + return "Stinger"; + case 210: + return "Vine"; + case 211: + return "Feral Claws"; + case 212: + return "Anklet of the Wind"; + case 213: + return "Staff of Regrowth"; + case 214: + return "Hellstone Brick"; + case 215: + return "Whoopie Cushion"; + case 216: + return "Shackle"; + case 217: + return "Molten Hamaxe"; + case 218: + return "Flamelash"; + case 219: + return "Phoenix Blaster"; + case 220: + return "Sunfury"; + case 221: + return "Hellforge"; + case 222: + return "Clay Pot"; + case 223: + return "Nature's Gift"; + case 224: + return "Bed"; + case 225: + return "Silk"; + case 226: + return "Lesser Restoration Potion"; + case 227: + return "Restoration Potion"; + case 228: + return "Jungle Hat"; + case 229: + return "Jungle Shirt"; + case 230: + return "Jungle Pants"; + case 231: + return "Molten Helmet"; + case 232: + return "Molten Breastplate"; + case 233: + return "Molten Greaves"; + case 234: + return "Meteor Shot"; + case 235: + return "Sticky Bomb"; + case 236: + return "Black Lens"; + case 237: + return "Sunglasses"; + case 238: + return "Wizard Hat"; + case 239: + return "Top Hat"; + case 240: + return "Tuxedo Shirt"; + case 241: + return "Tuxedo Pants"; + case 242: + return "Summer Hat"; + case 243: + return "Bunny Hood"; + case 244: + return "Plumber's Hat"; + case 245: + return "Plumber's Shirt"; + case 246: + return "Plumber's Pants"; + case 247: + return "Hero's Hat"; + case 248: + return "Hero's Shirt"; + case 249: + return "Hero's Pants"; + case 250: + return "Fish Bowl"; + case 251: + return "Archaeologist's Hat"; + case 252: + return "Archaeologist's Jacket"; + case 253: + return "Archaeologist's Pants"; + case 254: + return "Black Thread"; + case 255: + return "Green Thread"; + case 256: + return "Ninja Hood"; + case 257: + return "Ninja Shirt"; + case 258: + return "Ninja Pants"; + case 259: + return "Leather"; + case 260: + return "Red Hat"; + case 261: + return "Goldfish"; + case 262: + return "Robe"; + case 263: + return "Robot Hat"; + case 264: + return "Gold Crown"; + case 265: + return "Hellfire Arrow"; + case 266: + return "Sandgun"; + case 267: + return "Guide Voodoo Doll"; + case 268: + return "Diving Helmet"; + case 269: + return "Familiar Shirt"; + case 270: + return "Familiar Pants"; + case 271: + return "Familiar Wig"; + case 272: + return "Demon Scythe"; + case 273: + return "Night's Edge"; + case 274: + return "Dark Lance"; + case 275: + return "Coral"; + case 276: + return "Cactus"; + case 277: + return "Trident"; + case 278: + return "Silver Bullet"; + case 279: + return "Throwing Knife"; + case 280: + return "Spear"; + case 281: + return "Blowpipe"; + case 282: + return "Glowstick"; + case 283: + return "Seed"; + case 284: + return "Wooden Boomerang"; + case 285: + return "Aglet"; + case 286: + return "Sticky Glowstick"; + case 287: + return "Poisoned Knife"; + case 288: + return "Obsidian Skin Potion"; + case 289: + return "Regeneration Potion"; + case 290: + return "Swiftness Potion"; + case 291: + return "Gills Potion"; + case 292: + return "Ironskin Potion"; + case 293: + return "Mana Regeneration Potion"; + case 294: + return "Magic Power Potion"; + case 295: + return "Featherfall Potion"; + case 296: + return "Spelunker Potion"; + case 297: + return "Invisibility Potion"; + case 298: + return "Shine Potion"; + case 299: + return "Night Owl Potion"; + case 300: + return "Battle Potion"; + case 301: + return "Thorns Potion"; + case 302: + return "Water Walking Potion"; + case 303: + return "Archery Potion"; + case 304: + return "Hunter Potion"; + case 305: + return "Gravitation Potion"; + case 306: + return "Gold Chest"; + case 307: + return "Daybloom Seeds"; + case 308: + return "Moonglow Seeds"; + case 309: + return "Blinkroot Seeds"; + case 310: + return "Deathweed Seeds"; + case 311: + return "Waterleaf Seeds"; + case 312: + return "Fireblossom Seeds"; + case 313: + return "Daybloom"; + case 314: + return "Moonglow"; + case 315: + return "Blinkroot"; + case 316: + return "Deathweed"; + case 317: + return "Waterleaf"; + case 318: + return "Fireblossom"; + case 319: + return "Shark Fin"; + case 320: + return "Feather"; + case 321: + return "Tombstone"; + case 322: + return "Mime Mask"; + case 323: + return "Antlion Mandible"; + case 324: + return "Illegal Gun Parts"; + case 325: + return "The Doctor's Shirt"; + case 326: + return "The Doctor's Pants"; + case 327: + return "Golden Key"; + case 328: + return "Shadow Chest"; + case 329: + return "Shadow Key"; + case 330: + return "Obsidian Brick Wall"; + case 331: + return "Jungle Spores"; + case 332: + return "Loom"; + case 333: + return "Piano"; + case 334: + return "Dresser"; + case 335: + return "Bench"; + case 336: + return "Bathtub"; + case 337: + return "Red Banner"; + case 338: + return "Green Banner"; + case 339: + return "Blue Banner"; + case 340: + return "Yellow Banner"; + case 341: + return "Lamp Post"; + case 342: + return "Tiki Torch"; + case 343: + return "Barrel"; + case 344: + return "Chinese Lantern"; + case 345: + return "Cooking Pot"; + case 346: + return "Safe"; + case 347: + return "Skull Lantern"; + case 348: + return "Trash Can"; + case 349: + return "Candelabra"; + case 350: + return "Pink Vase"; + case 351: + return "Mug"; + case 352: + return "Keg"; + case 353: + return "Ale"; + case 354: + return "Bookcase"; + case 355: + return "Throne"; + case 356: + return "Bowl"; + case 357: + return "Bowl of Soup"; + case 358: + return "Toilet"; + case 359: + return "Grandfather Clock"; + case 360: + return "Armor Statue"; + case 361: + return "Goblin Battle Standard"; + case 362: + return "Tattered Cloth"; + case 363: + return "Sawmill"; + case 364: + return "Cobalt Ore"; + case 365: + return "Mythril Ore"; + case 366: + return "Adamantite Ore"; + case 367: + return "Pwnhammer"; + case 368: + return "Excalibur"; + case 369: + return "Hallowed Seeds"; + case 370: + return "Ebonsand Block"; + case 371: + return "Cobalt Hat"; + case 372: + return "Cobalt Helmet"; + case 373: + return "Cobalt Mask"; + case 374: + return "Cobalt Breastplate"; + case 375: + return "Cobalt Leggings"; + case 376: + return "Mythril Hood"; + case 377: + return "Mythril Helmet"; + case 378: + return "Mythril Hat"; + case 379: + return "Mythril Chainmail"; + case 380: + return "Mythril Greaves"; + case 381: + return "Cobalt Bar"; + case 382: + return "Mythril Bar"; + case 383: + return "Cobalt Chainsaw"; + case 384: + return "Mythril Chainsaw"; + case 385: + return "Cobalt Drill"; + case 386: + return "Mythril Drill"; + case 387: + return "Adamantite Chainsaw"; + case 388: + return "Adamantite Drill"; + case 389: + return "Dao of Pow"; + case 390: + return "Mythril Halberd"; + case 391: + return "Adamantite Bar"; + case 392: + return "Glass Wall"; + case 393: + return "Compass"; + case 394: + return "Diving Gear"; + case 395: + return "GPS"; + case 396: + return "Obsidian Horseshoe"; + case 397: + return "Obsidian Shield"; + case 398: + return "Tinkerer's Workshop"; + case 399: + return "Cloud in a Balloon"; + case 400: + return "Adamantite Headgear"; + case 401: + return "Adamantite Helmet"; + case 402: + return "Adamantite Mask"; + case 403: + return "Adamantite Breastplate"; + case 404: + return "Adamantite Leggings"; + case 405: + return "Spectre Boots"; + case 406: + return "Adamantite Glaive"; + case 407: + return "Toolbelt"; + case 408: + return "Pearlsand Block"; + case 409: + return "Pearlstone Block"; + case 410: + return "Mining Shirt"; + case 411: + return "Mining Pants"; + case 412: + return "Pearlstone Brick"; + case 413: + return "Iridescent Brick"; + case 414: + return "Mudstone Block"; + case 415: + return "Cobalt Brick"; + case 416: + return "Mythril Brick"; + case 417: + return "Pearlstone Brick Wall"; + case 418: + return "Iridescent Brick Wall"; + case 419: + return "Mudstone Brick Wall"; + case 420: + return "Cobalt Brick Wall"; + case 421: + return "Mythril Brick Wall"; + case 422: + return "Holy Water"; + case 423: + return "Unholy Water"; + case 424: + return "Silt Block"; + case 425: + return "Fairy Bell"; + case 426: + return "Breaker Blade"; + case 427: + return "Blue Torch"; + case 428: + return "Red Torch"; + case 429: + return "Green Torch"; + case 430: + return "Purple Torch"; + case 431: + return "White Torch"; + case 432: + return "Yellow Torch"; + case 433: + return "Demon Torch"; + case 434: + return "Clockwork Assault Rifle"; + case 435: + return "Cobalt Repeater"; + case 436: + return "Mythril Repeater"; + case 437: + return "Dual Hook"; + case 438: + return "Star Statue"; + case 439: + return "Sword Statue"; + case 440: + return "Slime Statue"; + case 441: + return "Goblin Statue"; + case 442: + return "Shield Statue"; + case 443: + return "Bat Statue"; + case 444: + return "Fish Statue"; + case 445: + return "Bunny Statue"; + case 446: + return "Skeleton Statue"; + case 447: + return "Reaper Statue"; + case 448: + return "Woman Statue"; + case 449: + return "Imp Statue"; + case 450: + return "Gargoyle Statue"; + case 451: + return "Gloom Statue"; + case 452: + return "Hornet Statue"; + case 453: + return "Bomb Statue"; + case 454: + return "Crab Statue"; + case 455: + return "Hammer Statue"; + case 456: + return "Potion Statue"; + case 457: + return "Spear Statue"; + case 458: + return "Cross Statue"; + case 459: + return "Jellyfish Statue"; + case 460: + return "Bow Statue"; + case 461: + return "Boomerang Statue"; + case 462: + return "Boot Statue"; + case 463: + return "Chest Statue"; + case 464: + return "Bird Statue"; + case 465: + return "Axe Statue"; + case 466: + return "Corrupt Statue"; + case 467: + return "Tree Statue"; + case 468: + return "Anvil Statue"; + case 469: + return "Pickaxe Statue"; + case 470: + return "Mushroom Statue"; + case 471: + return "Eyeball Statue"; + case 472: + return "Pillar Statue"; + case 473: + return "Heart Statue"; + case 474: + return "Pot Statue"; + case 475: + return "Sunflower Statue"; + case 476: + return "King Statue"; + case 477: + return "Queen Statue"; + case 478: + return "Piranha Statue"; + case 479: + return "Planked Wall"; + case 480: + return "Wooden Beam"; + case 481: + return "Adamantite Repeater"; + case 482: + return "Adamantite Sword"; + case 483: + return "Cobalt Sword"; + case 484: + return "Mythril Sword"; + case 485: + return "Moon Charm"; + case 486: + return "Ruler"; + case 487: + return "Crystal Ball"; + case 488: + return "Disco Ball"; + case 489: + return "Sorcerer Emblem"; + case 490: + return "Warrior Emblem"; + case 491: + return "Ranger Emblem"; + case 492: + return "Demon Wings"; + case 493: + return "Angel Wings"; + case 494: + return "Magical Harp"; + case 495: + return "Rainbow Rod"; + case 496: + return "Ice Rod"; + case 497: + return "Neptune's Shell"; + case 498: + return "Mannequin"; + case 499: + return "Greater Healing Potion"; + case 500: + return "Greater Mana Potion"; + case 501: + return "Pixie Dust"; + case 502: + return "Crystal Shard"; + case 503: + return "Clown Hat"; + case 504: + return "Clown Shirt"; + case 505: + return "Clown Pants"; + case 506: + return "Flamethrower"; + case 507: + return "Bell"; + case 508: + return "Harp"; + case 509: + return "Wrench"; + case 510: + return "Wire Cutter"; + case 511: + return "Active Stone Block"; + case 512: + return "Inactive Stone Block"; + case 513: + return "Lever"; + case 514: + return "Laser Rifle"; + case 515: + return "Crystal Bullet"; + case 516: + return "Holy Arrow"; + case 517: + return "Magic Dagger"; + case 518: + return "Crystal Storm"; + case 519: + return "Cursed Flames"; + case 520: + return "Soul of Light"; + case 521: + return "Soul of Night"; + case 522: + return "Cursed Flame"; + case 523: + return "Cursed Torch"; + case 524: + return "Adamantite Forge"; + case 525: + return "Mythril Anvil"; + case 526: + return "Unicorn Horn"; + case 527: + return "Dark Shard"; + case 528: + return "Light Shard"; + case 529: + return "Red Pressure Plate"; + case 530: + return "Wire"; + case 531: + return "Spell Tome"; + case 532: + return "Star Cloak"; + case 533: + return "Megashark"; + case 534: + return "Shotgun"; + case 535: + return "Philosopher's Stone"; + case 536: + return "Titan Glove"; + case 537: + return "Cobalt Naginata"; + case 538: + return "Switch"; + case 539: + return "Dart Trap"; + case 540: + return "Boulder"; + case 541: + return "Green Pressure Plate"; + case 542: + return "Gray Pressure Plate"; + case 543: + return "Brown Pressure Plate"; + case 544: + return "Mechanical Eye"; + case 545: + return "Cursed Arrow"; + case 546: + return "Cursed Bullet"; + case 547: + return "Soul of Fright"; + case 548: + return "Soul of Might"; + case 549: + return "Soul of Sight"; + case 550: + return "Gungnir"; + case 551: + return "Hallowed Plate Mail"; + case 552: + return "Hallowed Greaves"; + case 553: + return "Hallowed Helmet"; + case 554: + return "Cross Necklace"; + case 555: + return "Mana Flower"; + case 556: + return "Mechanical Worm"; + case 557: + return "Mechanical Skull"; + case 558: + return "Hallowed Headgear"; + case 559: + return "Hallowed Mask"; + case 560: + return "Slime Crown"; + case 561: + return "Light Disc"; + case 562: + return "Music Box (Overworld Day)"; + case 563: + return "Music Box (Eerie)"; + case 564: + return "Music Box (Night)"; + case 565: + return "Music Box (Title)"; + case 566: + return "Music Box (Underground)"; + case 567: + return "Music Box (Boss 1)"; + case 568: + return "Music Box (Jungle)"; + case 569: + return "Music Box (Corruption)"; + case 570: + return "Music Box (Underground Corruption)"; + case 571: + return "Music Box (The Hallow)"; + case 572: + return "Music Box (Boss 2)"; + case 573: + return "Music Box (Underground Hallow)"; + case 574: + return "Music Box (Boss 3)"; + case 575: + return "Soul of Flight"; + case 576: + return "Music Box"; + case 577: + return "Demonite Brick"; + case 578: + return "Hallowed Repeater"; + case 579: + return "Drax"; + case 580: + return "Explosives"; + case 581: + return "Inlet Pump"; + case 582: + return "Outlet Pump"; + case 583: + return "1 Second Timer"; + case 584: + return "3 Second Timer"; + case 585: + return "5 Second Timer"; + case 586: + return "Candy Cane Block"; + case 587: + return "Candy Cane Wall"; + case 588: + return "Santa Hat"; + case 589: + return "Santa Shirt"; + case 590: + return "Santa Pants"; + case 591: + return "Green Candy Cane Block"; + case 592: + return "Green Candy Cane Wall"; + case 593: + return "Snow Block"; + case 594: + return "Snow Brick"; + case 595: + return "Snow Brick Wall"; + case 596: + return "Blue Light"; + case 597: + return "Red Light"; + case 598: + return "Green Light"; + case 599: + return "Blue Present"; + case 600: + return "Green Present"; + case 601: + return "Yellow Present"; + case 602: + return "Snow Globe"; + case 603: + return "Carrot"; + case 604: + return "Adamantite Beam"; + case 605: + return "Adamantite Beam Wall"; + case 606: + return "Demonite Brick Wall"; + case 607: + return "Sandstone Brick"; + case 608: + return "Sandstone Brick Wall"; + case 609: + return "Ebonstone Brick"; + case 610: + return "Ebonstone Brick Wall"; + case 611: + return "Red Stucco"; + case 612: + return "Yellow Stucco"; + case 613: + return "Green Stucco"; + case 614: + return "Gray Stucco"; + case 615: + return "Red Stucco Wall"; + case 616: + return "Yellow Stucco Wall"; + case 617: + return "Green Stucco Wall"; + case 618: + return "Gray Stucco Wall"; + case 619: + return "Ebonwood"; + case 620: + return "Rich Mahogany"; + case 621: + return "Pearlwood"; + case 622: + return "Ebonwood Wall"; + case 623: + return "Rich Mahogany Wall"; + case 624: + return "Pearlwood Wall"; + case 625: + return "Ebonwood Chest"; + case 626: + return "Rich Mahogany Chest"; + case 627: + return "Pearlwood Chest"; + case 628: + return "Ebonwood Chair"; + case 629: + return "Rich Mahogany Chair"; + case 630: + return "Pearlwood Chair"; + case 631: + return "Ebonwood Platform"; + case 632: + return "Rich Mahogany Platform"; + case 633: + return "Pearlwood Platform"; + case 634: + return "Bone Platform"; + case 635: + return "Ebonwood Work Bench"; + case 636: + return "Rich Mahogany Work Bench"; + case 637: + return "Pearlwood Work Bench"; + case 638: + return "Ebonwood Table"; + case 639: + return "Rich Mahogany Table"; + case 640: + return "Pearlwood Table"; + case 641: + return "Ebonwood Piano"; + case 642: + return "Rich Mahogany Piano"; + case 643: + return "Pearlwood Piano"; + case 644: + return "Ebonwood Bed"; + case 645: + return "Rich Mahogany Bed"; + case 646: + return "Pearlwood Bed"; + case 647: + return "Ebonwood Dresser"; + case 648: + return "Rich Mahogany Dresser"; + case 649: + return "Pearlwood Dresser"; + case 650: + return "Ebonwood Door"; + case 651: + return "Rich Mahogany Door"; + case 652: + return "Pearlwood Door"; + case 653: + return "Ebonwood Sword"; + case 654: + return "Ebonwood Hammer"; + case 655: + return "Ebonwood Bow"; + case 656: + return "Rich Mahogany Sword"; + case 657: + return "Rich Mahogany Hammer"; + case 658: + return "Rich Mahogany Bow"; + case 659: + return "Pearlwood Sword"; + case 660: + return "Pearlwood Hammer"; + case 661: + return "Pearlwood Bow"; + case 662: + return "Rainbow Brick"; + case 663: + return "Rainbow Brick Wall"; + case 664: + return "Ice Block"; + case 665: + return "Red's Wings"; + case 666: + return "Red's Helmet"; + case 667: + return "Red's Breastplate"; + case 668: + return "Red's Leggings"; + case 669: + return "Fish"; + case 670: + return "Ice Boomerang"; + case 671: + return "Keybrand"; + case 672: + return "Cutlass"; + case 673: + return "Icemourne"; + case 674: + return "True Excalibur"; + case 675: + return "True Night's Edge"; + case 676: + return "Frostbrand"; + case 677: + return "Scythe"; + case 678: + return "Soul Scythe"; + case 679: + return "Tactical Shotgun"; + case 680: + return "Ivy Chest"; + case 681: + return "Ice Chest"; + case 682: + return "Marrow"; + case 683: + return "Unholy Trident"; + case 684: + return "Frost Helmet"; + case 685: + return "Frost Breastplate"; + case 686: + return "Frost Leggings"; + case 687: + return "Tin Helmet"; + case 688: + return "Tin Chainmail"; + case 689: + return "Tin Greaves"; + case 690: + return "Lead Helmet"; + case 691: + return "Lead Chainmail"; + case 692: + return "Lead Greaves"; + case 693: + return "Tungsten Helmet"; + case 694: + return "Tungsten Chainmail"; + case 695: + return "Tungsten Greaves"; + case 696: + return "Platinum Helmet"; + case 697: + return "Platinum Chainmail"; + case 698: + return "Platinum Greaves"; + case 699: + return "Tin Ore"; + case 700: + return "Lead Ore"; + case 701: + return "Tungsten Ore"; + case 702: + return "Platinum Ore"; + case 703: + return "Tin Bar"; + case 704: + return "Lead Bar"; + case 705: + return "Tungsten Bar"; + case 706: + return "Platinum Bar"; + case 707: + return "Tin Watch"; + case 708: + return "Tungsten Watch"; + case 709: + return "Platinum Watch"; + case 710: + return "Tin Chandelier"; + case 711: + return "Tungsten Chandelier"; + case 712: + return "Platinum Chandelier"; + case 713: + return "Platinum Candle"; + case 714: + return "Platinum Candelabra"; + case 715: + return "Platinum Crown"; + case 716: + return "Lead Anvil"; + case 717: + return "Tin Brick"; + case 718: + return "Tungsten Brick"; + case 719: + return "Platinum Brick"; + case 720: + return "Tin Brick Wall"; + case 721: + return "Tungsten Brick Wall"; + case 722: + return "Platinum Brick Wall"; + case 723: + return "Beam Sword"; + case 724: + return "Ice Blade"; + case 725: + return "Ice Bow"; + case 726: + return "Frost Staff"; + case 727: + return "Wood Helmet"; + case 728: + return "Wood Breastplate"; + case 729: + return "Wood Greaves"; + case 730: + return "Ebonwood Helmet"; + case 731: + return "Ebonwood Breastplate"; + case 732: + return "Ebonwood Greaves"; + case 733: + return "Rich Mahogany Helmet"; + case 734: + return "Rich Mahogany Breastplate"; + case 735: + return "Rich Mahogany Greaves"; + case 736: + return "Pearlwood Helmet"; + case 737: + return "Pearlwood Breastplate"; + case 738: + return "Pearlwood Greaves"; + case 739: + return "Amethyst Staff"; + case 740: + return "Topaz Staff"; + case 741: + return "Sapphire Staff"; + case 742: + return "Emerald Staff"; + case 743: + return "Ruby Staff"; + case 744: + return "Diamond Staff"; + case 745: + return "Grass Wall"; + case 746: + return "Jungle Wall"; + case 747: + return "Flower Wall"; + case 748: + return "Jetpack"; + case 749: + return "Butterfly Wings"; + case 750: + return "Cactus Wall"; + case 751: + return "Cloud"; + case 752: + return "Cloud Wall"; + case 753: + return "Seaweed"; + case 754: + return "Rune Hat"; + case 755: + return "Rune Robe"; + case 756: + return "Mushroom Spear"; + case 757: + return "Terra Blade"; + case 758: + return "Grenade Launcher"; + case 759: + return "Rocket Launcher"; + case 760: + return "Proximity Mine Launcher"; + case 761: + return "Fairy Wings"; + case 762: + return "Slime Block"; + case 763: + return "Flesh Block"; + case 764: + return "Mushroom Wall"; + case 765: + return "Rain Cloud"; + case 766: + return "Bone Block"; + case 767: + return "Frozen Slime Block"; + case 768: + return "Bone Block Wall"; + case 769: + return "Slime Block Wall"; + case 770: + return "Flesh Block Wall"; + case 771: + return "Rocket I"; + case 772: + return "Rocket II"; + case 773: + return "Rocket III"; + case 774: + return "Rocket IV"; + case 775: + return "Asphalt Block"; + case 776: + return "Cobalt Pickaxe"; + case 777: + return "Mythril Pickaxe"; + case 778: + return "Adamantite Pickaxe"; + case 779: + return "Clentaminator"; + case 780: + return "Green Solution"; + case 781: + return "Blue Solution"; + case 782: + return "Purple Solution"; + case 783: + return "Dark Blue Solution"; + case 784: + return "Red Solution"; + case 785: + return "Harpy Wings"; + case 786: + return "Bone Wings"; + case 787: + return "Hammush"; + case 788: + return "Nettle Burst"; + case 789: + return "Ankh Banner"; + case 790: + return "Snake Banner"; + case 791: + return "Omega Banner"; + case 792: + return "Crimson Helmet"; + case 793: + return "Crimson Scalemail"; + case 794: + return "Crimson Greaves"; + case 795: + return "Blood Butcherer"; + case 796: + return "Tendon Bow"; + case 797: + return "Flesh Grinder"; + case 798: + return "Deathbringer Pickaxe"; + case 799: + return "Blood Lust Cluster"; + case 800: + return "The Undertaker"; + case 801: + return "The Meatball"; + case 802: + return "The Rotted Fork"; + case 803: + return "Eskimo Hood"; + case 804: + return "Eskimo Coat"; + case 805: + return "Eskimo Pants"; + case 806: + return "Living Wood Chair"; + case 807: + return "Cactus Chair"; + case 808: + return "Bone Chair"; + case 809: + return "Flesh Chair"; + case 810: + return "Mushroom Chair"; + case 811: + return "Bone Work Bench"; + case 812: + return "Cactus Work Bench"; + case 813: + return "Flesh Work Bench"; + case 814: + return "Mushroom Work Bench"; + case 815: + return "Slime Work Bench"; + case 816: + return "Cactus Door"; + case 817: + return "Flesh Door"; + case 818: + return "Mushroom Door"; + case 819: + return "Living Wood Door"; + case 820: + return "Bone Door"; + case 821: + return "Flame Wings"; + case 822: + return "Frozen Wings"; + case 823: + return "Ghost Wings"; + case 824: + return "Sunplate Block"; + case 825: + return "Disc Wall"; + case 826: + return "Skyware Chair"; + case 827: + return "Bone Table"; + case 828: + return "Flesh Table"; + case 829: + return "Living Wood Table"; + case 830: + return "Skyware Table"; + case 831: + return "Living Wood Chest"; + case 832: + return "Living Wood Wand"; + case 833: + return "Purple Ice Block"; + case 834: + return "Pink Ice Block"; + case 835: + return "Red Ice Block"; + case 836: + return "Crimstone Block"; + case 837: + return "Skyware Door"; + case 838: + return "Skyware Chest"; + case 839: + return "Steampunk Hat"; + case 840: + return "Steampunk Shirt"; + case 841: + return "Steampunk Pants"; + case 842: + return "Bee Hat"; + case 843: + return "Bee Shirt"; + case 844: + return "Bee Pants"; + case 845: + return "World Banner"; + case 846: + return "Sun Banner"; + case 847: + return "Gravity Banner"; + case 848: + return "Pharaoh's Mask"; + case 849: + return "Actuator"; + case 850: + return "Blue Wrench"; + case 851: + return "Green Wrench"; + case 852: + return "Blue Pressure Plate"; + case 853: + return "Yellow Pressure Plate"; + case 854: + return "Discount Card"; + case 855: + return "Lucky Coin"; + case 856: + return "Unicorn on a Stick"; + case 857: + return "Sandstorm in a Bottle"; + case 858: + return "bl"; + case 859: + return "Beach Ball"; + case 860: + return "Charm of Myths"; + case 861: + return "Moon Shell"; + case 862: + return "Star Veil"; + case 863: + return "Water Walking Boots"; + case 864: + return "Tiara"; + case 865: + return "Princess Dress"; + case 866: + return "Pharaoh's Robe"; + case 867: + return "Green Cap"; + case 868: + return "Mushroom Cap"; + case 869: + return "Tam O' Shanter"; + case 870: + return "Mummy Mask"; + case 871: + return "Mummy Shirt"; + case 872: + return "Mummy Pants"; + case 873: + return "Cowboy Hat"; + case 874: + return "Cowboy Jacket"; + case 875: + return "Cowboy Pants"; + case 876: + return "Pirate Hat"; + case 877: + return "Pirate Shirt"; + case 878: + return "Pirate Pants"; + case 879: + return "Viking Helmet"; + case 880: + return "Crimtane Ore"; + case 881: + return "Cactus Sword"; + case 882: + return "Cactus Pickaxe"; + case 883: + return "Ice Brick"; + case 884: + return "Ice Brick Wall"; + case 885: + return "Adhesive Bandage"; + case 886: + return "Armor Polish"; + case 887: + return "Bezoar"; + case 888: + return "Blindfold"; + case 889: + return "Fast Clock"; + case 890: + return "Megaphone"; + case 891: + return "Nazar"; + case 892: + return "Vitamins"; + case 893: + return "Trifold Map"; + case 894: + return "Cactus Helmet"; + case 895: + return "Cactus Breastplate"; + case 896: + return "Cactus Leggings"; + case 897: + return "Power Glove"; + case 898: + return "Lightning Boots"; + case 899: + return "Sun Stone"; + case 900: + return "Moon Stone"; + case 901: + return "Armor Bracing"; + case 902: + return "Medicated Bandage"; + case 903: + return "The Plan"; + case 904: + return "Countercurse Mantra"; + case 905: + return "Coin Gun"; + case 906: + return "Lava Charm"; + case 907: + return "Obsidian Water Walking Boots"; + case 908: + return "Lava Waders"; + case 909: + return "Pure Water Fountain"; + case 910: + return "Desert Water Fountain"; + case 911: + return "Shadewood"; + case 912: + return "Shadewood Door"; + case 913: + return "Shadewood Platform"; + case 914: + return "Shadewood Chest"; + case 915: + return "Shadewood Chair"; + case 916: + return "Shadewood Work Bench"; + case 917: + return "Shadewood Table"; + case 918: + return "Shadewood Dresser"; + case 919: + return "Shadewood Piano"; + case 920: + return "Shadewood Bed"; + case 921: + return "Shadewood Sword"; + case 922: + return "Shadewood Hammer"; + case 923: + return "Shadewood Bow"; + case 924: + return "Shadewood Helmet"; + case 925: + return "Shadewood Breastplate"; + case 926: + return "Shadewood Greaves"; + case 927: + return "Shadewood Wall"; + case 928: + return "Cannon"; + case 929: + return "Cannonball"; + case 930: + return "Flare Gun"; + case 931: + return "Flare"; + case 932: + return "Bone Wand"; + case 933: + return "Leaf Wand"; + case 934: + return "Flying Carpet"; + case 935: + return "Avenger Emblem"; + case 936: + return "Mechanical Glove"; + case 937: + return "Land Mine"; + case 938: + return "Paladin's Shield"; + case 939: + return "Web Slinger"; + case 940: + return "Jungle Water Fountain"; + case 941: + return "Icy Water Fountain"; + case 942: + return "Corrupt Water Fountain"; + case 943: + return "Crimson Water Fountain"; + case 944: + return "Hallowed Water Fountain"; + case 945: + return "Blood Water Fountain"; + case 946: + return "Umbrella"; + case 947: + return "Chlorophyte Ore"; + case 948: + return "Steampunk Wings"; + case 949: + return "Snowball"; + case 950: + return "Ice Skates"; + case 951: + return "Snowball Launcher"; + case 952: + return "Web Covered Chest"; + case 953: + return "Climbing Claws"; + case 954: + return "Ancient Iron Helmet"; + case 955: + return "Ancient Gold Helmet"; + case 956: + return "Ancient Shadow Helmet"; + case 957: + return "Ancient Shadow Scalemail"; + case 958: + return "Ancient Shadow Greaves"; + case 959: + return "Ancient Necro Helmet"; + case 960: + return "Ancient Cobalt Helmet"; + case 961: + return "Ancient Cobalt Breastplate"; + case 962: + return "Ancient Cobalt Leggings"; + case 963: + return "Black Belt"; + case 964: + return "Boomstick"; + case 965: + return "Rope"; + case 966: + return "Campfire"; + case 967: + return "Marshmallow"; + case 968: + return "Marshmallow on a Stick"; + case 969: + return "Cooked Marshmallow"; + case 970: + return "Red Rocket"; + case 971: + return "Green Rocket"; + case 972: + return "Blue Rocket"; + case 973: + return "Yellow Rocket"; + case 974: + return "Ice Torch"; + case 975: + return "Shoe Spikes"; + case 976: + return "Tiger Climbing Gear"; + case 977: + return "Tabi"; + case 978: + return "Pink Eskimo Hood"; + case 979: + return "Pink Eskimo Coat"; + case 980: + return "Pink Eskimo Pants"; + case 981: + return "Pink Thread"; + case 982: + return "Mana Regeneration Band"; + case 983: + return "Sandstorm in a Balloon"; + case 984: + return "Master Ninja Gear"; + case 985: + return "Rope Coil"; + case 986: + return "Blowgun"; + case 987: + return "Blizzard in a Bottle"; + case 988: + return "Frostburn Arrow"; + case 989: + return "Enchanted Sword"; + case 990: + return "Pickaxe Axe"; + case 991: + return "Cobalt Waraxe"; + case 992: + return "Mythril Waraxe"; + case 993: + return "Adamantite Waraxe"; + case 994: + return "Eater's Bone"; + case 995: + return "Blend-O-Matic"; + case 996: + return "Meat Grinder"; + case 997: + return "Extractinator"; + case 998: + return "Solidifier"; + case 999: + return "Amber"; + case 1000: + return "Confetti Gun"; + case 1001: + return "Chlorophyte Mask"; + case 1002: + return "Chlorophyte Helmet"; + case 1003: + return "Chlorophyte Headgear"; + case 1004: + return "Chlorophyte Plate Mail"; + case 1005: + return "Chlorophyte Greaves"; + case 1006: + return "Chlorophyte Bar"; + case 1007: + return "Red Dye"; + case 1008: + return "Orange Dye"; + case 1009: + return "Yellow Dye"; + case 1010: + return "Lime Dye"; + case 1011: + return "Green Dye"; + case 1012: + return "Teal Dye"; + case 1013: + return "Cyan Dye"; + case 1014: + return "Sky Blue Dye"; + case 1015: + return "Blue Dye"; + case 1016: + return "Purple Dye"; + case 1017: + return "Violet Dye"; + case 1018: + return "Pink Dye"; + case 1019: + return "Red and Black Dye"; + case 1020: + return "Orange and Black Dye"; + case 1021: + return "Yellow and Black Dye"; + case 1022: + return "Lime and Black Dye"; + case 1023: + return "Green and Black Dye"; + case 1024: + return "Teal and Black Dye"; + case 1025: + return "Cyan and Black Dye"; + case 1026: + return "Sky Blue and Black Dye"; + case 1027: + return "Blue and Black Dye"; + case 1028: + return "Purple and Black Dye"; + case 1029: + return "Violet and Black Dye"; + case 1030: + return "Pink and Black Dye"; + case 1031: + return "Flame Dye"; + case 1032: + return "Flame and Black Dye"; + case 1033: + return "Green Flame Dye"; + case 1034: + return "Green Flame and Black Dye"; + case 1035: + return "Blue Flame Dye"; + case 1036: + return "Blue Flame and Black Dye"; + case 1037: + return "Silver Dye"; + case 1038: + return "Bright Red Dye"; + case 1039: + return "Bright Orange Dye"; + case 1040: + return "Bright Yellow Dye"; + case 1041: + return "Bright Lime Dye"; + case 1042: + return "Bright Green Dye"; + case 1043: + return "Bright Teal Dye"; + case 1044: + return "Bright Cyan Dye"; + case 1045: + return "Bright Sky Blue Dye"; + case 1046: + return "Bright Blue Dye"; + case 1047: + return "Bright Purple Dye"; + case 1048: + return "Bright Violet Dye"; + case 1049: + return "Bright Pink Dye"; + case 1050: + return "Black Dye"; + case 1051: + return "Red and Silver Dye"; + case 1052: + return "Orange and Silver Dye"; + case 1053: + return "Yellow and Silver Dye"; + case 1054: + return "Lime and Silver Dye"; + case 1055: + return "Green and Silver Dye"; + case 1056: + return "Teal and Silver Dye"; + case 1057: + return "Cyan and Silver Dye"; + case 1058: + return "Sky Blue and Silver Dye"; + case 1059: + return "Blue and Silver Dye"; + case 1060: + return "Purple and Silver Dye"; + case 1061: + return "Violet and Silver Dye"; + case 1062: + return "Pink and Silver Dye"; + case 1063: + return "Intense Flame Dye"; + case 1064: + return "Intense Green Flame Dye"; + case 1065: + return "Intense Blue Flame Dye"; + case 1066: + return "Rainbow Dye"; + case 1067: + return "Intense Rainbow Dye"; + case 1068: + return "Yellow Gradient Dye"; + case 1069: + return "Cyan Gradient Dye"; + case 1070: + return "Violet Gradient Dye"; + case 1071: + return "Paintbrush"; + case 1072: + return "Paint Roller"; + case 1073: + return "Red Paint"; + case 1074: + return "Orange Paint"; + case 1075: + return "Yellow Paint"; + case 1076: + return "Lime Paint"; + case 1077: + return "Green Paint"; + case 1078: + return "Teal Paint"; + case 1079: + return "Cyan Paint"; + case 1080: + return "Sky Blue Paint"; + case 1081: + return "Blue Paint"; + case 1082: + return "Purple Paint"; + case 1083: + return "Violet Paint"; + case 1084: + return "Pink Paint"; + case 1085: + return "Deep Red Paint"; + case 1086: + return "Deep Orange Paint"; + case 1087: + return "Deep Yellow Paint"; + case 1088: + return "Deep Lime Paint"; + case 1089: + return "Deep Green Paint"; + case 1090: + return "Deep Teal Paint"; + case 1091: + return "Deep Cyan Paint"; + case 1092: + return "Deep Sky Blue Paint"; + case 1093: + return "Deep Blue Paint"; + case 1094: + return "Deep Purple Paint"; + case 1095: + return "Deep Violet Paint"; + case 1096: + return "Deep Pink Paint"; + case 1097: + return "Black Paint"; + case 1098: + return "White Paint"; + case 1099: + return "Gray Paint"; + case 1100: + return "Paint Scraper"; + case 1101: + return "Lihzahrd Brick"; + case 1102: + return "Lihzahrd Brick Wall"; + case 1103: + return "Slush Block"; + case 1104: + return "Palladium Ore"; + case 1105: + return "Orichalcum Ore"; + case 1106: + return "Titanium Ore"; + case 1107: + return "Teal Mushroom"; + case 1108: + return "Green Mushroom"; + case 1109: + return "Sky Blue Flower"; + case 1110: + return "Yellow Marigold"; + case 1111: + return "Blue Berries"; + case 1112: + return "Lime Kelp"; + case 1113: + return "Pink Prickly Pear"; + case 1114: + return "Orange Bloodroot"; + case 1115: + return "Red Husk"; + case 1116: + return "Cyan Husk"; + case 1117: + return "Violet Husk"; + case 1118: + return "Purple Mucos"; + case 1119: + return "Black Ink"; + case 1120: + return "Dye Vat"; + case 1121: + return "Bee Gun"; + case 1122: + return "Possessed Hatchet"; + case 1123: + return "Bee Keeper"; + case 1124: + return "Hive"; + case 1125: + return "Honey Block"; + case 1126: + return "Hive Wall"; + case 1127: + return "Crispy Honey Block"; + case 1128: + return "Honey Bucket"; + case 1129: + return "Hive Wand"; + case 1130: + return "Beenade"; + case 1131: + return "Gravity Globe"; + case 1132: + return "Honey Comb"; + case 1133: + return "Abeemination"; + case 1134: + return "Bottled Honey"; + case 1135: + return "Rain Hat"; + case 1136: + return "Rain Coat"; + case 1137: + return "Lihzahrd Door"; + case 1138: + return "Dungeon Door"; + case 1139: + return "Lead Door"; + case 1140: + return "Iron Door"; + case 1141: + return "Temple Key"; + case 1142: + return "Lihzahrd Chest"; + case 1143: + return "Lihzahrd Chair"; + case 1144: + return "Lihzahrd Table"; + case 1145: + return "Lihzahrd Work Bench"; + case 1146: + return "Super Dart Trap"; + case 1147: + return "Flame Trap"; + case 1148: + return "Spiky Ball Trap"; + case 1149: + return "Spear Trap"; + case 1150: + return "Wooden Spike"; + case 1151: + return "Lihzahrd Pressure Plate"; + case 1152: + return "Lihzahrd Statue"; + case 1153: + return "Lihzahrd Watcher Statue"; + case 1154: + return "Lihzahrd Guardian Statue"; + case 1155: + return "Wasp Gun"; + case 1156: + return "Piranha Gun"; + case 1157: + return "Pygmy Staff"; + case 1158: + return "Pygmy Necklace"; + case 1159: + return "Tiki Mask"; + case 1160: + return "Tiki Shirt"; + case 1161: + return "Tiki Pants"; + case 1162: + return "Leaf Wings"; + case 1163: + return "Blizzard in a Balloon"; + case 1164: + return "Bundle of Balloons"; + case 1165: + return "Bat Wings"; + case 1166: + return "Bone Sword"; + case 1167: + return "Hercules Beetle"; + case 1168: + return "Smoke Bomb"; + case 1169: + return "Bone Key"; + case 1170: + return "Nectar"; + case 1171: + return "Tiki Totem"; + case 1172: + return "Lizard Egg"; + case 1173: + return "Grave Marker"; + case 1174: + return "Cross Grave Marker"; + case 1175: + return "Headstone"; + case 1176: + return "Gravestone"; + case 1177: + return "Obelisk"; + case 1178: + return "Leaf Blower"; + case 1179: + return "Chlorophyte Bullet"; + case 1180: + return "Parrot Cracker"; + case 1181: + return "Strange Glowing Mushroom"; + case 1182: + return "Seedling"; + case 1183: + return "Wisp in a Bottle"; + case 1184: + return "Palladium Bar"; + case 1185: + return "Palladium Sword"; + case 1186: + return "Palladium Pike"; + case 1187: + return "Palladium Repeater"; + case 1188: + return "Palladium Pickaxe"; + case 1189: + return "Palladium Drill"; + case 1190: + return "Palladium Chainsaw"; + case 1191: + return "Orichalcum Bar"; + case 1192: + return "Orichalcum Sword"; + case 1193: + return "Orichalcum Halberd"; + case 1194: + return "Orichalcum Repeater"; + case 1195: + return "Orichalcum Pickaxe"; + case 1196: + return "Orichalcum Drill"; + case 1197: + return "Orichalcum Chainsaw"; + case 1198: + return "Titanium Bar"; + case 1199: + return "Titanium Sword"; + case 1200: + return "Titanium Trident"; + case 1201: + return "Titanium Repeater"; + case 1202: + return "Titanium Pickaxe"; + case 1203: + return "Titanium Drill"; + case 1204: + return "Titanium Chainsaw"; + case 1205: + return "Palladium Mask"; + case 1206: + return "Palladium Helmet"; + case 1207: + return "Palladium Headgear"; + case 1208: + return "Palladium Breastplate"; + case 1209: + return "Palladium Leggings"; + case 1210: + return "Orichalcum Mask"; + case 1211: + return "Orichalcum Helmet"; + case 1212: + return "Orichalcum Headgear"; + case 1213: + return "Orichalcum Breastplate"; + case 1214: + return "Orichalcum Leggings"; + case 1215: + return "Titanium Mask"; + case 1216: + return "Titanium Helmet"; + case 1217: + return "Titanium Headgear"; + case 1218: + return "Titanium Breastplate"; + case 1219: + return "Titanium Leggings"; + case 1220: + return "Orichalcum Anvil"; + case 1221: + return "Titanium Forge"; + case 1222: + return "Palladium Waraxe"; + case 1223: + return "Orichalcum Waraxe"; + case 1224: + return "Titanium Waraxe"; + case 1225: + return "Hallowed Bar"; + case 1226: + return "Chlorophyte Claymore"; + case 1227: + return "Chlorophyte Saber"; + case 1228: + return "Chlorophyte Partisan"; + case 1229: + return "Chlorophyte Shotbow"; + case 1230: + return "Chlorophyte Pickaxe"; + case 1231: + return "Chlorophyte Drill"; + case 1232: + return "Chlorophyte Chainsaw"; + case 1233: + return "Chlorophyte Greataxe"; + case 1234: + return "Chlorophyte Warhammer"; + case 1235: + return "Chlorophyte Arrow"; + case 1236: + return "Amethyst Hook"; + case 1237: + return "Topaz Hook"; + case 1238: + return "Sapphire Hook"; + case 1239: + return "Emerald Hook"; + case 1240: + return "Ruby Hook"; + case 1241: + return "Diamond Hook"; + case 1242: + return "Amber Mosquito"; + case 1243: + return "Umbrella Hat"; + case 1244: + return "Nimbus Rod"; + case 1245: + return "Orange Torch"; + case 1246: + return "Crimsand Block"; + case 1247: + return "Bee Cloak"; + case 1248: + return "Eye of the Golem"; + case 1249: + return "Honey Balloon"; + case 1250: + return "Blue Horseshoe Balloon"; + case 1251: + return "White Horseshoe Balloon"; + case 1252: + return "Yellow Horseshoe Balloon"; + case 1253: + return "Frozen Turtle Shell"; + case 1254: + return "Sniper Rifle"; + case 1255: + return "Venus Magnum"; + case 1256: + return "Crimson Rod"; + case 1257: + return "Crimtane Bar"; + case 1258: + return "Stynger"; + case 1259: + return "Flower Pow"; + case 1260: + return "Rainbow Gun"; + case 1261: + return "Stynger Bolt"; + case 1262: + return "Chlorophyte Jackhammer"; + case 1263: + return "Teleporter"; + case 1264: + return "Flower of Frost"; + case 1265: + return "Uzi"; + case 1266: + return "Magnet Sphere"; + case 1267: + return "Purple Stained Glass"; + case 1268: + return "Yellow Stained Glass"; + case 1269: + return "Blue Stained Glass"; + case 1270: + return "Green Stained Glass"; + case 1271: + return "Red Stained Glass"; + case 1272: + return "Multicolored Stained Glass"; + case 1273: + return "Skeletron Hand"; + case 1274: + return "Skull"; + case 1275: + return "Balla Hat"; + case 1276: + return "Gangsta Hat"; + case 1277: + return "Sailor Hat"; + case 1278: + return "Eye Patch"; + case 1279: + return "Sailor Shirt"; + case 1280: + return "Sailor Pants"; + case 1281: + return "Skeletron Mask"; + case 1282: + return "Amethyst Robe"; + case 1283: + return "Topaz Robe"; + case 1284: + return "Sapphire Robe"; + case 1285: + return "Emerald Robe"; + case 1286: + return "Ruby Robe"; + case 1287: + return "Diamond Robe"; + case 1288: + return "White Tuxedo Shirt"; + case 1289: + return "White Tuxedo Pants"; + case 1290: + return "Panic Necklace"; + case 1291: + return "Life Fruit"; + case 1292: + return "Lihzahrd Altar"; + case 1293: + return "Lihzahrd Power Cell"; + case 1294: + return "Picksaw"; + case 1295: + return "Heat Ray"; + case 1296: + return "Staff of Earth"; + case 1297: + return "Golem Fist"; + case 1298: + return "Water Chest"; + case 1299: + return "Binoculars"; + case 1300: + return "Rifle Scope"; + case 1301: + return "Destroyer Emblem"; + case 1302: + return "High Velocity Bullet"; + case 1303: + return "Jellyfish Necklace"; + case 1304: + return "Zombie Arm"; + case 1305: + return "The Axe"; + case 1306: + return "Ice Sickle"; + case 1307: + return "Clothier Voodoo Doll"; + case 1308: + return "Poison Staff"; + case 1309: + return "Slime Staff"; + case 1310: + return "Poison Dart"; + case 1311: + return "Eye Spring"; + case 1312: + return "Toy Sled"; + case 1313: + return "Book of Skulls"; + case 1314: + return "KO Cannon"; + case 1315: + return "Pirate Map"; + case 1316: + return "Turtle Helmet"; + case 1317: + return "Turtle Scale Mail"; + case 1318: + return "Turtle Leggings"; + case 1319: + return "Snowball Cannon"; + case 1320: + return "Bone Pickaxe"; + case 1321: + return "Magic Quiver"; + case 1322: + return "Magma Stone"; + case 1323: + return "Obsidian Rose"; + case 1324: + return "Bananarang"; + case 1325: + return "Chain Knife"; + case 1326: + return "Rod of Discord"; + case 1327: + return "Death Sickle"; + case 1328: + return "Turtle Shell"; + case 1329: + return "Tissue Sample"; + case 1330: + return "Vertebrae"; + case 1331: + return "Bloody Spine"; + case 1332: + return "Ichor"; + case 1333: + return "Ichor Torch"; + case 1334: + return "Ichor Arrow"; + case 1335: + return "Ichor Bullet"; + case 1336: + return "Golden Shower"; + case 1337: + return "Bunny Cannon"; + case 1338: + return "Explosive Bunny"; + case 1339: + return "Vial of Venom"; + case 1340: + return "Flask of Venom"; + case 1341: + return "Venom Arrow"; + case 1342: + return "Venom Bullet"; + case 1343: + return "Fire Gauntlet"; + case 1344: + return "Cog"; + case 1345: + return "Confetti"; + case 1346: + return "Nanites"; + case 1347: + return "Explosive Powder"; + case 1348: + return "Gold Dust"; + case 1349: + return "Party Bullet"; + case 1350: + return "Nano Bullet"; + case 1351: + return "Exploding Bullet"; + case 1352: + return "Golden Bullet"; + case 1353: + return "Flask of Cursed Flames"; + case 1354: + return "Flask of Fire"; + case 1355: + return "Flask of Gold"; + case 1356: + return "Flask of Ichor"; + case 1357: + return "Flask of Nanites"; + case 1358: + return "Flask of Party"; + case 1359: + return "Flask of Poison"; + case 1360: + return "Eye of Cthulhu Trophy"; + case 1361: + return "Eater of Worlds Trophy"; + case 1362: + return "Brain of Cthulhu Trophy"; + case 1363: + return "Skeletron Trophy"; + case 1364: + return "Queen Bee Trophy"; + case 1365: + return "Wall of Flesh Trophy"; + case 1366: + return "Destroyer Trophy"; + case 1367: + return "Skeletron Prime Trophy"; + case 1368: + return "Retinazer Trophy"; + case 1369: + return "Spazmatism Trophy"; + case 1370: + return "Plantera Trophy"; + case 1371: + return "Golem Trophy"; + case 1372: + return "Blood Moon Rising"; + case 1373: + return "The Hanged Man"; + case 1374: + return "Glory of the Fire"; + case 1375: + return "Bone Warp"; + case 1376: + return "Wall Skeleton"; + case 1377: + return "Hanging Skeleton"; + case 1378: + return "Blue Slab Wall"; + case 1379: + return "Blue Tiled Wall"; + case 1380: + return "Pink Slab Wall"; + case 1381: + return "Pink Tiled Wall"; + case 1382: + return "Green Slab Wall"; + case 1383: + return "Green Tiled Wall"; + case 1384: + return "Blue Brick Platform"; + case 1385: + return "Pink Brick Platform"; + case 1386: + return "Green Brick Platform"; + case 1387: + return "Metal Shelf"; + case 1388: + return "Brass Shelf"; + case 1389: + return "Wood Shelf"; + case 1390: + return "Brass Lantern"; + case 1391: + return "Caged Lantern"; + case 1392: + return "Carriage Lantern"; + case 1393: + return "Alchemy Lantern"; + case 1394: + return "Diablost Lamp"; + case 1395: + return "Oil Rag Sconse"; + case 1396: + return "Blue Dungeon Chair"; + case 1397: + return "Blue Dungeon Table"; + case 1398: + return "Blue Dungeon Work Bench"; + case 1399: + return "Green Dungeon Chair"; + case 1400: + return "Green Dungeon Table"; + case 1401: + return "Green Dungeon Work Bench"; + case 1402: + return "Pink Dungeon Chair"; + case 1403: + return "Pink Dungeon Table"; + case 1404: + return "Pink Dungeon Work Bench"; + case 1405: + return "Blue Dungeon Candle"; + case 1406: + return "Green Dungeon Candle"; + case 1407: + return "Pink Dungeon Candle"; + case 1408: + return "Blue Dungeon Vase"; + case 1409: + return "Green Dungeon Vase"; + case 1410: + return "Pink Dungeon Vase"; + case 1411: + return "Blue Dungeon Door"; + case 1412: + return "Green Dungeon Door"; + case 1413: + return "Pink Dungeon Door"; + case 1414: + return "Blue Dungeon Bookcase"; + case 1415: + return "Green Dungeon Bookcase"; + case 1416: + return "Pink Dungeon Bookcase"; + case 1417: + return "Catacomb"; + case 1418: + return "Dungeon Shelf"; + case 1419: + return "Skellington J Skellingsworth"; + case 1420: + return "The Cursed Man"; + case 1421: + return "The Eye Sees the End"; + case 1422: + return "Something Evil is Watching You"; + case 1423: + return "The Twins Have Awoken"; + case 1424: + return "The Screamer"; + case 1425: + return "Goblins Playing Poker"; + case 1426: + return "Dryadisque"; + case 1427: + return "Sunflowers"; + case 1428: + return "Terrarian Gothic"; + case 1429: + return "Beanie"; + case 1430: + return "Imbuing Station"; + case 1431: + return "Star in a Bottle"; + case 1432: + return "Empty Bullet"; + case 1433: + return "Impact"; + case 1434: + return "Powered by Birds"; + case 1435: + return "The Destroyer"; + case 1436: + return "The Persistency of Eyes"; + case 1437: + return "Unicorn Crossing the Hallows"; + case 1438: + return "Great Wave"; + case 1439: + return "Starry Night"; + case 1440: + return "Guide Picasso"; + case 1441: + return "The Guardian's Gaze"; + case 1442: + return "Father of Someone"; + case 1443: + return "Nurse Lisa"; + case 1444: + return "Shadowbeam Staff"; + case 1445: + return "Inferno Fork"; + case 1446: + return "Spectre Staff"; + case 1447: + return "Wooden Fence"; + case 1448: + return "Metal Fence"; + case 1449: + return "Bubble Machine"; + case 1450: + return "Bubble Wand"; + case 1451: + return "Marching Bones Banner"; + case 1452: + return "Necromantic Sign"; + case 1453: + return "Rusted Company Standard"; + case 1454: + return "Ragged Brotherhood Sigil"; + case 1455: + return "Molten Legion Flag"; + case 1456: + return "Diabolic Sigil"; + case 1457: + return "Obsidian Platform"; + case 1458: + return "Obsidian Door"; + case 1459: + return "Obsidian Chair"; + case 1460: + return "Obsidian Table"; + case 1461: + return "Obsidian Work Bench"; + case 1462: + return "Obsidian Vase"; + case 1463: + return "Obsidian Bookcase"; + case 1464: + return "Hellbound Banner"; + case 1465: + return "Hell Hammer Banner"; + case 1466: + return "Helltower Banner"; + case 1467: + return "Lost Hopes of Man Banner"; + case 1468: + return "Obsidian Watcher Banner"; + case 1469: + return "Lava Erupts Banner"; + case 1470: + return "Blue Dungeon Bed"; + case 1471: + return "Green Dungeon Bed"; + case 1472: + return "Red Dungeon Bed"; + case 1473: + return "Obsidian Bed"; + case 1474: + return "Waldo"; + case 1475: + return "Darkness"; + case 1476: + return "Dark Soul Reaper"; + case 1477: + return "Land"; + case 1478: + return "Trapped Ghost"; + case 1479: + return "Demon's Eye"; + case 1480: + return "Finding Gold"; + case 1481: + return "First Encounter"; + case 1482: + return "Good Morning"; + case 1483: + return "Underground Reward"; + case 1484: + return "Through the Window"; + case 1485: + return "Place Above the Clouds"; + case 1486: + return "Do Not Step on the Grass"; + case 1487: + return "Cold Waters in the White Land"; + case 1488: + return "Lightless Chasms"; + case 1489: + return "The Land of Deceiving Looks"; + case 1490: + return "Daylight"; + case 1491: + return "Secret of the Sands"; + case 1492: + return "Deadland Comes Alive"; + case 1493: + return "Evil Presence"; + case 1494: + return "Sky Guardian"; + case 1495: + return "American Explosive"; + case 1496: + return "Discover"; + case 1497: + return "Hand Earth"; + case 1498: + return "Old Miner"; + case 1499: + return "Skelehead"; + case 1500: + return "Facing the Cerebral Mastermind"; + case 1501: + return "Lake of Fire"; + case 1502: + return "Trio Super Heroes"; + case 1503: + return "Spectre Hood"; + case 1504: + return "Spectre Robe"; + case 1505: + return "Spectre Pants"; + case 1506: + return "Spectre Pickaxe"; + case 1507: + return "Spectre Hamaxe"; + case 1508: + return "Ectoplasm"; + case 1509: + return "Gothic Chair"; + case 1510: + return "Gothic Table"; + case 1511: + return "Gothic Work Bench"; + case 1512: + return "Gothic Bookcase"; + case 1513: + return "Paladin's Hammer"; + case 1514: + return "SWAT Helmet"; + case 1515: + return "Bee Wings"; + case 1516: + return "Giant Harpy Feather"; + case 1517: + return "Bone Feather"; + case 1518: + return "Fire Feather"; + case 1519: + return "Ice Feather"; + case 1520: + return "Broken Bat Wing"; + case 1521: + return "Tattered Bee Wing"; + case 1522: + return "Large Amethyst"; + case 1523: + return "Large Topaz"; + case 1524: + return "Large Sapphire"; + case 1525: + return "Large Emerald"; + case 1526: + return "Large Ruby"; + case 1527: + return "Large Diamond"; + case 1528: + return "Jungle Chest"; + case 1529: + return "Corruption Chest"; + case 1530: + return "Crimson Chest"; + case 1531: + return "Hallowed Chest"; + case 1532: + return "Frozen Chest"; + case 1533: + return "Jungle Key"; + case 1534: + return "Corruption Key"; + case 1535: + return "Crimson Key"; + case 1536: + return "Hallowed Key"; + case 1537: + return "Frozen Key"; + case 1538: + return "Imp Face"; + case 1539: + return "Ominous Presence"; + case 1540: + return "Shining Moon"; + case 1541: + return "Living Gore"; + case 1542: + return "Flowing Magma"; + case 1543: + return "Spectre Paintbrush"; + case 1544: + return "Spectre Paint Roller"; + case 1545: + return "Spectre Paint Scraper"; + case 1546: + return "Shroomite Headgear"; + case 1547: + return "Shroomite Mask"; + case 1548: + return "Shroomite Helmet"; + case 1549: + return "Shroomite Breastplate"; + case 1550: + return "Shroomite Leggings"; + case 1551: + return "Autohammer"; + case 1552: + return "Shroomite Bar"; + case 1553: + return "S.D.M.G."; + case 1554: + return "Cenx's Tiara"; + case 1555: + return "Cenx's Breastplate"; + case 1556: + return "Cenx's Leggings"; + case 1557: + return "Crowno's Mask"; + case 1558: + return "Crowno's Breastplate"; + case 1559: + return "Crowno's Leggings"; + case 1560: + return "Will's Helmet"; + case 1561: + return "Will's Breastplate"; + case 1562: + return "Will's Leggings"; + case 1563: + return "Jim's Helmet"; + case 1564: + return "Jim's Breastplate"; + case 1565: + return "Jim's Leggings"; + case 1566: + return "Aaron's Helmet"; + case 1567: + return "Aaron's Breastplate"; + case 1568: + return "Aaron's Leggings"; + case 1569: + return "Vampire Knives"; + case 1570: + return "Broken Hero Sword"; + case 1571: + return "Scourge of the Corruptor"; + case 1572: + return "Staff of the Frost Hydra"; + case 1573: + return "The Creation of the Guide"; + case 1574: + return "The Merchant"; + case 1575: + return "Crowno Devours His Lunch"; + case 1576: + return "Rare Enchantment"; + case 1577: + return "Glorious Night"; + case 1578: + return "Sweetheart Necklace"; + case 1579: + return "Flurry Boots"; + case 1580: + return "D-Town's Helmet"; + case 1581: + return "D-Town's Breastplate"; + case 1582: + return "D-Town's Leggings"; + case 1583: + return "D-Town's Wings"; + case 1584: + return "Will's Wings"; + case 1585: + return "Crowno's Wings"; + case 1586: + return "Cenx's Wings"; + case 1587: + return "Cenx's Dress"; + case 1588: + return "Cenx's Dress Pants"; + case 1589: + return "Palladium Column"; + case 1590: + return "Palladium Column Wall"; + case 1591: + return "Bubblegum Block"; + case 1592: + return "Bubblegum Block Wall"; + case 1593: + return "Titanstone Block"; + case 1594: + return "Titanstone Block Wall"; + case 1595: + return "Magic Cuffs"; + case 1596: + return "Music Box (Snow)"; + case 1597: + return "Music Box (Space)"; + case 1598: + return "Music Box (Crimson)"; + case 1599: + return "Music Box (Boss 4)"; + case 1600: + return "Music Box (Alt Overworld Day)"; + case 1601: + return "Music Box (Rain)"; + case 1602: + return "Music Box (Ice)"; + case 1603: + return "Music Box (Desert)"; + case 1604: + return "Music Box (Ocean)"; + case 1605: + return "Music Box (Dungeon)"; + case 1606: + return "Music Box (Plantera)"; + case 1607: + return "Music Box (Boss 5)"; + case 1608: + return "Music Box (Temple)"; + case 1609: + return "Music Box (Eclipse)"; + case 1610: + return "Music Box (Mushrooms)"; + case 1611: + return "Butterfly Dust"; + case 1612: + return "Ankh Charm"; + case 1613: + return "Ankh Shield"; + case 1614: + return "Blue Flare"; + case 1615: + return "Angler Fish Banner"; + case 1616: + return "Angry Nimbus Banner"; + case 1617: + return "Anomura Fungus Banner"; + case 1618: + return "Antlion Banner"; + case 1619: + return "Arapaima Banner"; + case 1620: + return "Armored Skeleton Banner"; + case 1621: + return "Bat Banner"; + case 1622: + return "Bird Banner"; + case 1623: + return "Black Recluse Banner"; + case 1624: + return "Blood Feeder Banner"; + case 1625: + return "Blood Jelly Banner"; + case 1626: + return "Blood Crawler Banner"; + case 1627: + return "Bone Serpent Banner"; + case 1628: + return "Bunny Banner"; + case 1629: + return "Chaos Elemental Banner"; + case 1630: + return "Mimic Banner"; + case 1631: + return "Clown Banner"; + case 1632: + return "Corrupt Bunny Banner"; + case 1633: + return "Corrupt Goldfish Banner"; + case 1634: + return "Crab Banner"; + case 1635: + return "Crimera Banner"; + case 1636: + return "Crimson Axe Banner"; + case 1637: + return "Cursed Hammer Banner"; + case 1638: + return "Demon Banner"; + case 1639: + return "Demon Eye Banner"; + case 1640: + return "Derpling Banner"; + case 1641: + return "Eater of Souls Banner"; + case 1642: + return "Enchanted Sword Banner"; + case 1643: + return "Zombie Eskimo Banner"; + case 1644: + return "Face Monster Banner"; + case 1645: + return "Floaty Gross Banner"; + case 1646: + return "Flying Fish Banner"; + case 1647: + return "Flying Snake Banner"; + case 1648: + return "Frankenstein Banner"; + case 1649: + return "Fungi Bulb Banner"; + case 1650: + return "Fungo Fish Banner"; + case 1651: + return "Gastropod Banner"; + case 1652: + return "Goblin Archer Banner"; + case 1653: + return "Goblin Sorcerer Banner"; + case 1654: + return "Goblin Scout Banner"; + case 1655: + return "Goblin Thief Banner"; + case 1656: + return "Goblin Warrior Banner"; + case 1657: + return "Goldfish Banner"; + case 1658: + return "Harpy Banner"; + case 1659: + return "Hellbat Banner"; + case 1660: + return "Herpling Banner"; + case 1661: + return "Hornet Banner"; + case 1662: + return "Ice Elemental Banner"; + case 1663: + return "Icy Merman Banner"; + case 1664: + return "Fire Imp Banner"; + case 1665: + return "Jellyfish Banner"; + case 1666: + return "Jungle Creeper Banner"; + case 1667: + return "Lihzahrd Banner"; + case 1668: + return "Man Eater Banner"; + case 1669: + return "Meteor Head Banner"; + case 1670: + return "Moth Banner"; + case 1671: + return "Mummy Banner"; + case 1672: + return "Mushi Ladybug Banner"; + case 1673: + return "Parrot Banner"; + case 1674: + return "Pigron Banner"; + case 1675: + return "Piranha Banner"; + case 1676: + return "Pirate Banner"; + case 1677: + return "Pixie Banner"; + case 1678: + return "Raincoat Zombie Banner"; + case 1679: + return "Reaper Banner"; + case 1680: + return "Shark Banner"; + case 1681: + return "Skeleton Banner"; + case 1682: + return "Skeleton Mage Banner"; + case 1683: + return "Slime Banner"; + case 1684: + return "Snow Flinx Banner"; + case 1685: + return "Spider Banner"; + case 1686: + return "Spore Zombie Banner"; + case 1687: + return "Swamp Thing Banner"; + case 1688: + return "Tortoise Banner"; + case 1689: + return "Toxic Sludge Banner"; + case 1690: + return "Umbrella Slime Banner"; + case 1691: + return "Unicorn Banner"; + case 1692: + return "Vampire Banner"; + case 1693: + return "Vulture Banner"; + case 1694: + return "Nypmh Banner"; + case 1695: + return "Werewolf Banner"; + case 1696: + return "Wolf Banner"; + case 1697: + return "World Feeder Banner"; + case 1698: + return "Worm Banner"; + case 1699: + return "Wraith Banner"; + case 1700: + return "Wyvern Banner"; + case 1701: + return "Zombie Banner"; + case 1702: + return "Glass Platform"; + case 1703: + return "Glass Chair"; + case 1704: + return "Golden Chair"; + case 1705: + return "Golden Toilet"; + case 1706: + return "Bar Stool"; + case 1707: + return "Honey Chair"; + case 1708: + return "Steam Punk Chair"; + case 1709: + return "Glass Door"; + case 1710: + return "Golden Door"; + case 1711: + return "Honey Door"; + case 1712: + return "Steam Punk Door"; + case 1713: + return "Glass Table"; + case 1714: + return "Banquet Table"; + case 1715: + return "Bar"; + case 1716: + return "Golden Table"; + case 1717: + return "Honey Table"; + case 1718: + return "Steam Punk Table"; + case 1719: + return "Glass Bed"; + case 1720: + return "Golden Bed"; + case 1721: + return "Honey Bed"; + case 1722: + return "Steam Punk Bed"; + case 1723: + return "Living Wood Wall"; + case 1724: + return "Fart in a Jar"; + } + } + else + { + if (Lang.lang == 2) + { + switch (l) + { + case -24: + return "Gelbes Laserschwert"; + case -23: + return "Weisses Laserschwert"; + case -22: + return "Lila Laserschwert"; + case -21: + return "Gruenes Laserschwert"; + case -20: + return "Rotes Laserschwert"; + case -19: + return "Blaues Laserschwert"; + case -18: + return "Kupferbogen"; + case -17: + return "Kupferhammer"; + case -16: + return "Kupferaxt"; + case -15: + return "Kupferkurzschwert"; + case -14: + return "Kupferbreitschwert"; + case -13: + return "Kupferspitzhacke"; + case -12: + return "Silberbogen"; + case -11: + return "Silberhammer"; + case -10: + return "Silberaxt"; + case -9: + return "Silberkurzschwert"; + case -8: + return "Silberbreitschwert"; + case -7: + return "Silberspitzhacke"; + case -6: + return "Goldbogen"; + case -5: + return "Goldhammer"; + case -4: + return "Goldaxt"; + case -3: + return "Goldkurzschwert"; + case -2: + return "Goldbreitschwert"; + case -1: + return "Goldspitzhacke"; + case 1: + return "Eisenspitzhacke"; + case 2: + return "Dreckblock"; + case 3: + return "Steinblock"; + case 4: + return "Eisenbreitschwert"; + case 5: + return "Pilz"; + case 6: + return "Eisenkurzschwert"; + case 7: + return "Eisenhammer"; + case 8: + return "Fackel"; + case 9: + return "Holz"; + case 10: + return "Eisenaxt"; + case 11: + return "Eisenerz"; + case 12: + return "Kupfererz"; + case 13: + return "Golderz"; + case 14: + return "Silbererz"; + case 15: + return "Kupferuhr"; + case 16: + return "Silberuhr"; + case 17: + return "Golduhr"; + case 18: + return "Taucheruhr"; + case 19: + return "Goldbarren"; + case 20: + return "Kupferbarren"; + case 21: + return "Silberbarren"; + case 22: + return "Eisenbarren"; + case 23: + return "Glibber"; + case 24: + return "Holzschwert"; + case 25: + return "Holztuer"; + case 26: + return "Steinwand"; + case 27: + return "Eichel"; + case 28: + return "Schwacher Heiltrank"; + case 29: + return "Lebenskristall"; + case 30: + return "Dreckwand"; + case 31: + return "Flasche"; + case 32: + return "Holztisch"; + case 33: + return "Ofen"; + case 34: + return "Holzstuhl"; + case 35: + return "Eisenamboss"; + case 36: + return "Werkbank"; + case 37: + return "Schutzbrille"; + case 38: + return "Linse"; + case 39: + return "Holzbogen"; + case 40: + return "Holzpfeil"; + case 41: + return "Flammenpfeil"; + case 42: + return "Shuriken"; + case 43: + return "Verdaechtig ausschauendes Auge"; + case 44: + return "Daemonenbogen"; + case 45: + return "Kriegsaxt der Nacht"; + case 46: + return "Schrecken des Tages"; + case 47: + return "Unheiliger Pfeil"; + case 48: + return "Truhe"; + case 49: + return "Wiederbelebungsband"; + case 50: + return "Magischer Spiegel"; + case 51: + return "Dominopfeil"; + case 52: + return "Engelsstatue"; + case 53: + return "Wolke in einer Flasche"; + case 54: + return "Hermes-Stiefel"; + case 55: + return "Verzauberter Bumerang"; + case 56: + return "Daemoniterz"; + case 57: + return "Daemonitbarren"; + case 58: + return "Herz"; + case 59: + return "Verderbte Saat"; + case 60: + return "Ekelpilz"; + case 61: + return "Ebensteinblock"; + case 62: + return "Grassaat"; + case 63: + return "Sonnenblume"; + case 64: + return "Ekeldorn"; + case 65: + return "Sternenwut"; + case 66: + return "Reinigungspulver"; + case 67: + return "Ekelpulver"; + case 68: + return "Verfaultes"; + case 69: + return "Wurmzahn"; + case 70: + return "Wurmkoeder"; + case 71: + return "Kupfermuenze"; + case 72: + return "Silbermuenze"; + case 73: + return "Goldmuenze"; + case 74: + return "Platinmuenze"; + case 75: + return "Sternschnuppe"; + case 76: + return "Kupferbeinschuetzer"; + case 77: + return "Eisenbeinschuetzer"; + case 78: + return "Silberbeinschuetzer"; + case 79: + return "Goldbeinschuetzer"; + case 80: + return "Kupferkettenhemd"; + case 81: + return "Eisenkettenhemd"; + case 82: + return "Silberkettenhemd"; + case 83: + return "Goldkettenhemd"; + case 84: + return "Enterhaken"; + case 85: + return "Eisenkette"; + case 86: + return "Schattenschuppe"; + case 87: + return "Sparschwein"; + case 88: + return "Bergmannshelm"; + case 89: + return "Kupferhelm"; + case 90: + return "Eisenhelm"; + case 91: + return "Silberhelm"; + case 92: + return "Goldhelm"; + case 93: + return "Holzwand"; + case 94: + return "Holzklappe"; + case 95: + return "Steinschlosspistole"; + case 96: + return "Muskete"; + case 97: + return "Musketenkugel"; + case 98: + return "Minihai"; + case 99: + return "Eisenbogen"; + case 100: + return "Schattenbeinschuetzer"; + case 101: + return "Schattenschuppenhemd"; + case 102: + return "Schattenhelm"; + case 103: + return "Albtraum-Spitzhacke"; + case 104: + return "Zerschmetterer"; + case 105: + return "Kerze"; + case 106: + return "Kupferkronleuchter"; + case 107: + return "Silberkronleuchter"; + case 108: + return "Goldkronleuchter"; + case 109: + return "Mana-Kristall"; + case 110: + return "Schwacher Manatrank"; + case 111: + return "Sternenkraftband"; + case 112: + return "Feuerblume"; + case 113: + return "Magische Rakete"; + case 114: + return "Dreckrute"; + case 115: + return "Lichtkugel"; + case 116: + return "Meteorit"; + case 117: + return "Meteoritenbarren"; + case 118: + return "Haken"; + case 119: + return "Flamarang"; + case 120: + return "Geschmolzene Wut"; + case 121: + return "Feuriges Grossschwert"; + case 122: + return "Geschmolzene Spitzhacke"; + case 123: + return "Meteorhelm"; + case 124: + return "Meteoranzug"; + case 125: + return "Meteor Leggings"; + case 126: + return "Flaschenwasser"; + case 127: + return "Raum Gun"; + case 128: + return "Raketenstiefel"; + case 129: + return "Grauer Ziegel"; + case 130: + return "Graue Ziegelsteinwand"; + case 131: + return "Roter Ziegel"; + case 132: + return "Rote Ziegelwand"; + case 133: + return "Lehmblock"; + case 134: + return "Blauer Ziegel"; + case 135: + return "Blaue Ziegelwand"; + case 136: + return "Haengelaterne"; + case 137: + return "Gruener Ziegel"; + case 138: + return "Gruene Ziegelwand"; + case 139: + return "Rosa Ziegel"; + case 140: + return "Rosa Ziegelwand"; + case 141: + return "Goldziegel"; + case 142: + return "Goldziegelwand"; + case 143: + return "Silberziegel"; + case 144: + return "Silberziegelwand"; + case 145: + return "Kupferziegel"; + case 146: + return "Kupferziegelwand"; + case 147: + return "Stachel"; + case 148: + return "Wasserkerze"; + case 149: + return "Buch"; + case 150: + return "Spinnennetz"; + case 151: + return "Necrohelm"; + case 152: + return "Necro-Brustplatte"; + case 153: + return "Necro-Beinschuetzer"; + case 154: + return "Knochen"; + case 155: + return "Muramasa"; + case 156: + return "Kobaltschild"; + case 157: + return "Aqua-Zepter"; + case 158: + return "Glueckshufeisen"; + case 159: + return "Leuchtend roter Ballon"; + case 160: + return "Harpune"; + case 161: + return "Stachelball"; + case 162: + return "Ball des Schmerzes"; + case 163: + return "Blauer Mond"; + case 164: + return "Pistole"; + case 165: + return "Wasserbolzen"; + case 166: + return "Bombe"; + case 167: + return "Dynamit"; + case 168: + return "Granate"; + case 169: + return "Sandblock"; + case 170: + return "Glas"; + case 171: + return "Spruchschild"; + case 172: + return "Aschenblock"; + case 173: + return "Obsidian"; + case 174: + return "HOeLLENSTEIN"; + case 175: + return "HOeLLENSTEIN-Barren"; + case 176: + return "Matschblock"; + case 177: + return "Saphir"; + case 178: + return "Rubin"; + case 179: + return "Smaragd"; + case 180: + return "Topas"; + case 181: + return "Amethyst"; + case 182: + return "Diamant"; + case 183: + return "Gluehender Pilz"; + case 184: + return "Stern"; + case 185: + return "Efeupeitsche"; + case 186: + return "Schnorchelschilf"; + case 187: + return "Flosse"; + case 188: + return "Heiltrank"; + case 189: + return "Manatrank"; + case 190: + return "Grasklinge"; + case 191: + return "Dornen-Chakram"; + case 192: + return "Obsidianziegel"; + case 193: + return "Obsidianschaedel"; + case 194: + return "Pilzgras-Saat"; + case 195: + return "Dschungelgras-Saat"; + case 196: + return "Holzhammer"; + case 197: + return "Sternenkanone"; + case 198: + return "Blaue Laserklinge"; + case 199: + return "Rote Laserklinge"; + case 200: + return "Gruene Laserklinge"; + case 201: + return "Lila Laserklinge"; + case 202: + return "Weisse Laserklinge"; + case 203: + return "Gelbe Laserklinge"; + case 204: + return "Meteor-Hamaxt"; + case 205: + return "Leerer Eimer"; + case 206: + return "Wassereimer"; + case 207: + return "Lavaeimer"; + case 208: + return "Dschungelrose"; + case 209: + return "Hornissenstachel"; + case 210: + return "Weinrebe"; + case 211: + return "Wilde Klauen"; + case 212: + return "Fusskette des Windes"; + case 213: + return "Stab des Nachwachsens"; + case 214: + return "Hoellensteinziegel"; + case 215: + return "Furzkissen"; + case 216: + return "Fessel"; + case 217: + return "Geschmolzene Hamaxt"; + case 218: + return "Flammenpeitsche"; + case 219: + return "Phoenix-Blaster"; + case 220: + return "Sonnenwut"; + case 221: + return "Hoellenschmiede"; + case 222: + return "Tontopf"; + case 223: + return "Geschenk der Natur"; + case 224: + return "Bett"; + case 225: + return "Seide"; + case 226: + return "Schwacher Wiederherstellungstrank"; + case 227: + return "Wiederherstellungstrank"; + case 228: + return "Dschungelhut"; + case 229: + return "Dschungelhemd"; + case 230: + return "Dschungelhosen"; + case 231: + return "Geschmolzener Helm"; + case 232: + return "Geschmolzene Brustplatte"; + case 233: + return "Geschmolzene Beinschuetzer"; + case 234: + return "Meteorenschuss"; + case 235: + return "Haftbombe"; + case 236: + return "Schwarze Linsen"; + case 237: + return "Sonnenbrille"; + case 238: + return "Zaubererhut"; + case 239: + return "Zylinderhut"; + case 240: + return "Smokinghemd"; + case 241: + return "Smokinghosen"; + case 242: + return "Sommerhut"; + case 243: + return "Hasenkapuze"; + case 244: + return "Klempnerhut"; + case 245: + return "Klempnerhemd"; + case 246: + return "Klempnerhosen"; + case 247: + return "Heldenhut"; + case 248: + return "Heldenhemd"; + case 249: + return "Heldenhosen"; + case 250: + return "Fischglas"; + case 251: + return "Archaeologenhut"; + case 252: + return "Archaeologenjacke"; + case 253: + return "Archaeologenhosen"; + case 254: + return "Schwarzer Farbstoff"; + case 255: + return "Gruener Farbstoff"; + case 256: + return "Ninja-Kapuze"; + case 257: + return "Ninjahemd"; + case 258: + return "Ninjahosen"; + case 259: + return "Leder"; + case 260: + return "Roter Hut"; + case 261: + return "Goldfisch"; + case 262: + return "Robe"; + case 263: + return "Roboterhut"; + case 264: + return "Goldkrone"; + case 265: + return "Hoellenfeuer-Pfeil"; + case 266: + return "Sandgewehr"; + case 267: + return "Fremdenfuehrer-Voodoo-Puppe"; + case 268: + return "Taucherhelm"; + case 269: + return "Vertrautes Hemd"; + case 270: + return "Vertraute Hosen"; + case 271: + return "Vertraute Frisur"; + case 272: + return "Daemonensense"; + case 273: + return "Klinge der Nacht"; + case 274: + return "Dunkle Lanze"; + case 275: + return "Koralle"; + case 276: + return "Kaktus"; + case 277: + return "Dreizack"; + case 278: + return "Silberkugel"; + case 279: + return "Wurfmesser"; + case 280: + return "Speer"; + case 281: + return "Blasrohr"; + case 282: + return "Leuchtstab"; + case 283: + return "Saat"; + case 284: + return "Holzbumerang"; + case 285: + return "Schnuersenkelkappe"; + case 286: + return "Klebriger Leuchtstab"; + case 287: + return "Giftmesser"; + case 288: + return "Obsidianhaut-Trank"; + case 289: + return "Wiederbelebungstrank"; + case 290: + return "Flinkheitstrank"; + case 291: + return "Kiementrank"; + case 292: + return "Eisenhaut-Trank"; + case 293: + return "Mana-Wiederherstellungstrank"; + case 294: + return "Magiekraft-Trank"; + case 295: + return "Federsturz-Trank"; + case 296: + return "Hoehlenforschertrank"; + case 297: + return "Unsichtbarkeitstrank"; + case 298: + return "Strahlentrank"; + case 299: + return "Nachteulentrank"; + case 300: + return "Kampftrank"; + case 301: + return "Dornentrank"; + case 302: + return "Wasserlauftrank"; + case 303: + return "Bogenschiessrank"; + case 304: + return "Jaegertrank"; + case 305: + return "Gravitationstrank"; + case 306: + return "Goldtruhe"; + case 307: + return "Tagesblumensaat"; + case 308: + return "Mondscheinsaat"; + case 309: + return "Leuchtwurzel-Saat"; + case 310: + return "Todeskraut-Saat"; + case 311: + return "Wasserblatt-Saat"; + case 312: + return "Feuerblueten-Saat"; + case 313: + return "Tagesblume"; + case 314: + return "Mondglanz"; + case 315: + return "Leuchtwurzel"; + case 316: + return "Todeskraut"; + case 317: + return "Wasserblatt"; + case 318: + return "Feuerbluete"; + case 319: + return "Haifinne"; + case 320: + return "Feder"; + case 321: + return "Grabstein"; + case 322: + return "Imitatormaske"; + case 323: + return "Ameisenloewenkiefer"; + case 324: + return "Illegale Gewehrteile"; + case 325: + return "Hemd des Arztes"; + case 326: + return "Hosen des Arztes"; + case 327: + return "Goldener Schluessel"; + case 328: + return "Schattentruhe"; + case 329: + return "Schattenschluessel"; + case 330: + return "Obsidianziegelwand"; + case 331: + return "Dschungelsporen"; + case 332: + return "Webstuhl"; + case 333: + return "Piano"; + case 334: + return "Kommode"; + case 335: + return "Sitzbank"; + case 336: + return "Badewanne"; + case 337: + return "Rotes Dekoband"; + case 338: + return "Gruenes Dekoband"; + case 339: + return "Blaues Dekoband"; + case 340: + return "Gelbes Dekoband"; + case 341: + return "Laternenpfahl"; + case 342: + return "Petroleumfackel"; + case 343: + return "Fass"; + case 344: + return "Chinesische Laterne"; + case 345: + return "Kochtopf"; + case 346: + return "Tresor"; + case 347: + return "Schaedellaterne"; + case 348: + return "Muelleimer"; + case 349: + return "Kandelaber"; + case 350: + return "Rosa Vase"; + case 351: + return "Masskrug"; + case 352: + return "Gaerbottich"; + case 353: + return "Bier"; + case 354: + return "Buecherregal"; + case 355: + return "Thron"; + case 356: + return "Schuessel"; + case 357: + return "Schuessel mit Suppe"; + case 358: + return "Toilette"; + case 359: + return "Standuhr"; + case 360: + return "Ruestungsstatue"; + case 361: + return "Goblin-Kampfstandarte"; + case 362: + return "Zerfetzter Stoff"; + case 363: + return "Saegewerk"; + case 364: + return "Kobalterz"; + case 365: + return "Mithrilerz"; + case 366: + return "Adamantiterz"; + case 367: + return "Pwnhammer"; + case 368: + return "Excalibur"; + case 369: + return "Gesegnete Saat"; + case 370: + return "Ebensandblock"; + case 371: + return "Kobalthut"; + case 372: + return "Kobalthelm"; + case 373: + return "Kobalt-Maske"; + case 374: + return "Kobalt-Brustplatte"; + case 375: + return "Kobalt-Gamaschen"; + case 376: + return "Mithril-Kapuze"; + case 377: + return "Mithril-Helm"; + case 378: + return "Mithrilhut"; + case 379: + return "Mithril-Kettenhemd"; + case 380: + return "Mithril-Beinschuetzer"; + case 381: + return "Kobaltbarren"; + case 382: + return "Mithrilbarren"; + case 383: + return "Kobalt-Kettensaege"; + case 384: + return "Mithril-Kettensaege"; + case 385: + return "Kobaltbohrer"; + case 386: + return "Mithrilbohrer"; + case 387: + return "Adamantit-Kettensaege"; + case 388: + return "Adamantitbohrer"; + case 389: + return "Dao von Pow"; + case 390: + return "Mithril-Hellebarde"; + case 391: + return "Adamantitbarren"; + case 392: + return "Glaswand"; + case 393: + return "Kompass"; + case 394: + return "Tauchausruestung"; + case 395: + return "GPS"; + case 396: + return "Obsidian-Hufeisen"; + case 397: + return "Obsidianschild"; + case 398: + return "Tueftler-Werkstatt"; + case 399: + return "Wolke in einem Ballon"; + case 400: + return "Adamantitkopfschutz"; + case 401: + return "Adamantithelm"; + case 402: + return "Adamantitmaske"; + case 403: + return "Adamantitbrustplatte"; + case 404: + return "Adamantitgamaschen"; + case 405: + return "Geisterstiefel"; + case 406: + return "Adamantitgleve"; + case 407: + return "Werkzeugguertel"; + case 408: + return "Perlsandblock"; + case 409: + return "Perlsteinblock"; + case 410: + return "Bergbauhemd"; + case 411: + return "Bergbauhosen"; + case 412: + return "Perlsteinziegel"; + case 413: + return "Schillernder Ziegel"; + case 414: + return "Schlammsteinblock"; + case 415: + return "Kobaltziegel"; + case 416: + return "Mithrilziegel"; + case 417: + return "Perlsteinziegelwand"; + case 418: + return "Schillernde Ziegelwand"; + case 419: + return "Schlammsteinziegelwand"; + case 420: + return "Kobaltziegelwand"; + case 421: + return "Mithrilziegelwand"; + case 422: + return "Heiliges Wasser"; + case 423: + return "Unheiliges Wasser"; + case 424: + return "Schlickblock"; + case 425: + return "Feenglocke"; + case 426: + return "Schmetterklinge"; + case 427: + return "Blaue Fackel"; + case 428: + return "Rote Fackel"; + case 429: + return "Gruene Fackel"; + case 430: + return "Lila Fackel"; + case 431: + return "Weisse Fackel"; + case 432: + return "Gelbe Fackel"; + case 433: + return "Daemonenfackel"; + case 434: + return "Automatiksturmwaffe"; + case 435: + return "Kobaltrepetierer"; + case 436: + return "Mithrilrepetierer"; + case 437: + return "Dual-Haken"; + case 438: + return "Sternstatue"; + case 439: + return "Schwertstatue"; + case 440: + return "Schleimistatue"; + case 441: + return "Goblinstatue"; + case 442: + return "Schildstatue"; + case 443: + return "Fledermausstatue"; + case 444: + return "Fischstatue"; + case 445: + return "Haeschenstatue"; + case 446: + return "Skelettstatue"; + case 447: + return "Sensenmannstatue"; + case 448: + return "Frauenstatue"; + case 449: + return "Impstatue"; + case 450: + return "Wasserspeier-Statue"; + case 451: + return "Vanitasstatue"; + case 452: + return "Hornissenstatue"; + case 453: + return "Bombenstatue"; + case 454: + return "Krabbenstatue"; + case 455: + return "Hammerstatue"; + case 456: + return "Trankstatue"; + case 457: + return "Speerstatue"; + case 458: + return "Kreuzstatue"; + case 459: + return "Quallenstatue"; + case 460: + return "Bogenstatue"; + case 461: + return "Bumerangstatue"; + case 462: + return "Stiefelstatue"; + case 463: + return "Truhenstatue"; + case 464: + return "Vogelstatue"; + case 465: + return "Axtstatue"; + case 466: + return "Verderbnisstatue"; + case 467: + return "Baumstatue"; + case 468: + return "Amboss-Statue"; + case 469: + return "Spitzhackenstatue"; + case 470: + return "Pilzstatue"; + case 471: + return "Augapfelstatue"; + case 472: + return "Saeulenstatue"; + case 473: + return "Herzstatue"; + case 474: + return "Topfstatue"; + case 475: + return "Sonnenblumenstatue"; + case 476: + return "Koenigstatue"; + case 477: + return "Koeniginstatue"; + case 478: + return "Pirahnastatue"; + case 479: + return "Plankenwand"; + case 480: + return "Holzbalken"; + case 481: + return "Adamantitrepetierer"; + case 482: + return "Adamantitschwert"; + case 483: + return "Kobaltschwert"; + case 484: + return "Mithrilschwert"; + case 485: + return "Mondzauber"; + case 486: + return "Massgitter"; + case 487: + return "Kristallkugel"; + case 488: + return "Diskokugel"; + case 489: + return "Hexeremblem"; + case 490: + return "Kriegeremblem"; + case 491: + return "Waldlaeufer-Emblem"; + case 492: + return "Daemonenfluegel"; + case 493: + return "Engelsfluegel"; + case 494: + return "Magische Harfe"; + case 495: + return "Regenbogenrute"; + case 496: + return "Eisrute"; + case 497: + return "Neptuns Muschel"; + case 498: + return "Mannequin"; + case 499: + return "Grosser Heiltrank"; + case 500: + return "Grosser Manatrank"; + case 501: + return "Pixie-Staub"; + case 502: + return "Kristallscherbe"; + case 503: + return "Clownshut"; + case 504: + return "Clownshemd"; + case 505: + return "Clownshosen"; + case 506: + return "Flammenwerfer"; + case 507: + return "Glocke"; + case 508: + return "Harfe"; + case 509: + return "Schraubenschluessel"; + case 510: + return "Kabelcutter"; + case 511: + return "Aktiver Steinblock"; + case 512: + return "Inaktiver Steinblock"; + case 513: + return "Hebel"; + case 514: + return "Lasergewehr"; + case 515: + return "Kristallgeschoss"; + case 516: + return "Heiliger Pfeil"; + case 517: + return "Magischer Dolch"; + case 518: + return "Kristallsturm"; + case 519: + return "Verfluchte Flammen"; + case 520: + return "Seele des Lichts"; + case 521: + return "Seele der Nacht"; + case 522: + return "Verfluchte Flamme"; + case 523: + return "Verfluchte Fackel"; + case 524: + return "Adamantitschmiede"; + case 525: + return "Mithrilamboss"; + case 526: + return "Horn des Einhorns"; + case 527: + return "Dunkle Scherbe"; + case 528: + return "Lichtscherbe"; + case 529: + return "Rote Druckplatte"; + case 530: + return "Kabel"; + case 531: + return "Buch der Flueche"; + case 532: + return "Sternenumhang"; + case 533: + return "Maxihai"; + case 534: + return "Schrotflinte"; + case 535: + return "Stein der Weisen"; + case 536: + return "Titanhandschuh"; + case 537: + return "Kobalt-Naginata"; + case 538: + return "Schalter"; + case 539: + return "Pfeilfalle"; + case 540: + return "Felsbrocken"; + case 541: + return "Gruene Druckplatte"; + case 542: + return "Graue Druckplatte"; + case 543: + return "Braune Druckplatte"; + case 544: + return "Mechanisches Auge"; + case 545: + return "Verfluchter Pfeil"; + case 546: + return "Verfluchte Kugel"; + case 547: + return "Seele des Schreckens"; + case 548: + return "Seele der Macht"; + case 549: + return "Seele der Einsicht"; + case 550: + return "Gungnir"; + case 551: + return "Gesegneter Plattenpanzer"; + case 552: + return "Geheiligte Beinschuetzer"; + case 553: + return "Gesegneter Helm"; + case 554: + return "Kreuzhalskette"; + case 555: + return "Mana-Blume"; + case 556: + return "Mechanischer Wurm"; + case 557: + return "Mechanischer Schaedel"; + case 558: + return "Gesegneter Kopfschutz"; + case 559: + return "Gesegnete Maske"; + case 560: + return "Schleimikrone"; + case 561: + return "Lichtscheibe"; + case 562: + return "Musikbox (Tag auf der Oberwelt)"; + case 563: + return "Musikbox (Gespenstisch)"; + case 564: + return "Musikbox (Nacht)"; + case 565: + return "Musikbox (Titel)"; + case 566: + return "Musikbox (Unterirdisch)"; + case 567: + return "Musikbox (Boss 1)"; + case 568: + return "Musikbox (Dschungel)"; + case 569: + return "Musikbox (Verderben)"; + case 570: + return "Musikbox(Unterirdisches Verderben)"; + case 571: + return "Musikbox (Das Gesegnete)"; + case 572: + return "Musikbox (Boss 2)"; + case 573: + return "Musikbox (Unterirdisches Gesegnetes)"; + case 574: + return "Musikbox (Boss 3)"; + case 575: + return "Seele des Flugs"; + case 576: + return "Musikbox"; + case 577: + return "Daemonitziegel"; + case 578: + return "Gesegneter Repetierer"; + case 579: + return "Drax"; + case 580: + return "Explosiva"; + case 581: + return "Einlasspumpe"; + case 582: + return "Auslasspumpe"; + case 583: + return "1-Sekunden-Timer"; + case 584: + return "3-Sekunden-Timer"; + case 585: + return "5-Sekunden-Timer"; + case 586: + return "Candy Cane-Block"; + case 587: + return "Candy Cane Wand"; + case 588: + return "Weihnachtsmütze"; + case 589: + return "Santa Shirt"; + case 590: + return "von Santa Pants"; + case 591: + return "Grüne Candy Cane-Block"; + case 592: + return "Grüne Candy Cane Wand"; + case 593: + return "Schnee-Block"; + case 594: + return "Schnee Brick"; + case 595: + return "Schnee Brick Wall"; + case 596: + return "Blue Light"; + case 597: + return "Rotlicht"; + case 598: + return "Green Light"; + case 599: + return "blaue Gegenwart"; + case 600: + return "grüne Gegenwart"; + case 601: + return "Yellow Gegenwart"; + case 602: + return "Snow Globe"; + case 603: + return "Karotte"; + } + } + else + { + if (Lang.lang == 3) + { + switch (l) + { + case -24: + return "Spada laser gialla"; + case -23: + return "Spada laser bianca"; + case -22: + return "Spada laser viola"; + case -21: + return "Spada laser verde"; + case -20: + return "Spada laser rossa"; + case -19: + return "Spada laser blu"; + case -18: + return "Arco di rame"; + case -17: + return "Martello di rame"; + case -16: + return "Ascia di rame"; + case -15: + return "Spada corta di rame"; + case -14: + return "Spadone di rame"; + case -13: + return "Piccone di rame"; + case -12: + return "Arco d'argento"; + case -11: + return "Martello d'argento"; + case -10: + return "Ascia d'argento"; + case -9: + return "Spada corta d'argento"; + case -8: + return "Spadone d'argento"; + case -7: + return "Piccone d'argento"; + case -6: + return "Arco d'oro"; + case -5: + return "Martello d'oro"; + case -4: + return "Ascia d'oro"; + case -3: + return "Spada corta d'oro"; + case -2: + return "Spadone d'oro"; + case -1: + return "Piccone d'oro"; + case 1: + return "Piccone di ferro"; + case 2: + return "Blocco di terra"; + case 3: + return "Blocco di pietra"; + case 4: + return "Spadone di ferro"; + case 5: + return "Fungo"; + case 6: + return "Spada corta di ferro"; + case 7: + return "Martello di ferro"; + case 8: + return "Fiaccola"; + case 9: + return "Legno"; + case 10: + return "Ascia di ferro"; + case 11: + return "Minerale di ferro"; + case 12: + return "Minerale di rame"; + case 13: + return "Minerale d'oro"; + case 14: + return "Minerale d'argento"; + case 15: + return "Orologio di rame"; + case 16: + return "Orologio d'argento"; + case 17: + return "Orologio d'oro"; + case 18: + return "Misuratore di profondità"; + case 19: + return "Sbarra d'oro"; + case 20: + return "Sbarra di rame"; + case 21: + return "Sbarra d'argento"; + case 22: + return "Sbarra di ferro"; + case 23: + return "Gel"; + case 24: + return "Spada di legno"; + case 25: + return "Porta di legno"; + case 26: + return "Muro di pietra"; + case 27: + return "Ghianda"; + case 28: + return "Pozione curativa inferiore"; + case 29: + return "Cristallo di vita"; + case 30: + return "Muro di terra"; + case 31: + return "Bottiglia"; + case 32: + return "Tavolo di legno"; + case 33: + return "Forno"; + case 34: + return "Sedia di legno"; + case 35: + return "Incudine di ferro"; + case 36: + return "Banco di lavoro"; + case 37: + return "Occhiali protettivi"; + case 38: + return "Lenti"; + case 39: + return "Arco di legno"; + case 40: + return "Freccia di legno"; + case 41: + return "Freccia infuocata"; + case 42: + return "Shuriken"; + case 43: + return "Occhio diffidente"; + case 44: + return "Arco demoniaco"; + case 45: + return "Ascia da guerra della notte"; + case 46: + return "Flagello di luce"; + case 47: + return "Freccia empia"; + case 48: + return "Cassa"; + case 49: + return "Benda di rigenerazione"; + case 50: + return "Specchio magico"; + case 51: + return "Freccia del giullare"; + case 52: + return "Statua dell'angelo"; + case 53: + return "Nuvola in bottiglia"; + case 54: + return "Stivali di Ermes"; + case 55: + return "Boomerang incantato"; + case 56: + return "Minerale demoniaco"; + case 57: + return "Sbarra demoniaca"; + case 58: + return "Cuore"; + case 59: + return "Semi distrutti"; + case 60: + return "Fungo disgustoso"; + case 61: + return "Blocco pietra d'ebano"; + case 62: + return "Semi d'erba"; + case 63: + return "Girasole"; + case 64: + return "Spina vile"; + case 65: + return "Furia stellare"; + case 66: + return "Polvere purificatrice"; + case 67: + return "Polvere disgustosa"; + case 68: + return "Ceppo marcio"; + case 69: + return "Dente di verme"; + case 70: + return "Esca di verme"; + case 71: + return "Moneta di rame"; + case 72: + return "Moneta d'argento"; + case 73: + return "Moneta d'oro"; + case 74: + return "Moneta di platino"; + case 75: + return "Stella cadente"; + case 76: + return "Gambali di rame"; + case 77: + return "Gambali di ferro"; + case 78: + return "Gambali d'argento"; + case 79: + return "Gambali d'oro"; + case 80: + return "Maglia metallica di rame"; + case 81: + return "Maglia metallica di ferro"; + case 82: + return "Maglia metallica d'argento"; + case 83: + return "Maglia metallica d'oro"; + case 84: + return "Rampino"; + case 85: + return "Catena di ferro"; + case 86: + return "Scaglia d'ombra"; + case 87: + return "Salvadanaio"; + case 88: + return "Casco da minatore"; + case 89: + return "Casco di rame"; + case 90: + return "Casco di ferro"; + case 91: + return "Casco d'argento"; + case 92: + return "Casco d'oro"; + case 93: + return "Muro di legno"; + case 94: + return "Piattaforma di legno"; + case 95: + return "Pistola a pietra focaia"; + case 96: + return "Moschetto"; + case 97: + return "Palla di moschetto"; + case 98: + return "Minishark"; + case 99: + return "Arco di ferro"; + case 100: + return "Gambali ombra"; + case 101: + return "Armatura a scaglie ombra"; + case 102: + return "Casco ombra"; + case 103: + return "Piccone dell'incubo"; + case 104: + return "Il Distruttore"; + case 105: + return "Candela"; + case 106: + return "Lampadario di rame"; + case 107: + return "Lampadario d'argento"; + case 108: + return "Lampadario d'oro"; + case 109: + return "Cristallo mana"; + case 110: + return "Pozione mana inferiore"; + case 111: + return "Benda della forza stellare"; + case 112: + return "Fiore di fuoco"; + case 113: + return "Missile magico"; + case 114: + return "Bastone di terra"; + case 115: + return "Orbita di luce"; + case 116: + return "Meteorite"; + case 117: + return "Sbarra di meteorite"; + case 118: + return "Uncino"; + case 119: + return "Flamarang"; + case 120: + return "Furia fusa"; + case 121: + return "Spadone di fuoco"; + case 122: + return "Piccone fuso"; + case 123: + return "Casco meteorite"; + case 124: + return "Tunica di meteorite"; + case 125: + return "Meteora pantaloni"; + case 126: + return "Acqua imbottigliata"; + case 127: + return "Spazio pistola"; + case 128: + return "Stivali razzo"; + case 129: + return "Mattone grigio"; + case 130: + return "Muro grigio"; + case 131: + return "Mattone rosso"; + case 132: + return "Muro rosso"; + case 133: + return "Blocco d'argilla"; + case 134: + return "Mattone blu"; + case 135: + return "Muro blu"; + case 136: + return "Lanterna con catena"; + case 137: + return "Mattone verde"; + case 138: + return "Muro verde"; + case 139: + return "Mattone rosa"; + case 140: + return "Muro rosa"; + case 141: + return "Mattone dorato"; + case 142: + return "Muro dorato"; + case 143: + return "Mattone argentato"; + case 144: + return "Muro argentato"; + case 145: + return "Mattone di rame"; + case 146: + return "Muro di rame"; + case 147: + return "Spina"; + case 148: + return "Candela d'acqua"; + case 149: + return "Libro"; + case 150: + return "Ragnatela"; + case 151: + return "Casco funebre"; + case 152: + return "Pettorale funebre"; + case 153: + return "Gambali funebri"; + case 154: + return "Osso"; + case 155: + return "Muramasa"; + case 156: + return "Scudo di cobalto"; + case 157: + return "Scettro d'acqua"; + case 158: + return "Ferro di cavallo fortunato"; + case 159: + return "Palloncino rosso splendente"; + case 160: + return "Arpione"; + case 161: + return "Palla chiodata"; + case 162: + return "Palla del dolore"; + case 163: + return "Luna blu"; + case 164: + return "Pistola"; + case 165: + return "Dardo d'acqua"; + case 166: + return "Bomba"; + case 167: + return "Dinamite"; + case 168: + return "Granata"; + case 169: + return "Blocco di sabbia"; + case 170: + return "Vetro"; + case 171: + return "Cartello"; + case 172: + return "Blocco di cenere"; + case 173: + return "Ossidiana"; + case 174: + return "Pietra infernale"; + case 175: + return "Sbarra di pietra infernale"; + case 176: + return "Blocco di fango"; + case 177: + return "Zaffiro"; + case 178: + return "Rubino"; + case 179: + return "Smeraldo"; + case 180: + return "Topazio"; + case 181: + return "Ametista"; + case 182: + return "Diamante"; + case 183: + return "Fungo luminoso"; + case 184: + return "Stella"; + case 185: + return "Frusta di edera"; + case 186: + return "Canna per la respirazione"; + case 187: + return "Pinna"; + case 188: + return "Pozione curativa"; + case 189: + return "Pozione mana"; + case 190: + return "Spada di erba"; + case 191: + return "Artiglio di Chakram"; + case 192: + return "Mattone di ossidiana"; + case 193: + return "Teschio di ossidiana"; + case 194: + return "Semi di fungo"; + case 195: + return "Semi dell'erba della giungla"; + case 196: + return "Martello di legno"; + case 197: + return "Cannone stellare"; + case 198: + return "Spada laser blu"; + case 199: + return "Spada laser rossa"; + case 200: + return "Spada laser verde"; + case 201: + return "Spada laser viola"; + case 202: + return "Spada laser bianca"; + case 203: + return "Spada laser gialla"; + case 204: + return "Maglio di meteorite"; + case 205: + return "Secchio vuoto"; + case 206: + return "Secchio d'acqua"; + case 207: + return "Secchio di lava"; + case 208: + return "Rosa della giungla"; + case 209: + return "Artiglio"; + case 210: + return "Vite"; + case 211: + return "Artigli bestiali"; + case 212: + return "Cavigliera del vento"; + case 213: + return "Bastone della ricrescita"; + case 214: + return "Mattone di pietra infernale"; + case 215: + return "Cuscino rumoroso"; + case 216: + return "Grillo"; + case 217: + return "Maglio fuso"; + case 218: + return "Lanciatore di fiamma"; + case 219: + return "Blaster della fenice"; + case 220: + return "Furia del sole"; + case 221: + return "Creazione degli inferi"; + case 222: + return "Vaso di argilla"; + case 223: + return "Dono della natura"; + case 224: + return "Letto"; + case 225: + return "Seta"; + case 226: + return "Pozione di ripristino inferiore"; + case 227: + return "Pozione di ripristino"; + case 228: + return "Cappello della giungla"; + case 229: + return "Camicia della giungla"; + case 230: + return "Pantaloni della giungla"; + case 231: + return "Casco fuso"; + case 232: + return "Pettorale fuso"; + case 233: + return "Gambali fusi"; + case 234: + return "Sparo di meteorite"; + case 235: + return "Bomba appiccicosa"; + case 236: + return "Lenti nere"; + case 237: + return "Occhiali da sole"; + case 238: + return "Cappello dello stregone"; + case 239: + return "Cilindro"; + case 240: + return "Camicia da smoking"; + case 241: + return "Pantaloni smoking"; + case 242: + return "Cappello estivo"; + case 243: + return "Cappuccio da coniglio"; + case 244: + return "Cappello da idraulico"; + case 245: + return "Camicia da idraulico"; + case 246: + return "Pantaloni da idraulico"; + case 247: + return "Cappello da eroe"; + case 248: + return "Camicia da eroe"; + case 249: + return "Pantaloni da eroe"; + case 250: + return "Boccia dei pesci rossi"; + case 251: + return "Cappello da archeologo"; + case 252: + return "Giacca da archeologo"; + case 253: + return "Pantaloni da archeologo"; + case 254: + return "Tintura nera"; + case 255: + return "Tintura verde"; + case 256: + return "Cappuccio ninja"; + case 257: + return "Camicia ninja"; + case 258: + return "Pantaloni ninja"; + case 259: + return "Pelle"; + case 260: + return "Cappello rosso"; + case 261: + return "Pesce rosso"; + case 262: + return "Mantello"; + case 263: + return "Cappello da robot"; + case 264: + return "Corona d'oro"; + case 265: + return "Freccia di fuoco infernale"; + case 266: + return "Pistola di sabbia"; + case 267: + return "Bambola voodoo guida"; + case 268: + return "Casco da palombaro"; + case 269: + return "Camicia comune"; + case 270: + return "Pantaloni comuni"; + case 271: + return "Parrucca comune"; + case 272: + return "Falce demoniaca"; + case 273: + return "Confine della notte"; + case 274: + return "Lancia oscura"; + case 275: + return "Corallo"; + case 276: + return "Cactus"; + case 277: + return "Tridente"; + case 278: + return "Proiettile d'argento"; + case 279: + return "Coltello da lancio"; + case 280: + return "Lancia"; + case 281: + return "Cerbottana"; + case 282: + return "Bastone luminoso"; + case 283: + return "Seme"; + case 284: + return "Boomerang di legno"; + case 285: + return "Aghetto"; + case 286: + return "Bastone luminoso appiccicoso"; + case 287: + return "Coltello avvelenato"; + case 288: + return "Pozione pelle di ossidiana"; + case 289: + return "Pozione rigeneratrice"; + case 290: + return "Pozione della rapidità"; + case 291: + return "Pozione branchie"; + case 292: + return "Pozione pelle di ferro"; + case 293: + return "Pozione rigenerazione mana"; + case 294: + return "Pozione potenza magica"; + case 295: + return "Pozione caduta dolce"; + case 296: + return "Pozione speleologo"; + case 297: + return "Pozione invisibilità"; + case 298: + return "Pozione splendore"; + case 299: + return "Pozione civetta"; + case 300: + return "Pozione battaglia"; + case 301: + return "Pozione spine"; + case 302: + return "Pozione per camminare sull'acqua"; + case 303: + return "Pozione arciere"; + case 304: + return "Pozione cacciatore"; + case 305: + return "Pozione gravità"; + case 306: + return "Cassa d'oro"; + case 307: + return "Semi Fiordigiorno"; + case 308: + return "Semi Splendiluna"; + case 309: + return "Semi Lampeggiaradice"; + case 310: + return "Semi Erbamorte"; + case 311: + return "Semi Acquafoglia"; + case 312: + return "Semi Fiordifuoco"; + case 313: + return "Fiordigiorno"; + case 314: + return "Splendiluna"; + case 315: + return "Lampeggiaradice"; + case 316: + return "Erbamorte"; + case 317: + return "Acquafoglia"; + case 318: + return "Fiordifuoco"; + case 319: + return "Pinna di squalo"; + case 320: + return "Piuma"; + case 321: + return "Lapide"; + case 322: + return "Maschera sosia"; + case 323: + return "Mandibola di formicaleone"; + case 324: + return "Parti di pistola illegale"; + case 325: + return "Camicia da medico"; + case 326: + return "Pantaloni da medico"; + case 327: + return "Chiave dorata"; + case 328: + return "Cassa ombra"; + case 329: + return "Chiave ombra"; + case 330: + return "Muro di ossidiana"; + case 331: + return "Spore della giungla"; + case 332: + return "Telaio"; + case 333: + return "Pianoforte"; + case 334: + return "Cassettone"; + case 335: + return "Panca"; + case 336: + return "Vasca da bagno"; + case 337: + return "Stendardo rosso"; + case 338: + return "Stendardo verde"; + case 339: + return "Stendardo blu"; + case 340: + return "Stendardo giallo"; + case 341: + return "Lampione"; + case 342: + return "Torcia tiki"; + case 343: + return "Barile"; + case 344: + return "Lanterna cinese"; + case 345: + return "Pentola"; + case 346: + return "Caveau"; + case 347: + return "Lanterna-teschio"; + case 348: + return "Bidone"; + case 349: + return "Candelabro"; + case 350: + return "Vaso rosa"; + case 351: + return "Boccale"; + case 352: + return "Barilotto"; + case 353: + return "Birra"; + case 354: + return "Scaffale"; + case 355: + return "Trono"; + case 356: + return "Ciotola"; + case 357: + return "Ciotola di zuppa"; + case 358: + return "Toilette"; + case 359: + return "Pendola"; + case 360: + return "Statua armatura"; + case 361: + return "Insegna di battaglia dei goblin"; + case 362: + return "Abito a brandelli"; + case 363: + return "Segheria"; + case 364: + return "Minerale cobalto"; + case 365: + return "Minerale mitrilio"; + case 366: + return "Minerale adamantio"; + case 367: + return "Martellone"; + case 368: + return "Excalibur"; + case 369: + return "Semi consacrati"; + case 370: + return "Blocco sabbia d'ebano"; + case 371: + return "Cappello di cobalto"; + case 372: + return "Casco di cobalto"; + case 373: + return "Maschera di cobalto"; + case 374: + return "Corrazza di cobalto"; + case 375: + return "Calzamaglia di cobalto"; + case 376: + return "Cappuccio di mitrilio"; + case 377: + return "Casco di mitrilio"; + case 378: + return "Cappello di mitrilio"; + case 379: + return "Maglia metallica di mitrilio"; + case 380: + return "Gambali di mitrilio"; + case 381: + return "Sbarra di cobalto"; + case 382: + return "Sbarra di mitrilio"; + case 383: + return "Motosega di cobalto"; + case 384: + return "Motosega di mitrilio"; + case 385: + return "Perforatrice di cobalto"; + case 386: + return "Perforatrice di mitrilio"; + case 387: + return "Motosega di adamantio"; + case 388: + return "Perforatrice di adamantio"; + case 389: + return "Frustona"; + case 390: + return "Alabarda di mitrilio"; + case 391: + return "Sbarra di adamantio"; + case 392: + return "Muro di vetro"; + case 393: + return "Bussola"; + case 394: + return "Muta da sub"; + case 395: + return "GPS"; + case 396: + return "Ferro di cavallo di ossidiana"; + case 397: + return "Scudo di ossidiana"; + case 398: + return "Laboratorio dell'inventore"; + case 399: + return "Nuvola in un palloncino"; + case 400: + return "Copricapo di adamantio"; + case 401: + return "Casco di adamantio"; + case 402: + return "Maschera di adamantio"; + case 403: + return "Corrazza di adamantio"; + case 404: + return "Calzamaglia di adamantio"; + case 405: + return "Stivali da fantasma"; + case 406: + return "Alabarda di adamantio"; + case 407: + return "Cintura porta attrezzi"; + case 408: + return "Blocco sabbiaperla"; + case 409: + return "Blocco pietraperla"; + case 410: + return "Camicia da minatore"; + case 411: + return "Pantaloni da minatore"; + case 412: + return "Mattone pietraperla"; + case 413: + return "Mattone iridescente"; + case 414: + return "Blocco pietrafango"; + case 415: + return "Mattone cobalto"; + case 416: + return "Mattone mitrilio"; + case 417: + return "Muro di pietraperla"; + case 418: + return "Muro di mattoni iridescenti"; + case 419: + return "Muro di pietrafango"; + case 420: + return "Muro di mattoni di cobalto"; + case 421: + return "Muro di mattoni di mitrilio"; + case 422: + return "Acquasanta"; + case 423: + return "Acqua profana"; + case 424: + return "Blocco insabbiato"; + case 425: + return "Campana della fata"; + case 426: + return "Lama del distruttore"; + case 427: + return "Torcia blu"; + case 428: + return "Torcia rossa"; + case 429: + return "Torcia verde"; + case 430: + return "Torcia viola"; + case 431: + return "Torcia bianca"; + case 432: + return "Torcia gialla"; + case 433: + return "Torcia demoniaca"; + case 434: + return "Fucile d'assalto automatico"; + case 435: + return "Balestra automatica di cobalto"; + case 436: + return "Balestra automatica di mitrilio"; + case 437: + return "Gancio doppio"; + case 438: + return "Statua stella"; + case 439: + return "Statua spada"; + case 440: + return "Statua slime"; + case 441: + return "Statua goblin"; + case 442: + return "Statua scudo"; + case 443: + return "Statua pipistrello"; + case 444: + return "Statua pesce"; + case 445: + return "Statua coniglio"; + case 446: + return "Statua scheletro"; + case 447: + return "Statua mietitore"; + case 448: + return "Statua donna"; + case 449: + return "Statua diavoletto"; + case 450: + return "Statua gargoyle"; + case 451: + return "Statua tenebre"; + case 452: + return "Statua calabrone"; + case 453: + return "Statua bomba"; + case 454: + return "Statua granchio"; + case 455: + return "Statua martello"; + case 456: + return "Statua pozione"; + case 457: + return "Statua arpione"; + case 458: + return "Statua croce"; + case 459: + return "Statua medusa"; + case 460: + return "Statua arco"; + case 461: + return "Statua boomerang"; + case 462: + return "Statua stivali"; + case 463: + return "Statua cassa"; + case 464: + return "Statua Uucello"; + case 465: + return "Statua ascia"; + case 466: + return "Statua distruzione"; + case 467: + return "Statua albero"; + case 468: + return "Staua incudine"; + case 469: + return "Statua piccone"; + case 470: + return "Statua fungo"; + case 471: + return "Statua bulbo oculare"; + case 472: + return "Statua colonna"; + case 473: + return "Statua cuore"; + case 474: + return "Statua pentola"; + case 475: + return "Statua girasole"; + case 476: + return "Statua re"; + case 477: + return "Statua regina"; + case 478: + return "Statua piranha"; + case 479: + return "Muro impalcato"; + case 480: + return "Trave di legno"; + case 481: + return "Mietitore di adamantio"; + case 482: + return "Spada di adamantio"; + case 483: + return "Spada di cobalto"; + case 484: + return "Spada di mitrilio"; + case 485: + return "Amuleto della luna"; + case 486: + return "Righello"; + case 487: + return "Sfera di cristallo"; + case 488: + return "Palla disco"; + case 489: + return "Emblema dell'incantatore"; + case 490: + return "Emblema del guerriero"; + case 491: + return "Emblema del guardiaboschi"; + case 492: + return "Ali del demone"; + case 493: + return "Ali dell'angelo"; + case 494: + return "Arpa magica"; + case 495: + return "Bastone dell'arcobaleno"; + case 496: + return "Bastone di ghiaccio"; + case 497: + return "Conchiglia di Nettuno"; + case 498: + return "Manichino"; + case 499: + return "Pozione curativa superiore"; + case 500: + return "Pozione mana superiore"; + case 501: + return "Polvere di fata"; + case 502: + return "Frammento di cristallo"; + case 503: + return "Cappello da clown"; + case 504: + return "Camicia da clown"; + case 505: + return "Pantaloni da clown"; + case 506: + return "Lanciafiamme"; + case 507: + return "Campana"; + case 508: + return "Arpa"; + case 509: + return "Chiave inglese"; + case 510: + return "Tagliacavi"; + case 511: + return "Blocco di pietra attivo"; + case 512: + return "Blocco di pietra non attivo"; + case 513: + return "Leva"; + case 514: + return "Fucile laser"; + case 515: + return "Proiettile di cristallo"; + case 516: + return "Freccia sacra"; + case 517: + return "Pugnale magico"; + case 518: + return "Tempesta di cristallo"; + case 519: + return "Fiamme maledette"; + case 520: + return "Anima della luce"; + case 521: + return "Anima della notte"; + case 522: + return "Fiamma maledetta"; + case 523: + return "Torcia maledetta"; + case 524: + return "Fornace di adamantio"; + case 525: + return "Incudine di mitrilio"; + case 526: + return "Corno di unicorno"; + case 527: + return "Frammento oscuro"; + case 528: + return "Frammento di luce"; + case 529: + return "Piastra a pressione rossa"; + case 530: + return "Cavo"; + case 531: + return "Tomo incantato"; + case 532: + return "Mantello stellato"; + case 533: + return "Megashark"; + case 534: + return "Fucile"; + case 535: + return "Pietra filosofale"; + case 536: + return "Guanto del Titano"; + case 537: + return "Naginata di cobalto"; + case 538: + return "Interruttore"; + case 539: + return "Trappola dardi"; + case 540: + return "Masso"; + case 541: + return "Piastra a pressione verde"; + case 542: + return "Piastra a pressione grigia"; + case 543: + return "Piastra a pressione marrone"; + case 544: + return "Occhio meccanico"; + case 545: + return "Freccia maledetta"; + case 546: + return "Proiettile maledetto"; + case 547: + return "Anima del terrore"; + case 548: + return "Anima del potere"; + case 549: + return "Anima della visione"; + case 550: + return "Gungnir"; + case 551: + return "Armatura sacra"; + case 552: + return "Gambali sacri"; + case 553: + return "Casco sacro"; + case 554: + return "Collana con croce"; + case 555: + return "Fiore di mana"; + case 556: + return "Verme meccanico"; + case 557: + return "Teschio meccanico"; + case 558: + return "Copricapo sacro"; + case 559: + return "Maschera sacra"; + case 560: + return "Corona slime"; + case 561: + return "Disco di luce"; + case 562: + return "Musica (Giornata mondiale)"; + case 563: + return "Musica (Mistero)"; + case 564: + return "Musica (Notte)"; + case 565: + return "Musica (Titolo)"; + case 566: + return "Musica (Sottosuolo)"; + case 567: + return "Musica (Boss 1)"; + case 568: + return "Musica (Giungla)"; + case 569: + return "Musica (Distruzione)"; + case 570: + return "Musica (Distruzione sotterranea)"; + case 571: + return "Musica (Il sacro)"; + case 572: + return "Musica (Boss 2)"; + case 573: + return "Musica (Sacro sotterraneo)"; + case 574: + return "Musica (Boss 3)"; + case 575: + return "Anima del volo"; + case 576: + return "Musica"; + case 577: + return "Mattone demoniaco"; + case 578: + return "Balestra automatica sacra"; + case 579: + return "Perforascia"; + case 580: + return "Esplosivi"; + case 581: + return "Pompa interna"; + case 582: + return "Pompa esterna"; + case 583: + return "Timer 2 secondo"; + case 584: + return "Timer 3 secondi"; + case 585: + return "Timer 5 secondi"; + case 586: + return "Candy Cane Block"; + case 587: + return "Candy Cane parete"; + case 588: + return "Cappello da Babbo Natale"; + case 589: + return "S. Shirt"; + case 590: + return "Pantaloni di Santa"; + case 591: + return "Blocco verde Candy Cane"; + case 592: + return "Green Candy Cane Wall"; + case 593: + return "Blocca neve"; + case 594: + return "neve Brick"; + case 595: + return "Neve Muro di mattoni"; + case 596: + return "azzurro"; + case 597: + return "Red Light"; + case 598: + return "verde chiaro"; + case 599: + return "Presente blu"; + case 600: + return "Presente verde"; + case 601: + return "Presente giallo"; + case 602: + return "Snow Globe"; + case 603: + return "Carota"; + } + } + else + { + if (Lang.lang == 4) + { + switch (l) + { + case -24: + return "Sabre laser jaune"; + case -23: + return "Sabre laser blanc"; + case -22: + return "Sabre laser violet"; + case -21: + return "Sabre laser vert"; + case -20: + return "Sabre laser rouge"; + case -19: + return "Sabre laser bleu"; + case -18: + return "Arc en cuivre"; + case -17: + return "Marteau en cuivre"; + case -16: + return "Hache en cuivre"; + case -15: + return "Épée courte en cuivre"; + case -14: + return "Épée longue en cuivre"; + case -13: + return "Pioche en cuivre"; + case -12: + return "Arc en argent"; + case -11: + return "Marteau en argent"; + case -10: + return "Hache en argent"; + case -9: + return "Épée courte en argent"; + case -8: + return "Épée longue en argent"; + case -7: + return "Pioche en argent"; + case -6: + return "Arc en or"; + case -5: + return "Marteau en or"; + case -4: + return "Hache en or"; + case -3: + return "Épée courte en or"; + case -2: + return "Épée longue en or"; + case -1: + return "Pioche en or"; + case 1: + return "Pioche en fer"; + case 2: + return "Bloc de terre"; + case 3: + return "Bloc de pierre"; + case 4: + return "Épée longue en fer"; + case 5: + return "Champignon"; + case 6: + return "Épée courte en fer"; + case 7: + return "Marteau en fer"; + case 8: + return "Torche"; + case 9: + return "Bois"; + case 10: + return "Hache en fer"; + case 11: + return "Minerai de fer"; + case 12: + return "Minerai de cuivre"; + case 13: + return "Minerai d'or"; + case 14: + return "Minerai d'argent"; + case 15: + return "Montre en cuivre"; + case 16: + return "Montre en argent"; + case 17: + return "Montre en or"; + case 18: + return "Altimètre"; + case 19: + return "Lingot d'or"; + case 20: + return "Lingot de cuivre"; + case 21: + return "Lingot d'argent"; + case 22: + return "Lingot de fer"; + case 23: + return "Gel"; + case 24: + return "Épée en bois"; + case 25: + return "Porte en bois"; + case 26: + return "Mur en pierre"; + case 27: + return "Gland"; + case 28: + return "Faible potion de soin"; + case 29: + return "Cristal de vie"; + case 30: + return "Mur en terre"; + case 31: + return "Bouteille"; + case 32: + return "Table en bois"; + case 33: + return "Four"; + case 34: + return "Chaise en bois"; + case 35: + return "Enclume"; + case 36: + return "Établi"; + case 37: + return "Lunettes"; + case 38: + return "Lentille"; + case 39: + return "Arc en bois"; + case 40: + return "Flèche en bois"; + case 41: + return "Flèche enflammée"; + case 42: + return "Shuriken"; + case 43: + return "Œil observateur suspicieux"; + case 44: + return "Arc démoniaque"; + case 45: + return "Hache de guerre de la nuit"; + case 46: + return "Fléau de lumière"; + case 47: + return "Flèche impie"; + case 48: + return "Coffre"; + case 49: + return "Anneau de régénération"; + case 50: + return "Miroir magique"; + case 51: + return "Flèche du bouffon"; + case 52: + return "Statue d'ange"; + case 53: + return "Nuage en bouteille"; + case 54: + return "Bottes d'Hermès"; + case 55: + return "Boomerang enchanté"; + case 56: + return "Barre de démonite"; + case 57: + return "Lingot de démonite"; + case 58: + return "Pilier"; + case 59: + return "Graines corrompues"; + case 60: + return "Champignon infect"; + case 61: + return "Bloc d'ébonite"; + case 62: + return "Graines d'herbe"; + case 63: + return "Tournesols"; + case 64: + return "Vileronce"; + case 65: + return "Furie stellaire"; + case 66: + return "Poudre de purification"; + case 67: + return "Poudre infecte"; + case 68: + return "Morceau pourri"; + case 69: + return "Dent de ver"; + case 70: + return "Nourriture pour ver"; + case 71: + return "Pièce de cuivre"; + case 72: + return "Pièce d'argent"; + case 73: + return "Pièce d'or"; + case 74: + return "Pièce de platine"; + case 75: + return "Étoile filante"; + case 76: + return "Jambières en cuivre"; + case 77: + return "Jambières en fer"; + case 78: + return "Jambières en argent"; + case 79: + return "Jambière en or"; + case 80: + return "Cotte de mailles en cuivre"; + case 81: + return "Cotte de mailles en fer"; + case 82: + return "Cotte de mailles en argent"; + case 83: + return "Cotte de mailles en or"; + case 84: + return "Grappin"; + case 85: + return "Chaîne en fer"; + case 86: + return "Écaille sombre"; + case 87: + return "Tirelire"; + case 88: + return "Casque de mineur"; + case 89: + return "Casque en cuivre"; + case 90: + return "Casque en fer"; + case 91: + return "Casque en argent"; + case 92: + return "Casque en or"; + case 93: + return "Mur en bois"; + case 94: + return "Plateforme en bois"; + case 95: + return "Pistolet à silex"; + case 96: + return "Mousquet"; + case 97: + return "Balle de mousquet"; + case 98: + return "Minishark"; + case 99: + return "Arc en fer"; + case 100: + return "Jambières de l'ombre"; + case 101: + return "Armure d'écailles de l'ombre"; + case 102: + return "Casque de l'ombre"; + case 103: + return "Pioche cauchemardesque"; + case 104: + return "Le briseur"; + case 105: + return "Bougie"; + case 106: + return "Chandelier en cuivre"; + case 107: + return "Chandelier en argent"; + case 108: + return "Chandelier en or"; + case 109: + return "Cristal de mana"; + case 110: + return "Potion de mana inférieure"; + case 111: + return "Anneau de pouvoir stellaire"; + case 112: + return "Fleur de feu"; + case 113: + return "Missile magique"; + case 114: + return "Bâtonnet de terre"; + case 115: + return "Orbe de lumière"; + case 116: + return "Météorite"; + case 117: + return "Barre de météorite"; + case 118: + return "Crochet"; + case 119: + return "Flamarang"; + case 120: + return "Furie en fusion"; + case 121: + return "Grande épée ardente"; + case 122: + return "Pioche en fusion"; + case 123: + return "Casque de météore"; + case 124: + return "Costume de météore"; + case 125: + return "Leggings de météores"; + case 126: + return "Eau en bouteille"; + case 127: + return "Arme d'espace"; + case 128: + return "Bottes roquettes"; + case 129: + return "Brique grise"; + case 130: + return "Mur en briques grises"; + case 131: + return "Brique rouge"; + case 132: + return "Mur de briques rouges"; + case 133: + return "Bloc d'argile"; + case 134: + return "Brique bleue"; + case 135: + return "Mur en briques bleues"; + case 136: + return "Lanterne à chaîne"; + case 137: + return "Brique verte"; + case 138: + return "Mur de briques vertes"; + case 139: + return "Brique rose"; + case 140: + return "Mur de briques roses"; + case 141: + return "Brique dorée"; + case 142: + return "Mur de briques dorées"; + case 143: + return "Brique argentée"; + case 144: + return "Mur de briques argentées"; + case 145: + return "Brique cuivrée"; + case 146: + return "Mur de briques cuivrées"; + case 147: + return "Pointe"; + case 148: + return "Bougie d'eau"; + case 149: + return "Livre"; + case 150: + return "Toile d'araignée"; + case 151: + return "Casque nécro"; + case 152: + return "Plastron nécro"; + case 153: + return "Jambières nécro"; + case 154: + return "Os"; + case 155: + return "Muramasa"; + case 156: + return "Bouclier de cobalt"; + case 157: + return "Sceptre aquatique"; + case 158: + return "Fer à cheval porte-bonheur"; + case 159: + return "Ballon rouge brillant"; + case 160: + return "Harpon"; + case 161: + return "Balle hérissée"; + case 162: + return "Ball O' Hurt"; + case 163: + return "Lune bleue"; + case 164: + return "Pistolet"; + case 165: + return "Trait d'eau"; + case 166: + return "Bombe"; + case 167: + return "Dynamite"; + case 168: + return "Grenade"; + case 169: + return "Bloc de sable"; + case 170: + return "Verre"; + case 171: + return "Panneau"; + case 172: + return "Bloc de cendre"; + case 173: + return "Obsidienne"; + case 174: + return "Pierre de l'enfer"; + case 175: + return "Barre de pierre de l'enfer"; + case 176: + return "Bloc de boue"; + case 177: + return "Saphir"; + case 178: + return "Rubis"; + case 179: + return "Émeraude"; + case 180: + return "Topaze"; + case 181: + return "Améthyste"; + case 182: + return "Diamant"; + case 183: + return "Champignon lumineux"; + case 184: + return "Étoile"; + case 185: + return "Grappin à lianes"; + case 186: + return "Tuba"; + case 187: + return "Palmes"; + case 188: + return "Potion de soins"; + case 189: + return "Potion de mana"; + case 190: + return "Lame de l'herbe"; + case 191: + return "Chakram d'épines"; + case 192: + return "Brique d'obsidienne"; + case 193: + return "Crâne d'obsidienne"; + case 194: + return "Graines de champignon"; + case 195: + return "Graines de la jungle"; + case 196: + return "Marteau en bois"; + case 197: + return "Canon à étoiles"; + case 198: + return "Sabre laser bleu"; + case 199: + return "Sabre laser rouge"; + case 200: + return "Sabre laser vert"; + case 201: + return "Sabre laser violet"; + case 202: + return "Sabre laser blanc"; + case 203: + return "Sabre laser jaune"; + case 204: + return "Martache en météorite"; + case 205: + return "Seau vide"; + case 206: + return "Seau d'eau"; + case 207: + return "Seau de lave"; + case 208: + return "Rose de la jungle"; + case 209: + return "Dard"; + case 210: + return "Vigne"; + case 211: + return "Griffes sauvages"; + case 212: + return "Bracelet du vent"; + case 213: + return "Crosse de repousse"; + case 214: + return "Brique de pierre de l'enfer"; + case 215: + return "Coussin péteur"; + case 216: + return "Manille"; + case 217: + return "Martache en fusion"; + case 218: + return "Mèche enflammée"; + case 219: + return "Blaster phénix"; + case 220: + return "Furie solaire"; + case 221: + return "Forge infernale"; + case 222: + return "Pot d'argile"; + case 223: + return "Don de la nature"; + case 224: + return "Lit"; + case 225: + return "Soie"; + case 226: + return "Potion de restauration inférieure"; + case 227: + return "Potion de restauration"; + case 228: + return "Casque de la jungle"; + case 229: + return "Plastron de la jungle"; + case 230: + return "Jambières de la jungle"; + case 231: + return "Casque en fusion"; + case 232: + return "Plastron en fusion"; + case 233: + return "Jambières en fusion"; + case 234: + return "Balle météore"; + case 235: + return "Bombe collante"; + case 236: + return "Lentille noire"; + case 237: + return "Lunettes de soleil"; + case 238: + return "Chapeau de magicien"; + case 239: + return "Haut de forme"; + case 240: + return "Veste de smoking"; + case 241: + return "Pantalon de smoking"; + case 242: + return "Chapeau d'été"; + case 243: + return "Capuche de lapin"; + case 244: + return "Casquette de plombier"; + case 245: + return "Veste de plombier"; + case 246: + return "Pantalon de plombier"; + case 247: + return "Capuche de héros"; + case 248: + return "Veste de héros"; + case 249: + return "Pantalon de héros"; + case 250: + return "Bocal à poissons"; + case 251: + return "Chapeau d'archéologue"; + case 252: + return "Veste d'archéologue"; + case 253: + return "Pantalon d'archéologue"; + case 254: + return "Teinture noire"; + case 255: + return "Teinture verte"; + case 256: + return "Cagoule de ninja"; + case 257: + return "Veste de ninja"; + case 258: + return "Pantalon de ninja"; + case 259: + return "Cuir"; + case 260: + return "Chapeau rouge"; + case 261: + return "Poisson doré"; + case 262: + return "Robe"; + case 263: + return "Chapeau de robot"; + case 264: + return "Couronne d'or"; + case 265: + return "Flèche du feu de l'enfer"; + case 266: + return "Canon à sable"; + case 267: + return "Poupée vaudou du guide"; + case 268: + return "Casque de plongée"; + case 269: + return "Chemise familière"; + case 270: + return "Pantalon familier"; + case 271: + return "Perruque familière"; + case 272: + return "Faux de démon"; + case 273: + return "Fil des Ténèbres"; + case 274: + return "Lance sombre"; + case 275: + return "Corail"; + case 276: + return "Cactus"; + case 277: + return "Trident"; + case 278: + return "Balle d'argent"; + case 279: + return "Couteau de lancer"; + case 280: + return "Lance"; + case 281: + return "Sarbacane"; + case 282: + return "Bâton lumineux"; + case 283: + return "Graine"; + case 284: + return "Boomerang en bois"; + case 285: + return "Embout de lacet"; + case 286: + return "Bâton lumineux collant"; + case 287: + return "Couteau empoisonné"; + case 288: + return "Potion de peau d'obsidienne"; + case 289: + return "Potion de régénération"; + case 290: + return "Potion de rapidité"; + case 291: + return "Potion de branchies"; + case 292: + return "Potion de peau de fer"; + case 293: + return "Potion de régénération de mana"; + case 294: + return "Potion de pouvoir magique"; + case 295: + return "Potion de poids plume"; + case 296: + return "Potion de spéléologue"; + case 297: + return "Potion d'invisibilité"; + case 298: + return "Potion de brillance"; + case 299: + return "Potion de vision nocturne"; + case 300: + return "Potion de bataille"; + case 301: + return "Potion d'épines"; + case 302: + return "Potion de marche sur l'eau"; + case 303: + return "Potion de tir à l'arc"; + case 304: + return "Potion du chasseur"; + case 305: + return "Potion de gravité"; + case 306: + return "Coffre d'or"; + case 307: + return "Graines de floraison du jour"; + case 308: + return "Graines de lueur de lune"; + case 309: + return "Graines de racine clignotante"; + case 310: + return "Graines de mauvaise herbe morte"; + case 311: + return "Graines de feuilles de l'eau"; + case 312: + return "Graines de fleur de feu"; + case 313: + return "Floraison du jour"; + case 314: + return "Lueur de lune"; + case 315: + return "Racine clignotante"; + case 316: + return "Mauvaise herbe morte"; + case 317: + return "Feuille de l'eau"; + case 318: + return "Fleur de feu"; + case 319: + return "Aileron de requin"; + case 320: + return "Plume"; + case 321: + return "Pierre tombale"; + case 322: + return "Masque du mime"; + case 323: + return "Mandibule de fourmilion"; + case 324: + return "Pièces détachées"; + case 325: + return "Veste du docteur"; + case 326: + return "Pantalon du docteur"; + case 327: + return "Clé dorée"; + case 328: + return "Coffre sombre"; + case 329: + return "Clé sombre"; + case 330: + return "Mur de briques d'obsidienne"; + case 331: + return "Spores de la jungle"; + case 332: + return "Métier à tisser"; + case 333: + return "Piano"; + case 334: + return "Commode"; + case 335: + return "Banc"; + case 336: + return "Baignoire"; + case 337: + return "Bannière rouge"; + case 338: + return "Bannière verte"; + case 339: + return "Bannière bleue"; + case 340: + return "Bannière jaune"; + case 341: + return "Lampadaire"; + case 342: + return "Torche de tiki"; + case 343: + return "Baril"; + case 344: + return "Lanterne chinoise"; + case 345: + return "Marmite"; + case 346: + return "Coffre-fort"; + case 347: + return "Lanterne crâne"; + case 348: + return "Poubelle"; + case 349: + return "Candélabre"; + case 350: + return "Vase rose"; + case 351: + return "Chope"; + case 352: + return "Tonnelet"; + case 353: + return "Bière"; + case 354: + return "Bibliothèque"; + case 355: + return "Trône"; + case 356: + return "Bol"; + case 357: + return "Bol de soupe"; + case 358: + return "Toilettes"; + case 359: + return "Horloge de grand-père"; + case 360: + return "Statue d'armure"; + case 361: + return "Étendard de bataille gobelin"; + case 362: + return "Vêtements en lambeaux"; + case 363: + return "Scierie"; + case 364: + return "Minerai de cobalt"; + case 365: + return "Minerai de mythril"; + case 366: + return "Minerai d'adamantine"; + case 367: + return "Pwnhammer"; + case 368: + return "Excalibur"; + case 369: + return "Graines sacrées"; + case 370: + return "Bloc de sable d'ébène"; + case 371: + return "Chapeau de cobalt"; + case 372: + return "Casque de cobalt"; + case 373: + return "Masque de cobalt"; + case 374: + return "Plastron de cobalt"; + case 375: + return "Jambières de cobalt"; + case 376: + return "Capuche de mythril"; + case 377: + return "Casque de mythril"; + case 378: + return "Chapeau de mythril"; + case 379: + return "Cotte de mailles de mythril"; + case 380: + return "Jambières de mythril"; + case 381: + return "Barre de cobalt"; + case 382: + return "Barre de mythril"; + case 383: + return "Tronçonneuse de cobalt"; + case 384: + return "Tronçonneuse de mythril"; + case 385: + return "Perceuse de cobalt"; + case 386: + return "Perceuse de mythril"; + case 387: + return "Tronçonneuse d'adamantine"; + case 388: + return "Perceuse d'adamantine"; + case 389: + return "Dao de Pow"; + case 390: + return "Hallebarde de mythril"; + case 391: + return "Barre d'amantine"; + case 392: + return "Mur de verre"; + case 393: + return "Boussole"; + case 394: + return "Équipement de plongée"; + case 395: + return "GPS"; + case 396: + return "Fer à cheval d'obsidienne"; + case 397: + return "Bouclier d'obsidienne"; + case 398: + return "Atelier du bricoleur"; + case 399: + return "Nuage dans un ballon"; + case 400: + return "Coiffe d'adamantine"; + case 401: + return "Casque d'adamantine"; + case 402: + return "Masque d'adamantine"; + case 403: + return "Plastron d'adamantine"; + case 404: + return "Jambières en adamantine"; + case 405: + return "Bottes spectrales"; + case 406: + return "Glaive d'adamantine"; + case 407: + return "Ceinture d'outils"; + case 408: + return "Bloc de sable de perle"; + case 409: + return "Bloc de pierre de perle"; + case 410: + return "Veste de mineur"; + case 411: + return "Pantalon de mineur"; + case 412: + return "Brique de pierre de perle"; + case 413: + return "Brique iridescente"; + case 414: + return "Bloc de pierre de terre"; + case 415: + return "Brique de cobalt"; + case 416: + return "Brique de mythril"; + case 417: + return "Mur de briques de pierre de perle"; + case 418: + return "Mur de briques iridescentes"; + case 419: + return "Mur de briques de pierre de terre"; + case 420: + return "Mur de briques de cobalt"; + case 421: + return "Mur de briques de mythril"; + case 422: + return "Eau bénite"; + case 423: + return "Eau impie"; + case 424: + return "Bloc de limon"; + case 425: + return "Clochette de fée"; + case 426: + return "Lame du briseur"; + case 427: + return "Torche bleue"; + case 428: + return "Torche rouge"; + case 429: + return "Torche verte"; + case 430: + return "Torche violette"; + case 431: + return "Torche blanche"; + case 432: + return "Torche jaune"; + case 433: + return "Torche du démon"; + case 434: + return "Fusil d'assaut mécanique"; + case 435: + return "Arbalète en cobalt"; + case 436: + return "Arbalète en mythril"; + case 437: + return "Crochet Double"; + case 438: + return "Statue d'étoile"; + case 439: + return "Statue d'épée"; + case 440: + return "Statue de slime"; + case 441: + return "Statue de gobelin"; + case 442: + return "Statue de bouclier"; + case 443: + return "Statue de chauve-souris"; + case 444: + return "Statue de poisson"; + case 445: + return "Statue de lapin"; + case 446: + return "Statue de squelette"; + case 447: + return "Statue de faucheur"; + case 448: + return "Statue de femme"; + case 449: + return "Statue de diablotin"; + case 450: + return "Statue de gargouille"; + case 451: + return "Statue de morosité"; + case 452: + return "Statue de frelon"; + case 453: + return "Statue de bombe"; + case 454: + return "Statue de crabe"; + case 455: + return "Statue de marteau"; + case 456: + return "Statue de potion"; + case 457: + return "Statue de lance"; + case 458: + return "Statue de croix"; + case 459: + return "Statue de méduse"; + case 460: + return "Statue d'arc"; + case 461: + return "Statue de boomerang"; + case 462: + return "Statue de botte"; + case 463: + return "Statue de coffre"; + case 464: + return "Statue d'oiseau"; + case 465: + return "Statue de hache"; + case 466: + return "Statue corrompue"; + case 467: + return "Statue d'arbre"; + case 468: + return "Statue d'enclume"; + case 469: + return "Statue de pioche"; + case 470: + return "Statue de champignon"; + case 471: + return "Statue d'œil"; + case 472: + return "Statue de pilier"; + case 473: + return "Statue de cœur"; + case 474: + return "Statue de pot"; + case 475: + return "Statue de tournesol"; + case 476: + return "Statue de roi"; + case 477: + return "Statue de reine"; + case 478: + return "Statue de piranha"; + case 479: + return "Mur de planches"; + case 480: + return "Poutre de bois"; + case 481: + return "Arbalète d'adamantine"; + case 482: + return "Épée d'adamantine"; + case 483: + return "Épée de cobalt"; + case 484: + return "Épée de mythril"; + case 485: + return "Sortilège lunaire"; + case 486: + return "Règle"; + case 487: + return "Boule de cristal"; + case 488: + return "Boule à facettes"; + case 489: + return "Emblème sorcier"; + case 490: + return "Emblème guerrier"; + case 491: + return "Emblème ranger"; + case 492: + return "Ailes de démon"; + case 493: + return "Ailes d'ange"; + case 494: + return "Harpe magique"; + case 495: + return "Bâton d'arc-en-ciel"; + case 496: + return "Bâton de glace"; + case 497: + return "Coquillage de Neptune"; + case 498: + return "Mannequin"; + case 499: + return "Potion de soins supérieure"; + case 500: + return "Potion de mana supérieure"; + case 501: + return "Poudre de fée"; + case 502: + return "Éclat de cristal"; + case 503: + return "Chapeau de clown"; + case 504: + return "Veste de clown"; + case 505: + return "Pantalon de clown"; + case 506: + return "Lance-flammes"; + case 507: + return "Cloche"; + case 508: + return "Harpe"; + case 509: + return "Clé à molette"; + case 510: + return "Pince coupante"; + case 511: + return "Bloc de pierre actif"; + case 512: + return "Bloc de pierre inactif"; + case 513: + return "Levier"; + case 514: + return "Fusil laser"; + case 515: + return "Balle de cristal"; + case 516: + return "Flèche bénite"; + case 517: + return "Dague magique"; + case 518: + return "Tempête de cristal"; + case 519: + return "Flammes maudites"; + case 520: + return "Âme de lumière"; + case 521: + return "Âme de la nuit"; + case 522: + return "Flamme maudite"; + case 523: + return "Torche maudite"; + case 524: + return "Forge en adamantine"; + case 525: + return "Enclume en mythril"; + case 526: + return "Corne de licorne"; + case 527: + return "Éclat sombre"; + case 528: + return "Éclat de lumière"; + case 529: + return "Plaque de pression rouge"; + case 530: + return "Câble"; + case 531: + return "Livre de sorts"; + case 532: + return "Cape stellaire"; + case 533: + return "Mégashark"; + case 534: + return "Fusil à pompe"; + case 535: + return "Pierre du philosophe"; + case 536: + return "Gant du titan"; + case 537: + return "Naginata en cobalt"; + case 538: + return "Interrupteur"; + case 539: + return "Piège à fléchette"; + case 540: + return "Rocher"; + case 541: + return "Plaque de pression verte"; + case 542: + return "Plaque de pression grise"; + case 543: + return "Plaque de pression marron"; + case 544: + return "Œil mécanique"; + case 545: + return "Flèche maudite"; + case 546: + return "Balle maudite"; + case 547: + return "Âme d'effroi"; + case 548: + return "Âme de pouvoir"; + case 549: + return "Âme de vision"; + case 550: + return "Gungnir"; + case 551: + return "Armure de plaques sacrée"; + case 552: + return "Jambières sacrées"; + case 553: + return "Casque sacré"; + case 554: + return "Pendentif en croix"; + case 555: + return "Fleur de mana"; + case 556: + return "Ver mécanique"; + case 557: + return "Crâne mécanique"; + case 558: + return "Coiffe sacrée"; + case 559: + return "Masque sacré"; + case 560: + return "Couronne de slime"; + case 561: + return "Disque de lumière"; + case 562: + return "Boîte à musique (Jour du monde supérieur)"; + case 563: + return "Boîte à musique (Surnaturel)"; + case 564: + return "Boîte à musique (Nuit)"; + case 565: + return "Boîte à musique (Titre)"; + case 566: + return "Boîte à musique (Souterrain)"; + case 567: + return "Boîte à musique (Boss 1)"; + case 568: + return "Boîte à musique (Jungle)"; + case 569: + return "Boîte à musique(Corruption)"; + case 570: + return "Boîte à musique (Corruption du souterrain)"; + case 571: + return "Boîte à musique (La purification)"; + case 572: + return "Boîte à musique (Boss 2)"; + case 573: + return "Boîte à musique (Purification du souterrain)"; + case 574: + return "Boîte à musique (Boss 3)"; + case 575: + return "Âme du vol"; + case 576: + return "Boîte à musique"; + case 577: + return "Brique de démonite"; + case 578: + return "Arbalète bénie"; + case 579: + return "Hâche-marteau"; + case 580: + return "Explosifs"; + case 581: + return "Poste de pompage"; + case 582: + return "Sortie de pompage"; + case 583: + return "Minuteur d'une seconde"; + case 584: + return "Minuteur de 3 secondes"; + case 585: + return "Minuteur de 5 secondes"; + case 586: + return "Bloc Candy Cane"; + case 587: + return "Candy Cane mur"; + case 588: + return "Santa Hat"; + case 589: + return "Père shirt"; + case 590: + return "Pantalon de Santa"; + case 591: + return "Bloc vert Candy Cane"; + case 592: + return "Vert Candy Cane mur"; + case 593: + return "neige bloc"; + case 594: + return "brique de neige"; + case 595: + return "Mur de briques de neige"; + case 596: + return "Blue Light"; + case 597: + return "Red Light"; + case 598: + return "Green Light"; + case 599: + return "présent Bleu"; + case 600: + return "présent vert"; + case 601: + return "présent jaune"; + case 602: + return "Globe de neige"; + case 603: + return "Carotte"; + } + } + else + { + if (Lang.lang == 5) + { + switch (l) + { + case -24: + return "Sable de luz amarillo"; + case -23: + return "Sable de luz blanco"; + case -22: + return "Sable de luz morado"; + case -21: + return "Sable de luz verde"; + case -20: + return "Sable de luz rojo"; + case -19: + return "Sable de luz azul"; + case -18: + return "Arco de cobre"; + case -17: + return "Martillo de cobre"; + case -16: + return "Hacha de cobre"; + case -15: + return "Espada corta de cobre"; + case -14: + return "Espada larga de cobre"; + case -13: + return "Pico de cobre"; + case -12: + return "Arco de plata"; + case -11: + return "Martillo de plata"; + case -10: + return "Hacha de plata"; + case -9: + return "Espada corta de plata"; + case -8: + return "Espada larga de plata"; + case -7: + return "Pico de plata"; + case -6: + return "Arco de oro"; + case -5: + return "Martillo de oro"; + case -4: + return "Hacha de oro"; + case -3: + return "Espada corta de oro"; + case -2: + return "Espada larga de oro"; + case -1: + return "Pico de oro"; + case 1: + return "Pico de hierro"; + case 2: + return "Bloque de tierra"; + case 3: + return "Bloque de piedra"; + case 4: + return "Espada larga de hierro"; + case 5: + return "Champiñón"; + case 6: + return "Espada corta de hierro"; + case 7: + return "Martillo de hierro"; + case 8: + return "Antorcha"; + case 9: + return "Madera"; + case 10: + return "Hacha de hierro"; + case 11: + return "Mineral de hierro"; + case 12: + return "Mineral de cobre"; + case 13: + return "Mineral de oro"; + case 14: + return "Mineral de plata"; + case 15: + return "Reloj de cobre"; + case 16: + return "Reloj de plata"; + case 17: + return "Reloj de oro"; + case 18: + return "Medidor de profundidad"; + case 19: + return "Lingote de oro"; + case 20: + return "Lingote de cobre"; + case 21: + return "Lingote de plata"; + case 22: + return "Lingote de hierro"; + case 23: + return "Baba"; + case 24: + return "Espada de madera"; + case 25: + return "Puerta de madera"; + case 26: + return "Pared de piedra"; + case 27: + return "Bellota"; + case 28: + return "Poción curativa menor"; + case 29: + return "Cristal de vida"; + case 30: + return "Pared de tierra"; + case 31: + return "Botella"; + case 32: + return "Mesa de madera"; + case 33: + return "Horno"; + case 34: + return "Silla de madera"; + case 35: + return "Yunque de hierro"; + case 36: + return "Banco de trabajo"; + case 37: + return "Gafas de protección"; + case 38: + return "Lentes"; + case 39: + return "Arco de madera"; + case 40: + return "Flecha de madera"; + case 41: + return "Flecha ardiente"; + case 42: + return "Cuchillas ninja"; + case 43: + return "Ojo de mirada desconfiada"; + case 44: + return "Arco demoníaco"; + case 45: + return "Hacha de la noche"; + case 46: + return "Espada de la luz"; + case 47: + return "Flecha infame"; + case 48: + return "Cofre"; + case 49: + return "Banda de regeneración"; + case 50: + return "Espejo mágico"; + case 51: + return "Flecha de bufón"; + case 52: + return "Estatua de ángel"; + case 53: + return "Nube embotellada"; + case 54: + return "Botas de Hermes"; + case 55: + return "Bumerán encantado"; + case 56: + return "Mineral endemoniado"; + case 57: + return "Lingote endemoniado"; + case 58: + return "Corazón"; + case 59: + return "Semillas corrompidas"; + case 60: + return "Champiñón vil"; + case 61: + return "Bloque de piedra de ébano"; + case 62: + return "Semillas de césped"; + case 63: + return "Girasol"; + case 64: + return "Lanzador de espina vil"; + case 65: + return "Furia de estrellas"; + case 66: + return "Polvo de purificación"; + case 67: + return "Polvo vil"; + case 68: + return "Trozo podrido"; + case 69: + return "Diente de gusano"; + case 70: + return "Cebo de gusanos"; + case 71: + return "Moneda de cobre"; + case 72: + return "Moneda de plata"; + case 73: + return "Moneda de oro"; + case 74: + return "Moneda de platino"; + case 75: + return "Estrella caída"; + case 76: + return "Grebas de cobre"; + case 77: + return "Grebas de hierro"; + case 78: + return "Grebas de plata"; + case 79: + return "Grebas de oro"; + case 80: + return "Cota de malla de cobre"; + case 81: + return "Cota de malla de hierro"; + case 82: + return "Cota de malla de plata"; + case 83: + return "Cota de malla de oro"; + case 84: + return "Garfio extensible"; + case 85: + return "Cadena de hierro"; + case 86: + return "Escama de las sombras"; + case 87: + return "Hucha"; + case 88: + return "Casco de minero"; + case 89: + return "Casco de cobre"; + case 90: + return "Casco de hierro"; + case 91: + return "Casco de plata"; + case 92: + return "Casco de oro"; + case 93: + return "Pared de madera"; + case 94: + return "Plataforma de madera"; + case 95: + return "Pistola de pedernal"; + case 96: + return "Mosquetón"; + case 97: + return "Bala de mosquetón"; + case 98: + return "Minitiburón"; + case 99: + return "Arco de hierro"; + case 100: + return "Grebas de las sombras"; + case 101: + return "Cota de escamas de las sombras"; + case 102: + return "Casco de las sombras"; + case 103: + return "Pico de pesadilla"; + case 104: + return "La despedazadora"; + case 105: + return "Vela"; + case 106: + return "Lámpara araña de cobre"; + case 107: + return "Lámpara araña de plata"; + case 108: + return "Lámpara araña de oro"; + case 109: + return "Cristal de maná"; + case 110: + return "Poción de maná menor"; + case 111: + return "Banda de polvo de estrellas"; + case 112: + return "Flor de fuego"; + case 113: + return "Misil mágico"; + case 114: + return "Varita de tierra"; + case 115: + return "Orbe de Luz"; + case 116: + return "Meteorito"; + case 117: + return "Lingote de meteorito"; + case 118: + return "Garfio"; + case 119: + return "Bumerán de llamas"; + case 120: + return "Furia fundida"; + case 121: + return "Gran espada ardiente"; + case 122: + return "Pico fundido"; + case 123: + return "Casco de meteorito"; + case 124: + return "Cota de meteorito"; + case 125: + return "Polainas de meteoritos"; + case 126: + return "Agua embotellada"; + case 127: + return "Espacio de arma de fuego"; + case 128: + return "Botas cohete"; + case 129: + return "Ladrillo gris"; + case 130: + return "Pared de ladrillo gris"; + case 131: + return "Ladrillo rojo"; + case 132: + return "Pared de ladrillo rojo"; + case 133: + return "Bloque de arcilla"; + case 134: + return "Ladrillo azul"; + case 135: + return "Pared de ladrillo azul"; + case 136: + return "Farolillo"; + case 137: + return "Ladrillo verde"; + case 138: + return "Pared de ladrillo verde"; + case 139: + return "Ladrillo rosa"; + case 140: + return "Pared de ladrillo rosa"; + case 141: + return "Ladrillo dorado"; + case 142: + return "Pared de ladrillo dorado"; + case 143: + return "Ladrillo plateado"; + case 144: + return "Pared de ladrillo plateado"; + case 145: + return "Ladrillo cobrizo"; + case 146: + return "Pared de ladrillo cobrizo"; + case 147: + return "Púa"; + case 148: + return "Vela de agua"; + case 149: + return "Libro"; + case 150: + return "Telaraña"; + case 151: + return "Casco de los muertos"; + case 152: + return "Peto de los muertos"; + case 153: + return "Grebas de los muertos"; + case 154: + return "Hueso"; + case 155: + return "Catana Muramasa"; + case 156: + return "Escudo de cobalto"; + case 157: + return "Cetro de agua"; + case 158: + return "Herradura de la suerte"; + case 159: + return "Globo rojo brillante"; + case 160: + return "Arpón"; + case 161: + return "Bola con pinchos"; + case 162: + return "Flagelo con bola"; + case 163: + return "Luna azul"; + case 164: + return "Pistola"; + case 165: + return "Rayo de agua"; + case 166: + return "Bomba"; + case 167: + return "Dinamita"; + case 168: + return "Granada"; + case 169: + return "Bloque de arena"; + case 170: + return "Cristal"; + case 171: + return "Cartel"; + case 172: + return "Bloque de ceniza"; + case 173: + return "Obsidiana"; + case 174: + return "Piedra infernal"; + case 175: + return "Lingote de piedra infernal"; + case 176: + return "Bloque de lodo"; + case 177: + return "Zafiro"; + case 178: + return "Rubí"; + case 179: + return "Esmeralda"; + case 180: + return "Topacio"; + case 181: + return "Amatista"; + case 182: + return "Diamante"; + case 183: + return "Champiñón brillante"; + case 184: + return "Estrella"; + case 185: + return "Látigo de hiedra"; + case 186: + return "Caña para respirar"; + case 187: + return "Aletas"; + case 188: + return "Poción curativa"; + case 189: + return "Poción de maná"; + case 190: + return "Espada de hierba"; + case 191: + return "Chakram de espinas"; + case 192: + return "Ladrillo de obsidiana"; + case 193: + return "Cráneo de obsidiana"; + case 194: + return "Semillas de césped para champiñón"; + case 195: + return "Semillas de césped para selva"; + case 196: + return "Martillo de madera"; + case 197: + return "Cañón de estrellas"; + case 198: + return "Espada de luz azul"; + case 199: + return "Espada de luz roja"; + case 200: + return "Espada de luz verde"; + case 201: + return "Espada de luz morada"; + case 202: + return "Espada de luz blanca"; + case 203: + return "Espada de luz amarilla"; + case 204: + return "Hacha-martillo de meteorito"; + case 205: + return "Cubo vacío"; + case 206: + return "Cubo de agua"; + case 207: + return "Cubo de lava"; + case 208: + return "Rosa de la selva"; + case 209: + return "Aguijón"; + case 210: + return "Enredadera"; + case 211: + return "Garras de bestia"; + case 212: + return "Tobillera de viento"; + case 213: + return "Báculo de regeneración"; + case 214: + return "Ladrillo de piedra infernal"; + case 215: + return "Cojín flatulento"; + case 216: + return "Argolla"; + case 217: + return "Hacha-martillo fundido"; + case 218: + return "Látigo de llamas"; + case 219: + return "Desintegrador Fénix"; + case 220: + return "Furia solar"; + case 221: + return "Forjas infernal"; + case 222: + return "Marmita de arcilla"; + case 223: + return "Don de la naturaleza"; + case 224: + return "Cama"; + case 225: + return "Seda"; + case 226: + return "Poción de recuperación menor"; + case 227: + return "Poción de recuperación"; + case 228: + return "Casco para la selva"; + case 229: + return "Camisa para la selva"; + case 230: + return "Pantalones para la selva"; + case 231: + return "Casco fundido"; + case 232: + return "Peto fundido"; + case 233: + return "Grebas fundidas"; + case 234: + return "proyectil de meteorito"; + case 235: + return "Bomba lapa"; + case 236: + return "Lentes negras"; + case 237: + return "Gafas de sol"; + case 238: + return "Sombrero de mago"; + case 239: + return "Sombrero de copa"; + case 240: + return "Camisa de esmoquin"; + case 241: + return "Pantalones de esmoquin"; + case 242: + return "Sombrero veraniego"; + case 243: + return "Máscara de conejito"; + case 244: + return "Gorra de fontanero"; + case 245: + return "Camisa de fontanero"; + case 246: + return "Pantalones de fontanero"; + case 247: + return "Gorro de héroe"; + case 248: + return "Camisa de héroe"; + case 249: + return "Pantalones de héroe"; + case 250: + return "Pecera"; + case 251: + return "Sombrero de arqueólogo"; + case 252: + return "Chaqueta de arqueólogo"; + case 253: + return "Pantalones de arqueólogo"; + case 254: + return "Tinte negro"; + case 255: + return "Tinte verde"; + case 256: + return "Gorro de ninja"; + case 257: + return "Camisa de ninja"; + case 258: + return "Pantalones de ninja"; + case 259: + return "Cuero"; + case 260: + return "Sombrero rojo"; + case 261: + return "Pececillo"; + case 262: + return "Vestido"; + case 263: + return "Sombrero de robot"; + case 264: + return "Corona de oro"; + case 265: + return "Flecha de fuego infernal"; + case 266: + return "Pistola de arena"; + case 267: + return "Muñeco vudú del Guía"; + case 268: + return "Casco de buceo"; + case 269: + return "Camisa informal"; + case 270: + return "Pantalones informales"; + case 271: + return "Peluca informal"; + case 272: + return "Guadaña demoníaca"; + case 273: + return "Espada de la noche"; + case 274: + return "Lanza de la oscuridad"; + case 275: + return "Coral"; + case 276: + return "Cactus"; + case 277: + return "Tridente"; + case 278: + return "Bala de plata"; + case 279: + return "Cuchillo arrojadizo"; + case 280: + return "Lanza"; + case 281: + return "Cerbatana"; + case 282: + return "Barrita luminosa"; + case 283: + return "Semilla"; + case 284: + return "Bumerán de madera"; + case 285: + return "Herrete"; + case 286: + return "Barrita luminosa lapa"; + case 287: + return "Cuchillo envenenado"; + case 288: + return "Poción de piel obsidiana"; + case 289: + return "Poción de regeneración"; + case 290: + return "Poción de rapidez"; + case 291: + return "Poción de agallas"; + case 292: + return "Poción de piel de hierro"; + case 293: + return "Poción de regeneración de maná"; + case 294: + return "Poción de poder mágico"; + case 295: + return "Poción de caída de pluma"; + case 296: + return "Poción de espeleólogo"; + case 297: + return "Poción de invisibilidad"; + case 298: + return "Poción de brillo"; + case 299: + return "Poción de noctámbulo"; + case 300: + return "Poción de batalla"; + case 301: + return "Poción de espinas"; + case 302: + return "Poción caminando sobre el agua"; + case 303: + return "Poción de tiro con arco"; + case 304: + return "Poción de cazador"; + case 305: + return "Poción de gravedad"; + case 306: + return "Cofre de oro"; + case 307: + return "Semillas de resplandor del día"; + case 308: + return "Semillas de luz de luna"; + case 309: + return "Semillas de raíz de resplandor"; + case 310: + return "Semillas de malahierba"; + case 311: + return "Semillas de hoja de agua"; + case 312: + return "Semillas de resplandor de fuego"; + case 313: + return "Resplandor del día"; + case 314: + return "Luz de luna"; + case 315: + return "Raíz de resplandor"; + case 316: + return "Malahierba"; + case 317: + return "Hoja de agua"; + case 318: + return "Resplandor de fuego"; + case 319: + return "Aleta de tiburón"; + case 320: + return "Pluma"; + case 321: + return "Lápida"; + case 322: + return "Máscara de mimo"; + case 323: + return "Mandíbula de hormiga león"; + case 324: + return "Accesorios de arma ilegales"; + case 325: + return "Camisa del doctor"; + case 326: + return "Pantalones del doctor"; + case 327: + return "Llave dorada"; + case 328: + return "Cofre de las sombras"; + case 329: + return "Llave de las sombras"; + case 330: + return "Pared de ladrillo de obsidiana"; + case 331: + return "Esporas de la selva"; + case 332: + return "Telar"; + case 333: + return "Piano"; + case 334: + return "Aparador"; + case 335: + return "Banco"; + case 336: + return "Bañera"; + case 337: + return "Estandarte rojo"; + case 338: + return "Estandarte verde"; + case 339: + return "Estandarte azul"; + case 340: + return "Estandarte amarillo"; + case 341: + return "Farola"; + case 342: + return "Antorcha Tiki"; + case 343: + return "Barril"; + case 344: + return "Farolillo de papel"; + case 345: + return "Perol"; + case 346: + return "Caja fuerte"; + case 347: + return "Cráneo con vela"; + case 348: + return "Cubo de basura"; + case 349: + return "Candelabro"; + case 350: + return "Probeta rosa"; + case 351: + return "Taza"; + case 352: + return "Barrica"; + case 353: + return "Cerveza"; + case 354: + return "Librería"; + case 355: + return "Trono"; + case 356: + return "Cuenco"; + case 357: + return "Cuenco de sopa"; + case 358: + return "Retrete"; + case 359: + return "Reloj de pie"; + case 360: + return "Estatua de armadura"; + case 361: + return "Batalla de duendes convencional"; + case 362: + return "Harapos"; + case 363: + return "Serrería"; + case 364: + return "Mineral de cobalto"; + case 365: + return "Mineral de mithril"; + case 366: + return "Mineral de adamantita"; + case 367: + return "Gran martillo"; + case 368: + return "Excalibur"; + case 369: + return "Semillas bendecidas"; + case 370: + return "Bloque de arena de ébano"; + case 371: + return "Gorro de cobalto"; + case 372: + return "Casco de cobalto"; + case 373: + return "Máscara de cobalto"; + case 374: + return "Peto de cobalto"; + case 375: + return "Polainas de cobalto"; + case 376: + return "Caperuza de mithril"; + case 377: + return "Casco de mithril"; + case 378: + return "Gorro de mithril"; + case 379: + return "Cota de malla de mithril"; + case 380: + return "Grebas de mithril"; + case 381: + return "Lingote de cobalto"; + case 382: + return "Lingote de mithril"; + case 383: + return "Motosierra de cobalto"; + case 384: + return "Motosierra de mithril"; + case 385: + return "Taladro de cobalto"; + case 386: + return "Taladro de mithril"; + case 387: + return "Motosierra de adamantita"; + case 388: + return "Taladro de adamantita"; + case 389: + return "Flagelo Taoísta"; + case 390: + return "Alabarda de mithril"; + case 391: + return "Lingote de adamantita"; + case 392: + return "Cristal de pared"; + case 393: + return "Brújula"; + case 394: + return "Equipo de buceo"; + case 395: + return "GPS"; + case 396: + return "Herradura de obsidiana"; + case 397: + return "Escudo de obsidiana"; + case 398: + return "Taller del reparador"; + case 399: + return "Globo de nube"; + case 400: + return "Tocado de adamantita"; + case 401: + return "Casco de adamantita"; + case 402: + return "Máscara de adamantita"; + case 403: + return "Peto de adamantita"; + case 404: + return "Polainas de adamantita"; + case 405: + return "Botas de espectro"; + case 406: + return "Lanza de adamantita"; + case 407: + return "Cinturón de herramientas"; + case 408: + return "Bloque de arena de perla"; + case 409: + return "Bloque de piedra perlada"; + case 410: + return "Camisa de minero"; + case 411: + return "Pantalones de minero"; + case 412: + return "Ladrillo de piedra perlada"; + case 413: + return "Ladrillo tornasol"; + case 414: + return "Bloque de lutita"; + case 415: + return "Ladrillo de cobalto"; + case 416: + return "Ladrillo de mithril"; + case 417: + return "Pared de ladrillo de piedra perlada"; + case 418: + return "Pared de ladrillo tornasol"; + case 419: + return "Pared de ladrillo de lutita"; + case 420: + return "Pared de ladrillo de cobalto"; + case 421: + return "Pared de ladrillo de mithril"; + case 422: + return "Agua sagrada"; + case 423: + return "Agua impura"; + case 424: + return "Bloque de limo"; + case 425: + return "Campana de hada"; + case 426: + return "Espada despedazadora"; + case 427: + return "Antorcha azul"; + case 428: + return "Antorcha rojo"; + case 429: + return "Antorcha verde"; + case 430: + return "Antorcha morada"; + case 431: + return "Antorcha blanca"; + case 432: + return "Antorcha amarilla"; + case 433: + return "Antorcha demoníaca"; + case 434: + return "Fusil de asalto de precisión"; + case 435: + return "Repetidor de cobalto"; + case 436: + return "Repetidor de mithril"; + case 437: + return "Gancho doble"; + case 438: + return "Estatua de estrella"; + case 439: + return "Estatua de espada"; + case 440: + return "Estatua de babosa"; + case 441: + return "Estatua de duende"; + case 442: + return "Estatua de escudo"; + case 443: + return "Estatua de murciélago"; + case 444: + return "Estatua de pez"; + case 445: + return "Estatua de conejito"; + case 446: + return "Estatua de esqueleto"; + case 447: + return "Estatua de la Muerte"; + case 448: + return "Estatua de mujer"; + case 449: + return "Estatua de diablillo"; + case 450: + return "Estatua de gárgola"; + case 451: + return "Estatua de Melancolía"; + case 452: + return "Estatua de avispón"; + case 453: + return "Estatua de bomba"; + case 454: + return "Estatua de cangrejo"; + case 455: + return "Estatua de martilla"; + case 456: + return "Estatua de poción"; + case 457: + return "Estatua de lanza"; + case 458: + return "Estatua de cruz"; + case 459: + return "Estatua de medusa"; + case 460: + return "Estatua de arco"; + case 461: + return "Estatua de bumerán"; + case 462: + return "Estatua de bota"; + case 463: + return "Estatua de cofre"; + case 464: + return "Estatua de pájaro"; + case 465: + return "Estatua de hacha"; + case 466: + return "Estatua de corrupción"; + case 467: + return "Estatua de árbol"; + case 468: + return "Estatua de yunque"; + case 469: + return "Estatua de pico"; + case 470: + return "Estatua de champiñón"; + case 471: + return "Estatua de ojo"; + case 472: + return "Estatua de columna"; + case 473: + return "Estatua de corazón"; + case 474: + return "Estatua de marmita"; + case 475: + return "Estatua de girasol"; + case 476: + return "Estatua de rey"; + case 477: + return "Estatua de reina"; + case 478: + return "Estatua de piraña"; + case 479: + return "Pared de tablones"; + case 480: + return "Viga de madera"; + case 481: + return "Repetidor de adamantita"; + case 482: + return "Espada de adamantita"; + case 483: + return "Espada de cobalto"; + case 484: + return "Espada de mithril"; + case 485: + return "Hechizo de luna"; + case 486: + return "Regla"; + case 487: + return "Bola de cristal"; + case 488: + return "Bola de discoteca"; + case 489: + return "Emblema de hechicero"; + case 490: + return "Emblema de guerrero"; + case 491: + return "Emblema de guardián"; + case 492: + return "Alas demoníacas"; + case 493: + return "Alas de ángel"; + case 494: + return "Arpa mágica"; + case 495: + return "Varita multicolor"; + case 496: + return "Varita helada"; + case 497: + return "Concha de Neptuno"; + case 498: + return "Maniquí"; + case 499: + return "Poción curativa mayor"; + case 500: + return "Poción de maná mayor"; + case 501: + return "Polvo de hada"; + case 502: + return "Fragmento de cristal"; + case 503: + return "Sombrero de payaso"; + case 504: + return "Camisa de payaso"; + case 505: + return "Pantalones de payaso"; + case 506: + return "Lanzallamas"; + case 507: + return "Campana"; + case 508: + return "Arpa"; + case 509: + return "Llave inglesa"; + case 510: + return "Alicates"; + case 511: + return "Bloque de piedra activo"; + case 512: + return "Bloque de piedra inactivo"; + case 513: + return "Palanca"; + case 514: + return "Fusil láser"; + case 515: + return "Bala de cristal"; + case 516: + return "Flecha sagrada"; + case 517: + return "Daga mágica"; + case 518: + return "Tormenta de cristal"; + case 519: + return "Llamas malditas"; + case 520: + return "Alma de luz"; + case 521: + return "Alma de noche"; + case 522: + return "Llama maldita"; + case 523: + return "Antorcha maldita"; + case 524: + return "Forja de adamantita"; + case 525: + return "Yunque de mithril"; + case 526: + return "Cuerno de unicornio"; + case 527: + return "Fragmento de oscuridad"; + case 528: + return "Fragmento de luz"; + case 529: + return "Chapa de presión roja"; + case 530: + return "Alambre"; + case 531: + return "Tomo encantado"; + case 532: + return "Manto de estrellas"; + case 533: + return "Megatiburón"; + case 534: + return "Escopeta"; + case 535: + return "Piedra filosofal"; + case 536: + return "Guante de Titán"; + case 537: + return "Naginata de cobalto"; + case 538: + return "Interruptor"; + case 539: + return "Trampa de dardos"; + case 540: + return "Roca"; + case 541: + return "Chapa de presión verde"; + case 542: + return "Chapa de presión gris"; + case 543: + return "Chapa de presión marrón"; + case 544: + return "Ojo mecánico"; + case 545: + return "Flecha maldita"; + case 546: + return "Bala maldita"; + case 547: + return "Alma de terror"; + case 548: + return "Alma de poder"; + case 549: + return "Alma de visión"; + case 550: + return "Gungnir"; + case 551: + return "Cota de chapas bendecida"; + case 552: + return "Grebas bendecidas"; + case 553: + return "Casco bendecido"; + case 554: + return "Collar con cruz"; + case 555: + return "Flor de maná"; + case 556: + return "Gusano mecánico"; + case 557: + return "Cráneo mecánico"; + case 558: + return "Tocado bendecido"; + case 559: + return "Máscara bendecida"; + case 560: + return "Corona de babosa"; + case 561: + return "Disco de luz"; + case 562: + return "Caja de música (Superficie de día)"; + case 563: + return "Caja de música (Sobrecogedor)"; + case 564: + return "Caja de música (Noche)"; + case 565: + return "Caja de música (Título)"; + case 566: + return "Caja de música (Subsuelo)"; + case 567: + return "Caja de música (Jefe 1)"; + case 568: + return "Caja de música (Selva)"; + case 569: + return "Caja de música (Corrupción)"; + case 570: + return "Caja de música (Corrupción en el Subsuelo)"; + case 571: + return "Caja de música (La Bendición)"; + case 572: + return "Caja de música (Jefe 2)"; + case 573: + return "Caja de música (Bendición en el Subsuelo)"; + case 574: + return "Caja de música (Jefe 3)"; + case 575: + return "Alma de vuelo"; + case 576: + return "Caja de música"; + case 577: + return "Ladrillo endemoniado"; + case 578: + return "Repetidor bendecido"; + case 579: + return "Martitaladrahacha"; + case 580: + return "Explosivos"; + case 581: + return "Colector de entrada"; + case 582: + return "Colector de salida"; + case 583: + return "Temporizador de 1 segundo"; + case 584: + return "Temporizador de 3 segundos"; + case 585: + return "Temporizador de 5 segundos"; + case 586: + return "Bloquear dulces de caña"; + case 587: + return "Candy Cane pared"; + case 588: + return "Gorro de Papá Noel"; + case 589: + return "Santa Camisa"; + case 590: + return "Pantalones de Santa"; + case 591: + return "Caramelo verde de caña de bloques"; + case 592: + return "Verde del bastón de caramelo pared"; + case 593: + return "Bloque de nieve"; + case 594: + return "nieve ladrillo"; + case 595: + return "Snow Brick Wall"; + case 596: + return "Nieve pared de ladrillo"; + case 597: + return "azul claro"; + case 598: + return "luz roja"; + case 599: + return "Presente azul"; + case 600: + return "Presente verde"; + case 601: + return "Presente amarillo"; + case 602: + return "Bola de Nieve"; + case 603: + return "Zanahoria"; + } + } + } + } + } + } + if (!english && Lang.lang > 1) + { + return Lang.itemName(l, true); + } + return ""; + } + public static string evilGood() + { + if (Lang.lang <= 1) + { + string text; + if (WorldGen.tGood == 0) + { + text = string.Concat(new object[] + { + Main.worldName, + " is ", + WorldGen.tEvil, + "% corrupt." + }); + } + else + { + if (WorldGen.tEvil == 0) + { + text = string.Concat(new object[] + { + Main.worldName, + " is ", + WorldGen.tGood, + "% hallow." + }); + } + else + { + text = string.Concat(new object[] + { + Main.worldName, + " is ", + WorldGen.tGood, + "% hallow, and ", + WorldGen.tEvil, + "% corrupt." + }); + } + } + if (WorldGen.tGood > WorldGen.tEvil) + { + text += " Keep up the good work!"; + } + else + { + if (WorldGen.tEvil > WorldGen.tGood && WorldGen.tEvil > 20) + { + text += " Things are grim indeed."; + } + else + { + text += " You should try harder."; + } + } + return text; + } + if (Lang.lang == 2) + { + string text2; + if (WorldGen.tGood == 0) + { + text2 = string.Concat(new object[] + { + Main.worldName, + " ist zu ", + WorldGen.tEvil, + "% verderbt." + }); + } + else + { + if (WorldGen.tEvil == 0) + { + text2 = string.Concat(new object[] + { + Main.worldName, + " ist zu ", + WorldGen.tGood, + "% gesegnet." + }); + } + else + { + text2 = string.Concat(new object[] + { + Main.worldName, + " ist zu ", + WorldGen.tGood, + "% gesegnet und zu ", + WorldGen.tEvil, + "% verderbt." + }); + } + } + if (WorldGen.tGood > WorldGen.tEvil) + { + text2 += " Gute Arbeit, weiter so!"; + } + else + { + if (WorldGen.tEvil > WorldGen.tGood && WorldGen.tEvil > 20) + { + text2 += " Es steht nicht gut."; + } + else + { + text2 += " Streng dich mehr an!"; + } + } + return text2; + } + if (Lang.lang == 3) + { + string text3; + if (WorldGen.tGood == 0) + { + text3 = string.Concat(new object[] + { + Main.worldName, + " è distrutto al ", + WorldGen.tEvil, + "%." + }); + } + else + { + if (WorldGen.tEvil == 0) + { + text3 = string.Concat(new object[] + { + Main.worldName, + " è santo al ", + WorldGen.tGood, + "%." + }); + } + else + { + text3 = string.Concat(new object[] + { + Main.worldName, + " è santo al ", + WorldGen.tGood, + "% e distrutto al ", + WorldGen.tEvil, + "%." + }); + } + } + if (WorldGen.tGood > WorldGen.tEvil) + { + text3 += " Continua così!"; + } + else + { + if (WorldGen.tEvil > WorldGen.tGood && WorldGen.tEvil > 20) + { + text3 += " Le cose vanno male."; + } + else + { + text3 += " Dovresti impegnarti di più."; + } + } + return text3; + } + if (Lang.lang == 4) + { + string text4; + if (WorldGen.tGood == 0) + { + text4 = string.Concat(new object[] + { + Main.worldName, + " est corrompu à ", + WorldGen.tEvil, + "%." + }); + } + else + { + if (WorldGen.tEvil == 0) + { + text4 = string.Concat(new object[] + { + Main.worldName, + " est purifié à ", + WorldGen.tGood, + "%." + }); + } + else + { + text4 = string.Concat(new object[] + { + Main.worldName, + " est purifié à ", + WorldGen.tGood, + "% et corrompu à ", + WorldGen.tEvil, + "%." + }); + } + } + if (WorldGen.tGood > WorldGen.tEvil) + { + text4 += " Continuez comme ça."; + } + else + { + if (WorldGen.tEvil > WorldGen.tGood && WorldGen.tEvil > 20) + { + text4 += " En effet, c'est pas la joie."; + } + else + { + text4 += " Essayez encore."; + } + } + return text4; + } + if (Lang.lang == 5) + { + string text5; + if (WorldGen.tGood == 0) + { + text5 = string.Concat(new object[] + { + Main.worldName, + " ha sido corrompido por ", + WorldGen.tEvil, + "%." + }); + } + else + { + if (WorldGen.tEvil == 0) + { + text5 = string.Concat(new object[] + { + Main.worldName, + " ha sido bendecido por ", + WorldGen.tGood, + "%." + }); + } + else + { + text5 = string.Concat(new object[] + { + Main.worldName, + " ha sido bendecido por ", + WorldGen.tGood, + "% y corrompido por ", + WorldGen.tEvil, + "%." + }); + } + } + if (WorldGen.tGood > WorldGen.tEvil) + { + text5 += " ¡Sigue haciéndolo bien!"; + } + else + { + if (WorldGen.tEvil > WorldGen.tGood && WorldGen.tEvil > 20) + { + text5 += " Es bastante desalentador."; + } + else + { + text5 += " Deberías esforzarte más."; + } + } + return text5; + } + return ""; + } + public static string title() + { + int num = Main.rand.Next(16); + if (Lang.lang <= 1) + { + num = Main.rand.Next(50); + if (num == 0) + { + return "Terraria: Dig Peon, Dig!"; + } + if (num == 1) + { + return "Terraria: Epic Dirt"; + } + if (num == 2) + { + return "Terraria: Hey Guys!"; + } + if (num == 3) + { + return "Terraria: Sand is Overpowered"; + } + if (num == 4) + { + return "Terraria Part 3: The Return of the Guide"; + } + if (num == 5) + { + return "Terraria: A Bunnies Tale"; + } + if (num == 6) + { + return "Terraria: Dr. Bones and The Temple of Blood Moon"; + } + if (num == 7) + { + return "Terraria: Slimeassic Park"; + } + if (num == 8) + { + return "Terraria: The Grass is Greener on This Side"; + } + if (num == 9) + { + return "Terraria: Small Blocks, Not for Children Under the Age of 5"; + } + if (num == 10) + { + return "Terraria: Digger T' Blocks"; + } + if (num == 11) + { + return "Terraria: There is No Cow Layer"; + } + if (num == 12) + { + return "Terraria: Suspicous Looking Eyeballs"; + } + if (num == 13) + { + return "Terraria: Purple Grass!"; + } + if (num == 14) + { + return "Terraria: Noone Dug Behind!"; + } + if (num == 15) + { + return "Terraria: The Water Fall Of Content!"; + } + if (num == 16) + { + return "Terraria: Earthbound"; + } + if (num == 17) + { + return "Terraria: Dig Dug Ain't Got Nuthin on Me"; + } + if (num == 18) + { + return "Terraria: Ore's Well That Ends Well"; + } + if (num == 19) + { + return "Terraria: Judgement Clay"; + } + if (num == 20) + { + return "Terraria: Terrestrial Trouble"; + } + if (num == 21) + { + return "Terraria: Obsessive-Compulsive Discovery Simulator"; + } + if (num == 22) + { + return "Terraria: Red Dev Redemption"; + } + if (num == 23) + { + return "Terraria: Rise of the Slimes"; + } + if (num == 24) + { + return "Terraria: Now with more things to kill you!"; + } + if (num == 25) + { + return "Terraria: Rumors of the Guides' death were greatly exaggerated"; + } + if (num == 26) + { + return "Terraria: I Pity the Tools..."; + } + if (num == 27) + { + return "Terraria: A spelunker says 'What'?"; + } + if (num == 28) + { + return "Terraria: So then I said 'Something about a PC update....'"; + } + if (num == 29) + { + return "Terraria: May the blocks be with you"; + } + if (num == 30) + { + return "Terraria: Better than life"; + } + if (num == 31) + { + return "Terraria: Terraria: Terraria:"; + } + if (num == 32) + { + return "Terraria: Now in 1D"; + } + if (num == 33) + { + return "Terraria: Coming soon to a computer near you"; + } + if (num == 34) + { + return "Terraria: Dividing by zero"; + } + if (num == 35) + { + return "Terraria: Now with SOUND"; + } + if (num == 36) + { + return "Terraria: Press alt-f4"; + } + if (num == 37) + { + return "Terraria: I Pity the Tools"; + } + if (num == 38) + { + return "Terraria: You sand bro?"; + } + if (num == 39) + { + return "Terraria: A good day to dig hard"; + } + if (num == 40) + { + return "Terraria: Can You Re-Dig-It?"; + } + if (num == 41) + { + return "Terraria: I don't know that-- aaaaa!"; + } + if (num == 42) + { + return "Terraria: What's that purple spiked thing?"; + } + if (num == 43) + { + return "Terraria: I wanna be the guide"; + } + if (num == 44) + { + return "Terraria: Cthulhu is mad... and is missing an eye!"; + } + if (num == 45) + { + return "Terraria: NOT THE BEES!!!"; + } + if (num == 46) + { + return "Terraria: Legend of Maxx"; + } + if (num == 47) + { + return "Terraria: Cult of Cenx"; + } + if (num == 48) + { + return "Terraria 2: Electric Boogaloo"; + } + return "Terraria: Shut Up and Dig Gaiden!"; + } + else + { + if (Lang.lang == 2) + { + if (num == 0) + { + return "Terraria: Nun grab schon, Bauer, grab!"; + } + if (num == 1) + { + return "Terraria: Epischer Dreck"; + } + if (num == 2) + { + return "Terraria: Huhu, Leute!"; + } + if (num == 3) + { + return "Terraria: Sand is overpowered!"; + } + if (num == 4) + { + return "Terraria Teil 3: Die Rueckkehr des Fremdenfuehrers"; + } + if (num == 5) + { + return "Terraria: Geschichte eines verderbten Haeschens"; + } + if (num == 6) + { + return "Terraria: Dr. Bones und der Tempel des Blutmondes"; + } + if (num == 7) + { + return "Terraria: Schleimassic Park"; + } + if (num == 8) + { + return "Terraria: Das Gras ist auf dieser Seite gruener"; + } + if (num == 9) + { + return "Terraria: Kleine Bloecke, nicht fuer Kinder unter 5"; + } + if (num == 10) + { + return "Terraria: Der Block des Ausgraebers"; + } + if (num == 11) + { + return "Terraria: Hier gibt's auch kein Kuh-Level!"; + } + if (num == 12) + { + return "Terraria: Verdaechtig ausschauende Augaepfel"; + } + if (num == 13) + { + return "Terraria: Violettes Gras!"; + } + if (num == 14) + { + return "Terraria: Houston, wir haben ein Problem gehabt!"; + } + return "Terraria: Grab mit deiner Hand, nicht mit dem Mund!"; + } + else + { + if (Lang.lang == 3) + { + if (num == 0) + { + return "Terraria: Scava contadino, scava!"; + } + if (num == 1) + { + return "Terraria: Terra epica"; + } + if (num == 2) + { + return "Terraria: Ehi, ragazzi!"; + } + if (num == 3) + { + return "Terraria: La sabbia è strapotente"; + } + if (num == 4) + { + return "Terraria: Il ritorno della guida"; + } + if (num == 5) + { + return "Terraria: Coda di coniglio"; + } + if (num == 6) + { + return "Terraria: Dottor Ossa e il tempio della luna di sangue"; + } + if (num == 7) + { + return "Terraria: Slimeassic Park"; + } + if (num == 8) + { + return "Terraria: L'erba è più verde da questo lato"; + } + if (num == 9) + { + return "Terraria: Piccoli blocchi, non per bambini al di sotto di 5 anni"; + } + if (num == 10) + { + return "Terraria: Il blocco dello scavatore"; + } + if (num == 11) + { + return "Terraria: No mucche, no party"; + } + if (num == 12) + { + return "Terraria: Bulbi oculari diffidenti"; + } + if (num == 13) + { + return "Terraria: Erba viola!"; + } + if (num == 14) + { + return "Terraria: Houston, abbiamo un problema!"; + } + return "Terraria: Zitto e scava, 'azzo!"; + } + else + { + if (Lang.lang == 4) + { + if (num == 0) + { + return "Terraria : Creuse et fais pas cette mine !"; + } + if (num == 1) + { + return "Terraria : Bain de boue"; + } + if (num == 2) + { + return "Terraria : Salut la compagnie !"; + } + if (num == 3) + { + return "Terraria : Le canon à sable, c'est vraiment grosbill"; + } + if (num == 4) + { + return "Terraria, 3e partie : Le retour du guide"; + } + if (num == 5) + { + return "Terraria : Des lapins pas si crétins"; + } + if (num == 6) + { + return "Terraria : Dr Bones et le temple de la lune de sang"; + } + if (num == 7) + { + return "Terraria: Slimeassic Park"; + } + if (num == 8) + { + return "Terraria : L'herbe est plus verte dans le pré du voisin"; + } + if (num == 9) + { + return "Terraria : Petits blocs interdits aux enfants de moins de 5 ans"; + } + if (num == 10) + { + return "Terraria : Des mineurs gonflés à bloc ! "; + } + if (num == 11) + { + return "Terraria : Strates aux sphères"; + } + if (num == 12) + { + return "Terraria : L'œil observateur suspicieux"; + } + if (num == 13) + { + return "Terraria : Silence, ça pousse !"; + } + if (num == 14) + { + return "Terraria : Houston, nous avons un problème !"; + } + return "Terraria : J'fais des trous, des p'tis trous..."; + } + else + { + if (Lang.lang != 5) + { + return ""; + } + if (num == 0) + { + return "Terraria: ¡Cava, peón, cava!"; + } + if (num == 1) + { + return "Terraria: Terreno épico"; + } + if (num == 2) + { + return "Terraria: ¡Hola, tíos!"; + } + if (num == 3) + { + return "Terraria: El poder de la arena"; + } + if (num == 4) + { + return "Terraria parte 3: El regreso del Guía"; + } + if (num == 5) + { + return "Terraria: Un cuento de conejitos"; + } + if (num == 6) + { + return "Terraria: El Dr. Látigo y el Templo de la Luna Sangrienta"; + } + if (num == 7) + { + return "Terraria: Babosic Park"; + } + if (num == 8) + { + return "Terraria: Mi césped es más verde que el del vecino"; + } + if (num == 9) + { + return "Terraria: Bloques de construcción (no apto para menores de 5 años)"; + } + if (num == 10) + { + return "Terraria: Buscador de bloques"; + } + if (num == 11) + { + return "Terraria: Nada de niveles ocultos"; + } + if (num == 12) + { + return "Terraria: Ojos de aspecto sospechoso"; + } + if (num == 13) + { + return "Terraria: ¡Césped morado!"; + } + if (num == 14) + { + return "Terraria: ¡No abandonamos ningún agujero!"; + } + return "Terraria: ¡Cállate y cava un universo paralelo!"; + } + } + } + } + } + public static void setLang(bool english = false) + { + Main.chTitle = true; + if (Lang.lang <= 1 || english) + { + Lang.misc[0] = "A goblin army has been defeated!"; + Lang.misc[1] = "A goblin army is approaching from the west!"; + Lang.misc[2] = "A goblin army is approaching from the east!"; + Lang.misc[3] = "A goblin army has arrived!"; + Lang.misc[4] = "The Frost Legion has been defeated!"; + Lang.misc[5] = "The Frost Legion is approaching from the west!"; + Lang.misc[6] = "The Frost Legion is approaching from the east!"; + Lang.misc[7] = "The Frost Legion has arrived!"; + Lang.misc[8] = "The Blood Moon is rising..."; + Lang.misc[9] = "You feel an evil presence watching you..."; + Lang.misc[10] = "A horrible chill goes down your spine..."; + Lang.misc[11] = "Screams echo around you..."; + Lang.misc[12] = "Your world has been blessed with Cobalt!"; + Lang.misc[13] = "Your world has been blessed with Mythril!"; + Lang.misc[14] = "Your world has been blessed with Adamantite!"; + Lang.misc[15] = "The ancient spirits of light and dark have been released."; + Lang.misc[16] = "has awoken!"; + Lang.misc[17] = "has been defeated!"; + Lang.misc[18] = "has arrived!"; + Lang.misc[19] = " was slain..."; + Lang.misc[20] = "A solar eclipse is happening!"; + Lang.misc[21] = "Your world has been blessed with Palladium!"; + Lang.misc[22] = "Your world has been blessed with Orichalcum!"; + Lang.misc[23] = "Your world has been blessed with Titanium!"; + Lang.misc[24] = "The pirates have been defeated!"; + Lang.misc[25] = "Pirates are approaching from the west!"; + Lang.misc[26] = "Pirates are approaching from the east!"; + Lang.misc[27] = "The pirates have arrived!"; + Lang.misc[28] = "You feel vibrations from deep below..."; + Lang.misc[29] = "This is going to be a terrible night..."; + Lang.misc[30] = "The air is getting colder around you..."; + Lang.menu[0] = "Start a new instance of Terraria to join!"; + Lang.menu[1] = "Running on port "; + Lang.menu[2] = "Disconnect"; + Lang.menu[3] = "Server Requires Password:"; + Lang.menu[4] = "Accept"; + Lang.menu[5] = "Back"; + Lang.menu[6] = "Cancel"; + Lang.menu[7] = "Enter Server Password:"; + Lang.menu[8] = "Starting server..."; + Lang.menu[9] = "Load failed!"; + Lang.menu[10] = "Load Backup"; + Lang.menu[11] = "No backup found"; + Lang.menu[12] = "Single Player"; + Lang.menu[13] = "Multiplayer"; + Lang.menu[14] = "Settings"; + Lang.menu[15] = "Exit"; + Lang.menu[16] = "Create Character"; + Lang.menu[17] = "Delete"; + Lang.menu[18] = "Hair"; + Lang.menu[19] = "Eyes"; + Lang.menu[20] = "Skin"; + Lang.menu[21] = "Clothes"; + Lang.menu[22] = "Male"; + Lang.menu[23] = "Female"; + Lang.menu[24] = "Hardcore"; + Lang.menu[25] = "Mediumcore"; + Lang.menu[26] = "Softcore"; + Lang.menu[27] = "Random"; + Lang.menu[28] = "Create"; + Lang.menu[29] = "Hardcore characters die for good"; + Lang.menu[30] = "Mediumcore characters drop items on death"; + Lang.menu[31] = "Softcore characters drop money on death"; + Lang.menu[32] = "Select difficulty"; + Lang.menu[33] = "Shirt"; + Lang.menu[34] = "Undershirt"; + Lang.menu[35] = "Pants"; + Lang.menu[36] = "Shoes"; + Lang.menu[37] = "Hair"; + Lang.menu[38] = "Hair Color"; + Lang.menu[39] = "Eye Color"; + Lang.menu[40] = "Skin Color"; + Lang.menu[41] = "Shirt Color"; + Lang.menu[42] = "Undershirt Color"; + Lang.menu[43] = "Pants Color"; + Lang.menu[44] = "Shoe Color"; + Lang.menu[45] = "Enter Character Name:"; + Lang.menu[46] = "Delete"; + Lang.menu[47] = "Create World"; + Lang.menu[48] = "Enter World Name:"; + Lang.menu[49] = "Go Windowed"; + Lang.menu[50] = "Go Fullscreen"; + Lang.menu[51] = "Resolution"; + Lang.menu[52] = "Parallax"; + Lang.menu[53] = "Frame Skip Off (Not Recommended)"; + Lang.menu[54] = "Frame Skip On (Recommended)"; + Lang.menu[55] = "Lighting: Color"; + Lang.menu[56] = "Lighting: White"; + Lang.menu[57] = "Lighting: Retro"; + Lang.menu[58] = "Lighting: Trippy"; + Lang.menu[59] = "Quality: Auto"; + Lang.menu[60] = "Quality: High"; + Lang.menu[61] = "Quality: Medium"; + Lang.menu[62] = "Quality: Low"; + Lang.menu[63] = "Video"; + Lang.menu[64] = "Cursor Color"; + Lang.menu[65] = "Volume"; + Lang.menu[66] = "Controls"; + Lang.menu[67] = "Autosave On"; + Lang.menu[68] = "Autosave Off"; + Lang.menu[69] = "Autopause On"; + Lang.menu[70] = "Autopause Off"; + Lang.menu[71] = "Pickup Text On"; + Lang.menu[72] = "Pickup Text Off"; + Lang.menu[73] = "Fullscreen Resolution"; + Lang.menu[74] = "Up "; + Lang.menu[75] = "Down "; + Lang.menu[76] = "Left "; + Lang.menu[77] = "Right "; + Lang.menu[78] = "Jump "; + Lang.menu[79] = "Throw "; + Lang.menu[80] = "Inventory "; + Lang.menu[81] = "Quick Heal "; + Lang.menu[82] = "Quick Mana "; + Lang.menu[83] = "Quick Buff "; + Lang.menu[84] = "Grapple "; + Lang.menu[85] = "Auto Select "; + Lang.menu[86] = "Reset to Default"; + Lang.menu[87] = "Join"; + Lang.menu[88] = "Host & Play"; + Lang.menu[89] = "Enter Server IP Address:"; + Lang.menu[90] = "Enter Server Port:"; + Lang.menu[91] = "Choose world size:"; + Lang.menu[92] = "Small"; + Lang.menu[93] = "Medium"; + Lang.menu[94] = "Large"; + Lang.menu[95] = "Red:"; + Lang.menu[96] = "Green:"; + Lang.menu[97] = "Blue:"; + Lang.menu[98] = "Sound:"; + Lang.menu[99] = "Music:"; + Lang.menu[100] = "Background On"; + Lang.menu[101] = "Background Off"; + Lang.menu[102] = "Select language"; + Lang.menu[103] = "Language"; + Lang.menu[104] = "Yes"; + Lang.menu[105] = "No"; + Lang.menu[106] = "Toggle Map Style "; + Lang.menu[107] = "Toggle Fullscreen "; + Lang.menu[108] = "Zoom In "; + Lang.menu[109] = "Zoom Out "; + Lang.menu[110] = "Decrease Transparency "; + Lang.menu[111] = "Increase Transparency "; + Lang.menu[112] = "Map Enabled"; + Lang.menu[113] = "Map Disabled"; + Lang.gen[0] = "Generating world terrain:"; + Lang.gen[1] = "Adding sand..."; + Lang.gen[2] = "Generating hills..."; + Lang.gen[3] = "Puttin dirt behind dirt:"; + Lang.gen[4] = "Placing rocks in the dirt..."; + Lang.gen[5] = "Placing dirt in the rocks..."; + Lang.gen[6] = "Adding clay..."; + Lang.gen[7] = "Making random holes:"; + Lang.gen[8] = "Generating small caves:"; + Lang.gen[9] = "Generating large caves:"; + Lang.gen[10] = "Generating surface caves..."; + Lang.gen[11] = "Generating jungle:"; + Lang.gen[12] = "Generating floating islands..."; + Lang.gen[13] = "Adding mushroom patches..."; + Lang.gen[14] = "Placing mud in the dirt..."; + Lang.gen[15] = "Adding silt..."; + Lang.gen[16] = "Adding shinies..."; + Lang.gen[17] = "Adding webs..."; + Lang.gen[18] = "Creating underworld:"; + Lang.gen[19] = "Adding water bodies:"; + Lang.gen[20] = "Making the world evil:"; + Lang.gen[21] = "Generating mountain caves..."; + Lang.gen[22] = "Creating beaches..."; + Lang.gen[23] = "Adding gems..."; + Lang.gen[24] = "Gravitating sand:"; + Lang.gen[25] = "Cleaning up dirt backgrounds:"; + Lang.gen[26] = "Placing altars:"; + Lang.gen[27] = "Settling liquids:"; + Lang.gen[28] = "Placing life crystals:"; + Lang.gen[29] = "Placing statues:"; + Lang.gen[30] = "Hiding treasure:"; + Lang.gen[31] = "Hiding more treasure:"; + Lang.gen[32] = "Hiding jungle treasure:"; + Lang.gen[33] = "Hiding water treasure:"; + Lang.gen[34] = "Placing traps:"; + Lang.gen[35] = "Placing breakables:"; + Lang.gen[36] = "Placing hellforges:"; + Lang.gen[37] = "Spreading grass..."; + Lang.gen[38] = "Growing cacti..."; + Lang.gen[39] = "Planting sunflowers..."; + Lang.gen[40] = "Planting trees..."; + Lang.gen[41] = "Planting herbs..."; + Lang.gen[42] = "Planting weeds..."; + Lang.gen[43] = "Growing vines..."; + Lang.gen[44] = "Planting flowers..."; + Lang.gen[45] = "Planting mushrooms..."; + Lang.gen[46] = "Freeing unused resources:"; + Lang.gen[47] = "Resetting game objects:"; + Lang.gen[48] = "Setting hard mode..."; + Lang.gen[49] = "Saving world data:"; + Lang.gen[50] = "Backing up world file..."; + Lang.gen[51] = "Loading world data:"; + Lang.gen[52] = "Checking tile alignment:"; + Lang.gen[53] = "Load failed!"; + Lang.gen[54] = "No backup found."; + Lang.gen[55] = "Finding tile frames:"; + Lang.gen[56] = "Adding snow..."; + Lang.gen[57] = "World"; + Lang.gen[58] = "Creating dungeon:"; + Lang.gen[59] = "A meteorite has landed!"; + Lang.gen[60] = "Smoothing the world:"; + Lang.gen[61] = "Mossification:"; + Lang.gen[62] = "Gemification:"; + Lang.gen[63] = "Making cave walls:"; + Lang.gen[64] = "Growing spider caves:"; + Lang.gen[65] = "Clearing map data:"; + Lang.gen[66] = "Saving map data:"; + Lang.gen[67] = "Loading map data:"; + Lang.gen[68] = "Drawing map:"; + Lang.gen[69] = "Creating waterfalls:"; + Lang.gen[70] = "Creating jungle ruins..."; + Lang.gen[71] = "Creating hornet nests..."; + Lang.gen[72] = "Making the world bloody:"; + Lang.inter[0] = "Life:"; + Lang.inter[1] = "Breath"; + Lang.inter[2] = "Mana"; + Lang.inter[3] = "Trash Can"; + Lang.inter[4] = "Inventory"; + Lang.inter[5] = "Hotbar unlocked"; + Lang.inter[6] = "Hotbar locked"; + Lang.inter[7] = "Housing"; + Lang.inter[8] = "Housing Query"; + Lang.inter[9] = "Accessories"; + Lang.inter[10] = "Defense"; + Lang.inter[11] = "Social"; + Lang.inter[12] = "Helmet"; + Lang.inter[13] = "Shirt"; + Lang.inter[14] = "Pants"; + Lang.inter[15] = "platinum"; + Lang.inter[16] = "gold"; + Lang.inter[17] = "silver"; + Lang.inter[18] = "copper"; + Lang.inter[19] = "Reforge"; + Lang.inter[20] = "Place an item here to reforge"; + Lang.inter[21] = "Showing recipes that use"; + Lang.inter[22] = "Required objects:"; + Lang.inter[23] = "None"; + Lang.inter[24] = "Place a material here"; + Lang.inter[25] = "Crafting"; + Lang.inter[26] = "Coins"; + Lang.inter[27] = "Ammo"; + Lang.inter[28] = "Shop"; + Lang.inter[29] = "Loot All"; + Lang.inter[30] = "Deposit All"; + Lang.inter[31] = "Quick Stack"; + Lang.inter[32] = "Piggy Bank"; + Lang.inter[33] = "Safe"; + Lang.inter[34] = "Time:"; + Lang.inter[35] = "Save & Exit"; + Lang.inter[36] = "Disconnect"; + Lang.inter[37] = "Items"; + Lang.inter[38] = "You were slain..."; + Lang.inter[39] = "This housing is suitable."; + Lang.inter[40] = "This is not valid housing."; + Lang.inter[41] = "This housing is already occupied."; + Lang.inter[42] = "This housing is corrupted."; + Lang.inter[43] = "Connection timed out"; + Lang.inter[44] = "Receiving tile data"; + Lang.inter[45] = "Equip"; + Lang.inter[46] = "Cost"; + Lang.inter[47] = "Save"; + Lang.inter[48] = "Edit"; + Lang.inter[49] = "Status"; + Lang.inter[50] = "Curse"; + Lang.inter[51] = "Help"; + Lang.inter[52] = "Close"; + Lang.inter[53] = "Water"; + Lang.inter[54] = "Heal"; + Lang.inter[55] = "This housing does not meet the requirements for a"; + Lang.inter[56] = "Lava"; + Lang.inter[57] = "Dye"; + Lang.inter[58] = "Honey"; + Lang.tip[0] = "Equipped in social slot"; + Lang.tip[1] = "No stats will be gained"; + Lang.tip[2] = " melee damage"; + Lang.tip[3] = " ranged damage"; + Lang.tip[4] = " magic damage"; + Lang.tip[5] = "% critical strike chance"; + Lang.tip[6] = "Insanely fast speed"; + Lang.tip[7] = "Very fast speed"; + Lang.tip[8] = "Fast speed"; + Lang.tip[9] = "Average speed"; + Lang.tip[10] = "Slow speed"; + Lang.tip[11] = "Very slow speed"; + Lang.tip[12] = "Extremely slow speed"; + Lang.tip[13] = "Snail speed"; + Lang.tip[14] = "No knockback"; + Lang.tip[15] = "Extremely weak knockback"; + Lang.tip[16] = "Very weak knockback"; + Lang.tip[17] = "Weak knockback"; + Lang.tip[18] = "Average knockback"; + Lang.tip[19] = "Strong knockback"; + Lang.tip[20] = "Very strong knockback"; + Lang.tip[21] = "Extremely strong knockback"; + Lang.tip[22] = "Insane knockback"; + Lang.tip[23] = "Equipable"; + Lang.tip[24] = "Vanity Item"; + Lang.tip[25] = " defense"; + Lang.tip[26] = "% pickaxe power"; + Lang.tip[27] = "% axe power"; + Lang.tip[28] = "% hammer power"; + Lang.tip[29] = "Restores"; + Lang.tip[30] = "life"; + Lang.tip[31] = "mana"; + Lang.tip[32] = "Uses"; + Lang.tip[33] = "Can be placed"; + Lang.tip[34] = "Ammo"; + Lang.tip[35] = "Consumable"; + Lang.tip[36] = "Material"; + Lang.tip[37] = " minute duration"; + Lang.tip[38] = " second duration"; + Lang.tip[39] = "% damage"; + Lang.tip[40] = "% speed"; + Lang.tip[41] = "% critical strike chance"; + Lang.tip[42] = "% mana cost"; + Lang.tip[43] = "% size"; + Lang.tip[44] = "% velocity"; + Lang.tip[45] = "% knockback"; + Lang.tip[46] = "% movement speed"; + Lang.tip[47] = "% melee speed"; + Lang.tip[48] = "Set bonus:"; + Lang.tip[49] = "Sell price:"; + Lang.tip[50] = "Buy price:"; + Lang.tip[51] = "No value"; + Lang.tip[52] = "Consumes "; + Lang.tip[53] = " summon damage"; + Lang.tip[54] = " range"; + Lang.tip[55] = " damage"; + Lang.mp[0] = "Recieve:"; + Lang.mp[1] = "Incorrect password."; + Lang.mp[2] = "Invalid operation at this state."; + Lang.mp[3] = "You are banned from this server."; + Lang.mp[4] = "You are not using the same version as this server."; + Lang.mp[5] = "is already on this server."; + Lang.mp[6] = "/playing"; + Lang.mp[7] = "Current players:"; + Lang.mp[8] = "/roll"; + Lang.mp[9] = "rolls a"; + Lang.mp[10] = "You are not in a party!"; + Lang.mp[11] = "has enabled PvP!"; + Lang.mp[12] = "has disabled PvP!"; + Lang.mp[13] = "is no longer on a party."; + Lang.mp[14] = "has joined the red party."; + Lang.mp[15] = "has joined the green party."; + Lang.mp[16] = "has joined the blue party."; + Lang.mp[17] = "has joined the yellow party."; + Lang.mp[18] = "Welcome to"; + Lang.mp[19] = "has joined."; + Lang.mp[20] = "has left."; + Lang.mp[21] = "/players"; + Lang.the = "the "; + Lang.dt[0] = "couldn't find the antidote"; + Lang.dt[1] = "couldn't put the fire out"; + Lang.dt[2] = "couldn't breathe"; + Main.buffName[1] = "Obsidian Skin"; + Main.buffTip[1] = "Immune to lava"; + Main.buffName[2] = "Regeneration"; + Main.buffTip[2] = "Provides life regeneration"; + Main.buffName[3] = "Swiftness"; + Main.buffTip[3] = "25% increased movement speed"; + Main.buffName[4] = "Gills"; + Main.buffTip[4] = "Breathe water instead of air"; + Main.buffName[5] = "Ironskin"; + Main.buffTip[5] = "Increase defense by 8"; + Main.buffName[6] = "Mana Regeneration"; + Main.buffTip[6] = "Increased mana regeneration"; + Main.buffName[7] = "Magic Power"; + Main.buffTip[7] = "20% increased magic damage"; + Main.buffName[8] = "Featherfall"; + Main.buffTip[8] = "Press UP or DOWN to control speed of descent"; + Main.buffName[9] = "Spelunker"; + Main.buffTip[9] = "Shows the location of treasure and ore"; + Main.buffName[10] = "Invisibility"; + Main.buffTip[10] = "Grants invisibility"; + Main.buffName[11] = "Shine"; + Main.buffTip[11] = "Emitting light"; + Main.buffName[12] = "Night Owl"; + Main.buffTip[12] = "Increased night vision"; + Main.buffName[13] = "Battle"; + Main.buffTip[13] = "Increased enemy spawn rate"; + Main.buffName[14] = "Thorns"; + Main.buffTip[14] = "Attackers also take damage"; + Main.buffName[15] = "Water Walking"; + Main.buffTip[15] = "Press DOWN to enter water"; + Main.buffName[16] = "Archery"; + Main.buffTip[16] = "20% increased arrow damage and speed"; + Main.buffName[17] = "Hunter"; + Main.buffTip[17] = "Shows the location of enemies"; + Main.buffName[18] = "Gravitation"; + Main.buffTip[18] = "Press UP to reverse gravity"; + Main.buffName[19] = "Shadow Orb"; + Main.buffTip[19] = "A magical orb that provides light"; + Main.buffName[20] = "Poisoned"; + Main.buffTip[20] = "Slowly losing life"; + Main.buffName[21] = "Potion Sickness"; + Main.buffTip[21] = "Cannot consume anymore healing items"; + Main.buffName[22] = "Darkness"; + Main.buffTip[22] = "Decreased light vision"; + Main.buffName[23] = "Cursed"; + Main.buffTip[23] = "Cannot use any items"; + Main.buffName[24] = "On Fire!"; + Main.buffTip[24] = "Slowly losing life"; + Main.buffName[25] = "Tipsy"; + Main.buffTip[25] = "Increased melee abilities, lowered defense"; + Main.buffName[26] = "Well Fed"; + Main.buffTip[26] = "Minor improvements to all stats"; + Main.buffName[27] = "Fairy"; + Main.buffTip[27] = "A fairy is following you"; + Main.buffName[28] = "Werewolf"; + Main.buffTip[28] = "Physical abilities are increased"; + Main.buffName[29] = "Clairvoyance"; + Main.buffTip[29] = "Magic powers are increased"; + Main.buffName[30] = "Bleeding"; + Main.buffTip[30] = "Cannot regenerate life"; + Main.buffName[31] = "Confused"; + Main.buffTip[31] = "Movement is reversed"; + Main.buffName[32] = "Slow"; + Main.buffTip[32] = "Movement speed is reduced"; + Main.buffName[33] = "Weak"; + Main.buffTip[33] = "Physical abilities are decreased"; + Main.buffName[34] = "Merfolk"; + Main.buffTip[34] = "Can breathe and move easily underwater"; + Main.buffName[35] = "Silenced"; + Main.buffTip[35] = "Cannot use items that require mana"; + Main.buffName[36] = "Broken Armor"; + Main.buffTip[36] = "Defense is cut in half"; + Main.buffName[37] = "Horrified"; + Main.buffTip[37] = "You have seen something nasty, there is no escape."; + Main.buffName[38] = "The Tongue"; + Main.buffTip[38] = "You are being sucked into the mouth"; + Main.buffName[39] = "Cursed Inferno"; + Main.buffTip[39] = "Losing life"; + Main.buffName[40] = "Pet Bunny"; + Main.buffTip[40] = "I think it wants your carrot"; + Main.buffName[41] = "Baby Penguin"; + Main.buffTip[41] = "I think it wants your fish"; + Main.buffName[42] = "Pet Turtle"; + Main.buffTip[42] = "Happy turtle time!"; + Main.buffName[43] = "Paladin's Shield"; + Main.buffTip[43] = "25% of damage taken will be redirected to another player"; + Main.buffName[44] = "Frostburn"; + Main.buffTip[44] = "It's either really hot or really cold. Either way it REALLY hurts"; + Main.buffName[45] = "Baby Eater"; + Main.buffTip[45] = "A baby Eater of Souls is following you"; + Main.buffName[46] = "Chilled"; + Main.buffTip[46] = "Your movement speed has been reduced"; + Main.buffName[47] = "Frozen"; + Main.buffTip[47] = "You can't move!"; + Main.buffName[48] = "Honey"; + Main.buffTip[48] = "Life regeneration is increased"; + Main.buffName[49] = "Pygmies"; + Main.buffTip[49] = "The pygmies will fight for you"; + Main.buffName[50] = "Baby Skeletron Head"; + Main.buffTip[50] = "Don't even ask..."; + Main.buffName[51] = "Baby Hornet"; + Main.buffTip[51] = "It thinks you are its mother"; + Main.buffName[52] = "Tiki Spirit"; + Main.buffTip[52] = "A friendly spirit is following you"; + Main.buffName[53] = "Pet Lizard"; + Main.buffTip[53] = "Chillin' like a reptilian"; + Main.buffName[54] = "Pet Parrot"; + Main.buffTip[54] = "Polly want's the cracker"; + Main.buffName[55] = "Baby Truffle"; + Main.buffTip[55] = "Isn't this just soooo cute?"; + Main.buffName[56] = "Pet Sapling"; + Main.buffTip[56] = "A little sapling is following you"; + Main.buffName[57] = "Wisp"; + Main.buffTip[57] = "A wisp is following you"; + Main.buffName[58] = "Rapid Healing"; + Main.buffTip[58] = "Life regeneration is greatly increased"; + Main.buffName[59] = "Shadow Dodge"; + Main.buffTip[59] = "You will dodge the next attack"; + Main.buffName[60] = "Leaf Crystal"; + Main.buffTip[60] = "Shoots crystal leaves at nearby enemies"; + Main.buffName[61] = "Baby Dinosaur"; + Main.buffTip[61] = "A baby dinosaur is following you"; + Main.buffName[62] = "Ice Barrier"; + Main.buffTip[62] = "Defense is increased by 30"; + Main.buffName[63] = "Panic!"; + Main.buffTip[63] = "Movement speed is increased"; + Main.buffName[64] = "Baby Slime"; + Main.buffTip[64] = "The baby slime will fight for you"; + Main.buffName[65] = "Eyeball Spring"; + Main.buffTip[65] = "An eyeball spring is following you"; + Main.buffName[66] = "Baby Snowman"; + Main.buffTip[66] = "A baby snowman is following you"; + Main.buffName[67] = "Burning"; + Main.buffTip[67] = "Losing life and slowed movement"; + Main.buffName[68] = "Suffocation"; + Main.buffTip[68] = "Losing life"; + Main.buffName[69] = "Ichor"; + Main.buffTip[69] = "Reduced defense"; + Main.buffName[70] = "Venom"; + Main.buffTip[70] = "Losing life"; + Main.buffName[72] = "Midas"; + Main.buffTip[72] = "Drop more money on death"; + Main.buffName[80] = "Blackout"; + Main.buffTip[80] = "Light vision severely reduced"; + Main.buffName[71] = "Weapon Imbue: Venom"; + Main.buffTip[71] = "Melee attacks inflict venom on your targets"; + Main.buffName[73] = "Weapon Imbue: Cursed Flames"; + Main.buffTip[73] = "Melee attacks inflict enemies with cursed flames"; + Main.buffName[74] = "Weapon Imbue: Fire"; + Main.buffTip[74] = "Melee attacks set enemies on fire"; + Main.buffName[75] = "Weapon Imbue: Gold"; + Main.buffTip[75] = "Melee attacks make enemies drop more gold"; + Main.buffName[76] = "Weapon Imbue: Ichor"; + Main.buffTip[76] = "Melee attacks decrease enemies defense"; + Main.buffName[77] = "Weapon Imbue: Nanites"; + Main.buffTip[77] = "Melee attacks confuse enemies"; + Main.buffName[78] = "Weapon Imbue: Confetti"; + Main.buffTip[78] = "Melee attacks cause confetti to appear"; + Main.buffName[79] = "Weapon Imbue: Poison"; + Main.buffTip[79] = "Melee attacks poison enemies"; + Main.tileName[4] = "Torch"; + Main.tileName[5] = "Tree"; + Main.tileName[6] = "Iron"; + Main.tileName[7] = "Copper"; + Main.tileName[8] = "Gold"; + Main.tileName[9] = "Silver"; + Main.tileName[10] = "Door"; + Main.tileName[11] = "Door"; + Main.tileName[12] = "Heart Crystal"; + Main.tileName[13] = "Bottle"; + Main.tileName[14] = "Table"; + Main.tileName[15] = "Chair"; + Main.tileName[16] = "Anvil"; + Main.tileName[17] = "Furnace"; + Main.tileName[18] = "Work Bench"; + Main.tileName[21] = "Chest"; + Main.tileName[22] = "Demonite"; + Main.tileName[26] = "Demon Altar"; + Main.tileName[27] = "Sunflower"; + Main.tileName[28] = "Pot"; + Main.tileName[29] = "Piggy Bank"; + Main.tileName[31] = "Shadow Orb"; + Main.tileName[32] = "Thorns"; + Main.tileName[33] = "Candle"; + Main.tileName[34] = "Copper Chandelier"; + Main.tileName[35] = "Silver Chandelier"; + Main.tileName[36] = "Gold Chandelier"; + Main.tileName[42] = "Lantern"; + Main.tileName[48] = "Spike"; + Main.tileName[49] = "Water Candle"; + Main.tileName[50] = "Book"; + Main.tileName[51] = "Web"; + Main.tileName[55] = "Sign"; + Main.tileName[63] = "Sapphire"; + Main.tileName[64] = "Ruby"; + Main.tileName[65] = "Emerald"; + Main.tileName[66] = "Topaz"; + Main.tileName[67] = "Amethyst"; + Main.tileName[68] = "Diamond"; + Main.tileName[69] = "Thorn"; + Main.tileName[72] = "Giant Mushroom"; + Main.tileName[77] = "Hellforge"; + Main.tileName[78] = "Clay Pot"; + Main.tileName[79] = "Bed"; + Main.tileName[80] = "Cactus"; + Main.tileName[81] = "Coral"; + Main.tileName[85] = "Tombstone"; + Main.tileName[86] = "Loom"; + Main.tileName[87] = "Piano"; + Main.tileName[88] = "Dresser"; + Main.tileName[89] = "Bench"; + Main.tileName[90] = "Bathtub"; + Main.tileName[91] = "Banner"; + Main.tileName[92] = "Lamp Post"; + Main.tileName[93] = "Tiki Torch"; + Main.tileName[94] = "Keg"; + Main.tileName[95] = "Chinese Lantern"; + Main.tileName[96] = "Cooking Pot"; + Main.tileName[97] = "Safe"; + Main.tileName[98] = "Skull Lantern"; + Main.tileName[100] = "Candelabra"; + Main.tileName[101] = "Bookcase"; + Main.tileName[102] = "Throne"; + Main.tileName[103] = "Bowl"; + Main.tileName[104] = "Grandfather Clock"; + Main.tileName[105] = "Statue"; + Main.tileName[106] = "Sawmill"; + Main.tileName[107] = "Cobalt"; + Main.tileName[108] = "Mythril"; + Main.tileName[111] = "Adamantite"; + Main.tileName[114] = "Tinkerer's Workshop"; + Main.tileName[125] = "Crystal Ball"; + Main.tileName[128] = "Mannequin"; + Main.tileName[129] = "Crystal Shard"; + Main.tileName[132] = "Lever"; + Main.tileName[133] = "Adamantite or Titanium Forge"; + Main.tileName[134] = "Mythril or Orichalcum Anvil"; + Main.tileName[136] = "Switch"; + Main.tileName[137] = "Trap"; + Main.tileName[138] = "Boulder"; + Main.tileName[139] = "Music Box"; + Main.tileName[142] = "Inlet Pump"; + Main.tileName[143] = "Outlet Pump"; + Main.tileName[144] = "Timer"; + Main.tileName[149] = "Christmas Light"; + Main.tileName[166] = "Tin"; + Main.tileName[167] = "Lead"; + Main.tileName[168] = "Tungsten"; + Main.tileName[169] = "Platinum"; + Main.tileName[170] = "Tin Chandelier"; + Main.tileName[171] = "Tungsten Chandelier"; + Main.tileName[172] = "Platinum Chandelier"; + Main.tileName[173] = "Candelabra"; + Main.tileName[174] = "Platinum Candle"; + Main.tileName[191] = "Living Wood"; + Main.tileName[207] = "Crimtane"; + Main.tileName[207] = "Water Fountain"; + Main.tileName[209] = "Cannon"; + Main.tileName[211] = "Chlorophyte"; + Main.tileName[212] = "Turret"; + Main.tileName[213] = "Rope"; + Main.tileName[214] = "Chain"; + Main.tileName[215] = "Campfire"; + Main.tileName[216] = "Rocket"; + Main.tileName[217] = "Blend-O-Matic"; + Main.tileName[218] = "Meat Grinder"; + Main.tileName[219] = "Silt Extractinator"; + Main.tileName[220] = "Solidifier"; + Main.tileName[221] = "Palladium"; + Main.tileName[222] = "Orichalcum"; + Main.tileName[223] = "Titanium"; + Main.tileName[228] = "Dye Vat"; + Main.tileName[231] = "Larva"; + Main.tileName[232] = "Wooden Spike"; + Main.tileName[235] = "Teleporter"; + Main.tileName[236] = "Life Fruit"; + Main.tileName[237] = "Lihzahrd Altar"; + Main.tileName[238] = "Plantera's Bulb"; + Main.tileName[239] = "Metal Bar"; + Main.tileName[240] = "Picture"; + Main.tileName[241] = "Picture"; + Main.tileName[242] = "Picture"; + Main.tileName[243] = "Imbuing Station"; + Main.tileName[244] = "Bubble Machine"; + Main.tileName[245] = "Picture"; + Main.tileName[246] = "Picture"; + Main.tileName[247] = "Autohammer"; + } + else + { + if (Lang.lang == 2) + { + Lang.misc[0] = "Die Goblin-Armee wurde besiegt!"; + Lang.misc[1] = "Eine Goblin-Armee naehert sich von Westen!"; + Lang.misc[2] = "Eine Goblin-Armee naehert sich von Osten!"; + Lang.misc[3] = "Ein Goblin-Armee ist da!"; + Lang.misc[4] = "Der Frost Legion wurde besiegt!"; + Lang.misc[5] = "Der Frost ist Legion aus dem Westen näher!"; + Lang.misc[6] = "Der Frost ist Legion aus dem Osten näher!"; + Lang.misc[7] = "Der Frost Legion ist da!"; + Lang.misc[8] = "Der Blutmond steigt auf ..."; + Lang.misc[9] = "Du fuehlst dich von einer boesen Kraft beobachtet ..."; + Lang.misc[10] = "Eine Eiseskaelte steigt in dir hoch ..."; + Lang.misc[11] = "Du hoerst das Echo von Schreien um dich herum ..."; + Lang.misc[12] = "Deine Welt wurde mit Kobalt gesegnet!"; + Lang.misc[13] = "Deine Welt wurde mit Mithril gesegnet!"; + Lang.misc[14] = "Deine Welt wurde mit Adamantit gesegnet!"; + Lang.misc[15] = "Die uralten Geister des Lichts und der Finsternis wurden frei gelassen."; + Lang.misc[16] = "ist aufgewacht!"; + Lang.misc[17] = "wurde besiegt!"; + Lang.misc[18] = "ist eingetroffen!"; + Lang.misc[19] = " wurde durch..."; + Lang.misc[20] = "Eine Sonnenfinsternis ist passiert!"; + Lang.misc[21] = "Ihre Welt ist mit Palladium gesegnet worden!"; + Lang.misc[22] = "Ihre Welt hat mit Orichalcum gesegnet worden!"; + Lang.misc[23] = "Ihre Welt hat sich mit Titanium gesegnet worden!"; + Lang.misc[24] = "Die Piraten wurden besiegt!"; + Lang.misc[25] = "Piraten sind aus dem Westen näher!"; + Lang.misc[26] = "Piraten sind aus dem Osten näher!"; + Lang.misc[27] = "Die Piraten sind angekommen!"; + Lang.misc[28] = "Sie fühlen sich Schwingungen von tief unter ..."; + Lang.misc[29] = "Das wird eine schreckliche Nacht sein ..."; + Lang.misc[30] = "Die Luft wird kälter um dich herum ..."; + Lang.menu[0] = "Beginne eine neue Sitzung auf Terraria!"; + Lang.menu[1] = "Laeuft auf Port "; + Lang.menu[2] = "Trennen"; + Lang.menu[3] = "Server benoetigt Passwort:"; + Lang.menu[4] = "Akzeptieren"; + Lang.menu[5] = "Zurueck"; + Lang.menu[6] = "Abbrechen"; + Lang.menu[7] = "Server-Passwort eingeben:"; + Lang.menu[8] = "Server startet..."; + Lang.menu[9] = "Laden fehlgeschlagen!"; + Lang.menu[10] = "Backup laden"; + Lang.menu[11] = "Kein Backup gefunden"; + Lang.menu[12] = "Einzelspieler"; + Lang.menu[13] = "Mehrspieler"; + Lang.menu[14] = "Einstellungen"; + Lang.menu[15] = "Beenden"; + Lang.menu[16] = "Charakter erstellen"; + Lang.menu[17] = "Loeschen"; + Lang.menu[18] = "Haar"; + Lang.menu[19] = "Augen"; + Lang.menu[20] = "Haut"; + Lang.menu[21] = "Kleidung"; + Lang.menu[22] = "Maennlich"; + Lang.menu[23] = "Weiblich"; + Lang.menu[24] = "Hardcore"; + Lang.menu[25] = "Mediumcore"; + Lang.menu[26] = "Softcore"; + Lang.menu[27] = "Zufaellig"; + Lang.menu[28] = "Erstellen"; + Lang.menu[29] = "Hardcore-Charaktere sterben fuers Gute"; + Lang.menu[30] = "Mediumcore-Charaktere lassen im Tod Items fallen"; + Lang.menu[31] = "Softcore-Charaktere lassen im Tod Geld fallen"; + Lang.menu[32] = "Schwierigkeitsgrad waehlen"; + Lang.menu[33] = "Hemd"; + Lang.menu[34] = "Unterhemd"; + Lang.menu[35] = "Hose"; + Lang.menu[36] = "Schuhe"; + Lang.menu[37] = "Haar"; + Lang.menu[38] = "Haarfarbe"; + Lang.menu[39] = "Augenfarbe"; + Lang.menu[40] = "Hautfarbe"; + Lang.menu[41] = "Hemdfarbe"; + Lang.menu[42] = "Unterhemdfarbe"; + Lang.menu[43] = "Hosenfarbe"; + Lang.menu[44] = "Schuhfarbe"; + Lang.menu[45] = "Charaktername eingeben:"; + Lang.menu[46] = "Loeschen"; + Lang.menu[47] = "Welt erschaffen"; + Lang.menu[48] = "Weltnamen eingeben:"; + Lang.menu[49] = "Zum Fenstermodus"; + Lang.menu[50] = "Zum Vollbildschirm"; + Lang.menu[51] = "Aufloesung"; + Lang.menu[52] = "Parallaxe"; + Lang.menu[53] = "Frameskip aus (nicht empfohlen)"; + Lang.menu[54] = "Frameskip an (empfohlen)"; + Lang.menu[55] = "Beleuchtung: Farbe"; + Lang.menu[56] = "Beleuchtung: Weiss"; + Lang.menu[57] = "Beleuchtung: Retro"; + Lang.menu[58] = "Beleuchtung: Flippig"; + Lang.menu[59] = "Qualitaet: Auto"; + Lang.menu[60] = "Qualitaet: Hoch"; + Lang.menu[61] = "Qualitaet: Mittel"; + Lang.menu[62] = "Qualitaet: Niedrig"; + Lang.menu[63] = "Video"; + Lang.menu[64] = "Zeigerfarbe"; + Lang.menu[65] = "Lautstaerke"; + Lang.menu[66] = "Steuerung"; + Lang.menu[67] = "Automat. sichern an"; + Lang.menu[68] = "Automat. sichern aus"; + Lang.menu[69] = "Automat. Pause an"; + Lang.menu[70] = "Automat. Pause aus"; + Lang.menu[71] = "Pickup-Text an"; + Lang.menu[72] = "Pickup-Text aus"; + Lang.menu[73] = "Vollbildschirm-Aufloesung"; + Lang.menu[74] = "Hoch "; + Lang.menu[75] = "Hinunter "; + Lang.menu[76] = "Links "; + Lang.menu[77] = "Rechts "; + Lang.menu[78] = "Springen "; + Lang.menu[79] = "Werfen "; + Lang.menu[80] = "Inventar "; + Lang.menu[81] = "Schnellheilung "; + Lang.menu[82] = "Schnelles Mana "; + Lang.menu[83] = "Schneller Buff "; + Lang.menu[84] = "Entern "; + Lang.menu[85] = "Automat. Auswahl "; + Lang.menu[86] = "Auf Standard zuruecksetzen"; + Lang.menu[87] = "Mitmachen"; + Lang.menu[88] = "Hosten & Spielen"; + Lang.menu[89] = "Server-IP-Adresse eingeben:"; + Lang.menu[90] = "Server-Port eingeben:"; + Lang.menu[91] = "Weltgroesse waehlen:"; + Lang.menu[92] = "Klein"; + Lang.menu[93] = "Mittel"; + Lang.menu[94] = "Gross"; + Lang.menu[95] = "Rot:"; + Lang.menu[96] = "Gruen:"; + Lang.menu[97] = "Blau:"; + Lang.menu[98] = "Sound:"; + Lang.menu[99] = "Musik:"; + Lang.menu[100] = "Hintergrund On"; + Lang.menu[101] = "Hintergrund Off"; + Lang.menu[102] = "Wählen Sie die Sprache"; + Lang.menu[103] = "Sprache"; + Lang.menu[104] = "Ja"; + Lang.menu[105] = "Nicht"; + Lang.menu[106] = "Toggle Map-Stil"; + Lang.menu[107] = "umschalten Vollbild"; + Lang.menu[108] = "vergrößern"; + Lang.menu[109] = "Verkleinern"; + Lang.menu[110] = "Verringern Transparenz"; + Lang.menu[111] = "Erhöhung der Transparenz"; + Lang.menu[112] = "Karte Aktiviert"; + Lang.menu[113] = "Karte für Behinderte"; + Lang.gen[0] = "Generieren des Weltgelaendes:"; + Lang.gen[1] = "Sand wird hinzugefuegt ..."; + Lang.gen[2] = "Huegel werden generiert ..."; + Lang.gen[3] = "Dreck wird hinter Dreck geschoben:"; + Lang.gen[4] = "Felsen werden in den Dreck gesetzt ..."; + Lang.gen[5] = "Dreck wird in Felsen platziert ..."; + Lang.gen[6] = "Lehm wird hinzugefuegt ..."; + Lang.gen[7] = "Loecher werden zufaellig geschaffen:"; + Lang.gen[8] = "Generieren kleiner Hoehlen:"; + Lang.gen[9] = "Generieren grosser Hoehlen:"; + Lang.gen[10] = "Hoehlenoberflaechen werden generiert..."; + Lang.gen[11] = "Generieren des Dschungels:"; + Lang.gen[12] = "Schwimmende Inseln werden generiert ..."; + Lang.gen[13] = "Pilzflecken werden generiert ..."; + Lang.gen[14] = "Schlamm wird in Dreck gefuegt ..."; + Lang.gen[15] = "Schlick wird hinzugefuegt ..."; + Lang.gen[16] = "Glitzer wird hinzugefuegt ..."; + Lang.gen[17] = "Spinnweben werden hinzugefuegt ..."; + Lang.gen[18] = "Erstellen der Unterwelt:"; + Lang.gen[19] = "Gewaesser wird hinzugefuegt:"; + Lang.gen[20] = "Macht die Welt boese:"; + Lang.gen[21] = "Berghoehlen werden generiert ..."; + Lang.gen[22] = "Straende werden erstellt ..."; + Lang.gen[23] = "Edelsteine werden hinzugefuegt ..."; + Lang.gen[24] = "Gravitieren von Sand:"; + Lang.gen[25] = "Reinigung von Dreckhintergrund:"; + Lang.gen[26] = "Platzieren von Altaren:"; + Lang.gen[27] = "Gewaesser verteilen:"; + Lang.gen[28] = "Lebenskristalle platzieren:"; + Lang.gen[29] = "Platzieren von Statuen:"; + Lang.gen[30] = "Verstecken von Schaetzen:"; + Lang.gen[31] = "Verstecken von mehr Schaetzen:"; + Lang.gen[32] = "Verstecken von Dschungelschaetzen:"; + Lang.gen[33] = "Verstecken von Wasserschaetzen:"; + Lang.gen[34] = "Platzieren von Fallen:"; + Lang.gen[35] = "Platzieren von Zerbrechlichem:"; + Lang.gen[36] = "Platzieren von Hoellenschmieden:"; + Lang.gen[37] = "Gras wird verteilt ..."; + Lang.gen[38] = "Kakteen wachsen ..."; + Lang.gen[39] = "Sonnenblumen werden gepflanzt ..."; + Lang.gen[40] = "Baeume werden gepflanzt ..."; + Lang.gen[41] = "Kraeuter werden gepflanzt ..."; + Lang.gen[42] = "Unkraut wird gepflanzt ..."; + Lang.gen[43] = "Wein wird angebaut ..."; + Lang.gen[44] = "Blumen werden gepflanzt ..."; + Lang.gen[45] = "Pilze werden gesaet ..."; + Lang.gen[46] = "Ungenutzte Ressourcen werden freigesetzt:"; + Lang.gen[47] = "Spielobjekte werden zurueckgesetzt:"; + Lang.gen[48] = "Schwerer Modus wird eingestellt ..."; + Lang.gen[49] = "Weltdaten werden gesichert:"; + Lang.gen[50] = "Backup von Weltdatei wird erstellt ..."; + Lang.gen[51] = "Weltdaten werden geladen:"; + Lang.gen[52] = "Ueberpruefen der Feld-Ausrichtung:"; + Lang.gen[53] = "Laden fehlgeschlagen!"; + Lang.gen[54] = "Kein Backup gefunden."; + Lang.gen[55] = "Suchen von Feld-Frames:"; + Lang.gen[56] = "Hinzufügen Schnee ..."; + Lang.gen[57] = "Welt"; + Lang.gen[58] = "Erstellen Verlies:"; + Lang.gen[59] = "Ein Meteorit ist gelandet!"; + Lang.gen[60] = "Glättung der Welt:"; + Lang.gen[61] = "Mossification:"; + Lang.gen[62] = "Gemification:"; + Lang.gen[63] = "Machen Höhlewänden:"; + Lang.gen[64] = "Wachsende Spinne Höhlen:"; + Lang.gen[65] = "Clearing Kartendaten:"; + Lang.gen[66] = "Speichern von Kartendaten:"; + Lang.gen[67] = "Die Karte wird geladen Daten:"; + Lang.gen[68] = "Zeichnen Karte:"; + Lang.gen[69] = "Erstellen Wasserfälle:"; + Lang.gen[70] = "Erstellen Dschungelruinen..."; + Lang.gen[71] = "Erstellen Hornisse Nester..."; + Lang.gen[72] = "Machen Sie die Welt blutige:"; + Lang.inter[0] = "Leben:"; + Lang.inter[1] = "Atem"; + Lang.inter[2] = "Mana"; + Lang.inter[3] = "Muelleimer"; + Lang.inter[4] = "Inventar"; + Lang.inter[5] = "Hotbar entriegelt"; + Lang.inter[6] = "Hotbar gesperrt"; + Lang.inter[7] = "Behausung"; + Lang.inter[8] = "Behausungsanfrage"; + Lang.inter[9] = "Zusaetze"; + Lang.inter[10] = "Abwehr"; + Lang.inter[11] = "Sozial"; + Lang.inter[12] = "Helm"; + Lang.inter[13] = "Hemd"; + Lang.inter[14] = "Hose"; + Lang.inter[15] = "platin"; + Lang.inter[16] = "gold"; + Lang.inter[17] = "silber"; + Lang.inter[18] = "kupfer"; + Lang.inter[19] = "Nachschmieden"; + Lang.inter[20] = "Zum Nachschmieden Item hier platzieren"; + Lang.inter[21] = "Anzeige von Rezepten mit Verwendung von"; + Lang.inter[22] = "Erforderliche Objekte:"; + Lang.inter[23] = "Keins"; + Lang.inter[24] = "Bitte Material hier platzieren, um Rezepte zu zeigen"; + Lang.inter[25] = "Herstellen"; + Lang.inter[26] = "Muenzen"; + Lang.inter[27] = "Munition"; + Lang.inter[28] = "Geschaeft"; + Lang.inter[29] = "Alle ausraeumen"; + Lang.inter[30] = "Alle ablegen"; + Lang.inter[31] = "Schnellstapeln"; + Lang.inter[32] = "Sparschwein"; + Lang.inter[33] = "Tresor"; + Lang.inter[34] = "Zeit:"; + Lang.inter[35] = "Speichern & Beenden"; + Lang.inter[36] = "Trennen"; + Lang.inter[37] = "Artikel"; + Lang.inter[38] = "Du wurdest getoetet ..."; + Lang.inter[39] = "Diese Behausung ist geeignet."; + Lang.inter[40] = "Das ist keine zulaessiges Behausung"; + Lang.inter[41] = "Diese Behausung ist bereits belegt."; + Lang.inter[42] = "Diese Behausung ist beschaedigt."; + Lang.inter[43] = "Zeitueberschreitung bei Verbindung"; + Lang.inter[44] = "Felddaten werden empfangen"; + Lang.inter[45] = "Ausrüsten"; + Lang.inter[46] = "Kosten"; + Lang.inter[47] = "Sparen"; + Lang.inter[48] = "Bearbeiten"; + Lang.inter[49] = "Status"; + Lang.inter[50] = "Fluch"; + Lang.inter[51] = "Hilfe"; + Lang.inter[52] = "Schliessen"; + Lang.inter[53] = "Wasser"; + Lang.inter[54] = "Heilen"; + Lang.inter[55] = "Dieses Gehäuse erfüllt nicht die Anforderungen für eine"; + Lang.inter[56] = "Lava"; + Lang.inter[57] = "Färben"; + Lang.inter[58] = "Liebling"; + Lang.tip[0] = "Ausgestattet in sozialen Schlitz"; + Lang.tip[1] = "Keine Werte werden gewonnen"; + Lang.tip[2] = " Nahkampfschaden"; + Lang.tip[3] = " Fernkampfschaden"; + Lang.tip[4] = " Magischer Schaden"; + Lang.tip[5] = "% kritische Trefferchance"; + Lang.tip[6] = "Wahnsinnig schnell"; + Lang.tip[7] = "Sehr schnell"; + Lang.tip[8] = "Schnell"; + Lang.tip[9] = "Durchschnittlich "; + Lang.tip[10] = "Langsam"; + Lang.tip[11] = "Sehr langsam"; + Lang.tip[12] = "Extrem langsam"; + Lang.tip[13] = "Schneckentempo"; + Lang.tip[14] = "Kein Rueckstoss"; + Lang.tip[15] = "Extrem schwacher Rueckstoss"; + Lang.tip[16] = "Sehr schwacher Rueckstoss"; + Lang.tip[17] = "Schwacher Rueckstoss"; + Lang.tip[18] = "Mittlerer Rueckstoss"; + Lang.tip[19] = "Starker Rueckstoss"; + Lang.tip[20] = "Sehr starker Rueckstoss"; + Lang.tip[21] = "Extrem starker Rueckstoss"; + Lang.tip[22] = "Wahnsinniger Rueckstoss"; + Lang.tip[23] = "Ausruestbar"; + Lang.tip[24] = "Mode-Items"; + Lang.tip[25] = " Abwehr"; + Lang.tip[26] = "% Spitzhackenkraft"; + Lang.tip[27] = "% Axtmachtkraft"; + Lang.tip[28] = "% Hammerkraft"; + Lang.tip[29] = "Stellt"; + Lang.tip[30] = "Leben wieder her"; + Lang.tip[31] = "Mana wieder her"; + Lang.tip[32] = "Verwendet"; + Lang.tip[33] = "Kann platziert werden"; + Lang.tip[34] = "Munition"; + Lang.tip[35] = "Verbrauchbar"; + Lang.tip[36] = "Material"; + Lang.tip[37] = " Minuten Dauer"; + Lang.tip[38] = " Sekunden Dauer"; + Lang.tip[39] = "% Schaden"; + Lang.tip[40] = "% Tempo"; + Lang.tip[41] = "% kritische Trefferchance"; + Lang.tip[42] = "% Manakosten"; + Lang.tip[43] = "% Groesse"; + Lang.tip[44] = "% Projektiltempo"; + Lang.tip[45] = "% Rueckstoss"; + Lang.tip[46] = "% Bewegungstempo"; + Lang.tip[47] = "% Nahkampftempo"; + Lang.tip[48] = "Bonus-Set:"; + Lang.tip[49] = "Verkaufspreis:"; + Lang.tip[50] = "Kaufpreis:"; + Lang.tip[51] = "Kein Wert"; + Lang.tip[52] = "verbraucht "; + Lang.tip[53] = " beschwören Schaden"; + Lang.tip[54] = " Bereich"; + Lang.tip[55] = " Schäden"; + Lang.mp[1] = "Falsches Passwort."; + Lang.mp[2] = "Ungueltige Operation in diesem Zustand."; + Lang.mp[3] = "Auf diesem Server bist du gesperrt."; + Lang.mp[4] = "Du verwendest nicht die gleiche Version wie der Server."; + Lang.mp[5] = "ist bereits auf diesem Server."; + Lang.mp[5] = "is already on this server."; + Lang.mp[6] = "/spielen"; + Lang.mp[7] = "Aktuelle Spieler:"; + Lang.mp[8] = "/wuerfeln"; + Lang.mp[9] = "wuerfelt eine"; + Lang.mp[10] = "Du bist in keiner Gruppe!"; + Lang.mp[11] = "hat PvP aktiviert!"; + Lang.mp[12] = "hat PvP deaktiviert!"; + Lang.mp[13] = "ist in keiner Gruppe mehr."; + Lang.mp[14] = "ist der roten Gruppe beigetreten."; + Lang.mp[15] = "ist der gruenen Gruppe beigetreten."; + Lang.mp[16] = "ist der blauen Gruppe beigetreten."; + Lang.mp[17] = "ist der gelben Gruppe beigetreten."; + Lang.mp[18] = "Willkommen in"; + Lang.mp[19] = "beigetreten."; + Lang.mp[20] = "beenden."; + Lang.the = "der "; + Lang.dt[0] = "konnte das Antidot nicht finden"; + Lang.dt[1] = "konnte das Feuer nicht loeschen"; + Main.buffName[1] = "Obsidianhaut"; + Main.buffTip[1] = "Immun gegen Lava"; + Main.buffName[2] = "Wiederbelebung"; + Main.buffTip[2] = "Belebt wieder"; + Main.buffName[3] = "Wendigkeit"; + Main.buffTip[3] = "Erhoeht Bewegungstempo um 25%"; + Main.buffName[4] = "Kiemen"; + Main.buffTip[4] = "Wasser statt Luft atmen"; + Main.buffName[5] = "Eisenhaut"; + Main.buffTip[5] = "Erhoeht die Abwehr um 8"; + Main.buffName[6] = "Mana-Wiederherstellung"; + Main.buffTip[6] = "Erhoehte Mana-Wiederherstellung"; + Main.buffName[7] = "Magiekraft"; + Main.buffTip[7] = "Erhoeht magischen Schaden um 20%"; + Main.buffName[8] = "Federsturz"; + Main.buffTip[8] = "Zur Kontrolle der Sinkgeschwindigkeit UP oder DOWN druecken "; + Main.buffName[9] = "Hoehlenforscher"; + Main.buffTip[9] = "Zeigt den Fundort von Schatz und Erz"; + Main.buffName[10] = "Unsichtbarkeit"; + Main.buffTip[10] = "Macht unsichtbar"; + Main.buffName[11] = "Glanz"; + Main.buffTip[11] = "Strahlt Licht aus"; + Main.buffName[12] = "Nachteule"; + Main.buffTip[12] = "Erhoehte Nachtsicht"; + Main.buffName[13] = "Kampf"; + Main.buffTip[13] = "Erhoehte Feind-Spawnrate"; + Main.buffName[14] = "Dornen"; + Main.buffTip[14] = "Auch die Angreifer erleiden Schaden"; + Main.buffName[15] = "Wasserlaufen"; + Main.buffTip[15] = "DOWN druecken, um aufs Wasser zu gehen"; + Main.buffName[16] = "Bogenschiessen"; + Main.buffTip[16] = "Um 20% erhoehter Pfeilschaden und -tempo"; + Main.buffName[17] = "Jaeger"; + Main.buffTip[17] = "Zeigt die Position von Feinden"; + Main.buffName[18] = "Gravitation"; + Main.buffTip[18] = "Zum Umkehren der Schwerkraft UP oder DOWN druecken"; + Main.buffName[19] = "Lichtkugel"; + Main.buffTip[19] = "Eine magische Kugel, die Licht verstroemt"; + Main.buffName[20] = "Vergiftet"; + Main.buffTip[20] = "Langsam entweicht das Leben"; + Main.buffName[21] = "Krankheitstrank"; + Main.buffTip[21] = "Kann keine Heil-Items mehr verbrauchen"; + Main.buffName[22] = "Dunkelheit"; + Main.buffTip[22] = "Schlechtere Sicht durch weniger Licht"; + Main.buffName[23] = "Verflucht"; + Main.buffTip[23] = "Kann keine Items verwenden"; + Main.buffName[24] = "Flammenmeer!"; + Main.buffTip[24] = "Langsam entweicht das Leben"; + Main.buffName[25] = "Beschwipst"; + Main.buffTip[25] = "Erhoehte Nahkampffaehigkeiten, verminderte Abwehr"; + Main.buffName[26] = "Kleine Staerkung"; + Main.buffTip[26] = "Geringe Anhebung aller Werte"; + Main.buffName[27] = "Fee"; + Main.buffTip[27] = "Eine Fee folgt dir"; + Main.buffName[28] = "Werwolf"; + Main.buffTip[28] = "Koerperliche Faehigkeiten sind gestiegen"; + Main.buffName[29] = "Hellsehen"; + Main.buffTip[29] = "Magiekraefte werden erhoeht"; + Main.buffName[30] = "Blutung"; + Main.buffTip[30] = "Kann nicht wiederbeleben"; + Main.buffName[31] = "Verwirrt"; + Main.buffTip[31] = "Bewegung wird umgekehrt"; + Main.buffName[32] = "Langsam"; + Main.buffTip[32] = "Bewegungen werden verlangsamt"; + Main.buffName[33] = "Schwach"; + Main.buffTip[33] = "Koerperliche Faehigkeiten sind gesunken"; + Main.buffName[34] = "Meermenschen"; + Main.buffTip[34] = "Kann atmen und sich leicht unter Wasser bewegen"; + Main.buffName[35] = "Schweigen"; + Main.buffTip[35] = "Nicht verwenden können Gegenstände, die Mana benötigen"; + Main.buffName[36] = "Kaputte Ruestung"; + Main.buffTip[36] = "Die Abwehr ist halbiert worden"; + Main.buffName[37] = "Entsetzt"; + Main.buffTip[37] = "Du hast etwas Ekliges gesehen, es gibt kein Entrinnen."; + Main.buffName[38] = "Die Zunge"; + Main.buffTip[38] = "Du wirst ins Maul eingesaugt"; + Main.buffName[39] = "Verfluchtes Inferno"; + Main.buffTip[39] = "Das Leben entweicht"; + Main.buffName[40] = "Haustierhäschen"; + Main.buffTip[40] = "Ich denke, sie will deine Karotte"; + Main.buffName[41] = "Baby-Pinguin"; + Main.buffTip[41] = "Ich denke, sie will Ihre Fische"; + Main.buffName[42] = "Haustier Schildkröte"; + Main.buffTip[42] = "Glückliche Schildkröte Zeit!"; + Main.buffName[43] = "Paladin Schild"; + Main.buffTip[43] = "25% der Schäden getroffen werden, um einen anderen Spieler umgeleitet werden"; + Main.buffName[44] = "Frost brennen"; + Main.buffTip[44] = "Es ist entweder sehr heiß oder sehr kalt. So oder so ist es wirklich weh tut"; + Main.buffName[45] = "Baby Esser"; + Main.buffTip[45] = "Ein Baby-Eater of Souls wird Ihnen folgen"; + Main.buffName[46] = "Gekühlt"; + Main.buffTip[46] = "Ihre Bewegungsgeschwindigkeit verringert wurde"; + Main.buffName[47] = "eingefroren"; + Main.buffTip[47] = "Sie können sich nicht bewegen!"; + Main.buffName[48] = "Liebling"; + Main.buffTip[48] = "Leben Regeneration erhöht"; + Main.buffName[49] = "Pygmäen"; + Main.buffTip[49] = "Die Pygmäen wird für euch streiten"; + Main.buffName[50] = "Baby-Skeletron Kopf"; + Main.buffTip[50] = "Noch nicht einmal fragen ..."; + Main.buffName[51] = "Baby-Hornet"; + Main.buffTip[51] = "Es denkt, du bist seine Mutter"; + Main.buffName[52] = "Tiki Geist"; + Main.buffTip[52] = "Ein freundlicher Geist verfolgt dich"; + Main.buffName[53] = "Haustier Eidechse"; + Main.buffTip[53] = "Chillin 'wie ein Reptil"; + Main.buffName[54] = "Papagei"; + Main.buffTip[54] = "Polly Mangel ist der Cracker"; + Main.buffName[55] = "Baby Trüffel"; + Main.buffTip[55] = "Ist das nicht gerade soooo süß?"; + Main.buffName[56] = "Bäumchen"; + Main.buffTip[56] = "Ein kleines Bäumchen Ihnen folgt"; + Main.buffName[57] = "Irrlicht"; + Main.buffTip[57] = "Ein Hauch Ihnen folgt"; + Main.buffName[58] = "Schnelle Heilung"; + Main.buffTip[58] = "Leben Regeneration stark erhöht"; + Main.buffName[59] = "Schatten Ausweichen"; + Main.buffTip[59] = "Sie werden den nächsten Angriff ausweichen"; + Main.buffName[60] = "Blatt Kristall"; + Main.buffTip[60] = "Shoots Kristall fährt um Feinde in der Nähe"; + Main.buffName[61] = "Baby-Dinosaurier"; + Main.buffTip[61] = "Ein Baby-Dinosaurier Ihnen folgt"; + Main.buffName[62] = "Eisbarriere"; + Main.buffTip[62] = "Verteidigung ist um 30 erhöht"; + Main.buffName[63] = "Panik!"; + Main.buffTip[63] = "Die Bewegungsgeschwindigkeit wird erhöht"; + Main.buffName[64] = "Baby Schleim"; + Main.buffTip[64] = "Das Baby Schleim wird für euch streiten"; + Main.buffName[65] = "Augapfel Frühling"; + Main.buffTip[65] = "Ein Augapfel Frühjahr Ihnen folgt"; + Main.buffName[66] = "Baby-Schneemann"; + Main.buffTip[66] = "Ein Baby-Schneemann Ihnen folgt"; + Main.buffName[67] = "Brennen"; + Main.buffTip[67] = "Losing Leben und verlangsamte Bewegung"; + Main.buffName[68] = "Erstickung"; + Main.buffTip[68] = "Losing Leben"; + Main.buffName[69] = "Ichor"; + Main.buffTip[69] = "Statt Verteidigung"; + Main.buffName[70] = "Gift 2"; + Main.buffTip[70] = "Losing Leben"; + Main.buffName[72] = "Midas"; + Main.buffTip[72] = "Lassen Sie mehr Geld auf den Tod"; + Main.buffName[80] = "Blackout"; + Main.buffTip[80] = "Licht Vision stark reduziert"; + Main.buffName[71] = "Waffe verleihen: Gift 2"; + Main.buffTip[71] = "Nahkampfangriffe verursachen Gift auf Ihre Ziele"; + Main.buffName[73] = "Waffe verleihen: verflucht Flammen"; + Main.buffTip[73] = "Nahkampfangriffe verursachen Feinde verflucht mit Flammen"; + Main.buffName[74] = "Waffe verleihen: Feuer"; + Main.buffTip[74] = "Nahkampfangriffe gesetzt Feinde"; + Main.buffName[75] = "Waffe verleihen: Gold"; + Main.buffTip[75] = "Nahkampfangriffe Feinde machen fallen mehr Gold"; + Main.buffName[76] = "Waffe verleihen: Ichor"; + Main.buffTip[76] = "Nahkampfangriffe verringern Feinde Verteidigung"; + Main.buffName[77] = "Waffe verleihen: Nanites"; + Main.buffTip[77] = "Nahkampfangriffe verwirren Feinde"; + Main.buffName[78] = "Waffe verleihen: Konfetti"; + Main.buffTip[78] = "Nahkampfangriffe verursachen Konfetti zu erscheinen"; + Main.buffName[79] = "Waffe verleihen: Gift"; + Main.buffTip[79] = "Nahkampfangriffe Gift Feinde"; + Main.tileName[13] = "Flasche"; + Main.tileName[14] = "Tabelle"; + Main.tileName[15] = "Stuhl"; + Main.tileName[16] = "Amboss"; + Main.tileName[17] = "Ofen"; + Main.tileName[18] = "Werkbank"; + Main.tileName[26] = "Dämon Altar"; + Main.tileName[77] = "Hoellenschmiede"; + Main.tileName[86] = "Webstuhl"; + Main.tileName[94] = "Gaerbottich"; + Main.tileName[96] = "Kochtopf"; + Main.tileName[101] = "Buecherregal"; + Main.tileName[106] = "Saegewerk"; + Main.tileName[114] = "Tueftler-Werkstatt"; + Main.tileName[133] = "Adamantitschmiede"; + Main.tileName[134] = "Mithrilamboss"; + } + else + { + if (Lang.lang == 3) + { + Lang.misc[0] = "L'esercito di goblin è stato sconfitto! "; + Lang.misc[1] = "Un esercito di goblin si sta avvicinando da ovest!"; + Lang.misc[2] = "Un esercito di goblin si sta avvicinando da est!"; + Lang.misc[3] = "Un esercito di goblin è arrivato!"; + Lang.misc[4] = "La Legione di Frost è stato sconfitto!"; + Lang.misc[5] = "La Legione gelo si sta avvicinando da ovest!"; + Lang.misc[6] = "La Legione gelo si sta avvicinando da est!"; + Lang.misc[7] = "La Legione gelo è arrivato!"; + Lang.misc[8] = "La luna di sangue sta sorgendo..."; + Lang.misc[9] = "Senti una presenza malvagia che ti sta guardando..."; + Lang.misc[10] = "Un freddo terribile ti attraversa la spina dorsale..."; + Lang.misc[11] = "Intorno a te echeggiano urla... "; + Lang.misc[12] = "Il tuo mondo è stato benedetto con cobalto! "; + Lang.misc[13] = "Il tuo mondo è stato benedetto con mitrilio! "; + Lang.misc[14] = "Il tuo mondo è stato benedetto con adamantio!"; + Lang.misc[15] = "I vecchi spiriti di luce e tenebre sono stati liberati. "; + Lang.misc[16] = "si è svegliato!"; + Lang.misc[17] = "è stato sconfitto!"; + Lang.misc[18] = "è arrivato!"; + Lang.misc[19] = " è stato ucciso..."; + Lang.misc[20] = "Un eclissi solare sta accadendo!"; + Lang.misc[21] = "Il vostro mondo è stato benedetto con Palladium!"; + Lang.misc[22] = "Il vostro mondo è stato benedetto con oricalco!"; + Lang.misc[23] = "Your world has been blessed with titanium!"; + Lang.misc[24] = "I pirati sono stati sconfitti!"; + Lang.misc[25] = "I pirati si stanno avvicinando da ovest!"; + Lang.misc[26] = "I pirati si stanno avvicinando da est!"; + Lang.misc[27] = "I pirati sono arrivati!"; + Lang.misc[28] = "Ti senti vibrazioni profondità sotto ..."; + Lang.misc[29] = "Questa sarà una notte terribile ..."; + Lang.misc[30] = "L'aria è sempre più fredda intorno a te ..."; + Lang.menu[0] = "Inizia una nuova istanza di Terraria!"; + Lang.menu[1] = "In esecuzione sulla porta"; + Lang.menu[2] = "Disconnetti"; + Lang.menu[3] = "Il server richiede una password:"; + Lang.menu[4] = "Accetta"; + Lang.menu[5] = "Indietro"; + Lang.menu[6] = "Annulla"; + Lang.menu[7] = "Inserisci la password del server:"; + Lang.menu[8] = "Avvio del server..."; + Lang.menu[9] = "Caricamento non riuscito!"; + Lang.menu[10] = "Carica backup"; + Lang.menu[11] = "Backup non trovato"; + Lang.menu[12] = "Giocatore singolo"; + Lang.menu[13] = "Multigiocatore"; + Lang.menu[14] = "Impostazioni"; + Lang.menu[15] = "Esci"; + Lang.menu[16] = "Crea personaggio"; + Lang.menu[17] = "Elimina"; + Lang.menu[18] = "Capelli"; + Lang.menu[19] = "Occhi"; + Lang.menu[20] = "Pelle"; + Lang.menu[21] = "Abiti"; + Lang.menu[22] = "Maschio"; + Lang.menu[23] = "Femmina"; + Lang.menu[24] = "Harcore"; + Lang.menu[25] = "Mediumcore "; + Lang.menu[26] = "Softcore "; + Lang.menu[27] = "Casuale"; + Lang.menu[28] = "Crea"; + Lang.menu[29] = "I personaggi hardcore muoiono definitivamente"; + Lang.menu[30] = "I personaggi mediumcore perdono oggetti morendo"; + Lang.menu[31] = "I personaggi softcore perdono denaro morendo"; + Lang.menu[32] = "Livello di difficoltà"; + Lang.menu[33] = "Camicia"; + Lang.menu[34] = "Maglietta"; + Lang.menu[35] = "Pantaloni"; + Lang.menu[36] = "Scarpe"; + Lang.menu[37] = "Capelli"; + Lang.menu[38] = "Colore capelli"; + Lang.menu[39] = "Colore occhi"; + Lang.menu[40] = "Colore pelle"; + Lang.menu[41] = "Colore camicia"; + Lang.menu[42] = "Colore maglietta"; + Lang.menu[43] = "Colore pantaloni"; + Lang.menu[44] = "Colore scarpe"; + Lang.menu[45] = "Inserisci nome personaggio:"; + Lang.menu[46] = "Elimina"; + Lang.menu[47] = "Crea mondo"; + Lang.menu[48] = "Inserisci nome mondo:"; + Lang.menu[49] = "Finestra"; + Lang.menu[50] = "Schermo intero"; + Lang.menu[51] = "Risoluzione"; + Lang.menu[52] = "Parallasse"; + Lang.menu[53] = "Salta fotogrammi Off (sconsigliato)"; + Lang.menu[54] = "Salta fotogrammi On (consigliato)"; + Lang.menu[55] = "Illuminazione: a colori "; + Lang.menu[56] = "Illuminazione: bianca"; + Lang.menu[57] = "Illuminazione: retro"; + Lang.menu[58] = "Illuminazione: speciale"; + Lang.menu[59] = "Qualità: automatica"; + Lang.menu[60] = "Qualità: alta"; + Lang.menu[61] = "Qualità: media"; + Lang.menu[62] = "Qualità: bassa"; + Lang.menu[63] = "Video"; + Lang.menu[64] = "Colore cursore"; + Lang.menu[65] = "Volume"; + Lang.menu[66] = "Comandi"; + Lang.menu[67] = "Salvataggio automatico On"; + Lang.menu[68] = "Salvataggio automatico Off"; + Lang.menu[69] = "Pausa automatica On"; + Lang.menu[70] = "Pausa automatica Off"; + Lang.menu[71] = "Testo di collegamento On"; + Lang.menu[72] = "Testo di collegamento Off"; + Lang.menu[73] = "Risoluzione a schermo intero"; + Lang.menu[74] = "Su "; + Lang.menu[75] = "Giù "; + Lang.menu[76] = "Sinistra "; + Lang.menu[77] = "Destra "; + Lang.menu[78] = "Salta "; + Lang.menu[79] = "Lancia "; + Lang.menu[80] = "Inventario "; + Lang.menu[81] = "Cura veloce "; + Lang.menu[82] = "Mana veloce "; + Lang.menu[83] = "Buff veloce "; + Lang.menu[84] = "Rampino "; + Lang.menu[85] = "Selezione automatica "; + Lang.menu[86] = "Ripristina predefiniti"; + Lang.menu[87] = "Entra"; + Lang.menu[88] = "Ospita e gioca"; + Lang.menu[89] = "Inserisci indirizzo IP del server:"; + Lang.menu[90] = "Inserisci porta server:"; + Lang.menu[91] = "Scegli grandezza del mondo:"; + Lang.menu[92] = "Piccolo"; + Lang.menu[93] = "Medio"; + Lang.menu[94] = "Grande"; + Lang.menu[95] = "Rosso:"; + Lang.menu[96] = "Verde:"; + Lang.menu[97] = "Blu:"; + Lang.menu[98] = "Audio:"; + Lang.menu[99] = "Musica:"; + Lang.menu[100] = "Sfondo su"; + Lang.menu[101] = "Fondo off"; + Lang.menu[102] = "Selezionare la lingua"; + Lang.menu[103] = "Lingua"; + Lang.menu[104] = "Sì"; + Lang.menu[105] = "No"; + Lang.menu[106] = "mappa levetta stile"; + Lang.menu[107] = "Alterna a tutto schermo"; + Lang.menu[108] = "zoom in"; + Lang.menu[109] = "rimpicciolire"; + Lang.menu[110] = "diminuire Trasparenza"; + Lang.menu[111] = "aumentare la trasparenza"; + Lang.menu[112] = "mappa attivato"; + Lang.menu[113] = "mappa Disabilitato"; + Lang.gen[0] = "Crea terreno del mondo:"; + Lang.gen[1] = "Aggiunta sabbia..."; + Lang.gen[2] = "Creazione colline..."; + Lang.gen[3] = "Aggiungi terra dietro la terra:"; + Lang.gen[4] = "Aggiunta rocce nella terra..."; + Lang.gen[5] = "Aggiunta terra nelle rocce..."; + Lang.gen[6] = "Aggiunta argilla..."; + Lang.gen[7] = "Crea fori casuali:"; + Lang.gen[8] = "Crea piccole grotte: "; + Lang.gen[9] = "Crea grandi grotte:"; + Lang.gen[10] = "Creazione di grotte superficiali..."; + Lang.gen[11] = "Crea giungla:"; + Lang.gen[12] = "Creazione di isole galleggianti..."; + Lang.gen[13] = "Aggiunta campi di funghi..."; + Lang.gen[14] = "Aggiunta fango nella terra..."; + Lang.gen[15] = "Aggiunta fango..."; + Lang.gen[16] = "Aggiunta elementi luminosi..."; + Lang.gen[17] = "Aggiunta ragnatele..."; + Lang.gen[18] = "Crea sottomondo:"; + Lang.gen[19] = "Aggiungi creature acquatiche:"; + Lang.gen[20] = "Rendi il mondo malvagio:"; + Lang.gen[21] = "Creazione grotte montuose..."; + Lang.gen[22] = "Creazione spiagge..."; + Lang.gen[23] = "Aggiunta gemme..."; + Lang.gen[24] = "Ruota sabbia:"; + Lang.gen[25] = "Pulisci sfondi terra:"; + Lang.gen[26] = "Aggiungi altari:"; + Lang.gen[27] = "Versa liquidi:"; + Lang.gen[28] = "Aggiungi cristalli di vita:"; + Lang.gen[29] = "Aggiungi statue:"; + Lang.gen[30] = "Nascondi tesori:"; + Lang.gen[31] = "Nascondi più tesori:"; + Lang.gen[32] = "Nascondi tesori nella giungla:"; + Lang.gen[33] = "Nascondi tesori in acqua:"; + Lang.gen[34] = "Disponi trappole:"; + Lang.gen[35] = "Disponi gli oggetti fragili:"; + Lang.gen[36] = "Disponi creazioni degli inferi:"; + Lang.gen[37] = "Estensione erba..."; + Lang.gen[38] = "Crescita cactus..."; + Lang.gen[39] = "Pianta girasoli..."; + Lang.gen[40] = "Pianta alberi..."; + Lang.gen[41] = "Pianta erbe..."; + Lang.gen[42] = "Pianta erbacce..."; + Lang.gen[43] = "Crescita viti..."; + Lang.gen[44] = "Pianta fiori..."; + Lang.gen[45] = "Pianta funghi..."; + Lang.gen[46] = "Libera risorse inutilizzate:"; + Lang.gen[47] = "Resetta oggetti di gioco:"; + Lang.gen[48] = "Imposta modalità difficile..."; + Lang.gen[49] = "Salva dati del mondo:"; + Lang.gen[50] = "Backup file mondo..."; + Lang.gen[51] = "Carica dati del mondo:"; + Lang.gen[52] = "Controlla l'allineamento delle mattonelle:"; + Lang.gen[53] = "Caricamento non riuscito!"; + Lang.gen[54] = "Backup non trovato"; + Lang.gen[55] = "Trova cornici delle mattonelle:"; + Lang.gen[56] = "L'aggiunta di neve ..."; + Lang.gen[57] = "Mondo"; + Lang.gen[58] = "La creazione di dungeon:"; + Lang.gen[59] = "Un meteorite è atterrato!"; + Lang.gen[60] = "Smoothing il mondo:"; + Lang.gen[61] = "Mossification:"; + Lang.gen[62] = "Gemification:"; + Lang.gen[63] = "Fare pareti delle caverne:"; + Lang.gen[64] = "Crescere grotte ragno:"; + Lang.gen[65] = "Clearing mappa dati:"; + Lang.gen[66] = "Salvataggio dei dati della mappa:"; + Lang.gen[67] = "Caricamento dati della mappa:"; + Lang.gen[68] = "disegnare la mappa:"; + Lang.gen[69] = "creazione di cascate:"; + Lang.gen[70] = "Creazione di rovine della giungla..."; + Lang.gen[71] = "Creazione di nidi di calabrone..."; + Lang.gen[72] = "Rendere il mondo insanguinato:"; + Lang.inter[0] = "Vita:"; + Lang.inter[1] = "Respiro"; + Lang.inter[2] = "Mana "; + Lang.inter[3] = "Bidone"; + Lang.inter[4] = "Inventario"; + Lang.inter[5] = "Hotbar sbloccato"; + Lang.inter[6] = "Hotbar bloccato"; + Lang.inter[7] = "Alloggio"; + Lang.inter[8] = "Richiesta alloggio"; + Lang.inter[9] = "Accessori"; + Lang.inter[10] = "Difesa"; + Lang.inter[11] = "Sociale"; + Lang.inter[12] = "Casco"; + Lang.inter[13] = "Camicia"; + Lang.inter[14] = "Pantaloni"; + Lang.inter[15] = "platino"; + Lang.inter[16] = "oro"; + Lang.inter[17] = "argento"; + Lang.inter[18] = "rame"; + Lang.inter[19] = "Riforgiare"; + Lang.inter[20] = "Posizionare un oggetto qui per riforgiare"; + Lang.inter[21] = "Mostra ricetta da usare"; + Lang.inter[22] = "Oggetti richiesti:"; + Lang.inter[23] = "Nessuno"; + Lang.inter[24] = "Posizionare un materiale qui per mostrare ricette"; + Lang.inter[25] = "Artigianato"; + Lang.inter[26] = "Monete"; + Lang.inter[27] = "Munizioni"; + Lang.inter[28] = "Negozio"; + Lang.inter[29] = "Saccheggia tutto"; + Lang.inter[30] = "Deposita tutto"; + Lang.inter[31] = "Accumulo veloce"; + Lang.inter[32] = "Salvadanaio"; + Lang.inter[33] = "Caveau"; + Lang.inter[34] = "Tempo:"; + Lang.inter[35] = "Salva ed esci"; + Lang.inter[36] = "Disconnetti"; + Lang.inter[37] = "Oggetti"; + Lang.inter[38] = "Sei morto..."; + Lang.inter[39] = "Questo alloggio è adatto."; + Lang.inter[40] = "Questo alloggio non è valido."; + Lang.inter[41] = "Questo alloggio è già occupato."; + Lang.inter[42] = "Questo alloggio è distrutto."; + Lang.inter[43] = "Connessione scaduta"; + Lang.inter[44] = "Ricezione dati mattonella"; + Lang.inter[45] = "Equipaggiare"; + Lang.inter[46] = "Costo"; + Lang.inter[47] = "Salvare"; + Lang.inter[48] = "Edit"; + Lang.inter[49] = "Stato"; + Lang.inter[50] = "Maledizione"; + Lang.inter[51] = "Aiutare"; + Lang.inter[52] = "Fermer"; + Lang.inter[53] = "Acqua"; + Lang.inter[54] = "Guarire"; + Lang.inter[55] = "Questa custodia non soddisfa i requisiti per un"; + Lang.inter[56] = "lavica"; + Lang.inter[57] = "tingere"; + Lang.inter[58] = "dolcezza"; + Lang.tip[0] = "Equipaggiato in slot sociale"; + Lang.tip[1] = "Nessun parametro incrementato"; + Lang.tip[2] = " Danno nel corpo a corpo"; + Lang.tip[3] = " Danno a distanza"; + Lang.tip[4] = " Danno magico"; + Lang.tip[5] = "% Possibilità colpo critico"; + Lang.tip[6] = "Velocità matta"; + Lang.tip[7] = "Extra velocità"; + Lang.tip[8] = "Alta velocità"; + Lang.tip[9] = "Media velocità"; + Lang.tip[10] = "Bassa velocità"; + Lang.tip[11] = "Velocità molto bassa"; + Lang.tip[12] = "Velocità extra bassa"; + Lang.tip[13] = "Velocità lumaca"; + Lang.tip[14] = "Nessuno spintone"; + Lang.tip[15] = "Spintone extra debole"; + Lang.tip[16] = "Spintone molto debole"; + Lang.tip[17] = "Spintone debole"; + Lang.tip[18] = "Spintone medio"; + Lang.tip[19] = "Spintone forte"; + Lang.tip[20] = "Spintone molto forte"; + Lang.tip[21] = "Spintone extra forte"; + Lang.tip[22] = "Spintone matto"; + Lang.tip[23] = "Equipaggiabili"; + Lang.tip[24] = "Oggetti estetici"; + Lang.tip[25] = " Difesa"; + Lang.tip[26] = "% Potenza piccone"; + Lang.tip[27] = "% Potenza ascia"; + Lang.tip[28] = "% Potenza martello"; + Lang.tip[29] = "Risana"; + Lang.tip[30] = "vita"; + Lang.tip[31] = "mana"; + Lang.tip[32] = "Utilizza"; + Lang.tip[33] = "Può essere posizionato"; + Lang.tip[34] = "Munizioni"; + Lang.tip[35] = "Consumabile"; + Lang.tip[36] = "Materiale"; + Lang.tip[37] = " Durata minuto"; + Lang.tip[38] = " Durata secondo"; + Lang.tip[39] = "% Danno"; + Lang.tip[40] = "% Velocità"; + Lang.tip[41] = "% Possibilità colpo critico"; + Lang.tip[42] = "% Costo mana"; + Lang.tip[43] = "% Dimensione"; + Lang.tip[44] = "% Velocità del proiettile"; + Lang.tip[45] = "% Spintone"; + Lang.tip[46] = "% Velocità movimento"; + Lang.tip[47] = "% Velocità corpo a corpo"; + Lang.tip[48] = "Imposta bonus:"; + Lang.tip[49] = "Prezzo di vendita:"; + Lang.tip[50] = "Prezzo di acquisto:"; + Lang.tip[51] = "Nessun valore"; + Lang.tip[52] = "consuma "; + Lang.tip[53] = " convocare i danni"; + Lang.tip[54] = " gamma"; + Lang.tip[55] = " danni"; + Lang.mp[0] = "Ricevere:"; + Lang.mp[1] = "Password errata."; + Lang.mp[2] = "Operazione non valida in questo stato."; + Lang.mp[3] = "Sei stato bandito da questo server."; + Lang.mp[4] = "Non stai utilizzando la stessa versione del server."; + Lang.mp[5] = "è già su questo server."; + Lang.mp[6] = "/in gioco"; + Lang.mp[7] = "Giocatori correnti:"; + Lang.mp[8] = "/lancia"; + Lang.mp[9] = "lancia"; + Lang.mp[10] = "Non fai parte di un gruppo!"; + Lang.mp[11] = "ha attivato il PvP!"; + Lang.mp[12] = "ha disattivato il PvP!"; + Lang.mp[13] = "non è più in un gruppo."; + Lang.mp[14] = "si è unito al gruppo rosso."; + Lang.mp[15] = "si è unito al gruppo verde."; + Lang.mp[16] = "si è unito al gruppo blu."; + Lang.mp[17] = "si è unito al gruppo giallo."; + Lang.mp[18] = "Benevenuto a"; + Lang.mp[19] = "ha aderito."; + Lang.mp[20] = "ha smesso di."; + Lang.the = "la "; + Lang.dt[0] = "non ha trovato l'antidoto"; + Lang.dt[1] = "non ha spento il fuoco"; + Main.buffName[1] = "Pelle ossidiana"; + Main.buffTip[1] = "Immune alla lava"; + Main.buffName[2] = "Rigenerazione"; + Main.buffTip[2] = "Rigenera la vita"; + Main.buffName[3] = "Velocità"; + Main.buffTip[3] = "Velocità di movimento aumentata del 25%"; + Main.buffName[4] = "Branchie"; + Main.buffTip[4] = "Respira acqua invece di aria"; + Main.buffName[5] = "Pelle di ferro"; + Main.buffTip[5] = "Aumenta la difesa di 8"; + Main.buffName[6] = "Rigenerazione mana"; + Main.buffTip[6] = "Aumenta la rigenerazione del mana"; + Main.buffName[7] = "Potere magico"; + Main.buffTip[7] = "Danno magico aumentato del 20%"; + Main.buffName[8] = "Cascata di piume"; + Main.buffTip[8] = "Premi UP o DOWN per controllare la velocità di discesa"; + Main.buffName[9] = "Speleologo"; + Main.buffTip[9] = "Mostra l'ubicazione di tesori e minerale"; + Main.buffName[10] = "Invisibilità"; + Main.buffTip[10] = "Rende invisibili"; + Main.buffName[11] = "Brillantezza"; + Main.buffTip[11] = "Emette luce"; + Main.buffName[12] = "Civetta notturna"; + Main.buffTip[12] = "Visione notturna aumentata"; + Main.buffName[13] = "Battaglia"; + Main.buffTip[13] = "Ritmo generazione nemici aumentato"; + Main.buffName[14] = "Spine"; + Main.buffTip[14] = "Anche gli aggressori subiscono danni"; + Main.buffName[15] = "Camminata nell'acqua"; + Main.buffTip[15] = "Premi DOWN per entrare nell'acqua"; + Main.buffName[16] = "Arco"; + Main.buffTip[16] = "Danno e velocià freccia aumentati del 20%"; + Main.buffName[17] = "Cacciatore"; + Main.buffTip[17] = "Mostra la posizione dei nemici"; + Main.buffName[18] = "Gravità"; + Main.buffTip[18] = "Premi UP o DOWN per invertire la gravità"; + Main.buffName[19] = "Orbita di luce"; + Main.buffTip[19] = "Sfera magica che fornisce luce"; + Main.buffName[20] = "Avvelenato"; + Main.buffTip[20] = "Perdi lentamente la vita"; + Main.buffName[21] = "Malattia pozione"; + Main.buffTip[21] = "Non si possono più consumare oggetti curativi"; + Main.buffName[22] = "Oscurità"; + Main.buffTip[22] = "Diminuita visione della luce"; + Main.buffName[23] = "Maledetto"; + Main.buffTip[23] = "Non si possono più utilizzare oggetti"; + Main.buffName[24] = "A fuoco!"; + Main.buffTip[24] = "Perdi lentamente la vita"; + Main.buffName[25] = "Brillo"; + Main.buffTip[25] = "Abilità corpo a corpo aumentata, difesa abbassata"; + Main.buffName[26] = "Ben nutrito"; + Main.buffTip[26] = "Migliorie minori a tutti i parametri"; + Main.buffName[27] = "Fata"; + Main.buffTip[27] = "Una fata ti sta seguendo"; + Main.buffName[28] = "Lupo mannaro"; + Main.buffTip[28] = "Abilità fisiche aumentate"; + Main.buffName[29] = "Chiaroveggenza"; + Main.buffTip[29] = "Poteri magici aumentati"; + Main.buffName[30] = "Emorragia"; + Main.buffTip[30] = "Impossibile rigenerare vita"; + Main.buffName[31] = "Confuso"; + Main.buffTip[31] = "Movimento invertito"; + Main.buffName[32] = "Lento"; + Main.buffTip[32] = "Ridotta velocità movimento"; + Main.buffName[33] = "Debole"; + Main.buffTip[33] = "Abilità fisiche diminuite"; + Main.buffName[34] = "Tritone"; + Main.buffTip[34] = "Può respirare e muoversi facilmente sott'acqua"; + Main.buffName[35] = "Tacere"; + Main.buffTip[35] = "Non possono utilizzare gli elementi che richiedono mana"; + Main.buffName[36] = "Armatura rotta"; + Main.buffTip[36] = "La difesa è dimezzata"; + Main.buffName[37] = "Inorridito"; + Main.buffTip[37] = "Hai visto qualcosa di orribile, non c'è via di scampo."; + Main.buffName[38] = "La Lingua"; + Main.buffTip[38] = "Sei stato succhiato nella bocca"; + Main.buffName[39] = "Inferno maledetto"; + Main.buffTip[39] = "Perdi la vita"; + Main.buffName[40] = "Animale coniglio"; + Main.buffTip[40] = "Penso che vuole la tua carota"; + Main.buffName[41] = "baby pinguino"; + Main.buffTip[41] = "Penso che vuole il vostro pesce"; + Main.buffName[42] = "tartaruga"; + Main.buffTip[42] = "Tempo tartaruga felice!"; + Main.buffName[43] = "Scudo Paladino"; + Main.buffTip[43] = "Il 25% dei danni subiti sarà reindirizzato ad un altro giocatore"; + Main.buffName[44] = "gelo ustione"; + Main.buffTip[44] = "E 'sia davvero caldo o molto freddo. In entrambi i casi fa davvero male"; + Main.buffName[45] = "bambino Eater"; + Main.buffTip[45] = "Un bambino Eater of Souls ti sta seguendo"; + Main.buffName[46] = "refrigerate"; + Main.buffTip[46] = "La velocità di movimento è stato ridotto"; + Main.buffName[47] = "congelato"; + Main.buffTip[47] = "Non è possibile spostare!"; + Main.buffName[48] = "dolcezza"; + Main.buffTip[48] = "La vita di rigenerazione viene aumentata"; + Main.buffName[49] = "pigmei"; + Main.buffTip[49] = "I pigmei combatteranno per voi"; + Main.buffName[50] = "Bambino Skeletron Capo"; + Main.buffTip[50] = "Non hanno nemmeno chiedere ..."; + Main.buffName[51] = "bambino Hornet"; + Main.buffTip[51] = "Si pensa che tu sia sua madre"; + Main.buffName[52] = "Tiki Spirito"; + Main.buffTip[52] = "Uno spirito amichevole ti sta seguendo"; + Main.buffName[53] = "lucertola"; + Main.buffTip[53] = "Chillin 'come un rettile"; + Main.buffName[54] = "Pet Parrot"; + Main.buffTip[54] = "Polly want è il cracker"; + Main.buffName[55] = "tartufo bambino"; + Main.buffTip[55] = "Non è questo solo soooo cute?"; + Main.buffName[56] = "Pet Alberello"; + Main.buffTip[56] = "Un piccolo alberello ti sta seguendo"; + Main.buffName[57] = "Wisp"; + Main.buffTip[57] = "Un filo ti sta seguendo"; + Main.buffName[58] = "rapida guarigione"; + Main.buffTip[58] = "Vita rigenerazione è notevolmente aumentato"; + Main.buffName[59] = "ombra Dodge"; + Main.buffTip[59] = "Potrai schivare il prossimo attacco"; + Main.buffName[60] = "foglia di cristallo"; + Main.buffTip[60] = "Lascia cristallo spara a nemici nelle vicinanze"; + Main.buffName[61] = "cucciolo di dinosauro"; + Main.buffTip[61] = "Un dinosauro bambino ti sta seguendo"; + Main.buffName[62] = "Barriera di Ghiaccio"; + Main.buffTip[62] = "La difesa è aumentata del 30"; + Main.buffName[63] = "panico!"; + Main.buffTip[63] = "Velocità di movimento è aumentata"; + Main.buffName[64] = "bambino Slime"; + Main.buffTip[64] = "Il bambino melma combatterà per voi"; + Main.buffName[65] = "Eyeball Primavera"; + Main.buffTip[65] = "Una molla bulbo oculare ti sta seguendo"; + Main.buffName[66] = "bambino Snowman"; + Main.buffTip[66] = "Un pupazzo di neve bambino ti sta seguendo"; + Main.buffName[67] = "Masterizzazione"; + Main.buffTip[67] = "Perdere la vita e rallentato il movimento"; + Main.buffName[68] = "soffocamento"; + Main.buffTip[68] = "perdere la vita"; + Main.buffName[69] = "Ichor"; + Main.buffTip[69] = "difesa ridotto"; + Main.buffName[70] = "Venom"; + Main.buffTip[70] = "perdere la vita"; + Main.buffName[72] = "Midas"; + Main.buffTip[72] = "Goccia più soldi sulla morte"; + Main.buffName[80] = "Blackout"; + Main.buffTip[80] = "Vision Light notevolmente ridotta"; + Main.buffName[71] = "Arma Imbue: veleno"; + Main.buffTip[71] = "Attacchi in mischia infliggono veleno sui tuoi obiettivi"; + Main.buffName[73] = "Arma Imbue: Fiamme Cursed"; + Main.buffTip[73] = "Attacchi in mischia infliggono nemici con fiamme maledette"; + Main.buffName[74] = "Arma Imbue: Fuoco"; + Main.buffTip[74] = "Attacchi corpo a corpo impostati nemici in fiamme"; + Main.buffName[75] = "Arma Imbue: Gold"; + Main.buffTip[75] = "Attacchi corpo a corpo i nemici fanno cadere più oro"; + Main.buffName[76] = "Arma Imbue: Ichor"; + Main.buffTip[76] = "Attacchi corpo a corpo diminuiscono nemici difesa"; + Main.buffName[77] = "Arma Imbue: Nanites"; + Main.buffTip[77] = "Attacchi corpo a corpo confondono i nemici"; + Main.buffName[78] = "Arma Imbue: Confetti"; + Main.buffTip[78] = "Attacchi corpo a corpo causano a comparire coriandoli"; + Main.buffName[79] = "Arma Imbue: Poison"; + Main.buffTip[79] = "Mischia attacca nemici veleno"; + Main.tileName[13] = "Bottiglia"; + Main.tileName[14] = "Tavolo"; + Main.tileName[15] = "Sedia"; + Main.tileName[16] = "Incudine"; + Main.tileName[17] = "Forno"; + Main.tileName[18] = "Banco di lavoro"; + Main.tileName[26] = "Demone altare"; + Main.tileName[77] = "Creazione degli inferi"; + Main.tileName[86] = "Telaio"; + Main.tileName[94] = "Barilotto"; + Main.tileName[96] = "Pentola"; + Main.tileName[101] = "Scaffale"; + Main.tileName[106] = "Segheria"; + Main.tileName[114] = "Laboratorio dell'inventore"; + Main.tileName[133] = "Fornace di adamantio"; + Main.tileName[134] = "Incudine di mitrilio"; + } + else + { + if (Lang.lang == 4) + { + Lang.misc[0] = "L'armée des gobelins a été vaincue."; + Lang.misc[1] = "Une armée de gobelins approche par l'ouest."; + Lang.misc[2] = "Une armée de gobelins approche par l'est."; + Lang.misc[3] = "Une armée gobelin est arrivé!"; + Lang.misc[4] = "La Légion Frost a été vaincu!"; + Lang.misc[5] = "La Légion Frost est venant de l'ouest!"; + Lang.misc[6] = "La Légion Frost est l'approche de l'Est!"; + Lang.misc[7] = "La Légion gel est arrivé!"; + Lang.misc[8] = "La lune de sang se lève..."; + Lang.misc[9] = "Vous sentez une présence maléfique vous observer."; + Lang.misc[10] = "Un frisson vous parcourt le dos..."; + Lang.misc[11] = "Des cris retentissent autour de vous..."; + Lang.misc[12] = "Votre monde a la chance de profiter de ressources de cobalt."; + Lang.misc[13] = "Votre monde a la chance de profiter de ressources de mythril."; + Lang.misc[14] = "Votre monde a la chance de profiter de ressources d'adamantine."; + Lang.misc[15] = "Les anciens esprits de l'ombre et de la lumière ont été relâchés."; + Lang.misc[16] = "est réveillé."; + Lang.misc[17] = "a été vaincue."; + Lang.misc[18] = "est arrivée."; + Lang.misc[19] = " s'est fait éviscérer..."; + Lang.misc[20] = "Une éclipse solaire se produit!"; + Lang.misc[21] = "Votre monde a été béni avec Palladium!"; + Lang.misc[22] = "Votre monde a été béni avec orichalque!"; + Lang.misc[23] = "Votre monde a été béni avec Titanium!"; + Lang.misc[24] = "Les pirates ont été vaincus!"; + Lang.misc[25] = "Les pirates venant de l'ouest!"; + Lang.misc[26] = "Pirates se rapprochent de l'Est!"; + Lang.misc[27] = "Les pirates sont arrivés!"; + Lang.misc[28] = "Vous vous sentez des vibrations du plus profond ci-dessous ..."; + Lang.misc[29] = "Cela va être une nuit terrible ..."; + Lang.misc[30] = "L'air se refroidit autour de vous ..."; + Lang.menu[0] = "Démarrez une nouvelle instance de Terraria pour rejoindre une partie."; + Lang.menu[1] = "Fonctionne sur le port "; + Lang.menu[2] = "Déconnexion"; + Lang.menu[3] = "Le serveur requiert un mot de passe :"; + Lang.menu[4] = "Accepter"; + Lang.menu[5] = "Retour"; + Lang.menu[6] = "Annuler"; + Lang.menu[7] = "Entrer le mot de passe :"; + Lang.menu[8] = "Lancement du serveur..."; + Lang.menu[9] = "Le chargement a échoué."; + Lang.menu[10] = "Charger une sauvegarde"; + Lang.menu[11] = "Aucune sauvegarde trouvée"; + Lang.menu[12] = "Un joueur"; + Lang.menu[13] = "Multijoueur"; + Lang.menu[14] = "Réglages"; + Lang.menu[15] = "Quitter"; + Lang.menu[16] = "Créer un personnage"; + Lang.menu[17] = "Supprimer"; + Lang.menu[18] = "Cheveux"; + Lang.menu[19] = "Yeux"; + Lang.menu[20] = "Peau"; + Lang.menu[21] = "Vêtements"; + Lang.menu[22] = "Homme"; + Lang.menu[23] = "Femme"; + Lang.menu[24] = "Difficile"; + Lang.menu[25] = "Normal"; + Lang.menu[26] = "Facile"; + Lang.menu[27] = "Aléatoire"; + Lang.menu[28] = "Créer"; + Lang.menu[29] = "En cas de mort dans le mode Difficile, le personnage est tout simplement supprimé"; + Lang.menu[30] = "En cas de mort dans le mode Normal, les personnages laissent échapper des objets en mourant"; + Lang.menu[31] = "Les personnages en mode facile laissent échapper de l'argent en mourant."; + Lang.menu[32] = "Choisir la difficulté"; + Lang.menu[33] = "Chemise"; + Lang.menu[34] = "Maillot de corps"; + Lang.menu[35] = "Pantalon"; + Lang.menu[36] = "Chaussures"; + Lang.menu[37] = "Cheveux"; + Lang.menu[38] = "Couleur des cheveux"; + Lang.menu[39] = "Couleur des yeux"; + Lang.menu[40] = "Couleur de peau"; + Lang.menu[41] = "Couleur de chemise"; + Lang.menu[42] = "Couleur de maillot de corps"; + Lang.menu[43] = "Couleur de pantalon"; + Lang.menu[44] = "Couelur des chaussures"; + Lang.menu[45] = "Saisir le nom du personnage :"; + Lang.menu[46] = "Supprimer"; + Lang.menu[47] = "Créer un monde"; + Lang.menu[48] = "Saisir un nom de monde :"; + Lang.menu[49] = "Mode fenêtré"; + Lang.menu[50] = "Mode Plein écran"; + Lang.menu[51] = "Résolution"; + Lang.menu[52] = "Parallax"; + Lang.menu[53] = "Frame Skip activé (non recommandé)"; + Lang.menu[54] = "Frame Skip désactivé (recommandé)"; + Lang.menu[55] = "Lumière : couleur"; + Lang.menu[56] = "Lumière : blanche"; + Lang.menu[57] = "Lumière : rétro"; + Lang.menu[58] = "Lumière : psyché"; + Lang.menu[59] = "Qualité : auto"; + Lang.menu[60] = "Qualité : haute"; + Lang.menu[61] = "Qualité : moyenne"; + Lang.menu[62] = "Qualité : basse"; + Lang.menu[63] = "Vidéo"; + Lang.menu[64] = "Curseur chromatique"; + Lang.menu[65] = "Volume"; + Lang.menu[66] = "Contrôles"; + Lang.menu[67] = "Sauvegarde auto activée"; + Lang.menu[68] = "Sauvegarde auto désactivée"; + Lang.menu[69] = "Pause auto activée"; + Lang.menu[70] = "Pause auto désactivée"; + Lang.menu[71] = "Affichage du texte activé"; + Lang.menu[72] = "Affichage du texte désactivé"; + Lang.menu[73] = "Résolution Plein écran"; + Lang.menu[74] = "Haut "; + Lang.menu[75] = "Bas "; + Lang.menu[76] = "Gauche "; + Lang.menu[77] = "Droite "; + Lang.menu[78] = "Sauter "; + Lang.menu[79] = "Lancer "; + Lang.menu[80] = "Inventaire "; + Lang.menu[81] = "Soin rapide "; + Lang.menu[82] = "Mana rapide "; + Lang.menu[83] = "Buff rapide "; + Lang.menu[84] = "Agripper "; + Lang.menu[85] = "Sélection auto "; + Lang.menu[86] = "Réglages par défaut"; + Lang.menu[87] = "Rejoindre"; + Lang.menu[88] = "Héberger et jouer"; + Lang.menu[89] = "Entrer l'adresse IP du serveur :"; + Lang.menu[90] = "Entrer le port du serveur :"; + Lang.menu[91] = "Choisir la taille du monde :"; + Lang.menu[92] = "Petit"; + Lang.menu[93] = "Moyen"; + Lang.menu[94] = "Grand"; + Lang.menu[95] = "Rouge :"; + Lang.menu[96] = "Vert :"; + Lang.menu[97] = "Bleu :"; + Lang.menu[98] = "Son :"; + Lang.menu[99] = "Musique :"; + Lang.menu[100] = "De fond sur"; + Lang.menu[101] = "De fond au large"; + Lang.menu[102] = "Sélectionnez la langue"; + Lang.menu[103] = "Langue"; + Lang.menu[104] = "Oui"; + Lang.menu[105] = "Pas"; + Lang.menu[106] = "Basculer Carte de style"; + Lang.menu[107] = "basculer Plein écran"; + Lang.menu[108] = "Zoom"; + Lang.menu[109] = "Zoom arrière"; + Lang.menu[110] = "Diminution de la transparence"; + Lang.menu[111] = "augmenter la transparence"; + Lang.menu[112] = "carte Activé"; + Lang.menu[113] = "carte handicapés"; + Lang.gen[0] = "Création du terrain :"; + Lang.gen[1] = "Ajout de sable..."; + Lang.gen[2] = "Création des collines..."; + Lang.gen[3] = "Placement de la boue derrière la boue :"; + Lang.gen[4] = "Placement des rochers dans la boue..."; + Lang.gen[5] = "Placement de boue dans les rochers..."; + Lang.gen[6] = "Ajout d'argile..."; + Lang.gen[7] = "Création de trous aléatoires :"; + Lang.gen[8] = "Création de petites cavernes :"; + Lang.gen[9] = "Création de grandes cavernes :"; + Lang.gen[10] = "Création des cavernes en surface..."; + Lang.gen[11] = "Création de jungle :"; + Lang.gen[12] = "Création d'îles flottantes..."; + Lang.gen[13] = "Ajout des patchs de champignon..."; + Lang.gen[14] = "Placement de la terre dans la boue..."; + Lang.gen[15] = "Ajout de limon..."; + Lang.gen[16] = "Ajout des brillances..."; + Lang.gen[17] = "Ajout de toiles d'araignées..."; + Lang.gen[18] = "Création du monde inférieur :"; + Lang.gen[19] = "Ajout d'étendues d'eau :"; + Lang.gen[20] = "Corruption du monde :"; + Lang.gen[21] = "Création de cavernes montagneuses..."; + Lang.gen[22] = "Création de plages..."; + Lang.gen[23] = "Ajout de gemmes..."; + Lang.gen[24] = "Gravitation du sable :"; + Lang.gen[25] = "Nettoyage d'arrière-plans de boue :"; + Lang.gen[26] = "Placement d'autels :"; + Lang.gen[27] = "Clarification de l'eau :"; + Lang.gen[28] = "Placement de cristaux de vie :"; + Lang.gen[29] = "Placement de statues :"; + Lang.gen[30] = "Dissimulation de trésor :"; + Lang.gen[31] = "Dissimulation de trésor supplémentaire :"; + Lang.gen[32] = "Dissimulation de trésor de jungle :"; + Lang.gen[33] = "Dissimulation de trésor dans l'eau :"; + Lang.gen[34] = "Placement de pièges :"; + Lang.gen[35] = "Placement d'objets cassables :"; + Lang.gen[36] = "Placement de forges infernales :"; + Lang.gen[37] = "Placement de l'herbe :"; + Lang.gen[38] = "Faire pousser des cactus..."; + Lang.gen[39] = "Plantation de tournesols..."; + Lang.gen[40] = "Plantation d'arbres..."; + Lang.gen[41] = "Plantation d'herbe..."; + Lang.gen[42] = "Plantation de mauvaises herbes..."; + Lang.gen[43] = "Faire pousser des vignes..."; + Lang.gen[44] = "Plantation de fleurs..."; + Lang.gen[45] = "Plantation de champignons..."; + Lang.gen[46] = "Libération des ressources inutilisées :"; + Lang.gen[47] = "Réinitialisation des objets du jeu :"; + Lang.gen[48] = "Réglage du mode difficile..."; + Lang.gen[49] = "Sauvegarde des données du monde :"; + Lang.gen[50] = "Sauvegarde du fichier du monde..."; + Lang.gen[51] = "Chargement des données du monde :"; + Lang.gen[52] = "Vérification de l'alignement de blocs :"; + Lang.gen[53] = "Le chargement a échoué."; + Lang.gen[54] = "Aucune sauvegarde trouvée."; + Lang.gen[55] = "Trouver les images de blocs :"; + Lang.gen[56] = "Ajout de la neige ..."; + Lang.gen[57] = "Mondiale"; + Lang.gen[58] = "Créer donjon:"; + Lang.gen[59] = "Une météorite a atterri!"; + Lang.gen[60] = "Lissage du monde:"; + Lang.gen[61] = "Mossification:"; + Lang.gen[62] = "Gemification:"; + Lang.gen[63] = "Faire parois de la grotte:"; + Lang.gen[64] = "Growing grottes d'araignée:"; + Lang.gen[65] = "Clearing données cartographiques:"; + Lang.gen[66] = "Sauvegarde des données de la carte:"; + Lang.gen[67] = "Chargement des données cartographiques:"; + Lang.gen[68] = "dessin carte:"; + Lang.gen[69] = "créer des cascades:"; + Lang.gen[70] = "Création ruines dans la jungle..."; + Lang.gen[71] = "Création de nids de frelons..."; + Lang.gen[72] = "Faire la sanglante monde:"; + Lang.inter[0] = "Vie :"; + Lang.inter[1] = "Souffle "; + Lang.inter[2] = "Mana :"; + Lang.inter[3] = "Poubelle"; + Lang.inter[4] = "Inventaire"; + Lang.inter[5] = "Barre d'inventaire déverrouillée"; + Lang.inter[6] = "Barre d'inventaire verrouillée"; + Lang.inter[7] = "Logement"; + Lang.inter[8] = "Demande de logement"; + Lang.inter[9] = "Accessoires"; + Lang.inter[10] = "Défense"; + Lang.inter[11] = "Social"; + Lang.inter[12] = "Casque"; + Lang.inter[13] = "Chemise"; + Lang.inter[14] = "Pantalon"; + Lang.inter[15] = "Platine"; + Lang.inter[16] = "Or"; + Lang.inter[17] = "Argent"; + Lang.inter[18] = "Cuivre"; + Lang.inter[19] = "Reforger"; + Lang.inter[20] = "Placer un objet ici pour le reforger"; + Lang.inter[21] = "Affichage des techniques utilisant"; + Lang.inter[22] = "Objets requis :"; + Lang.inter[23] = "Aucun"; + Lang.inter[24] = "Placer un matériau ici pour afficher les techniques"; + Lang.inter[25] = "Artisanat"; + Lang.inter[26] = "Pièces"; + Lang.inter[27] = "Munitions"; + Lang.inter[28] = "Magasin"; + Lang.inter[29] = "Tout récupérer"; + Lang.inter[30] = "Tout déposer"; + Lang.inter[31] = "Pile rapide"; + Lang.inter[32] = "Tirelire"; + Lang.inter[33] = "Coffre-fort"; + Lang.inter[34] = "Temps :"; + Lang.inter[35] = "Sauvegarder et quitter"; + Lang.inter[36] = "Déconnexion"; + Lang.inter[37] = "Objets"; + Lang.inter[38] = "Vous vous êtes fait exterminer..."; + Lang.inter[39] = "Ce logement convient."; + Lang.inter[40] = "Ce logement ne convient pas."; + Lang.inter[41] = "Ce logement est déjà occupé."; + Lang.inter[42] = "Ce logement est corrompu."; + Lang.inter[43] = "La connexion a été interrompue"; + Lang.inter[44] = "Réception de données de blocs"; + Lang.inter[45] = "équiper"; + Lang.inter[46] = "Coût"; + Lang.inter[47] = "Enregistrer"; + Lang.inter[48] = "Modifier"; + Lang.inter[49] = "État"; + Lang.inter[50] = "Malédiction"; + Lang.inter[51] = "Aide"; + Lang.inter[52] = "Proches"; + Lang.inter[53] = "De l'eau"; + Lang.inter[54] = "Guérir"; + Lang.inter[55] = "Ce logement ne répond pas aux exigences d'un"; + Lang.inter[56] = "Lave"; + Lang.inter[57] = "teindre"; + Lang.inter[58] = "chérie"; + Lang.tip[0] = "Équipé dans l'emplacement social"; + Lang.tip[1] = "Ne procure pas de stats"; + Lang.tip[2] = " de dégâts de mêlée"; + Lang.tip[3] = " de dégâts à distance"; + Lang.tip[4] = " de dégâts de magie"; + Lang.tip[5] = "% de chance de coup critique"; + Lang.tip[6] = "Vitesse insensée"; + Lang.tip[7] = "Vitesse très rapide"; + Lang.tip[8] = "Vitesse rapide"; + Lang.tip[9] = "Vitesse moyenne"; + Lang.tip[10] = "Vitesse lente"; + Lang.tip[11] = "Vitesse très lente"; + Lang.tip[12] = "Vitesse extrêmement lente"; + Lang.tip[13] = "Vitesse d'escargot"; + Lang.tip[14] = "Pas de recul"; + Lang.tip[15] = "Recul extrêmement faible"; + Lang.tip[16] = "Recul très faible"; + Lang.tip[17] = "Recul faible"; + Lang.tip[18] = "Recul moyen"; + Lang.tip[19] = "Fort recul"; + Lang.tip[20] = "Très fort recul"; + Lang.tip[21] = "Recul extrêmement fort"; + Lang.tip[22] = "Recul ahurissant"; + Lang.tip[23] = "Équipable"; + Lang.tip[24] = "Objets sociaux"; + Lang.tip[25] = " de défense"; + Lang.tip[26] = "% de puissance de pioche"; + Lang.tip[27] = "% de puissance de hache"; + Lang.tip[28] = "% de puissance de marteau"; + Lang.tip[29] = "Redonne"; + Lang.tip[30] = "de vie"; + Lang.tip[31] = "de mana"; + Lang.tip[32] = "Consomme"; + Lang.tip[33] = "Peut être placé"; + Lang.tip[34] = "Munitions"; + Lang.tip[35] = "Consommable"; + Lang.tip[36] = "Matériau"; + Lang.tip[37] = " Durée minute"; + Lang.tip[38] = " Durée seconde"; + Lang.tip[39] = "% de dégâts"; + Lang.tip[40] = "% de vélocité"; + Lang.tip[41] = "% de chance de coup critique"; + Lang.tip[42] = "% de coût de mana"; + Lang.tip[43] = "% de la taille"; + Lang.tip[44] = "% de vitesse de projectile"; + Lang.tip[45] = "% de recul"; + Lang.tip[46] = "% de vitesse de déplacement"; + Lang.tip[47] = "% de vitesse de mêlée"; + Lang.tip[48] = "Bonus de collection :"; + Lang.tip[49] = "Prix de vente :"; + Lang.tip[50] = "Prix d'achat :"; + Lang.tip[51] = "Aucune valeur"; + Lang.tip[52] = "consomme "; + Lang.tip[53] = " convoquer des dommages"; + Lang.tip[54] = " gamme"; + Lang.tip[55] = " dommage"; + Lang.mp[0] = "Recevoir :"; + Lang.mp[1] = "Mot de passe incorrect."; + Lang.mp[2] = "Opération non valable en l'état."; + Lang.mp[3] = "Vous vous êtes fait bannir de ce serveur."; + Lang.mp[4] = "Vous n'utilisez pas la même version que ce serveur."; + Lang.mp[5] = "est déjà sur ce serveur."; + Lang.mp[6] = "/en train de jouer"; + Lang.mp[7] = "Joueurs actuels :"; + Lang.mp[8] = "/jet"; + Lang.mp[9] = "lance un"; + Lang.mp[10] = "Vous n'êtes pas dans une équipe."; + Lang.mp[11] = "a activé le PvP."; + Lang.mp[12] = "a désactivé le PvP."; + Lang.mp[13] = "n'est plus dans une équipe."; + Lang.mp[14] = "a rejoint l'équipe rouge."; + Lang.mp[15] = "a rejoint l'équipe verte."; + Lang.mp[16] = "a rejoint l'équipe bleue."; + Lang.mp[17] = "a rejoint l'équipe jaune."; + Lang.mp[18] = "Bienvenue dans"; + Lang.mp[19] = "a rejoint."; + Lang.mp[20] = "a quitté."; + Lang.the = "le "; + Lang.dt[0] = "n'a pas trouvé l'antidote"; + Lang.dt[1] = "n'a pas réussi à éteindre l'incendie"; + Main.buffName[1] = "Peau d'obsidienne"; + Main.buffTip[1] = "Immunise contre la lave"; + Main.buffName[2] = "Régénération"; + Main.buffTip[2] = "Régénère la vie"; + Main.buffName[3] = "Rapidité"; + Main.buffTip[3] = "Augmente la vitesse de déplacement de 25 %"; + Main.buffName[4] = "Branchies"; + Main.buffTip[4] = "Permet de respirer sous l'eau comme dans l'air"; + Main.buffName[5] = "Peau de fer"; + Main.buffTip[5] = "Augmente la défense de 8"; + Main.buffName[6] = "Régénération de mana"; + Main.buffTip[6] = "Augmente la régénération de mana"; + Main.buffName[7] = "Pouvoir magique"; + Main.buffTip[7] = "Augmente les dégâts de magie de 20 %"; + Main.buffName[8] = "Poids plume"; + Main.buffTip[8] = "Appuyer sur Bas ou Haut pour contrôler la vitesse de descente"; + Main.buffName[9] = "Spéléologue"; + Main.buffTip[9] = "Indique l'emplacement des trésors et du minerai"; + Main.buffName[10] = "Invisibilité"; + Main.buffTip[10] = "Procure l'invisibilité"; + Main.buffName[11] = "Brillance"; + Main.buffTip[11] = "Emet une aura de lumière"; + Main.buffName[12] = "Vision nocturne"; + Main.buffTip[12] = "Améliore la vision de nuit"; + Main.buffName[13] = "Bataille"; + Main.buffTip[13] = "Augmente la vitesse d'apparition des ennemis"; + Main.buffName[14] = "Épines"; + Main.buffTip[14] = "Les attaquants subissent aussi des dégâts"; + Main.buffName[15] = "Marche sur l'eau"; + Main.buffTip[15] = "Appuyer sur Bas pour entrer dans l'eau"; + Main.buffName[16] = "Tir à l'arc"; + Main.buffTip[16] = "La vitesse et les dégâts des flèches augmentent de 20 %"; + Main.buffName[17] = "Chasseur"; + Main.buffTip[17] = "Indique l'emplacement des ennemis"; + Main.buffName[18] = "Gravitation"; + Main.buffTip[18] = "Appuyer sur Haut ou Bas pour inverser la gravité"; + Main.buffName[19] = "Orbe de lumière"; + Main.buffTip[19] = "Un orbe magique qui émet de la lumière"; + Main.buffName[20] = "Empoisonnement"; + Main.buffTip[20] = "Perte lente de vie"; + Main.buffName[21] = "Nausée des potions"; + Main.buffTip[21] = "Ne peut plus consommer de potions de soin"; + Main.buffName[22] = "Obscurité"; + Main.buffTip[22] = "Diminue la vision de nuit"; + Main.buffName[23] = "Malédiction"; + Main.buffTip[23] = "Ne peut utiliser aucun objet"; + Main.buffName[24] = "En feu !"; + Main.buffTip[24] = "Perte lente de vie"; + Main.buffName[25] = "Ivresse"; + Main.buffTip[25] = "Augmente les aptitudes de mêlée, diminue la défense"; + Main.buffName[26] = "Bien nourri"; + Main.buffTip[26] = "Amélioration mineure de toutes les stats."; + Main.buffName[27] = "Fée"; + Main.buffTip[27] = "Une fée vous suit"; + Main.buffName[28] = "Loup-garou"; + Main.buffTip[28] = "Les aptitudes physiques sont augmentées"; + Main.buffName[29] = "Clairvoyance"; + Main.buffTip[29] = "Les pouvoirs magiques sont augmentés"; + Main.buffName[30] = "Saignement"; + Main.buffTip[30] = "Ne peut régénérer la vie"; + Main.buffName[31] = "Confusion"; + Main.buffTip[31] = "Les mouvements sont inversés"; + Main.buffName[32] = "Ralentissement"; + Main.buffTip[32] = "La vitesse de déplacement est réduite"; + Main.buffName[33] = "Faiblesse"; + Main.buffTip[33] = "Les aptitudes physiques sont diminuées"; + Main.buffName[34] = "Peuple des mers"; + Main.buffTip[34] = "Peut respirer et se déplacer sous l'eau facilement"; + Main.buffName[35] = "Silencieux"; + Main.buffTip[35] = "Ne peut pas utiliser des éléments qui nécessitent de mana"; + Main.buffName[36] = "Armure brisée"; + Main.buffTip[36] = "La défense est réduite de moitié"; + Main.buffName[37] = "Peur panique"; + Main.buffTip[37] = "Vous avez vu quelque chose de terrible et vous ne pouvez vous échapper."; + Main.buffName[38] = "La langue"; + Main.buffTip[38] = "Vous vous êtes fait aspirer dans la bouche"; + Main.buffName[39] = "Brasier maudit"; + Main.buffTip[39] = "Perte de vie"; + Main.buffName[40] = "Animal lapin"; + Main.buffTip[40] = "Je pense qu'il veut votre carotte"; + Main.buffName[41] = "bébé pingouin"; + Main.buffTip[41] = "Je pense qu'il veut votre poisson"; + Main.buffName[42] = "Animaux tortue"; + Main.buffTip[42] = "Temps de tortue heureuse!"; + Main.buffName[43] = "Bouclier de Paladin"; + Main.buffTip[43] = "25% des dégâts subis sera redirigé vers un autre joueur"; + Main.buffName[44] = "gel brûlure"; + Main.buffTip[44] = "C'est soit très chaud ou très froid. De toute façon ça fait vraiment mal"; + Main.buffName[45] = "Bébé Eater"; + Main.buffTip[45] = "Un bébé Eater of Souls vous suit"; + Main.buffName[46] = "réfrigéré"; + Main.buffTip[46] = "Votre vitesse de déplacement a été réduite"; + Main.buffName[47] = "congelé"; + Main.buffTip[47] = "Vous ne pouvez pas déplacer!"; + Main.buffName[48] = "chérie"; + Main.buffTip[48] = "Régénération de vie est augmentée"; + Main.buffName[49] = "Pygmées"; + Main.buffTip[49] = "Les pygmées se battront pour vous"; + Main.buffName[50] = "Bébé Skeletron Head"; + Main.buffTip[50] = "Ne demandent même pas ..."; + Main.buffName[51] = "Bébé Hornet"; + Main.buffTip[51] = "Il pense que vous êtes sa mère"; + Main.buffName[52] = "tiki esprit"; + Main.buffTip[52] = "Un esprit convivial vous suit"; + Main.buffName[53] = "lézard de compagnie"; + Main.buffTip[53] = "Chillin 'comme un reptile"; + Main.buffName[54] = "perroquet"; + Main.buffTip[54] = "Polly veulent du pirate"; + Main.buffName[55] = "Bébé Truffe"; + Main.buffTip[55] = "N'est-ce pas juste si mignon?"; + Main.buffName[56] = "Pet Arbrisseau"; + Main.buffTip[56] = "Un petit arbre vous suit"; + Main.buffName[57] = "Wisp"; + Main.buffTip[57] = "Un brin vous suit"; + Main.buffName[58] = "guérison rapide"; + Main.buffTip[58] = "Régénération de vie est considérablement augmentée"; + Main.buffName[59] = "Dodge Shadow"; + Main.buffTip[59] = "Vous pourrez esquiver la prochaine attaque"; + Main.buffName[60] = "cristal Feuille"; + Main.buffTip[60] = "Cristal Lance laisse les ennemis proches"; + Main.buffName[61] = "bébé dinosaure"; + Main.buffTip[61] = "Un dinosaure de bébé vous suit"; + Main.buffName[62] = "Barrière de glace"; + Main.buffTip[62] = "La défense est augmentée de 30"; + Main.buffName[63] = "Panic!"; + Main.buffTip[63] = "La vitesse de déplacement est augmentée"; + Main.buffName[64] = "Bébé Slime"; + Main.buffTip[64] = "Le bébé bave combattra pour vous"; + Main.buffName[65] = "Printemps de globe oculaire"; + Main.buffTip[65] = "Un ressort d'œil vous suit"; + Main.buffName[66] = "Bébé de bonhomme de neige"; + Main.buffTip[66] = "Un bonhomme de neige de bébé vous suit"; + Main.buffName[67] = "brûler"; + Main.buffTip[67] = "Perdre la vie et ralenti le mouvement"; + Main.buffName[68] = "étouffement"; + Main.buffTip[68] = "perdre la vie"; + Main.buffName[69] = "Ichor"; + Main.buffTip[69] = "défense réduite"; + Main.buffName[70] = "Venom"; + Main.buffTip[70] = "perdre la vie"; + Main.buffName[72] = "Midas"; + Main.buffTip[72] = "Déposer plus d'argent sur la mort"; + Main.buffName[80] = "Blackout"; + Main.buffTip[80] = "Vision lumière fortement réduite"; + Main.buffName[71] = "Weapon Imbue: Venom"; + Main.buffTip[71] = "Les attaques de mêlée infligent venin sur vos cibles"; + Main.buffName[73] = "Arme Imbue: Venom"; + Main.buffTip[73] = "Les attaques de mêlée infligent des ennemis avec des flammes maudits"; + Main.buffName[74] = "Arme Imbue: Fire"; + Main.buffTip[74] = "Les attaques de mêlée des ennemis mis le feu"; + Main.buffName[75] = "Arme Imbue: Gold"; + Main.buffTip[75] = "Les attaques de mêlée rendent ennemis laissent tomber plus d'or"; + Main.buffName[76] = "Arme Imbue: Ichor"; + Main.buffTip[76] = "Les attaques de mêlée réduire la défense des ennemis"; + Main.buffName[77] = "Arme Imbue: Nanites"; + Main.buffTip[77] = "Les attaques de mêlée confondent ennemis"; + Main.buffName[78] = "Arme Imbue: Confetti"; + Main.buffTip[78] = "Les attaques de mêlée causent des confettis à comparaître"; + Main.buffName[79] = "Arme Imbue: Poison"; + Main.buffTip[79] = "Attaques de mêlée des ennemis de poison"; + Main.tileName[13] = "Bouteille"; + Main.tileName[14] = "Table"; + Main.tileName[15] = "Président"; + Main.tileName[16] = "Enclume"; + Main.tileName[17] = "Four"; + Main.tileName[18] = "Établi"; + Main.tileName[26] = "Autel démon"; + Main.tileName[77] = "Forge infernale"; + Main.tileName[86] = "Métier à tisser"; + Main.tileName[94] = "Tonnelet"; + Main.tileName[96] = "Marmite"; + Main.tileName[101] = "Bibliothèque"; + Main.tileName[106] = "Scierie"; + Main.tileName[114] = "Atelier du bricoleur"; + Main.tileName[133] = "Forge en adamantine"; + Main.tileName[134] = "Enclume en mythril"; + } + else + { + if (Lang.lang == 5) + { + Lang.misc[0] = "¡El ejército de duendes ha sido derrotado!"; + Lang.misc[1] = "¡Un ejército de duendes se aproxima por el oeste!"; + Lang.misc[2] = "¡Un ejército de duendes se aproxima por el este!"; + Lang.misc[3] = "Un ejército goblin ha llegado!"; + Lang.misc[4] = "La Legión Frost ha sido derrotado!"; + Lang.misc[5] = "La Legión de Frost se aproxima desde el oeste!"; + Lang.misc[6] = "La Legión de Frost se acercaba desde el este!"; + Lang.misc[7] = "La Legión Frost ha llegado!"; + Lang.misc[8] = "La luna sangrienta está saliendo..."; + Lang.misc[9] = "Sientes que una presencia maligna te observa..."; + Lang.misc[10] = "Sientes un horrible escalofrío por la espalda..."; + Lang.misc[11] = "El eco de los alaridos suena por todas partes..."; + Lang.misc[12] = "¡Tu mundo ha sido bendecido con Cobalto!"; + Lang.misc[13] = "¡Tu mundo ha sido bendecido con Mithril!"; + Lang.misc[14] = "¡Tu mundo ha sido bendecido con Adamantita!"; + Lang.misc[15] = "Los ancestrales espíritus de la luz y la oscuridad han sido liberados."; + Lang.misc[16] = "ha despertado!"; + Lang.misc[17] = "ha sido derrotado!"; + Lang.misc[18] = "de duendes!"; + Lang.misc[19] = " fue asesinado..."; + Lang.misc[20] = "Un eclipse solar ocurre!"; + Lang.misc[21] = "Su mundo ha sido bendecido con el Palladium!"; + Lang.misc[22] = "Su mundo ha sido bendecido con Orichalcum!"; + Lang.misc[23] = "Su mundo ha sido bendecido con Titanium!"; + Lang.misc[24] = "Los piratas han sido derrotados!"; + Lang.misc[25] = "Piratas se están acercando desde el oeste!"; + Lang.misc[26] = "Piratas se acercan desde el este!"; + Lang.misc[27] = "Los piratas han llegado!"; + Lang.misc[28] = "Sientes las vibraciones de las profundidades de ..."; + Lang.misc[29] = "Esto va a ser una noche terrible ..."; + Lang.misc[30] = "El aire es más frío a su alrededor ..."; + Lang.menu[0] = "¡Comienza y únete a un nuevo periodo de Terraria!"; + Lang.menu[1] = "Ejecutándose en el puerto "; + Lang.menu[2] = "Desconectar"; + Lang.menu[3] = "Contraseña del servidor obligatoria:"; + Lang.menu[4] = "Aceptar"; + Lang.menu[5] = "Atrás"; + Lang.menu[6] = "Cancelar"; + Lang.menu[7] = "Escribir contraseña del servidor:"; + Lang.menu[8] = "Iniciando servidor..."; + Lang.menu[9] = "¡Error al cargar!"; + Lang.menu[10] = "Cargar copia de seguridad"; + Lang.menu[11] = "No hay copia de seguridad"; + Lang.menu[12] = "Un jugador"; + Lang.menu[13] = "Multijugador"; + Lang.menu[14] = "Ajustes"; + Lang.menu[15] = "Salir"; + Lang.menu[16] = "Crear personaje"; + Lang.menu[17] = "Eliminar"; + Lang.menu[18] = "Pelo"; + Lang.menu[19] = "Ojos"; + Lang.menu[20] = "Piel"; + Lang.menu[21] = "Ropa"; + Lang.menu[22] = "Hombre"; + Lang.menu[23] = "Mujer"; + Lang.menu[24] = "Fanático"; + Lang.menu[25] = "Normal"; + Lang.menu[26] = "Novato"; + Lang.menu[27] = "Aleatorio"; + Lang.menu[28] = "Crear"; + Lang.menu[29] = "Los personajes fanáticos mueren para siempre."; + Lang.menu[30] = "Los personajes normales sueltan objetos al morir"; + Lang.menu[31] = "Los personajes novatos sueltan dinero al morir"; + Lang.menu[32] = "Seleccionar dificultad"; + Lang.menu[33] = "Camisa"; + Lang.menu[34] = "Camiseta"; + Lang.menu[35] = "Pantalones"; + Lang.menu[36] = "Zapatos"; + Lang.menu[37] = "Pelo"; + Lang.menu[38] = "Color de pelo"; + Lang.menu[39] = "Color de ojos"; + Lang.menu[40] = "Color de piel"; + Lang.menu[41] = "Color de la camisa"; + Lang.menu[42] = "Color de la camiseta"; + Lang.menu[43] = "Color de los pantalones"; + Lang.menu[44] = "Color de los zapatos"; + Lang.menu[45] = "Escribir nombre del personaje:"; + Lang.menu[46] = "Eliminar"; + Lang.menu[47] = "Crear mundo"; + Lang.menu[48] = "Escribir nombre del mundo:"; + Lang.menu[49] = "Ir a Pantalla con ventanas"; + Lang.menu[50] = "Ir a Pantalla completa"; + Lang.menu[51] = "Resolución"; + Lang.menu[52] = "Paralaje"; + Lang.menu[53] = "Saltar fotograma desactivado (no recomendado)"; + Lang.menu[54] = "Saltar fotograma activado (recomendado)"; + Lang.menu[55] = "Iluminación: Color"; + Lang.menu[56] = "Iluminación: Blanco"; + Lang.menu[57] = "Iluminación: Retro"; + Lang.menu[58] = "Iluminación: Psicodélica"; + Lang.menu[59] = "Calidad: Automático"; + Lang.menu[60] = "Calidad: Alta"; + Lang.menu[61] = "Calidad: Normal"; + Lang.menu[62] = "Calidad: Baja"; + Lang.menu[63] = "Vídeo"; + Lang.menu[64] = "Color del cursor"; + Lang.menu[65] = "Volumen"; + Lang.menu[66] = "Controles"; + Lang.menu[67] = "Autoguardado activado"; + Lang.menu[68] = "Autoguardado desactivado"; + Lang.menu[69] = "Pausa automática activada"; + Lang.menu[70] = "Pausa automática desactivada"; + Lang.menu[71] = "Sugerencias activadas"; + Lang.menu[72] = "Sugerencias desactivadas"; + Lang.menu[73] = "Resolución de pantalla completa"; + Lang.menu[74] = "Arriba "; + Lang.menu[75] = "Abajo "; + Lang.menu[76] = "Izquierda "; + Lang.menu[77] = "Derecha "; + Lang.menu[78] = "Saltar "; + Lang.menu[79] = "Lanzar "; + Lang.menu[80] = "Inventario "; + Lang.menu[81] = "Curación rápida "; + Lang.menu[82] = "Maná rápido "; + Lang.menu[83] = "Extra rápido "; + Lang.menu[84] = "Apresar "; + Lang.menu[85] = "Selección automática "; + Lang.menu[86] = "Volver a predeterminados"; + Lang.menu[87] = "Unirse"; + Lang.menu[88] = "Crear y Jugar"; + Lang.menu[89] = "Escribir dirección IP del servidor:"; + Lang.menu[90] = "Escribir puerto del servidor:"; + Lang.menu[91] = "Elegir tamaño del mundo:"; + Lang.menu[92] = "Pequeño"; + Lang.menu[93] = "Mediano"; + Lang.menu[94] = "Grande"; + Lang.menu[95] = "Rojo:"; + Lang.menu[96] = "Verde:"; + Lang.menu[97] = "Azul:"; + Lang.menu[98] = "Sonido:"; + Lang.menu[99] = "Música:"; + Lang.menu[100] = "Fondo activado"; + Lang.menu[101] = "Fondo desactivado"; + Lang.menu[102] = "Seleccione el idioma"; + Lang.menu[103] = "Idioma"; + Lang.menu[104] = "Sí"; + Lang.menu[105] = "No"; + Lang.menu[106] = "Cambiar estilo del mapa"; + Lang.menu[107] = "Alternar pantalla completa"; + Lang.menu[108] = "Acercar"; + Lang.menu[109] = "Alejar"; + Lang.menu[110] = "Disminuir Transparencia"; + Lang.menu[111] = "Aumentar la Transparencia"; + Lang.menu[112] = "Mapa Activado"; + Lang.menu[113] = "Mapa Desactivado"; + Lang.gen[0] = "Generando terreno del mundo:"; + Lang.gen[1] = "Añadiendo arena..."; + Lang.gen[2] = "Generando colinas..."; + Lang.gen[3] = "Amontonando tierra:"; + Lang.gen[4] = "Añadiendo rocas a la tierra..."; + Lang.gen[5] = "Añadiendo tierra a las rocas..."; + Lang.gen[6] = "Añadiendo arcilla..."; + Lang.gen[7] = "Generando agujeros aleatorios:"; + Lang.gen[8] = "Generando cuevas pequeñas:"; + Lang.gen[9] = "Generando cuevas grandes:"; + Lang.gen[10] = "Generando superficie de cuevas..."; + Lang.gen[11] = "Generando selva:"; + Lang.gen[12] = "Generando islas flotantes..."; + Lang.gen[13] = "Añadiendo parcelas de champiñones..."; + Lang.gen[14] = "Añadiendo lodo a la tierra..."; + Lang.gen[15] = "Añadiendo cieno..."; + Lang.gen[16] = "Añadiendo brillos..."; + Lang.gen[17] = "Añadiendo telas de araña..."; + Lang.gen[18] = "Creando Inframundo:"; + Lang.gen[19] = "Añadiendo cursos de agua:"; + Lang.gen[20] = "Corrompiendo el mundo:"; + Lang.gen[21] = "Generando cuevas en montañas..."; + Lang.gen[22] = "Creando playas..."; + Lang.gen[23] = "Añadiendo gemas..."; + Lang.gen[24] = "Gravitando arena:"; + Lang.gen[25] = "Limpiando de tierra los entornos:"; + Lang.gen[26] = "Colocando altares:"; + Lang.gen[27] = "Distribuyendo líquidos:"; + Lang.gen[28] = "Colocando cristales de vida:"; + Lang.gen[29] = "Colocando estatuas:"; + Lang.gen[30] = "Ocultando tesoro:"; + Lang.gen[31] = "Ocultando otro tesoro:"; + Lang.gen[32] = "Ocultando tesoro en la selva:"; + Lang.gen[33] = "Ocultando tesoro en el agua:"; + Lang.gen[34] = "Colocando trampas:"; + Lang.gen[35] = "Colocando objetos quebradizos:"; + Lang.gen[36] = "Colocando forjas infernales:"; + Lang.gen[37] = "Plantando césped..."; + Lang.gen[38] = "Plantando cactus..."; + Lang.gen[39] = "Plantando girasoles..."; + Lang.gen[40] = "Plantando árboles..."; + Lang.gen[41] = "Plantando hierbas..."; + Lang.gen[42] = "Plantando hierbajos..."; + Lang.gen[43] = "Plantando enredaderas..."; + Lang.gen[44] = "Plantando flores..."; + Lang.gen[45] = "Cultivando champiñones..."; + Lang.gen[46] = "Liberando recursos sin usar:"; + Lang.gen[47] = "Reiniciando objetos del juego:"; + Lang.gen[48] = "Estableciendo modo difícil..."; + Lang.gen[49] = "Guardando datos del mundo:"; + Lang.gen[50] = "Copia de seguridad del archivo del mundo..."; + Lang.gen[51] = "Cargando datos del mundo:"; + Lang.gen[52] = "Comprobando alineación en cascada:"; + Lang.gen[53] = "¡Error al cargar!"; + Lang.gen[54] = "No hay copia de seguridad."; + Lang.gen[55] = "Encontrando estructura en cascada:"; + Lang.gen[56] = "Adición de nieve ..."; + Lang.gen[57] = "Mundo"; + Lang.gen[58] = "La creación de mazmorra:"; + Lang.gen[59] = "Un meteorito ha caído!"; + Lang.gen[60] = "Suavizar el mundo:"; + Lang.gen[61] = "Mossification:"; + Lang.gen[62] = "Gemification:"; + Lang.gen[63] = "Haciendo paredes de la cueva:"; + Lang.gen[64] = "Crecimiento cuevas araña:"; + Lang.gen[65] = "Eliminación de los datos del mapa:"; + Lang.gen[66] = "Guardar los datos del mapa:"; + Lang.gen[67] = "Carga de datos de los mapas:"; + Lang.gen[68] = "Dibujo mapa:"; + Lang.gen[69] = "La creación de cascadas:"; + Lang.gen[70] = "Crear ruinas de la selva ..."; + Lang.gen[71] = "La creación de nidos de avispa ..."; + Lang.gen[72] = "Haciendo un mundo más sangrienta:"; + Lang.inter[0] = "Vida:"; + Lang.inter[1] = "Aire"; + Lang.inter[2] = "Maná"; + Lang.inter[3] = "Cubo de basura"; + Lang.inter[4] = "Inventario"; + Lang.inter[5] = "Barra de acceso rápido desbloqueada"; + Lang.inter[6] = "Barra de acceso rápido bloqueada"; + Lang.inter[7] = "Vivienda"; + Lang.inter[8] = "Búsqueda de vivienda"; + Lang.inter[9] = "Accesorios"; + Lang.inter[10] = "Defensa"; + Lang.inter[11] = "Social"; + Lang.inter[12] = "Casco"; + Lang.inter[13] = "Camisa"; + Lang.inter[14] = "Pantalones"; + Lang.inter[15] = "platino"; + Lang.inter[16] = "oro"; + Lang.inter[17] = "plata"; + Lang.inter[18] = "cobre"; + Lang.inter[19] = "Remodelar"; + Lang.inter[20] = "Colocar un objeto aquí para remodelarlo"; + Lang.inter[21] = "Mostrando recetas en uso"; + Lang.inter[22] = "Objetos necesarios:"; + Lang.inter[23] = "Ninguno"; + Lang.inter[24] = "Colocar un material aquí para ver las recetas"; + Lang.inter[25] = "Producción"; + Lang.inter[26] = "Monedas"; + Lang.inter[27] = "Munición"; + Lang.inter[28] = "Tienda"; + Lang.inter[29] = "Saquear todo"; + Lang.inter[30] = "Ahorrar todo"; + Lang.inter[31] = "Apilar rápido"; + Lang.inter[32] = "Hucha"; + Lang.inter[33] = "Caja fuerte"; + Lang.inter[34] = "Hora:"; + Lang.inter[35] = "Guarda y Salir"; + Lang.inter[36] = "Desconectar"; + Lang.inter[37] = "Objetos"; + Lang.inter[38] = "Te han asesinado..."; + Lang.inter[39] = "Esta vivienda es habitable."; + Lang.inter[40] = "Esta vivienda no es habitable."; + Lang.inter[41] = "Esta vivienda ya está ocupada."; + Lang.inter[42] = "Esta vivienda está corrompida."; + Lang.inter[43] = "Ha finalizado el tiempo de conexión"; + Lang.inter[44] = "Recibiendo datos en cascada"; + Lang.inter[45] = "Equipar"; + Lang.inter[46] = "Costo"; + Lang.inter[47] = "Ahorrar"; + Lang.inter[48] = "Editar"; + Lang.inter[49] = "Estado"; + Lang.inter[50] = "Maldición"; + Lang.inter[51] = "Ayuda"; + Lang.inter[52] = "Cerca"; + Lang.inter[53] = "De agua"; + Lang.inter[54] = "Sanar"; + Lang.inter[55] = "Esta vivienda no cumple con los requisitos para un"; + Lang.inter[56] = "Lava"; + Lang.inter[57] = "teñir"; + Lang.inter[58] = "miel"; + Lang.tip[0] = "Equipado en espacio social"; + Lang.tip[1] = "No se registrará ninguna estadística"; + Lang.tip[2] = " daño en el cuerpo a cuerpo"; + Lang.tip[3] = " daño a distancia"; + Lang.tip[4] = " daño por magia"; + Lang.tip[5] = "% probabilidad de ataque crítico"; + Lang.tip[6] = "Velocidad de vértigo"; + Lang.tip[7] = "A gran velocidad"; + Lang.tip[8] = "Deprisa"; + Lang.tip[9] = "Velocidad normal"; + Lang.tip[10] = "Despacio"; + Lang.tip[11] = "Muy despacio"; + Lang.tip[12] = "Exageradamente despacio"; + Lang.tip[13] = "Velocidad de tortuga"; + Lang.tip[14] = "Sin retroceso"; + Lang.tip[15] = "Retroceso sumamente débil"; + Lang.tip[16] = "Retroceso muy débil"; + Lang.tip[17] = "Retroceso débil"; + Lang.tip[18] = "Retroceso normal"; + Lang.tip[19] = "Retroceso fuerte"; + Lang.tip[20] = "Retroceso muy fuerte"; + Lang.tip[21] = "Retroceso tremendamente fuerte"; + Lang.tip[22] = "Retroceso descomunal"; + Lang.tip[23] = "Utilizable"; + Lang.tip[24] = "Objeto de apariencia"; + Lang.tip[25] = " defensa"; + Lang.tip[26] = "% potencia de pico"; + Lang.tip[27] = "% potencia de hacha"; + Lang.tip[28] = "% potencia de martillo"; + Lang.tip[29] = "Recupera"; + Lang.tip[30] = "vida"; + Lang.tip[31] = "maná"; + Lang.tip[32] = "Consume"; + Lang.tip[33] = "Se puede colocar"; + Lang.tip[34] = "Munición"; + Lang.tip[35] = "Consumible"; + Lang.tip[36] = "Material"; + Lang.tip[37] = " minuto/s de duración"; + Lang.tip[38] = " segundo/s de duración"; + Lang.tip[39] = "% daño"; + Lang.tip[40] = "% velocidad"; + Lang.tip[41] = "% probabilidad de ataque crítico"; + Lang.tip[42] = "% coste de maná"; + Lang.tip[43] = "% tamaño"; + Lang.tip[44] = "% velocidad de proyectil"; + Lang.tip[45] = "% retroceso"; + Lang.tip[46] = "% velocidad de movimiento"; + Lang.tip[47] = "% velocidad en el cuerpo a cuerpo"; + Lang.tip[48] = "Set completo:"; + Lang.tip[49] = "Precio de venta:"; + Lang.tip[50] = "Precio de compra:"; + Lang.tip[51] = "Sin valor"; + Lang.tip[52] = "consume "; + Lang.tip[53] = " convocar a los daños"; + Lang.tip[54] = " alcance"; + Lang.tip[55] = " daño"; + Lang.mp[0] = "Recibe:"; + Lang.mp[1] = "Contraseña incorrecta."; + Lang.mp[2] = "Operación no válida en este estado."; + Lang.mp[3] = "Se te ha prohibido la entrada a este servidor."; + Lang.mp[4] = "No tienes la misma versión que este servidor."; + Lang.mp[5] = "ya está en este servidor."; + Lang.mp[6] = "/jugando"; + Lang.mp[7] = "Jugadores ahora:"; + Lang.mp[8] = "/tira"; + Lang.mp[9] = "tira de"; + Lang.mp[10] = "¡No estás en ningún bando!"; + Lang.mp[11] = "ha activado 1c1!"; + Lang.mp[12] = "ha desactivado 1c1!"; + Lang.mp[13] = "ya no pertenece a ningún bando."; + Lang.mp[14] = "se ha unido al bando rojo."; + Lang.mp[15] = "se ha unido al bando verde."; + Lang.mp[16] = "se ha unido al bando azul."; + Lang.mp[17] = "se ha unido al bando amarillo."; + Lang.mp[18] = "¡Bienvenido a"; + Lang.mp[19] = "se ha unido."; + Lang.mp[20] = "ha dejado de."; + Lang.the = "el "; + Lang.dt[0] = "no logró encontrar el antídoto"; + Lang.dt[1] = "no pudo extinguir el fuego"; + Main.buffName[1] = "Piel obsidiana"; + Main.buffTip[1] = "Inmune a la lava"; + Main.buffName[2] = "Regeneración"; + Main.buffTip[2] = "Regenera la vida"; + Main.buffName[3] = "Rapidez"; + Main.buffTip[3] = "Aumenta en un 25% la velocidad de movimiento"; + Main.buffName[4] = "Agallas"; + Main.buffTip[4] = "Permite respirar agua en lugar de aire"; + Main.buffName[5] = "Piel de hierro"; + Main.buffTip[5] = "Aumenta la defensa en 8"; + Main.buffName[6] = "Regeneración de maná"; + Main.buffTip[6] = "Aumenta la regeneración de maná"; + Main.buffName[7] = "Poder mágico"; + Main.buffTip[7] = "Aumenta el daño mágico en un 20%"; + Main.buffName[8] = "Caída de pluma"; + Main.buffTip[8] = "Pulsa ARRIBA o ABAJO para controlar la velocidad de descenso"; + Main.buffName[9] = "Espeleólogo"; + Main.buffTip[9] = "Muestra la ubicación de tesoros y minerales"; + Main.buffName[10] = "Invisibilidad"; + Main.buffTip[10] = "Proporciona invisibilidad"; + Main.buffName[11] = "Brillo"; + Main.buffTip[11] = "Emite luz"; + Main.buffName[12] = "Noctámbulo"; + Main.buffTip[12] = "Aumenta la visión nocturna"; + Main.buffName[13] = "Batalla"; + Main.buffTip[13] = "Aumenta el porcentaje de regeneración del enemigo"; + Main.buffName[14] = "Espinas"; + Main.buffTip[14] = "Los atacantes también sufren daños"; + Main.buffName[15] = "Caminando sobre el agua"; + Main.buffTip[15] = "Pulsa ABAJO para sumergirte"; + Main.buffName[16] = "Tiro con arco"; + Main.buffTip[16] = "Aumenta en un 20% la velocidad y el daño de las flechas"; + Main.buffName[17] = "Cazador"; + Main.buffTip[17] = "Muestra la ubicación de los enemigos"; + Main.buffName[18] = "Gravedad"; + Main.buffTip[18] = "Pulsa ARRIBA o ABAJO para invertir la gravedad"; + Main.buffName[19] = "Orbe de Luz"; + Main.buffTip[19] = "Orbe mágico que proporciona luz"; + Main.buffName[20] = "Veneno"; + Main.buffTip[20] = "Pérdida de vida lentamente"; + Main.buffName[21] = "Poción de náuseas"; + Main.buffTip[21] = "Deja de consumir remedios curativos"; + Main.buffName[22] = "Oscuridad"; + Main.buffTip[22] = "Disminuye la claridad"; + Main.buffName[23] = "Maldición"; + Main.buffTip[23] = "No se puede usar ningún objeto"; + Main.buffName[24] = "Llamas"; + Main.buffTip[24] = "Pérdida de vida lentamente"; + Main.buffName[25] = "Beodo"; + Main.buffTip[25] = "Mejora el cuerpo a cuerpo pero ralentiza la defensa"; + Main.buffName[26] = "Bien alimentado"; + Main.buffTip[26] = "Pequeñas mejoras de todas las estadísticas"; + Main.buffName[27] = "Hada"; + Main.buffTip[27] = "Un hada te acompaña"; + Main.buffName[28] = "Hombre lobo"; + Main.buffTip[28] = "Aumenta la capacidad física"; + Main.buffName[29] = "Clarividencia"; + Main.buffTip[29] = "Aumenta los poderes mágicos"; + Main.buffName[30] = "Ensangrentado"; + Main.buffTip[30] = "No se puede recuperar vida"; + Main.buffName[31] = "Confundido"; + Main.buffTip[31] = "Se invierte el movimiento"; + Main.buffName[32] = "Lento"; + Main.buffTip[32] = "Disminuye la velocidad de movimiento"; + Main.buffName[33] = "Débil"; + Main.buffTip[33] = "Disminuye la capacidad física"; + Main.buffName[34] = "Tritón"; + Main.buffTip[34] = "Respira y se mueve bajo el agua con facilidad"; + Main.buffName[35] = "Silenciado"; + Main.buffTip[35] = "No puede utilizar los artículos que requieren maná"; + Main.buffName[36] = "Armadura rota"; + Main.buffTip[36] = "La defensa disminuye hasta la mitad"; + Main.buffName[37] = "Aterrado"; + Main.buffTip[37] = "Has visto algo horrible, no hay escapatoria"; + Main.buffName[38] = "La Lengua"; + Main.buffTip[38] = "Te succiona"; + Main.buffName[39] = "El Averno"; + Main.buffTip[39] = "Pérdida de la vida"; + Main.buffName[40] = "Mascota conejo"; + Main.buffTip[40] = "Creo que quiere su zanahoria"; + Main.buffName[41] = "pingüino del bebé"; + Main.buffTip[41] = "Creo que quiere que sus peces"; + Main.buffName[42] = "tortuga"; + Main.buffTip[42] = "Tiempo feliz tortuga!"; + Main.buffName[43] = "el escudo de paladin"; + Main.buffTip[43] = "25% de daño recibido será redirigido a otro jugador"; + Main.buffName[44] = "quemadura de Escarcha"; + Main.buffTip[44] = "Es o muy caliente o muy fría. De cualquier manera me duele mucho"; + Main.buffName[45] = "comedor de bebé"; + Main.buffTip[45] = "A Eater bebé de las almas te está siguiendo"; + Main.buffName[46] = "enfriado"; + Main.buffTip[46] = "Su velocidad de movimiento se ha reducido"; + Main.buffName[47] = "Congelado"; + Main.buffTip[47] = "No se puede mover!"; + Main.buffName[48] = "miel"; + Main.buffTip[48] = "La regeneración de la vida se incrementa"; + Main.buffName[49] = "pigmeos"; + Main.buffTip[49] = "Los pigmeos lucharán para usted"; + Main.buffName[50] = "Bebé Skeletron cabeza"; + Main.buffTip[50] = "Ni siquiera preguntar ..."; + Main.buffName[51] = "Bebé Hornet"; + Main.buffTip[51] = "Se cree que eres su madre"; + Main.buffName[52] = "tiki espíritu"; + Main.buffTip[52] = "Un espíritu amistoso que está siguiendo"; + Main.buffName[53] = "lagartija"; + Main.buffTip[53] = "Tiempo libre como un reptil"; + Main.buffName[54] = "loro"; + Main.buffTip[54] = "Polly quiere es el cracker"; + Main.buffName[55] = "Bebé Trufa"; + Main.buffTip[55] = "No es esto apenas soooo cute"; + Main.buffName[56] = "mascota retoño"; + Main.buffTip[56] = "Un arbolito que está siguiendo"; + Main.buffName[57] = "manojito"; + Main.buffTip[57] = "Un mechón te está siguiendo"; + Main.buffName[58] = "La curación rápida"; + Main.buffTip[58] = "La regeneración de la vida es mucho mayor"; + Main.buffName[59] = "Sombra de Dodge"; + Main.buffTip[59] = "Va a esquivar el próximo ataque"; + Main.buffName[60] = "cristal de la hoja"; + Main.buffTip[60] = "Cristal Shoots sale a los enemigos cercanos"; + Main.buffName[61] = "dinosaurio del bebé"; + Main.buffTip[61] = "Un dinosaurio bebé te está siguiendo"; + Main.buffName[62] = "Barrera de hielo"; + Main.buffTip[62] = "Defensa se ​​incrementa en un 30"; + Main.buffName[63] = "pánico"; + Main.buffTip[63] = "La velocidad de movimiento se incrementa"; + Main.buffName[64] = "bebé baba"; + Main.buffTip[64] = "La baba del bebé peleará por vosotros"; + Main.buffName[65] = "Eyeball primavera"; + Main.buffTip[65] = "Un muelle ojo te está siguiendo"; + Main.buffName[66] = "Muñeco de nieve del bebé"; + Main.buffTip[66] = "Un muñeco de nieve del bebé te está siguiendo"; + Main.buffName[67] = "ardor"; + Main.buffTip[67] = "La pérdida de la vida y la lentitud de movimientos"; + Main.buffName[68] = "asfixia"; + Main.buffTip[68] = "La pérdida de la vida"; + Main.buffName[69] = "hondura"; + Main.buffTip[69] = "defensa reducida"; + Main.buffName[70] = "veneno"; + Main.buffTip[70] = "La pérdida de la vida"; + Main.buffName[72] = "Midas"; + Main.buffTip[72] = "Soltar más dinero en la muerte"; + Main.buffName[80] = "apagón"; + Main.buffTip[80] = "La visión de luz muy reducida"; + Main.buffName[71] = "imbuir armas: veneno"; + Main.buffTip[71] = "Ataques cuerpo a cuerpo infligen veneno en sus objetivos"; + Main.buffName[73] = "imbuir armas: Llamas Maldito"; + Main.buffTip[73] = "Ataques cuerpo a cuerpo infligen los enemigos con llamas malditos"; + Main.buffName[74] = "imbuir armas: fuego"; + Main.buffTip[74] = "Ataques cuerpo a cuerpo establecen enemigos en llamas"; + Main.buffName[75] = "imbuir armas: oro"; + Main.buffTip[75] = "Ataques cuerpo a cuerpo hacen enemigos caen más oro"; + Main.buffName[76] = "imbuir armas: hondura"; + Main.buffTip[76] = "Ataques cuerpo a cuerpo disminuyen defensa enemigos"; + Main.buffName[77] = "imbuir armas: Nanites"; + Main.buffTip[77] = "Ataques cuerpo a cuerpo confunde enemigos"; + Main.buffName[78] = "imbuir armas: confeti"; + Main.buffTip[78] = "Ataques cuerpo a cuerpo infligen confetti que aparezca"; + Main.buffName[79] = "imbuir armas: tóxico"; + Main.buffTip[79] = "Cuerpo a cuerpo ataca a los enemigos de veneno"; + Main.tileName[13] = "Botella"; + Main.tileName[14] = "Mesa"; + Main.tileName[15] = "Silla"; + Main.tileName[16] = "Yunque"; + Main.tileName[17] = "Horno"; + Main.tileName[18] = "Banco de trabajo"; + Main.tileName[26] = "Demonio altar"; + Main.tileName[77] = "Forjas infernal"; + Main.tileName[86] = "Telar"; + Main.tileName[94] = "Barrica"; + Main.tileName[96] = "Perol"; + Main.tileName[101] = "Librería"; + Main.tileName[106] = "Serrería"; + Main.tileName[114] = "Taller del reparador"; + Main.tileName[133] = "Forja de adamantita"; + Main.tileName[134] = "Yunque de mithril"; + } + } + } + } + } + for (int i = 0; i < Main.recipe.Length; i++) + { + if (Main.recipe[i].createItem.name != null && Main.recipe[i].createItem.name != "" && Main.recipe[i].createItem.netID != 0) + { + Main.recipe[i].createItem.name = Lang.itemName(Main.recipe[i].createItem.netID, false); + Main.recipe[i].createItem.CheckTip(); + for (int j = 0; j < Main.recipe[j].requiredItem.Length; j++) + { + Main.recipe[i].requiredItem[j].name = Lang.itemName(Main.recipe[i].requiredItem[j].netID, false); + Main.recipe[i].requiredItem[j].CheckTip(); + } + } + } + } + public static string deathMsg(int plr = -1, int npc = -1, int proj = -1, int other = -1) + { + if (Lang.lang <= 1) + { + string result = ""; + int num = Main.rand.Next(26); + string text = ""; + if (num == 0) + { + text = " was slain"; + } + else + { + if (num == 1) + { + text = " was eviscerated"; + } + else + { + if (num == 2) + { + text = " was murdered"; + } + else + { + if (num == 3) + { + text = "'s face was torn off"; + } + else + { + if (num == 4) + { + text = "'s entrails were ripped out"; + } + else + { + if (num == 5) + { + text = " was destroyed"; + } + else + { + if (num == 6) + { + text = "'s skull was crushed"; + } + else + { + if (num == 7) + { + text = " got massacred"; + } + else + { + if (num == 8) + { + text = " got impaled"; + } + else + { + if (num == 9) + { + text = " was torn in half"; + } + else + { + if (num == 10) + { + text = " was decapitated"; + } + else + { + if (num == 11) + { + text = " let their arms get torn off"; + } + else + { + if (num == 12) + { + text = " watched their innards become outards"; + } + else + { + if (num == 13) + { + text = " was brutally dissected"; + } + else + { + if (num == 14) + { + text = "'s extremities were detached"; + } + else + { + if (num == 15) + { + text = "'s body was mangled"; + } + else + { + if (num == 16) + { + text = "'s vital organs were ruptured"; + } + else + { + if (num == 17) + { + text = " was turned into a pile of flesh"; + } + else + { + if (num == 18) + { + text = " was removed from " + Main.worldName; + } + else + { + if (num == 19) + { + text = " got snapped in half"; + } + else + { + if (num == 20) + { + text = " was cut down the middle"; + } + else + { + if (num == 21) + { + text = " was chopped up"; + } + else + { + if (num == 22) + { + text = "'s plead for death was answered"; + } + else + { + if (num == 23) + { + text = "'s meat was ripped off the bone"; + } + else + { + if (num == 24) + { + text = "'s flailing about was finally stopped"; + } + else + { + if (num == 25) + { + text = " had their head removed"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (plr >= 0 && plr < 255) + { + if (proj >= 0 && Main.projectile[proj].name != "") + { + result = string.Concat(new string[] + { + text, + " by ", + Main.player[plr].name, + "'s ", + Main.projectile[proj].name, + "." + }); + } + else + { + result = string.Concat(new string[] + { + text, + " by ", + Main.player[plr].name, + "'s ", + Main.player[plr].inventory[Main.player[plr].selectedItem].name, + "." + }); + } + } + else + { + if (npc >= 0 && Main.npc[npc].displayName != "") + { + result = text + " by " + Main.npc[npc].displayName + "."; + } + else + { + if (proj >= 0 && Main.projectile[proj].name != "") + { + result = text + " by " + Main.projectile[proj].name + "."; + } + else + { + if (other >= 0) + { + if (other == 0) + { + if (Main.rand.Next(2) == 0) + { + result = " fell to their death."; + } + else + { + result = " didn't bounce."; + } + } + else + { + if (other == 1) + { + int num2 = Main.rand.Next(4); + if (num2 == 0) + { + result = " forgot to breathe."; + } + else + { + if (num2 == 1) + { + result = " is sleeping with the fish."; + } + else + { + if (num2 == 2) + { + result = " drowned."; + } + else + { + if (num2 == 3) + { + result = " is shark food."; + } + } + } + } + } + else + { + if (other == 2) + { + int num3 = Main.rand.Next(4); + if (num3 == 0) + { + result = " got melted."; + } + else + { + if (num3 == 1) + { + result = " was incinerated."; + } + else + { + if (num3 == 2) + { + result = " tried to swim in lava."; + } + else + { + if (num3 == 3) + { + result = " likes to play in magma."; + } + } + } + } + } + else + { + if (other == 3) + { + result = text + "."; + } + } + } + } + } + } + } + } + return result; + } + if (Lang.lang == 2) + { + string result2 = ""; + int num4 = Main.rand.Next(15); + string str; + if (num4 == 0) + { + str = " wurde durch"; + } + else + { + if (num4 == 1) + { + str = " wurde vernichtet"; + } + else + { + if (num4 == 2) + { + str = " wurde ermordet"; + } + else + { + if (num4 == 3) + { + str = " wurde zerstoert"; + } + else + { + if (num4 == 4) + { + str = " wurde massakriert"; + } + else + { + if (num4 == 5) + { + str = " wurde aufgespiesst"; + } + else + { + if (num4 == 6) + { + str = " wurde in zwei Haelften gerissen"; + } + else + { + if (num4 == 7) + { + str = " wurde gekoepft"; + } + else + { + if (num4 == 8) + { + str = " liess sich die Arme wegreissen"; + } + else + { + if (num4 == 9) + { + str = " sah die eigenen Innereien herausquellen"; + } + else + { + if (num4 == 10) + { + str = " wurde brutal seziert"; + } + else + { + if (num4 == 11) + { + str = " wurde in Hackfleisch verwandelt"; + } + else + { + if (num4 == 12) + { + str = " wurde laengs gefaltet"; + } + else + { + if (num4 == 13) + { + str = " wurde um die Haelfte gekuerzt"; + } + else + { + str = " liess sich den Kopf wegreissen"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if ((plr >= 0 && plr < 255) || (npc >= 0 && Main.npc[npc].displayName != "") || (proj >= 0 && Main.projectile[proj].name != "")) + { + result2 = str + "."; + } + else + { + if (other >= 0) + { + if (other == 0) + { + if (Main.rand.Next(2) == 0) + { + result2 = " stuerzte in den Tod."; + } + else + { + result2 = " ist nicht gesprungen."; + } + } + else + { + if (other == 1) + { + int num5 = Main.rand.Next(4); + if (num5 == 0) + { + result2 = " hat vergessen zu atmen."; + } + else + { + if (num5 == 1) + { + result2 = " hat jetzt ein feuchtes Grab bei den Fischen."; + } + else + { + if (num5 == 2) + { + result2 = " ist ertrunken."; + } + else + { + if (num5 == 3) + { + result2 = " ist jetzt Fischfutter."; + } + } + } + } + } + else + { + if (other == 2) + { + int num6 = Main.rand.Next(4); + if (num6 == 0) + { + result2 = " ist geschmolzen."; + } + else + { + if (num6 == 1) + { + result2 = " wurde eingeaeschert."; + } + else + { + if (num6 == 2) + { + result2 = " versuchte, in Lava zu baden."; + } + else + { + if (num6 == 3) + { + result2 = " spielt gern mit Magma."; + } + } + } + } + } + else + { + if (other == 3) + { + result2 = str + "."; + } + } + } + } + } + } + return result2; + } + if (Lang.lang == 3) + { + string result3 = ""; + int num7 = Main.rand.Next(13); + string str2; + if (num7 == 0) + { + str2 = " è stato ucciso"; + } + else + { + if (num7 == 1) + { + str2 = " è stato sventrato"; + } + else + { + if (num7 == 2) + { + str2 = " è stato assassinato"; + } + else + { + if (num7 == 3) + { + str2 = " è stato distrutto"; + } + else + { + if (num7 == 4) + { + str2 = " è stato massacrato"; + } + else + { + if (num7 == 5) + { + str2 = " è stato trafitto"; + } + else + { + if (num7 == 6) + { + str2 = " è stato diviso in due"; + } + else + { + if (num7 == 7) + { + str2 = " è stato decapitato"; + } + else + { + if (num7 == 8) + { + str2 = " ha visto uscire le sue interiora "; + } + else + { + if (num7 == 9) + { + str2 = " è stato brutalmente sezionato"; + } + else + { + if (num7 == 10) + { + str2 = " è diventato un mucchio di carne"; + } + else + { + if (num7 == 11) + { + str2 = " è stato spezzato a metà"; + } + else + { + str2 = " è stato tagliato a metà"; + } + } + } + } + } + } + } + } + } + } + } + } + if ((plr >= 0 && plr < 255) || (npc >= 0 && Main.npc[npc].displayName != "") || (proj >= 0 && Main.projectile[proj].name != "")) + { + result3 = str2 + "."; + } + else + { + if (other >= 0) + { + if (other == 0) + { + if (Main.rand.Next(2) == 0) + { + result3 = " sente la sua morte."; + } + else + { + result3 = " non poteva rimbalzare."; + } + } + else + { + if (other == 1) + { + int num8 = Main.rand.Next(4); + if (num8 == 0) + { + result3 = " ha dimenticato di respirare."; + } + else + { + if (num8 == 1) + { + result3 = " sta dormendo con i pesci."; + } + else + { + if (num8 == 2) + { + result3 = " è affogato."; + } + else + { + if (num8 == 3) + { + result3 = " è un pasto dello squalo."; + } + } + } + } + } + else + { + if (other == 2) + { + int num9 = Main.rand.Next(4); + if (num9 == 0) + { + result3 = " si è sciolto."; + } + else + { + if (num9 == 1) + { + result3 = " si è incenerito."; + } + else + { + if (num9 == 2) + { + result3 = " ha provato a nuotare nella lava."; + } + else + { + if (num9 == 3) + { + result3 = " piace giocare nel magma."; + } + } + } + } + } + else + { + if (other == 3) + { + result3 = str2 + "."; + } + } + } + } + } + } + return result3; + } + if (Lang.lang == 4) + { + string result4 = ""; + int num10 = Main.rand.Next(14); + string str3; + if (num10 == 0) + { + str3 = " s'est fait éviscérer"; + } + else + { + if (num10 == 1) + { + str3 = " s'est fait assassiner"; + } + else + { + if (num10 == 2) + { + str3 = " s'est fait détruire"; + } + else + { + if (num10 == 3) + { + str3 = " s'est fait massacrer"; + } + else + { + if (num10 == 4) + { + str3 = " s'est fait empaler"; + } + else + { + if (num10 == 5) + { + str3 = " s'est fait couper en deux"; + } + else + { + if (num10 == 6) + { + str3 = " s'est fait arracher la tête"; + } + else + { + if (num10 == 7) + { + str3 = " s'est fait déchiqueter les bras"; + } + else + { + if (num10 == 8) + { + str3 = " a vu ses entrailles tomber à ses pieds"; + } + else + { + if (num10 == 9) + { + str3 = " s'est fait brutalement découper"; + } + else + { + if (num10 == 10) + { + str3 = " a fini en chair à pâtée"; + } + else + { + if (num10 == 11) + { + str3 = " s'est fait couper en deux"; + } + else + { + if (num10 == 12) + { + str3 = " s'est fait couper en tranches"; + } + else + { + str3 = " a perdu la tête"; + } + } + } + } + } + } + } + } + } + } + } + } + } + if ((plr >= 0 && plr < 255) || (npc >= 0 && Main.npc[npc].displayName != "") || (proj >= 0 && Main.projectile[proj].name != "")) + { + result4 = str3 + "."; + } + else + { + if (other >= 0) + { + if (other == 0) + { + if (Main.rand.Next(2) == 0) + { + result4 = " a cassé sa pipe."; + } + else + { + result4 = " ne bouge plus."; + } + } + else + { + if (other == 1) + { + int num11 = Main.rand.Next(4); + if (num11 == 0) + { + result4 = " a cessé de respirer."; + } + else + { + if (num11 == 1) + { + result4 = " mange les pissenlits par la racine."; + } + else + { + if (num11 == 2) + { + result4 = " a coulé à pic."; + } + else + { + if (num11 == 3) + { + result4 = " nourrit les requins."; + } + } + } + } + } + else + { + if (other == 2) + { + int num12 = Main.rand.Next(4); + if (num12 == 0) + { + result4 = " a fondu."; + } + else + { + if (num12 == 1) + { + result4 = " s'est fait incinérer."; + } + else + { + if (num12 == 2) + { + result4 = " a tenté de nager dans la lave."; + } + else + { + if (num12 == 3) + { + result4 = " aime barboter dans le magma."; + } + } + } + } + } + else + { + if (other == 3) + { + result4 = str3 + "."; + } + } + } + } + } + } + return result4; + } + if (Lang.lang == 5) + { + string result5 = ""; + string str4 = " fue asesinado"; + if ((plr >= 0 && plr < 255) || (npc >= 0 && Main.npc[npc].displayName != "") || (proj >= 0 && Main.projectile[proj].name != "")) + { + result5 = str4 + "."; + } + else + { + if (other >= 0) + { + if (other == 0) + { + if (Main.rand.Next(2) == 0) + { + result5 = " le ha llegado la hora."; + } + else + { + result5 = " no saltó a tiempo."; + } + } + else + { + if (other == 1) + { + int num13 = Main.rand.Next(4); + if (num13 == 0) + { + result5 = " se olvidó de respirar."; + } + else + { + if (num13 == 1) + { + result5 = " duerme con los peces."; + } + else + { + if (num13 == 2) + { + result5 = " se ha ahogado."; + } + else + { + if (num13 == 3) + { + result5 = " es pasto de los tiburones."; + } + } + } + } + } + else + { + if (other == 2) + { + int num14 = Main.rand.Next(4); + if (num14 == 0) + { + result5 = " se ha calcinado."; + } + else + { + if (num14 == 1) + { + result5 = " se ha chamuscado."; + } + else + { + if (num14 == 2) + { + result5 = " ha intentado nadar en lava."; + } + else + { + if (num14 == 3) + { + result5 = " le gusta jugar con el magma."; + } + } + } + } + } + else + { + if (other == 3) + { + result5 = str4 + "."; + } + } + } + } + } + } + return result5; + } + return ""; + } + } +} diff --git a/Terraria/Lighting.cs b/Terraria/Lighting.cs new file mode 100644 index 0000000..35c24c5 --- /dev/null +++ b/Terraria/Lighting.cs @@ -0,0 +1,3500 @@ +using Microsoft.Xna.Framework; +using System; +using System.Diagnostics; +namespace Terraria +{ + public class Lighting + { + public static int maxRenderCount = 4; + public static int dirX; + public static int dirY; + public static float brightness = 1f; + public static float defBrightness = 1f; + public static int lightMode = 0; + public static bool RGB = true; + public static float oldSkyColor = 0f; + public static float skyColor = 0f; + private static float lightColor = 0f; + private static float lightColorG = 0f; + private static float lightColorB = 0f; + public static int lightCounter = 0; + public static int offScreenTiles = 45; + public static int offScreenTiles2 = 35; + private static int firstTileX; + private static int lastTileX; + private static int firstTileY; + private static int lastTileY; + public static float[,] color = new float[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static float[,] colorG = new float[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static float[,] colorB = new float[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static float[,] color2 = new float[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static float[,] colorG2 = new float[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static float[,] colorB2 = new float[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static bool[,] stopLight = new bool[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static bool[,] wetLight = new bool[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static bool[,] honeyLight = new bool[Main.screenWidth + Lighting.offScreenTiles * 2 + 10, Main.screenHeight + Lighting.offScreenTiles * 2 + 10]; + public static int scrX; + public static int scrY; + public static int minX; + public static int maxX; + public static int minY; + public static int maxY; + private static int maxTempLights = 2000; + private static int[] tempLightX = new int[Lighting.maxTempLights]; + private static int[] tempLightY = new int[Lighting.maxTempLights]; + private static float[] tempLight = new float[Lighting.maxTempLights]; + private static float[] tempLightG = new float[Lighting.maxTempLights]; + private static float[] tempLightB = new float[Lighting.maxTempLights]; + public static int tempLightCount; + private static int firstToLightX; + private static int firstToLightY; + private static int lastToLightX; + private static int lastToLightY; + public static bool resize = false; + private static float negLight = 0.04f; + private static float negLight2 = 0.16f; + private static float wetLightR = 0.16f; + private static float wetLightG = 0.16f; + private static float wetLightB = 0.16f; + private static float honeyLightR = 0.16f; + private static float honeyLightG = 0.16f; + private static float honeyLightB = 0.16f; + private static float blueWave = 1f; + private static int blueDir = 1; + private static int minX7; + private static int maxX7; + private static int minY7; + private static int maxY7; + private static int firstTileX7; + private static int lastTileX7; + private static int lastTileY7; + private static int firstTileY7; + private static int firstToLightX7; + private static int lastToLightX7; + private static int firstToLightY7; + private static int lastToLightY7; + private static int firstToLightX27; + private static int lastToLightX27; + private static int firstToLightY27; + private static int lastToLightY27; + public static void LightTiles(int firstX, int lastX, int firstY, int lastY) + { + Main.render = true; + Lighting.oldSkyColor = Lighting.skyColor; + Lighting.skyColor = (float)((Main.tileColor.R + Main.tileColor.G + Main.tileColor.B) / 3) / 255f; + if (Lighting.lightMode < 2) + { + Lighting.brightness = 1.2f; + Lighting.offScreenTiles2 = 34; + Lighting.offScreenTiles = 40; + } + else + { + Lighting.brightness = 1f; + Lighting.offScreenTiles2 = 18; + Lighting.offScreenTiles = 23; + } + if (Main.player[Main.myPlayer].blind) + { + Lighting.brightness = 1f; + } + Lighting.defBrightness = Lighting.brightness; + Lighting.firstTileX = firstX; + Lighting.lastTileX = lastX; + Lighting.firstTileY = firstY; + Lighting.lastTileY = lastY; + Lighting.firstToLightX = Lighting.firstTileX - Lighting.offScreenTiles; + Lighting.firstToLightY = Lighting.firstTileY - Lighting.offScreenTiles; + Lighting.lastToLightX = Lighting.lastTileX + Lighting.offScreenTiles; + Lighting.lastToLightY = Lighting.lastTileY + Lighting.offScreenTiles; + if (Lighting.firstToLightX < 0) + { + Lighting.firstToLightX = 0; + } + if (Lighting.lastToLightX >= Main.maxTilesX) + { + Lighting.lastToLightX = Main.maxTilesX - 1; + } + if (Lighting.firstToLightY < 0) + { + Lighting.firstToLightY = 0; + } + if (Lighting.lastToLightY >= Main.maxTilesY) + { + Lighting.lastToLightY = Main.maxTilesY - 1; + } + int num = Lighting.firstTileX - Lighting.offScreenTiles2; + int num2 = Lighting.firstTileY - Lighting.offScreenTiles2; + int num3 = Lighting.lastTileX + Lighting.offScreenTiles2; + int num4 = Lighting.lastTileY + Lighting.offScreenTiles2; + if (num < 0) + { + num = 0; + } + if (num3 >= Main.maxTilesX) + { + num3 = Main.maxTilesX - 1; + } + if (num2 < 0) + { + num2 = 0; + } + if (num4 >= Main.maxTilesY) + { + num4 = Main.maxTilesY - 1; + } + Lighting.lightCounter++; + Main.renderCount++; + int num5 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2; + int num6 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2; + Vector2 vector = Main.screenLastPosition; + Lighting.doColors(); + if (Main.renderCount == 2) + { + vector = Main.screenPosition; + int num7 = (int)(Main.screenPosition.X / 16f) - Lighting.scrX; + int num8 = (int)(Main.screenPosition.Y / 16f) - Lighting.scrY; + if (num7 > 16) + { + num7 = 0; + } + if (num8 > 16) + { + num8 = 0; + } + if (Lighting.RGB) + { + for (int i = 0; i < num5; i++) + { + if (i + num7 >= 0) + { + for (int j = 0; j < num6; j++) + { + if (j + num8 >= 0) + { + Lighting.color[i, j] = Lighting.color2[i + num7, j + num8]; + Lighting.colorG[i, j] = Lighting.colorG2[i + num7, j + num8]; + Lighting.colorB[i, j] = Lighting.colorB2[i + num7, j + num8]; + } + } + } + } + } + else + { + for (int k = 0; k < num5; k++) + { + if (k + num7 >= 0) + { + for (int l = 0; l < num6; l++) + { + if (l + num8 >= 0) + { + Lighting.color[k, l] = Lighting.color2[k + num7, l + num8]; + Lighting.colorG[k, l] = Lighting.color2[k + num7, l + num8]; + Lighting.colorB[k, l] = Lighting.color2[k + num7, l + num8]; + } + } + } + } + } + } + if (Main.renderCount != 2 && !Lighting.resize && !Main.renderNow) + { + if (Math.Abs(Main.screenPosition.X / 16f - vector.X / 16f) < 5f) + { + while ((int)(Main.screenPosition.X / 16f) < (int)(vector.X / 16f)) + { + vector.X -= 16f; + for (int m = num5 - 1; m > 1; m--) + { + for (int n = 0; n < num6; n++) + { + Lighting.color[m, n] = Lighting.color[m - 1, n]; + Lighting.colorG[m, n] = Lighting.colorG[m - 1, n]; + Lighting.colorB[m, n] = Lighting.colorB[m - 1, n]; + } + } + } + while ((int)(Main.screenPosition.X / 16f) > (int)(vector.X / 16f)) + { + vector.X += 16f; + for (int num9 = 0; num9 < num5 - 1; num9++) + { + for (int num10 = 0; num10 < num6; num10++) + { + Lighting.color[num9, num10] = Lighting.color[num9 + 1, num10]; + Lighting.colorG[num9, num10] = Lighting.colorG[num9 + 1, num10]; + Lighting.colorB[num9, num10] = Lighting.colorB[num9 + 1, num10]; + } + } + } + } + if (Math.Abs(Main.screenPosition.Y / 16f - vector.Y / 16f) < 5f) + { + while ((int)(Main.screenPosition.Y / 16f) < (int)(vector.Y / 16f)) + { + vector.Y -= 16f; + for (int num11 = num6 - 1; num11 > 1; num11--) + { + for (int num12 = 0; num12 < num5; num12++) + { + Lighting.color[num12, num11] = Lighting.color[num12, num11 - 1]; + Lighting.colorG[num12, num11] = Lighting.colorG[num12, num11 - 1]; + Lighting.colorB[num12, num11] = Lighting.colorB[num12, num11 - 1]; + } + } + } + while ((int)(Main.screenPosition.Y / 16f) > (int)(vector.Y / 16f)) + { + vector.Y += 16f; + for (int num13 = 0; num13 < num6 - 1; num13++) + { + for (int num14 = 0; num14 < num5 - 1; num14++) + { + Lighting.color[num14, num13] = Lighting.color[num14, num13 + 1]; + Lighting.colorG[num14, num13] = Lighting.colorG[num14, num13 + 1]; + Lighting.colorB[num14, num13] = Lighting.colorB[num14, num13 + 1]; + } + } + } + } + if (Netplay.clientSock.statusMax > 0) + { + Main.mapTime = 1; + } + if (Main.mapTime == 0 && Main.mapEnabled && Main.renderCount == 3) + { + try + { + Main.mapTime = Main.mapTimeMax; + Main.updateMap = true; + Main.mapMinX = Lighting.firstToLightX + Lighting.offScreenTiles; + Main.mapMaxX = Lighting.lastToLightX - Lighting.offScreenTiles; + Main.mapMinY = Lighting.firstToLightY + Lighting.offScreenTiles; + Main.mapMaxY = Lighting.lastToLightY - Lighting.offScreenTiles; + for (int num15 = Main.mapMinX; num15 < Main.mapMaxX; num15++) + { + for (int num16 = Main.mapMinY; num16 < Main.mapMaxY; num16++) + { + float num17 = 0f; + int num18 = num15 - Lighting.firstTileX + Lighting.offScreenTiles; + int num19 = num16 - Lighting.firstTileY + Lighting.offScreenTiles; + if (Lighting.color[num18, num19] * 255f > num17) + { + num17 = Lighting.color[num18, num19] * 255f; + } + if (Lighting.colorG[num18, num19] * 255f > num17) + { + num17 = Lighting.colorG[num18, num19] * 255f; + } + if (Lighting.colorB[num18, num19] * 255f > num17) + { + num17 = Lighting.colorB[num18, num19] * 255f; + } + if (Lighting.lightMode < 2) + { + num17 *= 1.5f; + } + if (num17 > 255f) + { + num17 = 255f; + } + if ((double)num16 < Main.worldSurface && !Main.tile[num15, num16].active() && Main.tile[num15, num16].wall == 0 && Main.tile[num15, num16].liquid == 0) + { + num17 = 22f; + } + if (num17 > 18f || (Main.map[num15, num16] != null && Main.map[num15, num16].light > 0)) + { + if (num17 < 22f) + { + num17 = 22f; + } + if (Main.map[num15, num16] == null) + { + Main.map[num15, num16] = new Map(); + } + Main.map[num15, num16].setTile(num15, num16, (byte)num17); + } + } + } + } + catch + { + } + } + if (Lighting.oldSkyColor != Lighting.skyColor) + { + for (int num20 = Lighting.firstToLightX; num20 < Lighting.lastToLightX; num20++) + { + for (int num21 = Lighting.firstToLightY; num21 < Lighting.lastToLightY; num21++) + { + if (Main.tile[num20, num21] == null) + { + Main.tile[num20, num21] = new Tile(); + } + if ((!Main.tile[num20, num21].active() || !Main.tileNoSunLight[(int)Main.tile[num20, num21].type]) && Lighting.color[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] < Lighting.skyColor && (double)num21 < Main.worldSurface && Main.tile[num20, num21].liquid < 200 && (Main.wallLight[(int)Main.tile[num20, num21].wall] || Main.tile[num20, num21].wall == 73)) + { + if (Lighting.color[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.color[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] = (float)Main.tileColor.R / 255f; + } + if (Lighting.colorG[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.colorG[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] = (float)Main.tileColor.G / 255f; + } + if (Lighting.colorB[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.colorB[num20 - Lighting.firstToLightX, num21 - Lighting.firstToLightY] = (float)Main.tileColor.B / 255f; + } + } + } + } + } + } + else + { + Lighting.lightCounter = 0; + } + if (Main.renderCount <= Lighting.maxRenderCount) + { + return; + } + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + long arg_B7E_0 = stopwatch.ElapsedMilliseconds; + Lighting.resize = false; + Main.drawScene = true; + Lighting.ResetRange(); + if (Lighting.lightMode == 0 || Lighting.lightMode == 3) + { + Lighting.RGB = true; + } + else + { + Lighting.RGB = false; + } + int num22 = 0; + int num23 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10; + int num24 = 0; + int num25 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10; + for (int num26 = num22; num26 < num23; num26++) + { + for (int num27 = num24; num27 < num25; num27++) + { + Lighting.color2[num26, num27] = 0f; + Lighting.colorG2[num26, num27] = 0f; + Lighting.colorB2[num26, num27] = 0f; + Lighting.stopLight[num26, num27] = false; + Lighting.wetLight[num26, num27] = false; + Lighting.honeyLight[num26, num27] = false; + } + } + for (int num28 = 0; num28 < Lighting.tempLightCount; num28++) + { + if (Lighting.tempLightX[num28] - Lighting.firstTileX + Lighting.offScreenTiles >= 0 && Lighting.tempLightX[num28] - Lighting.firstTileX + Lighting.offScreenTiles < Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 && Lighting.tempLightY[num28] - Lighting.firstTileY + Lighting.offScreenTiles >= 0 && Lighting.tempLightY[num28] - Lighting.firstTileY + Lighting.offScreenTiles < Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + int num29 = Lighting.tempLightX[num28] - Lighting.firstTileX + Lighting.offScreenTiles; + int num30 = Lighting.tempLightY[num28] - Lighting.firstTileY + Lighting.offScreenTiles; + if (Lighting.color2[num29, num30] < Lighting.tempLight[num28]) + { + Lighting.color2[num29, num30] = Lighting.tempLight[num28]; + } + if (Lighting.colorG2[num29, num30] < Lighting.tempLightG[num28]) + { + Lighting.colorG2[num29, num30] = Lighting.tempLightG[num28]; + } + if (Lighting.colorB2[num29, num30] < Lighting.tempLightB[num28]) + { + Lighting.colorB2[num29, num30] = Lighting.tempLightB[num28]; + } + } + } + if (Main.wof >= 0 && Main.player[Main.myPlayer].gross) + { + try + { + int num31 = (int)Main.screenPosition.Y / 16 - 10; + int num32 = (int)(Main.screenPosition.Y + (float)Main.screenHeight) / 16 + 10; + int num33 = (int)Main.npc[Main.wof].position.X / 16; + if (Main.npc[Main.wof].direction > 0) + { + num33 -= 3; + } + else + { + num33 += 2; + } + int num34 = num33 + 8; + float num35 = 0.5f * Main.demonTorch + 1f * (1f - Main.demonTorch); + float num36 = 0.3f; + float num37 = 1f * Main.demonTorch + 0.5f * (1f - Main.demonTorch); + num35 *= 0.2f; + num36 *= 0.1f; + num37 *= 0.3f; + for (int num38 = num33; num38 <= num34; num38++) + { + for (int num39 = num31; num39 <= num32; num39++) + { + if (Lighting.color2[num38 - Lighting.firstToLightX, num39 - Lighting.firstToLightY] < num35) + { + Lighting.color2[num38 - Lighting.firstToLightX, num39 - Lighting.firstToLightY] = num35; + } + if (Lighting.colorG2[num38 - Lighting.firstToLightX, num39 - Lighting.firstToLightY] < num36) + { + Lighting.colorG2[num38 - Lighting.firstToLightX, num39 - Lighting.firstToLightY] = num36; + } + if (Lighting.colorB2[num38 - Lighting.firstToLightX, num39 - Lighting.firstToLightY] < num37) + { + Lighting.colorB2[num38 - Lighting.firstToLightX, num39 - Lighting.firstToLightY] = num37; + } + } + } + } + catch + { + } + } + if (!Main.renderNow) + { + Main.oldTempLightCount = Lighting.tempLightCount; + Lighting.tempLightCount = 0; + } + if (Main.gamePaused) + { + Lighting.tempLightCount = Main.oldTempLightCount; + } + Main.sandTiles = 0; + Main.evilTiles = 0; + Main.bloodTiles = 0; + Main.shroomTiles = 0; + Main.snowTiles = 0; + Main.holyTiles = 0; + Main.meteorTiles = 0; + Main.jungleTiles = 0; + Main.dungeonTiles = 0; + Main.campfire = false; + Main.musicBox = -1; + Main.waterCandles = 0; + num22 = Lighting.firstToLightX; + num23 = Lighting.lastToLightX; + num24 = Lighting.firstToLightY; + num25 = Lighting.lastToLightY; + for (int num40 = num22; num40 < num23; num40++) + { + for (int num41 = num24; num41 < num25; num41++) + { + if (Main.tile[num40, num41] == null) + { + Main.tile[num40, num41] = new Tile(); + } + if ((!Main.tile[num40, num41].active() || !Main.tileNoSunLight[(int)Main.tile[num40, num41].type]) && Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor && (Main.wallLight[(int)Main.tile[num40, num41].wall] || Main.tile[num40, num41].wall == 73) && (double)num41 < Main.worldSurface) + { + if (Main.tile[num40, num41].halfBrick()) + { + if (Main.tile[num40, num41].liquid < 200 && Main.tile[num40, num41 - 1].liquid < 200) + { + if (Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = (float)Main.tileColor.R / 255f; + } + if (Lighting.colorG2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.colorG2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = (float)Main.tileColor.G / 255f; + } + if (Lighting.colorB2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.colorB2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = (float)Main.tileColor.B / 255f; + } + } + } + else + { + if (Main.tile[num40, num41].liquid < 200) + { + if (Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = (float)Main.tileColor.R / 255f; + } + if (Lighting.colorG2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.colorG2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = (float)Main.tileColor.G / 255f; + } + if (Lighting.colorB2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < Lighting.skyColor) + { + Lighting.colorB2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = (float)Main.tileColor.B / 255f; + } + } + } + } + if ((!Main.tile[num40, num41].active() || Main.tile[num40, num41].halfBrick() || !Main.tileNoSunLight[(int)Main.tile[num40, num41].type]) && Main.tile[num40, num41].wall >= 88 && Main.tile[num40, num41].wall <= 93 && (double)num41 < Main.worldSurface && Main.tile[num40, num41].liquid < 255) + { + float num42 = (float)Main.tileColor.R / 255f; + float num43 = (float)Main.tileColor.G / 255f; + float num44 = (float)Main.tileColor.B / 255f; + int num45 = (int)(Main.tile[num40, num41].wall - 88); + if (num45 == 0) + { + num42 *= 0.9f; + num43 *= 0.15f; + num44 *= 0.9f; + } + else + { + if (num45 == 1) + { + num42 *= 0.9f; + num43 *= 0.9f; + num44 *= 0.15f; + } + else + { + if (num45 == 2) + { + num42 *= 0.15f; + num43 *= 0.15f; + num44 *= 0.9f; + } + else + { + if (num45 == 3) + { + num42 *= 0.15f; + num43 *= 0.9f; + num44 *= 0.15f; + } + else + { + if (num45 == 4) + { + num42 *= 0.9f; + num43 *= 0.15f; + num44 *= 0.15f; + } + else + { + if (num45 == 5) + { + float num46 = 0.2f; + float num47 = 0.7f - num46; + num42 *= num47 + (float)Main.DiscoR / 255f * num46; + num43 *= num47 + (float)Main.DiscoG / 255f * num46; + num44 *= num47 + (float)Main.DiscoB / 255f * num46; + } + } + } + } + } + } + if (Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < num42) + { + Lighting.color2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = num42; + } + if (Lighting.colorG2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < num43) + { + Lighting.colorG2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = num43; + } + if (Lighting.colorB2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] < num44) + { + Lighting.colorB2[num40 - Lighting.firstToLightX, num41 - Lighting.firstToLightY] = num44; + } + } + } + } + Main.fountainColor = -1; + for (int num48 = num22; num48 < num23; num48++) + { + for (int num49 = num24; num49 < num25; num49++) + { + int num50 = num48 - Lighting.firstToLightX; + int num51 = num49 - Lighting.firstToLightY; + int zoneX = Main.zoneX; + int zoneY = Main.zoneY; + int num52 = (num23 - num22 - zoneX) / 2; + int num53 = (num25 - num24 - zoneY) / 2; + byte b = Main.tile[num48, num49].wall; + if (b != 33) + { + if (b == 44) + { + if (!Main.tile[num48, num49].active() || !Main.tileBlockLight[(int)Main.tile[num48, num49].type]) + { + if (Lighting.RGB) + { + float num54 = (float)Main.DiscoR / 255f; + float num55 = (float)Main.DiscoG / 255f; + float num56 = (float)Main.DiscoB / 255f; + num54 *= 0.15f; + num55 *= 0.15f; + num56 *= 0.15f; + if (Lighting.color2[num50, num51] < num54) + { + Lighting.color2[num50, num51] = num54; + } + if (Lighting.colorG2[num50, num51] < num55) + { + Lighting.colorG2[num50, num51] = num55; + } + if (Lighting.colorB2[num50, num51] < num56) + { + Lighting.colorB2[num50, num51] = num56; + } + } + else + { + if (Lighting.color2[num50, num51] < 0.15f) + { + Lighting.color2[num50, num51] = 0.15f; + } + } + } + } + } + else + { + if (!Main.tile[num48, num49].active() || !Main.tileBlockLight[(int)Main.tile[num48, num49].type]) + { + if ((double)Lighting.color2[num50, num51] < 0.12) + { + Lighting.color2[num50, num51] = 0.0899999961f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.07) + { + Lighting.colorG2[num50, num51] = 0.0525000021f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.32) + { + Lighting.colorB2[num50, num51] = 0.24f; + } + } + } + if (Main.tile[num48, num49].active()) + { + if (num48 > num22 + num52 && num48 < num23 - num52 && num49 > num24 + num53 && num49 < num25 - num53) + { + b = Main.tile[num48, num49].type; + if (b <= 72) + { + if (b <= 44) + { + if (b <= 32) + { + switch (b) + { + case 23: + case 24: + case 25: + break; + case 26: + goto IL_1B95; + case 27: + Main.evilTiles -= 5; + goto IL_1B95; + default: + if (b != 32) + { + goto IL_1B95; + } + break; + } + Main.evilTiles++; + goto IL_1B95; + } + if (b == 37) + { + Main.meteorTiles++; + goto IL_1B95; + } + switch (b) + { + case 41: + case 43: + case 44: + Main.dungeonTiles++; + goto IL_1B95; + case 42: + goto IL_1B95; + default: + goto IL_1B95; + } + } + else + { + if (b <= 53) + { + if (b == 49) + { + Main.waterCandles++; + goto IL_1B95; + } + if (b != 53) + { + goto IL_1B95; + } + Main.sandTiles++; + goto IL_1B95; + } + else + { + switch (b) + { + case 60: + case 61: + case 62: + break; + default: + switch (b) + { + case 70: + case 71: + case 72: + Main.shroomTiles++; + goto IL_1B95; + default: + goto IL_1B95; + } + break; + } + } + } + } + else + { + if (b <= 164) + { + if (b > 117) + { + switch (b) + { + case 147: + case 148: + break; + default: + switch (b) + { + case 161: + case 162: + break; + case 163: + Main.snowTiles++; + Main.evilTiles++; + goto IL_1B95; + case 164: + Main.holyTiles++; + Main.snowTiles++; + goto IL_1B95; + default: + goto IL_1B95; + } + break; + } + Main.snowTiles++; + goto IL_1B95; + } + if (b != 84) + { + switch (b) + { + case 109: + case 110: + case 113: + case 117: + Main.holyTiles++; + goto IL_1B95; + case 111: + case 114: + case 115: + goto IL_1B95; + case 112: + Main.sandTiles++; + Main.evilTiles++; + goto IL_1B95; + case 116: + Main.sandTiles++; + Main.holyTiles++; + goto IL_1B95; + default: + goto IL_1B95; + } + } + } + else + { + if (b <= 215) + { + switch (b) + { + case 199: + case 200: + case 203: + Main.bloodTiles++; + goto IL_1B95; + case 201: + case 202: + goto IL_1B95; + default: + if (b != 215) + { + goto IL_1B95; + } + Main.campfire = true; + goto IL_1B95; + } + } + else + { + if (b != 226) + { + if (b != 234) + { + goto IL_1B95; + } + Main.bloodTiles++; + Main.sandTiles++; + goto IL_1B95; + } + } + } + } + Main.jungleTiles++; + } + IL_1B95: + b = Main.tile[num48, num49].type; + if (b != 139) + { + if (b == 207) + { + if (Main.tile[num48, num49].frameY >= 72) + { + int num57 = 0; + for (int num58 = (int)(Main.tile[num48, num49].frameX / 18); num58 >= 2; num58 -= 2) + { + num57++; + } + if (num57 == 0) + { + Main.fountainColor = 0; + } + if (num57 == 1) + { + Main.fountainColor = 6; + } + if (num57 == 2) + { + Main.fountainColor = 3; + } + if (num57 == 3) + { + Main.fountainColor = 5; + } + if (num57 == 4) + { + Main.fountainColor = 2; + } + if (num57 == 5) + { + Main.fountainColor = 10; + } + if (num57 == 6) + { + Main.fountainColor = 4; + } + if (num57 == 7) + { + Main.fountainColor = 9; + } + } + } + } + else + { + if (Main.tile[num48, num49].frameX >= 36) + { + int num59 = 0; + for (int num60 = (int)(Main.tile[num48, num49].frameY / 18); num60 >= 2; num60 -= 2) + { + num59++; + } + Main.musicBox = num59; + } + } + if (Main.tileBlockLight[(int)Main.tile[num48, num49].type] && Main.tile[num48, num49].type != 131 && !Main.tile[num48, num49].inActive() && Main.tile[num48, num49].slope() == 0) + { + Lighting.stopLight[num50, num51] = true; + } + if (Main.tileLighted[(int)Main.tile[num48, num49].type]) + { + if (Lighting.RGB) + { + b = Main.tile[num48, num49].type; + if (b <= 84) + { + if (b <= 42) + { + if (b <= 17) + { + if (b != 4) + { + if (b != 17) + { + goto IL_42F9; + } + goto IL_2B4F; + } + else + { + float num61 = 1f; + float num62 = 0.95f; + float num63 = 0.8f; + if (Main.tile[num48, num49].frameX >= 66) + { + goto IL_42F9; + } + int num64 = (int)(Main.tile[num48, num49].frameY / 22); + if (num64 == 1) + { + num61 = 0f; + num62 = 0.1f; + num63 = 1.3f; + } + else + { + if (num64 == 2) + { + num61 = 1f; + num62 = 0.1f; + num63 = 0.1f; + } + else + { + if (num64 == 3) + { + num61 = 0f; + num62 = 1f; + num63 = 0.1f; + } + else + { + if (num64 == 4) + { + num61 = 0.9f; + num62 = 0f; + num63 = 0.9f; + } + else + { + if (num64 == 5) + { + num61 = 1.3f; + num62 = 1.3f; + num63 = 1.3f; + } + else + { + if (num64 == 6) + { + num61 = 0.9f; + num62 = 0.9f; + num63 = 0f; + } + else + { + if (num64 == 7) + { + num61 = 0.5f * Main.demonTorch + 1f * (1f - Main.demonTorch); + num62 = 0.3f; + num63 = 1f * Main.demonTorch + 0.5f * (1f - Main.demonTorch); + } + else + { + if (num64 == 8) + { + num63 = 0.7f; + num61 = 0.85f; + num62 = 1f; + } + else + { + if (num64 == 9) + { + num63 = 1f; + num61 = 0.7f; + num62 = 0.85f; + } + else + { + if (num64 == 10) + { + num61 = 1f; + num62 = 0.5f; + num63 = 0f; + } + else + { + if (num64 == 11) + { + num61 = 1.25f; + num62 = 1.25f; + num63 = 0.8f; + } + } + } + } + } + } + } + } + } + } + } + if (Lighting.color2[num50, num51] < num61) + { + Lighting.color2[num50, num51] = num61; + } + if (Lighting.colorG2[num50, num51] < num62) + { + Lighting.colorG2[num50, num51] = num62; + } + if (Lighting.colorB2[num50, num51] < num63) + { + Lighting.colorB2[num50, num51] = num63; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if (b == 22) + { + goto IL_2CDE; + } + switch (b) + { + case 26: + case 31: + if ((Main.tile[num48, num49].type == 31 && Main.tile[num48, num49].frameX >= 36) || (Main.tile[num48, num49].type == 26 && Main.tile[num48, num49].frameX >= 54)) + { + float num65 = (float)Main.rand.Next(-5, 6) * 0.0025f; + if (Lighting.color2[num50, num51] < 0.5f + num65 * 2f) + { + Lighting.color2[num50, num51] = 0.5f + num65 * 2f; + } + if (Lighting.colorG2[num50, num51] < 0.2f + num65) + { + Lighting.colorG2[num50, num51] = 0.2f + num65; + } + if (Lighting.colorB2[num50, num51] < 0.1f) + { + Lighting.colorB2[num50, num51] = 0.1f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + float num66 = (float)Main.rand.Next(-5, 6) * 0.0025f; + if (Lighting.color2[num50, num51] < 0.31f + num66) + { + Lighting.color2[num50, num51] = 0.31f + num66; + } + if (Lighting.colorG2[num50, num51] < 0.1f + num66) + { + Lighting.colorG2[num50, num51] = 0.1f; + } + if (Lighting.colorB2[num50, num51] < 0.44f + num66 * 2f) + { + Lighting.colorB2[num50, num51] = 0.44f + num66 * 2f; + goto IL_42F9; + } + goto IL_42F9; + } + break; + case 27: + case 28: + case 29: + case 30: + case 32: + goto IL_42F9; + case 33: + if (Main.tile[num48, num49].frameX != 0) + { + goto IL_42F9; + } + if (Main.tile[num48, num49].frameY == 0) + { + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.65) + { + Lighting.colorB2[num50, num51] = 0.65f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Main.tile[num48, num49].frameY == 22) + { + if (Lighting.color2[num50, num51] < 0.55f) + { + Lighting.color2[num50, num51] = 0.55f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.85) + { + Lighting.colorG2[num50, num51] = 0.85f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.35) + { + Lighting.colorB2[num50, num51] = 0.35f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Main.tile[num48, num49].frameY == 44) + { + if ((double)Lighting.color2[num50, num51] < 0.65) + { + Lighting.color2[num50, num51] = 0.65f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.5) + { + Lighting.colorB2[num50, num51] = 0.5f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Main.tile[num48, num49].frameY != 66) + { + goto IL_42F9; + } + if ((double)Lighting.color2[num50, num51] < 0.2) + { + Lighting.color2[num50, num51] = 0.2f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.75) + { + Lighting.colorG2[num50, num51] = 0.75f; + } + if (Lighting.colorB2[num50, num51] < 1f) + { + Lighting.colorB2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + } + } + } + break; + case 34: + case 35: + goto IL_2A07; + case 36: + break; + case 37: + if ((double)Lighting.color2[num50, num51] < 0.56) + { + Lighting.color2[num50, num51] = 0.56f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.43) + { + Lighting.colorG2[num50, num51] = 0.43f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.15) + { + Lighting.colorB2[num50, num51] = 0.15f; + goto IL_42F9; + } + goto IL_42F9; + default: + { + if (b != 42) + { + goto IL_42F9; + } + if (Main.tile[num48, num49].frameX != 0) + { + goto IL_42F9; + } + int num67 = (int)(Main.tile[num48, num49].frameY / 36); + float num68 = 1f; + float num69 = 1f; + float num70 = 1f; + if (num67 == 0) + { + num68 = 0.7f; + num69 = 0.65f; + num70 = 0.55f; + } + else + { + if (num67 == 1) + { + num68 = 0.9f; + num69 = 0.75f; + num70 = 0.6f; + } + else + { + if (num67 == 2) + { + num68 = 0.8f; + num69 = 0.6f; + num70 = 0.6f; + } + else + { + if (num67 == 3) + { + num68 = 0.65f; + num69 = 0.5f; + num70 = 0.2f; + } + else + { + if (num67 == 4) + { + num68 = 0.5f; + num69 = 0.7f; + num70 = 0.4f; + } + else + { + if (num67 == 5) + { + num68 = 0.9f; + num69 = 0.4f; + num70 = 0.2f; + } + else + { + if (num67 == 6) + { + num68 = 0.7f; + num69 = 0.75f; + num70 = 0.3f; + } + else + { + if (num67 == 7) + { + num68 = 0.9f; + num69 = 0.9f; + num70 = 0.7f; + num70 += Main.demonTorch * 0.2f; + num68 -= Main.demonTorch * 0.2f; + num69 -= Main.demonTorch * 0.2f; + } + } + } + } + } + } + } + } + if (Lighting.color2[num50, num51] < num68) + { + Lighting.color2[num50, num51] = num68; + } + if (Lighting.colorG2[num50, num51] < num69) + { + Lighting.colorG2[num50, num51] = num69; + } + if (Lighting.colorB2[num50, num51] < num70) + { + Lighting.colorB2[num50, num51] = num70; + goto IL_42F9; + } + goto IL_42F9; + } + } + } + } + else + { + if (b <= 61) + { + if (b != 49) + { + if (b != 61) + { + goto IL_42F9; + } + if (Main.tile[num48, num49].frameX != 144) + { + goto IL_42F9; + } + float num71 = 1f + (float)(270 - (int)Main.mouseTextColor) / 400f; + float num72 = 0.8f - (float)(270 - (int)Main.mouseTextColor) / 400f; + if (Lighting.color2[num50, num51] < 0.42f * num71) + { + Lighting.color2[num50, num51] = 0.42f * num72; + } + if (Lighting.colorG2[num50, num51] < 0.81f * num71) + { + Lighting.colorG2[num50, num51] = 0.81f * num71; + } + if (Lighting.colorB2[num50, num51] < 0.52f * num71) + { + Lighting.colorB2[num50, num51] = 0.52f * num72; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Lighting.color2[num50, num51] < 0f) + { + Lighting.color2[num50, num51] = 0f; + } + if (Lighting.colorG2[num50, num51] < 0.35f) + { + Lighting.colorG2[num50, num51] = 0.35f; + } + if (Lighting.colorB2[num50, num51] < 0.8f) + { + Lighting.colorB2[num50, num51] = 0.8f; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + switch (b) + { + case 70: + case 71: + case 72: + goto IL_2FF1; + default: + if (b != 77) + { + switch (b) + { + case 83: + if (Main.tile[num48, num49].frameX != 18 || Main.dayTime) + { + goto IL_42F9; + } + if ((double)Lighting.color2[num50, num51] < 0.1) + { + Lighting.color2[num50, num51] = 0.1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.4) + { + Lighting.colorG2[num50, num51] = 0.4f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.6) + { + Lighting.colorB2[num50, num51] = 0.6f; + goto IL_42F9; + } + goto IL_42F9; + case 84: + { + int num73 = (int)(Main.tile[num48, num49].frameX / 18); + if (num73 == 2) + { + float num74 = (float)(270 - (int)Main.mouseTextColor); + num74 /= 800f; + if (num74 > 1f) + { + num74 = 1f; + } + if (num74 < 0f) + { + num74 = 0f; + } + float num75 = num74; + if (Lighting.color2[num50, num51] < num75 * 0.7f) + { + Lighting.color2[num50, num51] = num75 * 0.7f; + } + if (Lighting.colorG2[num50, num51] < num75) + { + Lighting.colorG2[num50, num51] = num75; + } + if (Lighting.colorB2[num50, num51] < num75 * 0.1f) + { + Lighting.colorB2[num50, num51] = num75 * 0.1f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (num73 != 5) + { + goto IL_42F9; + } + float num75 = 0.9f; + if (Lighting.color2[num50, num51] < num75) + { + Lighting.color2[num50, num51] = num75; + } + if (Lighting.colorG2[num50, num51] < num75 * 0.8f) + { + Lighting.colorG2[num50, num51] = num75 * 0.8f; + } + if (Lighting.colorB2[num50, num51] < num75 * 0.2f) + { + Lighting.colorB2[num50, num51] = num75 * 0.2f; + goto IL_42F9; + } + goto IL_42F9; + } + break; + } + default: + goto IL_42F9; + } + } + else + { + if (Lighting.color2[num50, num51] < 0.75f) + { + Lighting.color2[num50, num51] = 0.75f; + } + if (Lighting.colorG2[num50, num51] < 0.45f) + { + Lighting.colorG2[num50, num51] = 0.45f; + } + if (Lighting.colorB2[num50, num51] < 0.25f) + { + Lighting.colorB2[num50, num51] = 0.25f; + goto IL_42F9; + } + goto IL_42F9; + } + break; + } + } + } + } + else + { + if (b <= 149) + { + if (b <= 129) + { + switch (b) + { + case 92: + if (Main.tile[num48, num49].frameY > 18 || Main.tile[num48, num49].frameX != 0) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if (Lighting.colorG2[num50, num51] < 1f) + { + Lighting.colorG2[num50, num51] = 1f; + } + if (Lighting.colorB2[num50, num51] < 1f) + { + Lighting.colorB2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + case 93: + if (Main.tile[num48, num49].frameY != 0 || Main.tile[num48, num49].frameX != 0) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.97) + { + Lighting.colorG2[num50, num51] = 0.97f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.85) + { + Lighting.colorB2[num50, num51] = 0.85f; + goto IL_42F9; + } + goto IL_42F9; + case 94: + case 96: + case 97: + case 99: + goto IL_42F9; + case 95: + if (Main.tile[num48, num49].frameX >= 36) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.8) + { + Lighting.colorB2[num50, num51] = 0.8f; + goto IL_42F9; + } + goto IL_42F9; + case 98: + if (Main.tile[num48, num49].frameY != 0) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.97) + { + Lighting.colorG2[num50, num51] = 0.97f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.85) + { + Lighting.colorB2[num50, num51] = 0.85f; + goto IL_42F9; + } + goto IL_42F9; + case 100: + break; + default: + switch (b) + { + case 125: + { + float num76 = (float)Main.rand.Next(28, 42) * 0.01f; + num76 += (float)(270 - (int)Main.mouseTextColor) / 800f; + if ((double)Lighting.colorG2[num50, num51] < 0.1 * (double)num76) + { + Lighting.colorG2[num50, num51] = 0.3f * num76; + } + if ((double)Lighting.colorB2[num50, num51] < 0.3 * (double)num76) + { + Lighting.colorB2[num50, num51] = 0.6f * num76; + goto IL_42F9; + } + goto IL_42F9; + } + case 126: + if (Main.tile[num48, num49].frameX >= 36) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < (float)Main.DiscoR / 255f) + { + Lighting.color2[num50, num51] = (float)Main.DiscoR / 255f; + } + if (Lighting.colorG2[num50, num51] < (float)Main.DiscoG / 255f) + { + Lighting.colorG2[num50, num51] = (float)Main.DiscoG / 255f; + } + if (Lighting.colorB2[num50, num51] < (float)Main.DiscoB / 255f) + { + Lighting.colorB2[num50, num51] = (float)Main.DiscoB / 255f; + goto IL_42F9; + } + goto IL_42F9; + case 127: + case 128: + goto IL_42F9; + case 129: + { + float num61; + float num62; + float num63; + if (Main.tile[num48, num49].frameX == 0 || Main.tile[num48, num49].frameX == 54 || Main.tile[num48, num49].frameX == 108) + { + num62 = 0.05f; + num63 = 0.25f; + num61 = 0f; + } + else + { + if (Main.tile[num48, num49].frameX == 18 || Main.tile[num48, num49].frameX == 72 || Main.tile[num48, num49].frameX == 126) + { + num61 = 0.2f; + num63 = 0.15f; + num62 = 0f; + } + else + { + num63 = 0.2f; + num61 = 0.1f; + num62 = 0f; + } + } + if (Lighting.color2[num50, num51] < num61) + { + Lighting.color2[num50, num51] = num61 * (float)Main.rand.Next(970, 1031) * 0.001f; + } + if (Lighting.colorG2[num50, num51] < num62) + { + Lighting.colorG2[num50, num51] = num62 * (float)Main.rand.Next(970, 1031) * 0.001f; + } + if (Lighting.colorB2[num50, num51] < num63) + { + Lighting.colorB2[num50, num51] = num63 * (float)Main.rand.Next(970, 1031) * 0.001f; + goto IL_42F9; + } + goto IL_42F9; + } + default: + goto IL_42F9; + } + break; + } + } + else + { + if (b == 133) + { + goto IL_2B4F; + } + if (b == 140) + { + goto IL_2CDE; + } + if (b != 149) + { + goto IL_42F9; + } + float num61; + float num62; + float num63; + if (Main.tile[num48, num49].frameX == 0) + { + num62 = 0.2f; + num63 = 0.5f; + num61 = 0.1f; + } + else + { + if (Main.tile[num48, num49].frameX == 18) + { + num61 = 0.5f; + num63 = 0.1f; + num62 = 0.1f; + } + else + { + num63 = 0.1f; + num61 = 0.2f; + num62 = 0.5f; + } + } + if (Main.tile[num48, num49].frameX > 36) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < num61) + { + Lighting.color2[num50, num51] = num61 * (float)Main.rand.Next(970, 1031) * 0.001f; + } + if (Lighting.colorG2[num50, num51] < num62) + { + Lighting.colorG2[num50, num51] = num62 * (float)Main.rand.Next(970, 1031) * 0.001f; + } + if (Lighting.colorB2[num50, num51] < num63) + { + Lighting.colorB2[num50, num51] = num63 * (float)Main.rand.Next(970, 1031) * 0.001f; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if (b <= 190) + { + if (b != 160) + { + switch (b) + { + case 170: + case 171: + goto IL_2A07; + case 172: + goto IL_28BF; + case 173: + break; + case 174: + if (Main.tile[num48, num49].frameX != 0) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.65) + { + Lighting.colorB2[num50, num51] = 0.65f; + goto IL_42F9; + } + goto IL_42F9; + default: + if (b != 190) + { + goto IL_42F9; + } + goto IL_2FF1; + } + } + else + { + float num77 = (float)Main.DiscoR / 255f; + float num78 = (float)Main.DiscoG / 255f; + float num79 = (float)Main.DiscoB / 255f; + num77 *= 0.25f; + num78 *= 0.25f; + num79 *= 0.25f; + if (Lighting.color2[num50, num51] < num77) + { + Lighting.color2[num50, num51] = num77; + } + if (Lighting.colorG2[num50, num51] < num78) + { + Lighting.colorG2[num50, num51] = num78; + } + if (Lighting.colorB2[num50, num51] < num79) + { + Lighting.colorB2[num50, num51] = num79; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if (b != 204) + { + if (b != 215) + { + switch (b) + { + case 235: + if ((double)Lighting.color2[num50, num51] < 0.6) + { + Lighting.color2[num50, num51] = 0.6f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.6) + { + Lighting.colorG2[num50, num51] = 0.6f; + goto IL_42F9; + } + goto IL_42F9; + case 236: + goto IL_42F9; + case 237: + if ((double)Lighting.color2[num50, num51] < 0.1) + { + Lighting.color2[num50, num51] = 0.1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.1) + { + Lighting.colorG2[num50, num51] = 0.1f; + goto IL_42F9; + } + goto IL_42F9; + case 238: + if ((double)Lighting.color2[num50, num51] < 0.5) + { + Lighting.color2[num50, num51] = 0.5f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.5) + { + Lighting.colorB2[num50, num51] = 0.5f; + goto IL_42F9; + } + goto IL_42F9; + default: + goto IL_42F9; + } + } + else + { + float num80 = (float)Main.rand.Next(28, 42) * 0.005f; + num80 += (float)(270 - (int)Main.mouseTextColor) / 700f; + if ((double)Lighting.color2[num50, num51] < 0.9 + (double)num80) + { + Lighting.color2[num50, num51] = 0.9f + num80; + } + if ((double)Lighting.colorG2[num50, num51] < 0.3 + (double)num80) + { + Lighting.colorG2[num50, num51] = 0.3f + num80; + } + if ((double)Lighting.colorB2[num50, num51] < 0.1 + (double)num80) + { + Lighting.colorB2[num50, num51] = 0.1f + num80; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if ((double)Lighting.color2[num50, num51] < 0.35) + { + Lighting.color2[num50, num51] = 0.35f; + goto IL_42F9; + } + goto IL_42F9; + } + } + } + if (Main.tile[num48, num49].frameX >= 36) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.65) + { + Lighting.colorB2[num50, num51] = 0.65f; + goto IL_42F9; + } + goto IL_42F9; + } + IL_28BF: + if (Main.tile[num48, num49].frameX >= 54) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.65) + { + Lighting.colorB2[num50, num51] = 0.65f; + goto IL_42F9; + } + goto IL_42F9; + IL_2A07: + if (Main.tile[num48, num49].frameX >= 54) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 1f) + { + Lighting.color2[num50, num51] = 1f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.95) + { + Lighting.colorG2[num50, num51] = 0.95f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.8) + { + Lighting.colorB2[num50, num51] = 0.8f; + goto IL_42F9; + } + goto IL_42F9; + IL_2B4F: + if (Lighting.color2[num50, num51] < 0.83f) + { + Lighting.color2[num50, num51] = 0.83f; + } + if (Lighting.colorG2[num50, num51] < 0.6f) + { + Lighting.colorG2[num50, num51] = 0.6f; + } + if (Lighting.colorB2[num50, num51] < 0.5f) + { + Lighting.colorB2[num50, num51] = 0.5f; + goto IL_42F9; + } + goto IL_42F9; + IL_2CDE: + if ((double)Lighting.color2[num50, num51] < 0.12) + { + Lighting.color2[num50, num51] = 0.12f; + } + if ((double)Lighting.colorG2[num50, num51] < 0.07) + { + Lighting.colorG2[num50, num51] = 0.07f; + } + if ((double)Lighting.colorB2[num50, num51] < 0.32) + { + Lighting.colorB2[num50, num51] = 0.32f; + goto IL_42F9; + } + goto IL_42F9; + IL_2FF1: + float num81 = (float)Main.rand.Next(28, 42) * 0.005f; + num81 += (float)(270 - (int)Main.mouseTextColor) / 1000f; + if (Lighting.color2[num50, num51] < 0.1f) + { + Lighting.color2[num50, num51] = 0.1f; + } + if (Lighting.colorG2[num50, num51] < 0.2f + num81 / 2f) + { + Lighting.colorG2[num50, num51] = 0.2f + num81 / 2f; + } + if (Lighting.colorB2[num50, num51] < 0.7f + num81) + { + Lighting.colorB2[num50, num51] = 0.7f + num81; + } + } + else + { + b = Main.tile[num48, num49].type; + if (b <= 84) + { + if (b <= 42) + { + if (b <= 17) + { + if (b != 4) + { + if (b != 17) + { + goto IL_42F9; + } + goto IL_3E61; + } + else + { + if (Main.tile[num48, num49].frameX < 66) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if (b != 22) + { + switch (b) + { + case 26: + case 31: + { + float num82 = (float)Main.rand.Next(-5, 6) * 0.01f; + if (Lighting.color2[num50, num51] < 0.4f + num82) + { + Lighting.color2[num50, num51] = 0.4f + num82; + goto IL_42F9; + } + goto IL_42F9; + } + case 27: + case 28: + case 29: + case 30: + case 32: + goto IL_42F9; + case 33: + if (Main.tile[num48, num49].frameX == 0) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + case 34: + case 35: + case 36: + break; + case 37: + if (Lighting.color2[num50, num51] < 0.5f) + { + Lighting.color2[num50, num51] = 0.5f; + goto IL_42F9; + } + goto IL_42F9; + default: + if (b != 42) + { + goto IL_42F9; + } + if (Main.tile[num48, num49].frameX == 0) + { + Lighting.color2[num50, num51] = 0.75f; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if (Lighting.color2[num50, num51] < 0.2f) + { + Lighting.color2[num50, num51] = 0.2f; + goto IL_42F9; + } + goto IL_42F9; + } + } + } + else + { + if (b <= 61) + { + if (b != 49) + { + if (b != 61) + { + goto IL_42F9; + } + if (Main.tile[num48, num49].frameX == 144 && Lighting.color2[num50, num51] < 0.75f) + { + Lighting.color2[num50, num51] = 0.75f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Lighting.color2[num50, num51] < 0.1f) + { + Lighting.color2[num50, num51] = 0.7f; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + switch (b) + { + case 70: + case 71: + case 72: + goto IL_4000; + default: + if (b != 77) + { + if (b != 84) + { + goto IL_42F9; + } + int num83 = (int)(Main.tile[num48, num49].frameX / 18); + float num84 = 0f; + if (num83 == 2) + { + float num85 = (float)(270 - (int)Main.mouseTextColor); + num85 /= 500f; + if (num85 > 1f) + { + num85 = 1f; + } + if (num85 < 0f) + { + num85 = 0f; + } + num84 = num85; + } + else + { + if (num83 == 5) + { + num84 = 0.7f; + } + } + if (Lighting.color2[num50, num51] < num84) + { + Lighting.color2[num50, num51] = num84; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Lighting.color2[num50, num51] < 0.6f) + { + Lighting.color2[num50, num51] = 0.6f; + goto IL_42F9; + } + goto IL_42F9; + } + break; + } + } + } + } + else + { + if (b <= 160) + { + if (b <= 129) + { + switch (b) + { + case 92: + if (Main.tile[num48, num49].frameY <= 18 && Main.tile[num48, num49].frameX == 0) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + case 93: + if (Main.tile[num48, num49].frameY == 0 && Main.tile[num48, num49].frameX == 0) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + case 94: + case 96: + case 97: + case 99: + goto IL_42F9; + case 95: + if (Main.tile[num48, num49].frameX < 36 && Lighting.color2[num50, num51] < 0.85f) + { + Lighting.color2[num50, num51] = 0.9f; + goto IL_42F9; + } + goto IL_42F9; + case 98: + if (Main.tile[num48, num49].frameY == 0) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + case 100: + if (Main.tile[num48, num49].frameX < 36) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + default: + switch (b) + { + case 125: + { + float num86 = (float)Main.rand.Next(28, 42) * 0.007f; + num86 += (float)(270 - (int)Main.mouseTextColor) / 900f; + if ((double)Lighting.color2[num50, num51] < 0.5 * (double)num86) + { + Lighting.color2[num50, num51] = 0.3f * num86; + goto IL_42F9; + } + goto IL_42F9; + } + case 126: + if (Main.tile[num48, num49].frameX < 36 && Lighting.color2[num50, num51] < 0.3f) + { + Lighting.color2[num50, num51] = 0.3f; + goto IL_42F9; + } + goto IL_42F9; + case 127: + case 128: + goto IL_42F9; + case 129: + { + float num87 = 0.08f; + if (Lighting.color2[num50, num51] < num87) + { + Lighting.color2[num50, num51] = num87 * (float)Main.rand.Next(970, 1031) * 0.001f; + goto IL_42F9; + } + goto IL_42F9; + } + default: + goto IL_42F9; + } + break; + } + } + else + { + if (b == 133) + { + goto IL_3E61; + } + if (b != 149) + { + if (b != 160) + { + goto IL_42F9; + } + if (Lighting.color2[num50, num51] < 15f) + { + Lighting.color2[num50, num51] = 0.1f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + if (Main.tile[num48, num49].frameX > 36) + { + goto IL_42F9; + } + float num87 = 0.4f; + if (Lighting.color2[num50, num51] < num87) + { + Lighting.color2[num50, num51] = num87 * (float)Main.rand.Next(970, 1031) * 0.001f; + goto IL_42F9; + } + goto IL_42F9; + } + } + } + else + { + if (b <= 190) + { + switch (b) + { + case 170: + case 171: + case 172: + break; + default: + if (b != 190) + { + goto IL_42F9; + } + goto IL_4000; + } + } + else + { + if (b != 204) + { + if (b != 215) + { + if (b == 237 && (double)Lighting.color2[num50, num51] < 0.1) + { + Lighting.color2[num50, num51] = 0.1f; + goto IL_42F9; + } + goto IL_42F9; + } + else + { + float num88 = (float)Main.rand.Next(28, 42) * 0.005f; + num88 += (float)(270 - (int)Main.mouseTextColor) / 700f; + if ((double)Lighting.color2[num50, num51] < 0.9 + (double)num88) + { + Lighting.color2[num50, num51] = 0.9f + num88; + goto IL_42F9; + } + goto IL_42F9; + } + } + else + { + if ((double)Lighting.color2[num50, num51] < 0.2) + { + Lighting.color2[num50, num51] = 0.2f; + goto IL_42F9; + } + goto IL_42F9; + } + } + } + } + if (Main.tile[num48, num49].frameX < 54) + { + Lighting.color2[num50, num51] = 1f; + goto IL_42F9; + } + goto IL_42F9; + IL_3E61: + if (Lighting.color2[num50, num51] < 0.75f) + { + Lighting.color2[num50, num51] = 0.75f; + goto IL_42F9; + } + goto IL_42F9; + IL_4000: + float num89 = (float)Main.rand.Next(38, 43) * 0.01f; + if (Lighting.color2[num50, num51] < num89) + { + Lighting.color2[num50, num51] = num89; + } + } + } + } + IL_42F9: + if (Main.tile[num48, num49].lava() && Main.tile[num48, num49].liquid > 0) + { + if (Lighting.RGB) + { + float num90 = (float)(Main.tile[num48, num49].liquid / 255) * 0.41f + 0.14f; + num90 = 0.55f; + num90 += (float)(270 - (int)Main.mouseTextColor) / 900f; + if (Lighting.color2[num50, num51] < num90) + { + Lighting.color2[num50, num51] = num90; + } + if (Lighting.colorG2[num50, num51] < num90) + { + Lighting.colorG2[num50, num51] = num90 * 0.6f; + } + if (Lighting.colorB2[num50, num51] < num90) + { + Lighting.colorB2[num50, num51] = num90 * 0.2f; + } + } + else + { + float num91 = (float)(Main.tile[num48, num49].liquid / 255) * 0.38f + 0.08f; + num91 += (float)(270 - (int)Main.mouseTextColor) / 2000f; + if (Lighting.color2[num50, num51] < num91) + { + Lighting.color2[num50, num51] = num91; + } + } + } + else + { + if (Main.tile[num48, num49].liquid > 128) + { + Lighting.wetLight[num50, num51] = true; + if (Main.tile[num48, num49].honey()) + { + Lighting.honeyLight[num50, num51] = true; + } + } + } + if (Lighting.RGB) + { + if (Lighting.color2[num50, num51] > 0f || Lighting.colorG2[num50, num51] > 0f || Lighting.colorB2[num50, num51] > 0f) + { + if (Lighting.minX > num50) + { + Lighting.minX = num50; + } + if (Lighting.maxX < num50 + 1) + { + Lighting.maxX = num50 + 1; + } + if (Lighting.minY > num51) + { + Lighting.minY = num51; + } + if (Lighting.maxY < num51 + 1) + { + Lighting.maxY = num51 + 1; + } + } + } + else + { + if (Lighting.color2[num50, num51] > 0f) + { + if (Lighting.minX > num50) + { + Lighting.minX = num50; + } + if (Lighting.maxX < num50 + 1) + { + Lighting.maxX = num50 + 1; + } + if (Lighting.minY > num51) + { + Lighting.minY = num51; + } + if (Lighting.maxY < num51 + 1) + { + Lighting.maxY = num51 + 1; + } + } + } + } + } + if (Main.holyTiles < 0) + { + Main.holyTiles = 0; + } + if (Main.evilTiles < 0) + { + Main.evilTiles = 0; + } + int holyTiles = Main.holyTiles; + Main.holyTiles -= Main.evilTiles; + Main.evilTiles -= holyTiles; + if (Main.holyTiles < 0) + { + Main.holyTiles = 0; + } + if (Main.evilTiles < 0) + { + Main.evilTiles = 0; + } + Lighting.minX += Lighting.firstToLightX; + Lighting.maxX += Lighting.firstToLightX; + Lighting.minY += Lighting.firstToLightY; + Lighting.maxY += Lighting.firstToLightY; + Lighting.minX7 = Lighting.minX; + Lighting.maxX7 = Lighting.maxX; + Lighting.minY7 = Lighting.minY; + Lighting.maxY7 = Lighting.maxY; + Lighting.firstTileX7 = Lighting.firstTileX; + Lighting.lastTileX7 = Lighting.lastTileX; + Lighting.lastTileY7 = Lighting.lastTileY; + Lighting.firstTileY7 = Lighting.firstTileY; + Lighting.firstToLightX7 = Lighting.firstToLightX; + Lighting.lastToLightX7 = Lighting.lastToLightX; + Lighting.firstToLightY7 = Lighting.firstToLightY; + Lighting.lastToLightY7 = Lighting.lastToLightY; + Lighting.firstToLightX27 = num; + Lighting.lastToLightX27 = num3; + Lighting.firstToLightY27 = num2; + Lighting.lastToLightY27 = num4; + Lighting.scrX = (int)Main.screenPosition.X / 16; + Lighting.scrY = (int)Main.screenPosition.Y / 16; + Main.renderCount = 0; + Main.lightTimer[0] = (float)stopwatch.ElapsedMilliseconds; + Lighting.doColors(); + } + public static void doColors() + { + Stopwatch stopwatch = new Stopwatch(); + if (Lighting.lightMode < 2) + { + Lighting.blueWave += (float)Lighting.blueDir * 0.0001f; + if (Lighting.blueWave > 1f) + { + Lighting.blueWave = 1f; + Lighting.blueDir = -1; + } + else + { + if (Lighting.blueWave < 0.97f) + { + Lighting.blueWave = 0.97f; + Lighting.blueDir = 1; + } + } + if (Lighting.RGB) + { + Lighting.negLight = 0.91f; + Lighting.negLight2 = 0.56f; + Lighting.honeyLightG = 0.7f * Lighting.negLight * Lighting.blueWave; + Lighting.honeyLightR = 0.75f * Lighting.negLight * Lighting.blueWave; + Lighting.honeyLightB = 0.6f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightG = 0.96f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.88f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.015f * Lighting.negLight * Lighting.blueWave; + if (Main.waterStyle == 2) + { + Lighting.wetLightG = 0.85f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.94f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.01f * Lighting.negLight * Lighting.blueWave; + } + else + { + if (Main.waterStyle == 3) + { + Lighting.wetLightG = 0.95f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.84f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.015f * Lighting.negLight * Lighting.blueWave; + } + else + { + if (Main.waterStyle == 4) + { + Lighting.wetLightG = 0.86f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.9f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.01f * Lighting.negLight * Lighting.blueWave; + } + else + { + if (Main.waterStyle == 5) + { + Lighting.wetLightG = 0.99f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.84f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.01f * Lighting.negLight * Lighting.blueWave; + } + else + { + if (Main.waterStyle == 6) + { + Lighting.wetLightG = 0.98f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.95f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 0.85f * Lighting.negLight * Lighting.blueWave; + } + else + { + if (Main.waterStyle == 9) + { + Lighting.wetLightG = 0.88f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 1f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 0.84f * Lighting.negLight * Lighting.blueWave; + } + else + { + if (Main.waterStyle == 10) + { + Lighting.wetLightG = 1f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.83f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1f * Lighting.negLight * Lighting.blueWave; + } + } + } + } + } + } + } + } + else + { + Lighting.negLight = 0.9f; + Lighting.negLight2 = 0.54f; + Lighting.wetLightR = 0.95f * Lighting.negLight * Lighting.blueWave; + } + if (Main.player[Main.myPlayer].nightVision) + { + Lighting.negLight *= 1.03f; + Lighting.negLight2 *= 1.03f; + } + if (Main.player[Main.myPlayer].blind) + { + Lighting.negLight *= 0.95f; + Lighting.negLight2 *= 0.95f; + } + if (Main.player[Main.myPlayer].blackout) + { + Lighting.negLight *= 0.85f; + Lighting.negLight2 *= 0.85f; + } + if (Lighting.RGB) + { + if (Main.renderCount == 0) + { + stopwatch.Restart(); + for (int i = Lighting.minX7; i < Lighting.maxX7; i++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int j = Lighting.minY7; j < Lighting.lastToLightY27 + Lighting.maxRenderCount; j++) + { + Lighting.LightColor(i, j); + Lighting.LightColorG(i, j); + Lighting.LightColorB(i, j); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int k = Lighting.maxY7; k >= Lighting.firstTileY7 - Lighting.maxRenderCount; k--) + { + Lighting.LightColor(i, k); + Lighting.LightColorG(i, k); + Lighting.LightColorB(i, k); + } + } + Main.lightTimer[1] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int l = Lighting.firstToLightY7; l < Lighting.lastToLightY7; l++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int m = Lighting.minX7; m < Lighting.lastTileX7 + Lighting.maxRenderCount; m++) + { + Lighting.LightColor(m, l); + Lighting.LightColorG(m, l); + Lighting.LightColorB(m, l); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int n = Lighting.maxX7; n >= Lighting.firstTileX7 - Lighting.maxRenderCount; n--) + { + Lighting.LightColor(n, l); + Lighting.LightColorG(n, l); + Lighting.LightColorB(n, l); + } + } + Main.lightTimer[2] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num = Lighting.firstToLightX27; num < Lighting.lastToLightX27; num++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num2 = Lighting.firstToLightY27; num2 < Lighting.lastTileY7 + Lighting.maxRenderCount; num2++) + { + Lighting.LightColor(num, num2); + Lighting.LightColorG(num, num2); + Lighting.LightColorB(num, num2); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num3 = Lighting.lastToLightY27; num3 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num3--) + { + Lighting.LightColor(num, num3); + Lighting.LightColorG(num, num3); + Lighting.LightColorB(num, num3); + } + } + Main.lightTimer[3] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 2) + { + stopwatch.Restart(); + for (int num4 = Lighting.firstToLightY27; num4 < Lighting.lastToLightY27; num4++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num5 = Lighting.firstToLightX27; num5 < Lighting.lastTileX7 + Lighting.maxRenderCount; num5++) + { + Lighting.LightColor(num5, num4); + Lighting.LightColorG(num5, num4); + Lighting.LightColorB(num5, num4); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num6 = Lighting.lastToLightX27; num6 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num6--) + { + Lighting.LightColor(num6, num4); + Lighting.LightColorG(num6, num4); + Lighting.LightColorB(num6, num4); + } + } + Main.lightTimer[4] = (float)stopwatch.ElapsedMilliseconds; + return; + } + } + else + { + if (Main.renderCount == 0) + { + stopwatch.Restart(); + for (int num7 = Lighting.minX7; num7 < Lighting.maxX7; num7++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num8 = Lighting.minY7; num8 < Lighting.lastToLightY27 + Lighting.maxRenderCount; num8++) + { + Lighting.LightColor(num7, num8); + } + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num9 = Lighting.maxY7; num9 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num9--) + { + Lighting.LightColor(num7, num9); + } + } + Main.lightTimer[1] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num10 = Lighting.firstToLightY7; num10 < Lighting.lastToLightY7; num10++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num11 = Lighting.minX7; num11 < Lighting.lastTileX7 + Lighting.maxRenderCount; num11++) + { + Lighting.LightColor(num11, num10); + } + Lighting.lightColor = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num12 = Lighting.maxX7; num12 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num12--) + { + Lighting.LightColor(num12, num10); + } + } + Main.lightTimer[2] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num13 = Lighting.firstToLightX27; num13 < Lighting.lastToLightX27; num13++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num14 = Lighting.firstToLightY27; num14 < Lighting.lastTileY7 + Lighting.maxRenderCount; num14++) + { + Lighting.LightColor(num13, num14); + } + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num15 = Lighting.lastToLightY27; num15 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num15--) + { + Lighting.LightColor(num13, num15); + } + } + Main.lightTimer[3] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 2) + { + stopwatch.Restart(); + for (int num16 = Lighting.firstToLightY27; num16 < Lighting.lastToLightY27; num16++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num17 = Lighting.firstToLightX27; num17 < Lighting.lastTileX7 + Lighting.maxRenderCount; num17++) + { + Lighting.LightColor(num17, num16); + } + Lighting.lightColor = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num18 = Lighting.lastToLightX27; num18 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num18--) + { + Lighting.LightColor(num18, num16); + } + } + Main.lightTimer[4] = (float)stopwatch.ElapsedMilliseconds; + return; + } + } + } + else + { + Lighting.negLight = 0.04f; + Lighting.negLight2 = 0.16f; + if (Main.player[Main.myPlayer].nightVision) + { + Lighting.negLight -= 0.013f; + Lighting.negLight2 -= 0.04f; + } + if (Main.player[Main.myPlayer].blind) + { + Lighting.negLight += 0.03f; + Lighting.negLight2 += 0.06f; + } + if (Main.player[Main.myPlayer].blackout) + { + Lighting.negLight += 0.09f; + Lighting.negLight2 += 0.18f; + } + Lighting.wetLightR = Lighting.negLight * 1.2f; + Lighting.wetLightG = Lighting.negLight * 1.1f; + if (Lighting.RGB) + { + if (Main.renderCount == 0) + { + stopwatch.Restart(); + for (int num19 = Lighting.minX7; num19 < Lighting.maxX7; num19++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num20 = Lighting.minY7; num20 < Lighting.lastToLightY27 + Lighting.maxRenderCount; num20++) + { + Lighting.LightColor2(num19, num20); + Lighting.LightColorG2(num19, num20); + Lighting.LightColorB2(num19, num20); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num21 = Lighting.maxY7; num21 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num21--) + { + Lighting.LightColor2(num19, num21); + Lighting.LightColorG2(num19, num21); + Lighting.LightColorB2(num19, num21); + } + } + Main.lightTimer[1] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num22 = Lighting.firstToLightY7; num22 < Lighting.lastToLightY7; num22++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num23 = Lighting.minX7; num23 < Lighting.lastTileX7 + Lighting.maxRenderCount; num23++) + { + Lighting.LightColor2(num23, num22); + Lighting.LightColorG2(num23, num22); + Lighting.LightColorB2(num23, num22); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num24 = Lighting.maxX7; num24 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num24--) + { + Lighting.LightColor2(num24, num22); + Lighting.LightColorG2(num24, num22); + Lighting.LightColorB2(num24, num22); + } + } + Main.lightTimer[2] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num25 = Lighting.firstToLightX27; num25 < Lighting.lastToLightX27; num25++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num26 = Lighting.firstToLightY27; num26 < Lighting.lastTileY7 + Lighting.maxRenderCount; num26++) + { + Lighting.LightColor2(num25, num26); + Lighting.LightColorG2(num25, num26); + Lighting.LightColorB2(num25, num26); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num27 = Lighting.lastToLightY27; num27 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num27--) + { + Lighting.LightColor2(num25, num27); + Lighting.LightColorG2(num25, num27); + Lighting.LightColorB2(num25, num27); + } + } + Main.lightTimer[3] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 2) + { + stopwatch.Restart(); + for (int num28 = Lighting.firstToLightY27; num28 < Lighting.lastToLightY27; num28++) + { + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num29 = Lighting.firstToLightX27; num29 < Lighting.lastTileX7 + Lighting.maxRenderCount; num29++) + { + Lighting.LightColor2(num29, num28); + Lighting.LightColorG2(num29, num28); + Lighting.LightColorB2(num29, num28); + } + Lighting.lightColor = 0f; + Lighting.lightColorG = 0f; + Lighting.lightColorB = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num30 = Lighting.lastToLightX27; num30 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num30--) + { + Lighting.LightColor2(num30, num28); + Lighting.LightColorG2(num30, num28); + Lighting.LightColorB2(num30, num28); + } + } + Main.lightTimer[4] = (float)stopwatch.ElapsedMilliseconds; + return; + } + } + else + { + if (Main.renderCount == 0) + { + stopwatch.Restart(); + for (int num31 = Lighting.minX7; num31 < Lighting.maxX7; num31++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num32 = Lighting.minY7; num32 < Lighting.lastToLightY27 + Lighting.maxRenderCount; num32++) + { + Lighting.LightColor2(num31, num32); + } + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num33 = Lighting.maxY7; num33 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num33--) + { + Lighting.LightColor2(num31, num33); + } + } + Main.lightTimer[1] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num34 = Lighting.firstToLightY7; num34 < Lighting.lastToLightY7; num34++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num35 = Lighting.minX7; num35 < Lighting.lastTileX7 + Lighting.maxRenderCount; num35++) + { + Lighting.LightColor2(num35, num34); + } + Lighting.lightColor = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num36 = Lighting.maxX7; num36 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num36--) + { + Lighting.LightColor2(num36, num34); + } + } + Main.lightTimer[2] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 1) + { + stopwatch.Restart(); + for (int num37 = Lighting.firstToLightX27; num37 < Lighting.lastToLightX27; num37++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = 1; + for (int num38 = Lighting.firstToLightY27; num38 < Lighting.lastTileY7 + Lighting.maxRenderCount; num38++) + { + Lighting.LightColor2(num37, num38); + } + Lighting.lightColor = 0f; + Lighting.dirX = 0; + Lighting.dirY = -1; + for (int num39 = Lighting.lastToLightY27; num39 >= Lighting.firstTileY7 - Lighting.maxRenderCount; num39--) + { + Lighting.LightColor2(num37, num39); + } + } + Main.lightTimer[3] = (float)stopwatch.ElapsedMilliseconds; + } + if (Main.renderCount == 2) + { + stopwatch.Restart(); + for (int num40 = Lighting.firstToLightY27; num40 < Lighting.lastToLightY27; num40++) + { + Lighting.lightColor = 0f; + Lighting.dirX = 1; + Lighting.dirY = 0; + for (int num41 = Lighting.firstToLightX27; num41 < Lighting.lastTileX7 + Lighting.maxRenderCount; num41++) + { + Lighting.LightColor2(num41, num40); + } + Lighting.lightColor = 0f; + Lighting.dirX = -1; + Lighting.dirY = 0; + for (int num42 = Lighting.lastToLightX27; num42 >= Lighting.firstTileX7 - Lighting.maxRenderCount; num42--) + { + Lighting.LightColor2(num42, num40); + } + } + Main.lightTimer[4] = (float)stopwatch.ElapsedMilliseconds; + } + } + } + } + public static void addLight(int i, int j, float Lightness) + { + if (Main.netMode == 2) + { + return; + } + if (i - Lighting.firstTileX + Lighting.offScreenTiles >= 0 && i - Lighting.firstTileX + Lighting.offScreenTiles < Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 && j - Lighting.firstTileY + Lighting.offScreenTiles >= 0 && j - Lighting.firstTileY + Lighting.offScreenTiles < Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + if (Lighting.tempLightCount == Lighting.maxTempLights) + { + return; + } + if (!Lighting.RGB) + { + for (int k = 0; k < Lighting.tempLightCount; k++) + { + if (Lighting.tempLightX[k] == i && Lighting.tempLightY[k] == j && Lightness <= Lighting.tempLight[k]) + { + return; + } + } + Lighting.tempLightX[Lighting.tempLightCount] = i; + Lighting.tempLightY[Lighting.tempLightCount] = j; + Lighting.tempLight[Lighting.tempLightCount] = Lightness; + Lighting.tempLightG[Lighting.tempLightCount] = Lightness; + Lighting.tempLightB[Lighting.tempLightCount] = Lightness; + Lighting.tempLightCount++; + return; + } + Lighting.tempLight[Lighting.tempLightCount] = Lightness; + Lighting.tempLightG[Lighting.tempLightCount] = Lightness; + Lighting.tempLightB[Lighting.tempLightCount] = Lightness; + Lighting.tempLightX[Lighting.tempLightCount] = i; + Lighting.tempLightY[Lighting.tempLightCount] = j; + Lighting.tempLightCount++; + } + } + public static void addLight(int i, int j, float R, float G, float B) + { + if (Main.netMode == 2) + { + return; + } + if (!Lighting.RGB) + { + Lighting.addLight(i, j, (R + G + B) / 3f); + } + if (i - Lighting.firstTileX + Lighting.offScreenTiles >= 0 && i - Lighting.firstTileX + Lighting.offScreenTiles < Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 && j - Lighting.firstTileY + Lighting.offScreenTiles >= 0 && j - Lighting.firstTileY + Lighting.offScreenTiles < Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + if (Lighting.tempLightCount == Lighting.maxTempLights) + { + return; + } + for (int k = 0; k < Lighting.tempLightCount; k++) + { + if (Lighting.tempLightX[k] == i && Lighting.tempLightY[k] == j) + { + if (Lighting.tempLight[k] < R) + { + Lighting.tempLight[k] = R; + } + if (Lighting.tempLightG[k] < G) + { + Lighting.tempLightG[k] = G; + } + if (Lighting.tempLightB[k] < B) + { + Lighting.tempLightB[k] = B; + } + return; + } + } + Lighting.tempLight[Lighting.tempLightCount] = R; + Lighting.tempLightG[Lighting.tempLightCount] = G; + Lighting.tempLightB[Lighting.tempLightCount] = B; + Lighting.tempLightX[Lighting.tempLightCount] = i; + Lighting.tempLightY[Lighting.tempLightCount] = j; + Lighting.tempLightCount++; + } + } + public static void BlackOut() + { + int num = Main.screenWidth / 16 + Lighting.offScreenTiles * 2; + int num2 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2; + for (int i = 0; i < num; i++) + { + for (int j = 0; j < num2; j++) + { + Lighting.color[i, j] = 0f; + Lighting.colorG[i, j] = 0f; + Lighting.colorB[i, j] = 0f; + } + } + } + private static void ResetRange() + { + Lighting.minX = Main.screenWidth + Lighting.offScreenTiles * 2 + 10; + Lighting.maxX = 0; + Lighting.minY = Main.screenHeight + Lighting.offScreenTiles * 2 + 10; + Lighting.maxY = 0; + } + private static void LightColor(int i, int j) + { + int num = i - Lighting.firstToLightX7; + int num2 = j - Lighting.firstToLightY7; + if (Lighting.color2[num, num2] > Lighting.lightColor) + { + Lighting.lightColor = Lighting.color2[num, num2]; + } + else + { + if ((double)Lighting.lightColor <= 0.0185) + { + return; + } + if (Lighting.color2[num, num2] < Lighting.lightColor) + { + Lighting.color2[num, num2] = Lighting.lightColor; + } + } + if (Lighting.color2[num + Lighting.dirX, num2 + Lighting.dirY] > Lighting.lightColor) + { + return; + } + if (Lighting.stopLight[num, num2]) + { + Lighting.lightColor *= Lighting.negLight2; + return; + } + if (!Lighting.wetLight[num, num2]) + { + Lighting.lightColor *= Lighting.negLight; + return; + } + if (Lighting.honeyLight[num, num2]) + { + Lighting.lightColor *= Lighting.honeyLightR * (float)Main.rand.Next(98, 100) * 0.01f; + return; + } + Lighting.lightColor *= Lighting.wetLightR * (float)Main.rand.Next(98, 100) * 0.01f; + } + private static void LightColorG(int i, int j) + { + int num = i - Lighting.firstToLightX7; + int num2 = j - Lighting.firstToLightY7; + if (Lighting.colorG2[num, num2] > Lighting.lightColorG) + { + Lighting.lightColorG = Lighting.colorG2[num, num2]; + } + else + { + if ((double)Lighting.lightColorG <= 0.0185) + { + return; + } + Lighting.colorG2[num, num2] = Lighting.lightColorG; + } + if (Lighting.colorG2[num + Lighting.dirX, num2 + Lighting.dirY] > Lighting.lightColorG) + { + return; + } + if (Lighting.stopLight[num, num2]) + { + Lighting.lightColorG *= Lighting.negLight2; + return; + } + if (!Lighting.wetLight[num, num2]) + { + Lighting.lightColorG *= Lighting.negLight; + return; + } + if (Lighting.honeyLight[num, num2]) + { + Lighting.lightColorG *= Lighting.honeyLightG * (float)Main.rand.Next(97, 100) * 0.01f; + return; + } + Lighting.lightColorG *= Lighting.wetLightG * (float)Main.rand.Next(97, 100) * 0.01f; + } + private static void LightColorB(int i, int j) + { + int num = i - Lighting.firstToLightX7; + int num2 = j - Lighting.firstToLightY7; + if (Lighting.colorB2[num, num2] > Lighting.lightColorB) + { + Lighting.lightColorB = Lighting.colorB2[num, num2]; + } + else + { + if ((double)Lighting.lightColorB <= 0.0185) + { + return; + } + Lighting.colorB2[num, num2] = Lighting.lightColorB; + } + if (Lighting.colorB2[num + Lighting.dirX, num2 + Lighting.dirY] >= Lighting.lightColorB) + { + return; + } + if (Lighting.stopLight[num, num2]) + { + Lighting.lightColorB *= Lighting.negLight2; + return; + } + if (!Lighting.wetLight[num, num2]) + { + Lighting.lightColorB *= Lighting.negLight; + return; + } + if (Lighting.honeyLight[num, num2]) + { + Lighting.lightColorB *= Lighting.honeyLightB * (float)Main.rand.Next(97, 100) * 0.01f; + return; + } + Lighting.lightColorB *= Lighting.wetLightB * (float)Main.rand.Next(97, 100) * 0.01f; + } + private static void LightColor2(int i, int j) + { + int num = i - Lighting.firstToLightX7; + int num2 = j - Lighting.firstToLightY7; + try + { + if (Lighting.color2[num, num2] > Lighting.lightColor) + { + Lighting.lightColor = Lighting.color2[num, num2]; + } + else + { + if (Lighting.lightColor <= 0f) + { + return; + } + Lighting.color2[num, num2] = Lighting.lightColor; + } + if (Main.tile[i, j].active() && Main.tileBlockLight[(int)Main.tile[i, j].type]) + { + Lighting.lightColor -= Lighting.negLight2; + } + else + { + if (Lighting.wetLight[num, num2]) + { + Lighting.lightColor -= Lighting.wetLightR; + } + else + { + Lighting.lightColor -= Lighting.negLight; + } + } + } + catch + { + } + } + private static void LightColorG2(int i, int j) + { + int num = i - Lighting.firstToLightX7; + int num2 = j - Lighting.firstToLightY7; + try + { + if (Lighting.colorG2[num, num2] > Lighting.lightColorG) + { + Lighting.lightColorG = Lighting.colorG2[num, num2]; + } + else + { + if (Lighting.lightColorG <= 0f) + { + return; + } + Lighting.colorG2[num, num2] = Lighting.lightColorG; + } + if (Main.tile[i, j].active() && Main.tileBlockLight[(int)Main.tile[i, j].type]) + { + Lighting.lightColorG -= Lighting.negLight2; + } + else + { + if (Lighting.wetLight[num, num2]) + { + Lighting.lightColorG -= Lighting.wetLightG; + } + else + { + Lighting.lightColorG -= Lighting.negLight; + } + } + } + catch + { + } + } + private static void LightColorB2(int i, int j) + { + int num = i - Lighting.firstToLightX7; + int num2 = j - Lighting.firstToLightY7; + try + { + if (Lighting.colorB2[num, num2] > Lighting.lightColorB) + { + Lighting.lightColorB = Lighting.colorB2[num, num2]; + } + else + { + if (Lighting.lightColorB <= 0f) + { + return; + } + Lighting.colorB2[num, num2] = Lighting.lightColorB; + } + if (Main.tile[i, j].active() && Main.tileBlockLight[(int)Main.tile[i, j].type]) + { + Lighting.lightColorB -= Lighting.negLight2; + } + else + { + Lighting.lightColorB -= Lighting.negLight; + } + } + catch + { + } + } + public static int LightingX(int lightX) + { + if (lightX < 0) + { + return 0; + } + if (lightX >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10) + { + return Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 - 1; + } + return lightX; + } + public static int LightingY(int lightY) + { + if (lightY < 0) + { + return 0; + } + if (lightY >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + return Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10 - 1; + } + return lightY; + } + public static Color GetColor(int x, int y, Color oldColor) + { + int num = x - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (Main.gameMenu) + { + return oldColor; + } + if (num < 0 || num2 < 0 || num >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || num2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + return Color.Black; + } + Color white = Color.White; + int num3 = (int)((float)oldColor.R * Lighting.color[num, num2] * Lighting.brightness); + int num4 = (int)((float)oldColor.G * Lighting.colorG[num, num2] * Lighting.brightness); + int num5 = (int)((float)oldColor.B * Lighting.colorB[num, num2] * Lighting.brightness); + if (num3 > 255) + { + num3 = 255; + } + if (num4 > 255) + { + num4 = 255; + } + if (num5 > 255) + { + num5 = 255; + } + white.R = (byte)num3; + white.G = (byte)num4; + white.B = (byte)num5; + return white; + } + public static Color GetColor(int x, int y) + { + int num = x - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (num < 0 || num2 < 0 || num >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || num2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2) + { + return Color.Black; + } + int num3 = (int)(255f * Lighting.color[num, num2] * Lighting.brightness); + int num4 = (int)(255f * Lighting.colorG[num, num2] * Lighting.brightness); + int num5 = (int)(255f * Lighting.colorB[num, num2] * Lighting.brightness); + if (num3 > 255) + { + num3 = 255; + } + if (num4 > 255) + { + num4 = 255; + } + if (num5 > 255) + { + num5 = 255; + } + Color result = new Color((int)((byte)num3), (int)((byte)num4), (int)((byte)num5), 255); + return result; + } + public static Color GetBlackness(int x, int y) + { + int num = x - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (num < 0 || num2 < 0 || num >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || num2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + return Color.Black; + } + Color result = new Color(0, 0, 0, (int)((byte)(255f - 255f * Lighting.color[num, num2]))); + return result; + } + public static float Brightness(int x, int y) + { + int num = x - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (num < 0 || num2 < 0 || num >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || num2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + return 0f; + } + return (Lighting.color[num, num2] + Lighting.colorG[num, num2] + Lighting.colorB[num, num2]) / 3f; + } + public static bool Brighter(int x, int y, int x2, int y2) + { + int num = x - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + int num3 = x2 - Lighting.firstTileX + Lighting.offScreenTiles; + int num4 = y2 - Lighting.firstTileY + Lighting.offScreenTiles; + bool result; + try + { + if (Lighting.color[num, num2] + Lighting.colorG[num, num2] + Lighting.colorB[num, num2] >= Lighting.color[num3, num4] + Lighting.colorG[num3, num4] + Lighting.colorB[num3, num4]) + { + result = true; + } + else + { + result = false; + } + } + catch + { + result = false; + } + return result; + } + } +} diff --git a/Terraria/Liquid.cs b/Terraria/Liquid.cs new file mode 100644 index 0000000..fae0b5c --- /dev/null +++ b/Terraria/Liquid.cs @@ -0,0 +1,1357 @@ +using System; +namespace Terraria +{ + public class Liquid + { + public static int skipCount = 0; + public static int stuckCount = 0; + public static int stuckAmount = 0; + public static int cycles = 10; + public static int resLiquid = 5000; + public static int maxLiquid = 5000; + public static int numLiquid; + public static bool stuck = false; + public static bool quickFall = false; + public static bool quickSettle = false; + private static int wetCounter; + public static int panicCounter = 0; + public static bool panicMode = false; + public static int panicY = 0; + public int x; + public int y; + public int kill; + public int delay; + public static double QuickWater(int verbose = 0, int minY = -1, int maxY = -1) + { + int num = 0; + if (minY == -1) + { + minY = 3; + } + if (maxY == -1) + { + maxY = Main.maxTilesY - 3; + } + for (int i = maxY; i >= minY; i--) + { + if (verbose > 0) + { + float num2 = (float)(maxY - i) / (float)(maxY - minY + 1); + num2 /= (float)verbose; + Main.statusText = string.Concat(new object[] + { + Lang.gen[27], + " ", + (int)(num2 * 100f + 1f), + "%" + }); + } + else + { + if (verbose < 0) + { + float num3 = (float)(maxY - i) / (float)(maxY - minY + 1); + num3 /= (float)(-(float)verbose); + Main.statusText = string.Concat(new object[] + { + Lang.gen[18], + " ", + (int)(num3 * 100f + 1f), + "%" + }); + } + } + for (int j = 0; j < 2; j++) + { + int num4 = 2; + int num5 = Main.maxTilesX - 2; + int num6 = 1; + if (j == 1) + { + num4 = Main.maxTilesX - 2; + num5 = 2; + num6 = -1; + } + for (int num7 = num4; num7 != num5; num7 += num6) + { + if (Main.tile[num7, i].liquid > 0) + { + int num8 = -num6; + bool flag = false; + int num9 = num7; + int num10 = i; + byte b = Main.tile[num7, i].liquidType(); + bool flag2 = Main.tile[num7, i].lava(); + bool flag3 = Main.tile[num7, i].honey(); + byte b2 = Main.tile[num7, i].liquid; + Main.tile[num7, i].liquid = 0; + bool flag4 = true; + int num11 = 0; + while (flag4 && num9 > 3 && num9 < Main.maxTilesX - 3 && num10 < Main.maxTilesY - 3) + { + flag4 = false; + while (Main.tile[num9, num10 + 1].liquid == 0 && num10 < Main.maxTilesY - 5 && (!Main.tile[num9, num10 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num9, num10 + 1].type] || Main.tileSolidTop[(int)Main.tile[num9, num10 + 1].type])) + { + flag = true; + num8 = num6; + num11 = 0; + flag4 = true; + num10++; + if (num10 > WorldGen.waterLine && WorldGen.gen && !flag3) + { + b = 1; + } + } + if (Main.tile[num9, num10 + 1].liquid > 0 && Main.tile[num9, num10 + 1].liquid < 255 && Main.tile[num9, num10 + 1].liquidType() == b) + { + int num12 = (int)(255 - Main.tile[num9, num10 + 1].liquid); + if (num12 > (int)b2) + { + num12 = (int)b2; + } + Tile expr_2D1 = Main.tile[num9, num10 + 1]; + expr_2D1.liquid += (byte)num12; + b2 -= (byte)num12; + if (b2 <= 0) + { + num++; + break; + } + } + if (num11 == 0) + { + if (Main.tile[num9 + num8, num10].liquid == 0 && (!Main.tile[num9 + num8, num10].nactive() || !Main.tileSolid[(int)Main.tile[num9 + num8, num10].type] || Main.tileSolidTop[(int)Main.tile[num9 + num8, num10].type])) + { + num11 = num8; + } + else + { + if (Main.tile[num9 - num8, num10].liquid == 0 && (!Main.tile[num9 - num8, num10].nactive() || !Main.tileSolid[(int)Main.tile[num9 - num8, num10].type] || Main.tileSolidTop[(int)Main.tile[num9 - num8, num10].type])) + { + num11 = -num8; + } + } + } + if (num11 != 0 && Main.tile[num9 + num11, num10].liquid == 0 && (!Main.tile[num9 + num11, num10].nactive() || !Main.tileSolid[(int)Main.tile[num9 + num11, num10].type] || Main.tileSolidTop[(int)Main.tile[num9 + num11, num10].type])) + { + flag4 = true; + num9 += num11; + } + if (flag && !flag4) + { + flag = false; + flag4 = true; + num8 = -num6; + num11 = 0; + } + } + if (num7 != num9 && i != num10) + { + num++; + } + Main.tile[num9, num10].liquid = b2; + Main.tile[num9, num10].liquidType((int)b); + if (Main.tile[num9 - 1, num10].liquid > 0 && Main.tile[num9 - 1, num10].lava() != flag2) + { + if (flag2) + { + Liquid.LavaCheck(num9, num10); + } + else + { + Liquid.LavaCheck(num9 - 1, num10); + } + } + else + { + if (Main.tile[num9 + 1, num10].liquid > 0 && Main.tile[num9 + 1, num10].lava() != flag2) + { + if (flag2) + { + Liquid.LavaCheck(num9, num10); + } + else + { + Liquid.LavaCheck(num9 + 1, num10); + } + } + else + { + if (Main.tile[num9, num10 - 1].liquid > 0 && Main.tile[num9, num10 - 1].lava() != flag2) + { + if (flag2) + { + Liquid.LavaCheck(num9, num10); + } + else + { + Liquid.LavaCheck(num9, num10 - 1); + } + } + else + { + if (Main.tile[num9, num10 + 1].liquid > 0 && Main.tile[num9, num10 + 1].lava() != flag2) + { + if (flag2) + { + Liquid.LavaCheck(num9, num10); + } + else + { + Liquid.LavaCheck(num9, num10 + 1); + } + } + } + } + } + if (Main.tile[num9, num10].liquid > 0) + { + if (Main.tile[num9 - 1, num10].liquid > 0 && Main.tile[num9 - 1, num10].honey() != flag3) + { + if (flag3) + { + Liquid.HoneyCheck(num9, num10); + } + else + { + Liquid.HoneyCheck(num9 - 1, num10); + } + } + else + { + if (Main.tile[num9 + 1, num10].liquid > 0 && Main.tile[num9 + 1, num10].honey() != flag3) + { + if (flag3) + { + Liquid.HoneyCheck(num9, num10); + } + else + { + Liquid.HoneyCheck(num9 + 1, num10); + } + } + else + { + if (Main.tile[num9, num10 - 1].liquid > 0 && Main.tile[num9, num10 - 1].honey() != flag3) + { + if (flag3) + { + Liquid.HoneyCheck(num9, num10); + } + else + { + Liquid.HoneyCheck(num9, num10 - 1); + } + } + else + { + if (Main.tile[num9, num10 + 1].liquid > 0 && Main.tile[num9, num10 + 1].honey() != flag3) + { + if (flag3) + { + Liquid.HoneyCheck(num9, num10); + } + else + { + Liquid.HoneyCheck(num9, num10 + 1); + } + } + } + } + } + } + } + } + } + } + return (double)num; + } + public void Update() + { + if (Main.tile[this.x, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x, this.y].type]) + { + byte arg_81_0 = Main.tile[this.x, this.y].type; + this.kill = 9; + return; + } + byte liquid = Main.tile[this.x, this.y].liquid; + if (this.y > Main.maxTilesY - 200 && Main.tile[this.x, this.y].liquidType() == 0 && Main.tile[this.x, this.y].liquid > 0) + { + byte b = 2; + if (Main.tile[this.x, this.y].liquid < b) + { + b = Main.tile[this.x, this.y].liquid; + } + Tile expr_150 = Main.tile[this.x, this.y]; + expr_150.liquid -= b; + } + if (Main.tile[this.x, this.y].liquid == 0) + { + this.kill = 9; + return; + } + if (Main.tile[this.x, this.y].lava()) + { + Liquid.LavaCheck(this.x, this.y); + if (!Liquid.quickFall) + { + if (this.delay < 5) + { + this.delay++; + return; + } + this.delay = 0; + } + } + else + { + if (Main.tile[this.x - 1, this.y].lava()) + { + Liquid.AddWater(this.x - 1, this.y); + } + if (Main.tile[this.x + 1, this.y].lava()) + { + Liquid.AddWater(this.x + 1, this.y); + } + if (Main.tile[this.x, this.y - 1].lava()) + { + Liquid.AddWater(this.x, this.y - 1); + } + if (Main.tile[this.x, this.y + 1].lava()) + { + Liquid.AddWater(this.x, this.y + 1); + } + if (Main.tile[this.x, this.y].honey()) + { + Liquid.HoneyCheck(this.x, this.y); + if (!Liquid.quickFall) + { + if (this.delay < 10) + { + this.delay++; + return; + } + this.delay = 0; + } + } + else + { + if (Main.tile[this.x - 1, this.y].honey()) + { + Liquid.AddWater(this.x - 1, this.y); + } + if (Main.tile[this.x + 1, this.y].honey()) + { + Liquid.AddWater(this.x + 1, this.y); + } + if (Main.tile[this.x, this.y - 1].honey()) + { + Liquid.AddWater(this.x, this.y - 1); + } + if (Main.tile[this.x, this.y + 1].honey()) + { + Liquid.AddWater(this.x, this.y + 1); + } + } + } + if ((!Main.tile[this.x, this.y + 1].nactive() || !Main.tileSolid[(int)Main.tile[this.x, this.y + 1].type] || Main.tileSolidTop[(int)Main.tile[this.x, this.y + 1].type]) && (Main.tile[this.x, this.y + 1].liquid <= 0 || Main.tile[this.x, this.y + 1].liquidType() == Main.tile[this.x, this.y].liquidType()) && Main.tile[this.x, this.y + 1].liquid < 255) + { + float num = (float)(255 - Main.tile[this.x, this.y + 1].liquid); + if (num > (float)Main.tile[this.x, this.y].liquid) + { + num = (float)Main.tile[this.x, this.y].liquid; + } + Tile expr_534 = Main.tile[this.x, this.y]; + expr_534.liquid -= (byte)num; + Tile expr_55B = Main.tile[this.x, this.y + 1]; + expr_55B.liquid += (byte)num; + Main.tile[this.x, this.y + 1].liquidType((int)Main.tile[this.x, this.y].liquidType()); + Liquid.AddWater(this.x, this.y + 1); + Main.tile[this.x, this.y + 1].skipLiquid(true); + Main.tile[this.x, this.y].skipLiquid(true); + if (Main.tile[this.x, this.y].liquid > 250) + { + Main.tile[this.x, this.y].liquid = 255; + } + else + { + Liquid.AddWater(this.x - 1, this.y); + Liquid.AddWater(this.x + 1, this.y); + } + } + if (Main.tile[this.x, this.y].liquid > 0) + { + bool flag = true; + bool flag2 = true; + bool flag3 = true; + bool flag4 = true; + if (Main.tile[this.x - 1, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x - 1, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x - 1, this.y].type]) + { + flag = false; + } + else + { + if (Main.tile[this.x - 1, this.y].liquid > 0 && Main.tile[this.x - 1, this.y].liquidType() != Main.tile[this.x, this.y].liquidType()) + { + flag = false; + } + else + { + if (Main.tile[this.x - 2, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x - 2, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x - 2, this.y].type]) + { + flag3 = false; + } + else + { + if (Main.tile[this.x - 2, this.y].liquid == 0) + { + flag3 = false; + } + else + { + if (Main.tile[this.x - 2, this.y].liquid > 0 && Main.tile[this.x - 2, this.y].liquidType() != Main.tile[this.x, this.y].liquidType()) + { + flag3 = false; + } + } + } + } + } + if (Main.tile[this.x + 1, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x + 1, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x + 1, this.y].type]) + { + flag2 = false; + } + else + { + if (Main.tile[this.x + 1, this.y].liquid > 0 && Main.tile[this.x + 1, this.y].liquidType() != Main.tile[this.x, this.y].liquidType()) + { + flag2 = false; + } + else + { + if (Main.tile[this.x + 2, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x + 2, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x + 2, this.y].type]) + { + flag4 = false; + } + else + { + if (Main.tile[this.x + 2, this.y].liquid == 0) + { + flag4 = false; + } + else + { + if (Main.tile[this.x + 2, this.y].liquid > 0 && Main.tile[this.x + 2, this.y].liquidType() != Main.tile[this.x, this.y].liquidType()) + { + flag4 = false; + } + } + } + } + } + int num2 = 0; + if (Main.tile[this.x, this.y].liquid < 3) + { + num2 = -1; + } + if (flag && flag2) + { + if (flag3 && flag4) + { + bool flag5 = true; + bool flag6 = true; + if (Main.tile[this.x - 3, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x - 3, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x - 3, this.y].type]) + { + flag5 = false; + } + else + { + if (Main.tile[this.x - 3, this.y].liquid == 0) + { + flag5 = false; + } + else + { + if (Main.tile[this.x - 3, this.y].liquidType() != Main.tile[this.x, this.y].liquidType()) + { + flag5 = false; + } + } + } + if (Main.tile[this.x + 3, this.y].nactive() && Main.tileSolid[(int)Main.tile[this.x + 3, this.y].type] && !Main.tileSolidTop[(int)Main.tile[this.x + 3, this.y].type]) + { + flag6 = false; + } + else + { + if (Main.tile[this.x + 3, this.y].liquid == 0) + { + flag6 = false; + } + else + { + if (Main.tile[this.x + 3, this.y].liquidType() != Main.tile[this.x, this.y].liquidType()) + { + flag6 = false; + } + } + } + if (flag5 && flag6) + { + float num = (float)((int)(Main.tile[this.x - 1, this.y].liquid + Main.tile[this.x + 1, this.y].liquid + Main.tile[this.x - 2, this.y].liquid + Main.tile[this.x + 2, this.y].liquid + Main.tile[this.x - 3, this.y].liquid + Main.tile[this.x + 3, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 7f)); + int num3 = 0; + Main.tile[this.x - 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 1, this.y].liquid != (byte)num) + { + Main.tile[this.x - 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 1, this.y); + } + else + { + num3++; + } + Main.tile[this.x + 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 1, this.y].liquid != (byte)num) + { + Main.tile[this.x + 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 1, this.y); + } + else + { + num3++; + } + Main.tile[this.x - 2, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 2, this.y].liquid != (byte)num) + { + Main.tile[this.x - 2, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 2, this.y); + } + else + { + num3++; + } + Main.tile[this.x + 2, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 2, this.y].liquid != (byte)num) + { + Main.tile[this.x + 2, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 2, this.y); + } + else + { + num3++; + } + Main.tile[this.x - 3, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 3, this.y].liquid != (byte)num) + { + Main.tile[this.x - 3, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 3, this.y); + } + else + { + num3++; + } + Main.tile[this.x + 3, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 3, this.y].liquid != (byte)num) + { + Main.tile[this.x + 3, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 3, this.y); + } + else + { + num3++; + } + if (Main.tile[this.x - 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 1, this.y); + } + if (Main.tile[this.x + 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 1, this.y); + } + if (Main.tile[this.x - 2, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 2, this.y); + } + if (Main.tile[this.x + 2, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 2, this.y); + } + if (Main.tile[this.x - 3, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 3, this.y); + } + if (Main.tile[this.x + 3, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 3, this.y); + } + if (num3 != 6 || Main.tile[this.x, this.y - 1].liquid <= 0) + { + Main.tile[this.x, this.y].liquid = (byte)num; + } + } + else + { + int num4 = 0; + float num = (float)((int)(Main.tile[this.x - 1, this.y].liquid + Main.tile[this.x + 1, this.y].liquid + Main.tile[this.x - 2, this.y].liquid + Main.tile[this.x + 2, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 5f)); + Main.tile[this.x - 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 1, this.y].liquid != (byte)num) + { + Main.tile[this.x - 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 1, this.y); + } + else + { + num4++; + } + Main.tile[this.x + 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 1, this.y].liquid != (byte)num) + { + Main.tile[this.x + 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 1, this.y); + } + else + { + num4++; + } + Main.tile[this.x - 2, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 2, this.y].liquid != (byte)num) + { + Main.tile[this.x - 2, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 2, this.y); + } + else + { + num4++; + } + Main.tile[this.x + 2, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 2, this.y].liquid != (byte)num) + { + Main.tile[this.x + 2, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 2, this.y); + } + else + { + num4++; + } + if (Main.tile[this.x - 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 1, this.y); + } + if (Main.tile[this.x + 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 1, this.y); + } + if (Main.tile[this.x - 2, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 2, this.y); + } + if (Main.tile[this.x + 2, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 2, this.y); + } + if (num4 != 4 || Main.tile[this.x, this.y - 1].liquid <= 0) + { + Main.tile[this.x, this.y].liquid = (byte)num; + } + } + } + else + { + if (flag3) + { + float num = (float)((int)(Main.tile[this.x - 1, this.y].liquid + Main.tile[this.x + 1, this.y].liquid + Main.tile[this.x - 2, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 4f) + 0.001); + Main.tile[this.x - 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Main.tile[this.x - 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 1, this.y); + } + Main.tile[this.x + 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Main.tile[this.x + 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 1, this.y); + } + Main.tile[this.x - 2, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 2, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Main.tile[this.x - 2, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 2, this.y); + } + Main.tile[this.x, this.y].liquid = (byte)num; + } + else + { + if (flag4) + { + float num = (float)((int)(Main.tile[this.x - 1, this.y].liquid + Main.tile[this.x + 1, this.y].liquid + Main.tile[this.x + 2, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 4f) + 0.001); + Main.tile[this.x - 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Main.tile[this.x - 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x - 1, this.y); + } + Main.tile[this.x + 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 1, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Main.tile[this.x + 1, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 1, this.y); + } + Main.tile[this.x + 2, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 2, this.y].liquid != (byte)num || Main.tile[this.x, this.y].liquid != (byte)num) + { + Main.tile[this.x + 2, this.y].liquid = (byte)num; + Liquid.AddWater(this.x + 2, this.y); + } + Main.tile[this.x, this.y].liquid = (byte)num; + } + else + { + float num = (float)((int)(Main.tile[this.x - 1, this.y].liquid + Main.tile[this.x + 1, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 3f) + 0.001); + Main.tile[this.x - 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x - 1, this.y].liquid != (byte)num) + { + Main.tile[this.x - 1, this.y].liquid = (byte)num; + } + if (Main.tile[this.x, this.y].liquid != (byte)num || Main.tile[this.x - 1, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 1, this.y); + } + Main.tile[this.x + 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x + 1, this.y].liquid != (byte)num) + { + Main.tile[this.x + 1, this.y].liquid = (byte)num; + } + if (Main.tile[this.x, this.y].liquid != (byte)num || Main.tile[this.x + 1, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 1, this.y); + } + Main.tile[this.x, this.y].liquid = (byte)num; + } + } + } + } + else + { + if (flag) + { + float num = (float)((int)(Main.tile[this.x - 1, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 2f) + 0.001); + if (Main.tile[this.x - 1, this.y].liquid != (byte)num) + { + Main.tile[this.x - 1, this.y].liquid = (byte)num; + } + Main.tile[this.x - 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x, this.y].liquid != (byte)num || Main.tile[this.x - 1, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x - 1, this.y); + } + Main.tile[this.x, this.y].liquid = (byte)num; + } + else + { + if (flag2) + { + float num = (float)((int)(Main.tile[this.x + 1, this.y].liquid + Main.tile[this.x, this.y].liquid) + num2); + num = (float)Math.Round((double)(num / 2f) + 0.001); + if (Main.tile[this.x + 1, this.y].liquid != (byte)num) + { + Main.tile[this.x + 1, this.y].liquid = (byte)num; + } + Main.tile[this.x + 1, this.y].liquidType((int)Main.tile[this.x, this.y].liquidType()); + if (Main.tile[this.x, this.y].liquid != (byte)num || Main.tile[this.x + 1, this.y].liquid != (byte)num) + { + Liquid.AddWater(this.x + 1, this.y); + } + Main.tile[this.x, this.y].liquid = (byte)num; + } + } + } + } + if (Main.tile[this.x, this.y].liquid == liquid) + { + this.kill++; + return; + } + if (Main.tile[this.x, this.y].liquid == 254 && liquid == 255) + { + Main.tile[this.x, this.y].liquid = 255; + this.kill++; + return; + } + Liquid.AddWater(this.x, this.y - 1); + this.kill = 0; + } + public static void StartPanic() + { + if (!Liquid.panicMode) + { + WorldGen.waterLine = Main.maxTilesY; + Liquid.numLiquid = 0; + LiquidBuffer.numLiquidBuffer = 0; + Liquid.panicCounter = 0; + Liquid.panicMode = true; + Liquid.panicY = Main.maxTilesY - 3; + if (Main.dedServ) + { + Console.WriteLine("Forcing water to settle."); + } + } + } + public static void UpdateLiquid() + { + if (Main.netMode == 2) + { + Liquid.cycles = 30; + Liquid.maxLiquid = 5000; + } + if (!WorldGen.gen) + { + if (!Liquid.panicMode) + { + if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > 4000) + { + Liquid.panicCounter++; + if (Liquid.panicCounter > 1800 || Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > 13500) + { + Liquid.StartPanic(); + } + } + else + { + Liquid.panicCounter = 0; + } + } + if (Liquid.panicMode) + { + int num = 0; + while (Liquid.panicY >= 3 && num < 5) + { + num++; + Liquid.QuickWater(0, Liquid.panicY, Liquid.panicY); + Liquid.panicY--; + if (Liquid.panicY < 3) + { + Console.WriteLine("Water has been settled."); + Liquid.panicCounter = 0; + Liquid.panicMode = false; + if (Main.netMode == 2) + { + for (int i = 0; i < 255; i++) + { + for (int j = 0; j < Main.maxSectionsX; j++) + { + for (int k = 0; k < Main.maxSectionsY; k++) + { + Netplay.serverSock[i].tileSection[j, k] = false; + } + } + } + } + } + } + return; + } + } + if (Liquid.quickSettle || Liquid.numLiquid > 2000) + { + Liquid.quickFall = true; + } + else + { + Liquid.quickFall = false; + } + Liquid.wetCounter++; + int num2 = Liquid.maxLiquid / Liquid.cycles; + int num3 = num2 * (Liquid.wetCounter - 1); + int num4 = num2 * Liquid.wetCounter; + if (Liquid.wetCounter == Liquid.cycles) + { + num4 = Liquid.numLiquid; + } + if (num4 > Liquid.numLiquid) + { + num4 = Liquid.numLiquid; + int arg_197_0 = Main.netMode; + Liquid.wetCounter = Liquid.cycles; + } + if (Liquid.quickFall) + { + for (int l = num3; l < num4; l++) + { + Main.liquid[l].delay = 10; + Main.liquid[l].Update(); + Main.tile[Main.liquid[l].x, Main.liquid[l].y].skipLiquid(false); + } + } + else + { + for (int m = num3; m < num4; m++) + { + if (!Main.tile[Main.liquid[m].x, Main.liquid[m].y].skipLiquid()) + { + Main.liquid[m].Update(); + } + else + { + Main.tile[Main.liquid[m].x, Main.liquid[m].y].skipLiquid(false); + } + } + } + if (Liquid.wetCounter >= Liquid.cycles) + { + Liquid.wetCounter = 0; + for (int n = Liquid.numLiquid - 1; n >= 0; n--) + { + if (Main.liquid[n].kill > 4) + { + Liquid.DelWater(n); + } + } + int num5 = Liquid.maxLiquid - (Liquid.maxLiquid - Liquid.numLiquid); + if (num5 > LiquidBuffer.numLiquidBuffer) + { + num5 = LiquidBuffer.numLiquidBuffer; + } + for (int num6 = 0; num6 < num5; num6++) + { + Main.tile[Main.liquidBuffer[0].x, Main.liquidBuffer[0].y].checkingLiquid(false); + Liquid.AddWater(Main.liquidBuffer[0].x, Main.liquidBuffer[0].y); + LiquidBuffer.DelBuffer(0); + } + if (Liquid.numLiquid > 0 && Liquid.numLiquid > Liquid.stuckAmount - 50 && Liquid.numLiquid < Liquid.stuckAmount + 50) + { + Liquid.stuckCount++; + if (Liquid.stuckCount >= 10000) + { + Liquid.stuck = true; + for (int num7 = Liquid.numLiquid - 1; num7 >= 0; num7--) + { + Liquid.DelWater(num7); + } + Liquid.stuck = false; + Liquid.stuckCount = 0; + return; + } + } + else + { + Liquid.stuckCount = 0; + Liquid.stuckAmount = Liquid.numLiquid; + } + } + } + public static void AddWater(int x, int y) + { + if (Main.tile[x, y].checkingLiquid()) + { + return; + } + if (x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5) + { + return; + } + if (x < 5 || y < 5) + { + return; + } + if (Main.tile[x, y] == null) + { + return; + } + if (Main.tile[x, y].liquid == 0) + { + return; + } + if (Liquid.numLiquid >= Liquid.maxLiquid - 1) + { + LiquidBuffer.AddBuffer(x, y); + return; + } + Main.tile[x, y].checkingLiquid(true); + Main.liquid[Liquid.numLiquid].kill = 0; + Main.liquid[Liquid.numLiquid].x = x; + Main.liquid[Liquid.numLiquid].y = y; + Main.liquid[Liquid.numLiquid].delay = 0; + Main.tile[x, y].skipLiquid(false); + Liquid.numLiquid++; + if (Main.netMode == 2 && Liquid.numLiquid < Liquid.maxLiquid / 3) + { + NetMessage.sendWater(x, y); + } + if (Main.tile[x, y].active() && (Main.tileWaterDeath[(int)Main.tile[x, y].type] || (Main.tile[x, y].lava() && Main.tileLavaDeath[(int)Main.tile[x, y].type]))) + { + if (Main.tile[x, y].type == 4 && Main.tile[x, y].frameY == 176) + { + return; + } + if (Main.tile[x, y].type == 4 && Main.tile[x, y].frameY == 242) + { + return; + } + if (Main.tile[x, y].type == 19 && Main.tile[x, y].frameY == 234) + { + return; + } + if (Main.tile[x, y].type == 11 && Main.tile[x, y].frameY >= 1026 && Main.tile[x, y].frameY <= 1078) + { + return; + } + if (Main.tile[x, y].type == 15 && Main.tile[x, y].frameY >= 640 && Main.tile[x, y].frameY <= 678) + { + return; + } + if (Main.tile[x, y].type == 14 && Main.tile[x, y].frameX >= 702 && Main.tile[x, y].frameX <= 754) + { + return; + } + if (Main.tile[x, y].type == 18 && Main.tile[x, y].frameX >= 504 && Main.tile[x, y].frameX <= 538) + { + return; + } + if (Main.tile[x, y].type == 105 && Main.tile[x, y].frameX >= 1764 && Main.tile[x, y].frameX <= 1798) + { + return; + } + if (Main.tile[x, y].type == 101 && Main.tile[x, y].frameX >= 216 && Main.tile[x, y].frameX <= 268) + { + return; + } + if (WorldGen.gen) + { + Main.tile[x, y].active(false); + return; + } + WorldGen.KillTile(x, y, false, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)x, (float)y, 0f, 0); + } + } + } + public static void LavaCheck(int x, int y) + { + if ((Main.tile[x - 1, y].liquid > 0 && !Main.tile[x - 1, y].lava()) || (Main.tile[x + 1, y].liquid > 0 && !Main.tile[x + 1, y].lava()) || (Main.tile[x, y - 1].liquid > 0 && !Main.tile[x, y - 1].lava())) + { + int num = 0; + int type = 56; + if (!Main.tile[x - 1, y].lava()) + { + num += (int)Main.tile[x - 1, y].liquid; + Main.tile[x - 1, y].liquid = 0; + } + if (!Main.tile[x + 1, y].lava()) + { + num += (int)Main.tile[x + 1, y].liquid; + Main.tile[x + 1, y].liquid = 0; + } + if (!Main.tile[x, y - 1].lava()) + { + num += (int)Main.tile[x, y - 1].liquid; + Main.tile[x, y - 1].liquid = 0; + } + if (Main.tile[x - 1, y].honey() || Main.tile[x + 1, y].honey() || Main.tile[x, y - 1].honey()) + { + type = 230; + } + if (num >= 32 && !Main.tile[x, y].active()) + { + Main.tile[x, y].liquid = 0; + Main.tile[x, y].lava(false); + WorldGen.PlaceTile(x, y, type, true, true, -1, 0); + WorldGen.SquareTileFrame(x, y, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x - 1, y - 1, 3); + return; + } + } + } + else + { + if (Main.tile[x, y + 1].liquid > 0 && !Main.tile[x, y + 1].lava()) + { + if (Main.tileCut[(int)Main.tile[x, y + 1].type]) + { + WorldGen.KillTile(x, y + 1, false, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)x, (float)(y + 1), 0f, 0); + } + } + if (!Main.tile[x, y + 1].active()) + { + if (Main.tile[x, y].liquid < 32) + { + Main.tile[x, y].liquid = 0; + Main.tile[x, y].liquidType(0); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x - 1, y, 3); + return; + } + } + else + { + int type2 = 56; + if (Main.tile[x, y + 1].honey()) + { + type2 = 230; + } + Main.tile[x, y].liquid = 0; + Main.tile[x, y].lava(false); + Main.tile[x, y + 1].liquid = 0; + WorldGen.PlaceTile(x, y + 1, type2, true, true, -1, 0); + WorldGen.SquareTileFrame(x, y + 1, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x - 1, y, 3); + } + } + } + } + } + } + public static void HoneyCheck(int x, int y) + { + if ((Main.tile[x - 1, y].liquid > 0 && Main.tile[x - 1, y].liquidType() == 0) || (Main.tile[x + 1, y].liquid > 0 && Main.tile[x + 1, y].liquidType() == 0) || (Main.tile[x, y - 1].liquid > 0 && Main.tile[x, y - 1].liquidType() == 0)) + { + int num = 0; + if (Main.tile[x - 1, y].liquidType() == 0) + { + num += (int)Main.tile[x - 1, y].liquid; + Main.tile[x - 1, y].liquid = 0; + } + if (Main.tile[x + 1, y].liquidType() == 0) + { + num += (int)Main.tile[x + 1, y].liquid; + Main.tile[x + 1, y].liquid = 0; + } + if (Main.tile[x, y - 1].liquidType() == 0) + { + num += (int)Main.tile[x, y - 1].liquid; + Main.tile[x, y - 1].liquid = 0; + } + if (num >= 32 && !Main.tile[x, y].active()) + { + Main.tile[x, y].liquid = 0; + Main.tile[x, y].liquidType(0); + WorldGen.PlaceTile(x, y, 229, true, true, -1, 0); + WorldGen.SquareTileFrame(x, y, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x - 1, y - 1, 3); + return; + } + } + } + else + { + if (Main.tile[x, y + 1].liquid > 0 && Main.tile[x, y + 1].liquidType() == 0) + { + if (Main.tileCut[(int)Main.tile[x, y + 1].type]) + { + WorldGen.KillTile(x, y + 1, false, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)x, (float)(y + 1), 0f, 0); + } + } + if (!Main.tile[x, y + 1].active()) + { + if (Main.tile[x, y].liquid < 32) + { + Main.tile[x, y].liquid = 0; + Main.tile[x, y].liquidType(0); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x - 1, y, 3); + return; + } + } + else + { + Main.tile[x, y].liquid = 0; + Main.tile[x, y].liquidType(0); + Main.tile[x, y + 1].liquid = 0; + Main.tile[x, y + 1].liquidType(0); + WorldGen.PlaceTile(x, y + 1, 229, true, true, -1, 0); + WorldGen.SquareTileFrame(x, y + 1, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x - 1, y, 3); + } + } + } + } + } + } + public static void NetAddWater(int x, int y) + { + if (x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5) + { + return; + } + if (x < 5 || y < 5) + { + return; + } + if (Main.tile[x, y] == null) + { + return; + } + if (Main.tile[x, y].liquid == 0) + { + return; + } + for (int i = 0; i < Liquid.numLiquid; i++) + { + if (Main.liquid[i].x == x && Main.liquid[i].y == y) + { + Main.liquid[i].kill = 0; + Main.tile[x, y].skipLiquid(true); + return; + } + } + if (Liquid.numLiquid >= Liquid.maxLiquid - 1) + { + LiquidBuffer.AddBuffer(x, y); + return; + } + Main.tile[x, y].checkingLiquid(true); + Main.tile[x, y].skipLiquid(true); + Main.liquid[Liquid.numLiquid].kill = 0; + Main.liquid[Liquid.numLiquid].x = x; + Main.liquid[Liquid.numLiquid].y = y; + Liquid.numLiquid++; + int arg_10F_0 = Main.netMode; + if (Main.tile[x, y].active() && (Main.tileWaterDeath[(int)Main.tile[x, y].type] || (Main.tile[x, y].lava() && Main.tileLavaDeath[(int)Main.tile[x, y].type]))) + { + WorldGen.KillTile(x, y, false, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)x, (float)y, 0f, 0); + } + } + } + public static void DelWater(int l) + { + int num = Main.liquid[l].x; + int num2 = Main.liquid[l].y; + byte b = 2; + if (Main.tile[num, num2].liquid < b) + { + Main.tile[num, num2].liquid = 0; + if (Main.tile[num - 1, num2].liquid < b) + { + Main.tile[num - 1, num2].liquid = 0; + } + else + { + Liquid.AddWater(num - 1, num2); + } + if (Main.tile[num + 1, num2].liquid < b) + { + Main.tile[num + 1, num2].liquid = 0; + } + else + { + Liquid.AddWater(num + 1, num2); + } + } + else + { + if (Main.tile[num, num2].liquid < 20) + { + if ((Main.tile[num - 1, num2].liquid < Main.tile[num, num2].liquid && (!Main.tile[num - 1, num2].nactive() || !Main.tileSolid[(int)Main.tile[num - 1, num2].type] || Main.tileSolidTop[(int)Main.tile[num - 1, num2].type])) || (Main.tile[num + 1, num2].liquid < Main.tile[num, num2].liquid && (!Main.tile[num + 1, num2].nactive() || !Main.tileSolid[(int)Main.tile[num + 1, num2].type] || Main.tileSolidTop[(int)Main.tile[num + 1, num2].type])) || (Main.tile[num, num2 + 1].liquid < 255 && (!Main.tile[num, num2 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num, num2 + 1].type] || Main.tileSolidTop[(int)Main.tile[num, num2 + 1].type]))) + { + Main.tile[num, num2].liquid = 0; + } + } + else + { + if (Main.tile[num, num2 + 1].liquid < 255 && (!Main.tile[num, num2 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num, num2 + 1].type] || Main.tileSolidTop[(int)Main.tile[num, num2 + 1].type]) && !Liquid.stuck) + { + Main.liquid[l].kill = 0; + return; + } + } + } + if (Main.tile[num, num2].liquid < 250 && Main.tile[num, num2 - 1].liquid > 0) + { + Liquid.AddWater(num, num2 - 1); + } + if (Main.tile[num, num2].liquid == 0) + { + Main.tile[num, num2].liquidType(0); + } + else + { + if ((Main.tile[num + 1, num2].liquid > 0 && Main.tile[num + 1, num2 + 1].liquid < 250 && !Main.tile[num + 1, num2 + 1].active()) || (Main.tile[num - 1, num2].liquid > 0 && Main.tile[num - 1, num2 + 1].liquid < 250 && !Main.tile[num - 1, num2 + 1].active())) + { + Liquid.AddWater(num - 1, num2); + Liquid.AddWater(num + 1, num2); + } + if (Main.tile[num, num2].lava()) + { + Liquid.LavaCheck(num, num2); + for (int i = num - 1; i <= num + 1; i++) + { + for (int j = num2 - 1; j <= num2 + 1; j++) + { + if (Main.tile[i, j].active()) + { + if (Main.tile[i, j].type == 2 || Main.tile[i, j].type == 23 || Main.tile[i, j].type == 109) + { + Main.tile[i, j].type = 0; + WorldGen.SquareTileFrame(i, j, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num, num2, 3); + } + } + else + { + if (Main.tile[i, j].type == 60 || Main.tile[i, j].type == 70) + { + Main.tile[i, j].type = 59; + WorldGen.SquareTileFrame(i, j, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num, num2, 3); + } + } + } + } + } + } + } + else + { + if (Main.tile[num, num2].honey()) + { + Liquid.HoneyCheck(num, num2); + } + } + } + if (Main.netMode == 2) + { + NetMessage.sendWater(num, num2); + } + Liquid.numLiquid--; + Main.tile[Main.liquid[l].x, Main.liquid[l].y].checkingLiquid(false); + Main.liquid[l].x = Main.liquid[Liquid.numLiquid].x; + Main.liquid[l].y = Main.liquid[Liquid.numLiquid].y; + Main.liquid[l].kill = Main.liquid[Liquid.numLiquid].kill; + if (Main.tileAlch[(int)Main.tile[num, num2].type]) + { + WorldGen.CheckAlch(num, num2); + } + } + } +} diff --git a/Terraria/LiquidBuffer.cs b/Terraria/LiquidBuffer.cs new file mode 100644 index 0000000..1904989 --- /dev/null +++ b/Terraria/LiquidBuffer.cs @@ -0,0 +1,32 @@ +using System; +namespace Terraria +{ + public class LiquidBuffer + { + public const int maxLiquidBuffer = 10000; + public static int numLiquidBuffer; + public int x; + public int y; + public static void AddBuffer(int x, int y) + { + if (LiquidBuffer.numLiquidBuffer == 9999) + { + return; + } + if (Main.tile[x, y].checkingLiquid()) + { + return; + } + Main.tile[x, y].checkingLiquid(true); + Main.liquidBuffer[LiquidBuffer.numLiquidBuffer].x = x; + Main.liquidBuffer[LiquidBuffer.numLiquidBuffer].y = y; + LiquidBuffer.numLiquidBuffer++; + } + public static void DelBuffer(int l) + { + LiquidBuffer.numLiquidBuffer--; + Main.liquidBuffer[l].x = Main.liquidBuffer[LiquidBuffer.numLiquidBuffer].x; + Main.liquidBuffer[l].y = Main.liquidBuffer[LiquidBuffer.numLiquidBuffer].y; + } + } +} diff --git a/Terraria/Main.cs b/Terraria/Main.cs new file mode 100644 index 0000000..4ac1b2b --- /dev/null +++ b/Terraria/Main.cs @@ -0,0 +1,36316 @@ +using Microsoft.Win32; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +namespace Terraria +{ + public class Main : Game + { + public const int maxItemTypes = 1725; + public const int maxProjectileTypes = 311; + public const int maxNPCTypes = 301; + public const int maxTileSets = 251; + public const int maxWallTypes = 113; + public const int maxGoreTypes = 438; + public const int numArmorHead = 112; + public const int numArmorBody = 75; + public const int numArmorLegs = 64; + public const int maxBuffs = 81; + public const int maxWings = 21; + public const int maxBackgrounds = 185; + private const int MF_BYPOSITION = 1024; + public const int sectionWidth = 200; + public const int sectionHeight = 150; + public const int maxDust = 6000; + public const int maxCombatText = 100; + public const int maxItemText = 20; + public const int maxPlayers = 255; + public const int maxChests = 1000; + public const int maxItems = 400; + public const int maxProjectiles = 1000; + public const int maxNPCs = 200; + public const int maxGore = 500; + public const int realInventory = 50; + public const int maxInventory = 58; + public const int maxItemSounds = 51; + public const int maxNPCHitSounds = 13; + public const int maxNPCKilledSounds = 19; + public const int maxLiquidTypes = 12; + public const int maxMusic = 30; + public const double dayLength = 54000.0; + public const double nightLength = 32400.0; + public const int maxStars = 130; + public const int maxStarTypes = 5; + public const int maxClouds = 200; + public const int maxCloudTypes = 22; + public const int maxHair = 51; + public static int curRelease = 71; + public static string versionNumber = "v1.2.0.3.1"; + public static string versionNumber2 = "v1.2.0.3.1"; + public static bool ServerSideCharacter = false; + public static string clientUUID; + public static int maxMsg = 69; + public static Effect pixelShader; + public static Effect tileShader; + public static int npcStreamSpeed = 60; + public static int musicError = 0; + public static bool dedServFPS = false; + public static int dedServCount1 = 0; + public static int dedServCount2 = 0; + public static bool superFast = false; + public static bool[] hairLoaded = new bool[51]; + public static bool[] wingsLoaded = new bool[21]; + public static bool[] goreLoaded = new bool[438]; + public static bool[] projectileLoaded = new bool[311]; + public static bool[] itemFlameLoaded = new bool[1725]; + public static bool[] backgroundLoaded = new bool[185]; + public static bool[] tileSetsLoaded = new bool[251]; + public static bool[] wallLoaded = new bool[113]; + public static bool[] NPCLoaded = new bool[301]; + public static bool[] armorHeadLoaded = new bool[112]; + public static bool[] armorBodyLoaded = new bool[75]; + public static bool[] armorLegsLoaded = new bool[64]; + public static float zoomX; + public static float zoomY; + public static float sunCircle; + public static int BlackFadeIn = 0; + public static bool noWindowBorder = false; + private Matrix Transform = Matrix.CreateScale(1f, 1f, 1f) * Matrix.CreateRotationZ(0f) * Matrix.CreateTranslation(new Vector3(0f, 0f, 0f)); + private RasterizerState Rasterizer = RasterizerState.CullCounterClockwise; + public static int ugBack = 0; + public static int oldUgBack = 0; + public static int[] bgFrame = new int[1]; + public static int[] bgFrameCounter = new int[1]; + public static bool skipMenu = false; + public static bool verboseNetplay = false; + public static bool stopTimeOuts = false; + public static bool showSpam = false; + public static bool showItemOwner = false; + public static int oldTempLightCount = 0; + public static bool[] nextNPC = new bool[301]; + public static int musicBox = -1; + public static int musicBox2 = -1; + public static byte hbPosition = 1; + public static bool cEd = false; + public static float wFrCounter = 0f; + public static float wFrame = 0f; + public static float wFallFrCounter = 0f; + public static float wFallFrame = 0f; + public static float wFallFrCounter2 = 0f; + public static float wFallFrame2 = 0f; + public static float wFallFrCounter3 = 0f; + public static float wFallFrame3 = 0f; + public static float wFallFrCounter4 = 0f; + public static float wFallFrame4 = 0f; + public static int findWaterfallCount = 0; + public static int waterfallDist = 100; + public static float upTimer; + public static float upTimerMax; + public static float upTimerMaxDelay; + public static float[] drawTimer = new float[10]; + public static float[] drawTimerMax = new float[10]; + public static float[] drawTimerMaxDelay = new float[10]; + public static float[] renderTimer = new float[10]; + public static float[] lightTimer = new float[10]; + public static bool drawDiag = false; + public static bool drawRelease = false; + public static bool renderNow = false; + public static bool drawToScreen = false; + public static bool targetSet = false; + public static int mouseX; + public static int mouseY; + public static bool mouseLeft; + public static bool mouseRight; + public static float essScale = 1f; + public static int essDir = -1; + public static float[] cloudBGX = new float[2]; + public static float cloudBGAlpha; + public static float cloudBGActive; + public static int[] cloudBG = new int[] + { + 112, + 113 + }; + public static int[] treeMntBG = new int[2]; + public static int[] treeBG = new int[3]; + public static int[] corruptBG = new int[3]; + public static int[] jungleBG = new int[3]; + public static int[] snowMntBG = new int[2]; + public static int[] snowBG = new int[3]; + public static int[] hallowBG = new int[3]; + public static int[] crimsonBG = new int[3]; + public static int[] desertBG = new int[2]; + public static int oceanBG; + public static int[] treeX = new int[4]; + public static int[] treeStyle = new int[4]; + public static int[] caveBackX = new int[4]; + public static int[] caveBackStyle = new int[4]; + public static int iceBackStyle; + public static int hellBackStyle; + public static int jungleBackStyle; + public static string debugWords = ""; + public static bool gamePad = false; + public static bool xMas = false; + public static int snowDust = 0; + public static bool chTitle = false; + public static int keyCount = 0; + public static string[] keyString = new string[10]; + public static int[] keyInt = new int[10]; + public static int wfTileMax = 200; + public static int[] wfTileX = new int[Main.wfTileMax]; + public static int[] wfTileY = new int[Main.wfTileMax]; + public static int[] wfTileType = new int[Main.wfTileMax]; + public static int wfTileNum = 0; + public static byte gFade = 0; + public static float gFader = 0f; + public static byte gFadeDir = 1; + public static bool netDiag = false; + public static int txData = 0; + public static int rxData = 0; + public static int txMsg = 0; + public static int rxMsg = 0; + public static int[] rxMsgType = new int[Main.maxMsg]; + public static int[] rxDataType = new int[Main.maxMsg]; + public static int[] txMsgType = new int[Main.maxMsg]; + public static int[] txDataType = new int[Main.maxMsg]; + public static float uCarry = 0f; + public static bool drawSkip = false; + public static int fpsCount = 0; + public static Stopwatch fpsTimer = new Stopwatch(); + public static Stopwatch updateTimer = new Stopwatch(); + public bool gammaTest; + public static int fountainColor = -1; + public static bool showSplash = true; + public static bool ignoreErrors = true; + public static string defaultIP = ""; + public static int dayRate = 1; + public static int maxScreenW = 1920; + public static int minScreenW = 800; + public static int maxScreenH = 1200; + public static int minScreenH = 600; + public static float iS = 1f; + public static bool render = false; + public static int qaStyle = 0; + public static int zoneX = 99; + public static int zoneY = 87; + public static float harpNote = 0f; + public static bool[] projHostile = new bool[311]; + public static bool[] pvpBuff = new bool[81]; + public static bool[] vanityPet = new bool[81]; + public static bool[] lightPet = new bool[81]; + public static bool[] meleeBuff = new bool[81]; + public static bool[] debuff = new bool[81]; + public static string[] buffName = new string[81]; + public static string[] buffTip = new string[81]; + public static int maxMP = 10; + public static string[] recentWorld = new string[Main.maxMP]; + public static string[] recentIP = new string[Main.maxMP]; + public static int[] recentPort = new int[Main.maxMP]; + public static bool shortRender = true; + public static bool owBack = true; + public static int quickBG = 2; + public static int bgDelay = 0; + public static int bgStyle = 0; + public static float[] bgAlpha = new float[10]; + public static float[] bgAlpha2 = new float[10]; + public bool showNPCs; + public int mouseNPC = -1; + public static int wof = -1; + public static int wofT; + public static int wofB; + public static int wofF = 0; + private static int offScreenRange = 200; + private RenderTarget2D backWaterTarget; + private RenderTarget2D waterTarget; + private RenderTarget2D tileTarget; + private RenderTarget2D blackTarget; + private RenderTarget2D tile2Target; + private RenderTarget2D wallTarget; + private RenderTarget2D backgroundTarget; + public static int maxMapUpdates = 250000; + public static bool refreshMap = false; + public static int loadMapLastX = 0; + public static bool loadMapLock = false; + public static bool loadMap = false; + public static bool mapReady = false; + public static int textureMax = 2000; + public static bool updateMap = false; + public static int mapMinX = 0; + public static int mapMaxX = 0; + public static int mapMinY = 0; + public static int mapMaxY = 0; + public static bool mapUnfinished; + public static int mapTimeMax = 30; + public static int mapTime = Main.mapTimeMax; + public static bool clearMap; + public static int mapTargetX = 5; + public static int mapTargetY = 2; + private RenderTarget2D[,] mapTarget = new RenderTarget2D[Main.mapTargetX, Main.mapTargetY]; + public static bool[,] initMap = new bool[Main.mapTargetX, Main.mapTargetY]; + private Texture2D[] mapIconTexture = new Texture2D[9]; + private Texture2D mapTexture; + private Texture2D mapBG1Texture; + private Texture2D mapBG2Texture; + private Texture2D mapBG3Texture; + private Texture2D mapBG4Texture; + private Texture2D mapBG5Texture; + private Texture2D mapBG6Texture; + private Texture2D mapBG7Texture; + private Texture2D mapBG8Texture; + private Texture2D mapBG9Texture; + private Texture2D mapBG10Texture; + private Texture2D mapBG11Texture; + private Texture2D mapBG12Texture; + private Texture2D hueTexture; + private Texture2D colorSliderTexture; + private Texture2D colorBarTexture; + private Texture2D colorBlipTexture; + private Texture2D iceBarrierTexture; + public static bool mapInit = false; + public static bool mapEnabled = true; + public static int mapStyle = 1; + public static float grabMapX = 0f; + public static float grabMapY = 0f; + public static int miniMapX = 0; + public static int miniMapY = 0; + public static int miniMapWidth = 0; + public static int miniMapHeight = 0; + public static float mapMinimapScale = 1.25f; + public static float mapMinimapAlpha = 1f; + public static float mapOverlayScale = 2.5f; + public static float mapOverlayAlpha = 0.35f; + public static bool mapFullscreen = false; + public static bool resetMapFull = false; + public static float mapFullscreenScale = 4f; + public static Vector2 mapFullscreenPos = new Vector2(-1f, -1f); + private int firstTileX; + private int lastTileX; + private int firstTileY; + private int lastTileY; + private double bgParrallax; + private int bgStart; + private int bgLoops; + private int bgStartY; + private int bgLoopsY; + private int bgTop; + public static int renderCount = 99; + private GraphicsDeviceManager graphics; + private SpriteBatch spriteBatch; + private Process tServer = new Process(); + private static Stopwatch saveTime = new Stopwatch(); + public static MouseState mouseState = Mouse.GetState(); + public static MouseState oldMouseState = Mouse.GetState(); + public static KeyboardState keyState = Keyboard.GetState(); + public static Color mcColor = new Color(125, 125, 255); + public static Color hcColor = new Color(200, 125, 255); + public static Color bgColor; + public static bool mouseHC = false; + public static string chestText = "Chest"; + public static bool craftingHide = false; + public static bool armorHide = false; + public static float craftingAlpha = 1f; + public static float armorAlpha = 1f; + public static float[] buffAlpha = new float[81]; + public static Item trashItem = new Item(); + public static bool hardMode = false; + public float chestLootScale = 1f; + public bool chestLootHover; + public float chestStackScale = 1f; + public bool chestStackHover; + public float chestDepositScale = 1f; + public bool chestDepositHover; + public static bool drawScene = false; + public static Vector2 sceneWaterPos = default(Vector2); + public static Vector2 sceneTilePos = default(Vector2); + public static Vector2 sceneTile2Pos = default(Vector2); + public static Vector2 sceneWallPos = default(Vector2); + public static Vector2 sceneBackgroundPos = default(Vector2); + public static bool maxQ = true; + public static float gfxQuality = 1f; + public static float gfxRate = 0.01f; + public int DiscoStyle; + public static int DiscoR = 255; + public static int DiscoB = 0; + public static int DiscoG = 0; + public static int teamCooldown = 0; + public static int teamCooldownLen = 300; + public static bool gamePaused = false; + public static int updateTime = 0; + public static int drawTime = 0; + public static int uCount = 0; + public static int updateRate = 0; + public static int frameRate = 0; + public static bool RGBRelease = false; + public static bool qRelease = false; + public static bool netRelease = false; + public static bool frameRelease = false; + public static bool showFrameRate = false; + public static int magmaBGFrame = 0; + public static int magmaBGFrameCounter = 0; + public static int saveTimer = 0; + public static bool autoJoin = false; + public static bool serverStarting = false; + public static float leftWorld = 0f; + public static float rightWorld = 134400f; + public static float topWorld = 0f; + public static float bottomWorld = 38400f; + public static int maxTilesX = (int)Main.rightWorld / 16 + 1; + public static int maxTilesY = (int)Main.bottomWorld / 16 + 1; + public static int maxSectionsX = Main.maxTilesX / 200; + public static int maxSectionsY = Main.maxTilesY / 150; + public static int numDust = 6000; + public static int numPlayers = 0; + public static int maxNetPlayers = 255; + public static string[] chrName = new string[301]; + public static int maxRain = 750; + public int invBottom = 210; + public static float cameraX = 0f; + public static bool drewLava = false; + public static float[] liquidAlpha = new float[12]; + public static int waterStyle = 0; + public static int worldRate = 1; + public static float caveParrallax = 1f; + public static string[] tileName = new string[251]; + public static int dungeonX; + public static int dungeonY; + public static Liquid[] liquid = new Liquid[Liquid.resLiquid]; + public static LiquidBuffer[] liquidBuffer = new LiquidBuffer[10000]; + public static bool dedServ = false; + public static int spamCount = 0; + public static int curMusic = 0; + public static int dayMusic = 0; + public int newMusic; + public static bool showItemText = true; + public static bool autoSave = true; + public static string buffString = ""; + public static string libPath = ""; + public static int lo = 0; + public static int LogoA = 255; + public static int LogoB = 0; + public static bool LogoT = false; + public static string statusText = ""; + public static string worldName = ""; + public static int worldID; + public static int background = 0; + public static int caveBackground = 0; + public static float ugBackTransition = 0f; + public static Color tileColor; + public static double worldSurface; + public static double rockLayer; + public static Color[] teamColor = new Color[5]; + public static bool dayTime = true; + public static double time = 13500.0; + public static int moonPhase = 0; + public static short sunModY = 0; + public static short moonModY = 0; + public static bool grabSky = false; + public static bool bloodMoon = false; + public static float cloudAlpha = 0f; + public static float maxRaining = 0f; + public static float oldMaxRaining = 0f; + public static int rainTime = 0; + public static bool raining = false; + public static bool eclipse = false; + public static float eclipseLight = 0f; + public static int checkForSpawns = 0; + public static int helpText = 0; + public static bool autoGen = false; + public static bool autoPause = false; + public static int[] projFrames = new int[311]; + public static bool[] projPet = new bool[311]; + public static float demonTorch = 1f; + public static int demonTorchDir = 1; + public static int numStars; + public static int weatherCounter = 0; + public static int cloudLimit = 200; + public static int numClouds = Main.cloudLimit; + public static int numCloudsTemp = Main.numClouds; + public static float windSpeedTemp = 0f; + public static float windSpeed = 0f; + public static float windSpeedSet = 0f; + public static float windSpeedSpeed = 0f; + public static Cloud[] cloud = new Cloud[200]; + public static bool resetClouds = true; + public static int sandTiles; + public static int evilTiles; + public static int shroomTiles; + public static float shroomLight; + public static int snowTiles; + public static int holyTiles; + public static int waterCandles; + public static int meteorTiles; + public static int bloodTiles; + public static int jungleTiles; + public static int dungeonTiles; + public static bool campfire; + public static int fadeCounter = 0; + public static float invAlpha = 1f; + public static float invDir = 1f; + [ThreadStatic] + public static Random rand; + public static Texture2D[] bannerTexture = new Texture2D[3]; + public static Texture2D[] npcHeadTexture = new Texture2D[20]; + public static Texture2D craftButtonTexture; + public static Texture2D craftUpButtonTexture; + public static Texture2D craftDownButtonTexture; + public static Texture2D frozenTexture; + public static Texture2D magicPixel; + public static Texture2D miniMapFrameTexture; + public static Texture2D miniMapFrame2Texture; + public static Texture2D[] miniMapButtonTexture = new Texture2D[3]; + public static Texture2D[] destTexture = new Texture2D[3]; + public static Texture2D[] gemTexture = new Texture2D[6]; + public static Texture2D[] wingsTexture = new Texture2D[21]; + public static Texture2D[] armorHeadTexture = new Texture2D[112]; + public static Texture2D[] armorBodyTexture = new Texture2D[75]; + public static Texture2D[] femaleBodyTexture = new Texture2D[75]; + public static Texture2D[] armorArmTexture = new Texture2D[75]; + public static Texture2D[] armorLegTexture = new Texture2D[64]; + public static Texture2D pulleyTexture; + public static Texture2D[] FlameTexture = new Texture2D[7]; + public static Texture2D timerTexture; + public static Texture2D reforgeTexture; + public static Texture2D wallOutlineTexture; + public static Texture2D actuatorTexture; + public static Texture2D wireTexture; + public static Texture2D wire2Texture; + public static Texture2D wire3Texture; + public static Texture2D flyingCarpetTexture; + public static Texture2D gridTexture; + public static Texture2D lightDiscTexture; + public static Texture2D MusicBoxTexture; + public static Texture2D EyeLaserTexture; + public static Texture2D BoneEyesTexture; + public static Texture2D BoneLaserTexture; + public static Texture2D trashTexture; + public static Texture2D chainTexture; + public static Texture2D probeTexture; + public static Texture2D[] golemTexture = new Texture2D[4]; + public static Texture2D confuseTexture; + public static Texture2D[] gemChainTexture = new Texture2D[7]; + public static Texture2D sunOrbTexture; + public static Texture2D sunAltarTexture; + public static Texture2D chain2Texture; + public static Texture2D chain3Texture; + public static Texture2D chain4Texture; + public static Texture2D chain5Texture; + public static Texture2D chain6Texture; + public static Texture2D chain7Texture; + public static Texture2D chain8Texture; + public static Texture2D chain9Texture; + public static Texture2D chain10Texture; + public static Texture2D chain11Texture; + public static Texture2D chain12Texture; + public static Texture2D chain13Texture; + public static Texture2D chain14Texture; + public static Texture2D chain15Texture; + public static Texture2D chain16Texture; + public static Texture2D chain17Texture; + public static Texture2D chain18Texture; + public static Texture2D chain19Texture; + public static Texture2D chain20Texture; + public static Texture2D chain21Texture; + public static Texture2D chain22Texture; + public static Texture2D chain23Texture; + public static Texture2D chain24Texture; + public static Texture2D chain25Texture; + public static Texture2D chain26Texture; + public static Texture2D chain27Texture; + public static Texture2D hbTexture1; + public static Texture2D hbTexture2; + public static Texture2D chaosTexture; + public static Texture2D cdTexture; + public static Texture2D wofTexture; + public static Texture2D boneArmTexture; + public static Texture2D boneArm2Texture; + public static Texture2D[] npcToggleTexture = new Texture2D[2]; + public static Texture2D[] HBLockTexture = new Texture2D[2]; + public static Texture2D[] buffTexture = new Texture2D[81]; + public static Texture2D[] itemTexture = new Texture2D[1725]; + public static Texture2D[] itemFlameTexture = new Texture2D[1725]; + public static Texture2D[] npcTexture = new Texture2D[301]; + public static Texture2D[] projectileTexture = new Texture2D[311]; + public static Texture2D[] goreTexture = new Texture2D[438]; + public static Texture2D[] BackPackTexture = new Texture2D[5]; + public static Texture2D[] rainTexture = new Texture2D[3]; + public static Texture2D cursorTexture; + public static Texture2D dustTexture; + public static Texture2D sunTexture; + public static Texture2D sun2Texture; + public static Texture2D sun3Texture; + public static int maxMoons = 3; + public static int moonType = 0; + public static Texture2D[] moonTexture = new Texture2D[Main.maxMoons]; + public static int numTileColors = 28; + public static RenderTarget2D[,] tileAltTexture = new RenderTarget2D[251, Main.numTileColors]; + public static bool[,] tileAltTextureInit = new bool[251, Main.numTileColors]; + public static bool[,] tileAltTextureDrawn = new bool[251, Main.numTileColors]; + public static int numTreeStyles = 15; + public static RenderTarget2D[,] treeTopAltTexture = new RenderTarget2D[Main.numTreeStyles, Main.numTileColors]; + public static RenderTarget2D[,] treeBranchAltTexture = new RenderTarget2D[Main.numTreeStyles, Main.numTileColors]; + public static bool[,] treeAltTextureInit = new bool[Main.numTreeStyles, Main.numTileColors]; + public static bool[,] treeAltTextureDrawn = new bool[Main.numTreeStyles, Main.numTileColors]; + public static bool[,] checkTreeAlt = new bool[Main.numTreeStyles, Main.numTileColors]; + public static RenderTarget2D[,] wallAltTexture = new RenderTarget2D[113, Main.numTileColors]; + public static bool[,] wallAltTextureInit = new bool[113, Main.numTileColors]; + public static bool[,] wallAltTextureDrawn = new bool[113, Main.numTileColors]; + public static Texture2D[] tileTexture = new Texture2D[251]; + public static Texture2D blackTileTexture; + public static Texture2D[] wallTexture = new Texture2D[113]; + public static Texture2D[] backgroundTexture = new Texture2D[185]; + public static Texture2D[] cloudTexture = new Texture2D[22]; + public static Texture2D[] starTexture = new Texture2D[5]; + public static Texture2D[] liquidTexture = new Texture2D[12]; + public static Texture2D[] waterfallTexture = new Texture2D[15]; + public static Texture2D heartTexture; + public static Texture2D heart2Texture; + public static Texture2D manaTexture; + public static Texture2D bubbleTexture; + public static Texture2D flameTexture; + public static Texture2D[] treeTopTexture = new Texture2D[Main.numTreeStyles]; + public static Texture2D[] treeBranchTexture = new Texture2D[Main.numTreeStyles]; + public static Texture2D[] woodTexture = new Texture2D[7]; + public static Texture2D shroomCapTexture; + public static Texture2D inventoryBackTexture; + public static Texture2D inventoryBack2Texture; + public static Texture2D inventoryBack3Texture; + public static Texture2D inventoryBack4Texture; + public static Texture2D inventoryBack5Texture; + public static Texture2D inventoryBack6Texture; + public static Texture2D inventoryBack7Texture; + public static Texture2D inventoryBack8Texture; + public static Texture2D inventoryBack9Texture; + public static Texture2D inventoryBack10Texture; + public static Texture2D inventoryBack11Texture; + public static Texture2D inventoryBack12Texture; + public static Texture2D loTexture; + public static Texture2D logoTexture; + public static Texture2D logo2Texture; + public static Texture2D textBackTexture; + public static Texture2D chatTexture; + public static Texture2D chat2Texture; + public static Texture2D chatBackTexture; + public static Texture2D teamTexture; + public static Texture2D reTexture; + public static Texture2D raTexture; + public static Texture2D splashTexture; + public static Texture2D fadeTexture; + public static Texture2D ninjaTexture; + public static Texture2D antLionTexture; + public static Texture2D spikeBaseTexture; + public static Texture2D ghostTexture; + public static Texture2D evilCactusTexture; + public static Texture2D goodCactusTexture; + public static Texture2D crimsonCactusTexture; + public static Texture2D wraithEyeTexture; + public static Texture2D reaperEyeTexture; + public static Texture2D skinBodyTexture; + public static Texture2D skinLegsTexture; + public static Texture2D playerEyeWhitesTexture; + public static Texture2D playerEyesTexture; + public static Texture2D playerHandsTexture; + public static Texture2D playerHands2Texture; + public static Texture2D playerHeadTexture; + public static Texture2D playerPantsTexture; + public static Texture2D playerShirtTexture; + public static Texture2D playerShoesTexture; + public static Texture2D playerUnderShirtTexture; + public static Texture2D playerUnderShirt2Texture; + public static Texture2D femaleShirt2Texture; + public static Texture2D femalePantsTexture; + public static Texture2D femaleShirtTexture; + public static Texture2D femaleShoesTexture; + public static Texture2D femaleUnderShirtTexture; + public static Texture2D femaleUnderShirt2Texture; + public static Texture2D[] playerHairTexture = new Texture2D[51]; + public static Texture2D[] playerHairAltTexture = new Texture2D[51]; + public static SoundEffect[] soundMech = new SoundEffect[1]; + public static SoundEffectInstance[] soundInstanceMech = new SoundEffectInstance[1]; + public static SoundEffect[] soundDig = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceDig = new SoundEffectInstance[3]; + public static SoundEffect[] soundTink = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceTink = new SoundEffectInstance[3]; + public static SoundEffect[] soundPlayerHit = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstancePlayerHit = new SoundEffectInstance[3]; + public static SoundEffect[] soundFemaleHit = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceFemaleHit = new SoundEffectInstance[3]; + public static SoundEffect soundPlayerKilled; + public static SoundEffectInstance soundInstancePlayerKilled; + public static SoundEffect soundGrass; + public static SoundEffectInstance soundInstanceGrass; + public static SoundEffect soundGrab; + public static SoundEffectInstance soundInstanceGrab; + public static SoundEffect soundPixie; + public static SoundEffectInstance soundInstancePixie; + public static SoundEffect[] soundItem = new SoundEffect[52]; + public static SoundEffectInstance[] soundInstanceItem = new SoundEffectInstance[52]; + public static SoundEffect[] soundNPCHit = new SoundEffect[14]; + public static SoundEffectInstance[] soundInstanceNPCHit = new SoundEffectInstance[14]; + public static SoundEffect[] soundNPCKilled = new SoundEffect[20]; + public static SoundEffectInstance[] soundInstanceNPCKilled = new SoundEffectInstance[20]; + public static SoundEffect soundDoorOpen; + public static SoundEffectInstance soundInstanceDoorOpen; + public static SoundEffect soundDoorClosed; + public static SoundEffectInstance soundInstanceDoorClosed; + public static SoundEffect soundMenuOpen; + public static SoundEffectInstance soundInstanceMenuOpen; + public static SoundEffect soundMenuClose; + public static SoundEffectInstance soundInstanceMenuClose; + public static SoundEffect soundMenuTick; + public static SoundEffectInstance soundInstanceMenuTick; + public static SoundEffect soundShatter; + public static SoundEffectInstance soundInstanceShatter; + public static SoundEffect[] soundZombie = new SoundEffect[10]; + public static SoundEffectInstance[] soundInstanceZombie = new SoundEffectInstance[10]; + public static SoundEffect[] soundRoar = new SoundEffect[2]; + public static SoundEffectInstance[] soundInstanceRoar = new SoundEffectInstance[2]; + public static SoundEffect[] soundSplash = new SoundEffect[2]; + public static SoundEffectInstance[] soundInstanceSplash = new SoundEffectInstance[2]; + public static SoundEffect soundDoubleJump; + public static SoundEffectInstance soundInstanceDoubleJump; + public static SoundEffect soundRun; + public static SoundEffectInstance soundInstanceRun; + public static SoundEffect soundCoins; + public static SoundEffectInstance soundInstanceCoins; + public static SoundEffect soundUnlock; + public static SoundEffectInstance soundInstanceUnlock; + public static SoundEffect soundChat; + public static SoundEffectInstance soundInstanceChat; + public static SoundEffect soundMaxMana; + public static SoundEffectInstance soundInstanceMaxMana; + public static SoundEffect soundDrown; + public static SoundEffectInstance soundInstanceDrown; + public static AudioEngine engine; + public static SoundBank soundBank; + public static WaveBank waveBank; + public static Cue[] music = new Cue[30]; + public static float[] musicFade = new float[30]; + public static float musicVolume = 0.75f; + public static float soundVolume = 1f; + public static SpriteFont fontItemStack; + public static SpriteFont fontMouseText; + public static SpriteFont fontDeathText; + public static SpriteFont[] fontCombatText = new SpriteFont[2]; + public static bool[] tileLighted = new bool[251]; + public static bool[] tileMergeDirt = new bool[251]; + public static bool[] tileCut = new bool[251]; + public static bool[] tileAlch = new bool[251]; + public static int[] tileShine = new int[251]; + public static bool[] tileShine2 = new bool[251]; + public static bool[] wallHouse = new bool[113]; + public static bool[] wallDungeon = new bool[113]; + public static bool[] wallLight = new bool[113]; + public static int[] wallBlend = new int[113]; + public static bool[] tileStone = new bool[251]; + public static bool[] tilePick = new bool[251]; + public static bool[] tileAxe = new bool[251]; + public static bool[] tileHammer = new bool[251]; + public static bool[] tileWaterDeath = new bool[251]; + public static bool[] tileLavaDeath = new bool[251]; + public static bool[] tileTable = new bool[251]; + public static bool[] tileBlockLight = new bool[251]; + public static bool[] tileNoSunLight = new bool[251]; + public static bool[] tileDungeon = new bool[251]; + public static bool[] tileSolidTop = new bool[251]; + public static bool[] tileSolid = new bool[251]; + public static bool[] tileRope = new bool[251]; + public static bool[] tileBrick = new bool[251]; + public static bool[] tileMoss = new bool[251]; + public static bool[] tileNoAttach = new bool[251]; + public static bool[] tileNoFail = new bool[251]; + public static bool[] tileFrameImportant = new bool[251]; + public static bool[] tileSand = new bool[251]; + public static bool[] tileFlame = new bool[251]; + public static int[] tileFrame = new int[251]; + public static int[] tileFrameCounter = new int[251]; + public static int[] backgroundWidth = new int[185]; + public static int[] backgroundHeight = new int[185]; + public static bool tilesLoaded = false; + public static Map[,] map = new Map[Main.maxTilesX, Main.maxTilesY]; + public static Tile[,] tile = new Tile[Main.maxTilesX, Main.maxTilesY]; + public static Dust[] dust = new Dust[6001]; + public static Star[] star = new Star[130]; + public static Item[] item = new Item[401]; + public static NPC[] npc = new NPC[201]; + public static Gore[] gore = new Gore[501]; + public static Rain[] rain = new Rain[Main.maxRain + 1]; + public static Projectile[] projectile = new Projectile[1001]; + public static CombatText[] combatText = new CombatText[100]; + public static ItemText[] itemText = new ItemText[20]; + public static Chest[] chest = new Chest[1000]; + public static Sign[] sign = new Sign[1000]; + public static Vector2 screenPosition; + public static Vector2 screenLastPosition; + public static int screenWidth = 1152; + public static int screenHeight = 864; + public static int chatLength = 600; + public static bool chatMode = false; + public static bool chatRelease = false; + public static int showCount = 10; + public static int numChatLines = 500; + public static int startChatLine = 0; + public static string chatText = ""; + public static ChatLine[] chatLine = new ChatLine[Main.numChatLines]; + public static bool inputTextEnter = false; + public static float[] hotbarScale = new float[] + { + 1f, + 0.75f, + 0.75f, + 0.75f, + 0.75f, + 0.75f, + 0.75f, + 0.75f, + 0.75f, + 0.75f + }; + public static byte mouseTextColor = 0; + public static int mouseTextColorChange = 1; + public static bool mouseLeftRelease = false; + public static bool mouseRightRelease = false; + public static bool playerInventory = false; + public static int stackSplit; + public static int stackCounter = 0; + public static int stackDelay = 7; + public static int superFastStack = 0; + public static Item mouseItem = new Item(); + public static Item guideItem = new Item(); + public static Item reforgeItem = new Item(); + private static float inventoryScale = 0.75f; + public static bool hasFocus = true; + public static bool recFastScroll = false; + public static bool recBigList = false; + public static int recStart = 0; + public static Recipe[] recipe = new Recipe[Recipe.maxRecipes]; + public static int[] availableRecipe = new int[Recipe.maxRecipes]; + public static float[] availableRecipeY = new float[Recipe.maxRecipes]; + public static int numAvailableRecipes; + public static int focusRecipe; + public static int myPlayer = 0; + public static Player[] player = new Player[256]; + public static int spawnTileX; + public static int spawnTileY; + public static bool npcChatRelease = false; + public static bool editSign = false; + public static string signText = ""; + public static string npcChatText = ""; + public static bool npcChatFocus1 = false; + public static bool npcChatFocus2 = false; + public static bool npcChatFocus3 = false; + public static int npcShop = 0; + public static int numShops = 18; + public Chest[] shop = new Chest[Main.numShops]; + public static bool craftGuide = false; + public static bool reforge = false; + private static Item toolTip = new Item(); + private static int backSpaceCount = 0; + public static string motd = ""; + public bool toggleFullscreen; + private int numDisplayModes; + private int[] displayWidth = new int[99]; + private int[] displayHeight = new int[99]; + public static bool gameMenu = true; + private static int maxLoadPlayer = 1000; + private static int maxLoadWorld = 1000; + public static Player[] loadPlayer = new Player[Main.maxLoadPlayer]; + public static string[] loadPlayerPath = new string[Main.maxLoadPlayer]; + private static int numLoadPlayers = 0; + public static string playerPathName; + public static string[] loadWorld = new string[Main.maxLoadWorld]; + public static string[] loadWorldPath = new string[Main.maxLoadWorld]; + private static int numLoadWorlds = 0; + public static string worldPathName; + public static string SavePath = string.Concat(new object[] + { + Environment.GetFolderPath(Environment.SpecialFolder.Personal), + Path.DirectorySeparatorChar, + "My Games", + Path.DirectorySeparatorChar, + "Terraria" + }); + public static string WorldPath = Main.SavePath + Path.DirectorySeparatorChar + "Worlds"; + public static string PlayerPath = Main.SavePath + Path.DirectorySeparatorChar + "Players"; + public static string[] itemName = new string[1725]; + public static string[] npcName = new string[301]; + private static KeyboardState inputText; + private static KeyboardState oldInputText; + public static int invasionType = 0; + public static double invasionX = 0.0; + public static int invasionSize = 0; + public static int invasionDelay = 0; + public static int invasionWarn = 0; + public static int[] npcFrameCount = new int[] + { + 1, + 2, + 2, + 3, + 6, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 16, + 14, + 16, + 14, + 15, + 16, + 2, + 10, + 1, + 16, + 16, + 16, + 3, + 1, + 15, + 3, + 1, + 3, + 1, + 1, + 16, + 16, + 1, + 1, + 1, + 3, + 3, + 15, + 3, + 7, + 7, + 4, + 5, + 5, + 5, + 3, + 3, + 16, + 6, + 3, + 6, + 6, + 2, + 5, + 3, + 2, + 7, + 7, + 4, + 2, + 8, + 1, + 5, + 1, + 2, + 4, + 16, + 5, + 4, + 4, + 15, + 15, + 15, + 15, + 2, + 4, + 6, + 6, + 24, + 16, + 1, + 1, + 1, + 1, + 1, + 1, + 4, + 3, + 1, + 1, + 1, + 1, + 1, + 1, + 5, + 6, + 7, + 16, + 1, + 1, + 16, + 16, + 12, + 20, + 21, + 1, + 2, + 2, + 3, + 6, + 1, + 1, + 1, + 15, + 4, + 11, + 1, + 14, + 6, + 6, + 3, + 1, + 2, + 2, + 1, + 3, + 4, + 1, + 2, + 1, + 4, + 2, + 1, + 15, + 3, + 16, + 4, + 5, + 7, + 3, + 2, + 12, + 12, + 4, + 4, + 4, + 8, + 8, + 9, + 2, + 6, + 4, + 15, + 16, + 3, + 3, + 8, + 5, + 4, + 3, + 15, + 12, + 4, + 14, + 14, + 3, + 2, + 5, + 3, + 2, + 3, + 14, + 5, + 14, + 16, + 5, + 2, + 2, + 12, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 7, + 14, + 15, + 16, + 8, + 3, + 15, + 15, + 15, + 2, + 3, + 20, + 16, + 14, + 16, + 4, + 4, + 16, + 16, + 20, + 20, + 20, + 2, + 2, + 2, + 2, + 8, + 12, + 3, + 4, + 2, + 4, + 16, + 16, + 15, + 6, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 5, + 4, + 6, + 7, + 15, + 4, + 7, + 6, + 1, + 1, + 2, + 4, + 3, + 5, + 3, + 3, + 3, + 4, + 5, + 6, + 4, + 2, + 1, + 8, + 4, + 4, + 1, + 8, + 1, + 4, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 3, + 3, + 3, + 3, + 3, + 3, + 15, + 3, + 6, + 12, + 20, + 20, + 20, + 15, + 15, + 15, + 5, + 5, + 6, + 6 + }; + private static bool mouseExit = false; + private static float exitScale = 0.8f; + private static bool mouseReforge = false; + private static float reforgeScale = 0.8f; + public static Player clientPlayer = new Player(); + public static string getIP = Main.defaultIP; + public static string getPort = Convert.ToString(Netplay.serverPort); + public static bool menuMultiplayer = false; + public static bool menuServer = false; + public static int netMode = 0; + public static int timeOut = 120; + public static int netPlayCounter; + public static int lastNPCUpdate; + public static int lastItemUpdate; + public static int maxNPCUpdates = 5; + public static int maxItemUpdates = 5; + public static string cUp = "W"; + public static string cLeft = "A"; + public static string cDown = "S"; + public static string cRight = "D"; + public static string cJump = "Space"; + public static string cThrowItem = "T"; + public static string cHeal = "H"; + public static string cMana = "J"; + public static string cBuff = "B"; + public static string cHook = "E"; + public static string cTorch = "LeftShift"; + public static string cInv = "Escape"; + public static string cMapZoomIn = "Add"; + public static string cMapZoomOut = "Subtract"; + public static string cMapAlphaUp = "PageUp"; + public static string cMapAlphaDown = "PageDown"; + public static string cMapFull = "M"; + public static string cMapStyle = "Tab"; + public static Color mouseColor = new Color(255, 50, 95); + public static Color cursorColor = Color.White; + public static int cursorColorDirection = 1; + public static float cursorAlpha = 0f; + public static float cursorScale = 0f; + public static bool signBubble = false; + public static int signX = 0; + public static int signY = 0; + public static bool hideUI = false; + public static bool releaseUI = false; + public static bool fixedTiming = false; + private int splashCounter; + public static string oldStatusText = ""; + public static bool autoShutdown = false; + public int a; + public int b; + private float logoRotation; + private float logoRotationDirection = 1f; + private float logoRotationSpeed = 1f; + private float logoScale = 1f; + private float logoScaleDirection = 1f; + private float logoScaleSpeed = 1f; + private static int maxMenuItems = 14; + private float[] menuItemScale = new float[Main.maxMenuItems]; + private int focusMenu = -1; + private int selectedMenu = -1; + private int selectedMenu2 = -1; + private int selectedPlayer; + private int selectedWorld; + public static int menuMode = 0; + public static int menuSkip = 0; + private static Item cpItem = new Item(); + private int textBlinkerCount; + private int textBlinkerState; + public static string newWorldName = ""; + private static int dyeSlotCount = 0; + private static int accSlotCount = 0; + private static string hoverItemName = ""; + private static Color inventoryBack = new Color(220, 220, 220, 220); + private static bool mouseText = false; + private static int mH = 0; + private static int sX = Main.screenWidth - 800; + private static int starMana = 20; + private static float heartLife = 20f; + private static int rare = 0; + private Color selColor = Color.White; + private int focusColor; + private int colorDelay; + private int setKey = -1; + private int bgScroll; + public static bool autoPass = false; + public static int menuFocus = 0; + private float hBar = -1f; + private float sBar = -1f; + private float lBar = 1f; + private int grabColorSlider; + private bool blockMouse; + private bool[] menuWide = new bool[100]; + private static float tranSpeed = 0.05f; + private static float atmo = 0f; + private static float bgScale = 1f; + private static int bgW = (int)(1024f * Main.bgScale); + private static Color backColor = Color.White; + private static Color trueBackColor = Main.backColor; + private float screenOff; + private float scAdj; + private float cTop; + [CompilerGenerated] + private static Action CachedAnonymousMethodDelegate1; + [DllImport("User32")] + private static extern int RemoveMenu(IntPtr hMenu, int nPosition, int wFlags); + [DllImport("User32")] + private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert); + [DllImport("User32")] + private static extern int GetMenuItemCount(IntPtr hWnd); + [DllImport("kernel32.dll")] + public static extern IntPtr LoadLibrary(string dllToLoad); + public static void LoadWorlds() + { + Directory.CreateDirectory(Main.WorldPath); + string[] files = Directory.GetFiles(Main.WorldPath, "*.wld"); + int num = files.Length; + if (!Main.dedServ && num > Main.maxLoadWorld) + { + num = Main.maxLoadWorld; + } + for (int i = 0; i < num; i++) + { + Main.loadWorldPath[i] = files[i]; + try + { + using (FileStream fileStream = new FileStream(Main.loadWorldPath[i], FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader(fileStream)) + { + binaryReader.ReadInt32(); + Main.loadWorld[i] = binaryReader.ReadString(); + binaryReader.Close(); + } + } + } + catch + { + Main.loadWorld[i] = Main.loadWorldPath[i]; + } + } + Main.numLoadWorlds = num; + } + private static void LoadPlayers() + { + Directory.CreateDirectory(Main.PlayerPath); + string[] files = Directory.GetFiles(Main.PlayerPath, "*.plr"); + int num = files.Length; + if (num > Main.maxLoadPlayer) + { + num = Main.maxLoadPlayer; + } + for (int i = 0; i < num; i++) + { + Main.loadPlayer[i] = new Player(); + if (i < num) + { + Main.loadPlayerPath[i] = files[i]; + Main.loadPlayer[i] = Player.LoadPlayer(Main.loadPlayerPath[i]); + } + } + Main.numLoadPlayers = num; + } + protected void OpenRecent() + { + try + { + if (File.Exists(Main.SavePath + Path.DirectorySeparatorChar + "servers.dat")) + { + using (FileStream fileStream = new FileStream(Main.SavePath + Path.DirectorySeparatorChar + "servers.dat", FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader(fileStream)) + { + binaryReader.ReadInt32(); + for (int i = 0; i < 10; i++) + { + Main.recentWorld[i] = binaryReader.ReadString(); + Main.recentIP[i] = binaryReader.ReadString(); + Main.recentPort[i] = binaryReader.ReadInt32(); + } + } + } + } + } + catch + { + } + } + public static void SaveRecent() + { + Directory.CreateDirectory(Main.SavePath); + try + { + File.SetAttributes(Main.SavePath + Path.DirectorySeparatorChar + "servers.dat", FileAttributes.Normal); + } + catch + { + } + try + { + using (FileStream fileStream = new FileStream(Main.SavePath + Path.DirectorySeparatorChar + "servers.dat", FileMode.Create)) + { + using (BinaryWriter binaryWriter = new BinaryWriter(fileStream)) + { + binaryWriter.Write(Main.curRelease); + for (int i = 0; i < 10; i++) + { + binaryWriter.Write(Main.recentWorld[i]); + binaryWriter.Write(Main.recentIP[i]); + binaryWriter.Write(Main.recentPort[i]); + } + } + } + } + catch + { + } + } + protected void SaveSettings() + { + Directory.CreateDirectory(Main.SavePath); + try + { + File.SetAttributes(Main.SavePath + Path.DirectorySeparatorChar + "config.dat", FileAttributes.Normal); + } + catch + { + } + try + { + using (FileStream fileStream = new FileStream(Main.SavePath + Path.DirectorySeparatorChar + "config.dat", FileMode.Create)) + { + using (BinaryWriter binaryWriter = new BinaryWriter(fileStream)) + { + binaryWriter.Write(Main.curRelease); + binaryWriter.Write(Main.clientUUID); + binaryWriter.Write(this.graphics.IsFullScreen); + binaryWriter.Write(Main.mouseColor.R); + binaryWriter.Write(Main.mouseColor.G); + binaryWriter.Write(Main.mouseColor.B); + binaryWriter.Write(Main.soundVolume); + binaryWriter.Write(Main.musicVolume); + binaryWriter.Write(Main.cUp); + binaryWriter.Write(Main.cDown); + binaryWriter.Write(Main.cLeft); + binaryWriter.Write(Main.cRight); + binaryWriter.Write(Main.cJump); + binaryWriter.Write(Main.cThrowItem); + binaryWriter.Write(Main.cInv); + binaryWriter.Write(Main.cHeal); + binaryWriter.Write(Main.cMana); + binaryWriter.Write(Main.cBuff); + binaryWriter.Write(Main.cHook); + binaryWriter.Write(Main.caveParrallax); + binaryWriter.Write(Main.fixedTiming); + binaryWriter.Write(this.graphics.PreferredBackBufferWidth); + binaryWriter.Write(this.graphics.PreferredBackBufferHeight); + binaryWriter.Write(Main.autoSave); + binaryWriter.Write(Main.autoPause); + binaryWriter.Write(Main.showItemText); + binaryWriter.Write(Main.cTorch); + binaryWriter.Write((byte)Lighting.lightMode); + binaryWriter.Write((byte)Main.qaStyle); + binaryWriter.Write(Main.owBack); + binaryWriter.Write((byte)Lang.lang); + binaryWriter.Write(Main.mapEnabled); + binaryWriter.Write(Main.cMapStyle); + binaryWriter.Write(Main.cMapFull); + binaryWriter.Write(Main.cMapZoomIn); + binaryWriter.Write(Main.cMapZoomOut); + binaryWriter.Write(Main.cMapAlphaUp); + binaryWriter.Write(Main.cMapAlphaDown); + binaryWriter.Close(); + } + } + } + catch + { + } + } + protected void CheckBunny() + { + try + { + RegistryKey registryKey = Registry.CurrentUser; + registryKey = registryKey.CreateSubKey("Software\\Terraria"); + if (registryKey != null && registryKey.GetValue("Bunny") != null && registryKey.GetValue("Bunny").ToString() == "1") + { + Main.cEd = true; + } + } + catch + { + Main.cEd = false; + } + } + protected void OpenSettings() + { + try + { + bool flag = false; + if (File.Exists(Main.SavePath + Path.DirectorySeparatorChar + "config.dat")) + { + using (FileStream fileStream = new FileStream(Main.SavePath + Path.DirectorySeparatorChar + "config.dat", FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader(fileStream)) + { + int num = binaryReader.ReadInt32(); + if (num < 68) + { + flag = true; + } + else + { + if (num >= 67) + { + Main.clientUUID = binaryReader.ReadString(); + } + else + { + flag = true; + } + bool flag2 = binaryReader.ReadBoolean(); + Main.mouseColor.R = binaryReader.ReadByte(); + Main.mouseColor.G = binaryReader.ReadByte(); + Main.mouseColor.B = binaryReader.ReadByte(); + Main.soundVolume = binaryReader.ReadSingle(); + Main.musicVolume = binaryReader.ReadSingle(); + Main.cUp = binaryReader.ReadString(); + Main.cDown = binaryReader.ReadString(); + Main.cLeft = binaryReader.ReadString(); + Main.cRight = binaryReader.ReadString(); + Main.cJump = binaryReader.ReadString(); + Main.cThrowItem = binaryReader.ReadString(); + if (num >= 1) + { + Main.cInv = binaryReader.ReadString(); + } + if (num >= 12) + { + Main.cHeal = binaryReader.ReadString(); + Main.cMana = binaryReader.ReadString(); + Main.cBuff = binaryReader.ReadString(); + } + if (num >= 13) + { + Main.cHook = binaryReader.ReadString(); + } + Main.caveParrallax = binaryReader.ReadSingle(); + if (num >= 2) + { + Main.fixedTiming = binaryReader.ReadBoolean(); + } + if (num >= 4) + { + this.graphics.PreferredBackBufferWidth = binaryReader.ReadInt32(); + this.graphics.PreferredBackBufferHeight = binaryReader.ReadInt32(); + } + if (num >= 8) + { + Main.autoSave = binaryReader.ReadBoolean(); + } + if (num >= 9) + { + Main.autoPause = binaryReader.ReadBoolean(); + } + if (num >= 19) + { + Main.showItemText = binaryReader.ReadBoolean(); + } + if (num >= 30) + { + Main.cTorch = binaryReader.ReadString(); + Lighting.lightMode = (int)binaryReader.ReadByte(); + Main.qaStyle = (int)binaryReader.ReadByte(); + } + if (num >= 37) + { + Main.owBack = binaryReader.ReadBoolean(); + } + if (num >= 39) + { + Lang.lang = (int)binaryReader.ReadByte(); + } + if (num >= 46) + { + Main.mapEnabled = binaryReader.ReadBoolean(); + Main.cMapStyle = binaryReader.ReadString(); + Main.cMapFull = binaryReader.ReadString(); + Main.cMapZoomIn = binaryReader.ReadString(); + Main.cMapZoomOut = binaryReader.ReadString(); + Main.cMapAlphaUp = binaryReader.ReadString(); + Main.cMapAlphaDown = binaryReader.ReadString(); + } + if (flag2 && !this.graphics.IsFullScreen) + { + this.graphics.ToggleFullScreen(); + } + } + binaryReader.Close(); + } + } + } + if (flag) + { + this.SaveSettings(); + } + } + catch + { + } + } + private static void ErasePlayer(int i) + { + try + { + File.Delete(Main.loadPlayerPath[i]); + File.Delete(Main.loadPlayerPath[i] + ".bak"); + } + catch + { + } + try + { + string path = Main.loadPlayerPath[i].Substring(0, Main.loadPlayerPath[i].Length - 4); + if (Directory.Exists(path)) + { + Directory.Delete(path, true); + } + Main.LoadPlayers(); + } + catch + { + } + } + private static void EraseWorld(int i) + { + try + { + File.Delete(Main.loadWorldPath[i]); + File.Delete(Main.loadWorldPath[i] + ".bak"); + Main.LoadWorlds(); + } + catch + { + } + } + private static string getPlayerPathName(string playerName) + { + string text = ""; + for (int i = 0; i < playerName.Length; i++) + { + string text2 = playerName.Substring(i, 1); + string str; + if (text2 == "a" || text2 == "b" || text2 == "c" || text2 == "d" || text2 == "e" || text2 == "f" || text2 == "g" || text2 == "h" || text2 == "i" || text2 == "j" || text2 == "k" || text2 == "l" || text2 == "m" || text2 == "n" || text2 == "o" || text2 == "p" || text2 == "q" || text2 == "r" || text2 == "s" || text2 == "t" || text2 == "u" || text2 == "v" || text2 == "w" || text2 == "x" || text2 == "y" || text2 == "z" || text2 == "A" || text2 == "B" || text2 == "C" || text2 == "D" || text2 == "E" || text2 == "F" || text2 == "G" || text2 == "H" || text2 == "I" || text2 == "J" || text2 == "K" || text2 == "L" || text2 == "M" || text2 == "N" || text2 == "O" || text2 == "P" || text2 == "Q" || text2 == "R" || text2 == "S" || text2 == "T" || text2 == "U" || text2 == "V" || text2 == "W" || text2 == "X" || text2 == "Y" || text2 == "Z" || text2 == "1" || text2 == "2" || text2 == "3" || text2 == "4" || text2 == "5" || text2 == "6" || text2 == "7" || text2 == "8" || text2 == "9" || text2 == "0") + { + str = text2; + } + else + { + if (text2 == " ") + { + str = "_"; + } + else + { + str = "-"; + } + } + text += str; + } + if (File.Exists(string.Concat(new object[] + { + Main.PlayerPath, + Path.DirectorySeparatorChar, + text, + ".plr" + }))) + { + int num = 2; + while (File.Exists(string.Concat(new object[] + { + Main.PlayerPath, + Path.DirectorySeparatorChar, + text, + num, + ".plr" + }))) + { + num++; + } + text += num; + } + return string.Concat(new object[] + { + Main.PlayerPath, + Path.DirectorySeparatorChar, + text, + ".plr" + }); + } + private static string getWorldPathName(string worldName) + { + string text = ""; + for (int i = 0; i < worldName.Length; i++) + { + string text2 = worldName.Substring(i, 1); + string str; + if (text2 == "a" || text2 == "b" || text2 == "c" || text2 == "d" || text2 == "e" || text2 == "f" || text2 == "g" || text2 == "h" || text2 == "i" || text2 == "j" || text2 == "k" || text2 == "l" || text2 == "m" || text2 == "n" || text2 == "o" || text2 == "p" || text2 == "q" || text2 == "r" || text2 == "s" || text2 == "t" || text2 == "u" || text2 == "v" || text2 == "w" || text2 == "x" || text2 == "y" || text2 == "z" || text2 == "A" || text2 == "B" || text2 == "C" || text2 == "D" || text2 == "E" || text2 == "F" || text2 == "G" || text2 == "H" || text2 == "I" || text2 == "J" || text2 == "K" || text2 == "L" || text2 == "M" || text2 == "N" || text2 == "O" || text2 == "P" || text2 == "Q" || text2 == "R" || text2 == "S" || text2 == "T" || text2 == "U" || text2 == "V" || text2 == "W" || text2 == "X" || text2 == "Y" || text2 == "Z" || text2 == "1" || text2 == "2" || text2 == "3" || text2 == "4" || text2 == "5" || text2 == "6" || text2 == "7" || text2 == "8" || text2 == "9" || text2 == "0") + { + str = text2; + } + else + { + if (text2 == " ") + { + str = "_"; + } + else + { + str = "-"; + } + } + text += str; + } + if (File.Exists(string.Concat(new object[] + { + Main.WorldPath, + Path.DirectorySeparatorChar, + text, + ".wld" + }))) + { + int num = 2; + while (File.Exists(string.Concat(new object[] + { + Main.WorldPath, + Path.DirectorySeparatorChar, + text, + num, + ".wld" + }))) + { + num++; + } + text += num; + } + return string.Concat(new object[] + { + Main.WorldPath, + Path.DirectorySeparatorChar, + text, + ".wld" + }); + } + public void autoCreate(string newOpt) + { + if (newOpt == "0") + { + Main.autoGen = false; + return; + } + if (newOpt == "1") + { + Main.maxTilesX = 4200; + Main.maxTilesY = 1200; + Main.autoGen = true; + return; + } + if (newOpt == "2") + { + Main.maxTilesX = 6300; + Main.maxTilesY = 1800; + Main.autoGen = true; + return; + } + if (newOpt == "3") + { + Main.maxTilesX = 8400; + Main.maxTilesY = 2400; + Main.autoGen = true; + } + } + public void NewMOTD(string newMOTD) + { + Main.motd = newMOTD; + } + public void LoadDedConfig(string configPath) + { + if (File.Exists(configPath)) + { + using (StreamReader streamReader = new StreamReader(configPath)) + { + string text; + while ((text = streamReader.ReadLine()) != null) + { + try + { + if (text.Length > 6 && text.Substring(0, 6).ToLower() == "world=") + { + string text2 = text.Substring(6); + Main.worldPathName = text2; + } + if (text.Length > 5 && text.Substring(0, 5).ToLower() == "port=") + { + string value = text.Substring(5); + try + { + int serverPort = Convert.ToInt32(value); + Netplay.serverPort = serverPort; + } + catch + { + } + } + if (text.Length > 11 && text.Substring(0, 11).ToLower() == "maxplayers=") + { + string value2 = text.Substring(11); + try + { + int num = Convert.ToInt32(value2); + Main.maxNetPlayers = num; + } + catch + { + } + } + if (text.Length > 11 && text.Substring(0, 9).ToLower() == "priority=") + { + string value3 = text.Substring(9); + try + { + int num2 = Convert.ToInt32(value3); + if (num2 >= 0 && num2 <= 5) + { + Process currentProcess = Process.GetCurrentProcess(); + if (num2 == 0) + { + currentProcess.PriorityClass = ProcessPriorityClass.RealTime; + } + else + { + if (num2 == 1) + { + currentProcess.PriorityClass = ProcessPriorityClass.High; + } + else + { + if (num2 == 2) + { + currentProcess.PriorityClass = ProcessPriorityClass.AboveNormal; + } + else + { + if (num2 == 3) + { + currentProcess.PriorityClass = ProcessPriorityClass.Normal; + } + else + { + if (num2 == 4) + { + currentProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + } + else + { + if (num2 == 5) + { + currentProcess.PriorityClass = ProcessPriorityClass.Idle; + } + } + } + } + } + } + } + } + catch + { + } + } + if (text.Length > 9 && text.Substring(0, 9).ToLower() == "password=") + { + string password = text.Substring(9); + Netplay.password = password; + } + if (text.Length > 5 && text.Substring(0, 5).ToLower() == "motd=") + { + string text3 = text.Substring(5); + Main.motd = text3; + } + if (text.Length > 5 && text.Substring(0, 5).ToLower() == "lang=") + { + string value4 = text.Substring(5); + Lang.lang = Convert.ToInt32(value4); + } + if (text.Length >= 10 && text.Substring(0, 10).ToLower() == "worldpath=") + { + string worldPath = text.Substring(10); + Main.WorldPath = worldPath; + } + if (text.Length >= 10 && text.Substring(0, 10).ToLower() == "worldname=") + { + string text4 = text.Substring(10); + Main.worldName = text4; + } + if (text.Length > 8 && text.Substring(0, 8).ToLower() == "banlist=") + { + string banFile = text.Substring(8); + Netplay.banFile = banFile; + } + if (text.Length > 11 && text.Substring(0, 11).ToLower() == "autocreate=") + { + string text5 = text.Substring(11); + if (text5 == "0") + { + Main.autoGen = false; + } + else + { + if (text5 == "1") + { + Main.maxTilesX = 4200; + Main.maxTilesY = 1200; + Main.autoGen = true; + } + else + { + if (text5 == "2") + { + Main.maxTilesX = 6300; + Main.maxTilesY = 1800; + Main.autoGen = true; + } + else + { + if (text5 == "3") + { + Main.maxTilesX = 8400; + Main.maxTilesY = 2400; + Main.autoGen = true; + } + } + } + } + } + if (text.Length > 7 && text.Substring(0, 7).ToLower() == "secure=") + { + string text6 = text.Substring(7); + if (text6 == "1") + { + Netplay.spamCheck = true; + } + } + if (text.Length > 5 && text.Substring(0, 5).ToLower() == "upnp=") + { + string text7 = text.Substring(5); + if (text7 != "1") + { + Netplay.uPNP = false; + } + } + if (text.Length > 5 && text.Substring(0, 10).ToLower() == "npcstream=") + { + string value5 = text.Substring(10); + try + { + int num3 = Convert.ToInt32(value5); + Main.npcStreamSpeed = num3; + } + catch + { + } + } + } + catch + { + } + } + } + } + } + public void SetNetPlayers(int mPlayers) + { + Main.maxNetPlayers = mPlayers; + } + public void SetWorld(string wrold) + { + Main.worldPathName = wrold; + } + public void SetWorldName(string wrold) + { + Main.worldName = wrold; + } + public void autoShut() + { + Main.autoShutdown = true; + } + [DllImport("user32.dll")] + public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + [DllImport("user32.dll")] + private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); + public void AutoPass() + { + Main.autoPass = true; + } + public void AutoJoin(string IP) + { + Main.defaultIP = IP; + Main.getIP = IP; + Netplay.SetIP(Main.defaultIP); + Main.autoJoin = true; + } + public void AutoHost() + { + Main.menuMultiplayer = true; + Main.menuServer = true; + Main.menuMode = 1; + } + public void loadLib(string path) + { + Main.libPath = path; + Main.LoadLibrary(Main.libPath); + } + public void DedServ() + { + Main.rand = new Random(); + if (Main.autoShutdown) + { + string text = "terraria" + Main.rand.Next(2147483647); + Console.Title = text; + IntPtr intPtr = Main.FindWindow(null, text); + if (intPtr != IntPtr.Zero) + { + Main.ShowWindow(intPtr, 0); + } + } + else + { + Console.Title = "Terraria Server " + Main.versionNumber2; + } + Main.dedServ = true; + Main.showSplash = false; + this.Initialize(); + Lang.setLang(false); + for (int i = 0; i < 301; i++) + { + NPC nPC = new NPC(); + nPC.SetDefaults(i, -1f); + Main.npcName[i] = nPC.name; + } + while (Main.worldPathName == null || Main.worldPathName == "") + { + Main.LoadWorlds(); + bool flag = true; + while (flag) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + for (int j = 0; j < Main.numLoadWorlds; j++) + { + Console.WriteLine(string.Concat(new object[] + { + j + 1, + '\t', + '\t', + Main.loadWorld[j] + })); + } + Console.WriteLine(string.Concat(new object[] + { + "n", + '\t', + '\t', + "New World" + })); + Console.WriteLine("d " + '\t' + "Delete World"); + Console.WriteLine(""); + Console.Write("Choose World: "); + string text2 = Console.ReadLine(); + try + { + Console.Clear(); + } + catch + { + } + if (text2.Length >= 2 && text2.Substring(0, 2).ToLower() == "d ") + { + try + { + int num = Convert.ToInt32(text2.Substring(2)) - 1; + if (num < Main.numLoadWorlds) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.WriteLine("Really delete " + Main.loadWorld[num] + "?"); + Console.Write("(y/n): "); + string text3 = Console.ReadLine(); + if (text3.ToLower() == "y") + { + Main.EraseWorld(num); + } + } + } + catch + { + } + try + { + Console.Clear(); + continue; + } + catch + { + continue; + } + } + if (text2 == "n" || text2 == "N") + { + bool flag2 = true; + while (flag2) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.WriteLine("1" + '\t' + "Small"); + Console.WriteLine("2" + '\t' + "Medium"); + Console.WriteLine("3" + '\t' + "Large"); + Console.WriteLine(""); + Console.Write("Choose size: "); + string value = Console.ReadLine(); + try + { + int num2 = Convert.ToInt32(value); + if (num2 == 1) + { + Main.maxTilesX = 4200; + Main.maxTilesY = 1200; + flag2 = false; + } + else + { + if (num2 == 2) + { + Main.maxTilesX = 6400; + Main.maxTilesY = 1800; + flag2 = false; + } + else + { + if (num2 == 3) + { + Main.maxTilesX = 8400; + Main.maxTilesY = 2400; + flag2 = false; + } + } + } + } + catch + { + } + try + { + Console.Clear(); + } + catch + { + } + } + flag2 = true; + while (flag2) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.Write("Enter world name: "); + Main.newWorldName = Console.ReadLine(); + if (Main.newWorldName != "" && Main.newWorldName != " " && Main.newWorldName != null) + { + flag2 = false; + } + try + { + Console.Clear(); + } + catch + { + } + } + Main.worldName = Main.newWorldName; + Main.worldPathName = Main.getWorldPathName(Main.worldName); + Main.menuMode = 10; + WorldGen.CreateNewWorld(); + flag2 = false; + while (Main.menuMode == 10) + { + if (Main.oldStatusText != Main.statusText) + { + Main.oldStatusText = Main.statusText; + Console.WriteLine(Main.statusText); + } + } + try + { + Console.Clear(); + continue; + } + catch + { + continue; + } + } + try + { + int num3 = Convert.ToInt32(text2); + num3--; + if (num3 >= 0 && num3 < Main.numLoadWorlds) + { + bool flag3 = true; + while (flag3) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.Write("Max players (press enter for 8): "); + string value2 = Console.ReadLine(); + try + { + if (value2 == "") + { + value2 = "8"; + } + int num4 = Convert.ToInt32(value2); + if (num4 <= 255 && num4 >= 1) + { + Main.maxNetPlayers = num4; + flag3 = false; + } + flag3 = false; + } + catch + { + } + try + { + Console.Clear(); + } + catch + { + } + } + flag3 = true; + while (flag3) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.Write("Server port (press enter for 7777): "); + string value3 = Console.ReadLine(); + try + { + if (value3 == "") + { + value3 = "7777"; + } + int num5 = Convert.ToInt32(value3); + if (num5 <= 65535) + { + Netplay.serverPort = num5; + flag3 = false; + } + } + catch + { + } + try + { + Console.Clear(); + } + catch + { + } + } + flag3 = true; + while (flag3) + { + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.Write("Automatically forward port? (y/n): "); + string text4 = Console.ReadLine(); + try + { + if (text4 == "" || text4.ToLower() == "y" || text4.ToLower() == "yes") + { + Netplay.uPNP = true; + flag3 = false; + } + else + { + if (text4.ToLower() == "n" || text4.ToLower() == "no") + { + Netplay.uPNP = false; + flag3 = false; + } + } + } + catch + { + } + try + { + Console.Clear(); + } + catch + { + } + } + Console.WriteLine("Terraria Server " + Main.versionNumber2); + Console.WriteLine(""); + Console.Write("Server password (press enter for none): "); + Netplay.password = Console.ReadLine(); + Main.worldPathName = Main.loadWorldPath[num3]; + flag = false; + try + { + Console.Clear(); + } + catch + { + } + } + } + catch + { + } + } + } + try + { + Console.Clear(); + } + catch + { + } + WorldGen.serverLoadWorld(); + Console.WriteLine("Terraria Server " + Main.versionNumber); + Console.WriteLine(""); + while (!Netplay.ServerUp) + { + if (Main.oldStatusText != Main.statusText) + { + Main.oldStatusText = Main.statusText; + Console.WriteLine(Main.statusText); + } + } + try + { + Console.Clear(); + } + catch + { + } + Console.WriteLine("Terraria Server " + Main.versionNumber); + Console.WriteLine(""); + Console.WriteLine("Listening on port " + Netplay.serverPort); + Console.WriteLine("Type 'help' for a list of commands."); + Console.WriteLine(""); + Console.Title = "Terraria Server: " + Main.worldName; + Stopwatch stopwatch = new Stopwatch(); + if (!Main.autoShutdown) + { + Main.startDedInput(); + } + stopwatch.Start(); + double num6 = 16.666666666666668; + double num7 = 0.0; + int num8 = 0; + Stopwatch stopwatch2 = new Stopwatch(); + stopwatch2.Start(); + while (!Netplay.disconnect) + { + double num9 = (double)stopwatch.ElapsedMilliseconds; + if (num9 + num7 >= num6) + { + num8++; + num7 += num9 - num6; + stopwatch.Reset(); + stopwatch.Start(); + if (Main.oldStatusText != Main.statusText) + { + Main.oldStatusText = Main.statusText; + Console.WriteLine(Main.statusText); + } + if (Netplay.anyClients) + { + this.Update(new GameTime()); + } + double num10 = (double)stopwatch.ElapsedMilliseconds + num7; + if (num10 < num6) + { + int num11 = (int)(num6 - num10) - 1; + if (num11 > 1) + { + Thread.Sleep(num11 - 1); + if (!Netplay.anyClients) + { + num7 = 0.0; + Thread.Sleep(10); + } + } + } + } + Thread.Sleep(0); + } + } + public static void startDedInput() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(Main.startDedInputCallBack), 1); + } + public static void startDedInputCallBack(object threadContext) + { + while (!Netplay.disconnect) + { + Console.Write(": "); + string text = Console.ReadLine(); + string text2 = text; + text = text.ToLower(); + try + { + if (text == "help") + { + Console.WriteLine("Available commands:"); + Console.WriteLine(""); + Console.WriteLine(string.Concat(new object[] + { + "help ", + '\t', + '\t', + " Displays a list of commands." + })); + Console.WriteLine("playing " + '\t' + " Shows the list of players"); + Console.WriteLine(string.Concat(new object[] + { + "clear ", + '\t', + '\t', + " Clear the console window." + })); + Console.WriteLine(string.Concat(new object[] + { + "exit ", + '\t', + '\t', + " Shutdown the server and save." + })); + Console.WriteLine("exit-nosave " + '\t' + " Shutdown the server without saving."); + Console.WriteLine(string.Concat(new object[] + { + "save ", + '\t', + '\t', + " Save the game world." + })); + Console.WriteLine("kick " + '\t' + " Kicks a player from the server."); + Console.WriteLine("ban " + '\t' + " Bans a player from the server."); + Console.WriteLine("password" + '\t' + " Show password."); + Console.WriteLine("password " + '\t' + " Change password."); + Console.WriteLine(string.Concat(new object[] + { + "version", + '\t', + '\t', + " Print version number." + })); + Console.WriteLine(string.Concat(new object[] + { + "time", + '\t', + '\t', + " Display game time." + })); + Console.WriteLine(string.Concat(new object[] + { + "port", + '\t', + '\t', + " Print the listening port." + })); + Console.WriteLine("maxplayers" + '\t' + " Print the max number of players."); + Console.WriteLine("say " + '\t' + " Send a message."); + Console.WriteLine(string.Concat(new object[] + { + "motd", + '\t', + '\t', + " Print MOTD." + })); + Console.WriteLine("motd " + '\t' + " Change MOTD."); + Console.WriteLine(string.Concat(new object[] + { + "dawn", + '\t', + '\t', + " Change time to dawn." + })); + Console.WriteLine(string.Concat(new object[] + { + "noon", + '\t', + '\t', + " Change time to noon." + })); + Console.WriteLine(string.Concat(new object[] + { + "dusk", + '\t', + '\t', + " Change time to dusk." + })); + Console.WriteLine("midnight" + '\t' + " Change time to midnight."); + Console.WriteLine(string.Concat(new object[] + { + "settle", + '\t', + '\t', + " Settle all water." + })); + } + else + { + if (text == "settle") + { + if (!Liquid.panicMode) + { + Liquid.StartPanic(); + } + else + { + Console.WriteLine("Water is already settling"); + } + } + else + { + if (text == "dawn") + { + Main.dayTime = true; + Main.time = 0.0; + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + else + { + if (text == "dusk") + { + Main.dayTime = false; + Main.time = 0.0; + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + else + { + if (text == "noon") + { + Main.dayTime = true; + Main.time = 27000.0; + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + else + { + if (text == "midnight") + { + Main.dayTime = false; + Main.time = 16200.0; + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + else + { + if (text == "exit-nosave") + { + Netplay.disconnect = true; + } + else + { + if (text == "exit") + { + WorldGen.saveWorld(false); + Netplay.disconnect = true; + } + else + { + if (text == "fps") + { + if (!Main.dedServFPS) + { + Main.dedServFPS = true; + Main.fpsTimer.Reset(); + } + else + { + Main.dedServCount1 = 0; + Main.dedServCount2 = 0; + Main.dedServFPS = false; + } + } + else + { + if (text == "save") + { + WorldGen.saveWorld(false); + } + else + { + if (text == "time") + { + string text3 = "AM"; + double num = Main.time; + if (!Main.dayTime) + { + num += 54000.0; + } + num = num / 86400.0 * 24.0; + double num2 = 7.5; + num = num - num2 - 12.0; + if (num < 0.0) + { + num += 24.0; + } + if (num >= 12.0) + { + text3 = "PM"; + } + int num3 = (int)num; + double num4 = num - (double)num3; + num4 = (double)((int)(num4 * 60.0)); + string text4 = string.Concat(num4); + if (num4 < 10.0) + { + text4 = "0" + text4; + } + if (num3 > 12) + { + num3 -= 12; + } + if (num3 == 0) + { + num3 = 12; + } + Console.WriteLine(string.Concat(new object[] + { + "Time: ", + num3, + ":", + text4, + " ", + text3 + })); + } + else + { + if (text == "maxplayers") + { + Console.WriteLine("Player limit: " + Main.maxNetPlayers); + } + else + { + if (text == "port") + { + Console.WriteLine("Port: " + Netplay.serverPort); + } + else + { + if (text == "version") + { + Console.WriteLine("Terraria Server " + Main.versionNumber); + } + else + { + if (text == "clear") + { + try + { + Console.Clear(); + continue; + } + catch + { + continue; + } + } + if (text == "playing") + { + int num5 = 0; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active) + { + num5++; + Console.WriteLine(string.Concat(new object[] + { + Main.player[i].name, + " (", + Netplay.serverSock[i].tcpClient.Client.RemoteEndPoint, + ")" + })); + } + } + if (num5 == 0) + { + Console.WriteLine("No players connected."); + } + else + { + if (num5 == 1) + { + Console.WriteLine("1 player connected."); + } + else + { + Console.WriteLine(num5 + " players connected."); + } + } + } + else + { + if (!(text == "")) + { + if (text == "motd") + { + if (Main.motd == "") + { + Console.WriteLine("Welcome to " + Main.worldName + "!"); + } + else + { + Console.WriteLine("MOTD: " + Main.motd); + } + } + else + { + if (text.Length >= 5 && text.Substring(0, 5) == "motd ") + { + string text5 = text2.Substring(5); + Main.motd = text5; + } + else + { + if (text.Length == 8 && text.Substring(0, 8) == "password") + { + if (Netplay.password == "") + { + Console.WriteLine("No password set."); + } + else + { + Console.WriteLine("Password: " + Netplay.password); + } + } + else + { + if (text.Length >= 9 && text.Substring(0, 9) == "password ") + { + string password = text2.Substring(9); + if (password == "") + { + Netplay.password = ""; + Console.WriteLine("Password disabled."); + } + else + { + Netplay.password = password; + Console.WriteLine("Password: " + Netplay.password); + } + } + else + { + if (text == "say") + { + Console.WriteLine("Usage: say "); + } + else + { + if (text.Length >= 4 && text.Substring(0, 4) == "say ") + { + string str = text2.Substring(4); + if (str == "") + { + Console.WriteLine("Usage: say "); + } + else + { + Console.WriteLine(" " + str); + NetMessage.SendData(25, -1, -1, " " + str, 255, 255f, 240f, 20f, 0); + } + } + else + { + if (text.Length == 4 && text.Substring(0, 4) == "kick") + { + Console.WriteLine("Usage: kick "); + } + else + { + if (text.Length >= 5 && text.Substring(0, 5) == "kick ") + { + string text6 = text.Substring(5); + text6 = text6.ToLower(); + if (text6 == "") + { + Console.WriteLine("Usage: kick "); + } + else + { + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && Main.player[j].name.ToLower() == text6) + { + NetMessage.SendData(2, j, -1, "Kicked from server.", 0, 0f, 0f, 0f, 0); + } + } + } + } + else + { + if (text.Length == 3 && text.Substring(0, 3) == "ban") + { + Console.WriteLine("Usage: ban "); + } + else + { + if (text.Length >= 4 && text.Substring(0, 4) == "ban ") + { + string text7 = text.Substring(4); + text7 = text7.ToLower(); + if (text7 == "") + { + Console.WriteLine("Usage: ban "); + } + else + { + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active && Main.player[k].name.ToLower() == text7) + { + Netplay.AddBan(k); + NetMessage.SendData(2, k, -1, "Banned from server.", 0, 0f, 0f, 0f, 0); + } + } + } + } + else + { + Console.WriteLine("Invalid command."); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + catch + { + Console.WriteLine("Invalid command."); + } + } + } + public Main() + { + this.graphics = new GraphicsDeviceManager(this); + base.Content.RootDirectory = "Content"; + } + protected void SetTitle() + { + base.Window.Title = Lang.title(); + } + protected override void Initialize() + { + NPC.clrNames(); + NPC.setNames(); + WorldGen.randomBackgrounds(); + WorldGen.setCaveBacks(); + WorldGen.randMoon(); + Main.bgAlpha[0] = 1f; + Main.bgAlpha2[0] = 1f; + this.invBottom = 258; + for (int i = 0; i < 311; i++) + { + Main.projFrames[i] = 1; + } + Main.projFrames[308] = 10; + Main.projFrames[275] = 2; + Main.projFrames[276] = 2; + Main.projFrames[254] = 5; + Main.projFrames[307] = 2; + Main.projFrames[72] = 4; + Main.projFrames[86] = 4; + Main.projFrames[87] = 4; + Main.projFrames[102] = 2; + Main.projFrames[111] = 8; + Main.projFrames[112] = 3; + Main.projFrames[127] = 16; + Main.projFrames[175] = 2; + Main.projFrames[181] = 4; + Main.projFrames[189] = 4; + Main.projFrames[191] = 18; + Main.projFrames[192] = 18; + Main.projFrames[193] = 18; + Main.projFrames[194] = 18; + Main.projFrames[190] = 4; + Main.projFrames[198] = 4; + Main.projFrames[199] = 8; + Main.projFrames[200] = 10; + Main.projFrames[206] = 5; + Main.projFrames[208] = 5; + Main.projFrames[209] = 12; + Main.projFrames[210] = 12; + Main.projFrames[211] = 10; + Main.projFrames[221] = 3; + Main.projFrames[237] = 4; + Main.projFrames[238] = 6; + Main.projFrames[221] = 3; + Main.projFrames[228] = 5; + Main.projFrames[229] = 4; + Main.projFrames[236] = 13; + Main.projFrames[243] = 4; + Main.projFrames[244] = 6; + Main.projFrames[249] = 5; + Main.projFrames[252] = 4; + Main.projFrames[266] = 6; + Main.projFrames[268] = 8; + Main.projFrames[269] = 7; + Main.projFrames[270] = 3; + Main.projPet[266] = true; + Main.tileLighted[237] = true; + Main.projPet[175] = true; + Main.projPet[111] = true; + Main.projPet[112] = true; + Main.projPet[127] = true; + Main.projPet[191] = true; + Main.projPet[192] = true; + Main.projPet[193] = true; + Main.projPet[194] = true; + Main.projPet[197] = true; + Main.projPet[198] = true; + Main.projPet[199] = true; + Main.projPet[200] = true; + Main.projPet[208] = true; + Main.projPet[209] = true; + Main.projPet[210] = true; + Main.projPet[211] = true; + Main.projPet[236] = true; + Main.projPet[268] = true; + Main.projPet[269] = true; + Main.pvpBuff[20] = true; + Main.pvpBuff[24] = true; + Main.pvpBuff[31] = true; + Main.pvpBuff[39] = true; + Main.pvpBuff[44] = true; + Main.debuff[20] = true; + Main.debuff[21] = true; + Main.debuff[22] = true; + Main.debuff[23] = true; + Main.debuff[24] = true; + Main.debuff[25] = true; + Main.debuff[28] = true; + Main.debuff[30] = true; + Main.debuff[31] = true; + Main.debuff[32] = true; + Main.debuff[33] = true; + Main.debuff[34] = true; + Main.debuff[35] = true; + Main.debuff[36] = true; + Main.debuff[37] = true; + Main.debuff[38] = true; + Main.debuff[39] = true; + Main.debuff[44] = true; + Main.debuff[46] = true; + Main.debuff[47] = true; + Main.debuff[67] = true; + Main.debuff[68] = true; + Main.debuff[69] = true; + Main.debuff[70] = true; + Main.debuff[80] = true; + Main.meleeBuff[71] = true; + Main.meleeBuff[73] = true; + Main.meleeBuff[74] = true; + Main.meleeBuff[75] = true; + Main.meleeBuff[76] = true; + Main.meleeBuff[77] = true; + Main.meleeBuff[78] = true; + Main.meleeBuff[79] = true; + Main.vanityPet[40] = true; + Main.vanityPet[41] = true; + Main.vanityPet[42] = true; + Main.vanityPet[45] = true; + Main.vanityPet[50] = true; + Main.vanityPet[51] = true; + Main.vanityPet[52] = true; + Main.vanityPet[53] = true; + Main.vanityPet[54] = true; + Main.vanityPet[55] = true; + Main.vanityPet[56] = true; + Main.vanityPet[61] = true; + Main.vanityPet[65] = true; + Main.vanityPet[66] = true; + Main.lightPet[19] = true; + Main.lightPet[27] = true; + Main.lightPet[57] = true; + Main.tileFlame[4] = true; + Main.tileFlame[33] = true; + Main.tileFlame[34] = true; + Main.tileFlame[35] = true; + Main.tileFlame[36] = true; + Main.tileFlame[49] = true; + Main.tileFlame[93] = true; + Main.tileFlame[98] = true; + Main.tileFlame[100] = true; + Main.tileFlame[170] = true; + Main.tileFlame[171] = true; + Main.tileFlame[172] = true; + Main.tileFlame[173] = true; + Main.tileFlame[174] = true; + Main.tileRope[213] = true; + Main.tileRope[214] = true; + Main.tileSolid[232] = true; + Main.tileShine[239] = 1100; + Main.tileSolid[239] = true; + Main.tileSolidTop[239] = true; + Main.tileFrameImportant[247] = true; + Main.tileFrameImportant[245] = true; + Main.tileFrameImportant[246] = true; + Main.tileFrameImportant[239] = true; + Main.tileFrameImportant[240] = true; + Main.tileFrameImportant[241] = true; + Main.tileFrameImportant[242] = true; + Main.tileFrameImportant[243] = true; + Main.tileFrameImportant[244] = true; + Main.tileSolid[221] = true; + Main.tileBlockLight[221] = true; + Main.tileMergeDirt[221] = true; + Main.tileSolid[229] = true; + Main.tileBlockLight[229] = true; + Main.tileMergeDirt[229] = true; + Main.tileSolid[230] = true; + Main.tileBlockLight[230] = true; + Main.tileMergeDirt[230] = true; + Main.tileSolid[222] = true; + Main.tileBlockLight[222] = true; + Main.tileMergeDirt[222] = true; + Main.tileSolid[223] = true; + Main.tileBlockLight[223] = true; + Main.tileMergeDirt[223] = true; + Main.tileSolid[224] = true; + Main.tileBlockLight[224] = true; + Main.tileFrameImportant[237] = true; + Main.tileFrameImportant[238] = true; + Main.tileSolid[225] = true; + Main.tileBlockLight[225] = true; + Main.tileBrick[225] = true; + Main.tileSolid[226] = true; + Main.tileBlockLight[226] = true; + Main.tileBrick[226] = true; + Main.tileSolid[235] = true; + Main.tileBlockLight[235] = true; + Main.tileFrameImportant[235] = true; + Main.tileLighted[238] = true; + Main.tileFrameImportant[236] = true; + Main.tileCut[236] = true; + Main.tileSolid[191] = true; + Main.tileBrick[191] = true; + Main.tileBlockLight[191] = true; + Main.tileSolid[211] = true; + Main.tileBlockLight[211] = true; + Main.tileSolid[208] = true; + Main.tileBrick[208] = true; + Main.tileBlockLight[208] = true; + Main.tileSolid[192] = true; + Main.tileBrick[192] = true; + Main.tileBlockLight[192] = true; + Main.tileSolid[193] = true; + Main.tileBrick[193] = true; + Main.tileBlockLight[193] = true; + Main.tileMergeDirt[193] = true; + Main.tileSolid[194] = true; + Main.tileBrick[194] = true; + Main.tileBlockLight[194] = true; + Main.tileSolid[195] = true; + Main.tileBrick[195] = true; + Main.tileMergeDirt[195] = true; + Main.tileBlockLight[195] = true; + Main.tileBlockLight[200] = true; + Main.tileSolid[200] = true; + Main.tileBrick[200] = true; + Main.tileBlockLight[203] = true; + Main.tileSolid[203] = true; + Main.tileMergeDirt[203] = true; + Main.tileBlockLight[204] = true; + Main.tileSolid[204] = true; + Main.tileMergeDirt[204] = true; + Main.tileBlockLight[165] = true; + Main.tileShine2[147] = true; + Main.tileShine2[161] = true; + Main.tileShine2[163] = true; + Main.tileShine2[164] = true; + Main.tileSolid[189] = true; + Main.tileBlockLight[51] = true; + Main.tileLighted[204] = true; + Main.tileShine[204] = 1150; + Main.tileShine2[204] = true; + Main.tileSolid[190] = true; + Main.tileBlockLight[190] = true; + Main.tileBrick[190] = true; + Main.tileSolid[198] = true; + Main.tileMergeDirt[198] = true; + Main.tileBrick[198] = true; + Main.tileBlockLight[198] = true; + Main.tileSolid[206] = true; + Main.tileBlockLight[206] = true; + Main.tileMergeDirt[206] = true; + Main.tileBrick[206] = true; + Main.tileBlockLight[234] = true; + Main.tileSolid[248] = true; + Main.tileSolid[249] = true; + Main.tileSolid[250] = true; + Main.tileBrick[248] = true; + Main.tileBrick[249] = true; + Main.tileBrick[250] = true; + Main.tileBlockLight[248] = true; + Main.tileBlockLight[249] = true; + Main.tileBlockLight[250] = true; + Main.wallHouse[109] = true; + Main.wallHouse[110] = true; + Main.wallHouse[111] = true; + Main.wallHouse[112] = true; + for (int j = 0; j < 113; j++) + { + Main.wallDungeon[j] = false; + } + Main.wallLight[0] = true; + Main.wallLight[21] = true; + Main.wallLight[106] = true; + Main.wallLight[107] = true; + Main.wallDungeon[7] = true; + Main.wallDungeon[8] = true; + Main.wallDungeon[9] = true; + Main.wallDungeon[94] = true; + Main.wallDungeon[95] = true; + Main.wallDungeon[96] = true; + Main.wallDungeon[97] = true; + Main.wallDungeon[98] = true; + Main.wallDungeon[99] = true; + Main.wallHouse[108] = true; + Main.wallHouse[101] = true; + Main.wallHouse[102] = true; + Main.wallHouse[103] = true; + Main.wallHouse[104] = true; + Main.wallHouse[105] = true; + Main.wallHouse[84] = true; + Main.wallHouse[74] = true; + Main.wallHouse[85] = true; + Main.wallHouse[88] = true; + Main.wallHouse[89] = true; + Main.wallHouse[90] = true; + Main.wallHouse[91] = true; + Main.wallHouse[92] = true; + Main.wallHouse[93] = true; + for (int k = 0; k < 10; k++) + { + Main.recentWorld[k] = ""; + Main.recentIP[k] = ""; + Main.recentPort[k] = 0; + } + if (Main.rand == null) + { + Main.rand = new Random((int)DateTime.Now.Ticks); + } + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + this.SetTitle(); + Main.lo = Main.rand.Next(6); + Main.tileBrick[1] = true; + Main.tileBrick[54] = true; + Main.tileBrick[118] = true; + Main.tileBrick[119] = true; + Main.tileBrick[120] = true; + Main.tileBrick[121] = true; + Main.tileBrick[122] = true; + Main.tileBrick[140] = true; + Main.tileBrick[148] = true; + Main.tileBrick[150] = true; + Main.tileBrick[151] = true; + Main.tileBrick[152] = true; + Main.tileBrick[30] = true; + Main.tileBrick[38] = true; + Main.tileBrick[39] = true; + Main.tileBrick[41] = true; + Main.tileBrick[43] = true; + Main.tileBrick[44] = true; + Main.tileBrick[45] = true; + Main.tileBrick[46] = true; + Main.tileBrick[47] = true; + Main.tileBrick[75] = true; + Main.tileBrick[76] = true; + Main.tileBrick[160] = true; + Main.tileBrick[2] = true; + Main.tileBrick[199] = true; + Main.tileBrick[23] = true; + Main.tileBrick[60] = true; + Main.tileBrick[70] = true; + Main.tileBrick[109] = true; + Main.tileBrick[53] = true; + Main.tileBrick[147] = true; + Main.tileBrick[153] = true; + Main.tileBrick[154] = true; + Main.tileBrick[155] = true; + Main.tileBrick[156] = true; + Main.tileBrick[157] = true; + Main.tileBrick[158] = true; + Main.tileBrick[159] = true; + Main.tileMergeDirt[202] = true; + Main.tileBrick[202] = true; + Main.tileSolid[202] = true; + Main.tileBlockLight[202] = true; + Main.wallHouse[82] = true; + Main.wallHouse[77] = true; + Main.tileBrick[161] = true; + Main.tileBlockLight[161] = true; + Main.tileBlockLight[163] = true; + Main.tileBlockLight[164] = true; + Main.tileSolid[188] = true; + Main.tileBlockLight[188] = true; + Main.tileBrick[188] = true; + Main.tileMergeDirt[188] = true; + Main.tileBrick[179] = true; + Main.tileSolid[179] = true; + Main.tileBlockLight[179] = true; + Main.tileMoss[179] = true; + Main.tileBrick[180] = true; + Main.tileSolid[180] = true; + Main.tileBlockLight[180] = true; + Main.tileMoss[180] = true; + Main.tileBrick[181] = true; + Main.tileSolid[181] = true; + Main.tileBlockLight[181] = true; + Main.tileMoss[181] = true; + Main.tileBrick[182] = true; + Main.tileSolid[182] = true; + Main.tileBlockLight[182] = true; + Main.tileMoss[182] = true; + Main.tileBrick[183] = true; + Main.tileSolid[183] = true; + Main.tileBlockLight[183] = true; + Main.tileMoss[183] = true; + Main.tileMergeDirt[177] = true; + Main.tileMergeDirt[190] = true; + Main.tileSolid[196] = true; + Main.wallHouse[75] = true; + Main.wallHouse[76] = true; + Main.wallHouse[78] = true; + Main.tileSolid[197] = true; + Main.tileMergeDirt[197] = true; + Main.tileBlockLight[197] = true; + Main.tileNoSunLight[197] = true; + Main.tileBrick[175] = true; + Main.tileSolid[175] = true; + Main.tileBlockLight[175] = true; + Main.tileBrick[176] = true; + Main.tileSolid[176] = true; + Main.tileBlockLight[176] = true; + Main.tileBrick[177] = true; + Main.tileSolid[177] = true; + Main.tileBlockLight[177] = true; + Main.tileBrick[225] = true; + Main.tileBrick[229] = true; + Main.tileShine[221] = 925; + Main.tileShine[222] = 875; + Main.tileShine[223] = 825; + Main.tileShine2[221] = true; + Main.tileShine2[222] = true; + Main.tileShine2[223] = true; + Main.tileMergeDirt[175] = true; + Main.tileMergeDirt[176] = true; + Main.tileMergeDirt[177] = true; + Main.tileMergeDirt[208] = true; + Main.tileBrick[162] = true; + Main.tileSolid[162] = true; + Main.tileBrick[163] = true; + Main.tileSolid[163] = true; + Main.tileBrick[164] = true; + Main.tileSolid[164] = true; + Main.tileShine2[6] = true; + Main.tileShine2[7] = true; + Main.tileShine2[8] = true; + Main.tileShine2[9] = true; + Main.tileShine2[166] = true; + Main.tileShine2[167] = true; + Main.tileShine2[168] = true; + Main.tileShine2[169] = true; + Main.tileShine2[12] = true; + Main.tileShine2[21] = true; + Main.tileShine2[22] = true; + Main.tileShine2[25] = true; + Main.tileShine2[45] = true; + Main.tileShine2[46] = true; + Main.tileShine2[47] = true; + Main.tileShine2[63] = true; + Main.tileShine2[64] = true; + Main.tileShine2[65] = true; + Main.tileShine2[66] = true; + Main.tileShine2[67] = true; + Main.tileShine2[68] = true; + Main.tileShine2[107] = true; + Main.tileShine2[108] = true; + Main.tileShine2[111] = true; + Main.tileShine2[121] = true; + Main.tileShine2[122] = true; + Main.tileShine2[117] = true; + Main.tileShine2[211] = true; + Main.tileShine[129] = 300; + Main.tileNoFail[129] = true; + Main.tileNoFail[192] = true; + Main.tileHammer[26] = true; + Main.tileHammer[31] = true; + Main.tileAxe[5] = true; + Main.tileAxe[72] = true; + Main.tileAxe[80] = true; + Main.tileBrick[59] = true; + Main.tileBrick[234] = true; + Main.tileSolid[234] = true; + Main.tileMergeDirt[234] = true; + Main.tileSand[53] = true; + Main.tileSand[112] = true; + Main.tileSand[116] = true; + Main.tileSand[234] = true; + Main.tileFrameImportant[233] = true; + Main.tileLighted[215] = true; + Main.tileFrameImportant[227] = true; + Main.tileFrameImportant[228] = true; + Main.tileFrameImportant[231] = true; + Main.tileCut[231] = true; + Main.tileFrameImportant[216] = true; + Main.tileFrameImportant[217] = true; + Main.tileFrameImportant[218] = true; + Main.tileFrameImportant[219] = true; + Main.tileFrameImportant[220] = true; + Main.tileFrameImportant[165] = true; + Main.tileFrameImportant[209] = true; + Main.tileFrameImportant[215] = true; + Main.tileFrameImportant[210] = true; + Main.tileFrameImportant[212] = true; + Main.tileFrameImportant[207] = true; + Main.tileFrameImportant[178] = true; + Main.tileFrameImportant[184] = true; + Main.tileFrameImportant[185] = true; + Main.tileFrameImportant[186] = true; + Main.tileFrameImportant[187] = true; + Main.tileFrameImportant[170] = true; + Main.tileFrameImportant[171] = true; + Main.tileFrameImportant[172] = true; + Main.tileFrameImportant[173] = true; + Main.tileFrameImportant[174] = true; + Main.tileLighted[170] = true; + Main.tileLighted[171] = true; + Main.tileLighted[172] = true; + Main.tileLighted[173] = true; + Main.tileLighted[174] = true; + Main.tileFrameImportant[139] = true; + Main.tileLighted[160] = true; + Main.tileLighted[149] = true; + Main.tileFrameImportant[149] = true; + Main.tileFrameImportant[142] = true; + Main.tileFrameImportant[143] = true; + Main.tileFrameImportant[144] = true; + Main.tileStone[131] = true; + Main.tileFrameImportant[136] = true; + Main.tileFrameImportant[137] = true; + Main.tileFrameImportant[138] = true; + Main.tileBlockLight[137] = true; + Main.tileSolid[137] = true; + Main.tileBlockLight[160] = true; + Main.tileSolid[160] = true; + Main.tileMergeDirt[160] = true; + Main.tileBlockLight[161] = true; + Main.tileSolid[161] = true; + Main.tileBlockLight[145] = true; + Main.tileSolid[145] = true; + Main.tileMergeDirt[145] = true; + Main.tileBlockLight[146] = true; + Main.tileSolid[146] = true; + Main.tileMergeDirt[146] = true; + Main.tileBlockLight[147] = true; + Main.tileSolid[147] = true; + Main.tileBlockLight[148] = true; + Main.tileSolid[148] = true; + Main.tileMergeDirt[148] = true; + Main.tileBlockLight[138] = true; + Main.tileSolid[138] = true; + Main.tileBlockLight[140] = true; + Main.tileSolid[140] = true; + Main.tileBlockLight[151] = true; + Main.tileSolid[151] = true; + Main.tileMergeDirt[151] = true; + Main.tileBlockLight[152] = true; + Main.tileSolid[152] = true; + Main.tileMergeDirt[152] = true; + Main.tileBlockLight[153] = true; + Main.tileSolid[153] = true; + Main.tileMergeDirt[153] = true; + Main.tileBlockLight[154] = true; + Main.tileSolid[154] = true; + Main.tileMergeDirt[154] = true; + Main.tileBlockLight[155] = true; + Main.tileSolid[155] = true; + Main.tileMergeDirt[155] = true; + Main.tileBlockLight[156] = true; + Main.tileSolid[156] = true; + Main.tileMergeDirt[156] = true; + Main.tileMergeDirt[150] = true; + Main.tileBlockLight[157] = true; + Main.tileSolid[157] = true; + Main.tileMergeDirt[157] = true; + Main.tileBlockLight[158] = true; + Main.tileSolid[158] = true; + Main.tileMergeDirt[158] = true; + Main.tileBlockLight[159] = true; + Main.tileSolid[159] = true; + Main.tileMergeDirt[159] = true; + Main.tileShine[22] = 1150; + Main.tileShine[6] = 1150; + Main.tileShine[7] = 1100; + Main.tileShine[8] = 1000; + Main.tileShine[9] = 1050; + Main.tileShine[166] = 1125; + Main.tileShine[167] = 1075; + Main.tileShine[168] = 1025; + Main.tileShine[169] = 975; + Main.tileShine[178] = 500; + Main.tileShine2[178] = true; + Main.tileShine[12] = 300; + Main.tileShine[21] = 1200; + Main.tileShine[63] = 900; + Main.tileShine[64] = 900; + Main.tileShine[65] = 900; + Main.tileShine[66] = 900; + Main.tileShine[67] = 900; + Main.tileShine[68] = 900; + Main.tileShine[45] = 1900; + Main.tileShine[46] = 2000; + Main.tileShine[47] = 2100; + Main.tileShine[122] = 1800; + Main.tileShine[121] = 1850; + Main.tileShine[125] = 600; + Main.tileShine[109] = 9000; + Main.tileShine[110] = 9000; + Main.tileShine[116] = 9000; + Main.tileShine[117] = 9000; + Main.tileShine[118] = 8000; + Main.tileShine[107] = 950; + Main.tileShine[108] = 900; + Main.tileShine[111] = 850; + Main.tileShine[211] = 800; + Main.tileLighted[4] = true; + Main.tileLighted[17] = true; + Main.tileLighted[133] = true; + Main.tileLighted[31] = true; + Main.tileLighted[33] = true; + Main.tileLighted[34] = true; + Main.tileLighted[35] = true; + Main.tileLighted[36] = true; + Main.tileLighted[37] = true; + Main.tileLighted[42] = true; + Main.tileLighted[49] = true; + Main.tileLighted[58] = true; + Main.tileLighted[61] = true; + Main.tileLighted[70] = true; + Main.tileLighted[71] = true; + Main.tileLighted[72] = true; + Main.tileLighted[76] = true; + Main.tileLighted[77] = true; + Main.tileLighted[19] = true; + Main.tileLighted[22] = true; + Main.tileLighted[26] = true; + Main.tileLighted[83] = true; + Main.tileLighted[84] = true; + Main.tileLighted[92] = true; + Main.tileLighted[93] = true; + Main.tileLighted[95] = true; + Main.tileLighted[98] = true; + Main.tileLighted[100] = true; + Main.tileLighted[109] = true; + Main.tileLighted[125] = true; + Main.tileLighted[126] = true; + Main.tileLighted[129] = true; + Main.tileLighted[140] = true; + Main.tileMergeDirt[1] = true; + Main.tileMergeDirt[6] = true; + Main.tileMergeDirt[7] = true; + Main.tileMergeDirt[8] = true; + Main.tileMergeDirt[9] = true; + Main.tileMergeDirt[166] = true; + Main.tileMergeDirt[167] = true; + Main.tileMergeDirt[168] = true; + Main.tileMergeDirt[169] = true; + Main.tileMergeDirt[22] = true; + Main.tileMergeDirt[25] = true; + Main.tileMergeDirt[30] = true; + Main.tileMergeDirt[37] = true; + Main.tileMergeDirt[38] = true; + Main.tileMergeDirt[40] = true; + Main.tileMergeDirt[53] = true; + Main.tileMergeDirt[56] = true; + Main.tileMergeDirt[107] = true; + Main.tileMergeDirt[108] = true; + Main.tileMergeDirt[111] = true; + Main.tileMergeDirt[112] = true; + Main.tileMergeDirt[116] = true; + Main.tileMergeDirt[117] = true; + Main.tileMergeDirt[123] = true; + Main.tileMergeDirt[140] = true; + Main.tileMergeDirt[39] = true; + Main.tileMergeDirt[122] = true; + Main.tileMergeDirt[121] = true; + Main.tileMergeDirt[120] = true; + Main.tileMergeDirt[119] = true; + Main.tileMergeDirt[118] = true; + Main.tileMergeDirt[47] = true; + Main.tileMergeDirt[46] = true; + Main.tileMergeDirt[45] = true; + Main.tileMergeDirt[44] = true; + Main.tileMergeDirt[43] = true; + Main.tileMergeDirt[41] = true; + Main.tileFrameImportant[201] = true; + Main.tileFrameImportant[3] = true; + Main.tileFrameImportant[4] = true; + Main.tileFrameImportant[5] = true; + Main.tileFrameImportant[10] = true; + Main.tileFrameImportant[11] = true; + Main.tileFrameImportant[12] = true; + Main.tileFrameImportant[13] = true; + Main.tileFrameImportant[14] = true; + Main.tileFrameImportant[15] = true; + Main.tileFrameImportant[16] = true; + Main.tileFrameImportant[17] = true; + Main.tileFrameImportant[18] = true; + Main.tileFrameImportant[19] = true; + Main.tileFrameImportant[20] = true; + Main.tileFrameImportant[21] = true; + Main.tileFrameImportant[24] = true; + Main.tileFrameImportant[26] = true; + Main.tileFrameImportant[27] = true; + Main.tileFrameImportant[28] = true; + Main.tileFrameImportant[29] = true; + Main.tileFrameImportant[31] = true; + Main.tileFrameImportant[33] = true; + Main.tileFrameImportant[34] = true; + Main.tileFrameImportant[35] = true; + Main.tileFrameImportant[36] = true; + Main.tileFrameImportant[42] = true; + Main.tileFrameImportant[50] = true; + Main.tileFrameImportant[55] = true; + Main.tileFrameImportant[61] = true; + Main.tileFrameImportant[71] = true; + Main.tileFrameImportant[72] = true; + Main.tileFrameImportant[73] = true; + Main.tileFrameImportant[74] = true; + Main.tileFrameImportant[77] = true; + Main.tileFrameImportant[78] = true; + Main.tileFrameImportant[79] = true; + Main.tileFrameImportant[81] = true; + Main.tileFrameImportant[82] = true; + Main.tileFrameImportant[83] = true; + Main.tileFrameImportant[84] = true; + Main.tileFrameImportant[85] = true; + Main.tileFrameImportant[86] = true; + Main.tileFrameImportant[87] = true; + Main.tileFrameImportant[88] = true; + Main.tileFrameImportant[89] = true; + Main.tileFrameImportant[90] = true; + Main.tileFrameImportant[91] = true; + Main.tileFrameImportant[92] = true; + Main.tileFrameImportant[93] = true; + Main.tileFrameImportant[94] = true; + Main.tileFrameImportant[95] = true; + Main.tileFrameImportant[96] = true; + Main.tileFrameImportant[97] = true; + Main.tileFrameImportant[98] = true; + Main.tileFrameImportant[99] = true; + Main.tileFrameImportant[101] = true; + Main.tileFrameImportant[102] = true; + Main.tileFrameImportant[103] = true; + Main.tileFrameImportant[104] = true; + Main.tileFrameImportant[105] = true; + Main.tileFrameImportant[100] = true; + Main.tileFrameImportant[106] = true; + Main.tileFrameImportant[110] = true; + Main.tileFrameImportant[113] = true; + Main.tileFrameImportant[114] = true; + Main.tileFrameImportant[125] = true; + Main.tileFrameImportant[126] = true; + Main.tileFrameImportant[128] = true; + Main.tileFrameImportant[129] = true; + Main.tileFrameImportant[132] = true; + Main.tileFrameImportant[133] = true; + Main.tileFrameImportant[134] = true; + Main.tileFrameImportant[135] = true; + Main.tileFrameImportant[141] = true; + Main.tileCut[201] = true; + Main.tileCut[3] = true; + Main.tileCut[24] = true; + Main.tileCut[28] = true; + Main.tileCut[32] = true; + Main.tileCut[51] = true; + Main.tileCut[52] = true; + Main.tileCut[61] = true; + Main.tileCut[62] = true; + Main.tileCut[69] = true; + Main.tileCut[71] = true; + Main.tileCut[73] = true; + Main.tileCut[74] = true; + Main.tileCut[82] = true; + Main.tileCut[83] = true; + Main.tileCut[84] = true; + Main.tileCut[110] = true; + Main.tileCut[113] = true; + Main.tileCut[115] = true; + Main.tileCut[184] = true; + Main.tileCut[205] = true; + Main.tileAlch[82] = true; + Main.tileAlch[83] = true; + Main.tileAlch[84] = true; + Main.tileLavaDeath[104] = true; + Main.tileLavaDeath[110] = true; + Main.tileLavaDeath[113] = true; + Main.tileLavaDeath[115] = true; + Main.tileSolid[127] = true; + Main.tileSolid[130] = true; + Main.tileBlockLight[130] = true; + Main.tileBlockLight[131] = true; + Main.tileNoAttach[232] = true; + Main.tileSolid[107] = true; + Main.tileBlockLight[107] = true; + Main.tileSolid[108] = true; + Main.tileBlockLight[108] = true; + Main.tileSolid[111] = true; + Main.tileBlockLight[111] = true; + Main.tileSolid[109] = true; + Main.tileBlockLight[109] = true; + Main.tileSolid[110] = false; + Main.tileNoAttach[110] = true; + Main.tileNoFail[110] = true; + Main.tileSolid[112] = true; + Main.tileBlockLight[112] = true; + Main.tileSolid[116] = true; + Main.tileBlockLight[116] = true; + Main.tileSolid[117] = true; + Main.tileBlockLight[117] = true; + Main.tileSolid[123] = true; + Main.tileBlockLight[123] = true; + Main.tileNoFail[165] = true; + Main.tileNoFail[184] = true; + Main.tileNoFail[185] = true; + Main.tileNoFail[186] = true; + Main.tileNoFail[187] = true; + Main.tileSolid[118] = true; + Main.tileBlockLight[118] = true; + Main.tileSolid[119] = true; + Main.tileBlockLight[119] = true; + Main.tileSolid[120] = true; + Main.tileBlockLight[120] = true; + Main.tileSolid[121] = true; + Main.tileBlockLight[121] = true; + Main.tileSolid[122] = true; + Main.tileBlockLight[122] = true; + Main.tileSolid[150] = true; + Main.tileBlockLight[150] = true; + Main.tileBlockLight[115] = true; + Main.tileSolid[199] = true; + Main.tileBlockLight[199] = true; + Main.tileSolid[0] = true; + Main.tileBlockLight[0] = true; + Main.tileSolid[1] = true; + Main.tileBlockLight[1] = true; + Main.tileSolid[2] = true; + Main.tileBlockLight[2] = true; + Main.tileSolid[3] = false; + Main.tileNoAttach[3] = true; + Main.tileNoFail[3] = true; + Main.tileNoFail[201] = true; + Main.tileSolid[4] = false; + Main.tileNoAttach[4] = true; + Main.tileNoFail[4] = true; + Main.tileNoFail[24] = true; + Main.tileSolid[5] = false; + Main.tileSolid[6] = true; + Main.tileBlockLight[6] = true; + Main.tileSolid[7] = true; + Main.tileBlockLight[7] = true; + Main.tileSolid[8] = true; + Main.tileBlockLight[8] = true; + Main.tileSolid[9] = true; + Main.tileBlockLight[9] = true; + Main.tileSolid[166] = true; + Main.tileBlockLight[166] = true; + Main.tileSolid[167] = true; + Main.tileBlockLight[167] = true; + Main.tileSolid[168] = true; + Main.tileBlockLight[168] = true; + Main.tileSolid[169] = true; + Main.tileBlockLight[169] = true; + Main.tileBlockLight[10] = true; + Main.tileSolid[10] = true; + Main.tileNoAttach[10] = true; + Main.tileBlockLight[10] = true; + Main.tileSolid[11] = false; + Main.tileSolidTop[19] = true; + Main.tileSolid[19] = true; + Main.tileSolid[22] = true; + Main.tileSolid[23] = true; + Main.tileSolid[25] = true; + Main.tileSolid[30] = true; + Main.tileNoFail[32] = true; + Main.tileBlockLight[32] = true; + Main.tileSolid[37] = true; + Main.tileBlockLight[37] = true; + Main.tileSolid[38] = true; + Main.tileBlockLight[38] = true; + Main.tileSolid[39] = true; + Main.tileBlockLight[39] = true; + Main.tileSolid[40] = true; + Main.tileBlockLight[40] = true; + Main.tileSolid[41] = true; + Main.tileBlockLight[41] = true; + Main.tileSolid[43] = true; + Main.tileBlockLight[43] = true; + Main.tileSolid[44] = true; + Main.tileBlockLight[44] = true; + Main.tileSolid[45] = true; + Main.tileBlockLight[45] = true; + Main.tileSolid[46] = true; + Main.tileBlockLight[46] = true; + Main.tileSolid[47] = true; + Main.tileBlockLight[47] = true; + Main.tileSolid[48] = true; + Main.tileBlockLight[48] = true; + Main.tileSolid[53] = true; + Main.tileBlockLight[53] = true; + Main.tileSolid[54] = true; + Main.tileBlockLight[52] = true; + Main.tileBlockLight[205] = true; + Main.tileSolid[56] = true; + Main.tileBlockLight[56] = true; + Main.tileSolid[57] = true; + Main.tileBlockLight[57] = true; + Main.tileSolid[58] = true; + Main.tileBlockLight[58] = true; + Main.tileSolid[59] = true; + Main.tileBlockLight[59] = true; + Main.tileSolid[60] = true; + Main.tileBlockLight[60] = true; + Main.tileSolid[63] = true; + Main.tileBlockLight[63] = true; + Main.tileStone[63] = true; + Main.tileStone[130] = true; + Main.tileSolid[64] = true; + Main.tileBlockLight[64] = true; + Main.tileStone[64] = true; + Main.tileSolid[65] = true; + Main.tileBlockLight[65] = true; + Main.tileStone[65] = true; + Main.tileSolid[66] = true; + Main.tileBlockLight[66] = true; + Main.tileStone[66] = true; + Main.tileSolid[67] = true; + Main.tileBlockLight[67] = true; + Main.tileStone[67] = true; + Main.tileSolid[68] = true; + Main.tileBlockLight[68] = true; + Main.tileStone[68] = true; + Main.tileSolid[75] = true; + Main.tileBlockLight[75] = true; + Main.tileSolid[76] = true; + Main.tileBlockLight[76] = true; + Main.tileSolid[70] = true; + Main.tileBlockLight[70] = true; + Main.tileNoFail[50] = true; + Main.tileNoAttach[50] = true; + Main.tileDungeon[41] = true; + Main.tileDungeon[43] = true; + Main.tileDungeon[44] = true; + Main.tileBlockLight[30] = true; + Main.tileBlockLight[25] = true; + Main.tileBlockLight[23] = true; + Main.tileBlockLight[22] = true; + Main.tileBlockLight[62] = true; + Main.tileSolidTop[18] = true; + Main.tileSolidTop[14] = true; + Main.tileSolidTop[16] = true; + Main.tileSolidTop[134] = true; + Main.tileSolidTop[114] = true; + Main.tileNoAttach[20] = true; + Main.tileNoAttach[19] = true; + Main.tileNoAttach[13] = true; + Main.tileNoAttach[14] = true; + Main.tileNoAttach[15] = true; + Main.tileNoAttach[16] = true; + Main.tileNoAttach[134] = true; + Main.tileNoAttach[17] = true; + Main.tileNoAttach[18] = true; + Main.tileNoAttach[19] = true; + Main.tileNoAttach[21] = true; + Main.tileNoAttach[27] = true; + Main.tileNoAttach[114] = true; + Main.tileTable[14] = true; + Main.tileTable[18] = true; + Main.tileTable[19] = true; + Main.tileTable[114] = true; + Main.tileNoAttach[86] = true; + Main.tileNoAttach[87] = true; + Main.tileNoAttach[88] = true; + Main.tileNoAttach[89] = true; + Main.tileNoAttach[90] = true; + Main.tileLavaDeath[86] = true; + Main.tileLavaDeath[87] = true; + Main.tileLavaDeath[88] = true; + Main.tileLavaDeath[89] = true; + Main.tileLavaDeath[125] = true; + Main.tileLavaDeath[126] = true; + Main.tileLavaDeath[101] = true; + Main.tileTable[101] = true; + Main.tileNoAttach[101] = true; + Main.tileLavaDeath[102] = true; + Main.tileNoAttach[102] = true; + Main.tileNoAttach[94] = true; + Main.tileNoAttach[95] = true; + Main.tileNoAttach[96] = true; + Main.tileNoAttach[97] = true; + Main.tileNoAttach[98] = true; + Main.tileNoAttach[99] = true; + Main.tileLavaDeath[94] = true; + Main.tileLavaDeath[95] = true; + Main.tileLavaDeath[96] = true; + Main.tileLavaDeath[97] = true; + Main.tileLavaDeath[98] = true; + Main.tileLavaDeath[99] = true; + Main.tileLavaDeath[100] = true; + Main.tileLavaDeath[103] = true; + Main.tileTable[87] = true; + Main.tileTable[88] = true; + Main.tileSolidTop[87] = true; + Main.tileSolidTop[88] = true; + Main.tileSolidTop[101] = true; + Main.tileNoAttach[91] = true; + Main.tileLavaDeath[91] = true; + Main.tileNoAttach[92] = true; + Main.tileLavaDeath[92] = true; + Main.tileNoAttach[93] = true; + Main.tileLavaDeath[93] = true; + Main.tileLighted[190] = true; + Main.tileBlockLight[192] = true; + Main.tileBrick[192] = false; + Main.tileWaterDeath[4] = true; + Main.tileWaterDeath[51] = true; + Main.tileWaterDeath[93] = true; + Main.tileWaterDeath[98] = true; + Main.tileLavaDeath[201] = true; + Main.tileLavaDeath[3] = true; + Main.tileLavaDeath[5] = true; + Main.tileLavaDeath[10] = true; + Main.tileLavaDeath[11] = true; + Main.tileLavaDeath[12] = true; + Main.tileLavaDeath[13] = true; + Main.tileLavaDeath[14] = true; + Main.tileLavaDeath[15] = true; + Main.tileLavaDeath[16] = true; + Main.tileLavaDeath[17] = true; + Main.tileLavaDeath[18] = true; + Main.tileLavaDeath[19] = true; + Main.tileLavaDeath[20] = true; + Main.tileLavaDeath[27] = true; + Main.tileLavaDeath[28] = true; + Main.tileLavaDeath[29] = true; + Main.tileLavaDeath[32] = true; + Main.tileLavaDeath[33] = true; + Main.tileLavaDeath[34] = true; + Main.tileLavaDeath[35] = true; + Main.tileLavaDeath[36] = true; + Main.tileLavaDeath[42] = true; + Main.tileLavaDeath[49] = true; + Main.tileLavaDeath[50] = true; + Main.tileLavaDeath[52] = true; + Main.tileLavaDeath[55] = true; + Main.tileLavaDeath[61] = true; + Main.tileLavaDeath[62] = true; + Main.tileLavaDeath[69] = true; + Main.tileLavaDeath[71] = true; + Main.tileLavaDeath[72] = true; + Main.tileLavaDeath[73] = true; + Main.tileLavaDeath[74] = true; + Main.tileLavaDeath[79] = true; + Main.tileLavaDeath[80] = true; + Main.tileLavaDeath[81] = true; + Main.tileLavaDeath[106] = true; + Main.tileLavaDeath[205] = true; + Main.wallHouse[1] = true; + Main.wallHouse[4] = true; + Main.wallHouse[5] = true; + Main.wallHouse[6] = true; + Main.wallHouse[10] = true; + Main.wallHouse[11] = true; + Main.wallHouse[12] = true; + Main.wallHouse[16] = true; + Main.wallHouse[17] = true; + Main.wallHouse[18] = true; + Main.wallHouse[19] = true; + Main.wallHouse[20] = true; + Main.wallHouse[21] = true; + Main.wallHouse[22] = true; + Main.wallHouse[23] = true; + Main.wallHouse[24] = true; + Main.wallHouse[25] = true; + Main.wallHouse[26] = true; + Main.wallHouse[27] = true; + Main.wallHouse[29] = true; + Main.wallHouse[30] = true; + Main.wallHouse[31] = true; + Main.wallHouse[32] = true; + Main.wallHouse[33] = true; + Main.wallHouse[34] = true; + Main.wallHouse[35] = true; + Main.wallHouse[36] = true; + Main.wallHouse[37] = true; + Main.wallHouse[38] = true; + Main.wallHouse[39] = true; + Main.wallHouse[41] = true; + Main.wallHouse[42] = true; + Main.wallHouse[43] = true; + Main.wallHouse[44] = true; + Main.wallHouse[45] = true; + Main.wallHouse[46] = true; + Main.wallHouse[47] = true; + Main.wallHouse[66] = true; + Main.wallHouse[67] = true; + Main.wallHouse[68] = true; + Main.wallHouse[72] = true; + Main.wallHouse[73] = true; + for (int l = 0; l < 113; l++) + { + if (l == 20) + { + Main.wallBlend[l] = 14; + } + else + { + if (l == 19) + { + Main.wallBlend[l] = 9; + } + else + { + if (l == 18) + { + Main.wallBlend[l] = 8; + } + else + { + if (l == 17) + { + Main.wallBlend[l] = 7; + } + else + { + if (l == 16 || l == 59) + { + Main.wallBlend[l] = 2; + } + else + { + if (l == 1 || (l >= 48 && l <= 53)) + { + Main.wallBlend[l] = 1; + } + else + { + Main.wallBlend[l] = l; + } + } + } + } + } + } + } + Main.wallBlend[65] = 63; + Main.wallBlend[66] = 63; + Main.wallBlend[68] = 63; + Main.wallBlend[67] = 64; + Main.wallBlend[80] = 74; + Main.wallBlend[81] = 77; + Main.wallBlend[94] = 7; + Main.wallBlend[95] = 7; + Main.wallBlend[100] = 7; + Main.wallBlend[101] = 7; + Main.wallBlend[96] = 8; + Main.wallBlend[97] = 8; + Main.wallBlend[102] = 8; + Main.wallBlend[103] = 8; + Main.wallBlend[98] = 9; + Main.wallBlend[99] = 9; + Main.wallBlend[104] = 9; + Main.wallBlend[105] = 9; + Main.tileNoFail[24] = true; + Main.tileNoFail[3] = true; + Main.tileNoFail[52] = true; + Main.tileNoFail[62] = true; + Main.tileNoFail[32] = true; + Main.tileNoFail[61] = true; + Main.tileNoFail[69] = true; + Main.tileNoFail[73] = true; + Main.tileNoFail[74] = true; + Main.tileNoFail[82] = true; + Main.tileNoFail[83] = true; + Main.tileNoFail[84] = true; + Main.tileNoFail[110] = true; + Main.tileNoFail[113] = true; + Main.tileNoFail[115] = true; + Main.tileNoFail[165] = true; + Main.tileNoFail[184] = true; + Main.tileNoFail[201] = true; + Main.tileNoFail[205] = true; + Main.tileNoFail[227] = true; + Main.tileNoFail[233] = true; + for (int m = 0; m < 251; m++) + { + Main.tileName[m] = ""; + if (Main.tileSolid[m]) + { + Main.tileNoSunLight[m] = true; + } + Main.tileFrame[m] = 0; + Main.tileFrameCounter[m] = 0; + } + Main.tileNoSunLight[19] = false; + Main.tileNoSunLight[11] = true; + Main.tileNoSunLight[189] = false; + Main.tileNoSunLight[196] = false; + for (int n = 0; n < Main.maxMenuItems; n++) + { + this.menuItemScale[n] = 0.8f; + } + for (int num = 0; num < 6001; num++) + { + Main.dust[num] = new Dust(); + } + for (int num2 = 0; num2 < 401; num2++) + { + Main.item[num2] = new Item(); + } + for (int num3 = 0; num3 < 201; num3++) + { + Main.npc[num3] = new NPC(); + Main.npc[num3].whoAmI = num3; + } + for (int num4 = 0; num4 < 256; num4++) + { + Main.player[num4] = new Player(); + } + for (int num5 = 0; num5 < 1001; num5++) + { + Main.projectile[num5] = new Projectile(); + } + for (int num6 = 0; num6 < 501; num6++) + { + Main.gore[num6] = new Gore(); + } + for (int num7 = 0; num7 < Main.maxRain + 1; num7++) + { + Main.rain[num7] = new Rain(); + } + for (int num8 = 0; num8 < 200; num8++) + { + Main.cloud[num8] = new Cloud(); + } + for (int num9 = 0; num9 < 100; num9++) + { + Main.combatText[num9] = new CombatText(); + } + for (int num10 = 0; num10 < 20; num10++) + { + Main.itemText[num10] = new ItemText(); + } + for (int num11 = 0; num11 < 1725; num11++) + { + Item item = new Item(); + item.SetDefaults(num11, false); + Main.itemName[num11] = item.name; + if (item.headSlot > 0) + { + Item.headType[item.headSlot] = item.type; + } + if (item.bodySlot > 0) + { + Item.bodyType[item.bodySlot] = item.type; + } + if (item.legSlot > 0) + { + Item.legType[item.legSlot] = item.type; + } + } + for (int num12 = 0; num12 < Recipe.maxRecipes; num12++) + { + Main.recipe[num12] = new Recipe(); + Main.availableRecipeY[num12] = (float)(65 * num12); + } + Recipe.SetupRecipes(); + for (int num13 = 0; num13 < Main.numChatLines; num13++) + { + Main.chatLine[num13] = new ChatLine(); + } + for (int num14 = 0; num14 < Liquid.resLiquid; num14++) + { + Main.liquid[num14] = new Liquid(); + } + for (int num15 = 0; num15 < 10000; num15++) + { + Main.liquidBuffer[num15] = new LiquidBuffer(); + } + this.shop[0] = new Chest(); + for (int num16 = 1; num16 < Main.numShops; num16++) + { + this.shop[num16] = new Chest(); + this.shop[num16].SetupShop(num16); + } + Main.teamColor[0] = Color.White; + Main.teamColor[1] = new Color(230, 40, 20); + Main.teamColor[2] = new Color(20, 200, 30); + Main.teamColor[3] = new Color(75, 90, 255); + Main.teamColor[4] = new Color(200, 180, 0); + if (Main.menuMode == 1) + { + Main.LoadPlayers(); + } + for (int num17 = 1; num17 < 311; num17++) + { + Projectile projectile = new Projectile(); + projectile.SetDefaults(num17); + if (projectile.hostile) + { + Main.projHostile[num17] = true; + } + } + Netplay.Init(); + if (Main.skipMenu) + { + WorldGen.clearWorld(); + Main.gameMenu = false; + Main.LoadPlayers(); + Main.player[Main.myPlayer] = (Player)Main.loadPlayer[0].Clone(); + Main.PlayerPath = Main.loadPlayerPath[0]; + Main.LoadWorlds(); + WorldGen.generateWorld(-1); + WorldGen.EveryTileFrame(); + Main.player[Main.myPlayer].Spawn(); + } + else + { + IntPtr systemMenu = Main.GetSystemMenu(base.Window.Handle, false); + int menuItemCount = Main.GetMenuItemCount(systemMenu); + Main.RemoveMenu(systemMenu, menuItemCount - 1, 1024); + } + if (Main.dedServ) + { + return; + } + Main.clientUUID = Guid.NewGuid().ToString(); + if (Main.CachedAnonymousMethodDelegate1 == null) + { + Main.CachedAnonymousMethodDelegate1 = new Action(Main.b__0); + } + keyBoardInput.newKeyEvent += Main.CachedAnonymousMethodDelegate1; + if (Main.screenWidth > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width) + { + Main.screenWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; + } + if (Main.screenHeight > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height) + { + Main.screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; + } + this.graphics.PreferredBackBufferWidth = Main.screenWidth; + this.graphics.PreferredBackBufferHeight = Main.screenHeight; + this.graphics.ApplyChanges(); + base.Initialize(); + base.Window.AllowUserResizing = true; + this.OpenSettings(); + this.CheckBunny(); + if (Lang.lang > 1) + { + Lang.setLang(true); + } + Lang.setLang(false); + if (Lang.lang == 0) + { + Main.menuMode = 1212; + } + this.SetTitle(); + this.OpenRecent(); + Star.SpawnStars(); + WorldGen.RandomWeather(); + foreach (DisplayMode current in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) + { + if (current.Width >= Main.minScreenW && current.Height >= Main.minScreenH && current.Width <= Main.maxScreenW && current.Height <= Main.maxScreenH) + { + bool flag = true; + for (int num18 = 0; num18 < this.numDisplayModes; num18++) + { + if (current.Width == this.displayWidth[num18] && current.Height == this.displayHeight[num18]) + { + flag = false; + break; + } + } + if (flag) + { + this.displayHeight[this.numDisplayModes] = current.Height; + this.displayWidth[this.numDisplayModes] = current.Width; + this.numDisplayModes++; + } + } + } + if (Main.autoJoin) + { + Main.LoadPlayers(); + Main.menuMode = 1; + Main.menuMultiplayer = true; + } + Main.fpsTimer.Start(); + Main.updateTimer.Start(); + } + protected override void LoadContent() + { + try + { + Main.pixelShader = base.Content.Load("pixelShader"); + Main.tileShader = base.Content.Load("tileShader"); + Main.engine = new AudioEngine("Content" + Path.DirectorySeparatorChar + "TerrariaMusic.xgs"); + Main.soundBank = new SoundBank(Main.engine, "Content" + Path.DirectorySeparatorChar + "Sound Bank.xsb"); + Main.waveBank = new WaveBank(Main.engine, "Content" + Path.DirectorySeparatorChar + "Wave Bank.xwb"); + for (int i = 1; i < 30; i++) + { + Main.music[i] = Main.soundBank.GetCue("Music_" + i); + } + Main.soundMech[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Mech_0"); + Main.soundInstanceMech[0] = Main.soundMech[0].CreateInstance(); + Main.soundGrab = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Grab"); + Main.soundInstanceGrab = Main.soundGrab.CreateInstance(); + Main.soundPixie = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Pixie"); + Main.soundInstancePixie = Main.soundGrab.CreateInstance(); + Main.soundDig[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Dig_0"); + Main.soundInstanceDig[0] = Main.soundDig[0].CreateInstance(); + Main.soundDig[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Dig_1"); + Main.soundInstanceDig[1] = Main.soundDig[1].CreateInstance(); + Main.soundDig[2] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Dig_2"); + Main.soundInstanceDig[2] = Main.soundDig[2].CreateInstance(); + Main.soundTink[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Tink_0"); + Main.soundInstanceTink[0] = Main.soundTink[0].CreateInstance(); + Main.soundTink[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Tink_1"); + Main.soundInstanceTink[1] = Main.soundTink[1].CreateInstance(); + Main.soundTink[2] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Tink_2"); + Main.soundInstanceTink[2] = Main.soundTink[2].CreateInstance(); + Main.soundPlayerHit[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Player_Hit_0"); + Main.soundInstancePlayerHit[0] = Main.soundPlayerHit[0].CreateInstance(); + Main.soundPlayerHit[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Player_Hit_1"); + Main.soundInstancePlayerHit[1] = Main.soundPlayerHit[1].CreateInstance(); + Main.soundPlayerHit[2] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Player_Hit_2"); + Main.soundInstancePlayerHit[2] = Main.soundPlayerHit[2].CreateInstance(); + Main.soundFemaleHit[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Female_Hit_0"); + Main.soundInstanceFemaleHit[0] = Main.soundFemaleHit[0].CreateInstance(); + Main.soundFemaleHit[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Female_Hit_1"); + Main.soundInstanceFemaleHit[1] = Main.soundFemaleHit[1].CreateInstance(); + Main.soundFemaleHit[2] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Female_Hit_2"); + Main.soundInstanceFemaleHit[2] = Main.soundFemaleHit[2].CreateInstance(); + Main.soundPlayerKilled = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Player_Killed"); + Main.soundInstancePlayerKilled = Main.soundPlayerKilled.CreateInstance(); + Main.soundChat = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Chat"); + Main.soundInstanceChat = Main.soundChat.CreateInstance(); + Main.soundGrass = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Grass"); + Main.soundInstanceGrass = Main.soundGrass.CreateInstance(); + Main.soundDoorOpen = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Door_Opened"); + Main.soundInstanceDoorOpen = Main.soundDoorOpen.CreateInstance(); + Main.soundDoorClosed = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Door_Closed"); + Main.soundInstanceDoorClosed = Main.soundDoorClosed.CreateInstance(); + Main.soundMenuTick = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Menu_Tick"); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.soundMenuOpen = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Menu_Open"); + Main.soundInstanceMenuOpen = Main.soundMenuOpen.CreateInstance(); + Main.soundMenuClose = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Menu_Close"); + Main.soundInstanceMenuClose = Main.soundMenuClose.CreateInstance(); + Main.soundShatter = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Shatter"); + Main.soundInstanceShatter = Main.soundShatter.CreateInstance(); + Main.soundZombie[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Zombie_0"); + Main.soundInstanceZombie[0] = Main.soundZombie[0].CreateInstance(); + Main.soundZombie[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Zombie_1"); + Main.soundInstanceZombie[1] = Main.soundZombie[1].CreateInstance(); + Main.soundZombie[2] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Zombie_2"); + Main.soundInstanceZombie[2] = Main.soundZombie[2].CreateInstance(); + Main.soundZombie[3] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Zombie_3"); + Main.soundInstanceZombie[3] = Main.soundZombie[3].CreateInstance(); + Main.soundZombie[4] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Zombie_4"); + Main.soundInstanceZombie[4] = Main.soundZombie[4].CreateInstance(); + Main.soundRoar[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Roar_0"); + Main.soundInstanceRoar[0] = Main.soundRoar[0].CreateInstance(); + Main.soundRoar[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Roar_1"); + Main.soundInstanceRoar[1] = Main.soundRoar[1].CreateInstance(); + Main.soundSplash[0] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Splash_0"); + Main.soundInstanceSplash[0] = Main.soundRoar[0].CreateInstance(); + Main.soundSplash[1] = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Splash_1"); + Main.soundInstanceSplash[1] = Main.soundSplash[1].CreateInstance(); + Main.soundDoubleJump = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Double_Jump"); + Main.soundInstanceDoubleJump = Main.soundRoar[0].CreateInstance(); + Main.soundRun = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Run"); + Main.soundInstanceRun = Main.soundRun.CreateInstance(); + Main.soundCoins = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Coins"); + Main.soundInstanceCoins = Main.soundCoins.CreateInstance(); + Main.soundUnlock = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Unlock"); + Main.soundInstanceUnlock = Main.soundUnlock.CreateInstance(); + Main.soundMaxMana = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "MaxMana"); + Main.soundInstanceMaxMana = Main.soundMaxMana.CreateInstance(); + Main.soundDrown = base.Content.Load("Sounds" + Path.DirectorySeparatorChar + "Drown"); + Main.soundInstanceDrown = Main.soundDrown.CreateInstance(); + for (int j = 1; j < 52; j++) + { + Main.soundItem[j] = base.Content.Load(string.Concat(new object[] + { + "Sounds", + Path.DirectorySeparatorChar, + "Item_", + j + })); + Main.soundInstanceItem[j] = Main.soundItem[j].CreateInstance(); + } + for (int k = 1; k < 14; k++) + { + Main.soundNPCHit[k] = base.Content.Load(string.Concat(new object[] + { + "Sounds", + Path.DirectorySeparatorChar, + "NPC_Hit_", + k + })); + Main.soundInstanceNPCHit[k] = Main.soundNPCHit[k].CreateInstance(); + } + for (int l = 1; l < 20; l++) + { + Main.soundNPCKilled[l] = base.Content.Load(string.Concat(new object[] + { + "Sounds", + Path.DirectorySeparatorChar, + "NPC_Killed_", + l + })); + Main.soundInstanceNPCKilled[l] = Main.soundNPCKilled[l].CreateInstance(); + } + } + catch + { + Main.musicVolume = 0f; + Main.soundVolume = 0f; + } + this.iceBarrierTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "IceBarrier"); + Main.frozenTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Frozen"); + Main.craftButtonTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "CraftButton"); + Main.craftUpButtonTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "RecUp"); + Main.craftDownButtonTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "RecDown"); + Main.pulleyTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "PlayerPulley"); + Main.reforgeTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Reforge"); + Main.timerTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Timer"); + Main.wofTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "WallOfFlesh"); + Main.wallOutlineTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Wall_Outline"); + Main.fadeTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "fade-out"); + Main.ghostTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Ghost"); + Main.evilCactusTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Evil_Cactus"); + Main.goodCactusTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Good_Cactus"); + Main.crimsonCactusTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Crimson_Cactus"); + Main.wraithEyeTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Wraith_Eyes"); + Main.reaperEyeTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Reaper_Eyes"); + Main.MusicBoxTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Music_Box"); + this.mapTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Map"); + this.mapBG1Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG1"); + this.mapBG2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG2"); + this.mapBG3Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG3"); + this.mapBG4Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG4"); + this.mapBG5Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG5"); + this.mapBG6Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG6"); + this.mapBG7Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG7"); + this.mapBG8Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG8"); + this.mapBG9Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG9"); + this.mapBG10Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG10"); + this.mapBG11Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG11"); + this.mapBG12Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MapBG12"); + this.hueTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Hue"); + this.colorSliderTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "ColorSlider"); + this.colorBarTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "ColorBar"); + this.colorBlipTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "ColorBlip"); + Main.rainTexture[0] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Rain_0"); + Main.rainTexture[1] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Rain_1"); + Main.rainTexture[2] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Rain_2"); + Main.magicPixel = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MagicPixel"); + Main.miniMapFrameTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MiniMapFrame"); + Main.miniMapFrame2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "MiniMapFrame2"); + for (int m = 0; m < Main.FlameTexture.Length; m++) + { + Main.FlameTexture[m] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Flame_", + m + })); + } + for (int n = 0; n < 3; n++) + { + Main.miniMapButtonTexture[n] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "MiniMapButton_", + n + })); + } + for (int num = 0; num < 8; num++) + { + this.mapIconTexture[num] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Map_", + num + })); + } + Main.destTexture[0] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Dest1"); + Main.destTexture[1] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Dest2"); + Main.destTexture[2] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Dest3"); + Main.actuatorTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Actuator"); + Main.wireTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Wires"); + Main.wire2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Wires2"); + Main.wire3Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Wires3"); + Main.flyingCarpetTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "FlyingCarpet"); + Main.hbTexture1 = base.Content.Load("Images" + Path.DirectorySeparatorChar + "HealthBar1"); + Main.hbTexture2 = base.Content.Load("Images" + Path.DirectorySeparatorChar + "HealthBar2"); + Main.loTexture = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "logo_", + Main.rand.Next(1, 9) + })); + this.spriteBatch = new SpriteBatch(base.GraphicsDevice); + for (int num2 = 1; num2 < 2; num2++) + { + Main.bannerTexture[num2] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "House_Banner_", + num2 + })); + } + for (int num3 = 0; num3 < Main.npcHeadTexture.Length; num3++) + { + Main.npcHeadTexture[num3] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "NPC_Head_", + num3 + })); + } + for (int num4 = 1; num4 < Main.BackPackTexture.Length; num4++) + { + Main.BackPackTexture[num4] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "BackPack_", + num4 + })); + } + for (int num5 = 1; num5 < 81; num5++) + { + Main.buffTexture[num5] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Buff_", + num5 + })); + } + this.LoadBackground(0); + this.LoadBackground(49); + for (int num6 = 0; num6 < 1725; num6++) + { + Main.itemTexture[num6] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Item_", + num6 + })); + } + for (int num7 = 0; num7 < 6; num7++) + { + Main.gemTexture[num7] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Gem_", + num7 + })); + } + for (int num8 = 0; num8 < 301; num8++) + { + NPC nPC = new NPC(); + nPC.SetDefaults(num8, -1f); + Main.npcName[num8] = nPC.name; + } + for (int num9 = 0; num9 < 22; num9++) + { + Main.cloudTexture[num9] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Cloud_", + num9 + })); + } + for (int num10 = 0; num10 < 5; num10++) + { + Main.starTexture[num10] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Star_", + num10 + })); + } + for (int num11 = 0; num11 < 12; num11++) + { + Main.liquidTexture[num11] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Liquid_", + num11 + })); + Main.waterfallTexture[num11] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Waterfall_", + num11 + })); + } + Main.waterfallTexture[12] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Waterfall_", + 12 + })); + Main.waterfallTexture[13] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Waterfall_", + 13 + })); + Main.waterfallTexture[14] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Waterfall_", + 14 + })); + Main.npcToggleTexture[0] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "House_1"); + Main.npcToggleTexture[1] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "House_2"); + Main.HBLockTexture[0] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Lock_0"); + Main.HBLockTexture[1] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Lock_1"); + Main.gridTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Grid"); + Main.trashTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Trash"); + Main.cdTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "CoolDown"); + Main.logoTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Logo"); + Main.logo2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Logo2"); + Main.dustTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Dust"); + Main.sunTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Sun"); + Main.sun2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Sun2"); + Main.sun3Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Sun3"); + Main.blackTileTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Black_Tile"); + Main.heartTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Heart"); + Main.heart2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Heart2"); + Main.bubbleTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Bubble"); + Main.flameTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Flame"); + Main.manaTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Mana"); + Main.cursorTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Cursor"); + Main.ninjaTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Ninja"); + Main.antLionTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "AntlionBody"); + Main.spikeBaseTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Spike_Base"); + Main.woodTexture[0] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_0"); + Main.woodTexture[1] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_1"); + Main.woodTexture[2] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_2"); + Main.woodTexture[3] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_3"); + Main.woodTexture[4] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_4"); + Main.woodTexture[5] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_5"); + Main.woodTexture[6] = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Tiles_5_6"); + for (int num12 = 0; num12 < Main.moonTexture.Length; num12++) + { + Main.moonTexture[num12] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Moon_", + num12 + })); + } + for (int num13 = 0; num13 < Main.treeTopTexture.Length; num13++) + { + Main.treeTopTexture[num13] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Tree_Tops_", + num13 + })); + } + for (int num14 = 0; num14 < Main.treeBranchTexture.Length; num14++) + { + Main.treeBranchTexture[num14] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Tree_Branches_", + num14 + })); + } + Main.shroomCapTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Shroom_Tops"); + Main.inventoryBackTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back"); + Main.inventoryBack2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back2"); + Main.inventoryBack3Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back3"); + Main.inventoryBack4Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back4"); + Main.inventoryBack5Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back5"); + Main.inventoryBack6Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back6"); + Main.inventoryBack7Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back7"); + Main.inventoryBack8Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back8"); + Main.inventoryBack9Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back9"); + Main.inventoryBack10Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back10"); + Main.inventoryBack11Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back11"); + Main.inventoryBack12Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Inventory_Back12"); + Main.textBackTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Text_Back"); + Main.chatTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chat"); + Main.chat2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chat2"); + Main.chatBackTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chat_Back"); + Main.teamTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Team"); + Main.skinBodyTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Skin_Body"); + Main.skinLegsTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Skin_Legs"); + Main.playerEyeWhitesTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Eye_Whites"); + Main.playerEyesTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Eyes"); + Main.playerHandsTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Hands"); + Main.playerHands2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Hands2"); + Main.playerHeadTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Head"); + Main.playerPantsTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Pants"); + Main.playerShirtTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Shirt"); + Main.playerShoesTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Shoes"); + Main.playerUnderShirtTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Undershirt"); + Main.playerUnderShirt2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Player_Undershirt2"); + Main.femalePantsTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Female_Pants"); + Main.femaleShirtTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Female_Shirt"); + Main.femaleShoesTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Female_Shoes"); + Main.femaleUnderShirtTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Female_Undershirt"); + Main.femaleUnderShirt2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Female_Undershirt2"); + Main.femaleShirt2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Female_Shirt2"); + Main.chaosTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chaos"); + Main.EyeLaserTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Eye_Laser"); + Main.BoneEyesTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Bone_eyes"); + Main.BoneLaserTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Bone_Laser"); + Main.lightDiscTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Light_Disc"); + Main.confuseTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Confuse"); + Main.probeTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Probe"); + Main.sunOrbTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "SunOrb"); + Main.sunAltarTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "SunAltar"); + Main.chainTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain"); + Main.chain2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain2"); + Main.chain3Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain3"); + Main.chain4Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain4"); + Main.chain5Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain5"); + Main.chain6Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain6"); + Main.chain7Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain7"); + Main.chain8Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain8"); + Main.chain9Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain9"); + Main.chain10Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain10"); + Main.chain11Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain11"); + Main.chain12Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain12"); + Main.chain13Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain13"); + Main.chain14Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain14"); + Main.chain15Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain15"); + Main.chain16Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain16"); + Main.chain17Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain17"); + Main.chain18Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain18"); + Main.chain19Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain19"); + Main.chain20Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain20"); + Main.chain21Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain21"); + Main.chain22Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain22"); + Main.chain23Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain23"); + Main.chain24Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain24"); + Main.chain25Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain25"); + Main.chain26Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain26"); + Main.chain27Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Chain27"); + Main.boneArmTexture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Arm_Bone"); + Main.boneArm2Texture = base.Content.Load("Images" + Path.DirectorySeparatorChar + "Arm_Bone_2"); + for (int num15 = 1; num15 < Main.gemChainTexture.Length; num15++) + { + Main.gemChainTexture[num15] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "GemChain_", + num15 + })); + } + for (int num16 = 1; num16 < Main.golemTexture.Length; num16++) + { + Main.golemTexture[num16] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "GolemLights", + num16 + })); + } + Main.fontItemStack = base.Content.Load("Fonts" + Path.DirectorySeparatorChar + "Item_Stack"); + Main.fontMouseText = base.Content.Load("Fonts" + Path.DirectorySeparatorChar + "Mouse_Text"); + Main.fontDeathText = base.Content.Load("Fonts" + Path.DirectorySeparatorChar + "Death_Text"); + Main.fontCombatText[0] = base.Content.Load("Fonts" + Path.DirectorySeparatorChar + "Combat_Text"); + Main.fontCombatText[1] = base.Content.Load("Fonts" + Path.DirectorySeparatorChar + "Combat_Crit"); + } + protected override void UnloadContent() + { + } + protected void UpdateMusic() + { + if (Main.musicVolume == 0f) + { + Main.curMusic = 0; + } + try + { + if (!Main.dedServ) + { + if (Main.curMusic > 0) + { + if (!base.IsActive) + { + if (!Main.music[Main.curMusic].IsPaused && Main.music[Main.curMusic].IsPlaying) + { + try + { + Main.music[Main.curMusic].Pause(); + } + catch + { + } + } + return; + } + if (Main.music[Main.curMusic].IsPaused) + { + Main.music[Main.curMusic].Resume(); + } + } + bool flag = false; + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + Rectangle rectangle = new Rectangle((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); + int num = 5000; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active) + { + if (Main.npc[i].type == 262 || Main.npc[i].type == 263 || Main.npc[i].type == 264) + { + Rectangle value = new Rectangle((int)(Main.npc[i].position.X + (float)(Main.npc[i].width / 2)) - num, (int)(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)) - num, num * 2, num * 2); + if (rectangle.Intersects(value)) + { + flag6 = true; + break; + } + } + else + { + if (Main.npc[i].type == 134 || Main.npc[i].type == 143 || Main.npc[i].type == 144 || Main.npc[i].type == 145 || Main.npc[i].type == 266) + { + Rectangle value2 = new Rectangle((int)(Main.npc[i].position.X + (float)(Main.npc[i].width / 2)) - num, (int)(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)) - num, num * 2, num * 2); + if (rectangle.Intersects(value2)) + { + flag3 = true; + break; + } + } + else + { + if ((Main.npc[i].type >= 212 && Main.npc[i].type <= 216) || Main.npc[i].type == 245) + { + Rectangle value3 = new Rectangle((int)(Main.npc[i].position.X + (float)(Main.npc[i].width / 2)) - num, (int)(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)) - num, num * 2, num * 2); + if (rectangle.Intersects(value3)) + { + flag4 = true; + break; + } + } + else + { + if (Main.npc[i].type == 113 || Main.npc[i].type == 114 || Main.npc[i].type == 125 || Main.npc[i].type == 126) + { + Rectangle value4 = new Rectangle((int)(Main.npc[i].position.X + (float)(Main.npc[i].width / 2)) - num, (int)(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)) - num, num * 2, num * 2); + if (rectangle.Intersects(value4)) + { + flag2 = true; + break; + } + } + else + { + if (Main.npc[i].type == 222) + { + Rectangle value5 = new Rectangle((int)(Main.npc[i].position.X + (float)(Main.npc[i].width / 2)) - num, (int)(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)) - num, num * 2, num * 2); + if (rectangle.Intersects(value5)) + { + flag5 = true; + break; + } + } + else + { + if (Main.npc[i].boss || Main.npc[i].type == 13 || Main.npc[i].type == 14 || Main.npc[i].type == 15 || Main.npc[i].type == 134 || Main.npc[i].type == 26 || Main.npc[i].type == 27 || Main.npc[i].type == 28 || Main.npc[i].type == 29 || Main.npc[i].type == 111) + { + Rectangle value6 = new Rectangle((int)(Main.npc[i].position.X + (float)(Main.npc[i].width / 2)) - num, (int)(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)) - num, num * 2, num * 2); + if (rectangle.Intersects(value6)) + { + flag = true; + break; + } + } + } + } + } + } + } + } + } + int num2 = (int)((Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f); + if (Main.musicVolume == 0f) + { + this.newMusic = 0; + } + else + { + if (Main.gameMenu) + { + if (Main.netMode != 2) + { + this.newMusic = 6; + } + else + { + this.newMusic = 0; + } + } + else + { + float num3 = (float)(Main.maxTilesX / 4200); + num3 *= num3; + float num4 = (float)((double)((Main.screenPosition.Y + (float)(Main.screenHeight / 2)) / 16f - (65f + 10f * num3)) / (Main.worldSurface / 5.0)); + if (flag6) + { + this.newMusic = 24; + } + else + { + if (flag2) + { + this.newMusic = 12; + } + else + { + if (flag) + { + this.newMusic = 5; + } + else + { + if (flag3) + { + this.newMusic = 13; + } + else + { + if (flag4) + { + this.newMusic = 17; + } + else + { + if (flag5) + { + this.newMusic = 25; + } + else + { + if (Main.player[Main.myPlayer].position.Y > (float)((Main.maxTilesY - 200) * 16)) + { + this.newMusic = 2; + } + else + { + if (Main.eclipse && (double)Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2)) + { + this.newMusic = 27; + } + else + { + if (num4 < 1f) + { + this.newMusic = 15; + } + else + { + if (Main.tile[(int)(Main.player[Main.myPlayer].Center().X / 16f), (int)(Main.player[Main.myPlayer].Center().Y / 16f)].wall == 87) + { + this.newMusic = 26; + } + else + { + if ((Main.bgStyle == 9 && (double)Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2)) || Main.ugBack == 2) + { + this.newMusic = 29; + } + else + { + if (Main.player[Main.myPlayer].zoneEvil) + { + if ((double)Main.player[Main.myPlayer].position.Y > Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2)) + { + this.newMusic = 10; + } + else + { + this.newMusic = 8; + } + } + else + { + if (Main.player[Main.myPlayer].zoneBlood) + { + if ((double)Main.player[Main.myPlayer].position.Y > Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2)) + { + this.newMusic = 16; + } + else + { + this.newMusic = 16; + } + } + else + { + if (Main.player[Main.myPlayer].zoneDungeon) + { + this.newMusic = 23; + } + else + { + if (Main.player[Main.myPlayer].zoneMeteor) + { + this.newMusic = 2; + } + else + { + if (Main.player[Main.myPlayer].zoneJungle) + { + this.newMusic = 7; + } + else + { + if (Main.player[Main.myPlayer].zoneSnow) + { + if ((double)Main.player[Main.myPlayer].position.Y > Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2)) + { + this.newMusic = 20; + } + else + { + this.newMusic = 14; + } + } + else + { + if ((double)Main.player[Main.myPlayer].position.Y > Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2)) + { + if (Main.player[Main.myPlayer].zoneHoly) + { + this.newMusic = 11; + } + else + { + this.newMusic = 4; + } + } + else + { + if (Main.dayTime && Main.player[Main.myPlayer].zoneHoly) + { + if (Main.cloudAlpha > 0f && !Main.gameMenu) + { + this.newMusic = 19; + } + else + { + this.newMusic = 9; + } + } + else + { + if ((double)(Main.screenPosition.Y / 16f) < Main.worldSurface + 10.0 && (num2 < 380 || num2 > Main.maxTilesX - 380)) + { + this.newMusic = 22; + } + else + { + if (Main.sandTiles > 1000) + { + this.newMusic = 21; + } + else + { + if (Main.dayTime) + { + if (Main.cloudAlpha > 0f && !Main.gameMenu) + { + this.newMusic = 19; + } + else + { + if (Main.dayMusic == 0) + { + Main.dayMusic = 1; + } + if (!Main.music[1].IsPlaying && !Main.music[18].IsPlaying) + { + int num5 = Main.rand.Next(2); + if (num5 == 0) + { + Main.dayMusic = 1; + } + else + { + if (num5 == 1) + { + Main.dayMusic = 18; + } + } + } + this.newMusic = Main.dayMusic; + } + } + else + { + if (!Main.dayTime) + { + if (Main.bloodMoon) + { + this.newMusic = 2; + } + else + { + if (Main.cloudAlpha > 0f && !Main.gameMenu) + { + this.newMusic = 19; + } + else + { + this.newMusic = 3; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.gameMenu || Main.musicVolume == 0f) + { + Main.musicBox2 = -1; + Main.musicBox = -1; + } + if (Main.musicBox2 >= 0) + { + Main.musicBox = Main.musicBox2; + } + if (Main.musicBox >= 0) + { + if (Main.musicBox == 0) + { + this.newMusic = 1; + } + if (Main.musicBox == 1) + { + this.newMusic = 2; + } + if (Main.musicBox == 2) + { + this.newMusic = 3; + } + if (Main.musicBox == 4) + { + this.newMusic = 4; + } + if (Main.musicBox == 5) + { + this.newMusic = 5; + } + if (Main.musicBox == 3) + { + this.newMusic = 6; + } + if (Main.musicBox == 6) + { + this.newMusic = 7; + } + if (Main.musicBox == 7) + { + this.newMusic = 8; + } + if (Main.musicBox == 9) + { + this.newMusic = 9; + } + if (Main.musicBox == 8) + { + this.newMusic = 10; + } + if (Main.musicBox == 11) + { + this.newMusic = 11; + } + if (Main.musicBox == 10) + { + this.newMusic = 12; + } + if (Main.musicBox == 12) + { + this.newMusic = 13; + } + if (Main.musicBox == 13) + { + this.newMusic = 14; + } + if (Main.musicBox == 14) + { + this.newMusic = 15; + } + if (Main.musicBox == 15) + { + this.newMusic = 16; + } + if (Main.musicBox == 16) + { + this.newMusic = 17; + } + if (Main.musicBox == 17) + { + this.newMusic = 18; + } + if (Main.musicBox == 18) + { + this.newMusic = 19; + } + if (Main.musicBox == 19) + { + this.newMusic = 20; + } + if (Main.musicBox == 20) + { + this.newMusic = 21; + } + if (Main.musicBox == 21) + { + this.newMusic = 22; + } + if (Main.musicBox == 22) + { + this.newMusic = 23; + } + if (Main.musicBox == 23) + { + this.newMusic = 24; + } + if (Main.musicBox == 24) + { + this.newMusic = 25; + } + if (Main.musicBox == 25) + { + this.newMusic = 26; + } + if (Main.musicBox == 26) + { + this.newMusic = 27; + } + if (Main.musicBox == 27) + { + this.newMusic = 29; + } + } + Main.curMusic = this.newMusic; + for (int j = 1; j < 30; j++) + { + if (j == 28) + { + if (Main.cloudAlpha > 0f && (double)Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2) && !Main.player[Main.myPlayer].zoneSnow) + { + if (!Main.music[j].IsPlaying) + { + Main.music[j] = Main.soundBank.GetCue("Music_" + j); + Main.music[j].Play(); + Main.music[j].SetVariable("Volume", Main.musicFade[j] * Main.musicVolume); + } + else + { + Main.musicFade[j] += 0.005f; + if (Main.musicFade[j] > 1f) + { + Main.musicFade[j] = 1f; + } + Main.music[j].SetVariable("Volume", Main.musicFade[j] * Main.musicVolume); + } + } + else + { + if (Main.music[j].IsPlaying) + { + if (Main.musicFade[Main.curMusic] > 0.25f) + { + Main.musicFade[j] -= 0.005f; + } + else + { + if (Main.curMusic == 0) + { + Main.musicFade[j] = 0f; + } + } + if (Main.musicFade[j] <= 0f) + { + Main.musicFade[j] -= 0f; + Main.music[j].Stop(AudioStopOptions.Immediate); + } + else + { + Main.music[j].SetVariable("Volume", Main.musicFade[j] * Main.musicVolume); + } + } + else + { + Main.musicFade[j] = 0f; + } + } + } + else + { + if (j == Main.curMusic) + { + if (!Main.music[j].IsPlaying) + { + Main.music[j] = Main.soundBank.GetCue("Music_" + j); + Main.music[j].Play(); + Main.music[j].SetVariable("Volume", Main.musicFade[j] * Main.musicVolume); + } + else + { + Main.musicFade[j] += 0.005f; + if (Main.musicFade[j] > 1f) + { + Main.musicFade[j] = 1f; + } + Main.music[j].SetVariable("Volume", Main.musicFade[j] * Main.musicVolume); + } + } + else + { + if (Main.music[j].IsPlaying) + { + if (Main.musicFade[Main.curMusic] > 0.25f) + { + Main.musicFade[j] -= 0.005f; + } + else + { + if (Main.curMusic == 0) + { + Main.musicFade[j] = 0f; + } + } + if (Main.musicFade[j] <= 0f) + { + Main.musicFade[j] -= 0f; + Main.music[j].Stop(AudioStopOptions.Immediate); + } + else + { + Main.music[j].SetVariable("Volume", Main.musicFade[j] * Main.musicVolume); + } + } + else + { + Main.musicFade[j] = 0f; + } + } + } + } + if (Main.musicError > 0) + { + Main.musicError--; + } + } + } + catch + { + Main.musicError++; + if (Main.musicError >= 100) + { + Main.musicError = 0; + Main.musicVolume = 0f; + } + } + } + public static void snowing() + { + if (Main.gamePaused) + { + return; + } + if (Main.snowTiles > 0 && (double)Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0) + { + int maxValue = 800 / Main.snowTiles; + float num = (float)Main.screenWidth / 1920f; + int num2 = (int)(500f * num); + num2 = (int)((float)num2 * (1f + 2f * Main.cloudAlpha)); + float num3 = 1f + 50f * Main.cloudAlpha; + int num4 = 0; + while ((float)num4 < num3) + { + try + { + if ((float)Main.snowDust >= (float)num2 * (Main.gfxQuality / 2f + 0.5f) + (float)num2 * 0.1f) + { + break; + } + if (Main.rand.Next(maxValue) == 0) + { + int num5 = Main.rand.Next(Main.screenWidth + 1000) - 500; + int num6 = (int)Main.screenPosition.Y - Main.rand.Next(50); + if (Main.player[Main.myPlayer].velocity.Y > 0f) + { + num6 -= (int)Main.player[Main.myPlayer].velocity.Y; + } + if (Main.rand.Next(5) == 0) + { + num5 = Main.rand.Next(500) - 500; + } + else + { + if (Main.rand.Next(5) == 0) + { + num5 = Main.rand.Next(500) + Main.screenWidth; + } + } + if (num5 < 0 || num5 > Main.screenWidth) + { + num6 += Main.rand.Next((int)((double)Main.screenHeight * 0.5)) + (int)((double)Main.screenHeight * 0.1); + } + num5 += (int)Main.screenPosition.X; + int num7 = num5 / 16; + int num8 = num6 / 16; + if (Main.tile[num7, num8] != null && Main.tile[num7, num8].wall == 0) + { + int num9 = Dust.NewDust(new Vector2((float)num5, (float)num6), 10, 10, 76, 0f, 0f, 0, default(Color), 1f); + Main.dust[num9].scale += Main.cloudAlpha * 0.2f; + Main.dust[num9].velocity.Y = 3f + (float)Main.rand.Next(30) * 0.1f; + Dust expr_291_cp_0 = Main.dust[num9]; + expr_291_cp_0.velocity.Y = expr_291_cp_0.velocity.Y * Main.dust[num9].scale; + Main.dust[num9].velocity.X = Main.windSpeed + (float)Main.rand.Next(-10, 10) * 0.1f; + Dust expr_2E4_cp_0 = Main.dust[num9]; + expr_2E4_cp_0.velocity.X = expr_2E4_cp_0.velocity.X + Main.windSpeed * Main.cloudAlpha * 10f; + Dust expr_30E_cp_0 = Main.dust[num9]; + expr_30E_cp_0.velocity.Y = expr_30E_cp_0.velocity.Y * (1f + 0.3f * Main.cloudAlpha); + Main.dust[num9].scale += Main.cloudAlpha * 0.2f; + Main.dust[num9].velocity *= 1f + Main.cloudAlpha * 0.5f; + } + } + } + catch + { + } + num4++; + } + } + } + public static void checkXMas() + { + DateTime now = DateTime.Now; + int day = now.Day; + int month = now.Month; + if (day >= 15 && month == 12) + { + Main.xMas = true; + return; + } + Main.xMas = false; + } + public void updateCloudLayer() + { + if (Main.netMode == 1) + { + return; + } + if (Main.netMode == 0 && Main.gameMenu) + { + return; + } + int num = 86400; + int num2 = num / 24; + float num3 = 1f + 4f * Main.cloudAlpha; + if (Main.cloudBGActive > 0f) + { + if (Main.cloudBGActive > 1f) + { + Main.cloudBGActive -= (float)Main.dayRate / num3; + } + if (Main.cloudBGActive < 1f) + { + Main.cloudBGActive = 1f; + } + if (Main.cloudBGActive == 1f && Main.rand.Next((int)((float)(num2 * 2 / Main.dayRate) * num3)) == 0) + { + Main.cloudBGActive = (float)(-(float)Main.rand.Next(num2 * 4, num * 4)); + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + return; + } + } + } + else + { + if (Main.cloudBGActive < 0f) + { + Main.cloudBGActive += (float)Main.dayRate * num3; + if (Main.raining) + { + Main.cloudBGActive += (float)(2 * Main.dayRate) * num3; + } + } + if (Main.cloudBGActive > 0f) + { + Main.cloudBGActive = 0f; + } + if (Main.cloudBGActive == 0f && Main.rand.Next((int)((float)(num2 * 8 / Main.dayRate) / num3)) == 0) + { + Main.cloudBGActive = (float)Main.rand.Next(num2 * 3, num * 2); + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + } + } + public static void TeleportEffect(Rectangle effectRect, int Style) + { + if (Style == 1) + { + Main.PlaySound(2, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2, 8); + int num = effectRect.Width * effectRect.Height / 5; + for (int i = 0; i < num; i++) + { + int num2 = Dust.NewDust(new Vector2((float)effectRect.X, (float)effectRect.Y), effectRect.Width, effectRect.Height, 164, 0f, 0f, 0, default(Color), 1f); + Main.dust[num2].scale = (float)Main.rand.Next(20, 70) * 0.01f; + if (i < 10) + { + Main.dust[num2].scale += 0.25f; + } + if (i < 5) + { + Main.dust[num2].scale += 0.25f; + } + } + return; + } + Main.PlaySound(2, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2, 6); + int num3 = effectRect.Width * effectRect.Height / 5; + for (int j = 0; j < num3; j++) + { + int num4 = Dust.NewDust(new Vector2((float)effectRect.X, (float)effectRect.Y), effectRect.Width, effectRect.Height, 159, 0f, 0f, 0, default(Color), 1f); + Main.dust[num4].scale = (float)Main.rand.Next(20, 70) * 0.01f; + if (j < 10) + { + Main.dust[num4].scale += 0.25f; + } + if (j < 5) + { + Main.dust[num4].scale += 0.25f; + } + } + } + protected override void Update(GameTime gameTime) + { + Main.ignoreErrors = true; + if (Main.netMode == 2) + { + Main.cloudAlpha = Main.maxRaining; + } + if (base.IsActive && Main.cloudAlpha > 0f) + { + Rain.MakeRain(); + } + if (Main.netMode != 1) + { + this.updateCloudLayer(); + } + this.UpdateWeather(); + if (Main.netMode != 2) + { + if (Main.ignoreErrors) + { + try + { + Main.snowing(); + goto IL_63; + } + catch + { + goto IL_63; + } + } + Main.snowing(); + } + IL_63: + if (Main.chTitle) + { + Main.chTitle = false; + this.SetTitle(); + } + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + WorldGen.destroyObject = false; + if (Main.gameMenu) + { + Main.mapFullscreen = false; + } + if (Main.dedServ) + { + if (Main.dedServFPS) + { + Main.updateTime++; + if (!Main.fpsTimer.IsRunning) + { + Main.fpsTimer.Restart(); + } + if (Main.fpsTimer.ElapsedMilliseconds >= 1000L) + { + Main.dedServCount1 += Main.updateTime; + Main.dedServCount2++; + float num = (float)Main.dedServCount1 / (float)Main.dedServCount2; + Console.WriteLine(string.Concat(new object[] + { + Main.updateTime, + " (", + num, + ")" + })); + Main.updateTime = 0; + Main.fpsTimer.Restart(); + } + } + else + { + if (Main.fpsTimer.IsRunning) + { + Main.fpsTimer.Stop(); + } + Main.updateTime = 0; + } + } + if (!Main.dedServ) + { + if (Main.superFast) + { + base.IsFixedTimeStep = false; + this.graphics.SynchronizeWithVerticalRetrace = false; + } + else + { + if (Main.fixedTiming) + { + if (base.IsActive) + { + base.IsFixedTimeStep = false; + } + else + { + base.IsFixedTimeStep = true; + } + } + else + { + base.IsFixedTimeStep = true; + this.graphics.SynchronizeWithVerticalRetrace = true; + } + this.graphics.SynchronizeWithVerticalRetrace = true; + } + if (Main.treeMntBG[1] == 94 || (Main.treeMntBG[1] >= 114 && Main.treeMntBG[1] <= 116)) + { + Main.bgFrameCounter[0]++; + if (Main.bgFrameCounter[0] >= 6) + { + Main.bgFrameCounter[0] = 0; + Main.bgFrame[0]++; + if (Main.bgFrame[0] >= 4) + { + Main.bgFrame[0] = 0; + } + } + if (Main.bgFrame[0] == 0) + { + Main.treeMntBG[1] = 94; + } + else + { + if (Main.bgFrame[0] == 1) + { + Main.treeMntBG[1] = 114; + } + else + { + if (Main.bgFrame[0] == 2) + { + Main.treeMntBG[1] = 115; + } + else + { + Main.treeMntBG[1] = 116; + } + } + } + if (Main.bgFrame[0] == 0) + { + Main.treeMntBG[0] = 93; + } + else + { + if (Main.bgFrame[0] == 1) + { + Main.treeMntBG[0] = 168; + } + else + { + if (Main.bgFrame[0] == 2) + { + Main.treeMntBG[0] = 169; + } + else + { + Main.treeMntBG[0] = 170; + } + } + } + } + if (Main.treeMntBG[1] >= 180 && Main.treeMntBG[1] <= 183) + { + Main.bgFrameCounter[0]++; + if (Main.bgFrameCounter[0] >= 6) + { + Main.bgFrameCounter[0] = 0; + Main.bgFrame[0]++; + if (Main.bgFrame[0] >= 4) + { + Main.bgFrame[0] = 0; + } + } + if (Main.bgFrame[0] == 0) + { + Main.treeMntBG[1] = 180; + } + else + { + if (Main.bgFrame[0] == 1) + { + Main.treeMntBG[1] = 181; + } + else + { + if (Main.bgFrame[0] == 2) + { + Main.treeMntBG[1] = 182; + } + else + { + Main.treeMntBG[1] = 183; + } + } + } + } + this.UpdateMusic(); + if (Main.showSplash) + { + return; + } + if (!Main.gameMenu && Main.netMode == 1) + { + if (!Main.saveTime.IsRunning) + { + Main.saveTime.Start(); + } + if (Main.saveTime.ElapsedMilliseconds > 300000L) + { + Main.saveTime.Reset(); + WorldGen.saveToonWhilePlaying(); + } + } + else + { + if (!Main.gameMenu && Main.autoSave) + { + if (!Main.saveTime.IsRunning) + { + Main.saveTime.Start(); + } + if (Main.saveTime.ElapsedMilliseconds > 600000L) + { + Main.saveTime.Reset(); + WorldGen.saveToonWhilePlaying(); + WorldGen.saveAndPlay(); + } + } + else + { + if (Main.saveTime.IsRunning) + { + Main.saveTime.Stop(); + } + } + } + if (Main.teamCooldown > 0) + { + Main.teamCooldown--; + } + Main.updateTime++; + if (Main.fpsTimer.ElapsedMilliseconds >= 1000L) + { + if ((float)Main.fpsCount >= 30f + 30f * Main.gfxQuality) + { + Main.gfxQuality += Main.gfxRate; + Main.gfxRate += 0.005f; + } + else + { + if ((float)Main.fpsCount < 29f + 30f * Main.gfxQuality) + { + Main.gfxRate = 0.01f; + Main.gfxQuality -= 0.1f; + } + } + if (Main.gfxQuality < 0f) + { + Main.gfxQuality = 0f; + } + if (Main.gfxQuality > 1f) + { + Main.gfxQuality = 1f; + } + if (Main.maxQ && base.IsActive) + { + Main.gfxQuality = 1f; + Main.maxQ = false; + } + Main.updateRate = Main.uCount; + Main.frameRate = Main.fpsCount; + Main.fpsCount = 0; + Main.fpsTimer.Restart(); + Main.updateTime = 0; + Main.drawTime = 0; + Main.uCount = 0; + if ((double)Main.gfxQuality < 0.8) + { + Main.mapTimeMax = (int)((1f - Main.gfxQuality) * 60f); + } + else + { + Main.mapTimeMax = 0; + } + int arg_5CA_0 = Main.netMode; + } + if (Main.fixedTiming) + { + float num2 = 16f; + float num3 = (float)Main.updateTimer.ElapsedMilliseconds; + if (num3 + Main.uCarry < num2 && !Main.superFast) + { + Main.drawSkip = true; + return; + } + Main.uCarry += num3 - num2; + if (Main.uCarry > 1000f) + { + Main.uCarry = 1000f; + } + Main.updateTimer.Restart(); + } + Main.uCount++; + Main.drawSkip = false; + if (Main.qaStyle == 1) + { + Main.gfxQuality = 1f; + } + else + { + if (Main.qaStyle == 2) + { + Main.gfxQuality = 0.5f; + } + else + { + if (Main.qaStyle == 3) + { + Main.gfxQuality = 0f; + } + } + } + Main.numDust = (int)(6000f * (Main.gfxQuality * 0.7f + 0.3f)); + if ((double)Main.gfxQuality < 0.9) + { + Main.numDust = (int)((float)Main.numDust * Main.gfxQuality); + } + if (Main.numDust < 1000) + { + Main.numDust = 1000; + } + Gore.goreTime = (int)(600f * Main.gfxQuality); + Liquid.maxLiquid = (int)(2500f + 2500f * Main.gfxQuality); + Liquid.cycles = (int)(17f - 10f * Main.gfxQuality); + if ((double)Main.gfxQuality < 0.5) + { + this.graphics.SynchronizeWithVerticalRetrace = false; + } + else + { + this.graphics.SynchronizeWithVerticalRetrace = true; + } + if (Main.superFast) + { + this.graphics.SynchronizeWithVerticalRetrace = false; + Main.drawSkip = false; + } + if ((double)Main.gfxQuality < 0.2) + { + Lighting.maxRenderCount = 8; + } + else + { + if ((double)Main.gfxQuality < 0.4) + { + Lighting.maxRenderCount = 7; + } + else + { + if ((double)Main.gfxQuality < 0.6) + { + Lighting.maxRenderCount = 6; + } + else + { + if ((double)Main.gfxQuality < 0.8) + { + Lighting.maxRenderCount = 5; + } + else + { + Lighting.maxRenderCount = 4; + } + } + } + } + if (Liquid.quickSettle) + { + Liquid.maxLiquid = Liquid.resLiquid; + Liquid.cycles = 1; + } + if (!base.IsActive) + { + Main.hasFocus = false; + } + else + { + Main.hasFocus = true; + } + if (!Main.gameMenu || Main.netMode == 2) + { + WorldGen.tempRaining = Main.raining; + WorldGen.tempRainTime = Main.rainTime; + WorldGen.tempMaxRain = Main.maxRaining; + } + if (!base.IsActive && Main.netMode == 0) + { + base.IsMouseVisible = true; + if (Main.netMode != 2 && Main.myPlayer >= 0) + { + Main.player[Main.myPlayer].delayUseItem = true; + } + Main.mouseLeftRelease = false; + Main.mouseRightRelease = false; + if (Main.gameMenu) + { + Main.UpdateMenu(); + } + Main.gamePaused = true; + return; + } + base.IsMouseVisible = false; + Main.demonTorch += (float)Main.demonTorchDir * 0.01f; + if (Main.demonTorch > 1f) + { + Main.demonTorch = 1f; + Main.demonTorchDir = -1; + } + if (Main.demonTorch < 0f) + { + Main.demonTorch = 0f; + Main.demonTorchDir = 1; + } + int num4 = 7; + if (this.DiscoStyle == 0) + { + Main.DiscoG += num4; + if (Main.DiscoG >= 255) + { + Main.DiscoG = 255; + this.DiscoStyle++; + } + Main.DiscoR -= num4; + if (Main.DiscoR <= 0) + { + Main.DiscoR = 0; + } + } + else + { + if (this.DiscoStyle == 1) + { + Main.DiscoB += num4; + if (Main.DiscoB >= 255) + { + Main.DiscoB = 255; + this.DiscoStyle++; + } + Main.DiscoG -= num4; + if (Main.DiscoG <= 0) + { + Main.DiscoG = 0; + } + } + else + { + Main.DiscoR += num4; + if (Main.DiscoR >= 255) + { + Main.DiscoR = 255; + this.DiscoStyle = 0; + } + Main.DiscoB -= num4; + if (Main.DiscoB <= 0) + { + Main.DiscoB = 0; + } + } + } + if (Main.gFadeDir == 1) + { + Main.gFader += 0.1f; + Main.gFade = (byte)Main.gFader; + if (Main.gFade > 150) + { + Main.gFadeDir = 0; + } + } + else + { + Main.gFader -= 0.1f; + Main.gFade = (byte)Main.gFader; + if (Main.gFade < 100) + { + Main.gFadeDir = 1; + } + } + Main.wFrCounter += Main.windSpeed * 2f; + if (Main.wFrCounter > 4f) + { + Main.wFrCounter = 0f; + Main.wFrame += 1f; + } + if (Main.wFrCounter < 0f) + { + Main.wFrCounter = 4f; + Main.wFrame -= 1f; + } + if (Main.wFrame > 16f) + { + Main.wFrame = 1f; + } + if (Main.wFrame < 1f) + { + Main.wFrame = 16f; + } + Main.wFallFrCounter += 1f; + if (Main.wFallFrCounter > 2f) + { + Main.wFallFrCounter = 0f; + Main.wFallFrame += 1f; + } + if (Main.wFallFrame > 15f) + { + Main.wFallFrame = 0f; + } + Main.wFallFrCounter2 += 1f; + if (Main.wFallFrCounter2 > 6f) + { + Main.wFallFrCounter2 = 0f; + Main.wFallFrame2 += 1f; + } + if (Main.wFallFrame2 > 15f) + { + Main.wFallFrame2 = 0f; + } + Main.wFallFrCounter3 += 1f; + if (Main.wFallFrCounter3 > 0f) + { + Main.wFallFrCounter3 = 0f; + Main.wFallFrame3 += 1f; + } + if (Main.wFallFrame3 > 7f) + { + Main.wFallFrame3 -= 8f; + } + Main.wFallFrCounter4 += 1f; + if (Main.wFallFrCounter4 > 2f) + { + Main.wFallFrCounter4 = 0f; + Main.wFallFrame4 -= 1f; + } + if (Main.wFallFrame4 < 0f) + { + Main.wFallFrame4 += 8f; + } + Main.tileFrameCounter[12]++; + if (Main.tileFrameCounter[12] > 5) + { + Main.tileFrameCounter[12] = 0; + Main.tileFrame[12]++; + if (Main.tileFrame[12] >= 10) + { + Main.tileFrame[12] = 0; + } + } + Main.tileFrameCounter[17]++; + if (Main.tileFrameCounter[17] > 5) + { + Main.tileFrameCounter[17] = 0; + Main.tileFrame[17]++; + if (Main.tileFrame[17] >= 12) + { + Main.tileFrame[17] = 0; + } + } + Main.tileFrameCounter[31]++; + if (Main.tileFrameCounter[31] > 10) + { + Main.tileFrameCounter[31] = 0; + Main.tileFrame[31]++; + if (Main.tileFrame[31] > 1) + { + Main.tileFrame[31] = 0; + } + } + Main.tileFrameCounter[77]++; + if (Main.tileFrameCounter[77] > 5) + { + Main.tileFrameCounter[77] = 0; + Main.tileFrame[77]++; + if (Main.tileFrame[77] >= 12) + { + Main.tileFrame[77] = 0; + } + } + Main.tileFrameCounter[207]++; + if (Main.tileFrameCounter[207] > 4) + { + Main.tileFrameCounter[207] = 0; + Main.tileFrame[207]++; + if (Main.tileFrame[207] >= 6) + { + Main.tileFrame[207] = 0; + } + } + Main.tileFrameCounter[215]++; + if (Main.tileFrameCounter[215] > 4) + { + Main.tileFrameCounter[215] = 0; + Main.tileFrame[215]++; + if (Main.tileFrame[215] >= 4) + { + Main.tileFrame[215] = 0; + } + } + Main.tileFrameCounter[217]++; + if (Main.tileFrameCounter[217] > 4) + { + Main.tileFrameCounter[217] = 0; + Main.tileFrame[217]++; + if (Main.tileFrame[217] >= 5) + { + Main.tileFrame[217] = 0; + } + } + Main.tileFrameCounter[218]++; + if (Main.tileFrameCounter[218] > 4) + { + Main.tileFrameCounter[218] = 0; + Main.tileFrame[218]++; + if (Main.tileFrame[218] >= 2) + { + Main.tileFrame[218] = 0; + } + } + Main.tileFrameCounter[219]++; + if (Main.tileFrameCounter[219] > 4) + { + Main.tileFrameCounter[219] = 0; + Main.tileFrame[219]++; + if (Main.tileFrame[219] >= 10) + { + Main.tileFrame[219] = 0; + } + } + Main.tileFrameCounter[220]++; + if (Main.tileFrameCounter[220] > 4) + { + Main.tileFrameCounter[220] = 0; + Main.tileFrame[220]++; + if (Main.tileFrame[220] >= 4) + { + Main.tileFrame[220] = 0; + } + } + Main.tileFrameCounter[231]++; + if (Main.tileFrameCounter[231] > 16) + { + Main.tileFrameCounter[231] = 0; + Main.tileFrame[231]++; + if (Main.tileFrame[231] >= 7) + { + Main.tileFrame[231] = 0; + } + } + Main.tileFrameCounter[235]++; + if (Main.tileFrameCounter[235] > 20) + { + Main.tileFrameCounter[235] = 0; + Main.tileFrame[235]++; + if (Main.tileFrame[235] >= 4) + { + Main.tileFrame[235] = 0; + } + if (Main.tileFrame[235] > 1) + { + Main.tileLighted[235] = true; + } + else + { + Main.tileLighted[235] = false; + } + } + Main.tileFrameCounter[238]++; + if (Main.tileFrameCounter[238] > 20) + { + Main.tileFrameCounter[238] = 0; + Main.tileFrame[238]++; + if (Main.tileFrame[238] >= 4) + { + Main.tileFrame[238] = 0; + } + } + Main.tileFrameCounter[243]++; + if (Main.tileFrameCounter[243] > 4) + { + Main.tileFrameCounter[243] = 0; + Main.tileFrame[243]++; + if (Main.tileFrame[243] >= 6) + { + Main.tileFrame[243] = 0; + } + } + Main.tileFrameCounter[244]++; + if (Main.tileFrameCounter[244] > 4) + { + Main.tileFrameCounter[244] = 0; + Main.tileFrame[244]++; + if (Main.tileFrame[244] >= 6) + { + Main.tileFrame[244] = 0; + } + } + Main.tileFrameCounter[247]++; + if (Main.tileFrameCounter[247] > 4) + { + Main.tileFrameCounter[247] = 0; + Main.tileFrame[247]++; + if (Main.tileFrame[247] > 7) + { + Main.tileFrame[247] = 0; + } + } + if (Main.keyState.IsKeyDown(Keys.F10) && !Main.chatMode && !Main.editSign) + { + if (Main.frameRelease) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.showFrameRate) + { + Main.showFrameRate = false; + } + else + { + Main.showFrameRate = true; + } + } + Main.frameRelease = false; + } + else + { + Main.frameRelease = true; + } + if (Main.keyState.IsKeyDown(Keys.F9) && !Main.chatMode && !Main.editSign) + { + if (Main.RGBRelease) + { + Lighting.lightCounter += 100; + Main.PlaySound(12, -1, -1, 1); + Lighting.lightMode++; + if (Lighting.lightMode >= 4) + { + Lighting.lightMode = 0; + } + if (Lighting.lightMode == 2 || Lighting.lightMode == 0) + { + Main.renderCount = 0; + Main.renderNow = true; + int num5 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2; + int num6 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2; + for (int i = 0; i < num5; i++) + { + for (int j = 0; j < num6; j++) + { + Lighting.color[i, j] = 0f; + Lighting.colorG[i, j] = 0f; + Lighting.colorB[i, j] = 0f; + } + } + } + } + Main.RGBRelease = false; + } + else + { + Main.RGBRelease = true; + } + if (Main.keyState.IsKeyDown(Keys.F8) && !Main.chatMode && !Main.editSign) + { + if (Main.netRelease) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.netDiag) + { + Main.netDiag = false; + } + else + { + Main.netDiag = true; + } + } + Main.netRelease = false; + } + else + { + Main.netRelease = true; + } + if (Main.keyState.IsKeyDown(Keys.F7) && !Main.chatMode && !Main.editSign) + { + if (Main.drawRelease) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.drawDiag) + { + Main.drawDiag = false; + } + else + { + Main.drawDiag = true; + } + } + Main.drawRelease = false; + } + else + { + Main.drawRelease = true; + } + if (Main.keyState.IsKeyDown(Keys.F11)) + { + if (Main.releaseUI) + { + if (Main.hideUI) + { + Main.hideUI = false; + } + else + { + Main.hideUI = true; + } + } + Main.releaseUI = false; + } + else + { + Main.releaseUI = true; + } + if ((Main.keyState.IsKeyDown(Keys.LeftAlt) || Main.keyState.IsKeyDown(Keys.RightAlt)) && Main.keyState.IsKeyDown(Keys.Enter)) + { + if (this.toggleFullscreen) + { + this.graphics.ToggleFullScreen(); + Main.chatRelease = false; + } + this.toggleFullscreen = false; + } + else + { + this.toggleFullscreen = true; + } + if (!Main.gamePad || Main.gameMenu) + { + Main.oldMouseState = Main.mouseState; + Main.mouseState = Mouse.GetState(); + Main.mouseX = Main.mouseState.X; + Main.mouseY = Main.mouseState.Y; + Main.mouseLeft = false; + Main.mouseRight = false; + if (Main.mouseState.LeftButton == ButtonState.Pressed) + { + Main.mouseLeft = true; + } + if (Main.mouseState.RightButton == ButtonState.Pressed) + { + Main.mouseRight = true; + } + } + Main.keyState = Keyboard.GetState(); + if (Main.editSign) + { + Main.chatMode = false; + } + if (!Main.chatMode) + { + Main.startChatLine = 0; + } + if (Main.chatMode) + { + Main.showCount = (int)((float)(Main.screenHeight / 3) / Main.fontMouseText.MeasureString("1").Y) - 1; + if (Main.keyState.IsKeyDown(Keys.Up)) + { + Main.startChatLine++; + if (Main.startChatLine + Main.showCount >= Main.numChatLines - 1) + { + Main.startChatLine = Main.numChatLines - Main.showCount - 1; + } + if (Main.chatLine[Main.startChatLine + Main.showCount].text == "") + { + Main.startChatLine--; + } + } + else + { + if (Main.keyState.IsKeyDown(Keys.Down)) + { + Main.startChatLine--; + if (Main.startChatLine < 0) + { + Main.startChatLine = 0; + } + } + } + if (Main.keyState.IsKeyDown(Keys.Escape)) + { + Main.chatMode = false; + } + string text = Main.chatText; + Main.chatText = Main.GetInputText(Main.chatText); + int num7 = Main.screenWidth - 330; + while (Main.fontMouseText.MeasureString(Main.chatText).X > (float)num7) + { + Main.chatText = Main.chatText.Substring(0, Main.chatText.Length - 1); + } + if (text != Main.chatText) + { + Main.PlaySound(12, -1, -1, 1); + } + if (Main.inputTextEnter && Main.chatRelease) + { + if (Main.chatText != "") + { + NetMessage.SendData(25, -1, -1, Main.chatText, Main.myPlayer, 0f, 0f, 0f, 0); + } + Main.chatText = ""; + Main.chatMode = false; + Main.chatRelease = false; + Main.player[Main.myPlayer].releaseHook = false; + Main.player[Main.myPlayer].releaseThrow = false; + Main.PlaySound(11, -1, -1, 1); + } + } + if (Main.keyState.IsKeyDown(Keys.Enter) && Main.netMode == 1 && !Main.keyState.IsKeyDown(Keys.LeftAlt) && !Main.keyState.IsKeyDown(Keys.RightAlt)) + { + if (Main.chatRelease && !Main.chatMode && !Main.editSign && !Main.gameMenu && !Main.keyState.IsKeyDown(Keys.Escape)) + { + Main.PlaySound(10, -1, -1, 1); + Main.chatMode = true; + Main.clrInput(); + Main.chatText = ""; + } + Main.chatRelease = false; + } + else + { + Main.chatRelease = true; + } + if (Main.gameMenu) + { + Main.UpdateMenu(); + if (Main.netMode != 2) + { + return; + } + Main.gamePaused = false; + } + } + if (Main.netMode == 1) + { + for (int k = 0; k < 59; k++) + { + if (Main.player[Main.myPlayer].inventory[k].IsNotTheSameAs(Main.clientPlayer.inventory[k])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].inventory[k].name, Main.myPlayer, (float)k, (float)Main.player[Main.myPlayer].inventory[k].prefix, 0f, 0); + } + } + if (Main.player[Main.myPlayer].armor[0].IsNotTheSameAs(Main.clientPlayer.armor[0])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[0].name, Main.myPlayer, 59f, (float)Main.player[Main.myPlayer].armor[0].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[1].IsNotTheSameAs(Main.clientPlayer.armor[1])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[1].name, Main.myPlayer, 60f, (float)Main.player[Main.myPlayer].armor[1].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[2].IsNotTheSameAs(Main.clientPlayer.armor[2])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[2].name, Main.myPlayer, 61f, (float)Main.player[Main.myPlayer].armor[2].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[3].IsNotTheSameAs(Main.clientPlayer.armor[3])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[3].name, Main.myPlayer, 62f, (float)Main.player[Main.myPlayer].armor[3].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[4].IsNotTheSameAs(Main.clientPlayer.armor[4])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[4].name, Main.myPlayer, 63f, (float)Main.player[Main.myPlayer].armor[4].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[5].IsNotTheSameAs(Main.clientPlayer.armor[5])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[5].name, Main.myPlayer, 64f, (float)Main.player[Main.myPlayer].armor[5].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[6].IsNotTheSameAs(Main.clientPlayer.armor[6])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[6].name, Main.myPlayer, 65f, (float)Main.player[Main.myPlayer].armor[6].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[7].IsNotTheSameAs(Main.clientPlayer.armor[7])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[7].name, Main.myPlayer, 66f, (float)Main.player[Main.myPlayer].armor[7].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[8].IsNotTheSameAs(Main.clientPlayer.armor[8])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[8].name, Main.myPlayer, 67f, (float)Main.player[Main.myPlayer].armor[8].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[9].IsNotTheSameAs(Main.clientPlayer.armor[9])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[9].name, Main.myPlayer, 68f, (float)Main.player[Main.myPlayer].armor[9].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].armor[10].IsNotTheSameAs(Main.clientPlayer.armor[10])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[10].name, Main.myPlayer, 69f, (float)Main.player[Main.myPlayer].armor[10].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].dye[0].IsNotTheSameAs(Main.clientPlayer.dye[0])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].dye[0].name, Main.myPlayer, 70f, (float)Main.player[Main.myPlayer].dye[0].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].dye[1].IsNotTheSameAs(Main.clientPlayer.dye[1])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].dye[1].name, Main.myPlayer, 71f, (float)Main.player[Main.myPlayer].dye[1].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].dye[2].IsNotTheSameAs(Main.clientPlayer.dye[2])) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].dye[2].name, Main.myPlayer, 72f, (float)Main.player[Main.myPlayer].dye[2].prefix, 0f, 0); + } + if (Main.player[Main.myPlayer].chest != Main.clientPlayer.chest) + { + NetMessage.SendData(33, -1, -1, "", Main.player[Main.myPlayer].chest, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].talkNPC != Main.clientPlayer.talkNPC) + { + NetMessage.SendData(40, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneEvil != Main.clientPlayer.zoneEvil) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneMeteor != Main.clientPlayer.zoneMeteor) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneDungeon != Main.clientPlayer.zoneDungeon) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneJungle != Main.clientPlayer.zoneJungle) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneHoly != Main.clientPlayer.zoneHoly) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneSnow != Main.clientPlayer.zoneSnow) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneBlood != Main.clientPlayer.zoneBlood) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Main.player[Main.myPlayer].zoneCandle != Main.clientPlayer.zoneCandle) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + bool flag = false; + for (int l = 0; l < 10; l++) + { + if (Main.player[Main.myPlayer].buffType[l] != Main.clientPlayer.buffType[l]) + { + flag = true; + } + } + if (flag) + { + NetMessage.SendData(50, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(13, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + } + if (Main.netMode == 1) + { + Main.clientPlayer = (Player)Main.player[Main.myPlayer].clientClone(); + } + if (Main.netMode == 0 && (Main.playerInventory || Main.npcChatText != "" || Main.player[Main.myPlayer].sign >= 0) && Main.autoPause) + { + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + Main.player[Main.myPlayer].controlInv = false; + for (int m = 0; m < pressedKeys.Length; m++) + { + string text2 = string.Concat(pressedKeys[m]); + if (text2 == Main.cInv) + { + Main.player[Main.myPlayer].controlInv = true; + } + } + if (Main.player[Main.myPlayer].controlInv) + { + if (Main.player[Main.myPlayer].releaseInventory) + { + Main.player[Main.myPlayer].toggleInv(); + } + Main.player[Main.myPlayer].releaseInventory = false; + } + else + { + Main.player[Main.myPlayer].releaseInventory = true; + } + if (Main.playerInventory) + { + int num8 = (Main.mouseState.ScrollWheelValue - Main.oldMouseState.ScrollWheelValue) / 120; + Main.focusRecipe += num8; + if (Main.focusRecipe > Main.numAvailableRecipes - 1) + { + Main.focusRecipe = Main.numAvailableRecipes - 1; + } + if (Main.focusRecipe < 0) + { + Main.focusRecipe = 0; + } + Main.player[Main.myPlayer].dropItemCheck(); + } + Main.player[Main.myPlayer].head = Main.player[Main.myPlayer].armor[0].headSlot; + Main.player[Main.myPlayer].body = Main.player[Main.myPlayer].armor[1].bodySlot; + Main.player[Main.myPlayer].legs = Main.player[Main.myPlayer].armor[2].legSlot; + if (!Main.player[Main.myPlayer].hostile) + { + if (Main.player[Main.myPlayer].armor[8].headSlot >= 0) + { + Main.player[Main.myPlayer].head = Main.player[Main.myPlayer].armor[8].headSlot; + } + if (Main.player[Main.myPlayer].armor[9].bodySlot >= 0) + { + Main.player[Main.myPlayer].body = Main.player[Main.myPlayer].armor[9].bodySlot; + } + if (Main.player[Main.myPlayer].armor[10].legSlot >= 0) + { + Main.player[Main.myPlayer].legs = Main.player[Main.myPlayer].armor[10].legSlot; + } + } + if (Main.editSign) + { + if (Main.player[Main.myPlayer].sign == -1) + { + Main.editSign = false; + } + else + { + Main.npcChatText = Main.GetInputText(Main.npcChatText); + if (Main.inputTextEnter) + { + byte[] bytes = new byte[] + { + 10 + }; + Main.npcChatText += Encoding.ASCII.GetString(bytes); + } + } + } + Main.gamePaused = true; + return; + } + Main.gamePaused = false; + if (!Main.dedServ && (double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0 && Main.netMode != 2) + { + Star.UpdateStars(); + Cloud.UpdateClouds(); + } + Main.numPlayers = 0; + int n = 0; + while (n < 255) + { + if (Main.ignoreErrors) + { + try + { + Main.player[n].UpdatePlayer(n); + goto IL_2568; + } + catch + { + goto IL_2568; + } + goto IL_2559; + } + goto IL_2559; + IL_2568: + n++; + continue; + IL_2559: + Main.player[n].UpdatePlayer(n); + goto IL_2568; + } + if (Main.netMode != 1) + { + NPC.SpawnNPC(); + } + for (int num9 = 0; num9 < 255; num9++) + { + Main.player[num9].activeNPCs = 0f; + Main.player[num9].townNPCs = 0f; + } + if (Main.wof >= 0 && !Main.npc[Main.wof].active) + { + Main.wof = -1; + } + if (NPC.golemBoss >= 0 && !Main.npc[NPC.golemBoss].active) + { + NPC.golemBoss = -1; + } + if (NPC.plantBoss >= 0 && !Main.npc[NPC.plantBoss].active) + { + NPC.plantBoss = -1; + } + if (NPC.crimsonBoss >= 0 && !Main.npc[NPC.crimsonBoss].active) + { + NPC.crimsonBoss = -1; + } + int num10 = 0; + while (num10 < 200) + { + if (Main.ignoreErrors) + { + try + { + Main.npc[num10].UpdateNPC(num10); + goto IL_2678; + } + catch (Exception) + { + Main.npc[num10] = new NPC(); + goto IL_2678; + } + goto IL_2669; + } + goto IL_2669; + IL_2678: + num10++; + continue; + IL_2669: + Main.npc[num10].UpdateNPC(num10); + goto IL_2678; + } + int num11 = 0; + while (num11 < 500) + { + if (Main.ignoreErrors) + { + try + { + Main.gore[num11].Update(); + goto IL_26BF; + } + catch + { + Main.gore[num11] = new Gore(); + goto IL_26BF; + } + goto IL_26B2; + } + goto IL_26B2; + IL_26BF: + num11++; + continue; + IL_26B2: + Main.gore[num11].Update(); + goto IL_26BF; + } + int num12 = 0; + while (num12 < 1000) + { + if (Main.ignoreErrors) + { + try + { + Main.projectile[num12].Update(num12); + goto IL_270A; + } + catch + { + Main.projectile[num12] = new Projectile(); + goto IL_270A; + } + goto IL_26FB; + } + goto IL_26FB; + IL_270A: + num12++; + continue; + IL_26FB: + Main.projectile[num12].Update(num12); + goto IL_270A; + } + int num13 = 0; + while (num13 < 400) + { + if (Main.ignoreErrors) + { + try + { + Main.item[num13].UpdateItem(num13); + goto IL_2755; + } + catch + { + Main.item[num13] = new Item(); + goto IL_2755; + } + goto IL_2746; + } + goto IL_2746; + IL_2755: + num13++; + continue; + IL_2746: + Main.item[num13].UpdateItem(num13); + goto IL_2755; + } + if (Main.ignoreErrors) + { + try + { + Dust.UpdateDust(); + goto IL_279B; + } + catch + { + for (int num14 = 0; num14 < 6000; num14++) + { + Main.dust[num14] = new Dust(); + } + goto IL_279B; + } + } + Dust.UpdateDust(); + IL_279B: + if (Main.netMode != 2) + { + CombatText.UpdateCombatText(); + ItemText.UpdateItemText(); + } + if (Main.ignoreErrors) + { + try + { + Main.UpdateTime(); + goto IL_27C9; + } + catch + { + Main.checkForSpawns = 0; + goto IL_27C9; + } + } + Main.UpdateTime(); + IL_27C9: + if (Main.netMode != 1) + { + if (Main.ignoreErrors) + { + try + { + WorldGen.UpdateWorld(); + Main.UpdateInvasion(); + goto IL_27F1; + } + catch + { + goto IL_27F1; + } + } + WorldGen.UpdateWorld(); + Main.UpdateInvasion(); + } + IL_27F1: + if (Main.ignoreErrors) + { + try + { + if (Main.netMode == 2) + { + Main.UpdateServer(); + } + if (Main.netMode == 1) + { + Main.UpdateClient(); + } + goto IL_2839; + } + catch + { + int arg_281C_0 = Main.netMode; + goto IL_2839; + } + } + if (Main.netMode == 2) + { + Main.UpdateServer(); + } + if (Main.netMode == 1) + { + Main.UpdateClient(); + } + IL_2839: + if (Main.ignoreErrors) + { + try + { + for (int num15 = 0; num15 < Main.numChatLines; num15++) + { + if (Main.chatLine[num15].showTime > 0) + { + Main.chatLine[num15].showTime--; + } + } + goto IL_28D8; + } + catch + { + for (int num16 = 0; num16 < Main.numChatLines; num16++) + { + Main.chatLine[num16] = new ChatLine(); + } + goto IL_28D8; + } + } + for (int num17 = 0; num17 < Main.numChatLines; num17++) + { + if (Main.chatLine[num17].showTime > 0) + { + Main.chatLine[num17].showTime--; + } + } + IL_28D8: + Main.upTimer = (float)stopwatch.ElapsedMilliseconds; + if (Main.upTimerMaxDelay > 0f) + { + Main.upTimerMaxDelay -= 1f; + } + else + { + Main.upTimerMax = 0f; + } + if (Main.upTimer > Main.upTimerMax) + { + Main.upTimerMax = Main.upTimer; + Main.upTimerMaxDelay = 400f; + } + base.Update(gameTime); + } + private static void UpdateMenu() + { + Main.playerInventory = false; + Main.exitScale = 0.8f; + if (Main.netMode == 0) + { + Main.maxRaining = 0f; + Main.raining = false; + if (!Main.grabSky) + { + Main.time += 86.4; + if (!Main.dayTime) + { + if (Main.time > 32400.0) + { + Main.bloodMoon = false; + Main.time = 0.0; + Main.dayTime = true; + Main.moonPhase++; + if (Main.moonPhase >= 8) + { + Main.moonPhase = 0; + return; + } + } + } + else + { + if (Main.time > 54000.0) + { + Main.time = 0.0; + Main.dayTime = false; + return; + } + } + } + } + else + { + if (Main.netMode == 1) + { + Main.UpdateTime(); + } + } + } + public static void clrInput() + { + Main.keyCount = 0; + } + [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] + public static extern short GetKeyState(int keyCode); + public static string GetInputText(string oldString) + { + if (!Main.hasFocus) + { + return oldString; + } + Main.inputTextEnter = false; + string text = oldString; + string text2 = ""; + if (text == null) + { + text = ""; + } + bool flag = false; + for (int i = 0; i < Main.keyCount; i++) + { + int num = Main.keyInt[i]; + string str = Main.keyString[i]; + if (num == 13) + { + Main.inputTextEnter = true; + } + else + { + if (num >= 32 && num != 127) + { + text2 += str; + } + } + } + Main.keyCount = 0; + text += text2; + Main.oldInputText = Main.inputText; + Main.inputText = Keyboard.GetState(); + Keys[] pressedKeys = Main.inputText.GetPressedKeys(); + Keys[] pressedKeys2 = Main.oldInputText.GetPressedKeys(); + if (Main.inputText.IsKeyDown(Keys.Back) && Main.oldInputText.IsKeyDown(Keys.Back)) + { + if (Main.backSpaceCount == 0) + { + Main.backSpaceCount = 7; + flag = true; + } + Main.backSpaceCount--; + } + else + { + Main.backSpaceCount = 15; + } + for (int j = 0; j < pressedKeys.Length; j++) + { + bool flag2 = true; + for (int k = 0; k < pressedKeys2.Length; k++) + { + if (pressedKeys[j] == pressedKeys2[k]) + { + flag2 = false; + } + } + string text3 = string.Concat(pressedKeys[j]); + if (text3 == "Back" && (flag2 || flag) && text.Length > 0) + { + text = text.Substring(0, text.Length - 1); + } + } + return text; + } + protected void MouseText(string cursorText, int rare = 0, byte diff = 0) + { + if (this.mouseNPC > -1) + { + return; + } + if (cursorText == null) + { + return; + } + int num = Main.mouseX + 10; + int num2 = Main.mouseY + 10; + Color color = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + float num22; + if (Main.toolTip.type > 0) + { + rare = Main.toolTip.rare; + float knockBack = Main.toolTip.knockBack; + if (Main.player[Main.myPlayer].kbGlove) + { + Main.toolTip.knockBack *= 1.7f; + } + if (Main.toolTip.ranged && Main.player[Main.myPlayer].armorSteath) + { + Main.toolTip.knockBack *= 1f + (1f - Main.player[Main.myPlayer].stealth) * 0.5f; + } + int num3 = 20; + int num4 = 1; + string[] array = new string[num3]; + bool[] array2 = new bool[num3]; + bool[] array3 = new bool[num3]; + for (int i = 0; i < num3; i++) + { + array2[i] = false; + array3[i] = false; + } + array[0] = Main.toolTip.AffixName(); + if (Main.toolTip.stack > 1) + { + string[] array4; + string[] expr_138 = array4 = array; + int arg_17C_1 = 0; + object obj = array4[0]; + expr_138[arg_17C_1] = string.Concat(new object[] + { + obj, + " (", + Main.toolTip.stack, + ")" + }); + } + if (Main.toolTip.social) + { + array[num4] = Lang.tip[0]; + num4++; + array[num4] = Lang.tip[1]; + num4++; + } + else + { + if (Main.toolTip.damage > 0 && !Main.toolTip.notAmmo) + { + int damage = Main.toolTip.damage; + if (Main.toolTip.melee) + { + array[num4] = string.Concat((int)(Main.player[Main.myPlayer].meleeDamage * (float)damage)); + string[] array5; + IntPtr intPtr; + (array5 = array)[(int)(intPtr = (IntPtr)num4)] = array5[(int)intPtr] + Lang.tip[2]; + } + else + { + if (Main.toolTip.ranged) + { + float num5 = (float)damage * Main.player[Main.myPlayer].rangedDamage; + if (Main.toolTip.useAmmo == 1) + { + num5 *= Main.player[Main.myPlayer].arrowDamage; + } + if (Main.toolTip.useAmmo == 14) + { + num5 *= Main.player[Main.myPlayer].bulletDamage; + } + if (Main.toolTip.useAmmo == 771 || Main.toolTip.useAmmo == 246) + { + num5 *= Main.player[Main.myPlayer].rocketDamage; + } + array[num4] = string.Concat((int)num5); + string[] array6; + IntPtr intPtr2; + (array6 = array)[(int)(intPtr2 = (IntPtr)num4)] = array6[(int)intPtr2] + Lang.tip[3]; + } + else + { + if (Main.toolTip.magic) + { + array[num4] = string.Concat((int)(Main.player[Main.myPlayer].magicDamage * (float)damage)); + string[] array7; + IntPtr intPtr3; + (array7 = array)[(int)(intPtr3 = (IntPtr)num4)] = array7[(int)intPtr3] + Lang.tip[4]; + } + else + { + if (Main.toolTip.summon) + { + array[num4] = string.Concat((int)(Main.player[Main.myPlayer].minionDamage * (float)damage)); + string[] array8; + IntPtr intPtr4; + (array8 = array)[(int)(intPtr4 = (IntPtr)num4)] = array8[(int)intPtr4] + Lang.tip[53]; + } + else + { + array[num4] = string.Concat(damage); + string[] array9; + IntPtr intPtr5; + (array9 = array)[(int)(intPtr5 = (IntPtr)num4)] = array9[(int)intPtr5] + Lang.tip[55]; + } + } + } + } + num4++; + if (Main.toolTip.melee) + { + int num6 = Main.player[Main.myPlayer].meleeCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.toolTip.crit; + array[num4] = num6 + Lang.tip[5]; + num4++; + } + else + { + if (Main.toolTip.ranged) + { + int num7 = Main.player[Main.myPlayer].rangedCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.toolTip.crit; + array[num4] = num7 + Lang.tip[5]; + num4++; + } + else + { + if (Main.toolTip.magic) + { + int num8 = Main.player[Main.myPlayer].magicCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.toolTip.crit; + array[num4] = num8 + Lang.tip[5]; + num4++; + } + } + } + if (Main.toolTip.useStyle > 0) + { + if (Main.toolTip.useAnimation <= 8) + { + array[num4] = Lang.tip[6]; + } + else + { + if (Main.toolTip.useAnimation <= 20) + { + array[num4] = Lang.tip[7]; + } + else + { + if (Main.toolTip.useAnimation <= 25) + { + array[num4] = Lang.tip[8]; + } + else + { + if (Main.toolTip.useAnimation <= 30) + { + array[num4] = Lang.tip[9]; + } + else + { + if (Main.toolTip.useAnimation <= 35) + { + array[num4] = Lang.tip[10]; + } + else + { + if (Main.toolTip.useAnimation <= 45) + { + array[num4] = Lang.tip[11]; + } + else + { + if (Main.toolTip.useAnimation <= 55) + { + array[num4] = Lang.tip[12]; + } + else + { + array[num4] = Lang.tip[13]; + } + } + } + } + } + } + } + num4++; + } + float num9 = Main.toolTip.knockBack; + if (Main.toolTip.summon) + { + num9 += Main.player[Main.myPlayer].minionKB; + } + if (num9 == 0f) + { + array[num4] = Lang.tip[14]; + } + else + { + if ((double)num9 <= 1.5) + { + array[num4] = Lang.tip[15]; + } + else + { + if (num9 <= 3f) + { + array[num4] = Lang.tip[16]; + } + else + { + if (num9 <= 4f) + { + array[num4] = Lang.tip[17]; + } + else + { + if (num9 <= 6f) + { + array[num4] = Lang.tip[18]; + } + else + { + if (num9 <= 7f) + { + array[num4] = Lang.tip[19]; + } + else + { + if (num9 <= 9f) + { + array[num4] = Lang.tip[20]; + } + else + { + if (num9 <= 11f) + { + array[num4] = Lang.tip[21]; + } + else + { + array[num4] = Lang.tip[22]; + } + } + } + } + } + } + } + } + num4++; + } + if (Main.toolTip.headSlot > 0 || Main.toolTip.bodySlot > 0 || Main.toolTip.legSlot > 0 || Main.toolTip.accessory) + { + array[num4] = Lang.tip[23]; + num4++; + } + if (Main.toolTip.tileWand > 0) + { + array[num4] = Lang.tip[52] + Lang.itemName(Main.toolTip.tileWand, false); + num4++; + } + if (Main.toolTip.vanity) + { + array[num4] = Lang.tip[24]; + num4++; + } + if (Main.toolTip.defense > 0) + { + array[num4] = Main.toolTip.defense + Lang.tip[25]; + num4++; + } + if (Main.toolTip.pick > 0) + { + array[num4] = Main.toolTip.pick + Lang.tip[26]; + num4++; + } + if (Main.toolTip.axe > 0) + { + array[num4] = Main.toolTip.axe * 5 + Lang.tip[27]; + num4++; + } + if (Main.toolTip.hammer > 0) + { + array[num4] = Main.toolTip.hammer + Lang.tip[28]; + num4++; + } + if (Main.toolTip.tileBoost != 0) + { + int tileBoost = Main.toolTip.tileBoost; + if (tileBoost > 0) + { + array[num4] = "+" + tileBoost + Lang.tip[54]; + } + else + { + array[num4] = tileBoost + Lang.tip[54]; + } + num4++; + } + if (Main.toolTip.healLife > 0) + { + array[num4] = string.Concat(new object[] + { + Lang.tip[29], + " ", + Main.toolTip.healLife, + " ", + Lang.tip[30] + }); + num4++; + } + if (Main.toolTip.healMana > 0) + { + array[num4] = string.Concat(new object[] + { + Lang.tip[29], + " ", + Main.toolTip.healMana, + " ", + Lang.tip[31] + }); + num4++; + } + if (Main.toolTip.mana > 0 && (Main.toolTip.type != 127 || !Main.player[Main.myPlayer].spaceGun)) + { + array[num4] = string.Concat(new object[] + { + Lang.tip[32], + " ", + (int)((float)Main.toolTip.mana * Main.player[Main.myPlayer].manaCost), + " ", + Lang.tip[31] + }); + num4++; + } + if (Main.toolTip.createWall > 0 || Main.toolTip.createTile > -1) + { + if (Main.toolTip.type != 213 && Main.toolTip.type != 832) + { + array[num4] = Lang.tip[33]; + num4++; + } + } + else + { + if (Main.toolTip.ammo > 0 && !Main.toolTip.notAmmo) + { + array[num4] = Lang.tip[34]; + num4++; + } + else + { + if (Main.toolTip.consumable) + { + array[num4] = Lang.tip[35]; + num4++; + } + } + } + if (Main.toolTip.material) + { + array[num4] = Lang.tip[36]; + num4++; + } + if (Main.toolTip.toolTip != null) + { + array[num4] = Main.toolTip.toolTip; + num4++; + } + if (Main.toolTip.toolTip2 != null) + { + array[num4] = Main.toolTip.toolTip2; + num4++; + } + if (Main.toolTip.buffTime > 0) + { + string text; + if (Main.toolTip.buffTime / 60 >= 60) + { + text = Math.Round((double)(Main.toolTip.buffTime / 60) / 60.0) + Lang.tip[37]; + } + else + { + text = Math.Round((double)Main.toolTip.buffTime / 60.0) + Lang.tip[38]; + } + array[num4] = text; + num4++; + } + if (Main.toolTip.prefix > 0) + { + if (Main.cpItem == null || Main.cpItem.netID != Main.toolTip.netID) + { + Main.cpItem = new Item(); + Main.cpItem.netDefaults(Main.toolTip.netID); + } + if (Main.cpItem.damage != Main.toolTip.damage) + { + double num10 = (double)((float)Main.toolTip.damage - (float)Main.cpItem.damage); + num10 = num10 / (double)((float)Main.cpItem.damage) * 100.0; + num10 = Math.Round(num10); + if (num10 > 0.0) + { + array[num4] = "+" + num10 + Lang.tip[39]; + } + else + { + array[num4] = num10 + Lang.tip[39]; + } + if (num10 < 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.cpItem.useAnimation != Main.toolTip.useAnimation) + { + double num11 = (double)((float)Main.toolTip.useAnimation - (float)Main.cpItem.useAnimation); + num11 = num11 / (double)((float)Main.cpItem.useAnimation) * 100.0; + num11 = Math.Round(num11); + num11 *= -1.0; + if (num11 > 0.0) + { + array[num4] = "+" + num11 + Lang.tip[40]; + } + else + { + array[num4] = num11 + Lang.tip[40]; + } + if (num11 < 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.cpItem.crit != Main.toolTip.crit) + { + double num12 = (double)((float)Main.toolTip.crit - (float)Main.cpItem.crit); + if (num12 > 0.0) + { + array[num4] = "+" + num12 + Lang.tip[41]; + } + else + { + array[num4] = num12 + Lang.tip[41]; + } + if (num12 < 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.cpItem.mana != Main.toolTip.mana) + { + double num13 = (double)((float)Main.toolTip.mana - (float)Main.cpItem.mana); + num13 = num13 / (double)((float)Main.cpItem.mana) * 100.0; + num13 = Math.Round(num13); + if (num13 > 0.0) + { + array[num4] = "+" + num13 + Lang.tip[42]; + } + else + { + array[num4] = num13 + Lang.tip[42]; + } + if (num13 > 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.cpItem.scale != Main.toolTip.scale) + { + double num14 = (double)(Main.toolTip.scale - Main.cpItem.scale); + num14 = num14 / (double)Main.cpItem.scale * 100.0; + num14 = Math.Round(num14); + if (num14 > 0.0) + { + array[num4] = "+" + num14 + Lang.tip[43]; + } + else + { + array[num4] = num14 + Lang.tip[43]; + } + if (num14 < 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.cpItem.shootSpeed != Main.toolTip.shootSpeed) + { + double num15 = (double)(Main.toolTip.shootSpeed - Main.cpItem.shootSpeed); + num15 = num15 / (double)Main.cpItem.shootSpeed * 100.0; + num15 = Math.Round(num15); + if (num15 > 0.0) + { + array[num4] = "+" + num15 + Lang.tip[44]; + } + else + { + array[num4] = num15 + Lang.tip[44]; + } + if (num15 < 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.cpItem.knockBack != knockBack) + { + double num16 = (double)(knockBack - Main.cpItem.knockBack); + num16 = num16 / (double)Main.cpItem.knockBack * 100.0; + num16 = Math.Round(num16); + if (num16 > 0.0) + { + array[num4] = "+" + num16 + Lang.tip[45]; + } + else + { + array[num4] = num16 + Lang.tip[45]; + } + if (num16 < 0.0) + { + array3[num4] = true; + } + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 62) + { + array[num4] = "+1" + Lang.tip[25]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 63) + { + array[num4] = "+2" + Lang.tip[25]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 64) + { + array[num4] = "+3" + Lang.tip[25]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 65) + { + array[num4] = "+4" + Lang.tip[25]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 66) + { + array[num4] = "+20 " + Lang.tip[31]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 67) + { + array[num4] = "+1" + Lang.tip[5]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 68) + { + array[num4] = "+2" + Lang.tip[5]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 69) + { + array[num4] = "+1" + Lang.tip[39]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 70) + { + array[num4] = "+2" + Lang.tip[39]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 71) + { + array[num4] = "+3" + Lang.tip[39]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 72) + { + array[num4] = "+4" + Lang.tip[39]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 73) + { + array[num4] = "+1" + Lang.tip[46]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 74) + { + array[num4] = "+2" + Lang.tip[46]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 75) + { + array[num4] = "+3" + Lang.tip[46]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 76) + { + array[num4] = "+4" + Lang.tip[46]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 77) + { + array[num4] = "+1" + Lang.tip[47]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 78) + { + array[num4] = "+2" + Lang.tip[47]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 79) + { + array[num4] = "+3" + Lang.tip[47]; + array2[num4] = true; + num4++; + } + if (Main.toolTip.prefix == 80) + { + array[num4] = "+4" + Lang.tip[47]; + array2[num4] = true; + num4++; + } + } + if (Main.toolTip.wornArmor && Main.player[Main.myPlayer].setBonus != "") + { + array[num4] = Lang.tip[48] + " " + Main.player[Main.myPlayer].setBonus; + num4++; + } + } + if (Main.npcShop > 0) + { + if (Main.toolTip.value > 0) + { + string text2 = ""; + int num17 = 0; + int num18 = 0; + int num19 = 0; + int num20 = 0; + int num21 = Main.toolTip.value * Main.toolTip.stack; + if (!Main.toolTip.buy) + { + num21 = Main.toolTip.value / 5 * Main.toolTip.stack; + } + if (num21 < 1) + { + num21 = 1; + } + if (num21 >= 1000000) + { + num17 = num21 / 1000000; + num21 -= num17 * 1000000; + } + if (num21 >= 10000) + { + num18 = num21 / 10000; + num21 -= num18 * 10000; + } + if (num21 >= 100) + { + num19 = num21 / 100; + num21 -= num19 * 100; + } + if (num21 >= 1) + { + num20 = num21; + } + if (num17 > 0) + { + object obj = text2; + text2 = string.Concat(new object[] + { + obj, + num17, + " ", + Lang.inter[15], + " " + }); + } + if (num18 > 0) + { + object obj = text2; + text2 = string.Concat(new object[] + { + obj, + num18, + " ", + Lang.inter[16], + " " + }); + } + if (num19 > 0) + { + object obj = text2; + text2 = string.Concat(new object[] + { + obj, + num19, + " ", + Lang.inter[17], + " " + }); + } + if (num20 > 0) + { + object obj = text2; + text2 = string.Concat(new object[] + { + obj, + num20, + " ", + Lang.inter[18], + " " + }); + } + if (!Main.toolTip.buy) + { + array[num4] = Lang.tip[49] + " " + text2; + } + else + { + array[num4] = Lang.tip[50] + " " + text2; + } + num4++; + num22 = (float)Main.mouseTextColor / 255f; + if (num17 > 0) + { + color = new Color((int)((byte)(220f * num22)), (int)((byte)(220f * num22)), (int)((byte)(198f * num22)), (int)Main.mouseTextColor); + } + else + { + if (num18 > 0) + { + color = new Color((int)((byte)(224f * num22)), (int)((byte)(201f * num22)), (int)((byte)(92f * num22)), (int)Main.mouseTextColor); + } + else + { + if (num19 > 0) + { + color = new Color((int)((byte)(181f * num22)), (int)((byte)(192f * num22)), (int)((byte)(193f * num22)), (int)Main.mouseTextColor); + } + else + { + if (num20 > 0) + { + color = new Color((int)((byte)(246f * num22)), (int)((byte)(138f * num22)), (int)((byte)(96f * num22)), (int)Main.mouseTextColor); + } + } + } + } + } + else + { + num22 = (float)Main.mouseTextColor / 255f; + array[num4] = Lang.tip[51]; + num4++; + color = new Color((int)((byte)(120f * num22)), (int)((byte)(120f * num22)), (int)((byte)(120f * num22)), (int)Main.mouseTextColor); + } + } + Vector2 vector = default(Vector2); + int num23 = 0; + for (int j = 0; j < num4; j++) + { + Vector2 vector2 = Main.fontMouseText.MeasureString(array[j]); + if (vector2.X > vector.X) + { + vector.X = vector2.X; + } + vector.Y += vector2.Y + (float)num23; + } + if ((float)num + vector.X + 4f > (float)Main.screenWidth) + { + num = (int)((float)Main.screenWidth - vector.X - 4f); + } + if ((float)num2 + vector.Y + 4f > (float)Main.screenHeight) + { + num2 = (int)((float)Main.screenHeight - vector.Y - 4f); + } + int num24 = 0; + num22 = (float)Main.mouseTextColor / 255f; + for (int k = 0; k < num4; k++) + { + for (int l = 0; l < 5; l++) + { + int num25 = num; + int num26 = num2 + num24; + Color color2 = Color.Black; + if (l == 0) + { + num25 -= 2; + } + else + { + if (l == 1) + { + num25 += 2; + } + else + { + if (l == 2) + { + num26 -= 2; + } + else + { + if (l == 3) + { + num26 += 2; + } + else + { + color2 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + if (k == 0) + { + if (rare == -1) + { + color2 = new Color((int)((byte)(130f * num22)), (int)((byte)(130f * num22)), (int)((byte)(130f * num22)), (int)Main.mouseTextColor); + } + if (rare == 1) + { + color2 = new Color((int)((byte)(150f * num22)), (int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (rare == 2) + { + color2 = new Color((int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)((byte)(150f * num22)), (int)Main.mouseTextColor); + } + if (rare == 3) + { + color2 = new Color((int)((byte)(255f * num22)), (int)((byte)(200f * num22)), (int)((byte)(150f * num22)), (int)Main.mouseTextColor); + } + if (rare == 4) + { + color2 = new Color((int)((byte)(255f * num22)), (int)((byte)(150f * num22)), (int)((byte)(150f * num22)), (int)Main.mouseTextColor); + } + if (rare == 5) + { + color2 = new Color((int)((byte)(255f * num22)), (int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (rare == 6) + { + color2 = new Color((int)((byte)(210f * num22)), (int)((byte)(160f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (rare == 7) + { + color2 = new Color((int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)((byte)(10f * num22)), (int)Main.mouseTextColor); + } + if (rare == 8) + { + color2 = new Color((int)((byte)(255f * num22)), (int)((byte)(255f * num22)), (int)((byte)(10f * num22)), (int)Main.mouseTextColor); + } + if (rare >= 9) + { + color2 = new Color((int)((byte)(5f * num22)), (int)((byte)(200f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (diff == 1) + { + color2 = new Color((int)((byte)((float)Main.mcColor.R * num22)), (int)((byte)((float)Main.mcColor.G * num22)), (int)((byte)((float)Main.mcColor.B * num22)), (int)Main.mouseTextColor); + } + if (diff == 2) + { + color2 = new Color((int)((byte)((float)Main.hcColor.R * num22)), (int)((byte)((float)Main.hcColor.G * num22)), (int)((byte)((float)Main.hcColor.B * num22)), (int)Main.mouseTextColor); + } + } + else + { + if (array2[k]) + { + if (array3[k]) + { + color2 = new Color((int)((byte)(190f * num22)), (int)((byte)(120f * num22)), (int)((byte)(120f * num22)), (int)Main.mouseTextColor); + } + else + { + color2 = new Color((int)((byte)(120f * num22)), (int)((byte)(190f * num22)), (int)((byte)(120f * num22)), (int)Main.mouseTextColor); + } + } + else + { + if (k == num4 - 1) + { + color2 = color; + } + } + } + } + } + } + } + this.spriteBatch.DrawString(Main.fontMouseText, array[k], new Vector2((float)num25, (float)num26), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + num24 += (int)(Main.fontMouseText.MeasureString(array[k]).Y + (float)num23); + } + return; + } + if (Main.buffString != "" && Main.buffString != null) + { + for (int m = 0; m < 5; m++) + { + int num27 = num; + int num28 = num2 + (int)Main.fontMouseText.MeasureString(Main.buffString).Y; + Color black = Color.Black; + if (m == 0) + { + num27 -= 2; + } + else + { + if (m == 1) + { + num27 += 2; + } + else + { + if (m == 2) + { + num28 -= 2; + } + else + { + if (m == 3) + { + num28 += 2; + } + else + { + black = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + } + } + } + } + this.spriteBatch.DrawString(Main.fontMouseText, Main.buffString, new Vector2((float)num27, (float)num28), black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + Vector2 vector3 = Main.fontMouseText.MeasureString(cursorText); + if ((float)num + vector3.X + 4f > (float)Main.screenWidth) + { + num = (int)((float)Main.screenWidth - vector3.X - 4f); + } + if ((float)num2 + vector3.Y + 4f > (float)Main.screenHeight) + { + num2 = (int)((float)Main.screenHeight - vector3.Y - 4f); + } + this.spriteBatch.DrawString(Main.fontMouseText, cursorText, new Vector2((float)num, (float)(num2 - 2)), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, cursorText, new Vector2((float)num, (float)(num2 + 2)), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, cursorText, new Vector2((float)(num - 2), (float)num2), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, cursorText, new Vector2((float)(num + 2), (float)num2), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + num22 = (float)Main.mouseTextColor / 255f; + Color color3 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + if (rare == -10) + { + color3 = new Color((int)((byte)(65f * num22)), (int)((byte)(255f * num22)), (int)((byte)(110f * num22)), (int)Main.mouseTextColor); + } + if (rare == -1) + { + color3 = new Color((int)((byte)(130f * num22)), (int)((byte)(130f * num22)), (int)((byte)(130f * num22)), (int)Main.mouseTextColor); + } + if (rare == 1) + { + color3 = new Color((int)((byte)(150f * num22)), (int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (rare == 2) + { + color3 = new Color((int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)((byte)(150f * num22)), (int)Main.mouseTextColor); + } + if (rare == 3) + { + color3 = new Color((int)((byte)(255f * num22)), (int)((byte)(200f * num22)), (int)((byte)(150f * num22)), (int)Main.mouseTextColor); + } + if (rare == 4) + { + color3 = new Color((int)((byte)(255f * num22)), (int)((byte)(150f * num22)), (int)((byte)(150f * num22)), (int)Main.mouseTextColor); + } + if (rare == 5) + { + color3 = new Color((int)((byte)(255f * num22)), (int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (rare == 6) + { + color3 = new Color((int)((byte)(210f * num22)), (int)((byte)(160f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (rare == 7) + { + color3 = new Color((int)((byte)(150f * num22)), (int)((byte)(255f * num22)), (int)((byte)(10f * num22)), (int)Main.mouseTextColor); + } + if (rare == 8) + { + color3 = new Color((int)((byte)(255f * num22)), (int)((byte)(255f * num22)), (int)((byte)(10f * num22)), (int)Main.mouseTextColor); + } + if (rare >= 9) + { + color3 = new Color((int)((byte)(5f * num22)), (int)((byte)(200f * num22)), (int)((byte)(255f * num22)), (int)Main.mouseTextColor); + } + if (diff == 1) + { + color3 = new Color((int)((byte)((float)Main.mcColor.R * num22)), (int)((byte)((float)Main.mcColor.G * num22)), (int)((byte)((float)Main.mcColor.B * num22)), (int)Main.mouseTextColor); + } + if (diff == 2) + { + color3 = new Color((int)((byte)((float)Main.hcColor.R * num22)), (int)((byte)((float)Main.hcColor.G * num22)), (int)((byte)((float)Main.hcColor.B * num22)), (int)Main.mouseTextColor); + } + this.spriteBatch.DrawString(Main.fontMouseText, cursorText, new Vector2((float)num, (float)num2), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + protected void DrawFPS() + { + if (Main.showFrameRate) + { + string text = string.Concat(Main.frameRate); + object obj = text; + text = string.Concat(new object[] + { + obj, + " (", + Liquid.numLiquid + LiquidBuffer.numLiquidBuffer, + ")" + }); + object obj2 = text; + text = string.Concat(new object[] + { + obj2, + " (", + (int)(Main.gfxQuality * 100f), + "%)" + }); + int num = 4; + if (!Main.gameMenu) + { + num = Main.screenHeight - 24; + } + this.spriteBatch.DrawString(Main.fontMouseText, text + " " + Main.debugWords, new Vector2(4f, (float)num), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + public static Color shine(Color newColor, int type) + { + int num = (int)newColor.R; + int num2 = (int)newColor.G; + int num3 = (int)newColor.B; + float num4 = 0.6f; + if (type == 25) + { + num = (int)((float)newColor.R * 0.95f); + num2 = (int)((float)newColor.G * 0.85f); + num3 = (int)((double)((float)newColor.B) * 1.1); + } + else + { + if (type == 117) + { + num = (int)((float)newColor.R * 1.1f); + num2 = (int)((float)newColor.G * 1f); + num3 = (int)((double)((float)newColor.B) * 1.2); + } + else + { + if (type == 204) + { + num4 = 0.3f + (float)Main.mouseTextColor / 300f; + num = (int)((float)newColor.R * (1.3f * num4)); + if (num > 255) + { + num = 255; + } + return new Color(num, num2, num3, 255); + } + if (type == 211) + { + num4 = 0.3f + (float)Main.mouseTextColor / 300f; + num2 = (int)((float)newColor.G * (1.5f * num4)); + num3 = (int)((float)newColor.B * (1.1f * num4)); + } + else + { + if (type == 147 || type == 161) + { + num = (int)((float)newColor.R * 1.1f); + num2 = (int)((float)newColor.G * 1.12f); + num3 = (int)((double)((float)newColor.B) * 1.15); + } + else + { + if (type == 163) + { + num = (int)((float)newColor.R * 1.05f); + num2 = (int)((float)newColor.G * 1.1f); + num3 = (int)((double)((float)newColor.B) * 1.15); + } + else + { + if (type == 164) + { + num = (int)((float)newColor.R * 1.1f); + num2 = (int)((float)newColor.G * 1.1f); + num3 = (int)((double)((float)newColor.B) * 1.2); + } + else + { + if (type == 178) + { + num4 = 0.5f; + num = (int)((float)newColor.R * (1f + num4)); + num2 = (int)((float)newColor.G * (1f + num4)); + num3 = (int)((float)newColor.B * (1f + num4)); + } + else + { + if (type == 185 || type == 186) + { + num4 = 0.3f; + num = (int)((float)newColor.R * (1f + num4)); + num2 = (int)((float)newColor.G * (1f + num4)); + num3 = (int)((float)newColor.B * (1f + num4)); + } + else + { + num = (int)((float)newColor.R * (1f + num4)); + num2 = (int)((float)newColor.G * (1f + num4)); + num3 = (int)((float)newColor.B * (1f + num4)); + } + } + } + } + } + } + } + } + if (num > 255) + { + num = 255; + } + if (num2 > 255) + { + num2 = 255; + } + if (num3 > 255) + { + num3 = 255; + } + newColor.R = (byte)num; + newColor.G = (byte)num2; + newColor.B = (byte)num3; + return new Color((int)((byte)num), (int)((byte)num2), (int)((byte)num3), (int)newColor.A); + } + public static bool canDrawColorTile(int i, int j) + { + return Main.tile[i, j] != null && Main.tile[i, j].color() > 0 && (int)Main.tile[i, j].color() < Main.numTileColors && Main.tileAltTextureDrawn[(int)Main.tile[i, j].type, (int)Main.tile[i, j].color()] && Main.tileAltTextureInit[(int)Main.tile[i, j].type, (int)Main.tile[i, j].color()]; + } + public static bool canDrawColorWall(int i, int j) + { + return Main.tile[i, j] != null && Main.tile[i, j].wallColor() > 0 && Main.wallAltTextureDrawn[(int)Main.tile[i, j].wall, (int)Main.tile[i, j].wallColor()] && Main.wallAltTextureInit[(int)Main.tile[i, j].wall, (int)Main.tile[i, j].wallColor()]; + } + protected void DrawTiles(bool solidOnly = true) + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int num = (int)(255f * (1f - Main.gfxQuality) + 30f * Main.gfxQuality); + int num2 = (int)(50f * (1f - Main.gfxQuality) + 2f * Main.gfxQuality); + Vector2 value = new Vector2((float)Main.offScreenRange, (float)Main.offScreenRange); + if (Main.drawToScreen) + { + value = default(Vector2); + } + int num3 = 0; + int[] array = new int[1000]; + int[] array2 = new int[1000]; + int num4 = (int)((Main.screenPosition.X - value.X) / 16f - 1f); + int num5 = (int)((Main.screenPosition.X + (float)Main.screenWidth + value.X) / 16f) + 2; + int num6 = (int)((Main.screenPosition.Y - value.Y) / 16f - 1f); + int num7 = (int)((Main.screenPosition.Y + (float)Main.screenHeight + value.Y) / 16f) + 5; + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + int num8 = 16; + for (int i = num6; i < num7 + 4; i++) + { + for (int j = num4 - 2; j < num5 + 2; j++) + { + if (Main.tile[j, i] == null) + { + Main.tile[j, i] = new Tile(); + Main.mapTime += 60; + } + bool flag = Main.tileSolid[(int)Main.tile[j, i].type]; + if (Main.tile[j, i].type == 11) + { + flag = true; + } + if (Main.tile[j, i].active() && flag == solidOnly) + { + this.LoadTiles((int)Main.tile[j, i].type); + SpriteEffects effects = SpriteEffects.None; + if (Main.tile[j, i].type == 3 || Main.tile[j, i].type == 13 || Main.tile[j, i].type == 20 || Main.tile[j, i].type == 24 || Main.tile[j, i].type == 49 || Main.tile[j, i].type == 50 || Main.tile[j, i].type == 52 || Main.tile[j, i].type == 61 || Main.tile[j, i].type == 62 || Main.tile[j, i].type == 71 || Main.tile[j, i].type == 73 || Main.tile[j, i].type == 74 || Main.tile[j, i].type == 81 || Main.tile[j, i].type == 82 || Main.tile[j, i].type == 83 || Main.tile[j, i].type == 84 || Main.tile[j, i].type == 91 || Main.tile[j, i].type == 92 || Main.tile[j, i].type == 93 || Main.tile[j, i].type == 110 || Main.tile[j, i].type == 113 || Main.tile[j, i].type == 115 || Main.tile[j, i].type == 135 || Main.tile[j, i].type == 141 || Main.tile[j, i].type == 165 || Main.tile[j, i].type == 174 || Main.tile[j, i].type == 201 || Main.tile[j, i].type == 205 || Main.tile[j, i].type == 227) + { + if (j % 2 == 1) + { + effects = SpriteEffects.FlipHorizontally; + } + } + else + { + if (Main.tile[j, i].type == 184) + { + if (Main.tile[j, i].frameY < 108) + { + if (j % 2 == 1) + { + effects = SpriteEffects.FlipHorizontally; + } + } + else + { + if (i % 2 == 1) + { + effects = SpriteEffects.FlipVertically; + } + } + } + else + { + if (Main.tile[j, i].type == 185 && Main.tile[j, i].frameY == 0 && j % 2 == 1) + { + effects = SpriteEffects.FlipHorizontally; + } + } + } + Color color = Lighting.GetColor(j, i); + int num9 = 0; + if (Main.tile[j, i].type == 4 && WorldGen.SolidTile(j, i - 1)) + { + num9 = 2; + if (WorldGen.SolidTile(j - 1, i + 1) || WorldGen.SolidTile(j + 1, i + 1)) + { + num9 = 4; + } + } + if (Main.tile[j, i].type == 78 || Main.tile[j, i].type == 85 || Main.tile[j, i].type == 210 || Main.tile[j, i].type == 133 || Main.tile[j, i].type == 134 || Main.tile[j, i].type == 233) + { + num9 = 2; + } + if (Main.tile[j, i].type == 33 || Main.tile[j, i].type == 49 || Main.tile[j, i].type == 174) + { + num9 = -4; + } + int num10; + if (Main.tile[j, i].type == 3 || Main.tile[j, i].type == 4 || Main.tile[j, i].type == 5 || Main.tile[j, i].type == 24 || Main.tile[j, i].type == 33 || Main.tile[j, i].type == 49 || Main.tile[j, i].type == 61 || Main.tile[j, i].type == 71 || Main.tile[j, i].type == 110 || Main.tile[j, i].type == 174 || Main.tile[j, i].type == 201) + { + num10 = 20; + } + else + { + if (Main.tile[j, i].type == 15 || Main.tile[j, i].type == 14 || Main.tile[j, i].type == 16 || Main.tile[j, i].type == 17 || Main.tile[j, i].type == 18 || Main.tile[j, i].type == 20 || Main.tile[j, i].type == 21 || Main.tile[j, i].type == 26 || Main.tile[j, i].type == 27 || Main.tile[j, i].type == 32 || Main.tile[j, i].type == 69 || Main.tile[j, i].type == 72 || Main.tile[j, i].type == 77 || Main.tile[j, i].type == 80) + { + num10 = 18; + } + else + { + if (Main.tile[j, i].type == 137) + { + num10 = 18; + } + else + { + if (Main.tile[j, i].type == 135) + { + num9 = 2; + num10 = 18; + } + else + { + if (Main.tile[j, i].type == 132) + { + num9 = 2; + num10 = 18; + } + else + { + num10 = 16; + } + } + } + } + } + if (Main.tile[j, i].type == 52) + { + num9 -= 2; + } + if (Main.tile[j, i].type == 231 || Main.tile[j, i].type == 238) + { + num9 += 2; + } + if (Main.tile[j, i].type == 207) + { + num9 = 2; + } + if (Main.tile[j, i].type == 4 || Main.tile[j, i].type == 5) + { + num8 = 20; + } + else + { + num8 = 16; + } + if (Main.tile[j, i].type == 73 || Main.tile[j, i].type == 74 || Main.tile[j, i].type == 113) + { + num9 -= 12; + num10 = 32; + } + if (Main.tile[j, i].type == 227) + { + num8 = 32; + num10 = 38; + if (Main.tile[j, i].frameX == 238) + { + num9 -= 6; + } + else + { + num9 -= 20; + } + } + if (Main.tile[j, i].type == 185 || Main.tile[j, i].type == 186 || Main.tile[j, i].type == 187) + { + num9 = 2; + if (Main.tile[j, i].type == 185) + { + if (Main.tile[j, i].frameY == 18 && Main.tile[j, i].frameX >= 576 && Main.tile[j, i].frameX <= 882) + { + Main.tileShine2[185] = true; + } + else + { + Main.tileShine2[185] = false; + } + } + else + { + if (Main.tile[j, i].type == 186) + { + if (Main.tile[j, i].frameX >= 864 && Main.tile[j, i].frameX <= 1170) + { + Main.tileShine2[186] = true; + } + else + { + Main.tileShine2[186] = false; + } + } + } + } + if (Main.tile[j, i].type == 178 && Main.tile[j, i].frameY <= 36) + { + num9 = 2; + } + if (Main.tile[j, i].type == 184) + { + num8 = 20; + if (Main.tile[j, i].frameY <= 36) + { + num9 = 2; + } + else + { + if (Main.tile[j, i].frameY <= 108) + { + num9 = -2; + } + } + } + if (Main.tile[j, i].type == 28) + { + num9 += 2; + } + if (Main.tile[j, i].type == 81) + { + num9 -= 8; + num10 = 26; + num8 = 24; + } + if (Main.tile[j, i].type == 105) + { + num9 = 2; + } + if (Main.tile[j, i].type == 124) + { + num10 = 18; + } + if (Main.tile[j, i].type == 137) + { + num10 = 18; + } + if (Main.tile[j, i].type == 138) + { + num10 = 18; + } + if (Main.tile[j, i].type == 139 || Main.tile[j, i].type == 142 || Main.tile[j, i].type == 143) + { + num9 = 2; + } + int num11 = 0; + if (Main.tile[j, i].halfBrick()) + { + num11 = 8; + } + int num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 38; + if (Main.tile[j, i].type == 12) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 36; + } + if (Main.tile[j, i].type == 238) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 36; + } + if (Main.tile[j, i].type == 31) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 36; + } + if (Main.tile[j, i].type == 215) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 36; + num9 = 2; + } + if (Main.tile[j, i].type == 231) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 54; + num9 = 2; + } + if (Main.tile[j, i].type == 243) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 54; + num9 = 2; + } + if (Main.tile[j, i].type == 247) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 54; + num9 = 2; + } + if (Main.tile[j, i].type == 244) + { + num9 = 2; + if (Main.tile[j, i].frameX < 54) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 36; + } + else + { + num12 = 0; + } + } + if (Main.tile[j, i].type == 235) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 18; + } + if (Main.tile[j, i].type == 217 || Main.tile[j, i].type == 218) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 36; + num9 = 2; + } + if (Main.tile[j, i].type == 219 || Main.tile[j, i].type == 220) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type] * 54; + num9 = 2; + } + if (Main.tile[j, i].type == 207) + { + if (Main.tile[j, i].frameY >= 72) + { + num12 = Main.tileFrame[(int)Main.tile[j, i].type]; + int num13 = j; + if (Main.tile[j, i].frameX % 36 != 0) + { + num13--; + } + num12 += num13 % 6; + if (num12 >= 6) + { + num12 -= 6; + } + num12 *= 72; + } + else + { + num12 = 0; + } + } + if (Main.player[Main.myPlayer].findTreasure) + { + bool flag2 = false; + if (Main.tile[j, i].type == 185 && Main.tile[j, i].frameY == 18 && Main.tile[j, i].frameX >= 576 && Main.tile[j, i].frameX <= 882) + { + flag2 = true; + } + if (Main.tile[j, i].type == 186 && Main.tile[j, i].frameX >= 864 && Main.tile[j, i].frameX <= 1170) + { + flag2 = true; + } + if (flag2 || Main.tile[j, i].type == 6 || Main.tile[j, i].type == 7 || Main.tile[j, i].type == 8 || Main.tile[j, i].type == 9 || Main.tile[j, i].type == 12 || Main.tile[j, i].type == 21 || Main.tile[j, i].type == 22 || Main.tile[j, i].type == 28 || Main.tile[j, i].type == 107 || Main.tile[j, i].type == 108 || Main.tile[j, i].type == 111 || (Main.tile[j, i].type >= 63 && Main.tile[j, i].type <= 68) || Main.tileAlch[(int)Main.tile[j, i].type] || Main.tile[j, i].type == 166 || Main.tile[j, i].type == 167 || Main.tile[j, i].type == 168 || Main.tile[j, i].type == 169 || Main.tile[j, i].type == 178 || Main.tile[j, i].type == 211 || Main.tile[j, i].type == 221 || Main.tile[j, i].type == 222 || Main.tile[j, i].type == 223 || Main.tile[j, i].type == 236) + { + if (color.R < Main.mouseTextColor / 2) + { + color.R = (byte)(Main.mouseTextColor / 2); + } + if (color.G < 70) + { + color.G = 70; + } + if (color.B < 210) + { + color.B = 210; + } + color.A = Main.mouseTextColor; + if (!Main.gamePaused && base.IsActive && Main.rand.Next(150) == 0) + { + int num14 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 15, 0f, 0f, 150, default(Color), 0.8f); + Main.dust[num14].velocity *= 0.1f; + Main.dust[num14].noLight = true; + } + } + } + if (!Main.gamePaused && base.IsActive && (Lighting.lightMode < 2 || Main.rand.Next(4) == 0)) + { + if (Main.tile[j, i].type == 238 && Main.rand.Next(10) == 0) + { + int num15 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 168, 0f, 0f, 0, default(Color), 1f); + Main.dust[num15].noGravity = true; + Main.dust[num15].alpha = 200; + } + if (Main.tile[j, i].type == 244 && Main.tile[j, i].frameX == 18 && Main.tile[j, i].frameY == 18 && Main.rand.Next(2) == 0) + { + if (Main.rand.Next(500) == 0) + { + Gore.NewGore(new Vector2((float)(j * 16 + 8), (float)(i * 16 + 8)), default(Vector2), 415, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(250) == 0) + { + Gore.NewGore(new Vector2((float)(j * 16 + 8), (float)(i * 16 + 8)), default(Vector2), 414, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(80) == 0) + { + Gore.NewGore(new Vector2((float)(j * 16 + 8), (float)(i * 16 + 8)), default(Vector2), 413, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(10) == 0) + { + Gore.NewGore(new Vector2((float)(j * 16 + 8), (float)(i * 16 + 8)), default(Vector2), 412, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(3) == 0) + { + Gore.NewGore(new Vector2((float)(j * 16 + 8), (float)(i * 16 + 8)), default(Vector2), 411, (float)Main.rand.Next(51, 101) * 0.01f); + } + } + } + } + } + } + if (Main.tile[j, i].type == 165 && Main.tile[j, i].frameX >= 162 && Main.tile[j, i].frameX <= 214 && Main.tile[j, i].frameY == 72 && Main.rand.Next(60) == 0) + { + int num16 = Dust.NewDust(new Vector2((float)(j * 16 + 2), (float)(i * 16 + 6)), 8, 4, 153, 0f, 0f, 0, default(Color), 1f); + Main.dust[num16].scale -= (float)Main.rand.Next(3) * 0.1f; + Main.dust[num16].velocity.Y = 0f; + Dust expr_192E_cp_0 = Main.dust[num16]; + expr_192E_cp_0.velocity.X = expr_192E_cp_0.velocity.X * 0.05f; + Main.dust[num16].alpha = 100; + } + if (Main.tile[j, i].type == 42 && Main.tile[j, i].frameX == 0 && Main.tile[j, i].frameY == 270) + { + if (Main.rand.Next(50) == 0) + { + int num17 = Dust.NewDust(new Vector2((float)(j * 16 + 4), (float)(i * 16 + 4)), 8, 8, 58, 0f, 0f, 150, default(Color), 1f); + Main.dust[num17].velocity *= 0.5f; + } + if (Main.rand.Next(100) == 0) + { + int num18 = Gore.NewGore(new Vector2((float)(j * 16 - 2), (float)(i * 16 - 4)), default(Vector2), Main.rand.Next(16, 18), 1f); + Main.gore[num18].scale *= 0.7f; + Main.gore[num18].velocity *= 0.25f; + } + } + if (Main.tile[j, i].type == 215 && Main.rand.Next(2) == 0 && ((Main.drawToScreen && Main.rand.Next(4) == 0) || !Main.drawToScreen) && Main.tile[j, i].frameY == 0) + { + int num19 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16 - 4)), 8, 8, 31, 0f, 0f, 100, default(Color), 1f); + if (Main.tile[j, i].frameX == 0) + { + Dust expr_1B41_cp_0 = Main.dust[num19]; + expr_1B41_cp_0.position.X = expr_1B41_cp_0.position.X + (float)Main.rand.Next(8); + } + if (Main.tile[j, i].frameX == 36) + { + Dust expr_1B7D_cp_0 = Main.dust[num19]; + expr_1B7D_cp_0.position.X = expr_1B7D_cp_0.position.X - (float)Main.rand.Next(8); + } + Main.dust[num19].alpha += Main.rand.Next(100); + Main.dust[num19].velocity *= 0.2f; + Dust expr_1BDF_cp_0 = Main.dust[num19]; + expr_1BDF_cp_0.velocity.Y = expr_1BDF_cp_0.velocity.Y - (0.5f + (float)Main.rand.Next(10) * 0.1f); + Main.dust[num19].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; + if (Main.rand.Next(4) == 0) + { + num19 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 8, 8, 6, 0f, 0f, 0, default(Color), 1f); + if (Main.tile[j, i].frameX == 0) + { + Dust expr_1C91_cp_0 = Main.dust[num19]; + expr_1C91_cp_0.position.X = expr_1C91_cp_0.position.X + (float)Main.rand.Next(8); + } + if (Main.tile[j, i].frameX == 36) + { + Dust expr_1CCD_cp_0 = Main.dust[num19]; + expr_1CCD_cp_0.position.X = expr_1CCD_cp_0.position.X - (float)Main.rand.Next(8); + } + if (Main.rand.Next(20) != 0) + { + Main.dust[num19].noGravity = true; + Main.dust[num19].scale *= 1f + (float)Main.rand.Next(10) * 0.1f; + Dust expr_1D3B_cp_0 = Main.dust[num19]; + expr_1D3B_cp_0.velocity.Y = expr_1D3B_cp_0.velocity.Y - 1f; + } + } + } + if (Main.tile[j, i].type == 4 && Main.rand.Next(40) == 0 && Main.tile[j, i].frameX < 66) + { + int num20 = (int)(Main.tile[j, i].frameY / 22); + if (num20 == 0) + { + num20 = 6; + } + else + { + if (num20 == 8) + { + num20 = 75; + } + else + { + if (num20 == 9) + { + num20 = 135; + } + else + { + if (num20 == 10) + { + num20 = 158; + } + else + { + if (num20 == 11) + { + num20 = 169; + } + else + { + num20 = 58 + num20; + } + } + } + } + } + int num21; + if (Main.tile[j, i].frameX == 22) + { + num21 = Dust.NewDust(new Vector2((float)(j * 16 + 6), (float)(i * 16)), 4, 4, num20, 0f, 0f, 100, default(Color), 1f); + } + if (Main.tile[j, i].frameX == 44) + { + num21 = Dust.NewDust(new Vector2((float)(j * 16 + 2), (float)(i * 16)), 4, 4, num20, 0f, 0f, 100, default(Color), 1f); + } + else + { + num21 = Dust.NewDust(new Vector2((float)(j * 16 + 4), (float)(i * 16)), 4, 4, num20, 0f, 0f, 100, default(Color), 1f); + } + if (Main.rand.Next(3) != 0) + { + Main.dust[num21].noGravity = true; + } + Main.dust[num21].velocity *= 0.3f; + Dust expr_1F13_cp_0 = Main.dust[num21]; + expr_1F13_cp_0.velocity.Y = expr_1F13_cp_0.velocity.Y - 1.5f; + } + if (Main.tile[j, i].type == 93 && Main.rand.Next(40) == 0 && Main.tile[j, i].frameX == 0 && Main.tile[j, i].frameY == 0) + { + int num22 = Dust.NewDust(new Vector2((float)(j * 16 + 4), (float)(i * 16 + 2)), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num22].noGravity = true; + } + Main.dust[num22].velocity *= 0.3f; + Dust expr_1FFE_cp_0 = Main.dust[num22]; + expr_1FFE_cp_0.velocity.Y = expr_1FFE_cp_0.velocity.Y - 1.5f; + } + if (Main.tile[j, i].type == 100 && Main.rand.Next(40) == 0 && Main.tile[j, i].frameX < 36 && Main.tile[j, i].frameY == 0) + { + int num23; + if (Main.tile[j, i].frameX == 0) + { + if (Main.rand.Next(3) == 0) + { + num23 = Dust.NewDust(new Vector2((float)(j * 16 + 4), (float)(i * 16 + 2)), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + } + else + { + num23 = Dust.NewDust(new Vector2((float)(j * 16 + 14), (float)(i * 16 + 2)), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + } + } + else + { + if (Main.rand.Next(3) == 0) + { + num23 = Dust.NewDust(new Vector2((float)(j * 16 + 6), (float)(i * 16 + 2)), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + } + else + { + num23 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16 + 2)), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + } + } + if (Main.rand.Next(3) != 0) + { + Main.dust[num23].noGravity = true; + } + Main.dust[num23].velocity *= 0.3f; + Dust expr_21D9_cp_0 = Main.dust[num23]; + expr_21D9_cp_0.velocity.Y = expr_21D9_cp_0.velocity.Y - 1.5f; + } + if (Main.tile[j, i].type == 98 && Main.rand.Next(40) == 0 && Main.tile[j, i].frameY == 0 && Main.tile[j, i].frameX == 0) + { + int num24 = Dust.NewDust(new Vector2((float)(j * 16 + 12), (float)(i * 16 + 2)), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num24].noGravity = true; + } + Main.dust[num24].velocity *= 0.3f; + Dust expr_22C5_cp_0 = Main.dust[num24]; + expr_22C5_cp_0.velocity.Y = expr_22C5_cp_0.velocity.Y - 1.5f; + } + if (Main.tile[j, i].type == 49 && Main.rand.Next(2) == 0) + { + int num25 = Dust.NewDust(new Vector2((float)(j * 16 + 4), (float)(i * 16 - 4)), 4, 4, 172, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num25].scale = 0.5f; + } + else + { + Main.dust[num25].scale = 0.9f; + Main.dust[num25].noGravity = true; + } + Main.dust[num25].velocity *= 0.3f; + Dust expr_23A9_cp_0 = Main.dust[num25]; + expr_23A9_cp_0.velocity.Y = expr_23A9_cp_0.velocity.Y - 1.5f; + } + if ((Main.tile[j, i].type == 34 || Main.tile[j, i].type == 35 || Main.tile[j, i].type == 36) && Main.rand.Next(40) == 0 && Main.tile[j, i].frameX < 54 && Main.tile[j, i].frameY == 18 && (Main.tile[j, i].frameX == 0 || Main.tile[j, i].frameX == 36)) + { + int num26 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16 + 2)), 14, 6, 6, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num26].noGravity = true; + } + Main.dust[num26].velocity *= 0.3f; + Dust expr_24F4_cp_0 = Main.dust[num26]; + expr_24F4_cp_0.velocity.Y = expr_24F4_cp_0.velocity.Y - 1.5f; + } + if (Main.tile[j, i].type == 22 && Main.rand.Next(400) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 0, default(Color), 1f); + } + else + { + if ((Main.tile[j, i].type == 23 || Main.tile[j, i].type == 24 || Main.tile[j, i].type == 32) && Main.rand.Next(500) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 0, default(Color), 1f); + } + else + { + if (Main.tile[j, i].type == 25 && Main.rand.Next(700) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 0, default(Color), 1f); + } + else + { + if (Main.tile[j, i].type == 112 && Main.rand.Next(700) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 0, default(Color), 1f); + } + else + { + if (Main.tile[j, i].type == 31 && Main.rand.Next(20) == 0) + { + if (Main.tile[j, i].frameX >= 36) + { + int num27 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 5, 0f, 0f, 100, default(Color), 1f); + Main.dust[num27].velocity.Y = 0f; + Dust expr_2761_cp_0 = Main.dust[num27]; + expr_2761_cp_0.velocity.X = expr_2761_cp_0.velocity.X * 0.3f; + } + else + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 100, default(Color), 1f); + } + } + else + { + if (Main.tile[j, i].type == 26 && Main.rand.Next(20) == 0) + { + if (Main.tile[j, i].frameX >= 54) + { + int num28 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 5, 0f, 0f, 100, default(Color), 1f); + Main.dust[num28].scale = 1.5f; + Main.dust[num28].noGravity = true; + Main.dust[num28].velocity *= 0.75f; + } + else + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 100, default(Color), 1f); + } + } + else + { + if ((Main.tile[j, i].type == 71 || Main.tile[j, i].type == 72) && Main.rand.Next(500) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 41, 0f, 0f, 250, default(Color), 0.8f); + } + else + { + if ((Main.tile[j, i].type == 17 || Main.tile[j, i].type == 77 || Main.tile[j, i].type == 133) && Main.rand.Next(40) == 0) + { + if (Main.tile[j, i].frameX == 18 & Main.tile[j, i].frameY == 18) + { + int num29 = Dust.NewDust(new Vector2((float)(j * 16 - 4), (float)(i * 16 - 6)), 8, 6, 6, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num29].noGravity = true; + } + } + } + else + { + if (Main.tile[j, i].type == 37 && Main.rand.Next(250) == 0) + { + int num30 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 6, 0f, 0f, 0, default(Color), (float)Main.rand.Next(3)); + if (Main.dust[num30].scale > 1f) + { + Main.dust[num30].noGravity = true; + } + } + else + { + if ((Main.tile[j, i].type == 58 || Main.tile[j, i].type == 76) && Main.rand.Next(250) == 0) + { + int num31 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 6, 0f, 0f, 0, default(Color), (float)Main.rand.Next(3)); + if (Main.dust[num31].scale > 1f) + { + Main.dust[num31].noGravity = true; + } + Main.dust[num31].noLight = true; + } + else + { + if (Main.tile[j, i].type == 61) + { + if (Main.tile[j, i].frameX == 144) + { + if (Main.rand.Next(60) == 0) + { + int num32 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 44, 0f, 0f, 250, default(Color), 0.4f); + Main.dust[num32].fadeIn = 0.7f; + } + color.A = (byte)(245f - (float)Main.mouseTextColor * 1.5f); + color.R = (byte)(245f - (float)Main.mouseTextColor * 1.5f); + color.B = (byte)(245f - (float)Main.mouseTextColor * 1.5f); + color.G = (byte)(245f - (float)Main.mouseTextColor * 1.5f); + } + } + else + { + if (Main.tileShine[(int)Main.tile[j, i].type] > 0) + { + Main.tileShine[211] = 500; + if (color.R > 20 || color.B > 20 || color.G > 20) + { + int num33 = (int)color.R; + if ((int)color.G > num33) + { + num33 = (int)color.G; + } + if ((int)color.B > num33) + { + num33 = (int)color.B; + } + num33 /= 30; + if (Main.rand.Next(Main.tileShine[(int)Main.tile[j, i].type]) < num33 && (Main.tile[j, i].type != 21 || (Main.tile[j, i].frameX >= 36 && Main.tile[j, i].frameX < 180) || Main.tile[j, i].frameX >= 360)) + { + Color white = Color.White; + if (Main.tile[j, i].type == 178) + { + int num34 = (int)(Main.tile[j, i].frameX / 18); + if (num34 == 0) + { + white = new Color(255, 0, 255, 255); + } + else + { + if (num34 == 1) + { + white = new Color(255, 255, 0, 255); + } + else + { + if (num34 == 2) + { + white = new Color(0, 0, 255, 255); + } + else + { + if (num34 == 3) + { + white = new Color(0, 255, 0, 255); + } + else + { + if (num34 == 4) + { + white = new Color(255, 0, 0, 255); + } + else + { + if (num34 == 5) + { + white = new Color(255, 255, 255, 255); + } + else + { + if (num34 == 6) + { + white = new Color(255, 255, 0, 255); + } + } + } + } + } + } + } + int num35 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 43, 0f, 0f, 254, white, 0.5f); + Main.dust[num35].velocity *= 0f; + } + else + { + if (Main.tile[j, i].type == 63) + { + white = new Color(0, 0, 255, 255); + } + if (Main.tile[j, i].type == 64) + { + white = new Color(255, 0, 0, 255); + } + if (Main.tile[j, i].type == 65) + { + white = new Color(0, 255, 0, 255); + } + if (Main.tile[j, i].type == 66) + { + white = new Color(255, 255, 0, 255); + } + if (Main.tile[j, i].type == 67) + { + white = new Color(255, 0, 255, 255); + } + if (Main.tile[j, i].type == 68) + { + white = new Color(255, 255, 255, 255); + } + if (Main.tile[j, i].type == 12) + { + white = new Color(255, 0, 0, 255); + } + if (Main.tile[j, i].type == 204) + { + white = new Color(255, 0, 0, 255); + } + if (Main.tile[j, i].type == 211) + { + white = new Color(50, 255, 100, 255); + } + int num36 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 43, 0f, 0f, 254, white, 0.5f); + Main.dust[num36].velocity *= 0f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[j, i].type == 128 && Main.tile[j, i].frameX >= 100) + { + array[num3] = j; + array2[num3] = i; + num3++; + } + if (Main.tile[j, i].type == 5 && Main.tile[j, i].frameY >= 198 && Main.tile[j, i].frameX >= 22) + { + array[num3] = j; + array2[num3] = i; + num3++; + } + if (Main.tile[j, i].type == 237 && Main.tile[j, i].frameX == 18 && Main.tile[j, i].frameY == 0) + { + array[num3] = j; + array2[num3] = i; + num3++; + } + if (Main.tile[j, i].type == 72 && Main.tile[j, i].frameX >= 36) + { + int num37 = 0; + if (Main.tile[j, i].frameY == 18) + { + num37 = 1; + } + else + { + if (Main.tile[j, i].frameY == 36) + { + num37 = 2; + } + } + this.spriteBatch.Draw(Main.shroomCapTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X - 22), (float)(i * 16 - (int)Main.screenPosition.Y - 26)) + value, new Rectangle?(new Rectangle(num37 * 62, 0, 60, 42)), Lighting.GetColor(j, i), 0f, default(Vector2), 1f, effects, 0f); + } + if (color.R > 1 || color.G > 1 || color.B > 1) + { + if (Main.tile[j - 1, i] == null) + { + Main.tile[j - 1, i] = new Tile(); + } + if (Main.tile[j + 1, i] == null) + { + Main.tile[j + 1, i] = new Tile(); + } + if (Main.tile[j, i - 1] == null) + { + Main.tile[j, i - 1] = new Tile(); + } + if (Main.tile[j, i + 1] == null) + { + Main.tile[j, i + 1] = new Tile(); + } + if (solidOnly && flag && !Main.tile[j, i].inActive() && !Main.tileSolidTop[(int)Main.tile[j, i].type] && (Main.tile[j - 1, i].liquid > 0 || Main.tile[j + 1, i].liquid > 0 || Main.tile[j, i - 1].liquid > 0 || Main.tile[j, i + 1].liquid > 0)) + { + bool flag3 = false; + if (Main.tile[j, i].halfBrick()) + { + int num38 = 160; + if ((int)Main.tile[j - 1, i].liquid > num38 || (int)Main.tile[j + 1, i].liquid > num38) + { + for (int k = 0; k < Main.wfTileNum; k++) + { + if (Main.wfTileX[k] == j && Main.wfTileY[k] == i) + { + flag3 = true; + } + } + } + } + if (!flag3) + { + Color color2 = Lighting.GetColor(j, i); + int num39 = 0; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + bool flag7 = false; + int num40 = 0; + bool flag8 = false; + if ((int)Main.tile[j - 1, i].liquid > num39) + { + num39 = (int)Main.tile[j - 1, i].liquid; + flag4 = true; + } + else + { + if (Main.tile[j - 1, i].liquid > 0) + { + flag4 = true; + } + } + if ((int)Main.tile[j + 1, i].liquid > num39) + { + num39 = (int)Main.tile[j + 1, i].liquid; + flag5 = true; + } + else + { + if (Main.tile[j + 1, i].liquid > 0) + { + num39 = (int)Main.tile[j + 1, i].liquid; + flag5 = true; + } + } + if (Main.tile[j, i - 1].liquid > 0) + { + flag6 = true; + } + if (Main.tile[j, i + 1].liquid > 240) + { + flag7 = true; + } + if (Main.tile[j - 1, i].liquid > 0) + { + if (Main.tile[j - 1, i].lava()) + { + num40 = 1; + } + else + { + if (Main.tile[j - 1, i].honey()) + { + num40 = 11; + } + else + { + flag8 = true; + } + } + } + if (Main.tile[j + 1, i].liquid > 0) + { + if (Main.tile[j + 1, i].lava()) + { + num40 = 1; + } + else + { + if (Main.tile[j + 1, i].honey()) + { + num40 = 11; + } + else + { + flag8 = true; + } + } + } + if (Main.tile[j, i - 1].liquid > 0) + { + if (Main.tile[j, i - 1].lava()) + { + num40 = 1; + } + else + { + if (Main.tile[j, i - 1].honey()) + { + num40 = 11; + } + else + { + flag8 = true; + } + } + } + if (Main.tile[j, i + 1].liquid > 0) + { + if (Main.tile[j, i + 1].lava()) + { + num40 = 1; + } + else + { + if (Main.tile[j, i + 1].honey()) + { + num40 = 11; + } + else + { + flag8 = true; + } + } + } + if (num40 == 0) + { + num40 = Main.waterStyle; + } + if (!flag8 || num40 != 1) + { + Vector2 value2 = new Vector2((float)(j * 16), (float)(i * 16)); + Rectangle value3 = new Rectangle(0, 4, 16, 16); + if (flag7 && (flag4 || flag5)) + { + flag4 = true; + flag5 = true; + } + if ((!flag6 || (!flag4 && !flag5)) && (!flag7 || !flag6)) + { + if (flag6) + { + value3 = new Rectangle(0, 4, 16, 4); + if (Main.tile[j, i].halfBrick() || Main.tile[j, i].slope() != 0) + { + value3 = new Rectangle(0, 4, 16, 12); + } + } + else + { + if (flag7 && !flag4 && !flag5) + { + value2 = new Vector2((float)(j * 16), (float)(i * 16 + 12)); + value3 = new Rectangle(0, 4, 16, 4); + } + else + { + float num41 = (float)(256 - num39); + num41 /= 32f; + int y = 4; + if (Main.tile[j, i - 1].liquid == 0 && !WorldGen.SolidTile(j, i - 1)) + { + y = 0; + } + if ((flag4 && flag5) || Main.tile[j, i].halfBrick() || Main.tile[j, i].slope() != 0) + { + value2 = new Vector2((float)(j * 16), (float)(i * 16 + (int)num41 * 2)); + value3 = new Rectangle(0, y, 16, 16 - (int)num41 * 2); + } + else + { + if (flag4) + { + value2 = new Vector2((float)(j * 16), (float)(i * 16 + (int)num41 * 2)); + value3 = new Rectangle(0, y, 4, 16 - (int)num41 * 2); + } + else + { + value2 = new Vector2((float)(j * 16 + 12), (float)(i * 16 + (int)num41 * 2)); + value3 = new Rectangle(0, y, 4, 16 - (int)num41 * 2); + } + } + } + } + } + float num42 = 0.5f; + if (num40 == 1) + { + num42 = 2f; + } + if (num40 == 1) + { + num42 = 1f; + } + if (num40 == 11) + { + num42 *= 1.7f; + if (num42 > 1f) + { + num42 = 1f; + } + } + if ((double)i < Main.worldSurface || num42 > 1f) + { + num42 = 1f; + if (Main.tile[j + 1, i].wall > 0 || Main.tile[j - 1, i].wall > 0 || Main.tile[j, i + 1].wall > 0 || Main.tile[j, i - 1].wall > 0) + { + num42 = 0.65f; + } + if (Main.tile[j, i].wall > 0) + { + num42 = 0.5f; + } + } + if (Main.tile[j, i].halfBrick() && Main.tile[j, i - 1].liquid > 0 && Main.tile[j, i].wall > 0) + { + num42 = 0f; + } + float num43 = (float)color2.R * num42; + float num44 = (float)color2.G * num42; + float num45 = (float)color2.B * num42; + float num46 = (float)color2.A * num42; + color2 = new Color((int)((byte)num43), (int)((byte)num44), (int)((byte)num45), (int)((byte)num46)); + this.spriteBatch.Draw(Main.liquidTexture[num40], value2 - Main.screenPosition + value, new Rectangle?(value3), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + if (Main.tile[j, i].type == 51) + { + Color color3 = Lighting.GetColor(j, i); + float num47 = 0.5f; + float num48 = (float)color3.R * num47; + float num49 = (float)color3.G * num47; + float num50 = (float)color3.B * num47; + float num51 = (float)color3.A * num47; + color3 = new Color((int)((byte)num48), (int)((byte)num49), (int)((byte)num50), (int)((byte)num51)); + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color3, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color3, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.tile[j, i].type == 160 && !Main.tile[j, i].halfBrick()) + { + Color color4 = default(Color); + color4 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255); + if (Main.tile[j, i].inActive()) + { + color4 = Main.tile[j, i].actColor(color4); + } + if (Main.tile[j, i].slope() == 0) + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color4, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + if (Main.tile[j, i].slope() == 1) + { + for (int l = 0; l < 8; l++) + { + int num52 = 2; + int num53 = l * 2; + int height = 14 - l * num52; + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num53, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + l * num52)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num53, (int)Main.tile[j, i].frameY, num52, height)), color4, 0f, default(Vector2), 1f, effects, 0f); + } + } + if (Main.tile[j, i].slope() == 2) + { + for (int m = 0; m < 8; m++) + { + int num54 = 2; + int num55 = 16 - m * num54 - num54; + int height2 = 14 - m * num54; + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num55, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + m * num54)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num55, (int)Main.tile[j, i].frameY, num54, height2)), color4, 0f, default(Vector2), 1f, effects, 0f); + } + } + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 14)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 14), 16, 2)), color4, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.tile[j, i].slope() > 0) + { + if (Main.tile[j, i].inActive()) + { + color = Main.tile[j, i].actColor(color); + } + else + { + if (Main.tileShine2[(int)Main.tile[j, i].type]) + { + color = Main.shine(color, (int)Main.tile[j, i].type); + } + } + if (Main.tile[j, i].slope() == 1) + { + for (int n = 0; n < 8; n++) + { + int num56 = 2; + int num57 = n * 2; + int height3 = 14 - n * num56; + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num57, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + n * num56)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num57, (int)Main.tile[j, i].frameY, num56, height3)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num57, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + n * num56)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num57, (int)Main.tile[j, i].frameY, num56, height3)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + if (Main.tile[j, i].slope() == 2) + { + for (int num58 = 0; num58 < 8; num58++) + { + int num59 = 2; + int num60 = 16 - num58 * num59 - num59; + int height4 = 14 - num58 * num59; + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num60, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num58 * num59)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num60, (int)Main.tile[j, i].frameY, num59, height4)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num60, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num58 * num59)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num60, (int)Main.tile[j, i].frameY, num59, height4)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 14)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 14), 16, 2)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 14)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 14), 16, 2)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.tile[j, i].type == 129) + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), new Color(200, 200, 200, 0), 0f, default(Vector2), 1f, effects, 0f); + } + else + { + if (Main.tileAlch[(int)Main.tile[j, i].type]) + { + num10 = 20; + num9 = -1; + int num61 = (int)Main.tile[j, i].type; + int num62 = (int)(Main.tile[j, i].frameX / 18); + if (num61 > 82) + { + if (num62 == 0 && Main.dayTime) + { + num61 = 84; + } + if (num62 == 1 && !Main.dayTime) + { + num61 = 84; + } + if (num62 == 3 && Main.bloodMoon) + { + num61 = 84; + } + } + if (num61 == 84) + { + if (num62 == 0 && Main.rand.Next(100) == 0) + { + int num63 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16 - 4)), 16, 16, 19, 0f, 0f, 160, default(Color), 0.1f); + Dust expr_48C1_cp_0 = Main.dust[num63]; + expr_48C1_cp_0.velocity.X = expr_48C1_cp_0.velocity.X / 2f; + Dust expr_48DF_cp_0 = Main.dust[num63]; + expr_48DF_cp_0.velocity.Y = expr_48DF_cp_0.velocity.Y / 2f; + Main.dust[num63].noGravity = true; + Main.dust[num63].fadeIn = 1f; + } + if (num62 == 1 && Main.rand.Next(100) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 41, 0f, 0f, 250, default(Color), 0.8f); + } + if (num62 == 3) + { + if (Main.rand.Next(200) == 0) + { + int num64 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 14, 0f, 0f, 100, default(Color), 0.2f); + Main.dust[num64].fadeIn = 1.2f; + } + if (Main.rand.Next(75) == 0) + { + int num65 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 27, 0f, 0f, 100, default(Color), 1f); + Dust expr_4A16_cp_0 = Main.dust[num65]; + expr_4A16_cp_0.velocity.X = expr_4A16_cp_0.velocity.X / 2f; + Dust expr_4A34_cp_0 = Main.dust[num65]; + expr_4A34_cp_0.velocity.Y = expr_4A34_cp_0.velocity.Y / 2f; + } + } + if (num62 == 4 && Main.rand.Next(150) == 0) + { + int num66 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 8, 16, 0f, 0f, 0, default(Color), 1f); + Dust expr_4AA5_cp_0 = Main.dust[num66]; + expr_4AA5_cp_0.velocity.X = expr_4AA5_cp_0.velocity.X / 3f; + Dust expr_4AC3_cp_0 = Main.dust[num66]; + expr_4AC3_cp_0.velocity.Y = expr_4AC3_cp_0.velocity.Y / 3f; + Dust expr_4AE1_cp_0 = Main.dust[num66]; + expr_4AE1_cp_0.velocity.Y = expr_4AE1_cp_0.velocity.Y - 0.7f; + Main.dust[num66].alpha = 50; + Main.dust[num66].scale *= 0.1f; + Main.dust[num66].fadeIn = 0.9f; + Main.dust[num66].noGravity = true; + } + if (num62 == 5) + { + if (Main.rand.Next(40) == 0) + { + int num67 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16 - 6)), 16, 16, 6, 0f, 0f, 0, default(Color), 1.5f); + Dust expr_4B96_cp_0 = Main.dust[num67]; + expr_4B96_cp_0.velocity.Y = expr_4B96_cp_0.velocity.Y - 2f; + Main.dust[num67].noGravity = true; + } + color.A = (byte)(Main.mouseTextColor / 2); + color.G = Main.mouseTextColor; + color.B = Main.mouseTextColor; + } + } + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.LoadTiles(num61); + this.spriteBatch.Draw(Main.tileTexture[num61], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.tile[j, i].type == 80) + { + bool flag9 = false; + bool flag10 = false; + bool flag11 = false; + if (!Main.canDrawColorTile(j, i)) + { + int num68 = j; + if (Main.tile[j, i].frameX == 36) + { + num68--; + } + if (Main.tile[j, i].frameX == 54) + { + num68++; + } + if (Main.tile[j, i].frameX == 108) + { + if (Main.tile[j, i].frameY == 18) + { + num68--; + } + else + { + num68++; + } + } + int num69 = i; + bool flag12 = false; + if (Main.tile[num68, num69].type == 80 && Main.tile[num68, num69].active()) + { + flag12 = true; + } + while (!Main.tile[num68, num69].active() || !Main.tileSolid[(int)Main.tile[num68, num69].type] || !flag12) + { + if (Main.tile[num68, num69].type == 80 && Main.tile[num68, num69].active()) + { + flag12 = true; + } + num69++; + if (num69 > i + 20) + { + break; + } + } + if (Main.tile[num68, num69].type == 112) + { + flag9 = true; + } + if (Main.tile[num68, num69].type == 116) + { + flag10 = true; + } + if (Main.tile[num68, num69].type == 234) + { + flag11 = true; + } + } + if (flag9) + { + this.spriteBatch.Draw(Main.evilCactusTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + if (flag11) + { + this.spriteBatch.Draw(Main.crimsonCactusTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + if (flag10) + { + this.spriteBatch.Draw(Main.goodCactusTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + } + } + else + { + if (Main.tile[j, i].type == 160) + { + color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255); + } + if (Main.tile[j, i].type != 19 && Main.tileSolid[(int)Main.tile[j, i].type] && !Main.tile[j, i].halfBrick() && (Main.tile[j - 1, i].halfBrick() || Main.tile[j + 1, i].halfBrick())) + { + if (Main.tile[j, i].inActive()) + { + color = Main.tile[j, i].actColor(color); + } + else + { + if (Main.tileShine2[(int)Main.tile[j, i].type]) + { + color = Main.shine(color, (int)Main.tile[j, i].type); + } + } + if (Main.tile[j - 1, i].halfBrick() && Main.tile[j + 1, i].halfBrick()) + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 8)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 8), num8, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(126, 0, 16, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 8)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 8), num8, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(126, 0, 16, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.tile[j - 1, i].halfBrick()) + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 8)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 8), num8, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + 4f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)(Main.tile[j, i].frameX + 4), (int)Main.tile[j, i].frameY, num8 - 4, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(126, 0, 4, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 8)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 8), num8, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + 4f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)(Main.tile[j, i].frameX + 4), (int)Main.tile[j, i].frameY, num8 - 4, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(126, 0, 4, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.tile[j + 1, i].halfBrick()) + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 8)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 8), num8, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8 - 4, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + 12f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(138, 0, 4, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 8)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)(Main.tile[j, i].frameY + 8), num8, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8 - 4, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + 12f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(138, 0, 4, 8)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + } + } + else + { + if (Lighting.lightMode < 2 && Main.tileSolid[(int)Main.tile[j, i].type] && Main.tile[j, i].type != 137 && Main.tile[j, i].type != 235 && !Main.tile[j, i].halfBrick() && !Main.tile[j, i].inActive()) + { + if ((int)color.R > num || (double)color.G > (double)num * 1.1 || (double)color.B > (double)num * 1.2) + { + for (int num70 = 0; num70 < 9; num70++) + { + int num71 = 0; + int num72 = 0; + int width = 4; + int height5 = 4; + Color color5 = color; + Color color6 = color; + if (num70 == 0) + { + color6 = Lighting.GetColor(j - 1, i - 1); + } + if (num70 == 1) + { + width = 8; + num71 = 4; + color6 = Lighting.GetColor(j, i - 1); + } + if (num70 == 2) + { + color6 = Lighting.GetColor(j + 1, i - 1); + num71 = 12; + } + if (num70 == 3) + { + color6 = Lighting.GetColor(j - 1, i); + height5 = 8; + num72 = 4; + } + if (num70 == 4) + { + width = 8; + height5 = 8; + num71 = 4; + num72 = 4; + } + if (num70 == 5) + { + num71 = 12; + num72 = 4; + height5 = 8; + color6 = Lighting.GetColor(j + 1, i); + } + if (num70 == 6) + { + color6 = Lighting.GetColor(j - 1, i + 1); + num72 = 12; + } + if (num70 == 7) + { + width = 8; + height5 = 4; + num71 = 4; + num72 = 12; + color6 = Lighting.GetColor(j, i + 1); + } + if (num70 == 8) + { + color6 = Lighting.GetColor(j + 1, i + 1); + num71 = 12; + num72 = 12; + } + color5.R = (byte)((color.R + color6.R) / 2); + color5.G = (byte)((color.G + color6.G) / 2); + color5.B = (byte)((color.B + color6.B) / 2); + if (Main.tile[j, i].inActive()) + { + color5 = Main.tile[j, i].actColor(color5); + } + else + { + if (Main.tileShine2[(int)Main.tile[j, i].type]) + { + color5 = Main.shine(color5, (int)Main.tile[j, i].type); + } + } + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num71, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num72)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num71, (int)Main.tile[j, i].frameY + num72, width, height5)), color5, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num71, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num72)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num71, (int)Main.tile[j, i].frameY + num72, width, height5)), color5, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + else + { + if ((int)color.R > num2 || (double)color.G > (double)num2 * 1.1 || (double)color.B > (double)num2 * 1.2) + { + for (int num73 = 0; num73 < 4; num73++) + { + int num74 = 0; + int num75 = 0; + Color color7 = color; + Color color8 = color; + if (num73 == 0) + { + if (Lighting.Brighter(j, i - 1, j - 1, i)) + { + color8 = Lighting.GetColor(j - 1, i); + } + else + { + color8 = Lighting.GetColor(j, i - 1); + } + } + if (num73 == 1) + { + if (Lighting.Brighter(j, i - 1, j + 1, i)) + { + color8 = Lighting.GetColor(j + 1, i); + } + else + { + color8 = Lighting.GetColor(j, i - 1); + } + num74 = 8; + } + if (num73 == 2) + { + if (Lighting.Brighter(j, i + 1, j - 1, i)) + { + color8 = Lighting.GetColor(j - 1, i); + } + else + { + color8 = Lighting.GetColor(j, i + 1); + } + num75 = 8; + } + if (num73 == 3) + { + if (Lighting.Brighter(j, i + 1, j + 1, i)) + { + color8 = Lighting.GetColor(j + 1, i); + } + else + { + color8 = Lighting.GetColor(j, i + 1); + } + num74 = 8; + num75 = 8; + } + color7.R = (byte)((color.R + color8.R) / 2); + color7.G = (byte)((color.G + color8.G) / 2); + color7.B = (byte)((color.B + color8.B) / 2); + if (Main.tile[j, i].inActive()) + { + color7 = Main.tile[j, i].actColor(color7); + } + else + { + if (Main.tileShine2[(int)Main.tile[j, i].type]) + { + color7 = Main.shine(color7, (int)Main.tile[j, i].type); + } + } + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num74, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num75)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num74, (int)Main.tile[j, i].frameY + num75, 8, 8)), color7, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + (float)num74, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num75)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX + num74, (int)Main.tile[j, i].frameY + num75, 8, 8)), color7, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + else + { + if (Main.tile[j, i].inActive()) + { + color = Main.tile[j, i].actColor(color); + } + else + { + if (Main.tileShine2[(int)Main.tile[j, i].type]) + { + color = Main.shine(color, (int)Main.tile[j, i].type); + } + } + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + } + else + { + if (Lighting.lightMode < 2 && Main.tileShine2[(int)Main.tile[j, i].type]) + { + if (Main.tile[j, i].type == 21) + { + if (Main.tile[j, i].frameX >= 36 && Main.tile[j, i].frameX < 178) + { + color = Main.shine(color, (int)Main.tile[j, i].type); + } + } + else + { + if (!Main.tile[j, i].inActive()) + { + color = Main.shine(color, (int)Main.tile[j, i].type); + } + } + } + if (Main.tile[j, i].inActive()) + { + color = Main.tile[j, i].actColor(color); + } + if (Main.tile[j, i].type == 128) + { + int num76; + for (num76 = (int)Main.tile[j, i].frameX; num76 >= 100; num76 -= 100) + { + } + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle(num76, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + if (Main.tile[j, i].type == 5) + { + int num77 = -1; + int num78 = j; + int num79 = i; + if (Main.tile[j, i].frameX == 66 && Main.tile[j, i].frameY <= 45) + { + num78++; + } + if (Main.tile[j, i].frameX == 88 && Main.tile[j, i].frameY >= 66 && Main.tile[j, i].frameY <= 110) + { + num78--; + } + if (Main.tile[j, i].frameX == 22 && Main.tile[j, i].frameY >= 132) + { + num78--; + } + if (Main.tile[j, i].frameX == 44 && Main.tile[j, i].frameY >= 132) + { + num78++; + } + while (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 5) + { + num79++; + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 23) + { + num77 = 0; + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 60) + { + num77 = 1; + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 70) + { + num77 = 6; + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 60 && (double)num79 > Main.worldSurface) + { + num77 = 5; + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 109) + { + num77 = 2; + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 147) + { + num77 = 3; + if (WorldGen.snowBG == 0) + { + num77 = -1; + } + } + if (Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 199) + { + num77 = 4; + } + if (num77 == -1 || Main.canDrawColorTile(j, i)) + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + this.spriteBatch.Draw(Main.woodTexture[num77], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (num11 == 8 && (!Main.tile[j, i + 1].active() || !Main.tileSolid[(int)Main.tile[j, i + 1].type] || Main.tile[j, i + 1].halfBrick())) + { + if (Main.tile[j, i].type == 19) + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num11)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num11)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + else + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num11)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10 - num11 - 4)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 12)) + value, new Rectangle?(new Rectangle(144, 66, num8, 4)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num11)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10 - num11 - 4)), color, 0f, default(Vector2), 1f, effects, 0f); + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + 12)) + value, new Rectangle?(new Rectangle(144, 66, num8, 4)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + } + else + { + if (Main.canDrawColorTile(j, i)) + { + this.spriteBatch.Draw(Main.tileAltTexture[(int)Main.tile[j, i].type, (int)Main.tile[j, i].color()], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num11)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY + num12, num8, num10 - num11)), color, 0f, default(Vector2), 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.tileTexture[(int)Main.tile[j, i].type], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9 + num11)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY + num12, num8, num10 - num11)), color, 0f, default(Vector2), 1f, effects, 0f); + } + } + if (Main.tile[j, i].type == 139) + { + this.spriteBatch.Draw(Main.MusicBoxTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), new Color(200, 200, 200, 0), 0f, default(Vector2), 1f, effects, 0f); + } + if (Main.tileFlame[(int)Main.tile[j, i].type]) + { + int type = (int)Main.tile[j, i].type; + int num80 = 0; + if (type == 4) + { + num80 = 0; + } + else + { + if (type == 33 || type == 174) + { + num80 = 1; + } + else + { + if (type == 100 || type == 173) + { + num80 = 2; + } + else + { + if (type == 34 || type == 35 || type == 36 || type == 170 || type == 171 || type == 172) + { + num80 = 3; + } + else + { + if (type == 93) + { + num80 = 4; + } + else + { + if (type == 49) + { + num80 = 5; + } + else + { + if (type == 98) + { + num80 = 6; + } + } + } + } + } + } + } + for (int num81 = 0; num81 < 7; num81++) + { + float num82 = (float)Main.rand.Next(-10, 11) * 0.15f; + float num83 = (float)Main.rand.Next(-10, 1) * 0.35f; + this.spriteBatch.Draw(Main.FlameTexture[num80], new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f + num82, (float)(i * 16 - (int)Main.screenPosition.Y + num9) + num83) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), new Color(100, 100, 100, 0), 0f, default(Vector2), 1f, effects, 0f); + } + } + if (Main.tile[j, i].type == 144) + { + this.spriteBatch.Draw(Main.timerTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), new Color(200, 200, 200, 0), 0f, default(Vector2), 1f, effects, 0f); + } + if (Main.tile[j, i].type == 237) + { + this.spriteBatch.Draw(Main.sunAltarTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X) - ((float)num8 - 16f) / 2f, (float)(i * 16 - (int)Main.screenPosition.Y + num9)) + value, new Rectangle?(new Rectangle((int)Main.tile[j, i].frameX, (int)Main.tile[j, i].frameY, num8, num10)), new Color((int)(Main.mouseTextColor / 2), (int)(Main.mouseTextColor / 2), (int)(Main.mouseTextColor / 2), 0), 0f, default(Vector2), 1f, effects, 0f); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + for (int num84 = 0; num84 < num3; num84++) + { + int num85 = array[num84]; + int num86 = array2[num84]; + if (Main.tile[num85, num86].type == 237) + { + this.spriteBatch.Draw(Main.sunOrbTexture, new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X) + (float)num8 / 2f, (float)(num86 * 16 - (int)Main.screenPosition.Y - 36)) + value, new Rectangle?(new Rectangle(0, 0, Main.sunOrbTexture.Width, Main.sunOrbTexture.Height)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, 0), Main.sunCircle, new Vector2((float)(Main.sunOrbTexture.Width / 2), (float)(Main.sunOrbTexture.Height / 2)), 1f, SpriteEffects.None, 0f); + } + if (Main.tile[num85, num86].type == 128 && Main.tile[num85, num86].frameX >= 100) + { + int num87 = (int)(Main.tile[num85, num86].frameY / 18); + int num88 = (int)Main.tile[num85, num86].frameX; + int num89 = 0; + while (num88 >= 100) + { + num89++; + num88 -= 100; + } + int num90 = -4; + SpriteEffects effects2 = SpriteEffects.FlipHorizontally; + if (num88 >= 36) + { + effects2 = SpriteEffects.None; + num90 = -4; + } + if (num87 == 0) + { + this.LoadArmorHead(num89); + this.spriteBatch.Draw(Main.armorHeadTexture[num89], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X + num90), (float)(num86 * 16 - (int)Main.screenPosition.Y - 12)) + value, new Rectangle?(new Rectangle(0, 0, 40, 36)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, effects2, 0f); + } + else + { + if (num87 == 1) + { + this.LoadArmorBody(num89); + this.spriteBatch.Draw(Main.armorBodyTexture[num89], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X + num90), (float)(num86 * 16 - (int)Main.screenPosition.Y - 28)) + value, new Rectangle?(new Rectangle(0, 0, 40, 54)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, effects2, 0f); + } + else + { + if (num87 == 2) + { + this.LoadArmorLegs(num89); + this.spriteBatch.Draw(Main.armorLegTexture[num89], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X + num90), (float)(num86 * 16 - (int)Main.screenPosition.Y - 44)) + value, new Rectangle?(new Rectangle(0, 0, 40, 54)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, effects2, 0f); + } + } + } + } + try + { + if (Main.tile[num85, num86].type == 5 && Main.tile[num85, num86].frameY >= 198 && Main.tile[num85, num86].frameX >= 22) + { + int num91 = 0; + if (Main.tile[num85, num86].frameX == 22) + { + if (Main.tile[num85, num86].frameY == 220) + { + num91 = 1; + } + else + { + if (Main.tile[num85, num86].frameY == 242) + { + num91 = 2; + } + } + int num92 = 0; + int num93 = 80; + int num94 = 80; + int num95 = 32; + int num96 = 0; + int num97 = num86; + while (num97 < num86 + 100) + { + if (Main.tile[num85, num97].type == 2) + { + num92 = Main.GetTreeStyle(num85); + break; + } + if (Main.tile[num85, num97].type == 23) + { + num92 = 1; + break; + } + if (Main.tile[num85, num97].type == 70) + { + num92 = 14; + break; + } + if (Main.tile[num85, num97].type == 60) + { + num92 = 2; + if (WorldGen.jungleBG == 1) + { + num92 = 11; + } + if ((double)num97 > Main.worldSurface) + { + num92 = 13; + } + num93 = 114; + num94 = 96; + num95 = 48; + break; + } + if (Main.tile[num85, num97].type == 147) + { + num92 = 4; + if (WorldGen.snowBG == 0) + { + num92 = 12; + break; + } + break; + } + else + { + if (Main.tile[num85, num97].type == 199) + { + num92 = 5; + break; + } + if (Main.tile[num85, num97].type == 109) + { + num92 = 3; + num94 = 140; + if (num85 % 3 == 1) + { + num91 += 3; + break; + } + if (num85 % 3 == 2) + { + num91 += 6; + break; + } + break; + } + else + { + num97++; + } + } + } + if (num92 == 14) + { + float num98 = (float)Main.rand.Next(28, 42) * 0.005f; + num98 += (float)(270 - (int)Main.mouseTextColor) / 1000f; + Lighting.addLight(num85, num86, 0.1f, 0.2f + num98 / 2f, 0.7f + num98); + } + if (Main.tile[num85, num86].color() > 0) + { + Main.checkTreeAlt[num92, (int)Main.tile[num85, num86].color()] = true; + } + if (Main.tile[num85, num86].color() > 0 && Main.treeAltTextureDrawn[num92, (int)Main.tile[num85, num86].color()]) + { + this.spriteBatch.Draw(Main.treeTopAltTexture[num92, (int)Main.tile[num85, num86].color()], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X - num95), (float)(num86 * 16 - (int)Main.screenPosition.Y - num94 + 16 + num96)) + value, new Rectangle?(new Rectangle(num91 * (num93 + 2), 0, num93, num94)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.treeTopTexture[num92], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X - num95), (float)(num86 * 16 - (int)Main.screenPosition.Y - num94 + 16 + num96)) + value, new Rectangle?(new Rectangle(num91 * (num93 + 2), 0, num93, num94)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + if (Main.tile[num85, num86].frameX == 44) + { + if (Main.tile[num85, num86].frameY == 220) + { + num91 = 1; + } + else + { + if (Main.tile[num85, num86].frameY == 242) + { + num91 = 2; + } + } + int num99 = 0; + int num100 = num86; + while (num100 < num86 + 100) + { + if (Main.tile[num85 + 1, num100].type == 2) + { + num99 = Main.GetTreeStyle(num85 + 1); + break; + } + if (Main.tile[num85 + 1, num100].type == 23) + { + num99 = 1; + break; + } + if (Main.tile[num85 + 1, num100].type == 70) + { + num99 = 14; + break; + } + if (Main.tile[num85 + 1, num100].type == 60) + { + num99 = 2; + if ((double)num100 > Main.worldSurface) + { + num99 = 13; + break; + } + break; + } + else + { + if (Main.tile[num85 + 1, num100].type == 147) + { + num99 = 4; + if (WorldGen.snowBG == 0) + { + num99 = 12; + break; + } + break; + } + else + { + if (Main.tile[num85 + 1, num100].type == 199) + { + num99 = 5; + break; + } + if (Main.tile[num85 + 1, num100].type == 109) + { + num99 = 3; + if (num85 % 3 == 1) + { + num91 += 3; + break; + } + if (num85 % 3 == 2) + { + num91 += 6; + break; + } + break; + } + else + { + num100++; + } + } + } + } + if (num99 == 14) + { + float num101 = (float)Main.rand.Next(28, 42) * 0.005f; + num101 += (float)(270 - (int)Main.mouseTextColor) / 1000f; + Lighting.addLight(num85, num86, 0.1f, 0.2f + num101 / 2f, 0.7f + num101); + } + if (Main.tile[num85, num86].color() > 0) + { + Main.checkTreeAlt[num99, (int)Main.tile[num85, num86].color()] = true; + } + if (Main.tile[num85, num86].color() > 0 && Main.treeAltTextureDrawn[num99, (int)Main.tile[num85, num86].color()]) + { + this.spriteBatch.Draw(Main.treeBranchAltTexture[num99, (int)Main.tile[num85, num86].color()], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X - 24), (float)(num86 * 16 - (int)Main.screenPosition.Y - 12)) + value, new Rectangle?(new Rectangle(0, num91 * 42, 40, 40)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.treeBranchTexture[num99], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X - 24), (float)(num86 * 16 - (int)Main.screenPosition.Y - 12)) + value, new Rectangle?(new Rectangle(0, num91 * 42, 40, 40)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + if (Main.tile[num85, num86].frameX == 66) + { + if (Main.tile[num85, num86].frameY == 220) + { + num91 = 1; + } + else + { + if (Main.tile[num85, num86].frameY == 242) + { + num91 = 2; + } + } + int num102 = 0; + int num103 = num86; + while (num103 < num86 + 100) + { + if (Main.tile[num85 - 1, num103].type == 2) + { + num102 = Main.GetTreeStyle(num85 - 1); + break; + } + if (Main.tile[num85 - 1, num103].type == 23) + { + num102 = 1; + break; + } + if (Main.tile[num85 - 1, num103].type == 70) + { + num102 = 14; + break; + } + if (Main.tile[num85 - 1, num103].type == 60) + { + num102 = 2; + if ((double)num103 > Main.worldSurface) + { + num102 = 13; + break; + } + break; + } + else + { + if (Main.tile[num85 - 1, num103].type == 147) + { + num102 = 4; + if (WorldGen.snowBG == 0) + { + num102 = 12; + break; + } + break; + } + else + { + if (Main.tile[num85 - 1, num103].type == 199) + { + num102 = 5; + break; + } + if (Main.tile[num85 - 1, num103].type == 109) + { + num102 = 3; + if (num85 % 3 == 1) + { + num91 += 3; + break; + } + if (num85 % 3 == 2) + { + num91 += 6; + break; + } + break; + } + else + { + num103++; + } + } + } + } + if (num102 == 14) + { + float num104 = (float)Main.rand.Next(28, 42) * 0.005f; + num104 += (float)(270 - (int)Main.mouseTextColor) / 1000f; + Lighting.addLight(num85, num86, 0.1f, 0.2f + num104 / 2f, 0.7f + num104); + } + if (Main.tile[num85, num86].color() > 0) + { + Main.checkTreeAlt[num102, (int)Main.tile[num85, num86].color()] = true; + } + if (Main.tile[num85, num86].color() > 0 && Main.treeAltTextureDrawn[num102, (int)Main.tile[num85, num86].color()]) + { + this.spriteBatch.Draw(Main.treeBranchAltTexture[num102, (int)Main.tile[num85, num86].color()], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X), (float)(num86 * 16 - (int)Main.screenPosition.Y - 12)) + value, new Rectangle?(new Rectangle(42, num91 * 42, 40, 40)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.treeBranchTexture[num102], new Vector2((float)(num85 * 16 - (int)Main.screenPosition.X), (float)(num86 * 16 - (int)Main.screenPosition.Y - 12)) + value, new Rectangle?(new Rectangle(42, num91 * 42, 40, 40)), Lighting.GetColor(num85, num86), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + } + catch + { + } + } + if (solidOnly) + { + Main.renderTimer[0] = (float)stopwatch.ElapsedMilliseconds; + return; + } + Main.renderTimer[1] = (float)stopwatch.ElapsedMilliseconds; + } + protected void DrawWater(bool bg = false, int Style = 0, float Alpha = 1f) + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + Vector2 value = new Vector2((float)Main.offScreenRange, (float)Main.offScreenRange); + if (Main.drawToScreen) + { + value = default(Vector2); + } + int num = (int)(255f * (1f - Main.gfxQuality) + 40f * Main.gfxQuality); + float arg_52_0 = Main.gfxQuality; + float arg_58_0 = Main.gfxQuality; + int num2 = (int)((Main.screenPosition.X - value.X) / 16f - 1f); + int num3 = (int)((Main.screenPosition.X + (float)Main.screenWidth + value.X) / 16f) + 2; + int num4 = (int)((Main.screenPosition.Y - value.Y) / 16f - 1f); + int num5 = (int)((Main.screenPosition.Y + (float)Main.screenHeight + value.Y) / 16f) + 5; + if (num2 < 5) + { + num2 = 5; + } + if (num3 > Main.maxTilesX - 5) + { + num3 = Main.maxTilesX - 5; + } + if (num4 < 5) + { + num4 = 5; + } + if (num5 > Main.maxTilesY - 5) + { + num5 = Main.maxTilesY - 5; + } + for (int i = num4; i < num5 + 4; i++) + { + for (int j = num2 - 2; j < num3 + 2; j++) + { + if (Main.tile[j, i] == null) + { + Main.tile[j, i] = new Tile(); + } + if (Main.tile[j, i].liquid > 0 && (!Main.tile[j, i].nactive() || !Main.tileSolid[(int)Main.tile[j, i].type] || Main.tileSolidTop[(int)Main.tile[j, i].type]) && (Lighting.Brightness(j, i) > 0f || bg)) + { + Color color = Lighting.GetColor(j, i); + float num6 = (float)(256 - (int)Main.tile[j, i].liquid); + num6 /= 32f; + int num7 = 0; + if (Main.tile[j, i].lava()) + { + num7 = 1; + } + else + { + if (Main.tile[j, i].honey()) + { + num7 = 11; + } + } + if (num7 == 0) + { + num7 = Style; + } + if ((num7 != 1 && num7 != 11) || !Main.drewLava) + { + float num8 = 0.5f; + if (bg) + { + num8 = 1f; + } + if (num7 != 1 && num7 != 11) + { + num8 *= Alpha; + } + Vector2 value2 = new Vector2((float)(j * 16), (float)(i * 16 + (int)num6 * 2)); + Rectangle value3 = new Rectangle(0, 0, 16, 16 - (int)num6 * 2); + if (Main.tile[j, i + 1].liquid < 245 && (!Main.tile[j, i + 1].nactive() || !Main.tileSolid[(int)Main.tile[j, i + 1].type] || Main.tileSolidTop[(int)Main.tile[j, i + 1].type])) + { + float num9 = (float)(256 - (int)Main.tile[j, i + 1].liquid); + num9 /= 32f; + num8 = 0.5f * (8f - num6) / 4f; + if ((double)num8 > 0.55) + { + num8 = 0.55f; + } + if ((double)num8 < 0.35) + { + num8 = 0.35f; + } + float num10 = num6 / 2f; + if (Main.tile[j, i + 1].liquid < 200) + { + if (bg) + { + goto IL_DA9; + } + if (Main.tile[j, i - 1].liquid > 0 && Main.tile[j, i - 1].liquid > 0) + { + value3 = new Rectangle(0, 4, 16, 16); + num8 = 0.5f; + } + else + { + if (Main.tile[j, i - 1].liquid > 0) + { + value2 = new Vector2((float)(j * 16), (float)(i * 16 + 4)); + value3 = new Rectangle(0, 4, 16, 12); + num8 = 0.5f; + } + else + { + if (Main.tile[j, i + 1].liquid > 0) + { + value2 = new Vector2((float)(j * 16), (float)(i * 16 + (int)num6 * 2 + (int)num9 * 2)); + value3 = new Rectangle(0, 4, 16, 16 - (int)num6 * 2); + } + else + { + value2 = new Vector2((float)(j * 16 + (int)num10), (float)(i * 16 + (int)num10 * 2 + (int)num9 * 2)); + value3 = new Rectangle(0, 4, 16 - (int)num10 * 2, 16 - (int)num10 * 2); + } + } + } + } + else + { + num8 = 0.5f; + value3 = new Rectangle(0, 4, 16, 16 - (int)num6 * 2 + (int)num9 * 2); + } + } + else + { + if (Main.tile[j, i - 1].liquid > 32) + { + value3 = new Rectangle(0, 4, value3.Width, value3.Height); + } + else + { + if (num6 < 1f && Main.tile[j, i - 1].nactive() && Main.tileSolid[(int)Main.tile[j, i - 1].type] && !Main.tileSolidTop[(int)Main.tile[j, i - 1].type]) + { + value2 = new Vector2((float)(j * 16), (float)(i * 16)); + value3 = new Rectangle(0, 4, 16, 16); + } + else + { + bool flag = true; + int num11 = i + 1; + while (num11 < i + 6 && (!Main.tile[j, num11].nactive() || !Main.tileSolid[(int)Main.tile[j, num11].type] || Main.tileSolidTop[(int)Main.tile[j, num11].type])) + { + if (Main.tile[j, num11].liquid < 200) + { + flag = false; + break; + } + num11++; + } + if (!flag) + { + num8 = 0.5f; + value3 = new Rectangle(0, 4, 16, 16); + } + else + { + if (Main.tile[j, i - 1].liquid > 0) + { + value3 = new Rectangle(0, 2, value3.Width, value3.Height); + } + } + } + } + } + if ((color.R > 20 || color.B > 20 || color.G > 20) && value3.Y < 4) + { + int num12 = (int)color.R; + if ((int)color.G > num12) + { + num12 = (int)color.G; + } + if ((int)color.B > num12) + { + num12 = (int)color.B; + } + num12 /= 30; + if (Main.rand.Next(20000) < num12) + { + Color newColor = new Color(255, 255, 255); + if (Main.tile[j, i].honey()) + { + newColor = new Color(255, 255, 50); + } + int num13 = Dust.NewDust(new Vector2((float)(j * 16), value2.Y - 2f), 16, 8, 43, 0f, 0f, 254, newColor, 0.75f); + Main.dust[num13].velocity *= 0f; + } + } + if (Main.tile[j, i].honey()) + { + num8 *= 1.6f; + if (num8 > 1f) + { + num8 = 1f; + } + } + if (Main.tile[j, i].lava()) + { + num8 *= 1.8f; + if (num8 > 1f) + { + num8 = 1f; + } + if (base.IsActive && !Main.gamePaused && Dust.lavaBubbles < 200) + { + if (Main.tile[j, i].liquid > 200 && Main.rand.Next(700) == 0) + { + Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16)), 16, 16, 35, 0f, 0f, 0, default(Color), 1f); + } + if (value3.Y == 0 && Main.rand.Next(350) == 0) + { + int num14 = Dust.NewDust(new Vector2((float)(j * 16), (float)(i * 16) + num6 * 2f - 8f), 16, 8, 35, 0f, 0f, 50, default(Color), 1.5f); + Main.dust[num14].velocity *= 0.8f; + Dust expr_8F6_cp_0 = Main.dust[num14]; + expr_8F6_cp_0.velocity.X = expr_8F6_cp_0.velocity.X * 2f; + Dust expr_914_cp_0 = Main.dust[num14]; + expr_914_cp_0.velocity.Y = expr_914_cp_0.velocity.Y - (float)Main.rand.Next(1, 7) * 0.1f; + if (Main.rand.Next(10) == 0) + { + Dust expr_94E_cp_0 = Main.dust[num14]; + expr_94E_cp_0.velocity.Y = expr_94E_cp_0.velocity.Y * (float)Main.rand.Next(2, 5); + } + Main.dust[num14].noGravity = true; + } + } + } + float num15 = (float)color.R * num8; + float num16 = (float)color.G * num8; + float num17 = (float)color.B * num8; + float num18 = (float)color.A * num8; + color = new Color((int)((byte)num15), (int)((byte)num16), (int)((byte)num17), (int)((byte)num18)); + if (Lighting.lightMode < 2 && !bg) + { + Color color2 = color; + if (num7 != 1 && ((double)color2.R > (double)num * 0.6 || (double)color2.G > (double)num * 0.65 || (double)color2.B > (double)num * 0.7)) + { + for (int k = 0; k < 4; k++) + { + int num19 = 0; + int num20 = 0; + int width = 8; + int height = 8; + Color color3 = color2; + Color color4 = Lighting.GetColor(j, i); + if (k == 0) + { + color4 = Lighting.GetColor(j - 1, i - 1); + if (value3.Height < 8) + { + height = value3.Height; + } + } + if (k == 1) + { + color4 = Lighting.GetColor(j + 1, i - 1); + num19 = 8; + if (value3.Height < 8) + { + height = value3.Height; + } + } + if (k == 2) + { + color4 = Lighting.GetColor(j - 1, i + 1); + num20 = 8; + height = 8 - (16 - value3.Height); + } + if (k == 3) + { + color4 = Lighting.GetColor(j + 1, i + 1); + num19 = 8; + num20 = 8; + height = 8 - (16 - value3.Height); + } + num15 = (float)color4.R * num8; + num16 = (float)color4.G * num8; + num17 = (float)color4.B * num8; + num18 = (float)color4.A * num8; + color4 = new Color((int)((byte)num15), (int)((byte)num16), (int)((byte)num17), (int)((byte)num18)); + color3.R = (byte)((color2.R * 3 + color4.R * 2) / 5); + color3.G = (byte)((color2.G * 3 + color4.G * 2) / 5); + color3.B = (byte)((color2.B * 3 + color4.B * 2) / 5); + color3.A = (byte)((color2.A * 3 + color4.A * 2) / 5); + this.spriteBatch.Draw(Main.liquidTexture[num7], value2 - Main.screenPosition + new Vector2((float)num19, (float)num20) + value, new Rectangle?(new Rectangle(value3.X + num19, value3.Y + num20, width, height)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + this.spriteBatch.Draw(Main.liquidTexture[num7], value2 - Main.screenPosition + value, new Rectangle?(value3), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + if (value3.Y < 4) + { + value3.X += (int)(Main.wFrame * 18f); + } + this.spriteBatch.Draw(Main.liquidTexture[num7], value2 - Main.screenPosition + value, new Rectangle?(value3), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.tile[j, i + 1].halfBrick()) + { + color = Lighting.GetColor(j, i + 1); + num15 = (float)color.R * num8; + num16 = (float)color.G * num8; + num17 = (float)color.B * num8; + num18 = (float)color.A * num8; + color = new Color((int)((byte)num15), (int)((byte)num16), (int)((byte)num17), (int)((byte)num18)); + value2 = new Vector2((float)(j * 16), (float)(i * 16 + 16)); + this.spriteBatch.Draw(Main.liquidTexture[num7], value2 - Main.screenPosition + value, new Rectangle?(new Rectangle(0, 4, 16, 8)), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + IL_DA9:; + } + } + Main.drewLava = true; + if (!bg) + { + Main.renderTimer[4] = (float)stopwatch.ElapsedMilliseconds; + } + } + protected void DrawGore() + { + for (int i = 0; i < 500; i++) + { + if (Main.gore[i].active && Main.gore[i].type > 0) + { + this.LoadGore(Main.gore[i].type); + Color alpha = Main.gore[i].GetAlpha(Lighting.GetColor((int)((double)Main.gore[i].position.X + (double)Main.goreTexture[Main.gore[i].type].Width * 0.5) / 16, (int)(((double)Main.gore[i].position.Y + (double)Main.goreTexture[Main.gore[i].type].Height * 0.5) / 16.0))); + this.spriteBatch.Draw(Main.goreTexture[Main.gore[i].type], new Vector2(Main.gore[i].position.X - Main.screenPosition.X + (float)(Main.goreTexture[Main.gore[i].type].Width / 2), Main.gore[i].position.Y - Main.screenPosition.Y + (float)(Main.goreTexture[Main.gore[i].type].Height / 2)), new Rectangle?(new Rectangle(0, 0, Main.goreTexture[Main.gore[i].type].Width, Main.goreTexture[Main.gore[i].type].Height)), alpha, Main.gore[i].rotation, new Vector2((float)(Main.goreTexture[Main.gore[i].type].Width / 2), (float)(Main.goreTexture[Main.gore[i].type].Height / 2)), Main.gore[i].scale, SpriteEffects.None, 0f); + } + } + } + protected void DrawHB(float X, float Y, int Health, int MaxHealth, float alpha, float scale = 1f) + { + if (Health <= 0) + { + return; + } + float num = (float)Health / (float)MaxHealth; + int num2 = (int)(36f * num); + float num3 = X - 18f * scale; + float num4 = Y; + if (Main.player[Main.myPlayer].gravDir == -1f) + { + num4 -= Main.screenPosition.Y; + num4 = Main.screenPosition.Y + (float)Main.screenHeight - num4; + } + float num5 = 0f; + float num6 = 255f; + num -= 0.1f; + float num7; + float num8; + if ((double)num > 0.5) + { + num7 = 255f; + num8 = 255f * (1f - num) * 2f; + } + else + { + num7 = 255f * num * 2f; + num8 = 255f; + } + if (num8 < 0f) + { + num8 = 0f; + } + if (num8 > 255f) + { + num8 = 255f; + } + if (num7 < 0f) + { + num7 = 0f; + } + if (num7 > 255f) + { + num7 = 255f; + } + float num9 = 0.95f; + num8 = num8 * alpha * num9; + num7 = num7 * alpha * num9; + num6 = num6 * alpha * num9; + Color color = new Color((int)((byte)num8), (int)((byte)num7), (int)((byte)num5), (int)((byte)num6)); + if (num2 < 3) + { + num2 = 3; + } + if (num2 < 34) + { + if (num2 < 36) + { + this.spriteBatch.Draw(Main.hbTexture2, new Vector2(num3 - Main.screenPosition.X + (float)num2 * scale, num4 - Main.screenPosition.Y), new Rectangle?(new Rectangle(2, 0, 2, Main.hbTexture2.Height)), color, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f); + } + if (num2 < 34) + { + this.spriteBatch.Draw(Main.hbTexture2, new Vector2(num3 - Main.screenPosition.X + (float)(num2 + 2) * scale, num4 - Main.screenPosition.Y), new Rectangle?(new Rectangle(num2 + 2, 0, 36 - num2 - 2, Main.hbTexture2.Height)), color, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f); + } + if (num2 > 2) + { + this.spriteBatch.Draw(Main.hbTexture1, new Vector2(num3 - Main.screenPosition.X, num4 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, num2 - 2, Main.hbTexture1.Height)), color, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f); + } + this.spriteBatch.Draw(Main.hbTexture1, new Vector2(num3 - Main.screenPosition.X + (float)(num2 - 2) * scale, num4 - Main.screenPosition.Y), new Rectangle?(new Rectangle(32, 0, 2, Main.hbTexture1.Height)), color, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f); + return; + } + if (num2 < 36) + { + this.spriteBatch.Draw(Main.hbTexture2, new Vector2(num3 - Main.screenPosition.X + (float)num2 * scale, num4 - Main.screenPosition.Y), new Rectangle?(new Rectangle(num2, 0, 36 - num2, Main.hbTexture2.Height)), color, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f); + } + this.spriteBatch.Draw(Main.hbTexture1, new Vector2(num3 - Main.screenPosition.X, num4 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, num2, Main.hbTexture1.Height)), color, 0f, new Vector2(0f, 0f), scale, SpriteEffects.None, 0f); + } + public static float NPCAddHeight(int i) + { + float num = 0f; + if (Main.npc[i].type == 125) + { + num = 30f; + } + else + { + if (Main.npc[i].type == 205) + { + num = 8f; + } + else + { + if (Main.npc[i].type == 182) + { + num = 24f; + } + else + { + if (Main.npc[i].type == 178) + { + num = 2f; + } + else + { + if (Main.npc[i].type == 126) + { + num = 30f; + } + else + { + if (Main.npc[i].type == 6 || Main.npc[i].type == 173) + { + num = 26f; + } + else + { + if (Main.npc[i].type == 94) + { + num = 14f; + } + else + { + if (Main.npc[i].type == 7 || Main.npc[i].type == 8 || Main.npc[i].type == 9) + { + num = 13f; + } + else + { + if (Main.npc[i].type == 98 || Main.npc[i].type == 99 || Main.npc[i].type == 100) + { + num = 13f; + } + else + { + if (Main.npc[i].type == 95 || Main.npc[i].type == 96 || Main.npc[i].type == 97) + { + num = 13f; + } + else + { + if (Main.npc[i].type == 10 || Main.npc[i].type == 11 || Main.npc[i].type == 12) + { + num = 8f; + } + else + { + if (Main.npc[i].type == 13 || Main.npc[i].type == 14 || Main.npc[i].type == 15) + { + num = 26f; + } + else + { + if (Main.npc[i].type == 175) + { + num = 4f; + } + else + { + if (Main.npc[i].type == 48) + { + num = 32f; + } + else + { + if (Main.npc[i].type == 49 || Main.npc[i].type == 51) + { + num = 4f; + } + else + { + if (Main.npc[i].type == 60) + { + num = 10f; + } + else + { + if (Main.npc[i].type == 62 || Main.npc[i].type == 66 || Main.npc[i].type == 156) + { + num = 14f; + } + else + { + if (Main.npc[i].type == 63 || Main.npc[i].type == 64 || Main.npc[i].type == 103) + { + num = 4f; + } + else + { + if (Main.npc[i].type == 65) + { + num = 14f; + } + else + { + if (Main.npc[i].type == 69) + { + num = 4f; + } + else + { + if (Main.npc[i].type == 70) + { + num = -4f; + } + else + { + if (Main.npc[i].type == 72) + { + num = -2f; + } + else + { + if (Main.npc[i].type == 83 || Main.npc[i].type == 84) + { + num = 20f; + } + else + { + if (Main.npc[i].type == 150 || Main.npc[i].type == 151 || Main.npc[i].type == 158) + { + num = 10f; + } + else + { + if (Main.npc[i].type == 152) + { + num = 6f; + } + else + { + if (Main.npc[i].type == 153 || Main.npc[i].type == 154) + { + num = 4f; + } + else + { + if (Main.npc[i].type == 165 || Main.npc[i].type == 237 || Main.npc[i].type == 238 || Main.npc[i].type == 240) + { + num = 10f; + } + else + { + if (Main.npc[i].type == 39 || Main.npc[i].type == 40 || Main.npc[i].type == 41) + { + num = 26f; + } + else + { + if (Main.npc[i].type >= 87 && Main.npc[i].type <= 92) + { + num = 56f; + } + else + { + if (Main.npc[i].type >= 134 && Main.npc[i].type <= 136) + { + num = 30f; + } + else + { + if (Main.npc[i].type == 169) + { + num = 8f; + } + else + { + if (Main.npc[i].type == 174) + { + num = 6f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return num * Main.npc[i].scale; + } + protected void DrawNPCs(bool behindTiles = false) + { + bool flag = false; + Rectangle rectangle = new Rectangle((int)Main.screenPosition.X - 300, (int)Main.screenPosition.Y - 300, Main.screenWidth + 600, Main.screenHeight + 600); + for (int i = 199; i >= 0; i--) + { + try + { + if (Main.npc[i].active && Main.npc[i].type > 0 && Main.npc[i].type < 301) + { + this.LoadNPC(Main.npc[i].type); + if (Main.npc[i].behindTiles == behindTiles) + { + if (Main.npc[i].setFrameSize) + { + Main.npc[i].frame = new Rectangle(0, 0, Main.npcTexture[Main.npc[i].type].Width, Main.npcTexture[Main.npc[i].type].Height / Main.npcFrameCount[Main.npc[i].type]); + Main.npc[i].setFrameSize = false; + } + if (Main.npc[i].type == 125 || Main.npc[i].type == 126) + { + if (!flag) + { + flag = true; + for (int j = 0; j < 200; j++) + { + if (Main.npc[j].active && i != j && (Main.npc[j].type == 125 || Main.npc[j].type == 126)) + { + float num = Main.npc[j].position.X + (float)Main.npc[j].width * 0.5f; + float num2 = Main.npc[j].position.Y + (float)Main.npc[j].height * 0.5f; + Vector2 vector = new Vector2(Main.npc[i].position.X + (float)Main.npc[i].width * 0.5f, Main.npc[i].position.Y + (float)Main.npc[i].height * 0.5f); + float num3 = num - vector.X; + float num4 = num2 - vector.Y; + float rotation = (float)Math.Atan2((double)num4, (double)num3) - 1.57f; + bool flag2 = true; + float num5 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4)); + if (num5 > 2000f) + { + flag2 = false; + } + while (flag2) + { + num5 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4)); + if (num5 < 40f) + { + flag2 = false; + } + else + { + num5 = (float)Main.chain12Texture.Height / num5; + num3 *= num5; + num4 *= num5; + vector.X += num3; + vector.Y += num4; + num3 = num - vector.X; + num4 = num2 - vector.Y; + Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f)); + this.spriteBatch.Draw(Main.chain12Texture, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain12Texture.Width, Main.chain12Texture.Height)), color, rotation, new Vector2((float)Main.chain12Texture.Width * 0.5f, (float)Main.chain12Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + } + else + { + if (Main.npc[i].type == 263 && Main.npc[i].aiStyle == 52 && NPC.plantBoss >= 0) + { + Vector2 vector2 = new Vector2(Main.npc[i].position.X + (float)(Main.npc[i].width / 2), Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)); + float num6 = Main.npc[NPC.plantBoss].center().X - vector2.X; + float num7 = Main.npc[NPC.plantBoss].center().Y - vector2.Y; + float rotation2 = (float)Math.Atan2((double)num7, (double)num6) - 1.57f; + bool flag3 = true; + while (flag3) + { + int num8 = 16; + int num9 = 32; + float num10 = (float)Math.Sqrt((double)(num6 * num6 + num7 * num7)); + if (num10 < (float)num9) + { + num8 = (int)num10 - num9 + num8; + flag3 = false; + } + num10 = (float)num8 / num10; + num6 *= num10; + num7 *= num10; + vector2.X += num6; + vector2.Y += num7; + num6 = Main.npc[NPC.plantBoss].center().X - vector2.X; + num7 = Main.npc[NPC.plantBoss].center().Y - vector2.Y; + Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f)); + this.spriteBatch.Draw(Main.chain26Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain26Texture.Width, num8)), color2, rotation2, new Vector2((float)Main.chain26Texture.Width * 0.5f, (float)Main.chain26Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + else + { + if (Main.npc[i].type == 264 && Main.npc[i].aiStyle == 53 && NPC.plantBoss >= 0) + { + int plantBoss = NPC.plantBoss; + Vector2 vector3 = new Vector2(Main.npc[i].position.X + (float)(Main.npc[i].width / 2), Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)); + float num11 = Main.npc[plantBoss].center().X - vector3.X; + float num12 = Main.npc[plantBoss].center().Y - vector3.Y; + float rotation3 = (float)Math.Atan2((double)num12, (double)num11) - 1.57f; + bool flag4 = true; + while (flag4) + { + int num13 = 16; + int num14 = 32; + float num15 = (float)Math.Sqrt((double)(num11 * num11 + num12 * num12)); + if (num15 < (float)num14) + { + num13 = (int)num15 - num14 + num13; + flag4 = false; + } + num15 = (float)num13 / num15; + num11 *= num15; + num12 *= num15; + vector3.X += num11; + vector3.Y += num12; + num11 = Main.npc[plantBoss].center().X - vector3.X; + num12 = Main.npc[plantBoss].center().Y - vector3.Y; + Color color3 = Lighting.GetColor((int)vector3.X / 16, (int)(vector3.Y / 16f)); + this.spriteBatch.Draw(Main.chain27Texture, new Vector2(vector3.X - Main.screenPosition.X, vector3.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain27Texture.Width, num13)), color3, rotation3, new Vector2((float)Main.chain27Texture.Width * 0.5f, (float)Main.chain27Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + if (rectangle.Intersects(new Rectangle((int)Main.npc[i].position.X, (int)Main.npc[i].position.Y, Main.npc[i].width, Main.npc[i].height))) + { + if (Main.npc[i].type == 101) + { + bool flag5 = true; + Vector2 vector4 = new Vector2(Main.npc[i].position.X + (float)(Main.npc[i].width / 2), Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)); + float num16 = Main.npc[i].ai[0] * 16f + 8f - vector4.X; + float num17 = Main.npc[i].ai[1] * 16f + 8f - vector4.Y; + float rotation4 = (float)Math.Atan2((double)num17, (double)num16) - 1.57f; + bool flag6 = true; + while (flag6) + { + float num18 = 0.75f; + int height = 28; + float num19 = (float)Math.Sqrt((double)(num16 * num16 + num17 * num17)); + if (num19 < 28f * num18) + { + height = (int)num19 - 40 + 28; + flag6 = false; + } + num19 = 20f * num18 / num19; + num16 *= num19; + num17 *= num19; + vector4.X += num16; + vector4.Y += num17; + num16 = Main.npc[i].ai[0] * 16f + 8f - vector4.X; + num17 = Main.npc[i].ai[1] * 16f + 8f - vector4.Y; + Color color4 = Lighting.GetColor((int)vector4.X / 16, (int)(vector4.Y / 16f)); + if (!flag5) + { + flag5 = true; + this.spriteBatch.Draw(Main.chain10Texture, new Vector2(vector4.X - Main.screenPosition.X, vector4.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain10Texture.Width, height)), color4, rotation4, new Vector2((float)Main.chain10Texture.Width * 0.5f, (float)Main.chain10Texture.Height * 0.5f), num18, SpriteEffects.None, 0f); + } + else + { + flag5 = false; + this.spriteBatch.Draw(Main.chain11Texture, new Vector2(vector4.X - Main.screenPosition.X, vector4.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain10Texture.Width, height)), color4, rotation4, new Vector2((float)Main.chain10Texture.Width * 0.5f, (float)Main.chain10Texture.Height * 0.5f), num18, SpriteEffects.None, 0f); + } + } + } + else + { + if (Main.npc[i].aiStyle == 13) + { + Vector2 vector5 = new Vector2(Main.npc[i].position.X + (float)(Main.npc[i].width / 2), Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)); + float num20 = Main.npc[i].ai[0] * 16f + 8f - vector5.X; + float num21 = Main.npc[i].ai[1] * 16f + 8f - vector5.Y; + float rotation5 = (float)Math.Atan2((double)num21, (double)num20) - 1.57f; + bool flag7 = true; + while (flag7) + { + int num22 = 28; + int num23 = 40; + if (Main.npc[i].type == 259 || Main.npc[i].type == 260) + { + num23 = 20; + num22 = 12; + } + float num24 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); + if (num24 < (float)num23) + { + num22 = (int)num24 - num23 + num22; + flag7 = false; + } + num24 = (float)num22 / num24; + num20 *= num24; + num21 *= num24; + vector5.X += num20; + vector5.Y += num21; + num20 = Main.npc[i].ai[0] * 16f + 8f - vector5.X; + num21 = Main.npc[i].ai[1] * 16f + 8f - vector5.Y; + Color color5 = Lighting.GetColor((int)vector5.X / 16, (int)(vector5.Y / 16f)); + if (Main.npc[i].type == 259 || Main.npc[i].type == 260) + { + color5.B = 255; + if (color5.R < 100) + { + color5.R = 100; + } + if (color5.G < 150) + { + color5.G = 150; + } + } + if (Main.npc[i].type == 56) + { + this.spriteBatch.Draw(Main.chain5Texture, new Vector2(vector5.X - Main.screenPosition.X, vector5.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain4Texture.Width, num22)), color5, rotation5, new Vector2((float)Main.chain4Texture.Width * 0.5f, (float)Main.chain4Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.npc[i].type == 175) + { + this.spriteBatch.Draw(Main.chain14Texture, new Vector2(vector5.X - Main.screenPosition.X, vector5.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain14Texture.Width, num22)), color5, rotation5, new Vector2((float)Main.chain14Texture.Width * 0.5f, (float)Main.chain14Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.npc[i].type == 259) + { + this.spriteBatch.Draw(Main.chain24Texture, new Vector2(vector5.X - Main.screenPosition.X, vector5.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain24Texture.Width, num22)), color5, rotation5, new Vector2((float)Main.chain24Texture.Width * 0.5f, (float)Main.chain24Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.npc[i].type == 260) + { + this.spriteBatch.Draw(Main.chain25Texture, new Vector2(vector5.X - Main.screenPosition.X, vector5.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain25Texture.Width, num22)), color5, rotation5, new Vector2((float)Main.chain25Texture.Width * 0.5f, (float)Main.chain25Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.chain4Texture, new Vector2(vector5.X - Main.screenPosition.X, vector5.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain4Texture.Width, num22)), color5, rotation5, new Vector2((float)Main.chain4Texture.Width * 0.5f, (float)Main.chain4Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + } + } + if (Main.npc[i].type == 36) + { + Vector2 vector6 = new Vector2(Main.npc[i].position.X + (float)Main.npc[i].width * 0.5f - 5f * Main.npc[i].ai[0], Main.npc[i].position.Y + 20f); + for (int k = 0; k < 2; k++) + { + float num25 = Main.npc[(int)Main.npc[i].ai[1]].position.X + (float)(Main.npc[(int)Main.npc[i].ai[1]].width / 2) - vector6.X; + float num26 = Main.npc[(int)Main.npc[i].ai[1]].position.Y + (float)(Main.npc[(int)Main.npc[i].ai[1]].height / 2) - vector6.Y; + float num27; + if (k == 0) + { + num25 -= 200f * Main.npc[i].ai[0]; + num26 += 130f; + num27 = (float)Math.Sqrt((double)(num25 * num25 + num26 * num26)); + num27 = 92f / num27; + vector6.X += num25 * num27; + vector6.Y += num26 * num27; + } + else + { + num25 -= 50f * Main.npc[i].ai[0]; + num26 += 80f; + num27 = (float)Math.Sqrt((double)(num25 * num25 + num26 * num26)); + num27 = 60f / num27; + vector6.X += num25 * num27; + vector6.Y += num26 * num27; + } + float rotation6 = (float)Math.Atan2((double)num26, (double)num25) - 1.57f; + Color color6 = Lighting.GetColor((int)vector6.X / 16, (int)(vector6.Y / 16f)); + this.spriteBatch.Draw(Main.boneArmTexture, new Vector2(vector6.X - Main.screenPosition.X, vector6.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.boneArmTexture.Width, Main.boneArmTexture.Height)), color6, rotation6, new Vector2((float)Main.boneArmTexture.Width * 0.5f, (float)Main.boneArmTexture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + if (k == 0) + { + vector6.X += num25 * num27 / 2f; + vector6.Y += num26 * num27 / 2f; + } + else + { + if (base.IsActive) + { + vector6.X += num25 * num27 - 16f; + vector6.Y += num26 * num27 - 6f; + int num28 = Dust.NewDust(new Vector2(vector6.X, vector6.Y), 30, 10, 5, num25 * 0.02f, num26 * 0.02f, 0, default(Color), 2f); + Main.dust[num28].noGravity = true; + } + } + } + } + if (Main.npc[i].aiStyle == 47) + { + Vector2 vector7 = new Vector2(Main.npc[i].center().X, Main.npc[i].center().Y); + float num29 = Main.npc[NPC.golemBoss].center().X - vector7.X; + float num30 = Main.npc[NPC.golemBoss].center().Y - vector7.Y; + num30 -= 7f; + if (Main.npc[i].type == 247) + { + num29 -= 70f; + } + else + { + num29 += 66f; + } + float rotation7 = (float)Math.Atan2((double)num30, (double)num29) - 1.57f; + bool flag8 = true; + while (flag8) + { + float num31 = (float)Math.Sqrt((double)(num29 * num29 + num30 * num30)); + if (num31 < 16f) + { + flag8 = false; + } + else + { + num31 = 16f / num31; + num29 *= num31; + num30 *= num31; + vector7.X += num29; + vector7.Y += num30; + num29 = Main.npc[NPC.golemBoss].center().X - vector7.X; + num30 = Main.npc[NPC.golemBoss].center().Y - vector7.Y; + num30 -= 7f; + if (Main.npc[i].type == 247) + { + num29 -= 70f; + } + else + { + num29 += 66f; + } + Color color7 = Lighting.GetColor((int)vector7.X / 16, (int)(vector7.Y / 16f)); + this.spriteBatch.Draw(Main.chain21Texture, new Vector2(vector7.X - Main.screenPosition.X, vector7.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain21Texture.Width, Main.chain21Texture.Height)), color7, rotation7, new Vector2((float)Main.chain21Texture.Width * 0.5f, (float)Main.chain21Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + if (Main.npc[i].aiStyle >= 33 && Main.npc[i].aiStyle <= 36) + { + Vector2 vector8 = new Vector2(Main.npc[i].position.X + (float)Main.npc[i].width * 0.5f - 5f * Main.npc[i].ai[0], Main.npc[i].position.Y + 20f); + for (int l = 0; l < 2; l++) + { + float num32 = Main.npc[(int)Main.npc[i].ai[1]].position.X + (float)(Main.npc[(int)Main.npc[i].ai[1]].width / 2) - vector8.X; + float num33 = Main.npc[(int)Main.npc[i].ai[1]].position.Y + (float)(Main.npc[(int)Main.npc[i].ai[1]].height / 2) - vector8.Y; + float num34; + if (l == 0) + { + num32 -= 200f * Main.npc[i].ai[0]; + num33 += 130f; + num34 = (float)Math.Sqrt((double)(num32 * num32 + num33 * num33)); + num34 = 92f / num34; + vector8.X += num32 * num34; + vector8.Y += num33 * num34; + } + else + { + num32 -= 50f * Main.npc[i].ai[0]; + num33 += 80f; + num34 = (float)Math.Sqrt((double)(num32 * num32 + num33 * num33)); + num34 = 60f / num34; + vector8.X += num32 * num34; + vector8.Y += num33 * num34; + } + float rotation8 = (float)Math.Atan2((double)num33, (double)num32) - 1.57f; + Color color8 = Lighting.GetColor((int)vector8.X / 16, (int)(vector8.Y / 16f)); + this.spriteBatch.Draw(Main.boneArm2Texture, new Vector2(vector8.X - Main.screenPosition.X, vector8.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.boneArmTexture.Width, Main.boneArmTexture.Height)), color8, rotation8, new Vector2((float)Main.boneArmTexture.Width * 0.5f, (float)Main.boneArmTexture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + if (l == 0) + { + vector8.X += num32 * num34 / 2f; + vector8.Y += num33 * num34 / 2f; + } + else + { + if (base.IsActive) + { + vector8.X += num32 * num34 - 16f; + vector8.Y += num33 * num34 - 6f; + int num35 = Dust.NewDust(new Vector2(vector8.X, vector8.Y), 30, 10, 6, num32 * 0.02f, num33 * 0.02f, 0, default(Color), 2.5f); + Main.dust[num35].noGravity = true; + } + } + } + } + if (Main.npc[i].aiStyle == 20) + { + Vector2 vector9 = new Vector2(Main.npc[i].position.X + (float)(Main.npc[i].width / 2), Main.npc[i].position.Y + (float)(Main.npc[i].height / 2)); + float num36 = Main.npc[i].ai[1] - vector9.X; + float num37 = Main.npc[i].ai[2] - vector9.Y; + float num38 = (float)Math.Atan2((double)num37, (double)num36) - 1.57f; + Main.npc[i].rotation = num38; + bool flag9 = true; + while (flag9) + { + int height2 = 12; + float num39 = (float)Math.Sqrt((double)(num36 * num36 + num37 * num37)); + if (num39 < 20f) + { + height2 = (int)num39 - 20 + 12; + flag9 = false; + } + num39 = 12f / num39; + num36 *= num39; + num37 *= num39; + vector9.X += num36; + vector9.Y += num37; + num36 = Main.npc[i].ai[1] - vector9.X; + num37 = Main.npc[i].ai[2] - vector9.Y; + Color color9 = Lighting.GetColor((int)vector9.X / 16, (int)(vector9.Y / 16f)); + this.spriteBatch.Draw(Main.chainTexture, new Vector2(vector9.X - Main.screenPosition.X, vector9.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chainTexture.Width, height2)), color9, num38, new Vector2((float)Main.chainTexture.Width * 0.5f, (float)Main.chainTexture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + this.spriteBatch.Draw(Main.spikeBaseTexture, new Vector2(Main.npc[i].ai[1] - Main.screenPosition.X, Main.npc[i].ai[2] - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.spikeBaseTexture.Width, Main.spikeBaseTexture.Height)), Lighting.GetColor((int)Main.npc[i].ai[1] / 16, (int)(Main.npc[i].ai[2] / 16f)), num38 - 0.75f, new Vector2((float)Main.spikeBaseTexture.Width * 0.5f, (float)Main.spikeBaseTexture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + Color color10 = Lighting.GetColor((int)((double)Main.npc[i].position.X + (double)Main.npc[i].width * 0.5) / 16, (int)(((double)Main.npc[i].position.Y + (double)Main.npc[i].height * 0.5) / 16.0)); + if (Main.npc[i].type >= 277 && Main.npc[i].type <= 280) + { + if (color10.R < 255) + { + color10.R = 255; + } + if (color10.G < 175) + { + color10.G = 175; + } + } + if (behindTiles && Main.npc[i].type != 113 && Main.npc[i].type != 114) + { + int num40 = (int)((Main.npc[i].position.X - 8f) / 16f); + int num41 = (int)((Main.npc[i].position.X + (float)Main.npc[i].width + 8f) / 16f); + int num42 = (int)((Main.npc[i].position.Y - 8f) / 16f); + int num43 = (int)((Main.npc[i].position.Y + (float)Main.npc[i].height + 8f) / 16f); + for (int m = num40; m <= num41; m++) + { + for (int n = num42; n <= num43; n++) + { + if (Lighting.Brightness(m, n) == 0f) + { + color10 = Color.Black; + } + } + } + } + float num44 = 1f; + float num45 = 1f; + float num46 = 1f; + float num47 = 1f; + if (Main.npc[i].poisoned) + { + if (Main.rand.Next(30) == 0) + { + int num48 = Dust.NewDust(Main.npc[i].position, Main.npc[i].width, Main.npc[i].height, 46, 0f, 0f, 120, default(Color), 0.2f); + Main.dust[num48].noGravity = true; + Main.dust[num48].fadeIn = 1.9f; + } + num44 *= 0.65f; + num46 *= 0.75f; + color10 = Main.buffColor(color10, num44, num45, num46, num47); + } + if (Main.npc[i].venom) + { + if (Main.rand.Next(10) == 0) + { + int num49 = Dust.NewDust(Main.npc[i].position, Main.npc[i].width, Main.npc[i].height, 171, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num49].noGravity = true; + Main.dust[num49].fadeIn = 1.5f; + } + num45 *= 0.45f; + num44 *= 0.75f; + color10 = Main.buffColor(color10, num44, num45, num46, num47); + } + if (Main.npc[i].midas) + { + num46 *= 0.3f; + num44 *= 0.85f; + color10 = Main.buffColor(color10, num44, num45, num46, num47); + } + if (Main.npc[i].onFire) + { + if (Main.rand.Next(4) < 3) + { + int num50 = Dust.NewDust(new Vector2(Main.npc[i].position.X - 2f, Main.npc[i].position.Y - 2f), Main.npc[i].width + 4, Main.npc[i].height + 4, 6, Main.npc[i].velocity.X * 0.4f, Main.npc[i].velocity.Y * 0.4f, 100, default(Color), 3.5f); + Main.dust[num50].noGravity = true; + Main.dust[num50].velocity *= 1.8f; + Dust expr_20BD_cp_0 = Main.dust[num50]; + expr_20BD_cp_0.velocity.Y = expr_20BD_cp_0.velocity.Y - 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[num50].noGravity = false; + Main.dust[num50].scale *= 0.5f; + } + } + Lighting.addLight((int)(Main.npc[i].position.X / 16f), (int)(Main.npc[i].position.Y / 16f + 1f), 1f, 0.3f, 0.1f); + } + if (Main.npc[i].ichor) + { + color10 = new Color(255, 255, 0, 255); + } + if (Main.npc[i].onFrostBurn) + { + if (Main.rand.Next(4) < 3) + { + int num51 = Dust.NewDust(new Vector2(Main.npc[i].position.X - 2f, Main.npc[i].position.Y - 2f), Main.npc[i].width + 4, Main.npc[i].height + 4, 135, Main.npc[i].velocity.X * 0.4f, Main.npc[i].velocity.Y * 0.4f, 100, default(Color), 3.5f); + Main.dust[num51].noGravity = true; + Main.dust[num51].velocity *= 1.8f; + Dust expr_2265_cp_0 = Main.dust[num51]; + expr_2265_cp_0.velocity.Y = expr_2265_cp_0.velocity.Y - 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[num51].noGravity = false; + Main.dust[num51].scale *= 0.5f; + } + } + Lighting.addLight((int)(Main.npc[i].position.X / 16f), (int)(Main.npc[i].position.Y / 16f + 1f), 0.1f, 0.6f, 1f); + } + if (Main.npc[i].onFire2) + { + if (Main.rand.Next(4) < 3) + { + int num52 = Dust.NewDust(new Vector2(Main.npc[i].position.X - 2f, Main.npc[i].position.Y - 2f), Main.npc[i].width + 4, Main.npc[i].height + 4, 75, Main.npc[i].velocity.X * 0.4f, Main.npc[i].velocity.Y * 0.4f, 100, default(Color), 3.5f); + Main.dust[num52].noGravity = true; + Main.dust[num52].velocity *= 1.8f; + Dust expr_23E5_cp_0 = Main.dust[num52]; + expr_23E5_cp_0.velocity.Y = expr_23E5_cp_0.velocity.Y - 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[num52].noGravity = false; + Main.dust[num52].scale *= 0.5f; + } + } + Lighting.addLight((int)(Main.npc[i].position.X / 16f), (int)(Main.npc[i].position.Y / 16f + 1f), 1f, 0.3f, 0.1f); + } + if (Main.player[Main.myPlayer].detectCreature && Main.npc[i].lifeMax > 1) + { + if (color10.R < 150) + { + color10.A = Main.mouseTextColor; + } + if (color10.R < 50) + { + color10.R = 50; + } + if (color10.G < 200) + { + color10.G = 200; + } + if (color10.B < 100) + { + color10.B = 100; + } + if (!Main.gamePaused && base.IsActive && Main.rand.Next(50) == 0) + { + int num53 = Dust.NewDust(new Vector2(Main.npc[i].position.X, Main.npc[i].position.Y), Main.npc[i].width, Main.npc[i].height, 15, 0f, 0f, 150, default(Color), 0.8f); + Main.dust[num53].velocity *= 0.1f; + Main.dust[num53].noLight = true; + } + } + if (Main.npc[i].type == 50) + { + Vector2 vector10 = default(Vector2); + float num54 = 0f; + vector10.Y -= Main.npc[i].velocity.Y; + vector10.X -= Main.npc[i].velocity.X * 2f; + num54 += Main.npc[i].velocity.X * 0.05f; + if (Main.npc[i].frame.Y == 120) + { + vector10.Y += 2f; + } + if (Main.npc[i].frame.Y == 360) + { + vector10.Y -= 2f; + } + if (Main.npc[i].frame.Y == 480) + { + vector10.Y -= 6f; + } + this.spriteBatch.Draw(Main.ninjaTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) + vector10.X, Main.npc[i].position.Y - Main.screenPosition.Y + (float)(Main.npc[i].height / 2) + vector10.Y), new Rectangle?(new Rectangle(0, 0, Main.ninjaTexture.Width, Main.ninjaTexture.Height)), color10, num54, new Vector2((float)(Main.ninjaTexture.Width / 2), (float)(Main.ninjaTexture.Height / 2)), 1f, SpriteEffects.None, 0f); + } + if (Main.npc[i].type == 71) + { + Vector2 vector11 = default(Vector2); + float num55 = 0f; + vector11.Y -= Main.npc[i].velocity.Y * 0.3f; + vector11.X -= Main.npc[i].velocity.X * 0.6f; + num55 += Main.npc[i].velocity.X * 0.09f; + if (Main.npc[i].frame.Y == 120) + { + vector11.Y += 2f; + } + if (Main.npc[i].frame.Y == 360) + { + vector11.Y -= 2f; + } + if (Main.npc[i].frame.Y == 480) + { + vector11.Y -= 6f; + } + this.spriteBatch.Draw(Main.itemTexture[327], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) + vector11.X, Main.npc[i].position.Y - Main.screenPosition.Y + (float)(Main.npc[i].height / 2) + vector11.Y), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[327].Width, Main.itemTexture[327].Height)), color10, num55, new Vector2((float)(Main.itemTexture[327].Width / 2), (float)(Main.itemTexture[327].Height / 2)), 1f, SpriteEffects.None, 0f); + } + if (Main.npc[i].type == 69) + { + this.spriteBatch.Draw(Main.antLionTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2), Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height + 14f), new Rectangle?(new Rectangle(0, 0, Main.antLionTexture.Width, Main.antLionTexture.Height)), color10, -Main.npc[i].rotation * 0.3f, new Vector2((float)(Main.antLionTexture.Width / 2), (float)(Main.antLionTexture.Height / 2)), 1f, SpriteEffects.None, 0f); + } + float num56 = 0f; + float num57 = Main.NPCAddHeight(i); + Vector2 origin = new Vector2((float)(Main.npcTexture[Main.npc[i].type].Width / 2), (float)(Main.npcTexture[Main.npc[i].type].Height / Main.npcFrameCount[Main.npc[i].type] / 2)); + if (Main.npc[i].type == 108 || Main.npc[i].type == 124) + { + num56 = 2f; + } + if (Main.npc[i].type == 4) + { + origin = new Vector2(55f, 107f); + } + else + { + if (Main.npc[i].type == 125) + { + origin = new Vector2(55f, 107f); + } + else + { + if (Main.npc[i].type == 126) + { + origin = new Vector2(55f, 107f); + } + else + { + if (Main.npc[i].type == 63 || Main.npc[i].type == 64 || Main.npc[i].type == 103) + { + origin.Y += 4f; + } + else + { + if (Main.npc[i].type == 69) + { + origin.Y += 8f; + } + else + { + if (Main.npc[i].type == 262) + { + origin.Y = 77f; + num57 += 26f; + } + else + { + if (Main.npc[i].type == 264) + { + origin.Y = 21f; + num57 += 2f; + } + else + { + if (Main.npc[i].type == 266) + { + num57 += 50f; + } + else + { + if (Main.npc[i].type == 268) + { + num57 += 16f; + } + else + { + if (Main.npc[i].type == 288) + { + num57 += 6f; + } + } + } + } + } + } + } + } + } + } + if (Main.npc[i].aiStyle == 10 || Main.npc[i].type == 72) + { + color10 = Color.White; + } + SpriteEffects effects = SpriteEffects.None; + if (Main.npc[i].spriteDirection == 1) + { + effects = SpriteEffects.FlipHorizontally; + } + if (Main.npc[i].type == 83 || Main.npc[i].type == 84 || Main.npc[i].type == 179) + { + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), Color.White, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + else + { + if (Main.npc[i].type >= 87 && Main.npc[i].type <= 92) + { + Color alpha = Main.npc[i].GetAlpha(color10); + byte b = (byte)((Main.tileColor.R + Main.tileColor.G + Main.tileColor.B) / 3); + if (alpha.R < b) + { + alpha.R = b; + } + if (alpha.G < b) + { + alpha.G = b; + } + if (alpha.B < b) + { + alpha.B = b; + } + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), alpha, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + else + { + if (Main.npc[i].type == 94) + { + for (int num58 = 1; num58 < 6; num58 += 2) + { + Vector2 arg_303D_0 = Main.npc[i].oldPos[num58]; + Color alpha2 = Main.npc[i].GetAlpha(color10); + alpha2.R = (byte)((int)alpha2.R * (10 - num58) / 15); + alpha2.G = (byte)((int)alpha2.G * (10 - num58) / 15); + alpha2.B = (byte)((int)alpha2.B * (10 - num58) / 15); + alpha2.A = (byte)((int)alpha2.A * (10 - num58) / 15); + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].oldPos[num58].X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].oldPos[num58].Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57), new Rectangle?(Main.npc[i].frame), alpha2, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + } + if (Main.npc[i].type == 125 || Main.npc[i].type == 126 || Main.npc[i].type == 127 || Main.npc[i].type == 128 || Main.npc[i].type == 129 || Main.npc[i].type == 130 || Main.npc[i].type == 131 || Main.npc[i].type == 139 || Main.npc[i].type == 140) + { + for (int num59 = 9; num59 >= 0; num59 -= 2) + { + Vector2 arg_32DB_0 = Main.npc[i].oldPos[num59]; + Color alpha3 = Main.npc[i].GetAlpha(color10); + alpha3.R = (byte)((int)alpha3.R * (10 - num59) / 20); + alpha3.G = (byte)((int)alpha3.G * (10 - num59) / 20); + alpha3.B = (byte)((int)alpha3.B * (10 - num59) / 20); + alpha3.A = (byte)((int)alpha3.A * (10 - num59) / 20); + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].oldPos[num59].X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].oldPos[num59].Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57), new Rectangle?(Main.npc[i].frame), alpha3, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + } + Rectangle frame = Main.npc[i].frame; + if (Main.npc[i].type == 182 || Main.npc[i].type == 289) + { + frame.Height -= 2; + } + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56 + Main.npc[i].gfxOffY), new Rectangle?(frame), Main.npc[i].GetAlpha(color10), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + if (Main.npc[i].color != default(Color)) + { + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56 + Main.npc[i].gfxOffY), new Rectangle?(frame), Main.npc[i].GetColor(color10), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + if (Main.npc[i].confused) + { + this.spriteBatch.Draw(Main.confuseTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56 - (float)Main.confuseTexture.Height - 20f), new Rectangle?(new Rectangle(0, 0, Main.confuseTexture.Width, Main.confuseTexture.Height)), new Color(250, 250, 250, 70), Main.npc[i].velocity.X * -0.05f, new Vector2((float)(Main.confuseTexture.Width / 2), (float)(Main.confuseTexture.Height / 2)), Main.essScale + 0.2f, SpriteEffects.None, 0f); + } + if (Main.npc[i].type >= 134 && Main.npc[i].type <= 136 && color10 != Color.Black) + { + this.spriteBatch.Draw(Main.destTexture[Main.npc[i].type - 134], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), new Color(255, 255, 255, 0), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + if (Main.npc[i].type == 125) + { + this.spriteBatch.Draw(Main.EyeLaserTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), new Color(255, 255, 255, 0), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + if (Main.npc[i].type == 139) + { + this.spriteBatch.Draw(Main.probeTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), new Color(255, 255, 255, 0), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + if (Main.npc[i].type == 127) + { + this.spriteBatch.Draw(Main.BoneEyesTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), new Color(200, 200, 200, 0), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + if (Main.npc[i].type == 131) + { + this.spriteBatch.Draw(Main.BoneLaserTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56), new Rectangle?(Main.npc[i].frame), new Color(200, 200, 200, 0), Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + if (Main.npc[i].type == 120) + { + for (int num60 = 1; num60 < Main.npc[i].oldPos.Length; num60++) + { + Vector2 arg_40C0_0 = Main.npc[i].oldPos[num60]; + Color color11 = default(Color); + color11.R = (byte)(150 * (10 - num60) / 15); + color11.G = (byte)(100 * (10 - num60) / 15); + color11.B = (byte)(150 * (10 - num60) / 15); + color11.A = (byte)(50 * (10 - num60) / 15); + this.spriteBatch.Draw(Main.chaosTexture, new Vector2(Main.npc[i].oldPos[num60].X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].oldPos[num60].Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57), new Rectangle?(Main.npc[i].frame), color11, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + } + else + { + if (Main.npc[i].type == 137 || Main.npc[i].type == 138) + { + for (int num61 = 1; num61 < Main.npc[i].oldPos.Length; num61++) + { + Vector2 arg_42CA_0 = Main.npc[i].oldPos[num61]; + Color color12 = default(Color); + color12.R = (byte)(150 * (10 - num61) / 15); + color12.G = (byte)(100 * (10 - num61) / 15); + color12.B = (byte)(150 * (10 - num61) / 15); + color12.A = (byte)(50 * (10 - num61) / 15); + this.spriteBatch.Draw(Main.npcTexture[Main.npc[i].type], new Vector2(Main.npc[i].oldPos[num61].X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].oldPos[num61].Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57), new Rectangle?(Main.npc[i].frame), color12, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + } + else + { + if (Main.npc[i].type == 82) + { + this.spriteBatch.Draw(Main.wraithEyeTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57), new Rectangle?(Main.npc[i].frame), Color.White, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + for (int num62 = 1; num62 < 10; num62++) + { + Color color13 = new Color(110 - num62 * 10, 110 - num62 * 10, 110 - num62 * 10, 110 - num62 * 10); + this.spriteBatch.Draw(Main.wraithEyeTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57) - Main.npc[i].velocity * (float)num62 * 0.5f, new Rectangle?(Main.npc[i].frame), color13, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + } + else + { + if (Main.npc[i].type == 253) + { + this.spriteBatch.Draw(Main.reaperEyeTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 3f + origin.Y * Main.npc[i].scale + num57), new Rectangle?(Main.npc[i].frame), Color.White, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + for (int num63 = 1; num63 < 20; num63++) + { + Color color14 = new Color(210 - num63 * 20, 210 - num63 * 20, 210 - num63 * 20, 210 - num63 * 20); + this.spriteBatch.Draw(Main.reaperEyeTexture, new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 3f + origin.Y * Main.npc[i].scale + num57) - Main.npc[i].velocity * (float)num63 * 0.5f, new Rectangle?(Main.npc[i].frame), color14, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + } + else + { + if (Main.npc[i].type == 245 && Main.npc[i].alpha == 0) + { + Color color15 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, 0); + this.spriteBatch.Draw(Main.golemTexture[3], new Vector2(Main.npc[i].position.X - Main.screenPosition.X + (float)(Main.npc[i].width / 2) - (float)Main.npcTexture[Main.npc[i].type].Width * Main.npc[i].scale / 2f + origin.X * Main.npc[i].scale, Main.npc[i].position.Y - Main.screenPosition.Y + (float)Main.npc[i].height - (float)Main.npcTexture[Main.npc[i].type].Height * Main.npc[i].scale / (float)Main.npcFrameCount[Main.npc[i].type] + 4f + origin.Y * Main.npc[i].scale + num57 + num56 + Main.npc[i].gfxOffY), new Rectangle?(frame), color15, Main.npc[i].rotation, origin, Main.npc[i].scale, effects, 0f); + } + else + { + if (Main.npc[i].type == 246) + { + Color color16 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, 0); + if (Main.npc[i].frame.Y < 222) + { + this.spriteBatch.Draw(Main.golemTexture[1], new Vector2(Main.npc[i].center().X - Main.screenPosition.X - 20f, Main.npc[i].center().Y - Main.screenPosition.Y - 27f), new Rectangle?(new Rectangle(0, 0, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2)), color16, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.npc[i].frame.Y < 444) + { + this.spriteBatch.Draw(Main.golemTexture[2], new Vector2(Main.npc[i].center().X - Main.screenPosition.X + 26f, Main.npc[i].center().Y - Main.screenPosition.Y - 28f), new Rectangle?(new Rectangle(0, 0, Main.golemTexture[2].Width, Main.golemTexture[2].Height / 4)), color16, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.golemTexture[2], new Vector2(Main.npc[i].center().X - Main.screenPosition.X - 38f, Main.npc[i].center().Y - Main.screenPosition.Y - 28f), new Rectangle?(new Rectangle(0, Main.golemTexture[2].Height / 2, Main.golemTexture[2].Width, Main.golemTexture[2].Height / 4)), color16, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + else + { + if (Main.npc[i].type == 249) + { + Color color17 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, 0); + this.spriteBatch.Draw(Main.golemTexture[1], new Vector2(Main.npc[i].center().X - Main.screenPosition.X - 20f, Main.npc[i].center().Y - Main.screenPosition.Y - 47f), new Rectangle?(new Rectangle(0, 0, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2)), color17, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + } + } + } + } + } + } + } + } + catch + { + Main.npc[i].active = false; + } + } + } + protected void DrawProj(int i) + { + this.LoadProjectile(Main.projectile[i].type); + if (Main.projectile[i].type == 32) + { + Vector2 vector = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector.X; + float num2 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector.Y; + float rotation = (float)Math.Atan2((double)num2, (double)num) - 1.57f; + bool flag = true; + if (num == 0f && num2 == 0f) + { + flag = false; + } + else + { + float num3 = (float)Math.Sqrt((double)(num * num + num2 * num2)); + num3 = 8f / num3; + num *= num3; + num2 *= num3; + vector.X -= num; + vector.Y -= num2; + num = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector.X; + num2 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector.Y; + } + while (flag) + { + float num4 = (float)Math.Sqrt((double)(num * num + num2 * num2)); + if (num4 < 28f) + { + flag = false; + } + else + { + if (num4 == float.NaN) + { + flag = false; + } + else + { + num4 = 28f / num4; + num *= num4; + num2 *= num4; + vector.X += num; + vector.Y += num2; + num = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector.X; + num2 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector.Y; + Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f)); + this.spriteBatch.Draw(Main.chain5Texture, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain5Texture.Width, Main.chain5Texture.Height)), color, rotation, new Vector2((float)Main.chain5Texture.Width * 0.5f, (float)Main.chain5Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 73) + { + Vector2 vector2 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num5 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector2.X; + float num6 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector2.Y; + float rotation2 = (float)Math.Atan2((double)num6, (double)num5) - 1.57f; + bool flag2 = true; + while (flag2) + { + float num7 = (float)Math.Sqrt((double)(num5 * num5 + num6 * num6)); + if (num7 < 25f) + { + flag2 = false; + } + else + { + if (num7 == float.NaN) + { + flag2 = false; + } + else + { + num7 = 12f / num7; + num5 *= num7; + num6 *= num7; + vector2.X += num5; + vector2.Y += num6; + num5 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector2.X; + num6 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector2.Y; + Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f)); + this.spriteBatch.Draw(Main.chain8Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain8Texture.Width, Main.chain8Texture.Height)), color2, rotation2, new Vector2((float)Main.chain8Texture.Width * 0.5f, (float)Main.chain8Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 186) + { + float num8 = Main.projectile[i].ai[1]; + float num9 = Main.projectile[i].position.Y - num8; + float num10 = (float)Main.chain17Texture.Height - num9; + Color color3 = Lighting.GetColor((int)Main.projectile[i].position.X / 16, (int)Main.projectile[i].position.Y / 16); + this.spriteBatch.Draw(Main.chain17Texture, new Vector2(Main.projectile[i].position.X - Main.screenPosition.X, num8 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, (int)num10, Main.chain17Texture.Width, (int)num9)), color3, 0f, new Vector2(0f, 0f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.projectile[i].type == 74) + { + Vector2 vector3 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num11 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector3.X; + float num12 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector3.Y; + float rotation3 = (float)Math.Atan2((double)num12, (double)num11) - 1.57f; + bool flag3 = true; + while (flag3) + { + float num13 = (float)Math.Sqrt((double)(num11 * num11 + num12 * num12)); + if (num13 < 25f) + { + flag3 = false; + } + else + { + if (num13 == float.NaN) + { + flag3 = false; + } + else + { + num13 = 12f / num13; + num11 *= num13; + num12 *= num13; + vector3.X += num11; + vector3.Y += num12; + num11 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector3.X; + num12 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector3.Y; + Color color4 = Lighting.GetColor((int)vector3.X / 16, (int)(vector3.Y / 16f)); + this.spriteBatch.Draw(Main.chain9Texture, new Vector2(vector3.X - Main.screenPosition.X, vector3.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain8Texture.Width, Main.chain8Texture.Height)), color4, rotation3, new Vector2((float)Main.chain8Texture.Width * 0.5f, (float)Main.chain8Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 171) + { + Vector2 vector4 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num14 = -Main.projectile[i].velocity.X; + float num15 = -Main.projectile[i].velocity.Y; + float num16 = 1f; + if (Main.projectile[i].ai[0] <= 17f) + { + num16 = Main.projectile[i].ai[0] / 17f; + } + int num17 = (int)(30f * num16); + float num18 = 1f; + if (Main.projectile[i].ai[0] <= 30f) + { + num18 = Main.projectile[i].ai[0] / 30f; + } + float num19 = 0.4f * num18; + float num20 = num19; + num15 += num20; + Vector2[] array = new Vector2[num17]; + float[] array2 = new float[num17]; + for (int j = 0; j < num17; j++) + { + float num21 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15)); + float num22 = 5.6f; + if (Math.Abs(num14) + Math.Abs(num15) < 1f) + { + num22 *= Math.Abs(num14) + Math.Abs(num15) / 1f; + } + num21 = num22 / num21; + num14 *= num21; + num15 *= num21; + float num23 = (float)Math.Atan2((double)num15, (double)num14) - 1.57f; + array[j].X = vector4.X; + array[j].Y = vector4.Y; + array2[j] = num23; + vector4.X += num14; + vector4.Y += num15; + num14 = -Main.projectile[i].velocity.X; + num15 = -Main.projectile[i].velocity.Y; + num20 += num19; + num15 += num20; + } + for (int k = num17 - 1; k >= 0; k--) + { + vector4.X = array[k].X; + vector4.Y = array[k].Y; + float rotation4 = array2[k]; + Color color5 = Lighting.GetColor((int)vector4.X / 16, (int)(vector4.Y / 16f)); + this.spriteBatch.Draw(Main.chain16Texture, new Vector2(vector4.X - Main.screenPosition.X, vector4.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain16Texture.Width, Main.chain16Texture.Height)), color5, rotation4, new Vector2((float)Main.chain16Texture.Width * 0.5f, (float)Main.chain16Texture.Height * 0.5f), 0.8f, SpriteEffects.None, 0f); + } + } + else + { + if (Main.projectile[i].type == 165) + { + Vector2 vector5 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num24 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector5.X; + float num25 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector5.Y; + float rotation5 = (float)Math.Atan2((double)num25, (double)num24) - 1.57f; + bool flag4 = true; + while (flag4) + { + float num26 = (float)Math.Sqrt((double)(num24 * num24 + num25 * num25)); + if (num26 < 25f) + { + flag4 = false; + } + else + { + if (num26 == float.NaN) + { + flag4 = false; + } + else + { + num26 = 24f / num26; + num24 *= num26; + num25 *= num26; + vector5.X += num24; + vector5.Y += num25; + num24 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector5.X; + num25 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector5.Y; + Color color6 = Lighting.GetColor((int)vector5.X / 16, (int)(vector5.Y / 16f)); + this.spriteBatch.Draw(Main.chain15Texture, new Vector2(vector5.X - Main.screenPosition.X, vector5.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain15Texture.Width, Main.chain15Texture.Height)), color6, rotation5, new Vector2((float)Main.chain15Texture.Width * 0.5f, (float)Main.chain15Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type >= 230 && Main.projectile[i].type <= 235) + { + int num27 = Main.projectile[i].type - 229; + Vector2 vector6 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num28 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector6.X; + float num29 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector6.Y; + float rotation6 = (float)Math.Atan2((double)num29, (double)num28) - 1.57f; + bool flag5 = true; + while (flag5) + { + float num30 = (float)Math.Sqrt((double)(num28 * num28 + num29 * num29)); + if (num30 < 25f) + { + flag5 = false; + } + else + { + if (num30 == float.NaN) + { + flag5 = false; + } + else + { + num30 = (float)Main.gemChainTexture[num27].Height / num30; + num28 *= num30; + num29 *= num30; + vector6.X += num28; + vector6.Y += num29; + num28 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector6.X; + num29 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector6.Y; + Color color7 = Lighting.GetColor((int)vector6.X / 16, (int)(vector6.Y / 16f)); + this.spriteBatch.Draw(Main.gemChainTexture[num27], new Vector2(vector6.X - Main.screenPosition.X, vector6.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.gemChainTexture[num27].Width, Main.gemChainTexture[num27].Height)), color7, rotation6, new Vector2((float)Main.gemChainTexture[num27].Width * 0.5f, (float)Main.gemChainTexture[num27].Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 256) + { + Vector2 vector7 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num31 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector7.X; + float num32 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector7.Y; + float num33 = (float)Math.Atan2((double)num32, (double)num31) - 1.57f; + bool flag6 = true; + while (flag6) + { + float num34 = (float)Math.Sqrt((double)(num31 * num31 + num32 * num32)); + if (num34 < 26f) + { + flag6 = false; + } + else + { + if (num34 == float.NaN) + { + flag6 = false; + } + else + { + num34 = 26f / num34; + num31 *= num34; + num32 *= num34; + vector7.X += num31; + vector7.Y += num32; + num31 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector7.X; + num32 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector7.Y; + Color color8 = Lighting.GetColor((int)vector7.X / 16, (int)(vector7.Y / 16f)); + this.spriteBatch.Draw(Main.chain20Texture, new Vector2(vector7.X - Main.screenPosition.X, vector7.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain20Texture.Width, Main.chain20Texture.Height)), color8, num33 - 0.785f, new Vector2((float)Main.chain20Texture.Width * 0.5f, (float)Main.chain20Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].aiStyle == 7) + { + Vector2 vector8 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num35 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector8.X; + float num36 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector8.Y; + float rotation7 = (float)Math.Atan2((double)num36, (double)num35) - 1.57f; + bool flag7 = true; + while (flag7) + { + float num37 = (float)Math.Sqrt((double)(num35 * num35 + num36 * num36)); + if (num37 < 25f) + { + flag7 = false; + } + else + { + if (num37 == float.NaN) + { + flag7 = false; + } + else + { + num37 = 12f / num37; + num35 *= num37; + num36 *= num37; + vector8.X += num35; + vector8.Y += num36; + num35 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector8.X; + num36 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector8.Y; + Color color9 = Lighting.GetColor((int)vector8.X / 16, (int)(vector8.Y / 16f)); + this.spriteBatch.Draw(Main.chainTexture, new Vector2(vector8.X - Main.screenPosition.X, vector8.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chainTexture.Width, Main.chainTexture.Height)), color9, rotation7, new Vector2((float)Main.chainTexture.Width * 0.5f, (float)Main.chainTexture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 262) + { + float num38 = Main.projectile[i].center().X; + float num39 = Main.projectile[i].center().Y; + float num40 = Main.projectile[i].velocity.X; + float num41 = Main.projectile[i].velocity.Y; + float num42 = (float)Math.Sqrt((double)(num40 * num40 + num41 * num41)); + num42 = 4f / num42; + if (Main.projectile[i].ai[0] == 0f) + { + num38 -= Main.projectile[i].velocity.X * num42; + num39 -= Main.projectile[i].velocity.Y * num42; + } + else + { + num38 += Main.projectile[i].velocity.X * num42; + num39 += Main.projectile[i].velocity.Y * num42; + } + Vector2 vector9 = new Vector2(num38, num39); + num40 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector9.X; + num41 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector9.Y; + float rotation8 = (float)Math.Atan2((double)num41, (double)num40) - 1.57f; + if (Main.projectile[i].alpha == 0) + { + int num43 = -1; + if (Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2) < Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2)) + { + num43 = 1; + } + if (Main.player[Main.projectile[i].owner].direction == 1) + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num41 * (float)num43), (double)(num40 * (float)num43)); + } + else + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num41 * (float)num43), (double)(num40 * (float)num43)); + } + } + bool flag8 = true; + while (flag8) + { + float num44 = (float)Math.Sqrt((double)(num40 * num40 + num41 * num41)); + if (num44 < 25f) + { + flag8 = false; + } + else + { + if (num44 == float.NaN) + { + flag8 = false; + } + else + { + num44 = 12f / num44; + num40 *= num44; + num41 *= num44; + vector9.X += num40; + vector9.Y += num41; + num40 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector9.X; + num41 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector9.Y; + Color color10 = Lighting.GetColor((int)vector9.X / 16, (int)(vector9.Y / 16f)); + this.spriteBatch.Draw(Main.chain22Texture, new Vector2(vector9.X - Main.screenPosition.X, vector9.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain22Texture.Width, Main.chain22Texture.Height)), color10, rotation8, new Vector2((float)Main.chain22Texture.Width * 0.5f, (float)Main.chain22Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 273) + { + float num45 = Main.projectile[i].center().X; + float num46 = Main.projectile[i].center().Y; + float num47 = Main.projectile[i].velocity.X; + float num48 = Main.projectile[i].velocity.Y; + float num49 = (float)Math.Sqrt((double)(num47 * num47 + num48 * num48)); + num49 = 4f / num49; + if (Main.projectile[i].ai[0] == 0f) + { + num45 -= Main.projectile[i].velocity.X * num49; + num46 -= Main.projectile[i].velocity.Y * num49; + } + else + { + num45 += Main.projectile[i].velocity.X * num49; + num46 += Main.projectile[i].velocity.Y * num49; + } + Vector2 vector10 = new Vector2(num45, num46); + num47 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector10.X; + num48 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector10.Y; + float rotation9 = (float)Math.Atan2((double)num48, (double)num47) - 1.57f; + if (Main.projectile[i].alpha == 0) + { + int num50 = -1; + if (Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2) < Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2)) + { + num50 = 1; + } + if (Main.player[Main.projectile[i].owner].direction == 1) + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num48 * (float)num50), (double)(num47 * (float)num50)); + } + else + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num48 * (float)num50), (double)(num47 * (float)num50)); + } + } + bool flag9 = true; + while (flag9) + { + float num51 = (float)Math.Sqrt((double)(num47 * num47 + num48 * num48)); + if (num51 < 25f) + { + flag9 = false; + } + else + { + if (num51 == float.NaN) + { + flag9 = false; + } + else + { + num51 = 12f / num51; + num47 *= num51; + num48 *= num51; + vector10.X += num47; + vector10.Y += num48; + num47 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector10.X; + num48 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector10.Y; + Color color11 = Lighting.GetColor((int)vector10.X / 16, (int)(vector10.Y / 16f)); + this.spriteBatch.Draw(Main.chain23Texture, new Vector2(vector10.X - Main.screenPosition.X, vector10.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain23Texture.Width, Main.chain23Texture.Height)), color11, rotation9, new Vector2((float)Main.chain23Texture.Width * 0.5f, (float)Main.chain23Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 271) + { + float num52 = Main.projectile[i].center().X; + float num53 = Main.projectile[i].center().Y; + float num54 = Main.projectile[i].velocity.X; + float num55 = Main.projectile[i].velocity.Y; + float num56 = (float)Math.Sqrt((double)(num54 * num54 + num55 * num55)); + num56 = 4f / num56; + if (Main.projectile[i].ai[0] == 0f) + { + num52 -= Main.projectile[i].velocity.X * num56; + num53 -= Main.projectile[i].velocity.Y * num56; + } + else + { + num52 += Main.projectile[i].velocity.X * num56; + num53 += Main.projectile[i].velocity.Y * num56; + } + Vector2 vector11 = new Vector2(num52, num53); + num54 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector11.X; + num55 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector11.Y; + float rotation10 = (float)Math.Atan2((double)num55, (double)num54) - 1.57f; + if (Main.projectile[i].alpha == 0) + { + int num57 = -1; + if (Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2) < Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2)) + { + num57 = 1; + } + if (Main.player[Main.projectile[i].owner].direction == 1) + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num55 * (float)num57), (double)(num54 * (float)num57)); + } + else + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num55 * (float)num57), (double)(num54 * (float)num57)); + } + } + bool flag10 = true; + while (flag10) + { + float num58 = (float)Math.Sqrt((double)(num54 * num54 + num55 * num55)); + if (num58 < 25f) + { + flag10 = false; + } + else + { + if (num58 == float.NaN) + { + flag10 = false; + } + else + { + num58 = 12f / num58; + num54 *= num58; + num55 *= num58; + vector11.X += num54; + vector11.Y += num55; + num54 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector11.X; + num55 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector11.Y; + Color color12 = Lighting.GetColor((int)vector11.X / 16, (int)(vector11.Y / 16f)); + this.spriteBatch.Draw(Main.chain18Texture, new Vector2(vector11.X - Main.screenPosition.X, vector11.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain18Texture.Width, Main.chain18Texture.Height)), color12, rotation10, new Vector2((float)Main.chain18Texture.Width * 0.5f, (float)Main.chain18Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].aiStyle == 13) + { + float num59 = Main.projectile[i].position.X + 8f; + float num60 = Main.projectile[i].position.Y + 2f; + float num61 = Main.projectile[i].velocity.X; + float num62 = Main.projectile[i].velocity.Y; + if (num61 == 0f && num62 == 0f) + { + num62 = 0.0001f; + } + float num63 = (float)Math.Sqrt((double)(num61 * num61 + num62 * num62)); + num63 = 20f / num63; + if (Main.projectile[i].ai[0] == 0f) + { + num59 -= Main.projectile[i].velocity.X * num63; + num60 -= Main.projectile[i].velocity.Y * num63; + } + else + { + num59 += Main.projectile[i].velocity.X * num63; + num60 += Main.projectile[i].velocity.Y * num63; + } + Vector2 vector12 = new Vector2(num59, num60); + num61 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector12.X; + num62 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector12.Y; + float rotation11 = (float)Math.Atan2((double)num62, (double)num61) - 1.57f; + if (Main.projectile[i].alpha == 0) + { + int num64 = -1; + if (Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2) < Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2)) + { + num64 = 1; + } + if (Main.player[Main.projectile[i].owner].direction == 1) + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num62 * (float)num64), (double)(num61 * (float)num64)); + } + else + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num62 * (float)num64), (double)(num61 * (float)num64)); + } + } + bool flag11 = true; + while (flag11) + { + float num65 = (float)Math.Sqrt((double)(num61 * num61 + num62 * num62)); + if (num65 < 25f) + { + flag11 = false; + } + else + { + if (num65 == float.NaN) + { + flag11 = false; + } + else + { + num65 = 12f / num65; + num61 *= num65; + num62 *= num65; + vector12.X += num61; + vector12.Y += num62; + num61 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector12.X; + num62 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector12.Y; + Color color13 = Lighting.GetColor((int)vector12.X / 16, (int)(vector12.Y / 16f)); + this.spriteBatch.Draw(Main.chainTexture, new Vector2(vector12.X - Main.screenPosition.X, vector12.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chainTexture.Width, Main.chainTexture.Height)), color13, rotation11, new Vector2((float)Main.chainTexture.Width * 0.5f, (float)Main.chainTexture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.projectile[i].type == 190) + { + float x = Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2); + float y = Main.projectile[i].position.Y + (float)(Main.projectile[i].height / 2); + float num66 = Main.projectile[i].velocity.X; + float num67 = Main.projectile[i].velocity.Y; + Math.Sqrt((double)(num66 * num66 + num67 * num67)); + Vector2 vector13 = new Vector2(x, y); + num66 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector13.X; + num67 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) + Main.player[Main.projectile[i].owner].gfxOffY - vector13.Y; + Math.Atan2((double)num67, (double)num66); + if (Main.projectile[i].alpha == 0) + { + int num68 = -1; + if (Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2) < Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2)) + { + num68 = 1; + } + if (Main.player[Main.projectile[i].owner].direction == 1) + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num67 * (float)num68), (double)(num66 * (float)num68)); + } + else + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num67 * (float)num68), (double)(num66 * (float)num68)); + } + } + } + else + { + if (Main.projectile[i].aiStyle == 15) + { + Vector2 vector14 = new Vector2(Main.projectile[i].position.X + (float)Main.projectile[i].width * 0.5f, Main.projectile[i].position.Y + (float)Main.projectile[i].height * 0.5f); + float num69 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector14.X; + float num70 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector14.Y; + float rotation12 = (float)Math.Atan2((double)num70, (double)num69) - 1.57f; + if (Main.projectile[i].alpha == 0) + { + int num71 = -1; + if (Main.projectile[i].position.X + (float)(Main.projectile[i].width / 2) < Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2)) + { + num71 = 1; + } + if (Main.player[Main.projectile[i].owner].direction == 1) + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num70 * (float)num71), (double)(num69 * (float)num71)); + } + else + { + Main.player[Main.projectile[i].owner].itemRotation = (float)Math.Atan2((double)(num70 * (float)num71), (double)(num69 * (float)num71)); + } + } + bool flag12 = true; + while (flag12) + { + float num72 = (float)Math.Sqrt((double)(num69 * num69 + num70 * num70)); + if (num72 < 25f) + { + flag12 = false; + } + else + { + if (num72 == float.NaN) + { + flag12 = false; + } + else + { + if (Main.projectile[i].type == 154 || Main.projectile[i].type == 247) + { + num72 = 18f / num72; + } + else + { + num72 = 12f / num72; + } + num69 *= num72; + num70 *= num72; + vector14.X += num69; + vector14.Y += num70; + num69 = Main.player[Main.projectile[i].owner].position.X + (float)(Main.player[Main.projectile[i].owner].width / 2) - vector14.X; + num70 = Main.player[Main.projectile[i].owner].position.Y + (float)(Main.player[Main.projectile[i].owner].height / 2) - vector14.Y; + Color color14 = Lighting.GetColor((int)vector14.X / 16, (int)(vector14.Y / 16f)); + if (Main.projectile[i].type == 25) + { + this.spriteBatch.Draw(Main.chain2Texture, new Vector2(vector14.X - Main.screenPosition.X, vector14.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain2Texture.Width, Main.chain2Texture.Height)), color14, rotation12, new Vector2((float)Main.chain2Texture.Width * 0.5f, (float)Main.chain2Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.projectile[i].type == 35) + { + this.spriteBatch.Draw(Main.chain6Texture, new Vector2(vector14.X - Main.screenPosition.X, vector14.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain6Texture.Width, Main.chain6Texture.Height)), color14, rotation12, new Vector2((float)Main.chain6Texture.Width * 0.5f, (float)Main.chain6Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.projectile[i].type == 247) + { + this.spriteBatch.Draw(Main.chain19Texture, new Vector2(vector14.X - Main.screenPosition.X, vector14.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain19Texture.Width, Main.chain19Texture.Height)), color14, rotation12, new Vector2((float)Main.chain19Texture.Width * 0.5f, (float)Main.chain19Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.projectile[i].type == 63) + { + this.spriteBatch.Draw(Main.chain7Texture, new Vector2(vector14.X - Main.screenPosition.X, vector14.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain7Texture.Width, Main.chain7Texture.Height)), color14, rotation12, new Vector2((float)Main.chain7Texture.Width * 0.5f, (float)Main.chain7Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.projectile[i].type == 154) + { + this.spriteBatch.Draw(Main.chain13Texture, new Vector2(vector14.X - Main.screenPosition.X, vector14.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain13Texture.Width, Main.chain13Texture.Height)), color14, rotation12, new Vector2((float)Main.chain13Texture.Width * 0.5f, (float)Main.chain13Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.chain3Texture, new Vector2(vector14.X - Main.screenPosition.X, vector14.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain3Texture.Width, Main.chain3Texture.Height)), color14, rotation12, new Vector2((float)Main.chain3Texture.Width * 0.5f, (float)Main.chain3Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + Color newColor = Lighting.GetColor((int)((double)Main.projectile[i].position.X + (double)Main.projectile[i].width * 0.5) / 16, (int)(((double)Main.projectile[i].position.Y + (double)Main.projectile[i].height * 0.5) / 16.0)); + if (Main.projectile[i].hide) + { + newColor = Lighting.GetColor((int)((double)Main.player[Main.projectile[i].owner].position.X + (double)Main.player[Main.projectile[i].owner].width * 0.5) / 16, (int)(((double)Main.player[Main.projectile[i].owner].position.Y + (double)Main.player[Main.projectile[i].owner].height * 0.5) / 16.0)); + } + if (Main.projectile[i].type == 14) + { + newColor = Color.White; + } + int num73 = 0; + int num74 = 0; + if (Main.projectile[i].type == 175) + { + num73 = 10; + } + if (Main.projectile[i].type == 254) + { + num73 = 3; + } + if (Main.projectile[i].type == 273) + { + num74 = 2; + } + if (Main.projectile[i].type == 162) + { + num73 = 1; + num74 = 1; + } + if (Main.projectile[i].type == 266) + { + num73 = 10; + num74 = -10; + } + if (Main.projectile[i].type == 269) + { + num73 = 18; + num74 = -14; + } + if (Main.projectile[i].type == 268) + { + num73 = 22; + num74 = -2; + } + if (Main.projectile[i].type == 18) + { + num73 = 3; + num74 = 3; + } + if (Main.projectile[i].type == 16) + { + num73 = 6; + } + if (Main.projectile[i].type == 17 || Main.projectile[i].type == 31) + { + num73 = 2; + } + if (Main.projectile[i].type == 25 || Main.projectile[i].type == 26 || Main.projectile[i].type == 35 || Main.projectile[i].type == 63 || Main.projectile[i].type == 154) + { + num73 = 6; + num74 -= 6; + } + if (Main.projectile[i].type == 28 || Main.projectile[i].type == 37 || Main.projectile[i].type == 75) + { + num73 = 8; + } + if (Main.projectile[i].type == 29) + { + num73 = 11; + } + if (Main.projectile[i].type == 43) + { + num73 = 4; + } + if (Main.projectile[i].type == 208) + { + num73 = 2; + num74 -= 12; + } + if (Main.projectile[i].type == 209) + { + num73 = 4; + num74 -= 8; + } + if (Main.projectile[i].type == 210) + { + num73 = 2; + num74 -= 22; + } + if (Main.projectile[i].type == 251) + { + num73 = 18; + num74 -= 10; + } + if (Main.projectile[i].type == 163 || Main.projectile[i].type == 310) + { + num73 = 10; + } + if (Main.projectile[i].type == 69 || Main.projectile[i].type == 70) + { + num73 = 4; + num74 = 4; + } + float num75 = (float)(Main.projectileTexture[Main.projectile[i].type].Width - Main.projectile[i].width) * 0.5f + (float)Main.projectile[i].width * 0.5f; + if (Main.projectile[i].type == 50 || Main.projectile[i].type == 53) + { + num74 = -8; + } + if (Main.projectile[i].type == 72 || Main.projectile[i].type == 86 || Main.projectile[i].type == 87) + { + num74 = -16; + num73 = 8; + } + if (Main.projectile[i].type == 74) + { + num74 = -6; + } + if (Main.projectile[i].type == 99) + { + num73 = 1; + } + if (Main.projectile[i].type == 111) + { + num73 = 18; + num74 = -16; + } + if (Main.projectile[i].type == 200) + { + num73 = 12; + num74 = -12; + } + if (Main.projectile[i].type == 211) + { + num73 = 14; + num74 = 0; + } + if (Main.projectile[i].type == 236) + { + num73 = 30; + num74 = -14; + } + if (Main.projectile[i].type >= 191 && Main.projectile[i].type <= 194) + { + num73 = 26; + if (Main.projectile[i].direction == 1) + { + num74 = -10; + } + else + { + num74 = -22; + } + } + if (Main.projectile[i].type == 112) + { + num73 = 12; + } + int arg_3772_0 = Main.projectile[i].type; + if (Main.projectile[i].type == 127) + { + num73 = 8; + } + if (Main.projectile[i].type == 155) + { + num73 = 3; + num74 = 3; + } + SpriteEffects effects = SpriteEffects.None; + if (Main.projectile[i].spriteDirection == -1) + { + effects = SpriteEffects.FlipHorizontally; + } + if (Main.projectile[i].type == 221) + { + for (int l = 1; l < 10; l++) + { + float num76 = Main.projectile[i].velocity.X * (float)l * 0.5f; + float num77 = Main.projectile[i].velocity.Y * (float)l * 0.5f; + Color alpha = Main.projectile[i].GetAlpha(newColor); + float num78 = 0f; + if (l == 1) + { + num78 = 0.9f; + } + if (l == 2) + { + num78 = 0.8f; + } + if (l == 3) + { + num78 = 0.7f; + } + if (l == 4) + { + num78 = 0.6f; + } + if (l == 5) + { + num78 = 0.5f; + } + if (l == 6) + { + num78 = 0.4f; + } + if (l == 7) + { + num78 = 0.3f; + } + if (l == 8) + { + num78 = 0.2f; + } + if (l == 9) + { + num78 = 0.1f; + } + alpha.R = (byte)((float)alpha.R * num78); + alpha.G = (byte)((float)alpha.G * num78); + alpha.B = (byte)((float)alpha.B * num78); + alpha.A = (byte)((float)alpha.A * num78); + int num79 = Main.projectileTexture[Main.projectile[i].type].Height / Main.projFrames[Main.projectile[i].type]; + int y2 = num79 * Main.projectile[i].frame; + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + num75 + (float)num74 - num76, Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY - num77), new Rectangle?(new Rectangle(0, y2, Main.projectileTexture[Main.projectile[i].type].Width, num79)), alpha, Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), Main.projectile[i].scale, effects, 0f); + } + } + if (Main.projFrames[Main.projectile[i].type] > 1) + { + int num80 = Main.projectileTexture[Main.projectile[i].type].Height / Main.projFrames[Main.projectile[i].type]; + int y3 = num80 * Main.projectile[i].frame; + if (Main.projectile[i].type == 111) + { + int r = (int)Main.player[Main.projectile[i].owner].shirtColor.R; + int g = (int)Main.player[Main.projectile[i].owner].shirtColor.G; + int num81 = (int)Main.player[Main.projectile[i].owner].shirtColor.B; + Color oldColor = new Color((int)((byte)r), (int)((byte)g), (int)((byte)num81)); + newColor = Lighting.GetColor((int)((double)Main.projectile[i].position.X + (double)Main.projectile[i].width * 0.5) / 16, (int)(((double)Main.projectile[i].position.Y + (double)Main.projectile[i].height * 0.5) / 16.0), oldColor); + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + num75 + (float)num74, Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY), new Rectangle?(new Rectangle(0, y3, Main.projectileTexture[Main.projectile[i].type].Width, num80)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), Main.projectile[i].scale, effects, 0f); + return; + } + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + num75 + (float)num74, Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY), new Rectangle?(new Rectangle(0, y3, Main.projectileTexture[Main.projectile[i].type].Width, num80)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), Main.projectile[i].scale, effects, 0f); + return; + } + else + { + if (Main.projectile[i].type == 157) + { + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + (float)(Main.projectile[i].width / 2), Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2)), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2((float)(Main.projectileTexture[Main.projectile[i].type].Width / 2), (float)(Main.projectileTexture[Main.projectile[i].type].Height / 2)), Main.projectile[i].scale, effects, 0f); + return; + } + if (Main.projectile[i].type == 306) + { + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + (float)(Main.projectile[i].width / 2), Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2)), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2((float)(Main.projectileTexture[Main.projectile[i].type].Width / 2), (float)(Main.projectileTexture[Main.projectile[i].type].Height / 2)), Main.projectile[i].scale, effects, 0f); + return; + } + if (Main.projectile[i].type == 256) + { + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + (float)(Main.projectile[i].width / 2), Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2)), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2((float)(Main.projectileTexture[Main.projectile[i].type].Width / 2), (float)(Main.projectileTexture[Main.projectile[i].type].Height / 2)), Main.projectile[i].scale, effects, 0f); + return; + } + if (Main.projectile[i].aiStyle == 27) + { + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + (float)(Main.projectile[i].width / 2), Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2)), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2((float)Main.projectileTexture[Main.projectile[i].type].Width, 0f), Main.projectile[i].scale, effects, 0f); + return; + } + if (Main.projectile[i].aiStyle == 19) + { + Vector2 origin = new Vector2(0f, 0f); + if (Main.projectile[i].spriteDirection == -1) + { + origin.X = (float)Main.projectileTexture[Main.projectile[i].type].Width; + } + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + (float)(Main.projectile[i].width / 2), Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, origin, Main.projectile[i].scale, effects, 0f); + return; + } + if (Main.projectile[i].type == 94 && Main.projectile[i].ai[1] > 6f) + { + for (int m = 0; m < 10; m++) + { + Color alpha2 = Main.projectile[i].GetAlpha(newColor); + float num82 = (float)(9 - m) / 9f; + alpha2.R = (byte)((float)alpha2.R * num82); + alpha2.G = (byte)((float)alpha2.G * num82); + alpha2.B = (byte)((float)alpha2.B * num82); + alpha2.A = (byte)((float)alpha2.A * num82); + float num83 = (float)(9 - m) / 9f; + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].oldPos[m].X - Main.screenPosition.X + num75 + (float)num74, Main.projectile[i].oldPos[m].Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), alpha2, Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), num83 * Main.projectile[i].scale, effects, 0f); + } + } + if (Main.projectile[i].type == 301) + { + for (int n = 0; n < 10; n++) + { + Color alpha3 = Main.projectile[i].GetAlpha(newColor); + float num84 = (float)(9 - n) / 9f; + alpha3.R = (byte)((float)alpha3.R * num84); + alpha3.G = (byte)((float)alpha3.G * num84); + alpha3.B = (byte)((float)alpha3.B * num84); + alpha3.A = (byte)((float)alpha3.A * num84); + float num85 = (float)(9 - n) / 9f; + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].oldPos[n].X - Main.screenPosition.X + num75 + (float)num74, Main.projectile[i].oldPos[n].Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), alpha3, Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), num85 * Main.projectile[i].scale, effects, 0f); + } + } + if (Main.projectile[i].type == 117 && Main.projectile[i].ai[0] > 3f) + { + for (int num86 = 1; num86 < 5; num86++) + { + float num87 = Main.projectile[i].velocity.X * (float)num86; + float num88 = Main.projectile[i].velocity.Y * (float)num86; + Color alpha4 = Main.projectile[i].GetAlpha(newColor); + float num89 = 0f; + if (num86 == 1) + { + num89 = 0.4f; + } + if (num86 == 2) + { + num89 = 0.3f; + } + if (num86 == 3) + { + num89 = 0.2f; + } + if (num86 == 4) + { + num89 = 0.1f; + } + alpha4.R = (byte)((float)alpha4.R * num89); + alpha4.G = (byte)((float)alpha4.G * num89); + alpha4.B = (byte)((float)alpha4.B * num89); + alpha4.A = (byte)((float)alpha4.A * num89); + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + num75 + (float)num74 - num87, Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY - num88), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), alpha4, Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), Main.projectile[i].scale, effects, 0f); + } + } + this.spriteBatch.Draw(Main.projectileTexture[Main.projectile[i].type], new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + num75 + (float)num74, Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2) + Main.projectile[i].gfxOffY), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), Main.projectile[i].GetAlpha(newColor), Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), Main.projectile[i].scale, effects, 0f); + if (Main.projectile[i].type == 106) + { + this.spriteBatch.Draw(Main.lightDiscTexture, new Vector2(Main.projectile[i].position.X - Main.screenPosition.X + num75 + (float)num74, Main.projectile[i].position.Y - Main.screenPosition.Y + (float)(Main.projectile[i].height / 2)), new Rectangle?(new Rectangle(0, 0, Main.projectileTexture[Main.projectile[i].type].Width, Main.projectileTexture[Main.projectile[i].type].Height)), new Color(200, 200, 200, 0), Main.projectile[i].rotation, new Vector2(num75, (float)(Main.projectile[i].height / 2 + num73)), Main.projectile[i].scale, effects, 0f); + } + return; + } + } + private static Color buffColor(Color newColor, float R, float G, float B, float A) + { + newColor.R = (byte)((float)newColor.R * R); + newColor.G = (byte)((float)newColor.G * G); + newColor.B = (byte)((float)newColor.B * B); + newColor.A = (byte)((float)newColor.A * A); + return newColor; + } + protected void DrawWoF() + { + if (Main.wof >= 0 && Main.player[Main.myPlayer].gross) + { + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && Main.player[i].tongued && !Main.player[i].dead) + { + float num = Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2); + float num2 = Main.npc[Main.wof].position.Y + (float)(Main.npc[Main.wof].height / 2); + Vector2 vector = new Vector2(Main.player[i].position.X + (float)Main.player[i].width * 0.5f, Main.player[i].position.Y + (float)Main.player[i].height * 0.5f); + float num3 = num - vector.X; + float num4 = num2 - vector.Y; + float rotation = (float)Math.Atan2((double)num4, (double)num3) - 1.57f; + bool flag = true; + while (flag) + { + float num5 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4)); + if (num5 < 40f) + { + flag = false; + } + else + { + num5 = (float)Main.chain12Texture.Height / num5; + num3 *= num5; + num4 *= num5; + vector.X += num3; + vector.Y += num4; + num3 = num - vector.X; + num4 = num2 - vector.Y; + Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f)); + this.spriteBatch.Draw(Main.chain12Texture, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain12Texture.Width, Main.chain12Texture.Height)), color, rotation, new Vector2((float)Main.chain12Texture.Width * 0.5f, (float)Main.chain12Texture.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + for (int j = 0; j < 200; j++) + { + if (Main.npc[j].active && Main.npc[j].aiStyle == 29) + { + float num6 = Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2); + float num7 = Main.npc[Main.wof].position.Y; + float num8 = (float)(Main.wofB - Main.wofT); + bool flag2 = false; + if (Main.npc[j].frameCounter > 7.0) + { + flag2 = true; + } + num7 = (float)Main.wofT + num8 * Main.npc[j].ai[0]; + Vector2 vector2 = new Vector2(Main.npc[j].position.X + (float)(Main.npc[j].width / 2), Main.npc[j].position.Y + (float)(Main.npc[j].height / 2)); + float num9 = num6 - vector2.X; + float num10 = num7 - vector2.Y; + float rotation2 = (float)Math.Atan2((double)num10, (double)num9) - 1.57f; + bool flag3 = true; + while (flag3) + { + SpriteEffects effects = SpriteEffects.None; + if (flag2) + { + effects = SpriteEffects.FlipHorizontally; + flag2 = false; + } + else + { + flag2 = true; + } + int height = 28; + float num11 = (float)Math.Sqrt((double)(num9 * num9 + num10 * num10)); + if (num11 < 40f) + { + height = (int)num11 - 40 + 28; + flag3 = false; + } + num11 = 28f / num11; + num9 *= num11; + num10 *= num11; + vector2.X += num9; + vector2.Y += num10; + num9 = num6 - vector2.X; + num10 = num7 - vector2.Y; + Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f)); + this.spriteBatch.Draw(Main.chain12Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chain4Texture.Width, height)), color2, rotation2, new Vector2((float)Main.chain4Texture.Width * 0.5f, (float)Main.chain4Texture.Height * 0.5f), 1f, effects, 0f); + } + } + } + int num12 = 140; + float num13 = (float)Main.wofT; + float num14 = (float)Main.wofB; + num14 = Main.screenPosition.Y + (float)Main.screenHeight; + float num15 = (float)((int)((num13 - Main.screenPosition.Y) / (float)num12) + 1); + num15 *= (float)num12; + if (num15 > 0f) + { + num13 -= num15; + } + float num16 = num13; + float num17 = Main.npc[Main.wof].position.X; + float num18 = num14 - num13; + bool flag4 = true; + SpriteEffects effects2 = SpriteEffects.None; + if (Main.npc[Main.wof].spriteDirection == 1) + { + effects2 = SpriteEffects.FlipHorizontally; + } + if (Main.npc[Main.wof].direction > 0) + { + num17 -= 80f; + } + int num19 = 0; + if (!Main.gamePaused) + { + Main.wofF++; + } + if (Main.wofF > 12) + { + num19 = 280; + if (Main.wofF > 17) + { + Main.wofF = 0; + } + } + else + { + if (Main.wofF > 6) + { + num19 = 140; + } + } + while (flag4) + { + num18 = num14 - num16; + if (num18 > (float)num12) + { + num18 = (float)num12; + } + bool flag5 = true; + int num20 = 0; + while (flag5) + { + int x = (int)(num17 + (float)(Main.wofTexture.Width / 2)) / 16; + int y = (int)(num16 + (float)num20) / 16; + this.spriteBatch.Draw(Main.wofTexture, new Vector2(num17 - Main.screenPosition.X, num16 + (float)num20 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, num19 + num20, Main.wofTexture.Width, 16)), Lighting.GetColor(x, y), 0f, default(Vector2), 1f, effects2, 0f); + num20 += 16; + if ((float)num20 >= num18) + { + flag5 = false; + } + } + num16 += (float)num12; + if (num16 >= num14) + { + flag4 = false; + } + } + } + } + protected void DrawGhost(Player drawPlayer) + { + SpriteEffects effects; + if (drawPlayer.direction == 1) + { + effects = SpriteEffects.None; + } + else + { + effects = SpriteEffects.FlipHorizontally; + } + Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, new Color((int)(Main.mouseTextColor / 2 + 100), (int)(Main.mouseTextColor / 2 + 100), (int)(Main.mouseTextColor / 2 + 100), (int)(Main.mouseTextColor / 2 + 100)))); + Rectangle value = new Rectangle(0, Main.ghostTexture.Height / 4 * drawPlayer.ghostFrame, Main.ghostTexture.Width, Main.ghostTexture.Height / 4); + Vector2 origin = new Vector2((float)value.Width * 0.5f, (float)value.Height * 0.5f); + this.spriteBatch.Draw(Main.ghostTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(value.Width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(value.Height / 2)))), new Rectangle?(value), immuneAlpha, 0f, origin, 1f, effects, 0f); + } + protected Vector2 DrawPlayerItemPos(Player drawPlayer) + { + float num = 10f; + Vector2 result = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width / 2), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 95) + { + num = 6f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1295) + { + num = 4f; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1255) + { + num = 6f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1265) + { + num = -8f; + result.Y += 4f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1000) + { + num = 6f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1178) + { + num = 4f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1319) + { + num = 0f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1297) + { + num = -8f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1121) + { + num = 6f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1314) + { + num = 2f; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1258) + { + num = 2f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1155) + { + num = -10f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1156) + { + num = -2f; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 96) + { + num = -8f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1260) + { + num = -8f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1254) + { + num = -6f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 98) + { + num = -5f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 534) + { + num = -2f; + result.Y += 1f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 679) + { + num = 0f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 964) + { + num = 0f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 533) + { + num = -7f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1553) + { + num = -10f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 506) + { + num = 0f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 494 || drawPlayer.inventory[drawPlayer.selectedItem].type == 508) + { + num = -2f; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 434) + { + num = 0f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 514) + { + num = 0f; + result.Y += 3f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 435 || drawPlayer.inventory[drawPlayer.selectedItem].type == 436 || drawPlayer.inventory[drawPlayer.selectedItem].type == 481 || drawPlayer.inventory[drawPlayer.selectedItem].type == 578 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1187 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1194 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1201 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1229) + { + num = -2f; + result.Y -= 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 197) + { + num = -5f; + result.Y += 4f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 126) + { + num = 4f; + result.Y += 4f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 800) + { + num = 4f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 127) + { + num = 4f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 157) + { + num = 6f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 160) + { + num = -8f; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 164 || drawPlayer.inventory[drawPlayer.selectedItem].type == 219) + { + num = 0f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 165 || drawPlayer.inventory[drawPlayer.selectedItem].type == 272) + { + num = 4f; + result.Y += 4f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 266) + { + num = 0f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 281) + { + num = 6f; + result.Y -= 6f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 986) + { + num = 6f; + result.Y -= 10f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 682) + { + num = 4f; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 758) + { + num -= 20f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 759) + { + num -= 18f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 760) + { + num -= 12f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 779) + { + num = 0f; + result.Y += 2f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 905) + { + num = -5f; + result.Y += 0f * drawPlayer.gravDir; + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 930) + { + num = 4f; + result.Y += 2f * drawPlayer.gravDir; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + result.X = num; + return result; + } + protected Color quickAlpha(Color oldColor, float Alpha) + { + Color result = oldColor; + result.R = (byte)((float)result.R * Alpha); + result.G = (byte)((float)result.G * Alpha); + result.B = (byte)((float)result.B * Alpha); + result.A = (byte)((float)result.A * Alpha); + return result; + } + protected void DrawPlayerHead(Player drawPlayer, float X, float Y, float Alpha = 1f, float Scale = 1f) + { + int index = 0; + if (drawPlayer.dye[0] != null) + { + index = (int)drawPlayer.dye[0].dye; + } + this.LoadHair(drawPlayer.hair); + Color color = this.quickAlpha(Color.White, Alpha); + Color color2 = this.quickAlpha(drawPlayer.eyeColor, Alpha); + Color color3 = this.quickAlpha(drawPlayer.hairColor, Alpha); + Color color4 = this.quickAlpha(drawPlayer.skinColor, Alpha); + Color color5 = this.quickAlpha(Color.White, Alpha); + SpriteEffects effects = SpriteEffects.None; + if (drawPlayer.direction < 0) + { + effects = SpriteEffects.FlipHorizontally; + } + Vector2 vector = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.4f); + Vector2 position = drawPlayer.position; + Rectangle bodyFrame = drawPlayer.bodyFrame; + drawPlayer.bodyFrame.Y = 0; + drawPlayer.position = Main.screenPosition; + drawPlayer.position.X = drawPlayer.position.X + X; + drawPlayer.position.Y = drawPlayer.position.Y + Y; + drawPlayer.position.X = drawPlayer.position.X - 6f; + drawPlayer.position.Y = drawPlayer.position.Y - 4f; + if (drawPlayer.head > 0 && drawPlayer.head < 112) + { + this.LoadArmorHead(drawPlayer.head); + } + if (drawPlayer.head != 38) + { + this.spriteBatch.Draw(Main.playerHeadTexture, new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, vector, Scale, effects, 0f); + this.spriteBatch.Draw(Main.playerEyeWhitesTexture, new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color, drawPlayer.headRotation, vector, Scale, effects, 0f); + this.spriteBatch.Draw(Main.playerEyesTexture, new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, vector, Scale, effects, 0f); + } + if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106) + { + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + if (!drawPlayer.invis) + { + Rectangle bodyFrame2 = drawPlayer.bodyFrame; + bodyFrame2.Y -= 336; + if (bodyFrame2.Y < 0) + { + bodyFrame2.Y = 0; + } + this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame2), color3, drawPlayer.headRotation, vector, Scale, effects, 0f); + } + } + if (drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69) + { + Rectangle bodyFrame3 = drawPlayer.bodyFrame; + bodyFrame3.Y -= 336; + if (bodyFrame3.Y < 0) + { + bodyFrame3.Y = 0; + } + if (!drawPlayer.invis) + { + this.spriteBatch.Draw(Main.playerHairAltTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame3), color3, drawPlayer.headRotation, vector, Scale, effects, 0f); + } + } + if (drawPlayer.head == 23) + { + Rectangle bodyFrame4 = drawPlayer.bodyFrame; + bodyFrame4.Y -= 336; + if (bodyFrame4.Y < 0) + { + bodyFrame4.Y = 0; + } + if (!drawPlayer.invis) + { + this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame4), color3, drawPlayer.headRotation, vector, Scale, effects, 0f); + } + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + if (drawPlayer.head == 14 || drawPlayer.head == 56) + { + Rectangle bodyFrame5 = drawPlayer.bodyFrame; + int num = 0; + if (bodyFrame5.Y == bodyFrame5.Height * 6) + { + bodyFrame5.Height -= 2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 7) + { + num = -2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 8) + { + num = -2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 9) + { + num = -2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 10) + { + num = -2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 13) + { + bodyFrame5.Height -= 2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 14) + { + num = -2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 15) + { + num = -2; + } + else + { + if (bodyFrame5.Y == bodyFrame5.Height * 16) + { + num = -2; + } + } + } + } + } + } + } + } + } + bodyFrame5.Y += num; + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f + (float)num) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame5), color5, drawPlayer.headRotation, vector, Scale, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + if (drawPlayer.head > 0 && drawPlayer.head < 112 && drawPlayer.head != 28) + { + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, vector, Scale, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + Rectangle bodyFrame6 = drawPlayer.bodyFrame; + bodyFrame6.Y -= 336; + if (bodyFrame6.Y < 0) + { + bodyFrame6.Y = 0; + } + this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2), drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f) + drawPlayer.headPosition + vector, new Rectangle?(bodyFrame6), color3, drawPlayer.headRotation, vector, Scale, effects, 0f); + } + } + } + drawPlayer.position = position; + drawPlayer.bodyFrame.Y = bodyFrame.Y; + } + protected void DrawPlayer(Player drawPlayer) + { + int index = 0; + int index2 = 0; + int index3 = 0; + if (drawPlayer.dye[0] != null) + { + index = (int)drawPlayer.dye[0].dye; + } + if (drawPlayer.dye[1] != null) + { + index2 = (int)drawPlayer.dye[1].dye; + } + if (drawPlayer.dye[2] != null) + { + index3 = (int)drawPlayer.dye[2].dye; + } + if (drawPlayer.shadow == 0f) + { + drawPlayer.position.Y = drawPlayer.position.Y + drawPlayer.gfxOffY; + } + drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y + drawPlayer.gfxOffY; + SpriteEffects effects = SpriteEffects.None; + Color color = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White)); + Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor)); + Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.hairColor)); + Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor)); + Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor)); + Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor)); + Color color6 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor)); + Color color7 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor)); + Color color8 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor)); + Color color9 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor)); + Color color10 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White)); + Color color11 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White)); + Color color12 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White)); + if (drawPlayer.head > 0 && drawPlayer.head < 112) + { + this.LoadArmorHead(drawPlayer.head); + } + if (drawPlayer.body > 0 && drawPlayer.body < 75) + { + this.LoadArmorBody(drawPlayer.body); + } + if (drawPlayer.legs > 0 && drawPlayer.legs < 64) + { + this.LoadArmorLegs(drawPlayer.legs); + } + this.LoadHair(drawPlayer.hair); + if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47) + { + float num = (float)Main.mouseTextColor / 200f - 0.3f; + if (drawPlayer.shadow != 0f) + { + num = 0f; + } + color10.G = (byte)((float)color10.G * num); + color11.G = (byte)((float)color11.G * num); + color12.G = (byte)((float)color12.G * num); + color10.B = (byte)((float)color10.B * num); + color10.R = (byte)((float)color10.R * num); + color11.B = (byte)((float)color11.B * num); + color11.R = (byte)((float)color11.R * num); + color12.B = (byte)((float)color12.B * num); + color12.R = (byte)((float)color12.R * num); + } + if (drawPlayer.shadow > 0f) + { + immuneAlpha = new Color(0, 0, 0, 0); + color5 = new Color(0, 0, 0, 0); + color4 = new Color(0, 0, 0, 0); + color3 = new Color(0, 0, 0, 0); + color2 = new Color(0, 0, 0, 0); + color = new Color(0, 0, 0, 0); + } + float num2 = 1f; + float num3 = 1f; + float num4 = 1f; + float num5 = 1f; + if (drawPlayer.honey && Main.rand.Next(30) == 0) + { + int num6 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 152, 0f, 0f, 150, default(Color), 1f); + Main.dust[num6].velocity.Y = 0.3f; + Dust expr_79B_cp_0 = Main.dust[num6]; + expr_79B_cp_0.velocity.X = expr_79B_cp_0.velocity.X * 0.1f; + Main.dust[num6].scale += (float)Main.rand.Next(3, 4) * 0.1f; + Main.dust[num6].alpha = 100; + Main.dust[num6].noGravity = true; + Main.dust[num6].velocity += drawPlayer.velocity * 0.1f; + } + if (drawPlayer.poisoned) + { + if (Main.rand.Next(50) == 0) + { + int num7 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 46, 0f, 0f, 150, default(Color), 0.2f); + Main.dust[num7].noGravity = true; + Main.dust[num7].fadeIn = 1.9f; + } + num2 *= 0.65f; + num4 *= 0.75f; + } + if (drawPlayer.venom) + { + if (Main.rand.Next(10) == 0) + { + int num8 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 171, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num8].noGravity = true; + Main.dust[num8].fadeIn = 1.5f; + } + num3 *= 0.45f; + num2 *= 0.75f; + } + if (drawPlayer.onFire) + { + if (Main.rand.Next(4) == 0) + { + int num9 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f); + Main.dust[num9].noGravity = true; + Main.dust[num9].velocity *= 1.8f; + Dust expr_9E3_cp_0 = Main.dust[num9]; + expr_9E3_cp_0.velocity.Y = expr_9E3_cp_0.velocity.Y - 0.5f; + } + num4 *= 0.6f; + num3 *= 0.7f; + } + if (drawPlayer.ichor) + { + num4 = 0f; + } + if (drawPlayer.burned) + { + int num10 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 2f); + Main.dust[num10].noGravity = true; + Main.dust[num10].velocity *= 1.8f; + Dust expr_ACC_cp_0 = Main.dust[num10]; + expr_ACC_cp_0.velocity.Y = expr_ACC_cp_0.velocity.Y - 0.75f; + num2 = 1f; + num4 *= 0.6f; + num3 *= 0.7f; + } + if (drawPlayer.onFrostBurn) + { + if (Main.rand.Next(4) == 0) + { + int num11 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 135, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f); + Main.dust[num11].noGravity = true; + Main.dust[num11].velocity *= 1.8f; + Dust expr_BC1_cp_0 = Main.dust[num11]; + expr_BC1_cp_0.velocity.Y = expr_BC1_cp_0.velocity.Y - 0.5f; + } + num2 *= 0.5f; + num3 *= 0.7f; + } + if (drawPlayer.onFire2) + { + if (Main.rand.Next(4) == 0) + { + int num12 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 75, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f); + Main.dust[num12].noGravity = true; + Main.dust[num12].velocity *= 1.8f; + Dust expr_CAC_cp_0 = Main.dust[num12]; + expr_CAC_cp_0.velocity.Y = expr_CAC_cp_0.velocity.Y - 0.5f; + } + num4 *= 0.6f; + num3 *= 0.7f; + } + if (drawPlayer.noItems) + { + num3 *= 0.8f; + num2 *= 0.65f; + } + if (drawPlayer.blind) + { + num3 *= 0.65f; + num2 *= 0.7f; + } + if (drawPlayer.bleed) + { + num3 *= 0.9f; + num4 *= 0.9f; + if (!drawPlayer.dead && Main.rand.Next(30) == 0) + { + int num13 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 5, 0f, 0f, 0, default(Color), 1f); + Dust expr_D7F_cp_0 = Main.dust[num13]; + expr_D7F_cp_0.velocity.Y = expr_D7F_cp_0.velocity.Y + 0.5f; + Main.dust[num13].velocity *= 0.25f; + } + } + if (drawPlayer.shadow == 0f && drawPlayer.palladiumRegen && drawPlayer.statLife < drawPlayer.statLifeMax && base.IsActive && !Main.gamePaused && drawPlayer.miscCounter % 10 == 0) + { + Vector2 position; + position.X = drawPlayer.position.X + (float)Main.rand.Next(drawPlayer.width); + position.Y = drawPlayer.position.Y + (float)Main.rand.Next(drawPlayer.height); + position.X = drawPlayer.position.X + (float)(drawPlayer.width / 2) - 6f; + position.Y = drawPlayer.position.Y + (float)(drawPlayer.height / 2) - 6f; + position.X -= (float)Main.rand.Next(-10, 11); + position.Y -= (float)Main.rand.Next(-20, 21); + Gore.NewGore(position, new Vector2((float)Main.rand.Next(-10, 11) * 0.1f, (float)Main.rand.Next(-20, -10) * 0.1f), 331, (float)Main.rand.Next(80, 120) * 0.01f); + } + if (num2 != 1f || num3 != 1f || num4 != 1f || num5 != 1f) + { + if (drawPlayer.onFire || drawPlayer.onFire2 || drawPlayer.onFrostBurn) + { + color = drawPlayer.GetImmuneAlpha(Color.White); + color2 = drawPlayer.GetImmuneAlpha(drawPlayer.eyeColor); + color3 = drawPlayer.GetImmuneAlpha(drawPlayer.hairColor); + color4 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor); + color5 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor); + color6 = drawPlayer.GetImmuneAlpha(drawPlayer.shirtColor); + color7 = drawPlayer.GetImmuneAlpha(drawPlayer.underShirtColor); + color8 = drawPlayer.GetImmuneAlpha(drawPlayer.pantsColor); + color9 = drawPlayer.GetImmuneAlpha(drawPlayer.shoeColor); + color10 = drawPlayer.GetImmuneAlpha(Color.White); + color11 = drawPlayer.GetImmuneAlpha(Color.White); + color12 = drawPlayer.GetImmuneAlpha(Color.White); + } + else + { + color = Main.buffColor(color, num2, num3, num4, num5); + color2 = Main.buffColor(color2, num2, num3, num4, num5); + color3 = Main.buffColor(color3, num2, num3, num4, num5); + color4 = Main.buffColor(color4, num2, num3, num4, num5); + color5 = Main.buffColor(color5, num2, num3, num4, num5); + color6 = Main.buffColor(color6, num2, num3, num4, num5); + color7 = Main.buffColor(color7, num2, num3, num4, num5); + color8 = Main.buffColor(color8, num2, num3, num4, num5); + color9 = Main.buffColor(color9, num2, num3, num4, num5); + color10 = Main.buffColor(color10, num2, num3, num4, num5); + color11 = Main.buffColor(color11, num2, num3, num4, num5); + color12 = Main.buffColor(color12, num2, num3, num4, num5); + } + } + if (drawPlayer.socialGhost) + { + color = new Color(0, 0, 0, 0); + color2 = new Color(0, 0, 0, 0); + color3 = new Color(0, 0, 0, 0); + color4 = new Color(0, 0, 0, 0); + color5 = new Color(0, 0, 0, 0); + color6 = new Color(0, 0, 0, 0); + color7 = new Color(0, 0, 0, 0); + color8 = new Color(0, 0, 0, 0); + color9 = new Color(0, 0, 0, 0); + immuneAlpha = new Color(0, 0, 0, 0); + if (color10.A > Main.gFade) + { + color10.A = Main.gFade; + } + if (color11.A > Main.gFade) + { + color11.A = Main.gFade; + } + if (color12.A > Main.gFade) + { + color12.A = Main.gFade; + } + } + if (drawPlayer.armorSteath) + { + float num14 = drawPlayer.stealth; + if ((double)num14 < 0.03) + { + num14 = 0.03f; + } + float num15 = (1f + num14 * 10f) / 11f; + if (num14 < 0f) + { + num14 = 0f; + } + if (num14 >= 1f - drawPlayer.shadow && drawPlayer.shadow > 0f) + { + num14 = drawPlayer.shadow * 0.5f; + } + color10 = new Color((int)((byte)((float)color10.R * num14)), (int)((byte)((float)color10.G * num14)), (int)((byte)((float)color10.B * num15)), (int)((byte)((float)color10.A * num14))); + color11 = new Color((int)((byte)((float)color11.R * num14)), (int)((byte)((float)color11.G * num14)), (int)((byte)((float)color11.B * num15)), (int)((byte)((float)color11.A * num14))); + color12 = new Color((int)((byte)((float)color12.R * num14)), (int)((byte)((float)color12.G * num14)), (int)((byte)((float)color12.B * num15)), (int)((byte)((float)color12.A * num14))); + num14 *= num14; + color = new Color((int)((byte)((float)color.R * num14)), (int)((byte)((float)color.G * num14)), (int)((byte)((float)color.B * num14)), (int)((byte)((float)color.A * num14))); + color2 = new Color((int)((byte)((float)color2.R * num14)), (int)((byte)((float)color2.G * num14)), (int)((byte)((float)color2.B * num14)), (int)((byte)((float)color2.A * num14))); + color3 = new Color((int)((byte)((float)color3.R * num14)), (int)((byte)((float)color3.G * num14)), (int)((byte)((float)color3.B * num14)), (int)((byte)((float)color3.A * num14))); + color4 = new Color((int)((byte)((float)color4.R * num14)), (int)((byte)((float)color4.G * num14)), (int)((byte)((float)color4.B * num14)), (int)((byte)((float)color4.A * num14))); + color5 = new Color((int)((byte)((float)color5.R * num14)), (int)((byte)((float)color5.G * num14)), (int)((byte)((float)color5.B * num14)), (int)((byte)((float)color5.A * num14))); + color6 = new Color((int)((byte)((float)color6.R * num14)), (int)((byte)((float)color6.G * num14)), (int)((byte)((float)color6.B * num14)), (int)((byte)((float)color6.A * num14))); + color7 = new Color((int)((byte)((float)color7.R * num14)), (int)((byte)((float)color7.G * num14)), (int)((byte)((float)color7.B * num14)), (int)((byte)((float)color7.A * num14))); + color8 = new Color((int)((byte)((float)color8.R * num14)), (int)((byte)((float)color8.G * num14)), (int)((byte)((float)color8.B * num14)), (int)((byte)((float)color8.A * num14))); + color9 = new Color((int)((byte)((float)color9.R * num14)), (int)((byte)((float)color9.G * num14)), (int)((byte)((float)color9.B * num14)), (int)((byte)((float)color9.A * num14))); + immuneAlpha = new Color((int)((byte)((float)immuneAlpha.R * num14)), (int)((byte)((float)immuneAlpha.G * num14)), (int)((byte)((float)immuneAlpha.B * num14)), (int)((byte)((float)immuneAlpha.A * num14))); + } + SpriteEffects effects2; + if (drawPlayer.gravDir == 1f) + { + if (drawPlayer.direction == 1) + { + effects = SpriteEffects.None; + effects2 = SpriteEffects.None; + } + else + { + effects = SpriteEffects.FlipHorizontally; + effects2 = SpriteEffects.FlipHorizontally; + } + if (!drawPlayer.dead) + { + drawPlayer.legPosition.Y = 0f; + drawPlayer.headPosition.Y = 0f; + drawPlayer.bodyPosition.Y = 0f; + } + } + else + { + if (drawPlayer.direction == 1) + { + effects = SpriteEffects.FlipVertically; + effects2 = SpriteEffects.FlipVertically; + } + else + { + effects = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically); + effects2 = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically); + } + if (!drawPlayer.dead) + { + drawPlayer.legPosition.Y = 6f; + drawPlayer.headPosition.Y = 6f; + drawPlayer.bodyPosition.Y = 6f; + } + } + Vector2 vector = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.75f); + Vector2 origin = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.5f); + Vector2 vector2 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.4f); + if (drawPlayer.merman) + { + drawPlayer.headRotation = drawPlayer.velocity.Y * (float)drawPlayer.direction * 0.1f; + if ((double)drawPlayer.headRotation < -0.3) + { + drawPlayer.headRotation = -0.3f; + } + if ((double)drawPlayer.headRotation > 0.3) + { + drawPlayer.headRotation = 0.3f; + } + } + else + { + if (!drawPlayer.dead) + { + drawPlayer.headRotation = 0f; + } + } + if (drawPlayer.carpetFrame >= 0) + { + Color color13 = color12; + float num16 = 0f; + if (drawPlayer.gravDir == -1f) + { + num16 = 10f; + } + this.spriteBatch.Draw(Main.flyingCarpetTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 28f * drawPlayer.gravDir + num16))), new Rectangle?(new Rectangle(0, Main.flyingCarpetTexture.Height / 6 * drawPlayer.carpetFrame, Main.flyingCarpetTexture.Width, Main.flyingCarpetTexture.Height / 6)), color13, drawPlayer.bodyRotation, new Vector2((float)(Main.flyingCarpetTexture.Width / 2), (float)(Main.flyingCarpetTexture.Height / 8)), 1f, effects, 0f); + } + bool flag = false; + if ((drawPlayer.wings == 0 || drawPlayer.velocity.Y == 0f) && (drawPlayer.inventory[drawPlayer.selectedItem].type == 1178 || drawPlayer.inventory[drawPlayer.selectedItem].type == 779 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1295 || drawPlayer.turtleArmor)) + { + flag = true; + int type = drawPlayer.inventory[drawPlayer.selectedItem].type; + int num17 = 1; + float num18 = -4f; + float num19 = -8f; + if (drawPlayer.turtleArmor) + { + num17 = 4; + } + else + { + if (type == 1178) + { + num17 = 1; + } + else + { + if (type == 779) + { + num17 = 2; + } + else + { + if (type == 1295) + { + num17 = 3; + } + } + } + } + if (num17 == 4) + { + this.spriteBatch.Draw(Main.BackPackTexture[num17], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.BackPackTexture[num17], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction))) + num18 * (float)drawPlayer.direction, (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + num19 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, 0, Main.BackPackTexture[num17].Width, Main.BackPackTexture[num17].Height)), color11, drawPlayer.bodyRotation, new Vector2((float)(Main.BackPackTexture[num17].Width / 2), (float)(Main.BackPackTexture[num17].Height / 2)), 1f, effects, 0f); + } + } + if (!flag && drawPlayer.wings > 0) + { + this.LoadWings(drawPlayer.wings); + int num20 = 0; + int num21 = 0; + if (drawPlayer.wings == 5) + { + num21 = 4; + num20 -= 4; + } + Color color14 = color11; + if (drawPlayer.wings == 9) + { + color14 = new Color(250, 250, 250, 100); + } + if (drawPlayer.wings == 10) + { + color14.A = 175; + } + if (drawPlayer.wings == 11 && color14.A > Main.gFade) + { + color14.A = Main.gFade; + } + if (drawPlayer.wings == 3) + { + Main.pixelShader.CurrentTechnique.Passes[index2].Apply(); + } + this.spriteBatch.Draw(Main.wingsTexture[drawPlayer.wings], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num21 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num20 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color14, drawPlayer.bodyRotation, new Vector2((float)(Main.wingsTexture[drawPlayer.wings].Width / 2), (float)(Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, effects, 0f); + if (drawPlayer.wings == 3) + { + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + } + if (!drawPlayer.invis) + { + this.spriteBatch.Draw(Main.skinBodyTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + this.spriteBatch.Draw(Main.skinLegsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.legFrame), immuneAlpha, drawPlayer.legRotation, origin, 1f, effects, 0f); + } + if (drawPlayer.legs > 0 && drawPlayer.legs < 64) + { + Main.pixelShader.CurrentTechnique.Passes[index3].Apply(); + this.spriteBatch.Draw(Main.armorLegTexture[drawPlayer.legs], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color12, drawPlayer.legRotation, vector, 1f, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + if (!drawPlayer.invis) + { + if (!drawPlayer.male) + { + this.spriteBatch.Draw(Main.femalePantsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color8, drawPlayer.legRotation, vector, 1f, effects, 0f); + this.spriteBatch.Draw(Main.femaleShoesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, vector, 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.playerPantsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color8, drawPlayer.legRotation, vector, 1f, effects, 0f); + this.spriteBatch.Draw(Main.playerShoesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.legFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.legFrame.Height + 4f))) + drawPlayer.legPosition + vector, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, vector, 1f, effects, 0f); + } + } + } + if (drawPlayer.body > 0 && drawPlayer.body < 75) + { + Main.pixelShader.CurrentTechnique.Passes[index2].Apply(); + if (!drawPlayer.male) + { + this.spriteBatch.Draw(Main.femaleBodyTexture[drawPlayer.body], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.armorBodyTexture[drawPlayer.body], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + if ((drawPlayer.body == 10 || drawPlayer.body == 11 || drawPlayer.body == 12 || drawPlayer.body == 13 || drawPlayer.body == 14 || drawPlayer.body == 43 || drawPlayer.body == 15 || drawPlayer.body == 16 || drawPlayer.body == 20 || drawPlayer.body == 39 || drawPlayer.body == 50 || drawPlayer.body == 38 || drawPlayer.body == 40 || drawPlayer.body == 57 || drawPlayer.body == 44 || drawPlayer.body == 52) && !drawPlayer.invis) + { + this.spriteBatch.Draw(Main.playerHandsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + } + else + { + if (!drawPlayer.invis) + { + if (!drawPlayer.male) + { + this.spriteBatch.Draw(Main.femaleUnderShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + this.spriteBatch.Draw(Main.femaleShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.playerUnderShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + this.spriteBatch.Draw(Main.playerShirtTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + this.spriteBatch.Draw(Main.playerHandsTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + } + if (!drawPlayer.invis && drawPlayer.head != 38) + { + this.spriteBatch.Draw(Main.playerHeadTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, vector2, 1f, effects, 0f); + this.spriteBatch.Draw(Main.playerEyeWhitesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color, drawPlayer.headRotation, vector2, 1f, effects, 0f); + this.spriteBatch.Draw(Main.playerEyesTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, vector2, 1f, effects, 0f); + } + if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106) + { + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + if (!drawPlayer.invis) + { + Rectangle bodyFrame = drawPlayer.bodyFrame; + bodyFrame.Y -= 336; + if (bodyFrame.Y < 0) + { + bodyFrame.Y = 0; + } + this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame), color3, drawPlayer.headRotation, vector2, 1f, effects, 0f); + } + } + if (drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69) + { + Rectangle bodyFrame2 = drawPlayer.bodyFrame; + bodyFrame2.Y -= 336; + if (bodyFrame2.Y < 0) + { + bodyFrame2.Y = 0; + } + if (!drawPlayer.invis) + { + this.spriteBatch.Draw(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame2), color3, drawPlayer.headRotation, vector2, 1f, effects, 0f); + } + } + if (drawPlayer.head == 23) + { + Rectangle bodyFrame3 = drawPlayer.bodyFrame; + bodyFrame3.Y -= 336; + if (bodyFrame3.Y < 0) + { + bodyFrame3.Y = 0; + } + if (!drawPlayer.invis) + { + this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame3), color3, drawPlayer.headRotation, vector2, 1f, effects, 0f); + } + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + if (drawPlayer.head == 14 || drawPlayer.head == 56) + { + Rectangle bodyFrame4 = drawPlayer.bodyFrame; + int num22 = 0; + if (bodyFrame4.Y == bodyFrame4.Height * 6) + { + bodyFrame4.Height -= 2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 7) + { + num22 = -2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 8) + { + num22 = -2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 9) + { + num22 = -2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 10) + { + num22 = -2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 13) + { + bodyFrame4.Height -= 2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 14) + { + num22 = -2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 15) + { + num22 = -2; + } + else + { + if (bodyFrame4.Y == bodyFrame4.Height * 16) + { + num22 = -2; + } + } + } + } + } + } + } + } + } + bodyFrame4.Y += num22; + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f + (float)num22))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame4), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + if (drawPlayer.head > 0 && drawPlayer.head < 112 && drawPlayer.head != 28) + { + Main.pixelShader.CurrentTechnique.Passes[index].Apply(); + if (drawPlayer.head > 0 && drawPlayer.head < 112) + { + this.LoadArmorHead(drawPlayer.head); + } + this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector2, 1f, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else + { + if (!drawPlayer.invis) + { + Rectangle bodyFrame5 = drawPlayer.bodyFrame; + bodyFrame5.Y -= 336; + if (bodyFrame5.Y < 0) + { + bodyFrame5.Y = 0; + } + this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.headPosition + vector2, new Rectangle?(bodyFrame5), color3, drawPlayer.headRotation, vector2, 1f, effects, 0f); + } + } + } + } + if (drawPlayer.pulley && drawPlayer.itemAnimation == 0) + { + if (drawPlayer.pulleyDir == 2) + { + int num23 = -26; + int num24 = 0; + float rotation = 0f; + this.spriteBatch.Draw(Main.pulleyTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num24 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num23 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color10, rotation, new Vector2((float)(Main.pulleyTexture.Width / 2), (float)(Main.pulleyTexture.Height / 4)), 1f, effects, 0f); + } + else + { + int num25 = -26; + int num26 = 10; + float rotation2 = 0.35f * (float)(-(float)drawPlayer.direction); + this.spriteBatch.Draw(Main.pulleyTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2) - (float)(9 * drawPlayer.direction)) + num26 * drawPlayer.direction), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(drawPlayer.height / 2) + 2f * drawPlayer.gravDir + (float)num25 * drawPlayer.gravDir))), new Rectangle?(new Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color10, rotation2, new Vector2((float)(Main.pulleyTexture.Width / 2), (float)(Main.pulleyTexture.Height / 4)), 1f, effects, 0f); + } + } + if (drawPlayer.heldProj >= 0) + { + Main.projectile[drawPlayer.heldProj].gfxOffY = drawPlayer.gfxOffY; + this.DrawProj(drawPlayer.heldProj); + } + Color newColor = Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0)); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 678) + { + newColor = Color.White; + } + if (drawPlayer.armorSteath && drawPlayer.inventory[drawPlayer.selectedItem].ranged) + { + float num27 = drawPlayer.stealth; + if ((double)num27 < 0.03) + { + num27 = 0.03f; + } + float num28 = (1f + num27 * 10f) / 11f; + newColor = new Color((int)((byte)((float)newColor.R * num27)), (int)((byte)((float)newColor.G * num27)), (int)((byte)((float)newColor.B * num28)), (int)((byte)((float)newColor.A * num27))); + } + if (!drawPlayer.frozen && (drawPlayer.itemAnimation > 0 || (drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley)) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet)) + { + string arg_38A2_0 = drawPlayer.name; + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 662 || drawPlayer.inventory[drawPlayer.selectedItem].type == 663) + { + newColor.R = (byte)Main.DiscoR; + newColor.G = (byte)Main.DiscoG; + newColor.B = (byte)Main.DiscoB; + newColor.A = 255; + } + if (drawPlayer.inventory[drawPlayer.selectedItem].useStyle == 5) + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 1308 || drawPlayer.inventory[drawPlayer.selectedItem].type == 683 || drawPlayer.inventory[drawPlayer.selectedItem].type == 723 || drawPlayer.inventory[drawPlayer.selectedItem].type == 726 || (drawPlayer.inventory[drawPlayer.selectedItem].type >= 739 && drawPlayer.inventory[drawPlayer.selectedItem].type <= 744) || drawPlayer.inventory[drawPlayer.selectedItem].type == 788 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1326 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1444 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1445 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1446) + { + float num29 = drawPlayer.itemRotation + 0.785f * (float)drawPlayer.direction; + int num30 = 0; + int num31 = 0; + Vector2 origin2 = new Vector2(0f, (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height); + if (drawPlayer.gravDir == -1f) + { + if (drawPlayer.direction == -1) + { + num29 += 1.57f; + origin2 = new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, 0f); + num30 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width; + } + else + { + num29 -= 1.57f; + origin2 = new Vector2(0f, 0f); + } + } + else + { + if (drawPlayer.direction == -1) + { + origin2 = new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height); + num30 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width; + } + } + this.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.position.X + (float)(drawPlayer.width / 2) - Main.screenPosition.X + origin2.X + (float)num30)), (float)((int)(drawPlayer.position.Y + (float)(drawPlayer.height / 2) - Main.screenPosition.Y + (float)num31))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), num29, origin2, drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + } + else + { + Vector2 vector3 = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width / 2), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + Vector2 vector4 = this.DrawPlayerItemPos(drawPlayer); + int num32 = (int)vector4.X; + vector3.Y = vector4.Y; + Vector2 origin3 = new Vector2((float)(-(float)num32), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + if (drawPlayer.direction == -1) + { + origin3 = new Vector2((float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width + num32), (float)(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + } + this.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + vector3.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + vector3.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, origin3, drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X + vector3.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y + vector3.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor), drawPlayer.itemRotation, origin3, drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + } + } + } + else + { + if (drawPlayer.gravDir == -1f) + { + this.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f - (float)Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5f * (float)drawPlayer.direction, 0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + } + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 425 || drawPlayer.inventory[drawPlayer.selectedItem].type == 507) + { + if (drawPlayer.gravDir == 1f) + { + if (drawPlayer.direction == 1) + { + effects2 = SpriteEffects.FlipVertically; + } + else + { + effects2 = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically); + } + } + else + { + if (drawPlayer.direction == 1) + { + effects2 = SpriteEffects.None; + } + else + { + effects2 = SpriteEffects.FlipHorizontally; + } + } + } + int type2 = drawPlayer.inventory[drawPlayer.selectedItem].type; + this.spriteBatch.Draw(Main.itemTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + if (drawPlayer.inventory[drawPlayer.selectedItem].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)), (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y))), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(newColor), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].flame && drawPlayer.shadow == 0f) + { + try + { + this.LoadItemFlames(type2); + if (Main.itemFlameTexture[type2] != null) + { + for (int i = 0; i < 7; i++) + { + float x = drawPlayer.itemFlamePos[i].X; + float y = drawPlayer.itemFlamePos[i].Y; + this.spriteBatch.Draw(Main.itemFlameTexture[type2], new Vector2((float)((int)(drawPlayer.itemLocation.X - Main.screenPosition.X)) + x, (float)((int)(drawPlayer.itemLocation.Y - Main.screenPosition.Y)) + y), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[type2].Width, Main.itemTexture[type2].Height)), new Color(100, 100, 100, 0), drawPlayer.itemRotation, new Vector2((float)Main.itemTexture[type2].Width * 0.5f - (float)Main.itemTexture[type2].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[type2].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effects2, 0f); + } + } + } + catch + { + } + } + } + } + } + if (drawPlayer.body > 0 && drawPlayer.body < 75) + { + Main.pixelShader.CurrentTechnique.Passes[index2].Apply(); + if (drawPlayer.body > 0 && drawPlayer.body < 75) + { + this.LoadArmorBody(drawPlayer.body); + } + this.spriteBatch.Draw(Main.armorArmTexture[drawPlayer.body], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + if ((drawPlayer.body == 10 || drawPlayer.body == 11 || drawPlayer.body == 43 || drawPlayer.body == 12 || drawPlayer.body == 13 || drawPlayer.body == 14 || drawPlayer.body == 15 || drawPlayer.body == 16 || drawPlayer.body == 20 || drawPlayer.body == 39 || drawPlayer.body == 50 || drawPlayer.body == 38 || drawPlayer.body == 40 || drawPlayer.body == 57 || drawPlayer.body == 44 || drawPlayer.body == 52 || drawPlayer.body == 53 || drawPlayer.body == 68) && !drawPlayer.invis) + { + this.spriteBatch.Draw(Main.playerHands2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + } + else + { + if (!drawPlayer.invis) + { + if (!drawPlayer.male) + { + this.spriteBatch.Draw(Main.femaleUnderShirt2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + this.spriteBatch.Draw(Main.femaleShirt2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + else + { + this.spriteBatch.Draw(Main.playerUnderShirt2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + this.spriteBatch.Draw(Main.playerHands2Texture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin, 1f, effects, 0f); + } + } + if (drawPlayer.frozen) + { + Color color15 = color11; + color15.R = (byte)((double)color15.R * 0.55); + color15.G = (byte)((double)color15.G * 0.55); + color15.B = (byte)((double)color15.B * 0.55); + color15.A = (byte)((double)color15.A * 0.55); + this.spriteBatch.Draw(Main.frozenTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, 0, Main.frozenTexture.Width, Main.frozenTexture.Height)), color15, drawPlayer.bodyRotation, new Vector2((float)(Main.frozenTexture.Width / 2), (float)(Main.frozenTexture.Height / 2)), 1f, effects, 0f); + } + if (drawPlayer.iceBarrier && drawPlayer.shadow == 0f) + { + int num33 = this.iceBarrierTexture.Height / 12; + Color white = Color.White; + this.spriteBatch.Draw(this.iceBarrierTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X - (float)(drawPlayer.bodyFrame.Width / 2) + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - (float)drawPlayer.bodyFrame.Height + 4f))) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, num33 * (int)drawPlayer.iceBarrierFrame, this.iceBarrierTexture.Width, num33)), white, 0f, new Vector2((float)(Main.frozenTexture.Width / 2), (float)(Main.frozenTexture.Height / 2)), 1f, effects, 0f); + } + if (drawPlayer.gem >= 0 && drawPlayer.shadow == 0f) + { + this.spriteBatch.Draw(Main.gemTexture[drawPlayer.gem], new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(drawPlayer.width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)drawPlayer.height - 80f))), new Rectangle?(new Rectangle(0, 0, Main.gemTexture[drawPlayer.gem].Width, Main.gemTexture[drawPlayer.gem].Height)), new Color(250, 250, 250, (int)(Main.mouseTextColor / 2)), 0f, new Vector2((float)(Main.gemTexture[drawPlayer.gem].Width / 2), (float)(Main.gemTexture[drawPlayer.gem].Height / 2)), (float)Main.mouseTextColor / 1000f + 0.8f, SpriteEffects.None, 0f); + } + if (drawPlayer.shadow == 0f) + { + drawPlayer.position.Y = drawPlayer.position.Y - drawPlayer.gfxOffY; + } + drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y - drawPlayer.gfxOffY; + } + private static void HelpText() + { + bool flag = false; + if (Main.player[Main.myPlayer].statLifeMax > 100) + { + flag = true; + } + bool flag2 = false; + if (Main.player[Main.myPlayer].statManaMax > 0) + { + flag2 = true; + } + bool flag3 = true; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + bool flag7 = false; + bool flag8 = false; + bool flag9 = false; + for (int i = 0; i < 58; i++) + { + if (Main.player[Main.myPlayer].inventory[i].pick > 0 && Main.player[Main.myPlayer].inventory[i].name != "Copper Pickaxe") + { + flag3 = false; + } + if (Main.player[Main.myPlayer].inventory[i].axe > 0 && Main.player[Main.myPlayer].inventory[i].name != "Copper Axe") + { + flag3 = false; + } + if (Main.player[Main.myPlayer].inventory[i].hammer > 0) + { + flag3 = false; + } + if (Main.player[Main.myPlayer].inventory[i].type == 11 || Main.player[Main.myPlayer].inventory[i].type == 12 || Main.player[Main.myPlayer].inventory[i].type == 13 || Main.player[Main.myPlayer].inventory[i].type == 14) + { + flag4 = true; + } + if (Main.player[Main.myPlayer].inventory[i].type == 19 || Main.player[Main.myPlayer].inventory[i].type == 20 || Main.player[Main.myPlayer].inventory[i].type == 21 || Main.player[Main.myPlayer].inventory[i].type == 22) + { + flag5 = true; + } + if (Main.player[Main.myPlayer].inventory[i].type == 75) + { + flag6 = true; + } + if (Main.player[Main.myPlayer].inventory[i].type == 75) + { + flag7 = true; + } + if (Main.player[Main.myPlayer].inventory[i].type == 68 || Main.player[Main.myPlayer].inventory[i].type == 70) + { + flag8 = true; + } + if (Main.player[Main.myPlayer].inventory[i].type == 84) + { + flag9 = true; + } + } + bool flag10 = false; + bool flag11 = false; + bool flag12 = false; + bool flag13 = false; + bool flag14 = false; + bool flag15 = false; + bool flag16 = false; + bool flag17 = false; + bool flag18 = false; + for (int j = 0; j < 200; j++) + { + if (Main.npc[j].active) + { + if (Main.npc[j].type == 17) + { + flag10 = true; + } + if (Main.npc[j].type == 18) + { + flag11 = true; + } + if (Main.npc[j].type == 19) + { + flag13 = true; + } + if (Main.npc[j].type == 20) + { + flag12 = true; + } + if (Main.npc[j].type == 54) + { + flag18 = true; + } + if (Main.npc[j].type == 124) + { + flag15 = true; + } + if (Main.npc[j].type == 107) + { + flag14 = true; + } + if (Main.npc[j].type == 108) + { + flag16 = true; + } + if (Main.npc[j].type == 38) + { + flag17 = true; + } + } + } + while (true) + { + Main.helpText++; + if (flag3) + { + if (Main.helpText == 1) + { + break; + } + if (Main.helpText == 2) + { + goto Block_31; + } + if (Main.helpText == 3) + { + goto Block_32; + } + if (Main.helpText == 4) + { + goto Block_33; + } + if (Main.helpText == 5) + { + goto Block_34; + } + if (Main.helpText == 6) + { + goto Block_35; + } + } + if (flag3 && !flag4 && !flag5 && Main.helpText == 11) + { + goto Block_39; + } + if (flag3 && flag4 && !flag5) + { + if (Main.helpText == 21) + { + goto Block_43; + } + if (Main.helpText == 22) + { + goto Block_44; + } + } + if (flag3 && flag5) + { + if (Main.helpText == 31) + { + goto Block_47; + } + if (Main.helpText == 32) + { + goto Block_48; + } + } + if (!flag && Main.helpText == 41) + { + goto Block_50; + } + if (!flag2 && Main.helpText == 42) + { + goto Block_52; + } + if (!flag2 && !flag6 && Main.helpText == 43) + { + goto Block_55; + } + if (!flag10 && !flag11) + { + if (Main.helpText == 51) + { + goto Block_58; + } + if (Main.helpText == 52) + { + goto Block_59; + } + if (Main.helpText == 53) + { + goto Block_60; + } + if (Main.helpText == 54) + { + goto Block_61; + } + } + if (!flag10 && Main.helpText == 61) + { + goto Block_63; + } + if (!flag11 && Main.helpText == 62) + { + goto Block_65; + } + if (!flag13 && Main.helpText == 63) + { + goto Block_67; + } + if (!flag12 && Main.helpText == 64) + { + goto Block_69; + } + if (!flag15 && Main.helpText == 65 && NPC.downedBoss3) + { + goto Block_72; + } + if (!flag18 && Main.helpText == 66 && NPC.downedBoss3) + { + goto Block_75; + } + if (!flag14 && Main.helpText == 67) + { + goto Block_77; + } + if (!flag17 && NPC.downedBoss2 && Main.helpText == 68) + { + goto Block_80; + } + if (!flag16 && Main.hardMode && Main.helpText == 69) + { + goto Block_83; + } + if (flag7 && Main.helpText == 71) + { + goto Block_85; + } + if (flag8 && Main.helpText == 72) + { + goto Block_87; + } + if ((flag7 || flag8) && Main.helpText == 80) + { + goto Block_89; + } + if (!flag9 && Main.helpText == 201 && !Main.hardMode && !NPC.downedBoss3 && !NPC.downedBoss2) + { + goto Block_94; + } + if (Main.helpText == 1000 && !NPC.downedBoss1 && !NPC.downedBoss2) + { + goto Block_97; + } + if (Main.helpText == 1001 && !NPC.downedBoss1 && !NPC.downedBoss2) + { + goto Block_100; + } + if (Main.helpText == 1002 && !NPC.downedBoss3) + { + goto Block_102; + } + if (Main.helpText == 1050 && !NPC.downedBoss1 && Main.player[Main.myPlayer].statLifeMax < 200) + { + goto Block_105; + } + if (Main.helpText == 1051 && !NPC.downedBoss1 && Main.player[Main.myPlayer].statDefense <= 10) + { + goto Block_108; + } + if (Main.helpText == 1052 && !NPC.downedBoss1 && Main.player[Main.myPlayer].statLifeMax >= 200 && Main.player[Main.myPlayer].statDefense > 10) + { + goto Block_112; + } + if (Main.helpText == 1053 && NPC.downedBoss1 && !NPC.downedBoss2 && Main.player[Main.myPlayer].statLifeMax < 300) + { + goto Block_116; + } + if (Main.helpText == 1054 && NPC.downedBoss1 && !NPC.downedBoss2 && Main.player[Main.myPlayer].statLifeMax >= 300) + { + goto Block_120; + } + if (Main.helpText == 1055 && NPC.downedBoss1 && !NPC.downedBoss2 && Main.player[Main.myPlayer].statLifeMax >= 300) + { + goto Block_124; + } + if (Main.helpText == 1056 && NPC.downedBoss1 && NPC.downedBoss2 && !NPC.downedBoss3) + { + goto Block_128; + } + if (Main.helpText == 1057 && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedBoss3 && !Main.hardMode && Main.player[Main.myPlayer].statLifeMax < 400) + { + goto Block_134; + } + if (Main.helpText == 1058 && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedBoss3 && !Main.hardMode && Main.player[Main.myPlayer].statLifeMax >= 400) + { + goto Block_140; + } + if (Main.helpText == 1059 && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedBoss3 && !Main.hardMode && Main.player[Main.myPlayer].statLifeMax >= 400) + { + goto Block_146; + } + if (Main.helpText == 1060 && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedBoss3 && !Main.hardMode && Main.player[Main.myPlayer].statLifeMax >= 400) + { + goto Block_152; + } + if (Main.helpText == 1061 && Main.hardMode) + { + goto Block_154; + } + if (Main.helpText == 1062 && Main.hardMode) + { + goto Block_156; + } + if (Main.helpText > 1100) + { + Main.helpText = 0; + } + } + Main.npcChatText = Lang.dialog(177, false); + return; + Block_31: + Main.npcChatText = Lang.dialog(178, false); + return; + Block_32: + Main.npcChatText = Lang.dialog(179, false); + return; + Block_33: + Main.npcChatText = Lang.dialog(180, false); + return; + Block_34: + Main.npcChatText = Lang.dialog(181, false); + return; + Block_35: + Main.npcChatText = Lang.dialog(182, false); + return; + Block_39: + Main.npcChatText = Lang.dialog(183, false); + return; + Block_43: + Main.npcChatText = Lang.dialog(184, false); + return; + Block_44: + Main.npcChatText = Lang.dialog(185, false); + return; + Block_47: + Main.npcChatText = Lang.dialog(186, false); + return; + Block_48: + Main.npcChatText = Lang.dialog(187, false); + return; + Block_50: + Main.npcChatText = Lang.dialog(188, false); + return; + Block_52: + Main.npcChatText = Lang.dialog(189, false); + return; + Block_55: + Main.npcChatText = Lang.dialog(190, false); + return; + Block_58: + Main.npcChatText = Lang.dialog(191, false); + return; + Block_59: + Main.npcChatText = Lang.dialog(192, false); + return; + Block_60: + Main.npcChatText = Lang.dialog(193, false); + return; + Block_61: + Main.npcChatText = Lang.dialog(194, false); + return; + Block_63: + Main.npcChatText = Lang.dialog(195, false); + return; + Block_65: + Main.npcChatText = Lang.dialog(196, false); + return; + Block_67: + Main.npcChatText = Lang.dialog(197, false); + return; + Block_69: + Main.npcChatText = Lang.dialog(198, false); + return; + Block_72: + Main.npcChatText = Lang.dialog(199, false); + return; + Block_75: + Main.npcChatText = Lang.dialog(200, false); + return; + Block_77: + Main.npcChatText = Lang.dialog(201, false); + return; + Block_80: + Main.npcChatText = Lang.dialog(202, false); + return; + Block_83: + Main.npcChatText = Lang.dialog(203, false); + return; + Block_85: + Main.npcChatText = Lang.dialog(204, false); + return; + Block_87: + Main.npcChatText = Lang.dialog(205, false); + return; + Block_89: + Main.npcChatText = Lang.dialog(206, false); + return; + Block_94: + Main.npcChatText = Lang.dialog(207, false); + return; + Block_97: + Main.npcChatText = Lang.dialog(208, false); + return; + Block_100: + Main.npcChatText = Lang.dialog(209, false); + return; + Block_102: + Main.npcChatText = Lang.dialog(210, false); + return; + Block_105: + Main.npcChatText = Lang.dialog(211, false); + return; + Block_108: + Main.npcChatText = Lang.dialog(212, false); + return; + Block_112: + Main.npcChatText = Lang.dialog(213, false); + return; + Block_116: + Main.npcChatText = Lang.dialog(214, false); + return; + Block_120: + Main.npcChatText = Lang.dialog(215, false); + return; + Block_124: + Main.npcChatText = Lang.dialog(216, false); + return; + Block_128: + Main.npcChatText = Lang.dialog(217, false); + return; + Block_134: + Main.npcChatText = Lang.dialog(218, false); + return; + Block_140: + Main.npcChatText = Lang.dialog(219, false); + return; + Block_146: + Main.npcChatText = Lang.dialog(220, false); + return; + Block_152: + Main.npcChatText = Lang.dialog(221, false); + return; + Block_154: + Main.npcChatText = Lang.dialog(222, false); + return; + Block_156: + Main.npcChatText = Lang.dialog(223, false); + } + protected void DrawChat() + { + if (Main.player[Main.myPlayer].talkNPC < 0 && Main.player[Main.myPlayer].sign == -1) + { + Main.npcChatText = ""; + return; + } + if (Main.netMode == 0 && Main.autoPause && Main.player[Main.myPlayer].talkNPC >= 0) + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 105) + { + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(107); + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 106) + { + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(108); + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 123) + { + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(124); + } + } + Color color = new Color(200, 200, 200, 200); + int num = (int)((Main.mouseTextColor * 2 + 255) / 3); + Color color2 = new Color(num, num, num, num); + int num2 = 10; + int num3 = 0; + string[] array = new string[num2]; + int num4 = 0; + int num5 = 0; + if (Main.npcChatText == null) + { + Main.npcChatText = ""; + } + for (int i = 0; i < Main.npcChatText.Length; i++) + { + byte[] bytes = Encoding.ASCII.GetBytes(Main.npcChatText.Substring(i, 1)); + if (bytes[0] == 10) + { + array[num3] = Main.npcChatText.Substring(num4, i - num4); + num3++; + num4 = i + 1; + num5 = i + 1; + } + else + { + if (Main.npcChatText.Substring(i, 1) == " " || i == Main.npcChatText.Length - 1) + { + if (Main.fontMouseText.MeasureString(Main.npcChatText.Substring(num4, i - num4)).X > 470f) + { + array[num3] = Main.npcChatText.Substring(num4, num5 - num4); + num3++; + num4 = num5 + 1; + } + num5 = i; + } + } + if (num3 == 10) + { + Main.npcChatText = Main.npcChatText.Substring(0, i - 1); + num4 = i - 1; + num3 = 9; + break; + } + } + if (num3 < 10) + { + array[num3] = Main.npcChatText.Substring(num4, Main.npcChatText.Length - num4); + } + if (Main.editSign) + { + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + if (this.textBlinkerState == 1) + { + string[] array2; + IntPtr intPtr; + (array2 = array)[(int)(intPtr = (IntPtr)num3)] = array2[(int)intPtr] + "|"; + } + } + num3++; + this.spriteBatch.Draw(Main.chatBackTexture, new Vector2((float)(Main.screenWidth / 2 - Main.chatBackTexture.Width / 2), 100f), new Rectangle?(new Rectangle(0, 0, Main.chatBackTexture.Width, (num3 + 1) * 30)), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.chatBackTexture, new Vector2((float)(Main.screenWidth / 2 - Main.chatBackTexture.Width / 2), (float)(100 + (num3 + 1) * 30)), new Rectangle?(new Rectangle(0, Main.chatBackTexture.Height - 30, Main.chatBackTexture.Width, 30)), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + for (int j = 0; j < num3; j++) + { + for (int k = 0; k < 5; k++) + { + Color color3 = Color.Black; + int num6 = 170 + (Main.screenWidth - 800) / 2; + int num7 = 120 + j * 30; + if (k == 0) + { + num6 -= 2; + } + if (k == 1) + { + num6 += 2; + } + if (k == 2) + { + num7 -= 2; + } + if (k == 3) + { + num7 += 2; + } + if (k == 4) + { + color3 = color2; + } + this.spriteBatch.DrawString(Main.fontMouseText, array[j], new Vector2((float)num6, (float)num7), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + num = (int)Main.mouseTextColor; + color2 = new Color(num, (int)((double)num / 1.1), num / 2, num); + string text = ""; + string text2 = ""; + int num8 = Main.player[Main.myPlayer].statLifeMax - Main.player[Main.myPlayer].statLife; + for (int l = 0; l < 10; l++) + { + int num9 = Main.player[Main.myPlayer].buffType[l]; + if (Main.debuff[num9] && Main.player[Main.myPlayer].buffTime[l] > 0 && num9 != 28 && num9 != 34) + { + num8 += 1000; + } + } + if (Main.player[Main.myPlayer].sign > -1) + { + if (Main.editSign) + { + text = Lang.inter[47]; + } + else + { + text = Lang.inter[48]; + } + } + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 20) + { + text = Lang.inter[28]; + text2 = Lang.inter[49]; + } + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 17 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 19 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 38 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 54 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 108 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 124 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 142 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 160 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 178 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 208 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 209 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 227 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 228 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 229) + { + text = Lang.inter[28]; + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107) + { + text2 = Lang.inter[19]; + } + } + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 37) + { + if (!Main.dayTime) + { + text = Lang.inter[50]; + } + } + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 22) + { + text = Lang.inter[51]; + text2 = Lang.inter[25]; + } + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 18) + { + string text3 = ""; + int num10 = 0; + int num11 = 0; + int num12 = 0; + int num13 = 0; + int num14 = num8; + if (num14 > 0) + { + num14 = (int)((double)num14 * 0.75); + if (num14 < 1) + { + num14 = 1; + } + } + if (num14 < 0) + { + num14 = 0; + } + num8 = num14; + if (num14 >= 1000000) + { + num10 = num14 / 1000000; + num14 -= num10 * 1000000; + } + if (num14 >= 10000) + { + num11 = num14 / 10000; + num14 -= num11 * 10000; + } + if (num14 >= 100) + { + num12 = num14 / 100; + num14 -= num12 * 100; + } + if (num14 >= 1) + { + num13 = num14; + } + if (num10 > 0) + { + object obj = text3; + text3 = string.Concat(new object[] + { + obj, + num10, + " ", + Lang.inter[15], + " " + }); + } + if (num11 > 0) + { + object obj2 = text3; + text3 = string.Concat(new object[] + { + obj2, + num11, + " ", + Lang.inter[16], + " " + }); + } + if (num12 > 0) + { + object obj = text3; + text3 = string.Concat(new object[] + { + obj, + num12, + " ", + Lang.inter[17], + " " + }); + } + if (num13 > 0) + { + object obj = text3; + text3 = string.Concat(new object[] + { + obj, + num13, + " ", + Lang.inter[18], + " " + }); + } + float num15 = (float)Main.mouseTextColor / 255f; + if (num10 > 0) + { + color2 = new Color((int)((byte)(220f * num15)), (int)((byte)(220f * num15)), (int)((byte)(198f * num15)), (int)Main.mouseTextColor); + } + else + { + if (num11 > 0) + { + color2 = new Color((int)((byte)(224f * num15)), (int)((byte)(201f * num15)), (int)((byte)(92f * num15)), (int)Main.mouseTextColor); + } + else + { + if (num12 > 0) + { + color2 = new Color((int)((byte)(181f * num15)), (int)((byte)(192f * num15)), (int)((byte)(193f * num15)), (int)Main.mouseTextColor); + } + else + { + if (num13 > 0) + { + color2 = new Color((int)((byte)(246f * num15)), (int)((byte)(138f * num15)), (int)((byte)(96f * num15)), (int)Main.mouseTextColor); + } + } + } + } + text = Lang.inter[54] + " (" + text3 + ")"; + if (num14 == 0) + { + text = Lang.inter[54]; + } + } + } + } + } + } + } + int num16 = 180 + (Main.screenWidth - 800) / 2; + int num17 = 130 + num3 * 30; + float scale = 0.9f; + if (Main.mouseX > num16 && (float)Main.mouseX < (float)num16 + Main.fontMouseText.MeasureString(text).X && Main.mouseY > num17 && (float)Main.mouseY < (float)num17 + Main.fontMouseText.MeasureString(text).Y) + { + Main.player[Main.myPlayer].mouseInterface = true; + scale = 1.1f; + if (!Main.npcChatFocus2) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.npcChatFocus2 = true; + Main.player[Main.myPlayer].releaseUseItem = false; + } + else + { + if (Main.npcChatFocus2) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.npcChatFocus2 = false; + } + for (int m = 0; m < 5; m++) + { + int num18 = num16; + int num19 = num17; + Color color4 = Color.Black; + if (m == 0) + { + num18 -= 2; + } + if (m == 1) + { + num18 += 2; + } + if (m == 2) + { + num19 -= 2; + } + if (m == 3) + { + num19 += 2; + } + if (m == 4) + { + color4 = color2; + } + Vector2 vector = Main.fontMouseText.MeasureString(text); + vector *= 0.5f; + this.spriteBatch.DrawString(Main.fontMouseText, text, new Vector2((float)num18 + vector.X, (float)num19 + vector.Y), color4, 0f, vector, scale, SpriteEffects.None, 0f); + } + string text4 = Lang.inter[52]; + color2 = new Color(num, (int)((double)num / 1.1), num / 2, num); + num16 = num16 + (int)Main.fontMouseText.MeasureString(text).X + 20; + int num20 = num16 + (int)Main.fontMouseText.MeasureString(text4).X; + num17 = 130 + num3 * 30; + scale = 0.9f; + if (Main.mouseX > num16 && (float)Main.mouseX < (float)num16 + Main.fontMouseText.MeasureString(text4).X && Main.mouseY > num17 && (float)Main.mouseY < (float)num17 + Main.fontMouseText.MeasureString(text4).Y) + { + scale = 1.1f; + if (!Main.npcChatFocus1) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.npcChatFocus1 = true; + Main.player[Main.myPlayer].releaseUseItem = false; + Main.player[Main.myPlayer].controlUseItem = false; + } + else + { + if (Main.npcChatFocus1) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.npcChatFocus1 = false; + } + for (int n = 0; n < 5; n++) + { + int num21 = num16; + int num22 = num17; + Color color5 = Color.Black; + if (n == 0) + { + num21 -= 2; + } + if (n == 1) + { + num21 += 2; + } + if (n == 2) + { + num22 -= 2; + } + if (n == 3) + { + num22 += 2; + } + if (n == 4) + { + color5 = color2; + } + Vector2 vector2 = Main.fontMouseText.MeasureString(text4); + vector2 *= 0.5f; + this.spriteBatch.DrawString(Main.fontMouseText, text4, new Vector2((float)num21 + vector2.X, (float)num22 + vector2.Y), color5, 0f, vector2, scale, SpriteEffects.None, 0f); + } + if (text2 != "") + { + num16 = num20 + (int)Main.fontMouseText.MeasureString(text2).X / 3; + num17 = 130 + num3 * 30; + scale = 0.9f; + if (Main.mouseX > num16 && (float)Main.mouseX < (float)num16 + Main.fontMouseText.MeasureString(text2).X && Main.mouseY > num17 && (float)Main.mouseY < (float)num17 + Main.fontMouseText.MeasureString(text2).Y) + { + Main.player[Main.myPlayer].mouseInterface = true; + scale = 1.1f; + if (!Main.npcChatFocus3) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.npcChatFocus3 = true; + Main.player[Main.myPlayer].releaseUseItem = false; + } + else + { + if (Main.npcChatFocus3) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.npcChatFocus3 = false; + } + for (int num23 = 0; num23 < 5; num23++) + { + int num24 = num16; + int num25 = num17; + Color color6 = Color.Black; + if (num23 == 0) + { + num24 -= 2; + } + if (num23 == 1) + { + num24 += 2; + } + if (num23 == 2) + { + num25 -= 2; + } + if (num23 == 3) + { + num25 += 2; + } + if (num23 == 4) + { + color6 = color2; + } + Vector2 vector3 = Main.fontMouseText.MeasureString(text); + vector3 *= 0.5f; + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num24 + vector3.X, (float)num25 + vector3.Y), color6, 0f, vector3, scale, SpriteEffects.None, 0f); + } + } + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.mouseLeftRelease = false; + Main.player[Main.myPlayer].releaseUseItem = false; + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.npcChatFocus1) + { + Main.player[Main.myPlayer].talkNPC = -1; + Main.player[Main.myPlayer].sign = -1; + Main.editSign = false; + Main.npcChatText = ""; + Main.PlaySound(11, -1, -1, 1); + return; + } + if (Main.npcChatFocus2) + { + if (Main.player[Main.myPlayer].sign != -1) + { + if (!Main.editSign) + { + Main.PlaySound(12, -1, -1, 1); + Main.editSign = true; + Main.clrInput(); + return; + } + Main.PlaySound(12, -1, -1, 1); + int num26 = Main.player[Main.myPlayer].sign; + Sign.TextSign(num26, Main.npcChatText); + Main.editSign = false; + if (Main.netMode == 1) + { + NetMessage.SendData(47, -1, -1, "", num26, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 17) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 1; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 19) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 2; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 124) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 8; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 142) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 9; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 37) + { + if (Main.netMode == 0) + { + NPC.SpawnSkeletron(); + } + else + { + NetMessage.SendData(51, -1, -1, "", Main.myPlayer, 1f, 0f, 0f, 0); + } + Main.npcChatText = ""; + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 20) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 3; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 38) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 4; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 54) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 5; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 6; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 108) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 7; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 160) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 10; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 178) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 11; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 12; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 208) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 13; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 209) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 14; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 227) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 15; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 228) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 16; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 229) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 17; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12, -1, -1, 1); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 22) + { + Main.PlaySound(12, -1, -1, 1); + Main.HelpText(); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 18) + { + Main.PlaySound(12, -1, -1, 1); + if (num8 > 0) + { + if (Main.player[Main.myPlayer].BuyItem(num8)) + { + Main.PlaySound(2, -1, -1, 4); + Main.player[Main.myPlayer].HealEffect(Main.player[Main.myPlayer].statLifeMax - Main.player[Main.myPlayer].statLife, true); + if ((double)Main.player[Main.myPlayer].statLife < (double)Main.player[Main.myPlayer].statLifeMax * 0.25) + { + Main.npcChatText = Lang.dialog(227, false); + } + else + { + if ((double)Main.player[Main.myPlayer].statLife < (double)Main.player[Main.myPlayer].statLifeMax * 0.5) + { + Main.npcChatText = Lang.dialog(228, false); + } + else + { + if ((double)Main.player[Main.myPlayer].statLife < (double)Main.player[Main.myPlayer].statLifeMax * 0.75) + { + Main.npcChatText = Lang.dialog(229, false); + } + else + { + Main.npcChatText = Lang.dialog(230, false); + } + } + } + Main.player[Main.myPlayer].statLife = Main.player[Main.myPlayer].statLifeMax; + for (int num27 = 0; num27 < 10; num27++) + { + int num28 = Main.player[Main.myPlayer].buffType[num27]; + if (Main.debuff[num28] && Main.player[Main.myPlayer].buffTime[num27] > 0 && num28 != 28 && num28 != 34) + { + Main.player[Main.myPlayer].DelBuff(num27); + } + } + return; + } + int num29 = Main.rand.Next(3); + if (num29 == 0) + { + Main.npcChatText = Lang.dialog(52, false); + } + if (num29 == 1) + { + Main.npcChatText = Lang.dialog(53, false); + } + if (num29 == 2) + { + Main.npcChatText = Lang.dialog(54, false); + return; + } + } + else + { + int num30 = Main.rand.Next(3); + if (num30 == 0) + { + Main.npcChatText = Lang.dialog(55, false); + } + if (num30 == 1) + { + Main.npcChatText = Lang.dialog(56, false); + } + if (num30 == 2) + { + Main.npcChatText = Lang.dialog(57, false); + return; + } + } + } + } + } + else + { + if (Main.npcChatFocus3 && Main.player[Main.myPlayer].talkNPC >= 0) + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 20) + { + Main.PlaySound(12, -1, -1, 1); + Main.npcChatText = Lang.evilGood(); + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 22) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.PlaySound(12, -1, -1, 1); + Main.craftGuide = true; + return; + } + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.PlaySound(12, -1, -1, 1); + Main.reforge = true; + } + } + } + } + } + private static bool AccCheck(Item newItem, int slot) + { + if (Main.player[Main.myPlayer].armor[slot].IsTheSameAs(newItem)) + { + return false; + } + for (int i = 0; i < Main.player[Main.myPlayer].armor.Length; i++) + { + if (newItem.IsTheSameAs(Main.player[Main.myPlayer].armor[i])) + { + return true; + } + } + return false; + } + public static Item dyeSwap(Item newItem) + { + if (newItem.dye <= 0) + { + return newItem; + } + for (int i = 0; i < 3; i++) + { + if (Main.player[Main.myPlayer].dye[i].type == 0) + { + Main.dyeSlotCount = i; + break; + } + } + if (Main.dyeSlotCount >= 3) + { + Main.dyeSlotCount = 0; + } + if (Main.dyeSlotCount < 0) + { + Main.dyeSlotCount = 2; + } + Item result = (Item)Main.player[Main.myPlayer].dye[Main.dyeSlotCount].Clone(); + Main.player[Main.myPlayer].dye[Main.dyeSlotCount] = (Item)newItem.Clone(); + Main.dyeSlotCount++; + if (Main.dyeSlotCount >= 3) + { + Main.accSlotCount = 0; + } + Main.PlaySound(7, -1, -1, 1); + Recipe.FindRecipes(); + return result; + } + public static Item armorSwap(Item newItem) + { + for (int i = 0; i < Main.player[Main.myPlayer].armor.Length; i++) + { + if (newItem.IsTheSameAs(Main.player[Main.myPlayer].armor[i])) + { + Main.accSlotCount = i; + } + } + if (newItem.headSlot == -1 && newItem.bodySlot == -1 && newItem.legSlot == -1 && !newItem.accessory) + { + return newItem; + } + Item result = newItem; + if (newItem.headSlot != -1) + { + result = (Item)Main.player[Main.myPlayer].armor[0].Clone(); + Main.player[Main.myPlayer].armor[0] = (Item)newItem.Clone(); + } + else + { + if (newItem.bodySlot != -1) + { + result = (Item)Main.player[Main.myPlayer].armor[1].Clone(); + Main.player[Main.myPlayer].armor[1] = (Item)newItem.Clone(); + } + else + { + if (newItem.legSlot != -1) + { + result = (Item)Main.player[Main.myPlayer].armor[2].Clone(); + Main.player[Main.myPlayer].armor[2] = (Item)newItem.Clone(); + } + else + { + if (newItem.accessory) + { + for (int j = 3; j < 8; j++) + { + if (Main.player[Main.myPlayer].armor[j].type == 0) + { + Main.accSlotCount = j - 3; + break; + } + } + for (int k = 0; k < Main.player[Main.myPlayer].armor.Length; k++) + { + if (newItem.IsTheSameAs(Main.player[Main.myPlayer].armor[k])) + { + Main.accSlotCount = k - 3; + } + } + if (Main.accSlotCount >= 5) + { + Main.accSlotCount = 0; + } + if (Main.accSlotCount < 0) + { + Main.accSlotCount = 4; + } + result = (Item)Main.player[Main.myPlayer].armor[3 + Main.accSlotCount].Clone(); + Main.player[Main.myPlayer].armor[3 + Main.accSlotCount] = (Item)newItem.Clone(); + Main.accSlotCount++; + if (Main.accSlotCount >= 5) + { + Main.accSlotCount = 0; + } + } + } + } + } + Main.PlaySound(7, -1, -1, 1); + Recipe.FindRecipes(); + return result; + } + public static void BankCoins() + { + for (int i = 0; i < 40; i++) + { + if (Main.player[Main.myPlayer].bank[i].type >= 71 && Main.player[Main.myPlayer].bank[i].type <= 73 && Main.player[Main.myPlayer].bank[i].stack == Main.player[Main.myPlayer].bank[i].maxStack) + { + Main.player[Main.myPlayer].bank[i].SetDefaults(Main.player[Main.myPlayer].bank[i].type + 1, false); + for (int j = 0; j < 40; j++) + { + if (j != i && Main.player[Main.myPlayer].bank[j].type == Main.player[Main.myPlayer].bank[i].type && Main.player[Main.myPlayer].bank[j].stack < Main.player[Main.myPlayer].bank[j].maxStack) + { + Main.player[Main.myPlayer].bank[j].stack++; + Main.player[Main.myPlayer].bank[i].SetDefaults(0, false); + Main.BankCoins(); + } + } + } + } + } + public static void ChestCoins() + { + for (int i = 0; i < 40; i++) + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[i].type >= 71 && Main.chest[Main.player[Main.myPlayer].chest].item[i].type <= 73 && Main.chest[Main.player[Main.myPlayer].chest].item[i].stack == Main.chest[Main.player[Main.myPlayer].chest].item[i].maxStack) + { + Main.chest[Main.player[Main.myPlayer].chest].item[i].SetDefaults(Main.chest[Main.player[Main.myPlayer].chest].item[i].type + 1, false); + for (int j = 0; j < 40; j++) + { + if (j != i && Main.chest[Main.player[Main.myPlayer].chest].item[j].type == Main.chest[Main.player[Main.myPlayer].chest].item[i].type && Main.chest[Main.player[Main.myPlayer].chest].item[j].stack < Main.chest[Main.player[Main.myPlayer].chest].item[j].maxStack) + { + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)j, 0f, 0f, 0); + } + Main.chest[Main.player[Main.myPlayer].chest].item[j].stack++; + Main.chest[Main.player[Main.myPlayer].chest].item[i].SetDefaults(0, false); + Main.ChestCoins(); + } + } + } + } + } + protected void DrawNPCHouse() + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].townNPC && !Main.npc[i].homeless && Main.npc[i].homeTileX > 0 && Main.npc[i].homeTileY > 0 && Main.npc[i].type != 37) + { + int num = 1; + int num2 = Main.npc[i].homeTileX; + int num3 = Main.npc[i].homeTileY - 1; + if (Main.tile[num2, num3] != null) + { + bool flag = false; + while (!Main.tile[num2, num3].active() || !Main.tileSolid[(int)Main.tile[num2, num3].type]) + { + num3--; + if (num3 < 10) + { + break; + } + if (Main.tile[num2, num3] == null) + { + flag = true; + break; + } + } + if (!flag) + { + int num4 = 8; + int num5 = 18; + if (Main.tile[num2, num3].type == 19) + { + num5 -= 8; + } + num3++; + int num6 = 0; + float num7 = (float)(num3 * 16); + SpriteEffects effects = SpriteEffects.None; + if (Main.player[Main.myPlayer].gravDir == -1f) + { + num7 -= Main.screenPosition.Y; + num7 = Main.screenPosition.Y + (float)Main.screenHeight - num7; + num7 -= (float)Main.bannerTexture[num].Height; + effects = SpriteEffects.FlipVertically; + num6 = 4; + } + this.spriteBatch.Draw(Main.bannerTexture[num], new Vector2((float)(num2 * 16 - (int)Main.screenPosition.X + num4), num7 - (float)((int)Main.screenPosition.Y) + (float)num5 + (float)num6), new Rectangle?(new Rectangle(0, 0, Main.bannerTexture[num].Width, Main.bannerTexture[num].Height)), Lighting.GetColor(num2, num3), 0f, new Vector2((float)(Main.bannerTexture[num].Width / 2), (float)(Main.bannerTexture[num].Height / 2)), 1f, effects, 0f); + int num8 = NPC.TypeToNum(Main.npc[i].type); + float scale = 1f; + float num9; + if (Main.npcHeadTexture[num8].Width > Main.npcHeadTexture[num8].Height) + { + num9 = (float)Main.npcHeadTexture[num8].Width; + } + else + { + num9 = (float)Main.npcHeadTexture[num8].Height; + } + if (num9 > 24f) + { + scale = 24f / num9; + } + this.spriteBatch.Draw(Main.npcHeadTexture[num8], new Vector2((float)(num2 * 16 - (int)Main.screenPosition.X + num4), num7 - (float)((int)Main.screenPosition.Y) + (float)num5 + 2f), new Rectangle?(new Rectangle(0, 0, Main.npcHeadTexture[num8].Width, Main.npcHeadTexture[num8].Height)), Lighting.GetColor(num2, num3), 0f, new Vector2((float)(Main.npcHeadTexture[num8].Width / 2), (float)(Main.npcHeadTexture[num8].Height / 2)), scale, effects, 0f); + num2 = num2 * 16 - (int)Main.screenPosition.X + num4 - Main.bannerTexture[num].Width / 2; + num3 = num3 * 16 - (int)Main.screenPosition.Y + num5 - Main.bannerTexture[num].Height / 2; + if (Main.mouseX >= num2 && Main.mouseX <= num2 + Main.bannerTexture[num].Width && Main.mouseY >= num3 && Main.mouseY <= num3 + Main.bannerTexture[num].Height) + { + this.MouseText(Main.npc[i].displayName + " the " + Main.npc[i].name, 0, 0); + if (Main.mouseRightRelease && Main.mouseRight) + { + Main.mouseRightRelease = false; + WorldGen.kickOut(i); + Main.PlaySound(12, -1, -1, 1); + } + } + } + } + } + } + } + protected void DrawPlayerChat() + { + if (Main.chatMode) + { + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + string text = Main.chatText; + if (this.textBlinkerState == 1) + { + text += "|"; + } + if (Main.screenWidth > 800) + { + int i = Main.screenWidth - 300; + int num = 78; + this.spriteBatch.Draw(Main.textBackTexture, new Vector2((float)num, (float)(Main.screenHeight - 36)), new Rectangle?(new Rectangle(0, 0, Main.textBackTexture.Width - 100, Main.textBackTexture.Height)), new Color(100, 100, 100, 100), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + i -= 400; + num += 400; + while (i > 0) + { + if (i > 300) + { + this.spriteBatch.Draw(Main.textBackTexture, new Vector2((float)num, (float)(Main.screenHeight - 36)), new Rectangle?(new Rectangle(100, 0, Main.textBackTexture.Width - 200, Main.textBackTexture.Height)), new Color(100, 100, 100, 100), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + i -= 300; + num += 300; + } + else + { + this.spriteBatch.Draw(Main.textBackTexture, new Vector2((float)num, (float)(Main.screenHeight - 36)), new Rectangle?(new Rectangle(Main.textBackTexture.Width - i, 0, Main.textBackTexture.Width - (Main.textBackTexture.Width - i), Main.textBackTexture.Height)), new Color(100, 100, 100, 100), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + i = 0; + } + } + } + else + { + this.spriteBatch.Draw(Main.textBackTexture, new Vector2(78f, (float)(Main.screenHeight - 36)), new Rectangle?(new Rectangle(0, 0, Main.textBackTexture.Width, Main.textBackTexture.Height)), new Color(100, 100, 100, 100), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int j = 0; j < 5; j++) + { + int num2 = 0; + int num3 = 0; + Color black = Color.Black; + if (j == 0) + { + num2 = -2; + } + if (j == 1) + { + num2 = 2; + } + if (j == 2) + { + num3 = -2; + } + if (j == 3) + { + num3 = 2; + } + if (j == 4) + { + black = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + } + this.spriteBatch.DrawString(Main.fontMouseText, text, new Vector2((float)(88 + num2), (float)(Main.screenHeight - 30 + num3)), black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + int num4 = Main.startChatLine; + int num5 = Main.startChatLine + Main.showCount; + if (num5 >= Main.numChatLines) + { + num5 = --Main.numChatLines; + num4 = num5 - Main.showCount; + } + int num6 = 0; + for (int k = num4; k < num5; k++) + { + if (Main.chatMode || Main.chatLine[k].showTime > 0) + { + float num7 = (float)Main.mouseTextColor / 255f; + for (int l = 0; l < 5; l++) + { + int num8 = 0; + int num9 = 0; + Color black2 = Color.Black; + if (l == 0) + { + num8 = -2; + } + if (l == 1) + { + num8 = 2; + } + if (l == 2) + { + num9 = -2; + } + if (l == 3) + { + num9 = 2; + } + if (l == 4) + { + black2 = new Color((int)((byte)((float)Main.chatLine[k].color.R * num7)), (int)((byte)((float)Main.chatLine[k].color.G * num7)), (int)((byte)((float)Main.chatLine[k].color.B * num7)), (int)Main.mouseTextColor); + } + this.spriteBatch.DrawString(Main.fontMouseText, Main.chatLine[k].text, new Vector2((float)(88 + num8), (float)(Main.screenHeight - 30 + num9 - 28 - num6 * 21)), black2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + num6++; + } + } + protected void DrawInventory() + { + if (Main.netMode == 1) + { + int num = 675 + Main.screenWidth - 800; + int num2 = 114 + Main.mH; + if (Main.player[Main.myPlayer].hostile) + { + this.spriteBatch.Draw(Main.itemTexture[4], new Vector2((float)(num - 2), (float)num2), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[4].Width, Main.itemTexture[4].Height)), Main.teamColor[Main.player[Main.myPlayer].team], 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.itemTexture[4], new Vector2((float)(num + 2), (float)num2), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[4].Width, Main.itemTexture[4].Height)), Main.teamColor[Main.player[Main.myPlayer].team], 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + else + { + this.spriteBatch.Draw(Main.itemTexture[4], new Vector2((float)(num - 16), (float)(num2 + 14)), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[4].Width, Main.itemTexture[4].Height)), Main.teamColor[Main.player[Main.myPlayer].team], -0.785f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.itemTexture[4], new Vector2((float)(num + 2), (float)(num2 + 14)), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[4].Width, Main.itemTexture[4].Height)), Main.teamColor[Main.player[Main.myPlayer].team], -0.785f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.mouseX > num && Main.mouseX < num + 34 && Main.mouseY > num2 - 2 && Main.mouseY < num2 + 34) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease && Main.teamCooldown == 0) + { + Main.teamCooldown = Main.teamCooldownLen; + Main.PlaySound(12, -1, -1, 1); + if (Main.player[Main.myPlayer].hostile) + { + Main.player[Main.myPlayer].hostile = false; + } + else + { + Main.player[Main.myPlayer].hostile = true; + } + NetMessage.SendData(30, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + } + num -= 3; + Rectangle value = new Rectangle(Main.mouseX, Main.mouseY, 1, 1); + int width = Main.teamTexture.Width; + int height = Main.teamTexture.Height; + for (int i = 0; i < 5; i++) + { + Rectangle rectangle = default(Rectangle); + if (i == 0) + { + rectangle = new Rectangle(num + 50, num2 - 20, width, height); + } + if (i == 1) + { + rectangle = new Rectangle(num + 40, num2, width, height); + } + if (i == 2) + { + rectangle = new Rectangle(num + 60, num2, width, height); + } + if (i == 3) + { + rectangle = new Rectangle(num + 40, num2 + 20, width, height); + } + if (i == 4) + { + rectangle = new Rectangle(num + 60, num2 + 20, width, height); + } + if (rectangle.Intersects(value)) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease && Main.player[Main.myPlayer].team != i && Main.teamCooldown == 0) + { + Main.teamCooldown = Main.teamCooldownLen; + Main.PlaySound(12, -1, -1, 1); + Main.player[Main.myPlayer].team = i; + NetMessage.SendData(45, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + } + } + this.spriteBatch.Draw(Main.teamTexture, new Vector2((float)(num + 50), (float)(num2 - 20)), new Rectangle?(new Rectangle(0, 0, Main.teamTexture.Width, Main.teamTexture.Height)), Main.teamColor[0], 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.teamTexture, new Vector2((float)(num + 40), (float)num2), new Rectangle?(new Rectangle(0, 0, Main.teamTexture.Width, Main.teamTexture.Height)), Main.teamColor[1], 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.teamTexture, new Vector2((float)(num + 60), (float)num2), new Rectangle?(new Rectangle(0, 0, Main.teamTexture.Width, Main.teamTexture.Height)), Main.teamColor[2], 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.teamTexture, new Vector2((float)(num + 40), (float)(num2 + 20)), new Rectangle?(new Rectangle(0, 0, Main.teamTexture.Width, Main.teamTexture.Height)), Main.teamColor[3], 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.teamTexture, new Vector2((float)(num + 60), (float)(num2 + 20)), new Rectangle?(new Rectangle(0, 0, Main.teamTexture.Width, Main.teamTexture.Height)), Main.teamColor[4], 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + bool flag = false; + Main.inventoryScale = 0.85f; + int num3 = 448; + int num4 = 258; + if (Main.player[Main.myPlayer].chest != -1 || Main.npcShop > 0) + { + num4 += 168; + Main.inventoryScale = 0.755f; + num3 += 5; + } + Color white = new Color(150, 150, 150, 150); + if (Main.mouseX >= num3 && (float)Main.mouseX <= (float)num3 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num4 && (float)Main.mouseY <= (float)num4 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if (Main.mouseItem.type != 0) + { + Main.trashItem.SetDefaults(0, false); + } + Item item = Main.mouseItem; + Main.mouseItem = Main.trashItem; + Main.trashItem = item; + if (Main.trashItem.type == 0 || Main.trashItem.stack < 1) + { + Main.trashItem = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.trashItem) && Main.trashItem.stack != Main.trashItem.maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.trashItem.stack <= Main.mouseItem.maxStack) + { + Main.trashItem.stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num5 = Main.mouseItem.maxStack - Main.trashItem.stack; + Main.trashItem.stack += num5; + Main.mouseItem.stack -= num5; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.trashItem.type > 0) + { + Main.PlaySound(7, -1, -1, 1); + } + } + if (!flag) + { + Main.hoverItemName = Main.trashItem.name; + if (Main.trashItem.stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.trashItem.stack, + ")" + }); + } + Main.toolTip = (Item)Main.trashItem.Clone(); + if (Main.hoverItemName == null) + { + Main.hoverItemName = Lang.inter[3]; + } + } + else + { + Main.hoverItemName = Lang.inter[3]; + } + } + this.spriteBatch.Draw(Main.inventoryBack7Texture, new Vector2((float)num3, (float)num4), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white = Color.White; + if (Main.trashItem.type == 0 || Main.trashItem.stack == 0 || flag) + { + white = new Color(100, 100, 100, 100); + float num6 = Main.inventoryScale; + this.spriteBatch.Draw(Main.trashTexture, new Vector2((float)num3 + 26f * Main.inventoryScale - (float)Main.trashTexture.Width * 0.5f * num6, (float)num4 + 26f * Main.inventoryScale - (float)Main.trashTexture.Height * 0.5f * num6), new Rectangle?(new Rectangle(0, 0, Main.trashTexture.Width, Main.trashTexture.Height)), white, 0f, default(Vector2), num6, SpriteEffects.None, 0f); + } + else + { + float num7 = 1f; + if (Main.itemTexture[Main.trashItem.type].Width > 32 || Main.itemTexture[Main.trashItem.type].Height > 32) + { + if (Main.itemTexture[Main.trashItem.type].Width > Main.itemTexture[Main.trashItem.type].Height) + { + num7 = 32f / (float)Main.itemTexture[Main.trashItem.type].Width; + } + else + { + num7 = 32f / (float)Main.itemTexture[Main.trashItem.type].Height; + } + } + num7 *= Main.inventoryScale; + if (Main.trashItem.type == 662 || Main.trashItem.type == 663) + { + white.R = (byte)Main.DiscoR; + white.G = (byte)Main.DiscoG; + white.B = (byte)Main.DiscoB; + white.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.trashItem.type], new Vector2((float)num3 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.trashItem.type].Width * 0.5f * num7, (float)num4 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.trashItem.type].Height * 0.5f * num7), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.trashItem.type].Width, Main.itemTexture[Main.trashItem.type].Height)), Main.trashItem.GetAlpha(white), 0f, default(Vector2), num7, SpriteEffects.None, 0f); + if (Main.trashItem.color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.trashItem.type], new Vector2((float)num3 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.trashItem.type].Width * 0.5f * num7, (float)num4 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.trashItem.type].Height * 0.5f * num7), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.trashItem.type].Width, Main.itemTexture[Main.trashItem.type].Height)), Main.trashItem.GetColor(white), 0f, default(Vector2), num7, SpriteEffects.None, 0f); + } + white = Color.White; + if (Main.trashItem.stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.trashItem.stack), new Vector2((float)num3 + 10f * Main.inventoryScale, (float)num4 + 26f * Main.inventoryScale), white, 0f, default(Vector2), num7, SpriteEffects.None, 0f); + } + } + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[4], new Vector2(40f, 0f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Main.inventoryScale = 0.85f; + if (Main.mouseX > 20 && Main.mouseX < (int)(20f + 560f * Main.inventoryScale) && Main.mouseY > 20 && Main.mouseY < (int)(20f + 224f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int j = 0; j < 10; j++) + { + for (int k = 0; k < 5; k++) + { + int num8 = (int)(20f + (float)(j * 56) * Main.inventoryScale); + int num9 = (int)(20f + (float)(k * 56) * Main.inventoryScale); + int num10 = j + k * 10; + Color white2 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num8 && (float)Main.mouseX <= (float)num8 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num9 && (float)Main.mouseY <= (float)num9 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if (Main.keyState.IsKeyDown(Keys.LeftShift)) + { + if (Main.player[Main.myPlayer].inventory[num10].type > 0) + { + if (Main.npcShop > 0) + { + if (Main.player[Main.myPlayer].inventory[num10].type < 71 || Main.player[Main.myPlayer].inventory[num10].type > 74) + { + if (Main.player[Main.myPlayer].SellItem(Main.player[Main.myPlayer].inventory[num10].value, Main.player[Main.myPlayer].inventory[num10].stack)) + { + this.shop[Main.npcShop].AddShop(Main.player[Main.myPlayer].inventory[num10]); + Main.player[Main.myPlayer].inventory[num10].SetDefaults(0, false); + Main.PlaySound(18, -1, -1, 1); + } + else + { + if (Main.player[Main.myPlayer].inventory[num10].value == 0) + { + this.shop[Main.npcShop].AddShop(Main.player[Main.myPlayer].inventory[num10]); + Main.player[Main.myPlayer].inventory[num10].SetDefaults(0, false); + Main.PlaySound(7, -1, -1, 1); + } + } + } + } + else + { + Main.PlaySound(7, -1, -1, 1); + Main.trashItem = (Item)Main.player[Main.myPlayer].inventory[num10].Clone(); + Main.player[Main.myPlayer].inventory[num10].SetDefaults(0, false); + Recipe.FindRecipes(); + } + } + } + else + { + if ((Main.player[Main.myPlayer].selectedItem != num10 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0) + { + Item item2 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].inventory[num10]; + Main.player[Main.myPlayer].inventory[num10] = item2; + if (Main.player[Main.myPlayer].inventory[num10].type == 0 || Main.player[Main.myPlayer].inventory[num10].stack < 1) + { + Main.player[Main.myPlayer].inventory[num10] = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].inventory[num10]) && Main.player[Main.myPlayer].inventory[num10].stack != Main.player[Main.myPlayer].inventory[num10].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.player[Main.myPlayer].inventory[num10].stack <= Main.mouseItem.maxStack) + { + Main.player[Main.myPlayer].inventory[num10].stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num11 = Main.mouseItem.maxStack - Main.player[Main.myPlayer].inventory[num10].stack; + Main.player[Main.myPlayer].inventory[num10].stack += num11; + Main.mouseItem.stack -= num11; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].inventory[num10].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + } + Recipe.FindRecipes(); + } + else + { + if (Main.mouseRight && Main.mouseRightRelease && (Main.player[Main.myPlayer].inventory[num10].type == 599 || Main.player[Main.myPlayer].inventory[num10].type == 600 || Main.player[Main.myPlayer].inventory[num10].type == 601)) + { + Main.PlaySound(7, -1, -1, 1); + Main.stackSplit = 30; + Main.mouseRightRelease = false; + int num12 = Main.rand.Next(14); + if (num12 == 0 && Main.hardMode) + { + Main.player[Main.myPlayer].inventory[num10].SetDefaults(602, false); + } + else + { + if (num12 <= 7) + { + Main.player[Main.myPlayer].inventory[num10].SetDefaults(586, false); + Main.player[Main.myPlayer].inventory[num10].stack = Main.rand.Next(20, 50); + } + else + { + Main.player[Main.myPlayer].inventory[num10].SetDefaults(591, false); + Main.player[Main.myPlayer].inventory[num10].stack = Main.rand.Next(20, 50); + } + } + Recipe.FindRecipes(); + } + else + { + if (Main.mouseRight && Main.mouseRightRelease && Main.player[Main.myPlayer].inventory[num10].maxStack == 1) + { + if (Main.player[Main.myPlayer].inventory[num10].dye > 0) + { + Main.player[Main.myPlayer].inventory[num10] = Main.dyeSwap(Main.player[Main.myPlayer].inventory[num10]); + } + else + { + Main.player[Main.myPlayer].inventory[num10] = Main.armorSwap(Main.player[Main.myPlayer].inventory[num10]); + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && Main.player[Main.myPlayer].inventory[num10].maxStack > 1 && Main.player[Main.myPlayer].inventory[num10].type > 0 && (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].inventory[num10]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.player[Main.myPlayer].inventory[num10].Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.player[Main.myPlayer].inventory[num10].stack--; + if (Main.player[Main.myPlayer].inventory[num10].stack <= 0) + { + Main.player[Main.myPlayer].inventory[num10] = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + } + } + Main.hoverItemName = Main.player[Main.myPlayer].inventory[num10].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].inventory[num10].Clone(); + if (Main.player[Main.myPlayer].inventory[num10].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].inventory[num10].stack, + ")" + }); + } + } + if (k != 0) + { + this.spriteBatch.Draw(Main.inventoryBackTexture, new Vector2((float)num8, (float)num9), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.inventoryBack9Texture, new Vector2((float)num8, (float)num9), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + } + white2 = Color.White; + if (Main.player[Main.myPlayer].inventory[num10].type > 0 && Main.player[Main.myPlayer].inventory[num10].stack > 0) + { + float num13 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width > Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height) + { + num13 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width; + } + else + { + num13 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height; + } + } + num13 *= Main.inventoryScale; + if (Main.player[Main.myPlayer].inventory[num10].type == 662 || Main.player[Main.myPlayer].inventory[num10].type == 663) + { + white2.R = (byte)Main.DiscoR; + white2.G = (byte)Main.DiscoG; + white2.B = (byte)Main.DiscoB; + white2.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type], new Vector2((float)num8 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width * 0.5f * num13, (float)num9 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height * 0.5f * num13), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height)), Main.player[Main.myPlayer].inventory[num10].GetAlpha(white2), 0f, default(Vector2), num13, SpriteEffects.None, 0f); + white2 = Color.White; + if (Main.player[Main.myPlayer].inventory[num10].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type], new Vector2((float)num8 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width * 0.5f * num13, (float)num9 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height * 0.5f * num13), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[num10].type].Height)), Main.player[Main.myPlayer].inventory[num10].GetColor(white2), 0f, default(Vector2), num13, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].inventory[num10].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].inventory[num10].stack), new Vector2((float)num8 + 10f * Main.inventoryScale, (float)num9 + 26f * Main.inventoryScale), white2, 0f, default(Vector2), num13, SpriteEffects.None, 0f); + } + } + if (k == 0) + { + string text = string.Concat(num10 + 1); + if (text == "10") + { + text = "0"; + } + Color color = Main.inventoryBack; + if (Main.player[Main.myPlayer].selectedItem == num10) + { + color.R = 0; + color.B = 0; + color.G = 255; + color.A = 50; + } + this.spriteBatch.DrawString(Main.fontItemStack, text, new Vector2((float)(num8 + 6), (float)(num9 + 4)), color, 0f, default(Vector2), Main.inventoryScale * 0.8f, SpriteEffects.None, 0f); + } + } + } + int num14 = 0; + int num15 = 2; + int num16 = 32; + if (!Main.player[Main.myPlayer].hbLocked) + { + num14 = 1; + } + this.spriteBatch.Draw(Main.HBLockTexture[num14], new Vector2((float)num15, (float)num16), new Rectangle?(new Rectangle(0, 0, Main.HBLockTexture[num14].Width, Main.HBLockTexture[num14].Height)), Main.inventoryBack, 0f, default(Vector2), 0.9f, SpriteEffects.None, 0f); + if (Main.mouseX > num15 && (float)Main.mouseX < (float)num15 + (float)Main.HBLockTexture[num14].Width * 0.9f && Main.mouseY > num16 && (float)Main.mouseY < (float)num16 + (float)Main.HBLockTexture[num14].Height * 0.9f) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (!Main.player[Main.myPlayer].hbLocked) + { + this.MouseText(Lang.inter[5], 0, 0); + Main.mouseText = true; + } + else + { + this.MouseText(Lang.inter[6], 0, 0); + Main.mouseText = true; + } + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(22, -1, -1, 1); + if (!Main.player[Main.myPlayer].hbLocked) + { + Main.player[Main.myPlayer].hbLocked = true; + } + else + { + Main.player[Main.myPlayer].hbLocked = false; + } + } + } + if (Main.mapEnabled) + { + bool flag2 = false; + int num17 = Main.screenWidth - 440; + int num18 = 40; + if (Main.screenWidth < 940) + { + flag2 = true; + } + if (flag2) + { + num17 = Main.screenWidth - 40; + num18 = Main.screenHeight - 200; + } + for (int l = 0; l < 4; l++) + { + int num19 = num17 + l * 32; + int num20 = num18; + if (flag2) + { + num19 = num17; + num20 = num18 + l * 32; + } + int num21 = l; + int num22 = 120; + if (l > 0 && Main.mapStyle == l - 1) + { + num22 = 200; + } + if (Main.mouseX >= num19 && Main.mouseX <= num19 + 32 && Main.mouseY >= num20 && Main.mouseY <= num20 + 30) + { + num22 = 255; + num21 += 4; + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + if (l == 0) + { + Main.playerInventory = false; + Main.player[Main.myPlayer].talkNPC = -1; + Main.PlaySound(10, -1, -1, 1); + float num23 = 2.5f; + Main.mapFullscreenScale = num23; + Main.mapFullscreen = true; + Main.resetMapFull = true; + } + if (l == 1) + { + Main.mapStyle = 0; + Main.PlaySound(12, -1, -1, 1); + } + if (l == 2) + { + Main.mapStyle = 1; + Main.PlaySound(12, -1, -1, 1); + } + if (l == 3) + { + Main.mapStyle = 2; + Main.PlaySound(12, -1, -1, 1); + } + } + } + this.spriteBatch.Draw(this.mapIconTexture[num21], new Vector2((float)num19, (float)num20), new Rectangle?(new Rectangle(0, 0, this.mapIconTexture[num21].Width, this.mapIconTexture[num21].Height)), new Color(num22, num22, num22, num22), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + if (Main.armorHide) + { + Main.armorAlpha -= 0.1f; + if (Main.armorAlpha < 0f) + { + Main.armorAlpha = 0f; + } + } + else + { + Main.armorAlpha += 0.025f; + if (Main.armorAlpha > 1f) + { + Main.armorAlpha = 1f; + } + } + Color color2 = new Color((int)((byte)((float)Main.mouseTextColor * Main.armorAlpha)), (int)((byte)((float)Main.mouseTextColor * Main.armorAlpha)), (int)((byte)((float)Main.mouseTextColor * Main.armorAlpha)), (int)((byte)((float)Main.mouseTextColor * Main.armorAlpha))); + Main.armorHide = false; + int num24 = 1; + int num25 = Main.screenWidth - 152; + int num26 = 128 + Main.mH; + if (Main.netMode == 0) + { + num25 += 72; + } + if (this.showNPCs) + { + num24 = 0; + } + this.spriteBatch.Draw(Main.npcToggleTexture[num24], new Vector2((float)num25, (float)num26), new Rectangle?(new Rectangle(0, 0, Main.npcToggleTexture[num24].Width, Main.npcToggleTexture[num24].Height)), Color.White, 0f, default(Vector2), 0.9f, SpriteEffects.None, 0f); + if (Main.mouseX > num25 && (float)Main.mouseX < (float)num25 + (float)Main.npcToggleTexture[num24].Width * 0.9f && Main.mouseY > num26 && (float)Main.mouseY < (float)num26 + (float)Main.npcToggleTexture[num24].Height * 0.9f) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(12, -1, -1, 1); + if (!this.showNPCs) + { + this.showNPCs = true; + } + else + { + this.showNPCs = false; + } + } + } + if (this.showNPCs) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[7], new Vector2((float)(Main.screenWidth - 64 - 28 - 3), (float)(152 + Main.mH)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 0.8f, SpriteEffects.None, 0f); + if (Main.mouseX > Main.screenWidth - 64 - 28 && Main.mouseX < (int)((float)(Main.screenWidth - 64 - 28) + 56f * Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int)((float)(174 + Main.mH) + 448f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + int num27 = 0; + string cursorText = ""; + int num28 = 0; + int num29 = 0; + for (int m = 0; m < Main.npcHeadTexture.Length; m++) + { + bool flag3 = false; + int num30 = 0; + if (m == 0) + { + flag3 = true; + } + else + { + for (int n = 0; n < 200; n++) + { + if (Main.npc[n].active && NPC.TypeToNum(Main.npc[n].type) == m) + { + flag3 = true; + num30 = n; + break; + } + } + } + if (flag3) + { + int num31 = Main.screenWidth - 64 - 28 + num29; + int num32 = (int)((float)(174 + Main.mH) + (float)(num27 * 56) * Main.inventoryScale) + num28; + Color white3 = new Color(100, 100, 100, 100); + if (num32 > Main.screenHeight - 80) + { + num29 -= 48; + num28 -= num32 - (174 + Main.mH); + num31 = Main.screenWidth - 64 - 28 + num29; + num32 = (int)((float)(174 + Main.mH) + (float)(num27 * 56) * Main.inventoryScale) + num28; + } + if (Main.mouseX >= num31 && (float)Main.mouseX <= (float)num31 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num32 && (float)Main.mouseY <= (float)num32 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.mouseText = true; + if (m == 0) + { + cursorText = Lang.inter[8]; + } + else + { + if (m == 11) + { + cursorText = Main.npc[num30].displayName; + } + else + { + cursorText = Main.npc[num30].displayName + " the " + Main.npc[num30].name; + } + } + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft && Main.mouseItem.type == 0) + { + Main.PlaySound(12, -1, -1, 1); + this.mouseNPC = m; + Main.mouseLeftRelease = false; + } + } + this.spriteBatch.Draw(Main.inventoryBack11Texture, new Vector2((float)num31, (float)num32), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white3 = Color.White; + int num33 = m; + float scale = 1f; + float num34; + if (Main.npcHeadTexture[num33].Width > Main.npcHeadTexture[num33].Height) + { + num34 = (float)Main.npcHeadTexture[num33].Width; + } + else + { + num34 = (float)Main.npcHeadTexture[num33].Height; + } + if (num34 > 36f) + { + scale = 36f / num34; + } + this.spriteBatch.Draw(Main.npcHeadTexture[num33], new Vector2((float)num31 + 26f * Main.inventoryScale, (float)num32 + 26f * Main.inventoryScale), new Rectangle?(new Rectangle(0, 0, Main.npcHeadTexture[num33].Width, Main.npcHeadTexture[num33].Height)), white3, 0f, new Vector2((float)(Main.npcHeadTexture[num33].Width / 2), (float)(Main.npcHeadTexture[num33].Height / 2)), scale, SpriteEffects.None, 0f); + num27++; + } + } + if (cursorText != "" && Main.mouseItem.type == 0) + { + this.MouseText(cursorText, 0, 0); + } + } + else + { + Vector2 vector = Main.fontMouseText.MeasureString("Equip"); + Vector2 vector2 = Main.fontMouseText.MeasureString(Lang.inter[45]); + float num35 = vector.X / vector2.X; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[45], new Vector2((float)(Main.screenWidth - 64 - 28 + 4), (float)(152 + Main.mH) + (vector.Y - vector.Y * num35) / 2f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 0.8f * num35, SpriteEffects.None, 0f); + if (Main.mouseX > Main.screenWidth - 64 - 28 && Main.mouseX < (int)((float)(Main.screenWidth - 64 - 28) + 56f * Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int)((float)(174 + Main.mH) + 448f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num36 = 0; num36 < 8; num36++) + { + int num37 = Main.screenWidth - 64 - 28; + int num38 = (int)((float)(174 + Main.mH) + (float)(num36 * 56) * Main.inventoryScale); + Color white4 = new Color(100, 100, 100, 100); + string text2 = ""; + if (num36 == 3) + { + text2 = Lang.inter[9]; + } + if (num36 == 7) + { + text2 = Main.player[Main.myPlayer].statDefense + " " + Lang.inter[10]; + } + Vector2 vector3 = Main.fontMouseText.MeasureString(text2); + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num37 - vector3.X - 10f, (float)num38 + (float)Main.inventoryBackTexture.Height * 0.5f - vector3.Y * 0.5f), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + if (Main.mouseX >= num37 && (float)Main.mouseX <= (float)num37 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num38 && (float)Main.mouseY <= (float)num38 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.armorHide = true; + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft && (Main.mouseItem.type == 0 || (Main.mouseItem.headSlot > -1 && num36 == 0) || (Main.mouseItem.bodySlot > -1 && num36 == 1) || (Main.mouseItem.legSlot > -1 && num36 == 2) || (Main.mouseItem.accessory && num36 > 2 && !Main.AccCheck(Main.mouseItem, num36)))) + { + Item item3 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].armor[num36]; + Main.player[Main.myPlayer].armor[num36] = item3; + if (Main.player[Main.myPlayer].armor[num36].type == 0 || Main.player[Main.myPlayer].armor[num36].stack < 1) + { + Main.player[Main.myPlayer].armor[num36] = new Item(); + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].armor[num36].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + Main.hoverItemName = Main.player[Main.myPlayer].armor[num36].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].armor[num36].Clone(); + if (num36 <= 2) + { + Main.toolTip.wornArmor = true; + } + if (Main.player[Main.myPlayer].armor[num36].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].armor[num36].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack3Texture, new Vector2((float)num37, (float)num38), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white4 = Color.White; + if (Main.player[Main.myPlayer].armor[num36].type > 0 && Main.player[Main.myPlayer].armor[num36].stack > 0) + { + float num39 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width > Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height) + { + num39 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width; + } + else + { + num39 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height; + } + } + num39 *= Main.inventoryScale; + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type], new Vector2((float)num37 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width * 0.5f * num39, (float)num38 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height * 0.5f * num39), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width, Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height)), Main.player[Main.myPlayer].armor[num36].GetAlpha(white4), 0f, default(Vector2), num39, SpriteEffects.None, 0f); + if (Main.player[Main.myPlayer].armor[num36].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type], new Vector2((float)num37 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width * 0.5f * num39, (float)num38 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height * 0.5f * num39), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Width, Main.itemTexture[Main.player[Main.myPlayer].armor[num36].type].Height)), Main.player[Main.myPlayer].armor[num36].GetColor(white4), 0f, default(Vector2), num39, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].armor[num36].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].armor[num36].stack), new Vector2((float)num37 + 10f * Main.inventoryScale, (float)num38 + 26f * Main.inventoryScale), white4, 0f, default(Vector2), num39, SpriteEffects.None, 0f); + } + } + } + Vector2 vector4 = Main.fontMouseText.MeasureString("Social"); + Vector2 vector5 = Main.fontMouseText.MeasureString(Lang.inter[11]); + float num40 = vector4.X / vector5.X; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[11], new Vector2((float)(Main.screenWidth - 64 - 28 - 44), (float)(152 + Main.mH) + (vector4.Y - vector4.Y * num40) / 2f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 0.8f * num40, SpriteEffects.None, 0f); + if (Main.mouseX > Main.screenWidth - 64 - 28 - 47 && Main.mouseX < (int)((float)(Main.screenWidth - 64 - 20 - 47) + 56f * Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int)((float)(174 + Main.mH) + 168f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num41 = 8; num41 < 11; num41++) + { + int num42 = Main.screenWidth - 64 - 28 - 47; + int num43 = (int)((float)(174 + Main.mH) + (float)((num41 - 8) * 56) * Main.inventoryScale); + Color white5 = new Color(100, 100, 100, 100); + string text3 = ""; + if (num41 == 8) + { + text3 = Lang.inter[12]; + } + else + { + if (num41 == 9) + { + text3 = Lang.inter[13]; + } + else + { + if (num41 == 10) + { + text3 = Lang.inter[14]; + } + } + } + Vector2 vector6 = Main.fontMouseText.MeasureString(text3); + this.spriteBatch.DrawString(Main.fontMouseText, text3, new Vector2((float)num42 - vector6.X - 10f - 47f, (float)num43 + (float)Main.inventoryBackTexture.Height * 0.5f - vector6.Y * 0.5f), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + if (Main.mouseX >= num42 && (float)Main.mouseX <= (float)num42 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num43 && (float)Main.mouseY <= (float)num43 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + Main.armorHide = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if (Main.mouseItem.type == 0 || (Main.mouseItem.headSlot > -1 && num41 == 8) || (Main.mouseItem.bodySlot > -1 && num41 == 9) || (Main.mouseItem.legSlot > -1 && num41 == 10)) + { + Item item4 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].armor[num41]; + Main.player[Main.myPlayer].armor[num41] = item4; + if (Main.player[Main.myPlayer].armor[num41].type == 0 || Main.player[Main.myPlayer].armor[num41].stack < 1) + { + Main.player[Main.myPlayer].armor[num41] = new Item(); + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].armor[num41].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + } + else + { + if (Main.mouseRight && Main.mouseRightRelease && Main.player[Main.myPlayer].armor[num41].maxStack == 1) + { + Main.player[Main.myPlayer].armor[num41] = Main.armorSwap(Main.player[Main.myPlayer].armor[num41]); + } + } + Main.hoverItemName = Main.player[Main.myPlayer].armor[num41].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].armor[num41].Clone(); + Main.toolTip.social = true; + if (num41 <= 2) + { + Main.toolTip.wornArmor = true; + } + if (Main.player[Main.myPlayer].armor[num41].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].armor[num41].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack8Texture, new Vector2((float)num42, (float)num43), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white5 = Color.White; + if (Main.player[Main.myPlayer].armor[num41].type > 0 && Main.player[Main.myPlayer].armor[num41].stack > 0) + { + float num44 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width > Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height) + { + num44 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width; + } + else + { + num44 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height; + } + } + num44 *= Main.inventoryScale; + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type], new Vector2((float)num42 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width * 0.5f * num44, (float)num43 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height * 0.5f * num44), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width, Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height)), Main.player[Main.myPlayer].armor[num41].GetAlpha(white5), 0f, default(Vector2), num44, SpriteEffects.None, 0f); + if (Main.player[Main.myPlayer].armor[num41].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type], new Vector2((float)num42 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width * 0.5f * num44, (float)num43 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height * 0.5f * num44), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Width, Main.itemTexture[Main.player[Main.myPlayer].armor[num41].type].Height)), Main.player[Main.myPlayer].armor[num41].GetColor(white5), 0f, default(Vector2), num44, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].armor[num41].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].armor[num41].stack), new Vector2((float)num42 + 10f * Main.inventoryScale, (float)num43 + 26f * Main.inventoryScale), white5, 0f, default(Vector2), num44, SpriteEffects.None, 0f); + } + } + } + Vector2 vector7 = Main.fontMouseText.MeasureString("Dye"); + Vector2 vector8 = Main.fontMouseText.MeasureString(Lang.inter[57]); + float num45 = vector7.X / vector8.X; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[57], new Vector2((float)(Main.screenWidth - 64 - 28 - 44 - 40), (float)(152 + Main.mH) + (vector7.Y - vector7.Y * num45) / 2f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 0.8f * num45, SpriteEffects.None, 0f); + if (Main.mouseX > Main.screenWidth - 64 - 28 - 47 && Main.mouseX < (int)((float)(Main.screenWidth - 64 - 20 - 47) + 56f * Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int)((float)(174 + Main.mH) + 168f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num46 = 0; num46 < 3; num46++) + { + int num47 = Main.screenWidth - 64 - 28 - 47 - 47; + int num48 = (int)((float)(174 + Main.mH) + (float)(num46 * 56) * Main.inventoryScale); + Color white6 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num47 && (float)Main.mouseX <= (float)num47 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num48 && (float)Main.mouseY <= (float)num48 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + Main.armorHide = true; + if (Main.mouseLeftRelease && Main.mouseLeft && (Main.mouseItem.type == 0 || Main.mouseItem.dye > 0)) + { + Item item5 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].dye[num46]; + Main.player[Main.myPlayer].dye[num46] = item5; + if (Main.player[Main.myPlayer].dye[num46].type == 0 || Main.player[Main.myPlayer].dye[num46].stack < 1) + { + Main.player[Main.myPlayer].dye[num46] = new Item(); + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].dye[num46].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + Main.hoverItemName = Main.player[Main.myPlayer].dye[num46].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].dye[num46].Clone(); + if (Main.player[Main.myPlayer].dye[num46].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].dye[num46].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack12Texture, new Vector2((float)num47, (float)num48), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white6 = Color.White; + if (Main.player[Main.myPlayer].dye[num46].type > 0 && Main.player[Main.myPlayer].dye[num46].stack > 0) + { + float num49 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width > Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height) + { + num49 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width; + } + else + { + num49 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height; + } + } + num49 *= Main.inventoryScale; + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type], new Vector2((float)num47 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width * 0.5f * num49, (float)num48 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height * 0.5f * num49), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width, Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height)), Main.player[Main.myPlayer].dye[num46].GetAlpha(white6), 0f, default(Vector2), num49, SpriteEffects.None, 0f); + if (Main.player[Main.myPlayer].dye[num46].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type], new Vector2((float)num47 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width * 0.5f * num49, (float)num48 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height * 0.5f * num49), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Width, Main.itemTexture[Main.player[Main.myPlayer].dye[num46].type].Height)), Main.player[Main.myPlayer].dye[num46].GetColor(white6), 0f, default(Vector2), num49, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].dye[num46].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].dye[num46].stack), new Vector2((float)num47 + 10f * Main.inventoryScale, (float)num48 + 26f * Main.inventoryScale), white6, 0f, default(Vector2), num49, SpriteEffects.None, 0f); + } + } + } + } + int num50 = (Main.screenHeight - 600) / 2; + int num51 = (int)((float)Main.screenHeight / 600f * 250f); + if (Main.screenHeight < 700) + { + num50 = (Main.screenHeight - 508) / 2; + num51 = (int)((float)Main.screenHeight / 600f * 200f); + } + else + { + if (Main.screenHeight < 850) + { + num51 = (int)((float)Main.screenHeight / 600f * 225f); + } + } + if (Main.craftingHide) + { + Main.craftingAlpha -= 0.1f; + if (Main.craftingAlpha < 0f) + { + Main.craftingAlpha = 0f; + } + } + else + { + Main.craftingAlpha += 0.025f; + if (Main.craftingAlpha > 1f) + { + Main.craftingAlpha = 1f; + } + } + Color color3 = new Color((int)((byte)((float)Main.mouseTextColor * Main.craftingAlpha)), (int)((byte)((float)Main.mouseTextColor * Main.craftingAlpha)), (int)((byte)((float)Main.mouseTextColor * Main.craftingAlpha)), (int)((byte)((float)Main.mouseTextColor * Main.craftingAlpha))); + Main.craftingHide = false; + if (Main.reforge) + { + if (Main.mouseReforge) + { + if ((double)Main.reforgeScale < 1.3) + { + Main.reforgeScale += 0.02f; + } + } + else + { + if (Main.reforgeScale > 1f) + { + Main.reforgeScale -= 0.02f; + } + } + if (Main.player[Main.myPlayer].chest != -1 || Main.npcShop != 0 || Main.player[Main.myPlayer].talkNPC == -1 || Main.craftGuide) + { + Main.reforge = false; + Main.player[Main.myPlayer].dropItemCheck(); + Recipe.FindRecipes(); + } + else + { + int num52 = 50; + int num53 = 270; + string text4 = Lang.inter[46] + ": "; + if (Main.reforgeItem.type > 0) + { + int num54 = Main.reforgeItem.value; + if (Main.player[Main.myPlayer].discount) + { + num54 = (int)((double)num54 * 0.8); + } + num54 /= 2; + string text5 = ""; + int num55 = 0; + int num56 = 0; + int num57 = 0; + int num58 = 0; + int num59 = num54; + if (num59 < 1) + { + num59 = 1; + } + if (num59 >= 1000000) + { + num55 = num59 / 1000000; + num59 -= num55 * 1000000; + } + if (num59 >= 10000) + { + num56 = num59 / 10000; + num59 -= num56 * 10000; + } + if (num59 >= 100) + { + num57 = num59 / 100; + num59 -= num57 * 100; + } + if (num59 >= 1) + { + num58 = num59; + } + if (num55 > 0) + { + object obj = text5; + text5 = string.Concat(new object[] + { + obj, + num55, + " ", + Lang.inter[15], + " " + }); + } + if (num56 > 0) + { + object obj = text5; + text5 = string.Concat(new object[] + { + obj, + num56, + " ", + Lang.inter[16], + " " + }); + } + if (num57 > 0) + { + object obj = text5; + text5 = string.Concat(new object[] + { + obj, + num57, + " ", + Lang.inter[17], + " " + }); + } + if (num58 > 0) + { + object obj = text5; + text5 = string.Concat(new object[] + { + obj, + num58, + " ", + Lang.inter[18], + " " + }); + } + float num60 = (float)Main.mouseTextColor / 255f; + Color white7 = Color.White; + if (num55 > 0) + { + white7 = new Color((int)((byte)(220f * num60)), (int)((byte)(220f * num60)), (int)((byte)(198f * num60)), (int)Main.mouseTextColor); + } + else + { + if (num56 > 0) + { + white7 = new Color((int)((byte)(224f * num60)), (int)((byte)(201f * num60)), (int)((byte)(92f * num60)), (int)Main.mouseTextColor); + } + else + { + if (num57 > 0) + { + white7 = new Color((int)((byte)(181f * num60)), (int)((byte)(192f * num60)), (int)((byte)(193f * num60)), (int)Main.mouseTextColor); + } + else + { + if (num58 > 0) + { + white7 = new Color((int)((byte)(246f * num60)), (int)((byte)(138f * num60)), (int)((byte)(96f * num60)), (int)Main.mouseTextColor); + } + } + } + } + this.spriteBatch.DrawString(Main.fontMouseText, text5, new Vector2((float)(num52 + 50) + Main.fontMouseText.MeasureString(text4).X, (float)num53), white7, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + int num61 = num52 + 70; + int num62 = num53 + 40; + this.spriteBatch.Draw(Main.reforgeTexture, new Vector2((float)num61, (float)num62), new Rectangle?(new Rectangle(0, 0, Main.reforgeTexture.Width, Main.reforgeTexture.Height)), Color.White, 0f, new Vector2((float)(Main.reforgeTexture.Width / 2), (float)(Main.reforgeTexture.Height / 2)), Main.reforgeScale, SpriteEffects.None, 0f); + if (Main.mouseX > num61 - Main.reforgeTexture.Width / 2 && Main.mouseX < num61 + Main.reforgeTexture.Width / 2 && Main.mouseY > num62 - Main.reforgeTexture.Height / 2 && Main.mouseY < num62 + Main.reforgeTexture.Height / 2) + { + Main.hoverItemName = Lang.inter[19]; + if (!Main.mouseReforge) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.mouseReforge = true; + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft && Main.player[Main.myPlayer].BuyItem(num54)) + { + Main.reforgeItem.netDefaults(Main.reforgeItem.netID); + Main.reforgeItem.Prefix(-2); + Main.reforgeItem.position.X = Main.player[Main.myPlayer].position.X + (float)(Main.player[Main.myPlayer].width / 2) - (float)(Main.reforgeItem.width / 2); + Main.reforgeItem.position.Y = Main.player[Main.myPlayer].position.Y + (float)(Main.player[Main.myPlayer].height / 2) - (float)(Main.reforgeItem.height / 2); + ItemText.NewText(Main.reforgeItem, Main.reforgeItem.stack); + Main.PlaySound(2, -1, -1, 37); + } + } + else + { + Main.mouseReforge = false; + } + } + else + { + text4 = Lang.inter[20]; + } + this.spriteBatch.DrawString(Main.fontMouseText, text4, new Vector2((float)(num52 + 50), (float)num53), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Color white8 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num52 && (float)Main.mouseX <= (float)num52 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num53 && (float)Main.mouseY <= (float)num53 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + Main.craftingHide = true; + if (Main.mouseItem.Prefix(-3) || Main.mouseItem.type == 0) + { + if (Main.mouseLeftRelease && Main.mouseLeft && Main.player[Main.myPlayer].itemTime == 0) + { + Item item6 = Main.mouseItem; + Main.mouseItem = Main.reforgeItem; + Main.reforgeItem = item6; + if (Main.reforgeItem.type == 0 || Main.reforgeItem.stack < 1) + { + Main.reforgeItem = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.reforgeItem) && Main.reforgeItem.stack != Main.reforgeItem.maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.reforgeItem.stack <= Main.mouseItem.maxStack) + { + Main.reforgeItem.stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num63 = Main.mouseItem.maxStack - Main.reforgeItem.stack; + Main.reforgeItem.stack += num63; + Main.mouseItem.stack -= num63; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.reforgeItem.type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && (Main.mouseItem.IsTheSameAs(Main.reforgeItem) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.reforgeItem.Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.reforgeItem.stack--; + if (Main.reforgeItem.stack <= 0) + { + Main.reforgeItem = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + } + Main.hoverItemName = Main.reforgeItem.name; + Main.toolTip = (Item)Main.reforgeItem.Clone(); + if (Main.reforgeItem.stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.reforgeItem.stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack4Texture, new Vector2((float)num52, (float)num53), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white8 = Color.White; + if (Main.reforgeItem.type > 0 && Main.reforgeItem.stack > 0) + { + float num64 = 1f; + if (Main.itemTexture[Main.reforgeItem.type].Width > 32 || Main.itemTexture[Main.reforgeItem.type].Height > 32) + { + if (Main.itemTexture[Main.reforgeItem.type].Width > Main.itemTexture[Main.reforgeItem.type].Height) + { + num64 = 32f / (float)Main.itemTexture[Main.reforgeItem.type].Width; + } + else + { + num64 = 32f / (float)Main.itemTexture[Main.reforgeItem.type].Height; + } + } + num64 *= Main.inventoryScale; + this.spriteBatch.Draw(Main.itemTexture[Main.reforgeItem.type], new Vector2((float)num52 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.reforgeItem.type].Width * 0.5f * num64, (float)num53 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.reforgeItem.type].Height * 0.5f * num64), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.reforgeItem.type].Width, Main.itemTexture[Main.reforgeItem.type].Height)), Main.reforgeItem.GetAlpha(white8), 0f, default(Vector2), num64, SpriteEffects.None, 0f); + if (Main.reforgeItem.color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.reforgeItem.type], new Vector2((float)num52 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.reforgeItem.type].Width * 0.5f * num64, (float)num53 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.reforgeItem.type].Height * 0.5f * num64), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.reforgeItem.type].Width, Main.itemTexture[Main.reforgeItem.type].Height)), Main.reforgeItem.GetColor(white8), 0f, default(Vector2), num64, SpriteEffects.None, 0f); + } + if (Main.reforgeItem.stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.reforgeItem.stack), new Vector2((float)num52 + 10f * Main.inventoryScale, (float)num53 + 26f * Main.inventoryScale), white8, 0f, default(Vector2), num64, SpriteEffects.None, 0f); + } + } + } + } + else + { + if (Main.craftGuide) + { + if (Main.player[Main.myPlayer].chest != -1 || Main.npcShop != 0 || Main.player[Main.myPlayer].talkNPC == -1 || Main.reforge) + { + Main.craftGuide = false; + Main.player[Main.myPlayer].dropItemCheck(); + Recipe.FindRecipes(); + } + else + { + int num65 = 73; + int num66 = 331; + num66 += num50; + string text6; + if (Main.guideItem.type > 0) + { + text6 = Lang.inter[21] + " " + Main.guideItem.name; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[22], new Vector2((float)num65, (float)(num66 + 118)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + int num67 = Main.focusRecipe; + int num68 = 0; + int num69 = 0; + while (num69 < Recipe.maxRequirements) + { + int num70 = (num69 + 1) * 26; + if (Main.recipe[Main.availableRecipe[num67]].requiredTile[num69] == -1) + { + if (num69 == 0 && !Main.recipe[Main.availableRecipe[num67]].needWater && !Main.recipe[Main.availableRecipe[num67]].needHoney) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[23], new Vector2((float)num65, (float)(num66 + 118 + num70)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + break; + } + break; + } + else + { + num68++; + this.spriteBatch.DrawString(Main.fontMouseText, Main.tileName[Main.recipe[Main.availableRecipe[num67]].requiredTile[num69]], new Vector2((float)num65, (float)(num66 + 118 + num70)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + num69++; + } + } + if (Main.recipe[Main.availableRecipe[num67]].needWater) + { + int num71 = (num68 + 1) * 26; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[53], new Vector2((float)num65, (float)(num66 + 118 + num71)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.recipe[Main.availableRecipe[num67]].needHoney) + { + int num72 = (num68 + 1) * 26; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[58], new Vector2((float)num65, (float)(num66 + 118 + num72)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + text6 = Lang.inter[24]; + } + this.spriteBatch.DrawString(Main.fontMouseText, text6, new Vector2((float)(num65 + 50), (float)(num66 + 12)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Color white9 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num65 && (float)Main.mouseX <= (float)num65 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num66 && (float)Main.mouseY <= (float)num66 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + Main.craftingHide = true; + if (Main.mouseItem.material || Main.mouseItem.type == 0) + { + if (Main.mouseLeftRelease && Main.mouseLeft) + { + Item item7 = Main.mouseItem; + Main.mouseItem = Main.guideItem; + Main.guideItem = item7; + if (Main.guideItem.type == 0 || Main.guideItem.stack < 1) + { + Main.guideItem = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.guideItem) && Main.guideItem.stack != Main.guideItem.maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.guideItem.stack <= Main.mouseItem.maxStack) + { + Main.guideItem.stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num73 = Main.mouseItem.maxStack - Main.guideItem.stack; + Main.guideItem.stack += num73; + Main.mouseItem.stack -= num73; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.guideItem.type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && (Main.mouseItem.IsTheSameAs(Main.guideItem) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.guideItem.Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.guideItem.stack--; + if (Main.guideItem.stack <= 0) + { + Main.guideItem = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + } + Main.hoverItemName = Main.guideItem.name; + Main.toolTip = (Item)Main.guideItem.Clone(); + if (Main.guideItem.stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.guideItem.stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack4Texture, new Vector2((float)num65, (float)num66), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white9 = Color.White; + if (Main.guideItem.type > 0 && Main.guideItem.stack > 0) + { + float num74 = 1f; + if (Main.itemTexture[Main.guideItem.type].Width > 32 || Main.itemTexture[Main.guideItem.type].Height > 32) + { + if (Main.itemTexture[Main.guideItem.type].Width > Main.itemTexture[Main.guideItem.type].Height) + { + num74 = 32f / (float)Main.itemTexture[Main.guideItem.type].Width; + } + else + { + num74 = 32f / (float)Main.itemTexture[Main.guideItem.type].Height; + } + } + num74 *= Main.inventoryScale; + if (Main.guideItem.type == 662 || Main.guideItem.type == 663) + { + white9.R = (byte)Main.DiscoR; + white9.G = (byte)Main.DiscoG; + white9.B = (byte)Main.DiscoB; + white9.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.guideItem.type], new Vector2((float)num65 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.guideItem.type].Width * 0.5f * num74, (float)num66 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.guideItem.type].Height * 0.5f * num74), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.guideItem.type].Width, Main.itemTexture[Main.guideItem.type].Height)), Main.guideItem.GetAlpha(white9), 0f, default(Vector2), num74, SpriteEffects.None, 0f); + white9 = Color.White; + if (Main.guideItem.color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.guideItem.type], new Vector2((float)num65 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.guideItem.type].Width * 0.5f * num74, (float)num66 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.guideItem.type].Height * 0.5f * num74), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.guideItem.type].Width, Main.itemTexture[Main.guideItem.type].Height)), Main.guideItem.GetColor(white9), 0f, default(Vector2), num74, SpriteEffects.None, 0f); + } + if (Main.guideItem.stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.guideItem.stack), new Vector2((float)num65 + 10f * Main.inventoryScale, (float)num66 + 26f * Main.inventoryScale), white9, 0f, default(Vector2), num74, SpriteEffects.None, 0f); + } + } + } + } + } + if (!Main.reforge) + { + if (Main.numAvailableRecipes > 0) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[25], new Vector2(76f, (float)(414 + num50)), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int num75 = 0; num75 < Recipe.maxRecipes; num75++) + { + Main.inventoryScale = 100f / (Math.Abs(Main.availableRecipeY[num75]) + 100f); + if ((double)Main.inventoryScale < 0.75) + { + Main.inventoryScale = 0.75f; + } + if (Main.recFastScroll) + { + Main.inventoryScale = 0.75f; + } + if (Main.availableRecipeY[num75] < (float)((num75 - Main.focusRecipe) * 65)) + { + if (Main.availableRecipeY[num75] == 0f && !Main.recFastScroll) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.availableRecipeY[num75] += 6.5f; + if (Main.recFastScroll) + { + Main.availableRecipeY[num75] += 130000f; + } + if (Main.availableRecipeY[num75] > (float)((num75 - Main.focusRecipe) * 65)) + { + Main.availableRecipeY[num75] = (float)((num75 - Main.focusRecipe) * 65); + } + } + else + { + if (Main.availableRecipeY[num75] > (float)((num75 - Main.focusRecipe) * 65)) + { + if (Main.availableRecipeY[num75] == 0f && !Main.recFastScroll) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.availableRecipeY[num75] -= 6.5f; + if (Main.recFastScroll) + { + Main.availableRecipeY[num75] -= 130000f; + } + if (Main.availableRecipeY[num75] < (float)((num75 - Main.focusRecipe) * 65)) + { + Main.availableRecipeY[num75] = (float)((num75 - Main.focusRecipe) * 65); + } + } + else + { + Main.recFastScroll = false; + } + } + if (num75 < Main.numAvailableRecipes && Math.Abs(Main.availableRecipeY[num75]) <= (float)num51) + { + int num76 = (int)(46f - 26f * Main.inventoryScale); + int num77 = (int)(410f + Main.availableRecipeY[num75] * Main.inventoryScale - 30f * Main.inventoryScale + (float)num50); + double num78 = (double)(Main.inventoryBack.A + 50); + double num79 = 255.0; + if (Math.Abs(Main.availableRecipeY[num75]) > (float)(num51 - 100)) + { + num78 = (double)(150f * (100f - (Math.Abs(Main.availableRecipeY[num75]) - (float)(num51 - 100)))) * 0.01; + num79 = (double)(255f * (100f - (Math.Abs(Main.availableRecipeY[num75]) - (float)(num51 - 100)))) * 0.01; + } + new Color((int)((byte)num78), (int)((byte)num78), (int)((byte)num78), (int)((byte)num78)); + Color color4 = new Color((int)((byte)num79), (int)((byte)num79), (int)((byte)num79), (int)((byte)num79)); + if (Main.mouseX >= num76 && (float)Main.mouseX <= (float)num76 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num77 && (float)Main.mouseY <= (float)num77 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.focusRecipe == num75 && Main.guideItem.type == 0) + { + if (Main.mouseItem.type == 0 || (Main.mouseItem.IsTheSameAs(Main.recipe[Main.availableRecipe[num75]].createItem) && Main.mouseItem.stack + Main.recipe[Main.availableRecipe[num75]].createItem.stack <= Main.mouseItem.maxStack)) + { + if (Main.mouseLeftRelease && Main.mouseLeft) + { + int stack = Main.mouseItem.stack; + Main.mouseItem = (Item)Main.recipe[Main.availableRecipe[num75]].createItem.Clone(); + Main.mouseItem.Prefix(-1); + Main.mouseItem.stack += stack; + Main.mouseItem.position.X = Main.player[Main.myPlayer].position.X + (float)(Main.player[Main.myPlayer].width / 2) - (float)(Main.mouseItem.width / 2); + Main.mouseItem.position.Y = Main.player[Main.myPlayer].position.Y + (float)(Main.player[Main.myPlayer].height / 2) - (float)(Main.mouseItem.height / 2); + ItemText.NewText(Main.mouseItem, Main.recipe[Main.availableRecipe[num75]].createItem.stack); + Main.recipe[Main.availableRecipe[num75]].Create(); + if (Main.mouseItem.type > 0 || Main.recipe[Main.availableRecipe[num75]].createItem.type > 0) + { + Main.PlaySound(7, -1, -1, 1); + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + int stack2 = Main.mouseItem.stack; + Main.mouseItem = (Item)Main.recipe[Main.availableRecipe[num75]].createItem.Clone(); + Main.mouseItem.stack += stack2; + Main.mouseItem.position.X = Main.player[Main.myPlayer].position.X + (float)(Main.player[Main.myPlayer].width / 2) - (float)(Main.mouseItem.width / 2); + Main.mouseItem.position.Y = Main.player[Main.myPlayer].position.Y + (float)(Main.player[Main.myPlayer].height / 2) - (float)(Main.mouseItem.height / 2); + ItemText.NewText(Main.mouseItem, Main.recipe[Main.availableRecipe[num75]].createItem.stack); + Main.recipe[Main.availableRecipe[num75]].Create(); + if (Main.mouseItem.type > 0 || Main.recipe[Main.availableRecipe[num75]].createItem.type > 0) + { + Main.PlaySound(7, -1, -1, 1); + } + } + } + } + } + else + { + if (Main.mouseLeftRelease && Main.mouseLeft) + { + Main.focusRecipe = num75; + } + } + Main.craftingHide = true; + Main.hoverItemName = Main.recipe[Main.availableRecipe[num75]].createItem.name; + Main.toolTip = (Item)Main.recipe[Main.availableRecipe[num75]].createItem.Clone(); + if (Main.recipe[Main.availableRecipe[num75]].createItem.stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.recipe[Main.availableRecipe[num75]].createItem.stack, + ")" + }); + } + } + if (Main.numAvailableRecipes > 0) + { + num78 -= 50.0; + if (num78 < 0.0) + { + num78 = 0.0; + } + this.spriteBatch.Draw(Main.inventoryBack4Texture, new Vector2((float)num76, (float)num77), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Color((int)((byte)num78), (int)((byte)num78), (int)((byte)num78), (int)((byte)num78)), 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + if (Main.recipe[Main.availableRecipe[num75]].createItem.type > 0 && Main.recipe[Main.availableRecipe[num75]].createItem.stack > 0) + { + float num80 = 1f; + if (Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width > 32 || Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height > 32) + { + if (Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width > Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height) + { + num80 = 32f / (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width; + } + else + { + num80 = 32f / (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height; + } + } + num80 *= Main.inventoryScale; + Color color5 = color4; + if (Main.recipe[Main.availableRecipe[num75]].createItem.type == 662 || Main.recipe[Main.availableRecipe[num75]].createItem.type == 663) + { + color4.R = (byte)Main.DiscoR; + color4.G = (byte)Main.DiscoG; + color4.B = (byte)Main.DiscoB; + color4.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type], new Vector2((float)num76 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width * 0.5f * num80, (float)num77 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height * 0.5f * num80), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width, Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height)), Main.recipe[Main.availableRecipe[num75]].createItem.GetAlpha(color4), 0f, default(Vector2), num80, SpriteEffects.None, 0f); + color4 = color5; + if (Main.recipe[Main.availableRecipe[num75]].createItem.color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type], new Vector2((float)num76 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width * 0.5f * num80, (float)num77 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height * 0.5f * num80), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Width, Main.itemTexture[Main.recipe[Main.availableRecipe[num75]].createItem.type].Height)), Main.recipe[Main.availableRecipe[num75]].createItem.GetColor(color4), 0f, default(Vector2), num80, SpriteEffects.None, 0f); + } + if (Main.recipe[Main.availableRecipe[num75]].createItem.stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.recipe[Main.availableRecipe[num75]].createItem.stack), new Vector2((float)num76 + 10f * Main.inventoryScale, (float)num77 + 26f * Main.inventoryScale), color4, 0f, default(Vector2), num80, SpriteEffects.None, 0f); + } + } + } + } + } + if (Main.numAvailableRecipes > 0) + { + int num81 = 0; + while (num81 < Recipe.maxRequirements && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type != 0) + { + int num82 = 80 + num81 * 40; + int num83 = 380 + num50; + double num84 = (double)(Main.inventoryBack.A + 50); + Color white10 = Color.White; + Color color6 = Color.White; + num84 = (double)((float)(Main.inventoryBack.A + 50) - Math.Abs(Main.availableRecipeY[Main.focusRecipe]) * 2f); + double num85 = (double)(255f - Math.Abs(Main.availableRecipeY[Main.focusRecipe]) * 2f); + if (num84 < 0.0) + { + num84 = 0.0; + } + if (num85 < 0.0) + { + num85 = 0.0; + } + white10.R = (byte)num84; + white10.G = (byte)num84; + white10.B = (byte)num84; + white10.A = (byte)num84; + color6.R = (byte)num85; + color6.G = (byte)num85; + color6.B = (byte)num85; + color6.A = (byte)num85; + Main.inventoryScale = 0.6f; + if (num84 == 0.0) + { + break; + } + if (Main.mouseX >= num82 && (float)Main.mouseX <= (float)num82 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num83 && (float)Main.mouseY <= (float)num83 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.craftingHide = true; + Main.player[Main.myPlayer].mouseInterface = true; + Main.hoverItemName = Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].name; + Main.toolTip = (Item)Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].Clone(); + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyIronBar && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type == 22) + { + Main.toolTip.name = Main.itemName[22] + ", or " + Main.itemName[704]; + } + else + { + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyWood && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type == 9) + { + Main.toolTip.name = string.Concat(new string[] + { + Main.itemName[9], + ", ", + Main.itemName[620], + ", ", + Main.itemName[619], + ", ", + Main.itemName[911], + ", or ", + Main.itemName[621] + }); + } + } + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].stack, + ")" + }); + } + } + num84 -= 50.0; + if (num84 < 0.0) + { + num84 = 0.0; + } + this.spriteBatch.Draw(Main.inventoryBack4Texture, new Vector2((float)num82, (float)num83), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Color((int)((byte)num84), (int)((byte)num84), (int)((byte)num84), (int)((byte)num84)), 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type > 0 && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].stack > 0) + { + float num86 = 1f; + if (Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width > 32 || Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height > 32) + { + if (Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width > Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height) + { + num86 = 32f / (float)Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width; + } + else + { + num86 = 32f / (float)Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height; + } + } + num86 *= Main.inventoryScale; + Color color7 = color6; + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type == 662 || Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type == 663) + { + color6.R = (byte)Main.DiscoR; + color6.G = (byte)Main.DiscoG; + color6.B = (byte)Main.DiscoB; + color6.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type], new Vector2((float)num82 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width * 0.5f * num86, (float)num83 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height * 0.5f * num86), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width, Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height)), Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].GetAlpha(color6), 0f, default(Vector2), num86, SpriteEffects.None, 0f); + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type], new Vector2((float)num82 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width * 0.5f * num86, (float)num83 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height * 0.5f * num86), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Width, Main.itemTexture[Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].type].Height)), Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].GetColor(color6), 0f, default(Vector2), num86, SpriteEffects.None, 0f); + } + color6 = color7; + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[num81].stack), new Vector2((float)num82 + 10f * Main.inventoryScale, (float)num83 + 26f * Main.inventoryScale), color6, 0f, default(Vector2), num86, SpriteEffects.None, 0f); + } + } + num81++; + } + } + if (Main.player[Main.myPlayer].chest != -1 || Main.numAvailableRecipes == 0) + { + Main.recBigList = false; + } + else + { + int num87 = 94; + int num88 = 364 + num50; + if (Main.craftGuide) + { + num88 -= 50; + } + this.spriteBatch.Draw(Main.craftButtonTexture, new Vector2((float)num87, (float)num88), new Rectangle?(new Rectangle(0, 0, Main.craftButtonTexture.Width, Main.craftButtonTexture.Height)), Color.White, 0f, new Vector2((float)(Main.craftButtonTexture.Width / 2), (float)(Main.craftButtonTexture.Height / 2)), Main.reforgeScale, SpriteEffects.None, 0f); + if (Main.mouseX > num87 - Main.craftButtonTexture.Width / 2 && Main.mouseX < num87 + Main.craftButtonTexture.Width / 2 && Main.mouseY > num88 - Main.craftButtonTexture.Height / 2 && Main.mouseY < num88 + Main.craftButtonTexture.Height / 2) + { + this.MouseText("Crafting window", 0, 0); + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + if (!Main.recBigList) + { + Main.recBigList = true; + Main.PlaySound(12, -1, -1, 1); + } + else + { + Main.recBigList = false; + Main.PlaySound(12, -1, -1, 1); + } + } + } + } + } + if (Main.recBigList) + { + int num89 = 42; + if ((double)Main.inventoryScale < 0.75) + { + Main.inventoryScale = 0.75f; + } + int num90 = 340; + int num91 = 310; + int num92 = (Main.screenWidth - num91 - 280) / num89; + int num93 = (Main.screenHeight - num90 - 20) / num89; + int num94 = 0; + int num95 = 0; + int num96 = num91; + int num97 = num90; + int num98 = num91 - 20; + int num99 = num90 + 2; + if (Main.recStart > Main.numAvailableRecipes - num92 * num93) + { + Main.recStart = Main.numAvailableRecipes - num92 * num93; + if (Main.recStart < 0) + { + Main.recStart = 0; + } + } + if (Main.recStart > 0) + { + if (Main.mouseX >= num98 && Main.mouseX <= num98 + Main.craftUpButtonTexture.Width && Main.mouseY >= num99 && Main.mouseY <= num99 + Main.craftUpButtonTexture.Height) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + Main.recStart -= num92; + if (Main.recStart < 0) + { + Main.recStart = 0; + } + Main.PlaySound(12, -1, -1, 1); + } + } + this.spriteBatch.Draw(Main.craftUpButtonTexture, new Vector2((float)num98, (float)num99), new Rectangle?(new Rectangle(0, 0, Main.craftUpButtonTexture.Width, Main.craftUpButtonTexture.Height)), new Color(200, 200, 200, 200), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.recStart < Main.numAvailableRecipes - num92 * num93) + { + num99 += 20; + if (Main.mouseX >= num98 && Main.mouseX <= num98 + Main.craftUpButtonTexture.Width && Main.mouseY >= num99 && Main.mouseY <= num99 + Main.craftUpButtonTexture.Height) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + Main.recStart += num92; + Main.PlaySound(12, -1, -1, 1); + if (Main.recStart > Main.numAvailableRecipes - num92) + { + Main.recStart = Main.numAvailableRecipes - num92; + } + } + } + this.spriteBatch.Draw(Main.craftDownButtonTexture, new Vector2((float)num98, (float)num99), new Rectangle?(new Rectangle(0, 0, Main.craftUpButtonTexture.Width, Main.craftUpButtonTexture.Height)), new Color(200, 200, 200, 200), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + int num100 = Main.recStart; + while (num100 < Recipe.maxRecipes && num100 < Main.numAvailableRecipes) + { + int num101 = num96; + int num102 = num97; + double num103 = (double)(Main.inventoryBack.A + 50); + double num104 = 255.0; + new Color((int)((byte)num103), (int)((byte)num103), (int)((byte)num103), (int)((byte)num103)); + Color color8 = new Color((int)((byte)num104), (int)((byte)num104), (int)((byte)num104), (int)((byte)num104)); + if (Main.mouseX >= num101 && (float)Main.mouseX <= (float)num101 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num102 && (float)Main.mouseY <= (float)num102 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + Main.focusRecipe = num100; + Main.recFastScroll = true; + Main.recBigList = false; + Main.PlaySound(12, -1, -1, 1); + } + Main.craftingHide = true; + Main.hoverItemName = Main.recipe[Main.availableRecipe[num100]].createItem.name; + Main.toolTip = (Item)Main.recipe[Main.availableRecipe[num100]].createItem.Clone(); + if (Main.recipe[Main.availableRecipe[num100]].createItem.stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.recipe[Main.availableRecipe[num100]].createItem.stack, + ")" + }); + } + } + if (Main.numAvailableRecipes > 0) + { + num103 -= 50.0; + if (num103 < 0.0) + { + num103 = 0.0; + } + this.spriteBatch.Draw(Main.inventoryBack4Texture, new Vector2((float)num101, (float)num102), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Color((int)((byte)num103), (int)((byte)num103), (int)((byte)num103), (int)((byte)num103)), 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + if (Main.recipe[Main.availableRecipe[num100]].createItem.type > 0 && Main.recipe[Main.availableRecipe[num100]].createItem.stack > 0) + { + float num105 = 1f; + if (Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width > 32 || Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height > 32) + { + if (Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width > Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height) + { + num105 = 32f / (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width; + } + else + { + num105 = 32f / (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height; + } + } + num105 *= Main.inventoryScale; + Color color9 = color8; + if (Main.recipe[Main.availableRecipe[num100]].createItem.type == 662 || Main.recipe[Main.availableRecipe[num100]].createItem.type == 663) + { + color8.R = (byte)Main.DiscoR; + color8.G = (byte)Main.DiscoG; + color8.B = (byte)Main.DiscoB; + color8.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type], new Vector2((float)num101 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width * 0.5f * num105, (float)num102 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height * 0.5f * num105), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width, Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height)), Main.recipe[Main.availableRecipe[num100]].createItem.GetAlpha(color8), 0f, default(Vector2), num105, SpriteEffects.None, 0f); + color8 = color9; + if (Main.recipe[Main.availableRecipe[num100]].createItem.color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type], new Vector2((float)num101 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width * 0.5f * num105, (float)num102 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height * 0.5f * num105), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Width, Main.itemTexture[Main.recipe[Main.availableRecipe[num100]].createItem.type].Height)), Main.recipe[Main.availableRecipe[num100]].createItem.GetColor(color8), 0f, default(Vector2), num105, SpriteEffects.None, 0f); + } + if (Main.recipe[Main.availableRecipe[num100]].createItem.stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.recipe[Main.availableRecipe[num100]].createItem.stack), new Vector2((float)num101 + 10f * Main.inventoryScale, (float)num102 + 26f * Main.inventoryScale), color8, 0f, default(Vector2), num105, SpriteEffects.None, 0f); + } + } + } + num96 += num89; + num94++; + if (num94 >= num92) + { + num96 = num91; + num97 += num89; + num94 = 0; + num95++; + if (num95 >= num93) + { + break; + } + } + num100++; + } + } + Vector2 vector9 = Main.fontMouseText.MeasureString("Coins"); + Vector2 vector10 = Main.fontMouseText.MeasureString(Lang.inter[26]); + float num106 = vector9.X / vector10.X; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[26], new Vector2(496f, 84f + (vector9.Y - vector9.Y * num106) / 2f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 0.75f * num106, SpriteEffects.None, 0f); + Main.inventoryScale = 0.6f; + for (int num107 = 0; num107 < 4; num107++) + { + int num108 = 497; + int num109 = (int)(85f + (float)(num107 * 56) * Main.inventoryScale + 20f); + int num110 = num107 + 50; + Color white11 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num108 && (float)Main.mouseX <= (float)num108 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num109 && (float)Main.mouseY <= (float)num109 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if (Main.keyState.IsKeyDown(Keys.LeftShift)) + { + if (Main.player[Main.myPlayer].inventory[num110].type > 0) + { + if (Main.npcShop > 0) + { + if (Main.player[Main.myPlayer].inventory[num110].type < 71 || Main.player[Main.myPlayer].inventory[num110].type > 74) + { + if (Main.player[Main.myPlayer].SellItem(Main.player[Main.myPlayer].inventory[num110].value, Main.player[Main.myPlayer].inventory[num110].stack)) + { + this.shop[Main.npcShop].AddShop(Main.player[Main.myPlayer].inventory[num110]); + Main.player[Main.myPlayer].inventory[num110].SetDefaults(0, false); + Main.PlaySound(18, -1, -1, 1); + } + else + { + if (Main.player[Main.myPlayer].inventory[num110].value == 0) + { + this.shop[Main.npcShop].AddShop(Main.player[Main.myPlayer].inventory[num110]); + Main.player[Main.myPlayer].inventory[num110].SetDefaults(0, false); + Main.PlaySound(7, -1, -1, 1); + } + } + } + } + else + { + Main.PlaySound(7, -1, -1, 1); + Main.trashItem = (Item)Main.player[Main.myPlayer].inventory[num110].Clone(); + Main.player[Main.myPlayer].inventory[num110].SetDefaults(0, false); + Recipe.FindRecipes(); + } + } + } + else + { + if ((Main.player[Main.myPlayer].selectedItem != num110 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0 && (Main.mouseItem.type == 0 || Main.mouseItem.type == 71 || Main.mouseItem.type == 72 || Main.mouseItem.type == 73 || Main.mouseItem.type == 74)) + { + Item item8 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].inventory[num110]; + Main.player[Main.myPlayer].inventory[num110] = item8; + if (Main.player[Main.myPlayer].inventory[num110].type == 0 || Main.player[Main.myPlayer].inventory[num110].stack < 1) + { + Main.player[Main.myPlayer].inventory[num110] = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].inventory[num110]) && Main.player[Main.myPlayer].inventory[num110].stack != Main.player[Main.myPlayer].inventory[num110].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.player[Main.myPlayer].inventory[num110].stack <= Main.mouseItem.maxStack) + { + Main.player[Main.myPlayer].inventory[num110].stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num111 = Main.mouseItem.maxStack - Main.player[Main.myPlayer].inventory[num110].stack; + Main.player[Main.myPlayer].inventory[num110].stack += num111; + Main.mouseItem.stack -= num111; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].inventory[num110].type > 0) + { + Main.PlaySound(7, -1, -1, 1); + } + Recipe.FindRecipes(); + } + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].inventory[num110]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.player[Main.myPlayer].inventory[num110].Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.player[Main.myPlayer].inventory[num110].stack--; + if (Main.player[Main.myPlayer].inventory[num110].stack <= 0) + { + Main.player[Main.myPlayer].inventory[num110] = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + Main.hoverItemName = Main.player[Main.myPlayer].inventory[num110].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].inventory[num110].Clone(); + if (Main.player[Main.myPlayer].inventory[num110].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].inventory[num110].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBackTexture, new Vector2((float)num108, (float)num109), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white11 = Color.White; + if (Main.player[Main.myPlayer].inventory[num110].type > 0 && Main.player[Main.myPlayer].inventory[num110].stack > 0) + { + float num112 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width > Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height) + { + num112 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width; + } + else + { + num112 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height; + } + } + num112 *= Main.inventoryScale; + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type], new Vector2((float)num108 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width * 0.5f * num112, (float)num109 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height * 0.5f * num112), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height)), Main.player[Main.myPlayer].inventory[num110].GetAlpha(white11), 0f, default(Vector2), num112, SpriteEffects.None, 0f); + if (Main.player[Main.myPlayer].inventory[num110].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type], new Vector2((float)num108 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width * 0.5f * num112, (float)num109 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height * 0.5f * num112), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[num110].type].Height)), Main.player[Main.myPlayer].inventory[num110].GetColor(white11), 0f, default(Vector2), num112, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].inventory[num110].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].inventory[num110].stack), new Vector2((float)num108 + 10f * Main.inventoryScale, (float)num109 + 26f * Main.inventoryScale), white11, 0f, default(Vector2), num112, SpriteEffects.None, 0f); + } + } + } + Vector2 vector11 = Main.fontMouseText.MeasureString("Ammo"); + Vector2 vector12 = Main.fontMouseText.MeasureString(Lang.inter[27]); + float num113 = vector11.X / vector12.X; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[27], new Vector2(532f, 84f + (vector11.Y - vector11.Y * num113) / 2f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 0.75f * num113, SpriteEffects.None, 0f); + Main.inventoryScale = 0.6f; + for (int num114 = 0; num114 < 4; num114++) + { + int num115 = 534; + int num116 = (int)(85f + (float)(num114 * 56) * Main.inventoryScale + 20f); + int num117 = 54 + num114; + Color white12 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num115 && (float)Main.mouseX <= (float)num115 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num116 && (float)Main.mouseY <= (float)num116 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if (Main.keyState.IsKeyDown(Keys.LeftShift)) + { + if (Main.player[Main.myPlayer].inventory[num117].type > 0) + { + if (Main.npcShop > 0) + { + if (Main.player[Main.myPlayer].inventory[num117].type < 71 || Main.player[Main.myPlayer].inventory[num117].type > 74) + { + if (Main.player[Main.myPlayer].SellItem(Main.player[Main.myPlayer].inventory[num117].value, Main.player[Main.myPlayer].inventory[num117].stack)) + { + this.shop[Main.npcShop].AddShop(Main.player[Main.myPlayer].inventory[num117]); + Main.player[Main.myPlayer].inventory[num117].SetDefaults(0, false); + Main.PlaySound(18, -1, -1, 1); + } + else + { + if (Main.player[Main.myPlayer].inventory[num117].value == 0) + { + this.shop[Main.npcShop].AddShop(Main.player[Main.myPlayer].inventory[num117]); + Main.player[Main.myPlayer].inventory[num117].SetDefaults(0, false); + Main.PlaySound(7, -1, -1, 1); + } + } + } + } + else + { + Main.PlaySound(7, -1, -1, 1); + Main.trashItem = (Item)Main.player[Main.myPlayer].inventory[num117].Clone(); + Main.player[Main.myPlayer].inventory[num117].SetDefaults(0, false); + Recipe.FindRecipes(); + } + } + } + else + { + if ((Main.player[Main.myPlayer].selectedItem != num117 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0 && (Main.mouseItem.type == 0 || Main.mouseItem.ammo > 0 || Main.mouseItem.type == 530) && !Main.mouseItem.notAmmo) + { + Item item9 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].inventory[num117]; + Main.player[Main.myPlayer].inventory[num117] = item9; + if (Main.player[Main.myPlayer].inventory[num117].type == 0 || Main.player[Main.myPlayer].inventory[num117].stack < 1) + { + Main.player[Main.myPlayer].inventory[num117] = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].inventory[num117]) && Main.player[Main.myPlayer].inventory[num117].stack != Main.player[Main.myPlayer].inventory[num117].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.player[Main.myPlayer].inventory[num117].stack <= Main.mouseItem.maxStack) + { + Main.player[Main.myPlayer].inventory[num117].stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num118 = Main.mouseItem.maxStack - Main.player[Main.myPlayer].inventory[num117].stack; + Main.player[Main.myPlayer].inventory[num117].stack += num118; + Main.mouseItem.stack -= num118; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].inventory[num117].type > 0) + { + Main.PlaySound(7, -1, -1, 1); + } + Recipe.FindRecipes(); + } + } + Recipe.FindRecipes(); + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].inventory[num117]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.player[Main.myPlayer].inventory[num117].Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.player[Main.myPlayer].inventory[num117].stack--; + if (Main.player[Main.myPlayer].inventory[num117].stack <= 0) + { + Main.player[Main.myPlayer].inventory[num117] = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + Main.hoverItemName = Main.player[Main.myPlayer].inventory[num117].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].inventory[num117].Clone(); + if (Main.player[Main.myPlayer].inventory[num117].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].inventory[num117].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBackTexture, new Vector2((float)num115, (float)num116), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white12 = Color.White; + if (Main.player[Main.myPlayer].inventory[num117].type > 0 && Main.player[Main.myPlayer].inventory[num117].stack > 0) + { + float num119 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width > Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height) + { + num119 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width; + } + else + { + num119 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height; + } + } + num119 *= Main.inventoryScale; + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type], new Vector2((float)num115 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width * 0.5f * num119, (float)num116 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height * 0.5f * num119), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height)), Main.player[Main.myPlayer].inventory[num117].GetAlpha(white12), 0f, default(Vector2), num119, SpriteEffects.None, 0f); + if (Main.player[Main.myPlayer].inventory[num117].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type], new Vector2((float)num115 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width * 0.5f * num119, (float)num116 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height * 0.5f * num119), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[num117].type].Height)), Main.player[Main.myPlayer].inventory[num117].GetColor(white12), 0f, default(Vector2), num119, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].inventory[num117].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].inventory[num117].stack), new Vector2((float)num115 + 10f * Main.inventoryScale, (float)num116 + 26f * Main.inventoryScale), white12, 0f, default(Vector2), num119, SpriteEffects.None, 0f); + } + } + } + if (Main.npcShop > 0 && (!Main.playerInventory || Main.player[Main.myPlayer].talkNPC == -1)) + { + Main.npcShop = 0; + } + if (Main.npcShop > 0) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[28], new Vector2(504f, (float)this.invBottom), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Main.inventoryScale = 0.755f; + if (Main.mouseX > 73 && Main.mouseX < (int)(73f + 560f * Main.inventoryScale) && Main.mouseY > this.invBottom && Main.mouseY < (int)((float)this.invBottom + 224f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num120 = 0; num120 < 10; num120++) + { + for (int num121 = 0; num121 < 4; num121++) + { + int num122 = (int)(73f + (float)(num120 * 56) * Main.inventoryScale); + int num123 = (int)((float)this.invBottom + (float)(num121 * 56) * Main.inventoryScale); + int num124 = num120 + num121 * 10; + Color white13 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num122 && (float)Main.mouseX <= (float)num122 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num123 && (float)Main.mouseY <= (float)num123 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if (Main.mouseItem.type == 0 && this.shop[Main.npcShop].item[num124].type > 0) + { + if ((Main.player[Main.myPlayer].selectedItem != num124 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0 && Main.player[Main.myPlayer].BuyItem(this.shop[Main.npcShop].item[num124].value)) + { + if (this.shop[Main.npcShop].item[num124].buyOnce) + { + int prefix = (int)this.shop[Main.npcShop].item[num124].prefix; + Main.mouseItem.netDefaults(this.shop[Main.npcShop].item[num124].netID); + Main.mouseItem.Prefix(prefix); + } + else + { + Main.mouseItem.netDefaults(this.shop[Main.npcShop].item[num124].netID); + Main.mouseItem.Prefix(-1); + } + Main.mouseItem.position.X = Main.player[Main.myPlayer].position.X + (float)(Main.player[Main.myPlayer].width / 2) - (float)(Main.mouseItem.width / 2); + Main.mouseItem.position.Y = Main.player[Main.myPlayer].position.Y + (float)(Main.player[Main.myPlayer].height / 2) - (float)(Main.mouseItem.height / 2); + ItemText.NewText(Main.mouseItem, Main.mouseItem.stack); + if (this.shop[Main.npcShop].item[num124].buyOnce) + { + this.shop[Main.npcShop].item[num124].stack--; + if (this.shop[Main.npcShop].item[num124].stack <= 0) + { + this.shop[Main.npcShop].item[num124].SetDefaults(0, false); + } + } + if (this.shop[Main.npcShop].item[num124].value > 0) + { + Main.PlaySound(18, -1, -1, 1); + } + else + { + Main.PlaySound(7, -1, -1, 1); + } + } + } + else + { + if (this.shop[Main.npcShop].item[num124].type == 0 && Main.mouseItem.type > 0 && (Main.mouseItem.type < 71 || Main.mouseItem.type > 74)) + { + if (Main.player[Main.myPlayer].SellItem(Main.mouseItem.value, Main.mouseItem.stack)) + { + this.shop[Main.npcShop].AddShop(Main.mouseItem); + Main.mouseItem.stack = 0; + Main.mouseItem.type = 0; + Main.PlaySound(18, -1, -1, 1); + } + else + { + if (Main.mouseItem.value == 0) + { + this.shop[Main.npcShop].AddShop(Main.mouseItem); + Main.mouseItem.stack = 0; + Main.mouseItem.type = 0; + Main.PlaySound(7, -1, -1, 1); + } + } + Recipe.FindRecipes(); + } + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && this.shop[Main.npcShop].item[num124].type > 0 && (Main.mouseItem.IsTheSameAs(this.shop[Main.npcShop].item[num124]) || Main.mouseItem.type == 0)) + { + int num125 = Main.superFastStack + 1; + for (int num126 = 0; num126 < num125; num126++) + { + if ((Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0) && Main.player[Main.myPlayer].BuyItem(this.shop[Main.npcShop].item[num124].value)) + { + if (num126 == 0) + { + Main.PlaySound(18, -1, -1, 1); + } + if (Main.mouseItem.type == 0) + { + Main.mouseItem.netDefaults(this.shop[Main.npcShop].item[num124].netID); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + if (this.shop[Main.npcShop].item[num124].buyOnce) + { + this.shop[Main.npcShop].item[num124].stack--; + if (this.shop[Main.npcShop].item[num124].stack <= 0) + { + this.shop[Main.npcShop].item[num124].SetDefaults(0, false); + } + } + } + } + } + } + Main.hoverItemName = this.shop[Main.npcShop].item[num124].name; + Main.toolTip = (Item)this.shop[Main.npcShop].item[num124].Clone(); + Main.toolTip.buy = true; + if (this.shop[Main.npcShop].item[num124].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + this.shop[Main.npcShop].item[num124].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack6Texture, new Vector2((float)num122, (float)num123), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white13 = Color.White; + if (this.shop[Main.npcShop].item[num124].type > 0 && this.shop[Main.npcShop].item[num124].stack > 0) + { + float num127 = 1f; + if (Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width > 32 || Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height > 32) + { + if (Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width > Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height) + { + num127 = 32f / (float)Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width; + } + else + { + num127 = 32f / (float)Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height; + } + } + num127 *= Main.inventoryScale; + if (this.shop[Main.npcShop].item[num124].type == 662 || this.shop[Main.npcShop].item[num124].type == 663) + { + white13.R = (byte)Main.DiscoR; + white13.G = (byte)Main.DiscoG; + white13.B = (byte)Main.DiscoB; + white13.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[this.shop[Main.npcShop].item[num124].type], new Vector2((float)num122 + 26f * Main.inventoryScale - (float)Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width * 0.5f * num127, (float)num123 + 26f * Main.inventoryScale - (float)Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height * 0.5f * num127), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width, Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height)), this.shop[Main.npcShop].item[num124].GetAlpha(white13), 0f, default(Vector2), num127, SpriteEffects.None, 0f); + white13 = Color.White; + if (this.shop[Main.npcShop].item[num124].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[this.shop[Main.npcShop].item[num124].type], new Vector2((float)num122 + 26f * Main.inventoryScale - (float)Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width * 0.5f * num127, (float)num123 + 26f * Main.inventoryScale - (float)Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height * 0.5f * num127), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Width, Main.itemTexture[this.shop[Main.npcShop].item[num124].type].Height)), this.shop[Main.npcShop].item[num124].GetColor(white13), 0f, default(Vector2), num127, SpriteEffects.None, 0f); + } + if (this.shop[Main.npcShop].item[num124].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(this.shop[Main.npcShop].item[num124].stack), new Vector2((float)num122 + 10f * Main.inventoryScale, (float)num123 + 26f * Main.inventoryScale), white13, 0f, default(Vector2), num127, SpriteEffects.None, 0f); + } + } + } + } + } + if (Main.player[Main.myPlayer].chest > -1 && Main.tile[Main.player[Main.myPlayer].chestX, Main.player[Main.myPlayer].chestY].type != 21) + { + Main.player[Main.myPlayer].chest = -1; + } + if (Main.player[Main.myPlayer].chest != -1) + { + Main.inventoryScale = 0.755f; + if (Main.mouseX > 73 && Main.mouseX < (int)(73f + 560f * Main.inventoryScale) && Main.mouseY > this.invBottom && Main.mouseY < (int)((float)this.invBottom + 224f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num128 = 0; num128 < 3; num128++) + { + int num129 = 506; + int num130 = this.invBottom + 40; + float num131 = this.chestLootScale; + string text7 = Lang.inter[29]; + if (num128 == 1) + { + num130 += 26; + num131 = this.chestDepositScale; + text7 = Lang.inter[30]; + } + else + { + if (num128 == 2) + { + num130 += 52; + num131 = this.chestStackScale; + text7 = Lang.inter[31]; + } + } + Vector2 vector13 = Main.fontMouseText.MeasureString(text7) / 2f; + Color color10 = new Color((int)((byte)((float)Main.mouseTextColor * num131)), (int)((byte)((float)Main.mouseTextColor * num131)), (int)((byte)((float)Main.mouseTextColor * num131)), (int)((byte)((float)Main.mouseTextColor * num131))); + num129 += (int)(vector13.X * num131); + this.spriteBatch.DrawString(Main.fontMouseText, text7, new Vector2((float)num129, (float)num130), color10, 0f, vector13, num131, SpriteEffects.None, 0f); + vector13 *= num131; + if ((float)Main.mouseX > (float)num129 - vector13.X && (float)Main.mouseX < (float)num129 + vector13.X && (float)Main.mouseY > (float)num130 - vector13.Y && (float)Main.mouseY < (float)num130 + vector13.Y) + { + if (num128 == 0) + { + if (!this.chestLootHover) + { + Main.PlaySound(12, -1, -1, 1); + } + this.chestLootHover = true; + } + else + { + if (num128 == 1) + { + if (!this.chestDepositHover) + { + Main.PlaySound(12, -1, -1, 1); + } + this.chestDepositHover = true; + } + else + { + if (!this.chestStackHover) + { + Main.PlaySound(12, -1, -1, 1); + } + this.chestStackHover = true; + } + } + Main.player[Main.myPlayer].mouseInterface = true; + num131 += 0.05f; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + if (num128 == 0) + { + if (Main.player[Main.myPlayer].chest > -1) + { + for (int num132 = 0; num132 < Chest.maxItems; num132++) + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num132].type > 0) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num132] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, Main.chest[Main.player[Main.myPlayer].chest].item[num132]); + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num132, 0f, 0f, 0); + } + } + } + } + else + { + if (Main.player[Main.myPlayer].chest == -3) + { + for (int num133 = 0; num133 < Chest.maxItems; num133++) + { + if (Main.player[Main.myPlayer].bank2[num133].type > 0) + { + Main.player[Main.myPlayer].bank2[num133] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, Main.player[Main.myPlayer].bank2[num133]); + } + } + } + else + { + for (int num134 = 0; num134 < Chest.maxItems; num134++) + { + if (Main.player[Main.myPlayer].bank[num134].type > 0) + { + Main.player[Main.myPlayer].bank[num134] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, Main.player[Main.myPlayer].bank[num134]); + } + } + } + } + } + else + { + if (num128 == 1) + { + for (int num135 = 49; num135 >= 10; num135--) + { + if (Main.player[Main.myPlayer].inventory[num135].stack > 0 && Main.player[Main.myPlayer].inventory[num135].type > 0) + { + if (Main.player[Main.myPlayer].inventory[num135].maxStack > 1) + { + for (int num136 = 0; num136 < Chest.maxItems; num136++) + { + if (Main.player[Main.myPlayer].chest > -1) + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num136].stack < Main.chest[Main.player[Main.myPlayer].chest].item[num136].maxStack && Main.player[Main.myPlayer].inventory[num135].IsTheSameAs(Main.chest[Main.player[Main.myPlayer].chest].item[num136])) + { + int num137 = Main.player[Main.myPlayer].inventory[num135].stack; + if (Main.player[Main.myPlayer].inventory[num135].stack + Main.chest[Main.player[Main.myPlayer].chest].item[num136].stack > Main.chest[Main.player[Main.myPlayer].chest].item[num136].maxStack) + { + num137 = Main.chest[Main.player[Main.myPlayer].chest].item[num136].maxStack - Main.chest[Main.player[Main.myPlayer].chest].item[num136].stack; + } + Main.player[Main.myPlayer].inventory[num135].stack -= num137; + Main.chest[Main.player[Main.myPlayer].chest].item[num136].stack += num137; + Main.ChestCoins(); + Main.PlaySound(7, -1, -1, 1); + if (Main.player[Main.myPlayer].inventory[num135].stack <= 0) + { + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num136, 0f, 0f, 0); + break; + } + break; + } + else + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num136].type == 0) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num136] = (Item)Main.player[Main.myPlayer].inventory[num135].Clone(); + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + } + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num136, 0f, 0f, 0); + } + } + } + } + else + { + if (Main.player[Main.myPlayer].chest == -3) + { + if (Main.player[Main.myPlayer].bank2[num136].stack < Main.player[Main.myPlayer].bank2[num136].maxStack && Main.player[Main.myPlayer].inventory[num135].IsTheSameAs(Main.player[Main.myPlayer].bank2[num136])) + { + int num138 = Main.player[Main.myPlayer].inventory[num135].stack; + if (Main.player[Main.myPlayer].inventory[num135].stack + Main.player[Main.myPlayer].bank2[num136].stack > Main.player[Main.myPlayer].bank2[num136].maxStack) + { + num138 = Main.player[Main.myPlayer].bank2[num136].maxStack - Main.player[Main.myPlayer].bank2[num136].stack; + } + Main.player[Main.myPlayer].inventory[num135].stack -= num138; + Main.player[Main.myPlayer].bank2[num136].stack += num138; + Main.PlaySound(7, -1, -1, 1); + Main.BankCoins(); + if (Main.player[Main.myPlayer].inventory[num135].stack <= 0) + { + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + break; + } + if (Main.player[Main.myPlayer].bank2[num136].type == 0) + { + Main.player[Main.myPlayer].bank2[num136] = (Item)Main.player[Main.myPlayer].inventory[num135].Clone(); + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + } + } + } + else + { + if (Main.player[Main.myPlayer].bank[num136].stack < Main.player[Main.myPlayer].bank[num136].maxStack && Main.player[Main.myPlayer].inventory[num135].IsTheSameAs(Main.player[Main.myPlayer].bank[num136])) + { + int num139 = Main.player[Main.myPlayer].inventory[num135].stack; + if (Main.player[Main.myPlayer].inventory[num135].stack + Main.player[Main.myPlayer].bank[num136].stack > Main.player[Main.myPlayer].bank[num136].maxStack) + { + num139 = Main.player[Main.myPlayer].bank[num136].maxStack - Main.player[Main.myPlayer].bank[num136].stack; + } + Main.player[Main.myPlayer].inventory[num135].stack -= num139; + Main.player[Main.myPlayer].bank[num136].stack += num139; + Main.PlaySound(7, -1, -1, 1); + Main.BankCoins(); + if (Main.player[Main.myPlayer].inventory[num135].stack <= 0) + { + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + break; + } + if (Main.player[Main.myPlayer].bank[num136].type == 0) + { + Main.player[Main.myPlayer].bank[num136] = (Item)Main.player[Main.myPlayer].inventory[num135].Clone(); + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + } + } + } + } + } + } + if (Main.player[Main.myPlayer].inventory[num135].stack > 0) + { + if (Main.player[Main.myPlayer].chest > -1) + { + int num140 = 0; + while (num140 < Chest.maxItems) + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num140].stack == 0) + { + Main.PlaySound(7, -1, -1, 1); + Main.chest[Main.player[Main.myPlayer].chest].item[num140] = (Item)Main.player[Main.myPlayer].inventory[num135].Clone(); + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num140, 0f, 0f, 0); + break; + } + break; + } + else + { + num140++; + } + } + } + else + { + if (Main.player[Main.myPlayer].chest == -3) + { + for (int num141 = 0; num141 < Chest.maxItems; num141++) + { + if (Main.player[Main.myPlayer].bank2[num141].stack == 0) + { + Main.PlaySound(7, -1, -1, 1); + Main.player[Main.myPlayer].bank2[num141] = (Item)Main.player[Main.myPlayer].inventory[num135].Clone(); + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + break; + } + } + } + else + { + for (int num142 = 0; num142 < Chest.maxItems; num142++) + { + if (Main.player[Main.myPlayer].bank[num142].stack == 0) + { + Main.PlaySound(7, -1, -1, 1); + Main.player[Main.myPlayer].bank[num142] = (Item)Main.player[Main.myPlayer].inventory[num135].Clone(); + Main.player[Main.myPlayer].inventory[num135].SetDefaults(0, false); + break; + } + } + } + } + } + } + } + } + else + { + if (Main.player[Main.myPlayer].chest > -1) + { + for (int num143 = 0; num143 < Chest.maxItems; num143++) + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num143].type > 0 && Main.chest[Main.player[Main.myPlayer].chest].item[num143].stack < Main.chest[Main.player[Main.myPlayer].chest].item[num143].maxStack) + { + for (int num144 = 0; num144 < 58; num144++) + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num143].IsTheSameAs(Main.player[Main.myPlayer].inventory[num144])) + { + int num145 = Main.player[Main.myPlayer].inventory[num144].stack; + if (Main.chest[Main.player[Main.myPlayer].chest].item[num143].stack + num145 > Main.chest[Main.player[Main.myPlayer].chest].item[num143].maxStack) + { + num145 = Main.chest[Main.player[Main.myPlayer].chest].item[num143].maxStack - Main.chest[Main.player[Main.myPlayer].chest].item[num143].stack; + } + Main.PlaySound(7, -1, -1, 1); + Main.chest[Main.player[Main.myPlayer].chest].item[num143].stack += num145; + Main.player[Main.myPlayer].inventory[num144].stack -= num145; + Main.ChestCoins(); + if (Main.player[Main.myPlayer].inventory[num144].stack == 0) + { + Main.player[Main.myPlayer].inventory[num144].SetDefaults(0, false); + } + else + { + if (Main.chest[Main.player[Main.myPlayer].chest].item[num143].type == 0) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num143] = (Item)Main.player[Main.myPlayer].inventory[num144].Clone(); + Main.player[Main.myPlayer].inventory[num144].SetDefaults(0, false); + } + } + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num143, 0f, 0f, 0); + } + } + } + } + } + } + else + { + if (Main.player[Main.myPlayer].chest == -3) + { + for (int num146 = 0; num146 < Chest.maxItems; num146++) + { + if (Main.player[Main.myPlayer].bank2[num146].type > 0 && Main.player[Main.myPlayer].bank2[num146].stack < Main.player[Main.myPlayer].bank2[num146].maxStack) + { + for (int num147 = 0; num147 < 58; num147++) + { + if (Main.player[Main.myPlayer].bank2[num146].IsTheSameAs(Main.player[Main.myPlayer].inventory[num147])) + { + int num148 = Main.player[Main.myPlayer].inventory[num147].stack; + if (Main.player[Main.myPlayer].bank2[num146].stack + num148 > Main.player[Main.myPlayer].bank2[num146].maxStack) + { + num148 = Main.player[Main.myPlayer].bank2[num146].maxStack - Main.player[Main.myPlayer].bank2[num146].stack; + } + Main.PlaySound(7, -1, -1, 1); + Main.player[Main.myPlayer].bank2[num146].stack += num148; + Main.player[Main.myPlayer].inventory[num147].stack -= num148; + Main.BankCoins(); + if (Main.player[Main.myPlayer].inventory[num147].stack == 0) + { + Main.player[Main.myPlayer].inventory[num147].SetDefaults(0, false); + } + else + { + if (Main.player[Main.myPlayer].bank2[num146].type == 0) + { + Main.player[Main.myPlayer].bank2[num146] = (Item)Main.player[Main.myPlayer].inventory[num147].Clone(); + Main.player[Main.myPlayer].inventory[num147].SetDefaults(0, false); + } + } + } + } + } + } + } + else + { + for (int num149 = 0; num149 < Chest.maxItems; num149++) + { + if (Main.player[Main.myPlayer].bank[num149].type > 0 && Main.player[Main.myPlayer].bank[num149].stack < Main.player[Main.myPlayer].bank[num149].maxStack) + { + for (int num150 = 0; num150 < 58; num150++) + { + if (Main.player[Main.myPlayer].bank[num149].IsTheSameAs(Main.player[Main.myPlayer].inventory[num150])) + { + int num151 = Main.player[Main.myPlayer].inventory[num150].stack; + if (Main.player[Main.myPlayer].bank[num149].stack + num151 > Main.player[Main.myPlayer].bank[num149].maxStack) + { + num151 = Main.player[Main.myPlayer].bank[num149].maxStack - Main.player[Main.myPlayer].bank[num149].stack; + } + Main.PlaySound(7, -1, -1, 1); + Main.player[Main.myPlayer].bank[num149].stack += num151; + Main.player[Main.myPlayer].inventory[num150].stack -= num151; + Main.BankCoins(); + if (Main.player[Main.myPlayer].inventory[num150].stack == 0) + { + Main.player[Main.myPlayer].inventory[num150].SetDefaults(0, false); + } + else + { + if (Main.player[Main.myPlayer].bank[num149].type == 0) + { + Main.player[Main.myPlayer].bank[num149] = (Item)Main.player[Main.myPlayer].inventory[num150].Clone(); + Main.player[Main.myPlayer].inventory[num150].SetDefaults(0, false); + } + } + } + } + } + } + } + } + } + } + Recipe.FindRecipes(); + } + } + else + { + num131 -= 0.05f; + if (num128 == 0) + { + this.chestLootHover = false; + } + else + { + if (num128 == 1) + { + this.chestDepositHover = false; + } + else + { + this.chestStackHover = false; + } + } + } + if ((double)num131 < 0.75) + { + num131 = 0.75f; + } + if (num131 > 1f) + { + num131 = 1f; + } + if (num128 == 0) + { + this.chestLootScale = num131; + } + else + { + if (num128 == 1) + { + this.chestDepositScale = num131; + } + else + { + this.chestStackScale = num131; + } + } + } + } + else + { + this.chestLootScale = 0.75f; + this.chestDepositScale = 0.75f; + this.chestStackScale = 0.75f; + this.chestLootHover = false; + this.chestDepositHover = false; + this.chestStackHover = false; + } + if (Main.player[Main.myPlayer].chest > -1) + { + this.spriteBatch.DrawString(Main.fontMouseText, Main.chestText, new Vector2(504f, (float)this.invBottom), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Main.inventoryScale = 0.755f; + if (Main.mouseX > 73 && Main.mouseX < (int)(73f + 280f * Main.inventoryScale) && Main.mouseY > this.invBottom && Main.mouseY < (int)((float)this.invBottom + 224f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num152 = 0; num152 < 10; num152++) + { + for (int num153 = 0; num153 < 4; num153++) + { + int num154 = (int)(73f + (float)(num152 * 56) * Main.inventoryScale); + int num155 = (int)((float)this.invBottom + (float)(num153 * 56) * Main.inventoryScale); + int num156 = num152 + num153 * 10; + Color white14 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num154 && (float)Main.mouseX <= (float)num154 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num155 && (float)Main.mouseY <= (float)num155 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if ((Main.player[Main.myPlayer].selectedItem != num156 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0) + { + Item item10 = Main.mouseItem; + Main.mouseItem = Main.chest[Main.player[Main.myPlayer].chest].item[num156]; + Main.chest[Main.player[Main.myPlayer].chest].item[num156] = item10; + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].type == 0 || Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack < 1) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num156] = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.chest[Main.player[Main.myPlayer].chest].item[num156]) && Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack != Main.chest[Main.player[Main.myPlayer].chest].item[num156].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack <= Main.mouseItem.maxStack) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num157 = Main.mouseItem.maxStack - Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack; + Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack += num157; + Main.mouseItem.stack -= num157; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.chest[Main.player[Main.myPlayer].chest].item[num156].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num156, 0f, 0f, 0); + } + } + } + else + { + if (Main.mouseRight && Main.mouseRightRelease && Main.chest[Main.player[Main.myPlayer].chest].item[num156].maxStack == 1) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num156] = Main.armorSwap(Main.chest[Main.player[Main.myPlayer].chest].item[num156]); + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num156, 0f, 0f, 0); + } + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && Main.chest[Main.player[Main.myPlayer].chest].item[num156].maxStack > 1 && (Main.mouseItem.IsTheSameAs(Main.chest[Main.player[Main.myPlayer].chest].item[num156]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.chest[Main.player[Main.myPlayer].chest].item[num156].Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack--; + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack <= 0) + { + Main.chest[Main.player[Main.myPlayer].chest].item[num156] = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + if (Main.netMode == 1) + { + NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)num156, 0f, 0f, 0); + } + } + } + } + Main.hoverItemName = Main.chest[Main.player[Main.myPlayer].chest].item[num156].name; + Main.toolTip = (Item)Main.chest[Main.player[Main.myPlayer].chest].item[num156].Clone(); + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack5Texture, new Vector2((float)num154, (float)num155), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white14 = Color.White; + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].type > 0 && Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack > 0) + { + float num158 = 1f; + if (Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width > 32 || Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height > 32) + { + if (Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width > Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height) + { + num158 = 32f / (float)Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width; + } + else + { + num158 = 32f / (float)Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height; + } + } + num158 *= Main.inventoryScale; + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].type == 662 || Main.chest[Main.player[Main.myPlayer].chest].item[num156].type == 663) + { + white14.R = (byte)Main.DiscoR; + white14.G = (byte)Main.DiscoG; + white14.B = (byte)Main.DiscoB; + white14.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type], new Vector2((float)num154 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width * 0.5f * num158, (float)num155 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height * 0.5f * num158), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width, Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height)), Main.chest[Main.player[Main.myPlayer].chest].item[num156].GetAlpha(white14), 0f, default(Vector2), num158, SpriteEffects.None, 0f); + white14 = Color.White; + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type], new Vector2((float)num154 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width * 0.5f * num158, (float)num155 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height * 0.5f * num158), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Width, Main.itemTexture[Main.chest[Main.player[Main.myPlayer].chest].item[num156].type].Height)), Main.chest[Main.player[Main.myPlayer].chest].item[num156].GetColor(white14), 0f, default(Vector2), num158, SpriteEffects.None, 0f); + } + if (Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.chest[Main.player[Main.myPlayer].chest].item[num156].stack), new Vector2((float)num154 + 10f * Main.inventoryScale, (float)num155 + 26f * Main.inventoryScale), white14, 0f, default(Vector2), num158, SpriteEffects.None, 0f); + } + } + } + } + } + if (Main.player[Main.myPlayer].chest == -2) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[32], new Vector2(504f, (float)this.invBottom), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Main.inventoryScale = 0.755f; + if (Main.mouseX > 73 && Main.mouseX < (int)(73f + 560f * Main.inventoryScale) && Main.mouseY > this.invBottom && Main.mouseY < (int)((float)this.invBottom + 224f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num159 = 0; num159 < 10; num159++) + { + for (int num160 = 0; num160 < 4; num160++) + { + int num161 = (int)(73f + (float)(num159 * 56) * Main.inventoryScale); + int num162 = (int)((float)this.invBottom + (float)(num160 * 56) * Main.inventoryScale); + int num163 = num159 + num160 * 10; + Color white15 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num161 && (float)Main.mouseX <= (float)num161 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num162 && (float)Main.mouseY <= (float)num162 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if ((Main.player[Main.myPlayer].selectedItem != num163 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0) + { + Item item11 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].bank[num163]; + Main.player[Main.myPlayer].bank[num163] = item11; + if (Main.player[Main.myPlayer].bank[num163].type == 0 || Main.player[Main.myPlayer].bank[num163].stack < 1) + { + Main.player[Main.myPlayer].bank[num163] = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].bank[num163]) && Main.player[Main.myPlayer].bank[num163].stack != Main.player[Main.myPlayer].bank[num163].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.player[Main.myPlayer].bank[num163].stack <= Main.mouseItem.maxStack) + { + Main.player[Main.myPlayer].bank[num163].stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num164 = Main.mouseItem.maxStack - Main.player[Main.myPlayer].bank[num163].stack; + Main.player[Main.myPlayer].bank[num163].stack += num164; + Main.mouseItem.stack -= num164; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].bank[num163].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + } + else + { + if (Main.mouseRight && Main.mouseRightRelease && Main.player[Main.myPlayer].bank[num163].maxStack == 1) + { + Main.player[Main.myPlayer].bank[num163] = Main.armorSwap(Main.player[Main.myPlayer].bank[num163]); + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && Main.player[Main.myPlayer].bank[num163].maxStack > 1 && (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].bank[num163]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.player[Main.myPlayer].bank[num163].Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.player[Main.myPlayer].bank[num163].stack--; + if (Main.player[Main.myPlayer].bank[num163].stack <= 0) + { + Main.player[Main.myPlayer].bank[num163] = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + } + Main.hoverItemName = Main.player[Main.myPlayer].bank[num163].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].bank[num163].Clone(); + if (Main.player[Main.myPlayer].bank[num163].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].bank[num163].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack2Texture, new Vector2((float)num161, (float)num162), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white15 = Color.White; + if (Main.player[Main.myPlayer].bank[num163].type > 0 && Main.player[Main.myPlayer].bank[num163].stack > 0) + { + float num165 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width > Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height) + { + num165 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width; + } + else + { + num165 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height; + } + } + num165 *= Main.inventoryScale; + if (Main.player[Main.myPlayer].bank[num163].type == 662 || Main.player[Main.myPlayer].bank[num163].type == 663) + { + white15.R = (byte)Main.DiscoR; + white15.G = (byte)Main.DiscoG; + white15.B = (byte)Main.DiscoB; + white15.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type], new Vector2((float)num161 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width * 0.5f * num165, (float)num162 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height * 0.5f * num165), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width, Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height)), Main.player[Main.myPlayer].bank[num163].GetAlpha(white15), 0f, default(Vector2), num165, SpriteEffects.None, 0f); + white15 = Color.White; + if (Main.player[Main.myPlayer].bank[num163].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type], new Vector2((float)num161 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width * 0.5f * num165, (float)num162 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height * 0.5f * num165), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Width, Main.itemTexture[Main.player[Main.myPlayer].bank[num163].type].Height)), Main.player[Main.myPlayer].bank[num163].GetColor(white15), 0f, default(Vector2), num165, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].bank[num163].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].bank[num163].stack), new Vector2((float)num161 + 10f * Main.inventoryScale, (float)num162 + 26f * Main.inventoryScale), white15, 0f, default(Vector2), num165, SpriteEffects.None, 0f); + } + } + } + } + } + if (Main.player[Main.myPlayer].chest == -3) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[33], new Vector2(504f, (float)this.invBottom), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + Main.inventoryScale = 0.755f; + if (Main.mouseX > 73 && Main.mouseX < (int)(73f + 560f * Main.inventoryScale) && Main.mouseY > this.invBottom && Main.mouseY < (int)((float)this.invBottom + 224f * Main.inventoryScale)) + { + Main.player[Main.myPlayer].mouseInterface = true; + } + for (int num166 = 0; num166 < 10; num166++) + { + for (int num167 = 0; num167 < 4; num167++) + { + int num168 = (int)(73f + (float)(num166 * 56) * Main.inventoryScale); + int num169 = (int)((float)this.invBottom + (float)(num167 * 56) * Main.inventoryScale); + int num170 = num166 + num167 * 10; + Color white16 = new Color(100, 100, 100, 100); + if (Main.mouseX >= num168 && (float)Main.mouseX <= (float)num168 + (float)Main.inventoryBackTexture.Width * Main.inventoryScale && Main.mouseY >= num169 && (float)Main.mouseY <= (float)num169 + (float)Main.inventoryBackTexture.Height * Main.inventoryScale) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + if ((Main.player[Main.myPlayer].selectedItem != num170 || Main.player[Main.myPlayer].itemAnimation <= 0) && Main.player[Main.myPlayer].itemTime == 0) + { + Item item12 = Main.mouseItem; + Main.mouseItem = Main.player[Main.myPlayer].bank2[num170]; + Main.player[Main.myPlayer].bank2[num170] = item12; + if (Main.player[Main.myPlayer].bank2[num170].type == 0 || Main.player[Main.myPlayer].bank2[num170].stack < 1) + { + Main.player[Main.myPlayer].bank2[num170] = new Item(); + } + if (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].bank2[num170]) && Main.player[Main.myPlayer].bank2[num170].stack != Main.player[Main.myPlayer].bank2[num170].maxStack && Main.mouseItem.stack != Main.mouseItem.maxStack) + { + if (Main.mouseItem.stack + Main.player[Main.myPlayer].bank2[num170].stack <= Main.mouseItem.maxStack) + { + Main.player[Main.myPlayer].bank2[num170].stack += Main.mouseItem.stack; + Main.mouseItem.stack = 0; + } + else + { + int num171 = Main.mouseItem.maxStack - Main.player[Main.myPlayer].bank2[num170].stack; + Main.player[Main.myPlayer].bank2[num170].stack += num171; + Main.mouseItem.stack -= num171; + } + } + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + { + Main.mouseItem = new Item(); + } + if (Main.mouseItem.type > 0 || Main.player[Main.myPlayer].bank2[num170].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7, -1, -1, 1); + } + } + } + else + { + if (Main.mouseRight && Main.mouseRightRelease && Main.player[Main.myPlayer].bank2[num170].maxStack == 1) + { + Main.player[Main.myPlayer].bank2[num170] = Main.armorSwap(Main.player[Main.myPlayer].bank2[num170]); + } + else + { + if (Main.stackSplit <= 1 && Main.mouseRight && Main.player[Main.myPlayer].bank2[num170].maxStack > 1 && (Main.mouseItem.IsTheSameAs(Main.player[Main.myPlayer].bank2[num170]) || Main.mouseItem.type == 0) && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + if (Main.mouseItem.type == 0) + { + Main.mouseItem = (Item)Main.player[Main.myPlayer].bank2[num170].Clone(); + Main.mouseItem.stack = 0; + } + Main.mouseItem.stack++; + Main.player[Main.myPlayer].bank2[num170].stack--; + if (Main.player[Main.myPlayer].bank2[num170].stack <= 0) + { + Main.player[Main.myPlayer].bank2[num170] = new Item(); + } + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12, -1, -1, 1); + if (Main.stackSplit == 0) + { + Main.stackSplit = 15; + } + else + { + Main.stackSplit = Main.stackDelay; + } + } + } + } + Main.hoverItemName = Main.player[Main.myPlayer].bank2[num170].name; + Main.toolTip = (Item)Main.player[Main.myPlayer].bank2[num170].Clone(); + if (Main.player[Main.myPlayer].bank2[num170].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].bank2[num170].stack, + ")" + }); + } + } + this.spriteBatch.Draw(Main.inventoryBack2Texture, new Vector2((float)num168, (float)num169), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), Main.inventoryBack, 0f, default(Vector2), Main.inventoryScale, SpriteEffects.None, 0f); + white16 = Color.White; + if (Main.player[Main.myPlayer].bank2[num170].type > 0 && Main.player[Main.myPlayer].bank2[num170].stack > 0) + { + float num172 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width > Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height) + { + num172 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width; + } + else + { + num172 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height; + } + } + num172 *= Main.inventoryScale; + if (Main.player[Main.myPlayer].bank2[num170].type == 662 || Main.player[Main.myPlayer].bank2[num170].type == 663) + { + white16.R = (byte)Main.DiscoR; + white16.G = (byte)Main.DiscoG; + white16.B = (byte)Main.DiscoB; + white16.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type], new Vector2((float)num168 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width * 0.5f * num172, (float)num169 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height * 0.5f * num172), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width, Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height)), Main.player[Main.myPlayer].bank2[num170].GetAlpha(white16), 0f, default(Vector2), num172, SpriteEffects.None, 0f); + white16 = Color.White; + if (Main.player[Main.myPlayer].bank2[num170].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type], new Vector2((float)num168 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width * 0.5f * num172, (float)num169 + 26f * Main.inventoryScale - (float)Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height * 0.5f * num172), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Width, Main.itemTexture[Main.player[Main.myPlayer].bank2[num170].type].Height)), Main.player[Main.myPlayer].bank2[num170].GetColor(white16), 0f, default(Vector2), num172, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].bank2[num170].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].bank2[num170].stack), new Vector2((float)num168 + 10f * Main.inventoryScale, (float)num169 + 26f * Main.inventoryScale), white16, 0f, default(Vector2), num172, SpriteEffects.None, 0f); + } + } + } + } + } + } + protected void DrawMouseOver() + { + Rectangle rectangle = new Rectangle((int)((float)Main.mouseX + Main.screenPosition.X), (int)((float)Main.mouseY + Main.screenPosition.Y), 1, 1); + if (Main.player[Main.myPlayer].gravDir == -1f) + { + rectangle.Y = (int)Main.screenPosition.Y + Main.screenHeight - Main.mouseY; + } + if (!Main.mouseText) + { + int num = 26 * Main.player[Main.myPlayer].statLifeMax / (int)Main.heartLife; + int num2 = 0; + if (Main.player[Main.myPlayer].statLifeMax > 200) + { + num = 260; + num2 += 26; + } + if (Main.mouseX > 500 + Main.sX && Main.mouseX < 500 + num + Main.sX && Main.mouseY > 32 && Main.mouseY < 32 + Main.heartTexture.Height + num2) + { + Main.player[Main.myPlayer].showItemIcon = false; + string cursorText = Main.player[Main.myPlayer].statLife + "/" + Main.player[Main.myPlayer].statLifeMax; + this.MouseText(cursorText, 0, 0); + Main.mouseText = true; + } + } + if (!Main.mouseText) + { + int num3 = 24; + int num4 = 28 * Main.player[Main.myPlayer].statManaMax2 / Main.starMana; + if (Main.mouseX > 762 + Main.sX && Main.mouseX < 762 + num3 + Main.sX && Main.mouseY > 30 && Main.mouseY < 30 + num4) + { + Main.player[Main.myPlayer].showItemIcon = false; + string cursorText2 = Main.player[Main.myPlayer].statMana + "/" + Main.player[Main.myPlayer].statManaMax2; + this.MouseText(cursorText2, 0, 0); + Main.mouseText = true; + } + } + if (!Main.mouseText) + { + for (int i = 0; i < 400; i++) + { + if (Main.item[i].active) + { + Rectangle value = new Rectangle((int)((double)Main.item[i].position.X + (double)Main.item[i].width * 0.5 - (double)Main.itemTexture[Main.item[i].type].Width * 0.5), (int)(Main.item[i].position.Y + (float)Main.item[i].height - (float)Main.itemTexture[Main.item[i].type].Height), Main.itemTexture[Main.item[i].type].Width, Main.itemTexture[Main.item[i].type].Height); + if (rectangle.Intersects(value)) + { + Main.player[Main.myPlayer].showItemIcon = false; + string text = Main.item[i].AffixName(); + if (Main.item[i].stack > 1) + { + object obj = text; + text = string.Concat(new object[] + { + obj, + " (", + Main.item[i].stack, + ")" + }); + } + if (Main.item[i].owner < 255 && Main.showItemOwner) + { + text = text + " <" + Main.player[Main.item[i].owner].name + ">"; + } + Main.rare = Main.item[i].rare; + this.MouseText(text, Main.rare, 0); + Main.mouseText = true; + break; + } + } + } + } + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && Main.myPlayer != j && !Main.player[j].dead) + { + Rectangle value2 = new Rectangle((int)((double)Main.player[j].position.X + (double)Main.player[j].width * 0.5 - 16.0), (int)(Main.player[j].position.Y + (float)Main.player[j].height - 48f), 32, 48); + if (!Main.mouseText && rectangle.Intersects(value2)) + { + Main.player[Main.myPlayer].showItemIcon = false; + int num5 = Main.player[j].statLife; + if (num5 < 0) + { + num5 = 0; + } + string text2 = string.Concat(new object[] + { + Main.player[j].name, + ": ", + num5, + "/", + Main.player[j].statLifeMax + }); + if (Main.player[j].hostile) + { + text2 += " (PvP)"; + } + this.MouseText(text2, 0, Main.player[j].difficulty); + } + } + } + if (!Main.mouseText) + { + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active) + { + this.LoadNPC(Main.npc[k].type); + Rectangle value3 = new Rectangle((int)((double)Main.npc[k].position.X + (double)Main.npc[k].width * 0.5 - (double)Main.npcTexture[Main.npc[k].type].Width * 0.5), (int)(Main.npc[k].position.Y + (float)Main.npc[k].height - (float)(Main.npcTexture[Main.npc[k].type].Height / Main.npcFrameCount[Main.npc[k].type])), Main.npcTexture[Main.npc[k].type].Width, Main.npcTexture[Main.npc[k].type].Height / Main.npcFrameCount[Main.npc[k].type]); + if (Main.npc[k].type >= 87 && Main.npc[k].type <= 92) + { + value3 = new Rectangle((int)((double)Main.npc[k].position.X + (double)Main.npc[k].width * 0.5 - 32.0), (int)((double)Main.npc[k].position.Y + (double)Main.npc[k].height * 0.5 - 32.0), 64, 64); + } + if (rectangle.Intersects(value3) && (Main.npc[k].type != 85 || Main.npc[k].ai[0] != 0f)) + { + bool flag = false; + if (Main.npc[k].townNPC || Main.npc[k].type == 105 || Main.npc[k].type == 106 || Main.npc[k].type == 123) + { + Rectangle rectangle2 = new Rectangle((int)(Main.player[Main.myPlayer].position.X + (float)(Main.player[Main.myPlayer].width / 2) - (float)(Player.tileRangeX * 16)), (int)(Main.player[Main.myPlayer].position.Y + (float)(Main.player[Main.myPlayer].height / 2) - (float)(Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2); + Rectangle value4 = new Rectangle((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height); + if (rectangle2.Intersects(value4)) + { + flag = true; + } + } + if (flag && !Main.player[Main.myPlayer].dead) + { + int num6 = -(Main.npc[k].width / 2 + 8); + SpriteEffects effects = SpriteEffects.None; + if (Main.npc[k].spriteDirection == -1) + { + effects = SpriteEffects.FlipHorizontally; + num6 = Main.npc[k].width / 2 + 8; + } + this.spriteBatch.Draw(Main.chatTexture, new Vector2(Main.npc[k].position.X + (float)(Main.npc[k].width / 2) - Main.screenPosition.X - (float)(Main.chatTexture.Width / 2) - (float)num6, Main.npc[k].position.Y - (float)Main.chatTexture.Height - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, Main.chatTexture.Width, Main.chatTexture.Height)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, effects, 0f); + if (Main.mouseRight && Main.npcChatRelease) + { + Main.npcChatRelease = false; + if (Main.player[Main.myPlayer].talkNPC != k) + { + Main.npcShop = 0; + Main.craftGuide = false; + Main.player[Main.myPlayer].dropItemCheck(); + Recipe.FindRecipes(); + Main.player[Main.myPlayer].sign = -1; + Main.editSign = false; + Main.player[Main.myPlayer].talkNPC = k; + Main.playerInventory = false; + Main.player[Main.myPlayer].chest = -1; + Main.npcChatText = Main.npc[k].GetChat(); + Main.PlaySound(24, -1, -1, 1); + } + } + } + Main.player[Main.myPlayer].showItemIcon = false; + string text3 = Main.npc[k].displayName; + int num7 = k; + if (Main.npc[k].realLife >= 0) + { + num7 = Main.npc[k].realLife; + } + if (Main.npc[num7].lifeMax > 1 && !Main.npc[num7].dontTakeDamage) + { + object obj2 = text3; + text3 = string.Concat(new object[] + { + obj2, + ": ", + Main.npc[num7].life, + "/", + Main.npc[num7].lifeMax + }); + } + this.MouseText(text3, 0, 0); + return; + } + } + } + } + } + protected void DrawInterfaceBars() + { + Main.sX = Main.screenWidth - 800; + int num = Main.player[Main.myPlayer].statLifeMax / 20; + if (num >= 10) + { + num = 10; + } + string text = string.Concat(new object[] + { + Lang.inter[0], + " ", + Main.player[Main.myPlayer].statLifeMax, + "/", + Main.player[Main.myPlayer].statLifeMax + }); + Vector2 vector = Main.fontMouseText.MeasureString(text); + if (!Main.player[Main.myPlayer].ghost) + { + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[0], new Vector2((float)(500 + 13 * num) - vector.X * 0.5f + (float)Main.sX, 6f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, Main.player[Main.myPlayer].statLife + "/" + Main.player[Main.myPlayer].statLifeMax, new Vector2((float)(500 + 13 * num) + vector.X * 0.5f + (float)Main.sX, 6f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, new Vector2(Main.fontMouseText.MeasureString(Main.player[Main.myPlayer].statLife + "/" + Main.player[Main.myPlayer].statLifeMax).X, 0f), 1f, SpriteEffects.None, 0f); + } + Main.heartLife = 20f; + if (Main.player[Main.myPlayer].statLifeMax > 400) + { + Main.heartLife = (float)Main.player[Main.myPlayer].statLifeMax / 20f; + } + int num2 = (Main.player[Main.myPlayer].statLifeMax - 400) / 5; + if (num2 < 0) + { + num2 = 0; + } + int num3 = 1; + while ((float)num3 < (float)Main.player[Main.myPlayer].statLifeMax / Main.heartLife + 1f) + { + float num4 = 1f; + bool flag = false; + int num5; + if ((float)Main.player[Main.myPlayer].statLife >= (float)num3 * Main.heartLife) + { + num5 = 255; + if ((float)Main.player[Main.myPlayer].statLife == (float)num3 * Main.heartLife) + { + flag = true; + } + } + else + { + float num6 = ((float)Main.player[Main.myPlayer].statLife - (float)(num3 - 1) * Main.heartLife) / Main.heartLife; + num5 = (int)(30f + 225f * num6); + if (num5 < 30) + { + num5 = 30; + } + num4 = num6 / 4f + 0.75f; + if ((double)num4 < 0.75) + { + num4 = 0.75f; + } + if (num6 > 0f) + { + flag = true; + } + } + if (flag) + { + num4 += Main.cursorScale - 1f; + } + int num7 = 0; + int num8 = 0; + if (num3 > 10) + { + num7 -= 260; + num8 += 26; + } + int num9 = (int)((double)((float)num5) * 0.9); + if (!Main.player[Main.myPlayer].ghost) + { + if (num2 > 0) + { + num2--; + this.spriteBatch.Draw(Main.heart2Texture, new Vector2((float)(500 + 26 * (num3 - 1) + num7 + Main.sX + Main.heartTexture.Width / 2), 32f + ((float)Main.heartTexture.Height - (float)Main.heartTexture.Height * num4) / 2f + (float)num8 + (float)(Main.heartTexture.Height / 2)), new Rectangle?(new Rectangle(0, 0, Main.heartTexture.Width, Main.heartTexture.Height)), new Color(num5, num5, num5, num9), 0f, new Vector2((float)(Main.heartTexture.Width / 2), (float)(Main.heartTexture.Height / 2)), num4, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.heartTexture, new Vector2((float)(500 + 26 * (num3 - 1) + num7 + Main.sX + Main.heartTexture.Width / 2), 32f + ((float)Main.heartTexture.Height - (float)Main.heartTexture.Height * num4) / 2f + (float)num8 + (float)(Main.heartTexture.Height / 2)), new Rectangle?(new Rectangle(0, 0, Main.heartTexture.Width, Main.heartTexture.Height)), new Color(num5, num5, num5, num9), 0f, new Vector2((float)(Main.heartTexture.Width / 2), (float)(Main.heartTexture.Height / 2)), num4, SpriteEffects.None, 0f); + } + } + num3++; + } + Main.starMana = 20; + if (Main.player[Main.myPlayer].statManaMax2 > 0) + { + int arg_585_0 = Main.player[Main.myPlayer].statManaMax2 / 20; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[2], new Vector2((float)(750 + Main.sX), 6f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + for (int i = 1; i < Main.player[Main.myPlayer].statManaMax2 / Main.starMana + 1; i++) + { + bool flag2 = false; + float num10 = 1f; + int num11; + if (Main.player[Main.myPlayer].statMana >= i * Main.starMana) + { + num11 = 255; + if (Main.player[Main.myPlayer].statMana == i * Main.starMana) + { + flag2 = true; + } + } + else + { + float num12 = (float)(Main.player[Main.myPlayer].statMana - (i - 1) * Main.starMana) / (float)Main.starMana; + num11 = (int)(30f + 225f * num12); + if (num11 < 30) + { + num11 = 30; + } + num10 = num12 / 4f + 0.75f; + if ((double)num10 < 0.75) + { + num10 = 0.75f; + } + if (num12 > 0f) + { + flag2 = true; + } + } + if (flag2) + { + num10 += Main.cursorScale - 1f; + } + int num13 = (int)((double)((float)num11) * 0.9); + this.spriteBatch.Draw(Main.manaTexture, new Vector2((float)(775 + Main.sX), (float)(30 + Main.manaTexture.Height / 2) + ((float)Main.manaTexture.Height - (float)Main.manaTexture.Height * num10) / 2f + (float)(28 * (i - 1))), new Rectangle?(new Rectangle(0, 0, Main.manaTexture.Width, Main.manaTexture.Height)), new Color(num11, num11, num11, num13), 0f, new Vector2((float)(Main.manaTexture.Width / 2), (float)(Main.manaTexture.Height / 2)), num10, SpriteEffects.None, 0f); + } + } + bool flag3 = false; + if (Main.player[Main.myPlayer].lavaTime < Main.player[Main.myPlayer].lavaMax && Main.player[Main.myPlayer].lavaWet) + { + flag3 = true; + } + else + { + if (Main.player[Main.myPlayer].lavaTime < Main.player[Main.myPlayer].lavaMax && Main.player[Main.myPlayer].breath == Main.player[Main.myPlayer].breathMax) + { + flag3 = true; + } + } + if (Main.player[Main.myPlayer].breath < Main.player[Main.myPlayer].breathMax && !Main.player[Main.myPlayer].ghost && !flag3) + { + int num14 = 76 + Main.mH; + int arg_88F_0 = Main.player[Main.myPlayer].breathMax / 20; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[1], new Vector2((float)(500 + 13 * num) - Main.fontMouseText.MeasureString(Lang.inter[1]).X * 0.5f + (float)Main.sX, (float)(6 + num14)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + int num15 = 20; + for (int j = 1; j < Main.player[Main.myPlayer].breathMax / num15 + 1; j++) + { + float num16 = 1f; + int num17; + if (Main.player[Main.myPlayer].breath >= j * num15) + { + num17 = 255; + } + else + { + float num18 = (float)(Main.player[Main.myPlayer].breath - (j - 1) * num15) / (float)num15; + num17 = (int)(30f + 225f * num18); + if (num17 < 30) + { + num17 = 30; + } + num16 = num18 / 4f + 0.75f; + if ((double)num16 < 0.75) + { + num16 = 0.75f; + } + } + int num19 = 0; + int num20 = 0; + if (j > 10) + { + num19 -= 260; + num20 += 26; + } + this.spriteBatch.Draw(Main.bubbleTexture, new Vector2((float)(500 + 26 * (j - 1) + num19 + Main.sX), 32f + ((float)Main.bubbleTexture.Height - (float)Main.bubbleTexture.Height * num16) / 2f + (float)num20 + (float)num14), new Rectangle?(new Rectangle(0, 0, Main.bubbleTexture.Width, Main.bubbleTexture.Height)), new Color(num17, num17, num17, num17), 0f, default(Vector2), num16, SpriteEffects.None, 0f); + } + } + if (Main.player[Main.myPlayer].lavaTime < Main.player[Main.myPlayer].lavaMax && !Main.player[Main.myPlayer].ghost && flag3) + { + int num21 = 76 + Main.mH; + int num22 = Main.player[Main.myPlayer].lavaMax / 10; + int arg_AFC_0 = Main.player[Main.myPlayer].breathMax / num22; + this.spriteBatch.DrawString(Main.fontMouseText, Lang.inter[56], new Vector2(630f - Main.fontMouseText.MeasureString(Lang.inter[56]).X * 0.5f + (float)Main.sX, (float)(6 + num21)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + for (int k = 1; k < Main.player[Main.myPlayer].lavaMax / num22 + 1; k++) + { + float num23 = 1f; + int num24; + if (Main.player[Main.myPlayer].lavaTime >= k * num22) + { + num24 = 255; + } + else + { + float num25 = (float)(Main.player[Main.myPlayer].lavaTime - (k - 1) * num22) / (float)num22; + num24 = (int)(30f + 225f * num25); + if (num24 < 30) + { + num24 = 30; + } + num23 = num25 / 4f + 0.75f; + if ((double)num23 < 0.75) + { + num23 = 0.75f; + } + } + int num26 = 0; + int num27 = 0; + if (k > 10) + { + num26 -= 260; + num27 += 26; + } + this.spriteBatch.Draw(Main.flameTexture, new Vector2((float)(500 + 26 * (k - 1) + num26 + Main.sX), 32f + ((float)Main.flameTexture.Height - (float)Main.flameTexture.Height * num23) / 2f + (float)num27 + (float)num21), new Rectangle?(new Rectangle(0, 0, Main.bubbleTexture.Width, Main.bubbleTexture.Height)), new Color(num24, num24, num24, num24), 0f, default(Vector2), num23, SpriteEffects.None, 0f); + } + } + Main.buffString = ""; + if (!Main.recBigList) + { + Main.recStart = 0; + } + if (!Main.playerInventory) + { + Main.recBigList = false; + int num28 = -1; + for (int l = 0; l < 10; l++) + { + if (Main.player[Main.myPlayer].buffType[l] > 0) + { + int num29 = Main.player[Main.myPlayer].buffType[l]; + int num30 = 32 + l * 38; + int num31 = 76; + Color color = new Color(Main.buffAlpha[l], Main.buffAlpha[l], Main.buffAlpha[l], Main.buffAlpha[l]); + this.spriteBatch.Draw(Main.buffTexture[num29], new Vector2((float)num30, (float)num31), new Rectangle?(new Rectangle(0, 0, Main.buffTexture[num29].Width, Main.buffTexture[num29].Height)), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + if (!Main.vanityPet[num29] && !Main.lightPet[num29] && num29 != 64 && num29 != 60 && num29 != 49 && num29 != 28 && num29 != 34 && num29 != 37 && num29 != 38 && num29 != 40 && num29 != 41 && num29 != 27 && num29 != 19 && num29 != 42 && num29 != 43 && num29 != 45 && (!Main.player[Main.myPlayer].honeyWet || num29 != 48) && num29 != 62 && num29 != 67 && num29 != 68 && Main.player[Main.myPlayer].buffTime[l] > 2) + { + string text2; + if (Main.player[Main.myPlayer].buffTime[l] / 60 >= 60) + { + text2 = Math.Round((double)(Main.player[Main.myPlayer].buffTime[l] / 60) / 60.0) + " m"; + } + else + { + text2 = Math.Round((double)Main.player[Main.myPlayer].buffTime[l] / 60.0) + " s"; + } + this.spriteBatch.DrawString(Main.fontItemStack, text2, new Vector2((float)num30, (float)(num31 + Main.buffTexture[num29].Height)), color, 0f, default(Vector2), 0.8f, SpriteEffects.None, 0f); + } + if (Main.mouseX < num30 + Main.buffTexture[num29].Width && Main.mouseY < num31 + Main.buffTexture[num29].Height && Main.mouseX > num30 && Main.mouseY > num31) + { + num28 = l; + Main.buffAlpha[l] += 0.1f; + if (Main.mouseRight && Main.mouseRightRelease && !Main.debuff[num29] && num29 != 60) + { + Main.PlaySound(12, -1, -1, 1); + Main.player[Main.myPlayer].DelBuff(l); + } + } + else + { + Main.buffAlpha[l] -= 0.05f; + } + if (Main.buffAlpha[l] > 1f) + { + Main.buffAlpha[l] = 1f; + } + else + { + if ((double)Main.buffAlpha[l] < 0.4) + { + Main.buffAlpha[l] = 0.4f; + } + } + } + else + { + Main.buffAlpha[l] = 0.4f; + } + } + if (num28 >= 0) + { + int num32 = Main.player[Main.myPlayer].buffType[num28]; + if (num32 > 0) + { + Main.buffString = Main.buffTip[num32]; + if (Main.meleeBuff[num32]) + { + this.MouseText(Main.buffName[num32], -10, 0); + return; + } + this.MouseText(Main.buffName[num32], 0, 0); + } + } + } + } + protected void DrawHotbar() + { + if (!Main.playerInventory && !Main.player[Main.myPlayer].ghost) + { + string text = Lang.inter[37]; + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].name != null && Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].name != "") + { + text = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].AffixName(); + } + Vector2 vector = Main.fontMouseText.MeasureString(text) / 2f; + this.spriteBatch.DrawString(Main.fontMouseText, text, new Vector2(236f - vector.X, 0f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + int num = 20; + for (int i = 0; i < 10; i++) + { + if (i == Main.player[Main.myPlayer].selectedItem) + { + if (Main.hotbarScale[i] < 1f) + { + Main.hotbarScale[i] += 0.05f; + } + } + else + { + if ((double)Main.hotbarScale[i] > 0.75) + { + Main.hotbarScale[i] -= 0.05f; + } + } + float num2 = Main.hotbarScale[i]; + int num3 = (int)(20f + 22f * (1f - num2)); + int num4 = (int)(75f + 150f * num2); + Color color = new Color(255, 255, 255, num4); + this.spriteBatch.Draw(Main.inventoryBackTexture, new Vector2((float)num, (float)num3), new Rectangle?(new Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Color(100, 100, 100, 100), 0f, default(Vector2), num2, SpriteEffects.None, 0f); + if (!Main.player[Main.myPlayer].hbLocked && Main.mouseX >= num && (float)Main.mouseX <= (float)num + (float)Main.inventoryBackTexture.Width * Main.hotbarScale[i] && Main.mouseY >= num3 && (float)Main.mouseY <= (float)num3 + (float)Main.inventoryBackTexture.Height * Main.hotbarScale[i] && !Main.player[Main.myPlayer].channel) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && !Main.player[Main.myPlayer].hbLocked) + { + Main.player[Main.myPlayer].changeItem = i; + } + Main.player[Main.myPlayer].showItemIcon = false; + Main.hoverItemName = Main.player[Main.myPlayer].inventory[i].AffixName(); + if (Main.player[Main.myPlayer].inventory[i].stack > 1) + { + object obj = Main.hoverItemName; + Main.hoverItemName = string.Concat(new object[] + { + obj, + " (", + Main.player[Main.myPlayer].inventory[i].stack, + ")" + }); + } + Main.rare = Main.player[Main.myPlayer].inventory[i].rare; + } + if (Main.player[Main.myPlayer].inventory[i].type > 0 && Main.player[Main.myPlayer].inventory[i].stack > 0) + { + float num5 = 1f; + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width > 32 || Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height > 32) + { + if (Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width > Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height) + { + num5 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width; + } + else + { + num5 = 32f / (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height; + } + } + num5 *= num2; + Color color2 = color; + if (Main.player[Main.myPlayer].inventory[i].type == 662 || Main.player[Main.myPlayer].inventory[i].type == 663) + { + color.R = (byte)Main.DiscoR; + color.G = (byte)Main.DiscoG; + color.B = (byte)Main.DiscoB; + color.A = 255; + } + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type], new Vector2((float)num + 26f * num2 - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width * 0.5f * num5, (float)num3 + 26f * num2 - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height * 0.5f * num5), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height)), Main.player[Main.myPlayer].inventory[i].GetAlpha(color), 0f, default(Vector2), num5, SpriteEffects.None, 0f); + color = color2; + if (Main.player[Main.myPlayer].inventory[i].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type], new Vector2((float)num + 26f * num2 - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width * 0.5f * num5, (float)num3 + 26f * num2 - (float)Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height * 0.5f * num5), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[i].type].Height)), Main.player[Main.myPlayer].inventory[i].GetColor(color), 0f, default(Vector2), num5, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].inventory[i].stack > 1) + { + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.player[Main.myPlayer].inventory[i].stack), new Vector2((float)num + 10f * num2, (float)num3 + 26f * num2), color, 0f, default(Vector2), num5, SpriteEffects.None, 0f); + } + if (Main.player[Main.myPlayer].inventory[i].useAmmo > 0) + { + int useAmmo = Main.player[Main.myPlayer].inventory[i].useAmmo; + int num6 = 0; + for (int j = 0; j < 58; j++) + { + if (Main.player[Main.myPlayer].inventory[j].ammo == useAmmo) + { + num6 += Main.player[Main.myPlayer].inventory[j].stack; + } + } + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(num6), new Vector2((float)num + 8f * num2, (float)num3 + 30f * num2), color, 0f, default(Vector2), num2 * 0.8f, SpriteEffects.None, 0f); + } + else + { + if (Main.player[Main.myPlayer].inventory[i].tileWand > 0) + { + int tileWand = Main.player[Main.myPlayer].inventory[i].tileWand; + int num7 = 0; + for (int k = 0; k < 58; k++) + { + if (Main.player[Main.myPlayer].inventory[k].type == tileWand) + { + num7 += Main.player[Main.myPlayer].inventory[k].stack; + } + } + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(num7), new Vector2((float)num + 8f * num2, (float)num3 + 30f * num2), color, 0f, default(Vector2), num2 * 0.8f, SpriteEffects.None, 0f); + } + else + { + if (Main.player[Main.myPlayer].inventory[i].type == 509 || Main.player[Main.myPlayer].inventory[i].type == 850 || Main.player[Main.myPlayer].inventory[i].type == 851) + { + int num8 = 0; + for (int l = 0; l < 58; l++) + { + if (Main.player[Main.myPlayer].inventory[l].type == 530) + { + num8 += Main.player[Main.myPlayer].inventory[l].stack; + } + } + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(num8), new Vector2((float)num + 8f * num2, (float)num3 + 30f * num2), color, 0f, default(Vector2), num2 * 0.8f, SpriteEffects.None, 0f); + } + } + } + string text2 = string.Concat(i + 1); + if (text2 == "10") + { + text2 = "0"; + } + this.spriteBatch.DrawString(Main.fontItemStack, text2, new Vector2((float)num + 8f * Main.hotbarScale[i], (float)num3 + 4f * Main.hotbarScale[i]), new Color((int)(color.R / 2), (int)(color.G / 2), (int)(color.B / 2), (int)(color.A / 2)), 0f, default(Vector2), num5, SpriteEffects.None, 0f); + if (Main.player[Main.myPlayer].inventory[i].potion) + { + Color alpha = Main.player[Main.myPlayer].inventory[i].GetAlpha(color); + float num9 = (float)Main.player[Main.myPlayer].potionDelay / (float)Main.player[Main.myPlayer].potionDelayTime; + float num10 = (float)alpha.R * num9; + float num11 = (float)alpha.G * num9; + float num12 = (float)alpha.B * num9; + float num13 = (float)alpha.A * num9; + alpha = new Color((int)((byte)num10), (int)((byte)num11), (int)((byte)num12), (int)((byte)num13)); + this.spriteBatch.Draw(Main.cdTexture, new Vector2((float)num + 26f * Main.hotbarScale[i] - (float)Main.cdTexture.Width * 0.5f * num5, (float)num3 + 26f * Main.hotbarScale[i] - (float)Main.cdTexture.Height * 0.5f * num5), new Rectangle?(new Rectangle(0, 0, Main.cdTexture.Width, Main.cdTexture.Height)), alpha, 0f, default(Vector2), num5, SpriteEffects.None, 0f); + } + } + num += (int)((float)Main.inventoryBackTexture.Width * Main.hotbarScale[i]) + 4; + } + } + } + protected void DrawInterface() + { + if (Main.player[Main.myPlayer].rulerAcc) + { + int num = (int)((float)((int)(Main.screenPosition.X / 16f) * 16) - Main.screenPosition.X); + int num2 = (int)((float)((int)(Main.screenPosition.Y / 16f) * 16) - Main.screenPosition.Y); + int num3 = Main.screenWidth / Main.gridTexture.Width; + int num4 = Main.screenHeight / Main.gridTexture.Height; + for (int i = 0; i <= num3 + 1; i++) + { + for (int j = 0; j <= num4 + 1; j++) + { + this.spriteBatch.Draw(Main.gridTexture, new Vector2((float)(i * Main.gridTexture.Width + num), (float)(j * Main.gridTexture.Height + num2)), new Rectangle?(new Rectangle(0, 0, Main.gridTexture.Width, Main.gridTexture.Height)), new Color(100, 100, 100, 15), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + if (this.showNPCs) + { + if (Main.ignoreErrors) + { + try + { + this.DrawNPCHouse(); + goto IL_147; + } + catch + { + goto IL_147; + } + } + this.DrawNPCHouse(); + } + IL_147: + Main.mH = 0; + if (Main.mapEnabled) + { + if (!Main.mapFullscreen && Main.mapStyle == 1) + { + Main.mH = 256; + if (Main.ignoreErrors) + { + try + { + this.DrawMap(); + goto IL_185; + } + catch + { + goto IL_185; + } + } + this.DrawMap(); + } + IL_185: + if (Main.mH + 600 > Main.screenHeight) + { + Main.mH = Main.screenHeight - 600; + } + } + if (Main.hbPosition != 0) + { + for (int k = 199; k >= 0; k--) + { + if (Main.npc[k].active && Main.npc[k].type > 0 && Main.npc[k].life != Main.npc[k].lifeMax && !Main.npc[k].dontTakeDamage) + { + float scale = 1f; + int type = Main.npc[k].type; + if (type == 4) + { + scale = 1.5f; + } + if (type == 35) + { + scale = 1.5f; + } + if (type == 36) + { + scale = 1.5f; + } + if (type == 50) + { + scale = 1.5f; + } + if (type == 113) + { + scale = 1.5f; + } + if (type == 114) + { + scale = 1.5f; + } + if (type == 125) + { + scale = 1.5f; + } + if (type == 126) + { + scale = 1.5f; + } + if (type == 127) + { + scale = 1.5f; + } + if (type == 128) + { + scale = 1.5f; + } + if (type == 129) + { + scale = 1.5f; + } + if (type == 130) + { + scale = 1.5f; + } + if (type == 131) + { + scale = 1.5f; + } + if (type == 222) + { + scale = 1.5f; + } + if (type >= 245 && type <= 249) + { + scale = 1.5f; + } + if (type == 262) + { + scale = 1.5f; + } + if (type == 266) + { + scale = 1.5f; + } + if (Main.hbPosition == 1) + { + float num5 = 10f; + num5 += Main.NPCAddHeight(k); + this.DrawHB(Main.npc[k].position.X + (float)(Main.npc[k].width / 2), Main.npc[k].position.Y + (float)Main.npc[k].height + num5 + Main.npc[k].gfxOffY, Main.npc[k].life, Main.npc[k].lifeMax, Lighting.Brightness((int)((Main.npc[k].position.X + (float)(Main.npc[k].width / 2)) / 16f), (int)((Main.npc[k].position.Y + (float)(Main.npc[k].height / 2) + Main.npc[k].gfxOffY) / 16f)), scale); + } + else + { + if (Main.hbPosition == 2) + { + float num6 = -24f; + num6 -= Main.NPCAddHeight(k) / 2f; + this.DrawHB(Main.npc[k].position.X + (float)(Main.npc[k].width / 2), Main.npc[k].position.Y + num6 + Main.npc[k].gfxOffY, Main.npc[k].life, Main.npc[k].lifeMax, Lighting.Brightness((int)((Main.npc[k].position.X + (float)(Main.npc[k].width / 2)) / 16f), (int)((Main.npc[k].position.Y + (float)(Main.npc[k].height / 2) + Main.npc[k].gfxOffY) / 16f)), scale); + } + } + } + } + for (int l = 0; l < 255; l++) + { + if (l != Main.myPlayer && Main.player[l].active && !Main.player[l].ghost && !Main.player[l].dead && Main.player[l].statLife != Main.player[l].statLifeMax) + { + if (Main.hbPosition == 1) + { + int num7 = 10; + this.DrawHB(Main.player[l].position.X + (float)(Main.player[l].width / 2), Main.player[l].position.Y + (float)Main.player[l].height + (float)num7 + Main.player[l].gfxOffY, Main.player[l].statLife, Main.player[l].statLifeMax, Lighting.Brightness((int)((Main.player[l].position.X + (float)(Main.player[l].width / 2)) / 16f), (int)((Main.player[l].position.Y + (float)(Main.player[l].height / 2) + Main.player[l].gfxOffY) / 16f)), 1f); + } + else + { + if (Main.hbPosition == 2) + { + int num8 = -20; + this.DrawHB(Main.player[l].position.X + (float)(Main.player[l].width / 2), Main.player[l].position.Y + (float)num8 + Main.player[l].gfxOffY, Main.player[l].statLife, Main.player[l].statLifeMax, Lighting.Brightness((int)((Main.player[l].position.X + (float)(Main.player[l].width / 2)) / 16f), (int)((Main.player[l].position.Y + (float)(Main.player[l].height / 2) + Main.player[l].gfxOffY) / 16f)), 1f); + } + } + } + } + } + if (Main.player[Main.myPlayer].selectedItem == 58 && Main.player[Main.myPlayer].itemAnimation > 0) + { + Main.mouseLeftRelease = false; + } + Main.mouseHC = false; + if (Main.hideUI) + { + Main.maxQ = true; + return; + } + if (Main.netDiag) + { + for (int m = 0; m < 4; m++) + { + string text = ""; + int num9 = 20; + int num10 = 220; + if (m == 0) + { + text = "RX Msgs: " + string.Format("{0:0,0}", Main.rxMsg); + num10 += m * 20; + } + else + { + if (m == 1) + { + text = "RX Bytes: " + string.Format("{0:0,0}", Main.rxData); + num10 += m * 20; + } + else + { + if (m == 2) + { + text = "TX Msgs: " + string.Format("{0:0,0}", Main.txMsg); + num10 += m * 20; + } + else + { + if (m == 3) + { + text = "TX Bytes: " + string.Format("{0:0,0}", Main.txData); + num10 += m * 20; + } + } + } + } + this.spriteBatch.DrawString(Main.fontMouseText, text, new Vector2((float)num9, (float)num10), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int n = 0; n < Main.maxMsg; n++) + { + float scale2 = 0.7f; + int num11 = 200; + int num12 = 120; + num12 += n * 13; + string text2 = n + ": "; + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num11, (float)num12), Color.White, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + num11 += 30; + text2 = "rx:" + string.Format("{0:0,0}", Main.rxMsgType[n]); + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num11, (float)num12), Color.White, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + num11 += 70; + text2 = string.Format("{0:0,0}", Main.rxDataType[n]); + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num11, (float)num12), Color.White, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + num11 += 70; + text2 = n + ": "; + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num11, (float)num12), Color.White, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + num11 += 30; + text2 = "tx:" + string.Format("{0:0,0}", Main.txMsgType[n]); + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num11, (float)num12), Color.White, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + num11 += 70; + text2 = string.Format("{0:0,0}", Main.txDataType[n]); + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2((float)num11, (float)num12), Color.White, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + } + } + if (Main.drawDiag) + { + for (int num13 = 0; num13 < 7; num13++) + { + string text3 = ""; + int num14 = 20; + int num15 = 220; + num15 += num13 * 16; + if (num13 == 0) + { + text3 = "Solid Tiles:"; + } + if (num13 == 1) + { + text3 = "Misc. Tiles:"; + } + if (num13 == 2) + { + text3 = "Walls Tiles:"; + } + if (num13 == 3) + { + text3 = "Background Tiles:"; + } + if (num13 == 4) + { + text3 = "Water Tiles:"; + } + if (num13 == 5) + { + text3 = "Black Tiles:"; + } + if (num13 == 6) + { + text3 = "Total Render:"; + } + this.spriteBatch.DrawString(Main.fontMouseText, text3, new Vector2((float)num14, (float)num15), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int num16 = 0; num16 < 7; num16++) + { + string text4 = ""; + int num17 = 180; + int num18 = 220; + num18 += num16 * 16; + if (num16 == 0) + { + text4 = Main.renderTimer[num16] + "ms"; + } + if (num16 == 1) + { + text4 = Main.renderTimer[num16] + "ms"; + } + if (num16 == 2) + { + text4 = Main.renderTimer[num16] + "ms"; + } + if (num16 == 3) + { + text4 = Main.renderTimer[num16] + "ms"; + } + if (num16 == 4) + { + text4 = Main.renderTimer[num16] + "ms"; + } + if (num16 == 5) + { + text4 = Main.renderTimer[num16] + "ms"; + } + if (num16 == 6) + { + text4 = Main.renderTimer[0] + Main.renderTimer[1] + Main.renderTimer[2] + Main.renderTimer[3] + Main.renderTimer[4] + Main.renderTimer[5] + "ms"; + } + this.spriteBatch.DrawString(Main.fontMouseText, text4, new Vector2((float)num17, (float)num18), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int num19 = 0; num19 < 6; num19++) + { + string text5 = ""; + int num20 = 20; + int num21 = 346; + num21 += num19 * 16; + if (num19 == 0) + { + text5 = "Lighting Init:"; + } + if (num19 == 1) + { + text5 = "Lighting Phase #1:"; + } + if (num19 == 2) + { + text5 = "Lighting Phase #2:"; + } + if (num19 == 3) + { + text5 = "Lighting Phase #3"; + } + if (num19 == 4) + { + text5 = "Lighting Phase #4"; + } + if (num19 == 5) + { + text5 = "Total Lighting:"; + } + this.spriteBatch.DrawString(Main.fontMouseText, text5, new Vector2((float)num20, (float)num21), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int num22 = 0; num22 < 6; num22++) + { + string text6 = ""; + int num23 = 180; + int num24 = 346; + num24 += num22 * 16; + if (num22 == 0) + { + text6 = Main.lightTimer[num22] + "ms"; + } + if (num22 == 1) + { + text6 = Main.lightTimer[num22] + "ms"; + } + if (num22 == 2) + { + text6 = Main.lightTimer[num22] + "ms"; + } + if (num22 == 3) + { + text6 = Main.lightTimer[num22] + "ms"; + } + if (num22 == 4) + { + text6 = Main.lightTimer[num22] + "ms"; + } + if (num22 == 5) + { + text6 = Main.lightTimer[0] + Main.lightTimer[1] + Main.lightTimer[2] + Main.lightTimer[3] + Main.lightTimer[4] + "ms"; + } + this.spriteBatch.DrawString(Main.fontMouseText, text6, new Vector2((float)num23, (float)num24), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + int num25 = 5; + for (int num26 = 0; num26 < num25; num26++) + { + int num27 = 20; + int num28 = 456; + num28 += num26 * 16; + string text7 = "Render #" + num26 + ":"; + this.spriteBatch.DrawString(Main.fontMouseText, text7, new Vector2((float)num27, (float)num28), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int num29 = 0; num29 < num25; num29++) + { + int num30 = 180; + int num31 = 456; + num31 += num29 * 16; + string text8 = Main.drawTimer[num29] + "ms"; + this.spriteBatch.DrawString(Main.fontMouseText, text8, new Vector2((float)num30, (float)num31), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + for (int num32 = 0; num32 < num25; num32++) + { + int num33 = 230; + int num34 = 456; + num34 += num32 * 16; + string text9 = Main.drawTimerMax[num32] + "ms"; + this.spriteBatch.DrawString(Main.fontMouseText, text9, new Vector2((float)num33, (float)num34), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + int num35 = 20; + int num36 = 456 + 16 * num25 + 16; + string text10 = "Update:"; + this.spriteBatch.DrawString(Main.fontMouseText, text10, new Vector2((float)num35, (float)num36), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + num35 = 180; + text10 = Main.upTimer + "ms"; + this.spriteBatch.DrawString(Main.fontMouseText, text10, new Vector2((float)num35, (float)num36), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + num35 = 230; + text10 = Main.upTimerMax + "ms"; + this.spriteBatch.DrawString(Main.fontMouseText, text10, new Vector2((float)num35, (float)num36), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.signBubble) + { + int num37 = (int)((float)Main.signX - Main.screenPosition.X); + int num38 = (int)((float)Main.signY - Main.screenPosition.Y); + SpriteEffects effects = SpriteEffects.None; + if ((float)Main.signX > Main.player[Main.myPlayer].position.X + (float)Main.player[Main.myPlayer].width) + { + effects = SpriteEffects.FlipHorizontally; + num37 += -8 - Main.chat2Texture.Width; + } + else + { + num37 += 8; + } + num38 -= 22; + this.spriteBatch.Draw(Main.chat2Texture, new Vector2((float)num37, (float)num38), new Rectangle?(new Rectangle(0, 0, Main.chat2Texture.Width, Main.chat2Texture.Height)), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, effects, 0f); + Main.signBubble = false; + } + for (int num39 = 0; num39 < 255; num39++) + { + if (Main.player[num39].active && Main.myPlayer != num39 && !Main.player[num39].dead) + { + new Rectangle((int)((double)Main.player[num39].position.X + (double)Main.player[num39].width * 0.5 - 16.0), (int)(Main.player[num39].position.Y + (float)Main.player[num39].height - 48f), 32, 48); + if (Main.player[Main.myPlayer].team > 0 && Main.player[Main.myPlayer].team == Main.player[num39].team) + { + new Rectangle((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); + string text11 = Main.player[num39].name; + if (Main.player[num39].statLife < Main.player[num39].statLifeMax) + { + object obj = text11; + text11 = string.Concat(new object[] + { + obj, + ": ", + Main.player[num39].statLife, + "/", + Main.player[num39].statLifeMax + }); + } + Vector2 position = Main.fontMouseText.MeasureString(text11); + float num40 = 0f; + if (Main.player[num39].chatShowTime > 0) + { + num40 = -position.Y; + } + float num41 = 0f; + float num42 = (float)Main.mouseTextColor / 255f; + Color color = new Color((int)((byte)((float)Main.teamColor[Main.player[num39].team].R * num42)), (int)((byte)((float)Main.teamColor[Main.player[num39].team].G * num42)), (int)((byte)((float)Main.teamColor[Main.player[num39].team].B * num42)), (int)Main.mouseTextColor); + Vector2 vector = new Vector2((float)(Main.screenWidth / 2) + Main.screenPosition.X, (float)(Main.screenHeight / 2) + Main.screenPosition.Y); + float num43 = Main.player[num39].position.X + (float)(Main.player[num39].width / 2) - vector.X; + float num44 = Main.player[num39].position.Y - position.Y - 2f + num40 - vector.Y; + float num45 = (float)Math.Sqrt((double)(num43 * num43 + num44 * num44)); + int num46 = Main.screenHeight; + if (Main.screenHeight > Main.screenWidth) + { + num46 = Main.screenWidth; + } + num46 = num46 / 2 - 30; + if (num46 < 100) + { + num46 = 100; + } + if (num45 < (float)num46) + { + position.X = Main.player[num39].position.X + (float)(Main.player[num39].width / 2) - position.X / 2f - Main.screenPosition.X; + position.Y = Main.player[num39].position.Y - position.Y - 2f + num40 - Main.screenPosition.Y; + } + else + { + num41 = num45; + num45 = (float)num46 / num45; + position.X = (float)(Main.screenWidth / 2) + num43 * num45 - position.X / 2f; + position.Y = (float)(Main.screenHeight / 2) + num44 * num45; + } + if (Main.player[Main.myPlayer].gravDir == -1f) + { + position.Y = (float)Main.screenHeight - position.Y; + } + if (num41 > 0f) + { + string text12 = "(" + (int)(num41 / 16f * 2f) + " ft)"; + Vector2 position2 = Main.fontMouseText.MeasureString(text12); + position2.X = position.X + Main.fontMouseText.MeasureString(text11).X / 2f - position2.X / 2f; + position2.Y = position.Y + Main.fontMouseText.MeasureString(text11).Y / 2f - position2.Y / 2f - 20f; + this.spriteBatch.DrawString(Main.fontMouseText, text12, new Vector2(position2.X - 2f, position2.Y), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text12, new Vector2(position2.X + 2f, position2.Y), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text12, new Vector2(position2.X, position2.Y - 2f), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text12, new Vector2(position2.X, position2.Y + 2f), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text12, position2, color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + this.spriteBatch.DrawString(Main.fontMouseText, text11, new Vector2(position.X - 2f, position.Y), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text11, new Vector2(position.X + 2f, position.Y), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text11, new Vector2(position.X, position.Y - 2f), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text11, new Vector2(position.X, position.Y + 2f), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.DrawString(Main.fontMouseText, text11, position, color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + if (Main.playerInventory) + { + Main.npcChatText = ""; + Main.player[Main.myPlayer].sign = -1; + } + if (Main.ignoreErrors) + { + try + { + if (Main.npcChatText != "" || Main.player[Main.myPlayer].sign != -1) + { + this.DrawChat(); + } + goto IL_1AF7; + } + catch + { + goto IL_1AF7; + } + } + if (Main.npcChatText != "" || Main.player[Main.myPlayer].sign != -1) + { + this.DrawChat(); + } + IL_1AF7: + Main.inventoryBack = new Color(220, 220, 220, 220); + Main.invAlpha += Main.invDir * 0.2f; + if (Main.invAlpha > 240f) + { + Main.invAlpha = 240f; + Main.invDir = -1f; + } + if (Main.invAlpha < 180f) + { + Main.invAlpha = 180f; + Main.invDir = 1f; + } + Main.inventoryBack = new Color((int)((byte)Main.invAlpha), (int)((byte)Main.invAlpha), (int)((byte)Main.invAlpha), (int)((byte)Main.invAlpha)); + Main.mouseText = false; + Main.rare = 0; + if (Main.ignoreErrors) + { + try + { + this.DrawInterfaceBars(); + goto IL_1BB1; + } + catch + { + goto IL_1BB1; + } + } + this.DrawInterfaceBars(); + IL_1BB1: + if (Main.player[Main.myPlayer].dead) + { + Main.playerInventory = false; + } + if (!Main.playerInventory) + { + Main.player[Main.myPlayer].chest = -1; + if (Main.craftGuide) + { + Main.craftGuide = false; + Recipe.FindRecipes(); + } + Main.reforge = false; + } + Main.hoverItemName = ""; + if (Main.playerInventory) + { + if (Main.ignoreErrors) + { + try + { + this.DrawInventory(); + goto IL_20A1; + } + catch + { + goto IL_20A1; + } + } + this.DrawInventory(); + } + else + { + if (Main.npcChatText == null || Main.npcChatText == "") + { + bool flag = false; + bool flag2 = false; + bool flag3 = false; + for (int num47 = 0; num47 < 3; num47++) + { + string text13 = ""; + if (Main.player[Main.myPlayer].accCompass > 0 && !flag3) + { + int num48 = (int)((Main.player[Main.myPlayer].position.X + (float)(Main.player[Main.myPlayer].width / 2)) * 2f / 16f - (float)Main.maxTilesX); + if (num48 > 0) + { + text13 = "Position: " + num48 + " feet east"; + if (num48 == 1) + { + text13 = "Position: " + num48 + " foot east"; + } + } + else + { + if (num48 < 0) + { + num48 *= -1; + text13 = "Position: " + num48 + " feet west"; + if (num48 == 1) + { + text13 = "Position: " + num48 + " foot west"; + } + } + else + { + text13 = "Position: center"; + } + } + flag3 = true; + } + else + { + if (Main.player[Main.myPlayer].accDepthMeter > 0 && !flag2) + { + int num49 = (int)((double)((Main.player[Main.myPlayer].position.Y + (float)Main.player[Main.myPlayer].height) * 2f / 16f) - Main.worldSurface * 2.0); + if (num49 > 0) + { + text13 = "Depth: " + num49 + " feet below"; + if (num49 == 1) + { + text13 = "Depth: " + num49 + " foot below"; + } + } + else + { + if (num49 < 0) + { + num49 *= -1; + text13 = "Depth: " + num49 + " feet above"; + if (num49 == 1) + { + text13 = "Depth: " + num49 + " foot above"; + } + } + else + { + text13 = "Depth: Level"; + } + } + flag2 = true; + } + else + { + if (Main.player[Main.myPlayer].accWatch > 0 && !flag) + { + string text14 = "AM"; + double num50 = Main.time; + if (!Main.dayTime) + { + num50 += 54000.0; + } + num50 = num50 / 86400.0 * 24.0; + double num51 = 7.5; + num50 = num50 - num51 - 12.0; + if (num50 < 0.0) + { + num50 += 24.0; + } + if (num50 >= 12.0) + { + text14 = "PM"; + } + int num52 = (int)num50; + double num53 = num50 - (double)num52; + num53 = (double)((int)(num53 * 60.0)); + string text15 = string.Concat(num53); + if (num53 < 10.0) + { + text15 = "0" + text15; + } + if (num52 > 12) + { + num52 -= 12; + } + if (num52 == 0) + { + num52 = 12; + } + if (Main.player[Main.myPlayer].accWatch == 1) + { + text15 = "00"; + } + else + { + if (Main.player[Main.myPlayer].accWatch == 2) + { + if (num53 < 30.0) + { + text15 = "00"; + } + else + { + text15 = "30"; + } + } + } + text13 = string.Concat(new object[] + { + Lang.inter[34], + ": ", + num52, + ":", + text15, + " ", + text14 + }); + flag = true; + } + } + } + if (text13 != "") + { + for (int num54 = 0; num54 < 5; num54++) + { + int num55 = 0; + int num56 = 0; + Color black = Color.Black; + if (num54 == 0) + { + num55 = -2; + } + if (num54 == 1) + { + num55 = 2; + } + if (num54 == 2) + { + num56 = -2; + } + if (num54 == 3) + { + num56 = 2; + } + if (num54 == 4) + { + black = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + } + this.spriteBatch.DrawString(Main.fontMouseText, text13, new Vector2((float)(22 + num55), (float)(110 + 22 * num47 + num56 + 48)), black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + IL_20A1: + if (Main.playerInventory || Main.player[Main.myPlayer].ghost) + { + string text16 = Lang.inter[35]; + Vector2 vector2 = Main.fontMouseText.MeasureString("Save & Exit"); + Vector2 vector3 = Main.fontMouseText.MeasureString(Lang.inter[35]); + if (Main.netMode != 0) + { + text16 = Lang.inter[36]; + vector2 = Main.fontMouseText.MeasureString("Disconnect"); + vector3 = Main.fontMouseText.MeasureString(Lang.inter[36]); + } + Vector2 vector4 = Main.fontDeathText.MeasureString(text16); + int num57 = Main.screenWidth - 110; + int num58 = Main.screenHeight - 20; + float num59 = vector2.X / vector3.X; + if (Main.mouseExit) + { + if (Main.exitScale < 1f) + { + Main.exitScale += 0.02f; + } + } + else + { + if ((double)Main.exitScale > 0.8) + { + Main.exitScale -= 0.02f; + } + } + for (int num60 = 0; num60 < 5; num60++) + { + int num61 = 0; + int num62 = 0; + Color color2 = Color.Black; + if (num60 == 0) + { + num61 = -2; + } + if (num60 == 1) + { + num61 = 2; + } + if (num60 == 2) + { + num62 = -2; + } + if (num60 == 3) + { + num62 = 2; + } + if (num60 == 4) + { + color2 = Color.White; + } + this.spriteBatch.DrawString(Main.fontDeathText, text16, new Vector2((float)(num57 + num61), (float)(num58 + num62)), color2, 0f, new Vector2(vector4.X / 2f, vector4.Y / 2f), (Main.exitScale - 0.2f) * num59, SpriteEffects.None, 0f); + } + if ((float)Main.mouseX > (float)num57 - vector4.X / 2f && (float)Main.mouseX < (float)num57 + vector4.X / 2f && (float)Main.mouseY > (float)num58 - vector4.Y / 2f && (float)Main.mouseY < (float)num58 + vector4.Y / 2f - 10f) + { + if (!Main.mouseExit) + { + Main.PlaySound(12, -1, -1, 1); + } + Main.mouseExit = true; + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + Main.menuMode = 10; + WorldGen.SaveAndQuit(); + } + } + else + { + Main.mouseExit = false; + } + } + if (Main.ignoreErrors) + { + try + { + this.DrawHotbar(); + goto IL_2317; + } + catch + { + goto IL_2317; + } + } + this.DrawHotbar(); + IL_2317: + if (Main.mouseItem.stack <= 0) + { + Main.mouseItem.type = 0; + } + if (Main.hoverItemName != null && Main.hoverItemName != "" && Main.mouseItem.type == 0) + { + Main.player[Main.myPlayer].showItemIcon = false; + this.MouseText(Main.hoverItemName, Main.rare, 0); + Main.mouseText = true; + } + if (Main.ignoreErrors) + { + try + { + this.DrawPlayerChat(); + goto IL_2393; + } + catch + { + goto IL_2393; + } + } + this.DrawPlayerChat(); + IL_2393: + if (Main.player[Main.myPlayer].dead) + { + string text17 = Lang.inter[38]; + this.spriteBatch.DrawString(Main.fontDeathText, text17, new Vector2((float)(Main.screenWidth / 2 - text17.Length * 10), (float)(Main.screenHeight / 2 - 20)), Main.player[Main.myPlayer].GetDeathAlpha(new Color(0, 0, 0, 0)), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + this.spriteBatch.Draw(Main.cursorTexture, new Vector2((float)(Main.mouseX + 1), (float)(Main.mouseY + 1)), new Rectangle?(new Rectangle(0, 0, Main.cursorTexture.Width, Main.cursorTexture.Height)), new Color((int)((float)Main.cursorColor.R * 0.2f), (int)((float)Main.cursorColor.G * 0.2f), (int)((float)Main.cursorColor.B * 0.2f), (int)((float)Main.cursorColor.A * 0.5f)), 0f, default(Vector2), Main.cursorScale * 1.1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.cursorTexture, new Vector2((float)Main.mouseX, (float)Main.mouseY), new Rectangle?(new Rectangle(0, 0, Main.cursorTexture.Width, Main.cursorTexture.Height)), Main.cursorColor, 0f, default(Vector2), Main.cursorScale, SpriteEffects.None, 0f); + if (Main.mouseItem.type > 0 && Main.mouseItem.stack > 0) + { + this.mouseNPC = -1; + Main.player[Main.myPlayer].showItemIcon = false; + Main.player[Main.myPlayer].showItemIcon2 = 0; + Main.mouseText = true; + float num63 = 1f; + if (Main.itemTexture[Main.mouseItem.type].Width > 32 || Main.itemTexture[Main.mouseItem.type].Height > 32) + { + if (Main.itemTexture[Main.mouseItem.type].Width > Main.itemTexture[Main.mouseItem.type].Height) + { + num63 = 32f / (float)Main.itemTexture[Main.mouseItem.type].Width; + } + else + { + num63 = 32f / (float)Main.itemTexture[Main.mouseItem.type].Height; + } + } + float num64 = 1f; + num64 *= Main.cursorScale; + Color white = Color.White; + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 662 || Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 663) + { + white.R = (byte)Main.DiscoR; + white.G = (byte)Main.DiscoG; + white.B = (byte)Main.DiscoB; + white.A = 255; + } + num63 *= num64; + this.spriteBatch.Draw(Main.itemTexture[Main.mouseItem.type], new Vector2((float)Main.mouseX + 26f * num64 - (float)Main.itemTexture[Main.mouseItem.type].Width * 0.5f * num63, (float)Main.mouseY + 26f * num64 - (float)Main.itemTexture[Main.mouseItem.type].Height * 0.5f * num63), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.mouseItem.type].Width, Main.itemTexture[Main.mouseItem.type].Height)), Main.mouseItem.GetAlpha(white), 0f, default(Vector2), num63, SpriteEffects.None, 0f); + if (Main.mouseItem.color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.mouseItem.type], new Vector2((float)Main.mouseX + 26f * num64 - (float)Main.itemTexture[Main.mouseItem.type].Width * 0.5f * num63, (float)Main.mouseY + 26f * num64 - (float)Main.itemTexture[Main.mouseItem.type].Height * 0.5f * num63), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.mouseItem.type].Width, Main.itemTexture[Main.mouseItem.type].Height)), Main.mouseItem.GetColor(white), 0f, default(Vector2), num63, SpriteEffects.None, 0f); + } + if (Main.mouseItem.stack > 1) + { + white = Color.White; + this.spriteBatch.DrawString(Main.fontItemStack, string.Concat(Main.mouseItem.stack), new Vector2((float)Main.mouseX + 10f * num64, (float)Main.mouseY + 26f * num64), white, 0f, default(Vector2), num63, SpriteEffects.None, 0f); + } + } + else + { + if (this.mouseNPC > -1) + { + Main.player[Main.myPlayer].mouseInterface = true; + Main.mouseText = false; + float num65 = 1f; + num65 *= Main.cursorScale; + this.spriteBatch.Draw(Main.npcHeadTexture[this.mouseNPC], new Vector2((float)Main.mouseX + 26f * num65 - (float)Main.npcHeadTexture[this.mouseNPC].Width * 0.5f * num65, (float)Main.mouseY + 26f * num65 - (float)Main.npcHeadTexture[this.mouseNPC].Height * 0.5f * num65), new Rectangle?(new Rectangle(0, 0, Main.npcHeadTexture[this.mouseNPC].Width, Main.npcHeadTexture[this.mouseNPC].Height)), Color.White, 0f, default(Vector2), num65, SpriteEffects.None, 0f); + if (Main.mouseRight && Main.mouseRightRelease) + { + Main.PlaySound(12, -1, -1, 1); + this.mouseNPC = -1; + } + if (Main.mouseLeft && Main.mouseLeftRelease) + { + if (this.mouseNPC == 0) + { + int x = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f); + int y = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f); + int n2 = -1; + if (WorldGen.MoveNPC(x, y, n2)) + { + Main.NewText(Lang.inter[39], 255, 240, 20, false); + } + } + else + { + int num66 = 0; + for (int num67 = 0; num67 < 200; num67++) + { + if (Main.npc[num67].active && Main.npc[num67].type == NPC.NumToType(this.mouseNPC)) + { + num66 = num67; + break; + } + } + if (num66 >= 0) + { + int x2 = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f); + int y2 = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f); + if (WorldGen.MoveNPC(x2, y2, num66)) + { + this.mouseNPC = -1; + WorldGen.moveRoom(x2, y2, num66); + Main.PlaySound(12, -1, -1, 1); + } + } + else + { + this.mouseNPC = 0; + } + } + } + } + } + if (Main.ignoreErrors) + { + try + { + this.DrawMouseOver(); + goto IL_2B69; + } + catch + { + goto IL_2B69; + } + } + this.DrawMouseOver(); + IL_2B69: + if (Main.mouseRight) + { + Main.npcChatRelease = false; + } + else + { + Main.npcChatRelease = true; + } + if (Main.player[Main.myPlayer].showItemIcon && (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type > 0 || Main.player[Main.myPlayer].showItemIcon2 > 0)) + { + int num68 = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type; + Color color3 = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].GetAlpha(Color.White); + Color color4 = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].GetColor(Color.White); + if (Main.player[Main.myPlayer].showItemIcon2 > 0) + { + num68 = Main.player[Main.myPlayer].showItemIcon2; + color3 = Color.White; + color4 = default(Color); + } + float scale3 = Main.cursorScale; + if (num68 == 662 || num68 == 663) + { + color3.R = (byte)Main.DiscoR; + color3.G = (byte)Main.DiscoG; + color3.B = (byte)Main.DiscoB; + color3.A = 255; + } + SpriteEffects effects2 = SpriteEffects.None; + if ((Main.player[Main.myPlayer].showItemIcon2 == 928 || Main.player[Main.myPlayer].showItemIcon2 == 1337) && Main.player[Main.myPlayer].showItemIconR) + { + effects2 = SpriteEffects.FlipHorizontally; + } + this.spriteBatch.Draw(Main.itemTexture[num68], new Vector2((float)(Main.mouseX + 10), (float)(Main.mouseY + 10)), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[num68].Width, Main.itemTexture[num68].Height)), color3, 0f, default(Vector2), scale3, effects2, 0f); + if (Main.player[Main.myPlayer].showItemIcon2 == 0 && Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type], new Vector2((float)(Main.mouseX + 10), (float)(Main.mouseY + 10)), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type].Height)), color4, 0f, default(Vector2), scale3, SpriteEffects.None, 0f); + } + } + Main.player[Main.myPlayer].showItemIcon = false; + Main.player[Main.myPlayer].showItemIcon2 = 0; + } + protected void QuitGame() + { + Steam.Kill(); + base.Exit(); + } + protected Color randColor() + { + int num = 0; + int num2 = 0; + int num3 = 0; + while (num + num3 + num2 <= 150) + { + num = Main.rand.Next(256); + num2 = Main.rand.Next(256); + num3 = Main.rand.Next(256); + } + return new Color(num, num2, num3, 255); + } + public static Color hslToRgb(float Hue, float Saturation, float Luminosity) + { + byte r; + byte g; + byte b; + if (Saturation == 0f) + { + r = (byte)Math.Round((double)Luminosity * 255.0); + g = (byte)Math.Round((double)Luminosity * 255.0); + b = (byte)Math.Round((double)Luminosity * 255.0); + } + else + { + double num = (double)Hue; + double num2; + if ((double)Luminosity < 0.5) + { + num2 = (double)Luminosity * (1.0 + (double)Saturation); + } + else + { + num2 = (double)(Luminosity + Saturation - Luminosity * Saturation); + } + double t = 2.0 * (double)Luminosity - num2; + double num3 = num + 0.33333333333333331; + double num4 = num; + double num5 = num - 0.33333333333333331; + num3 = Main.hue2rgb(num3, t, num2); + num4 = Main.hue2rgb(num4, t, num2); + num5 = Main.hue2rgb(num5, t, num2); + r = (byte)Math.Round(num3 * 255.0); + g = (byte)Math.Round(num4 * 255.0); + b = (byte)Math.Round(num5 * 255.0); + } + return new Color((int)r, (int)g, (int)b); + } + public static double hue2rgb(double c, double t1, double t2) + { + if (c < 0.0) + { + c += 1.0; + } + if (c > 1.0) + { + c -= 1.0; + } + if (6.0 * c < 1.0) + { + return t1 + (t2 - t1) * 6.0 * c; + } + if (2.0 * c < 1.0) + { + return t2; + } + if (3.0 * c < 2.0) + { + return t1 + (t2 - t1) * (0.66666666666666663 - c) * 6.0; + } + return t1; + } + public static Vector3 rgbToHsl(Color newColor) + { + float num = (float)newColor.R; + float num2 = (float)newColor.G; + float num3 = (float)newColor.B; + num /= 255f; + num2 /= 255f; + num3 /= 255f; + float num4 = Math.Max(num, num2); + num4 = Math.Max(num4, num3); + float num5 = Math.Min(num, num2); + num5 = Math.Min(num5, num3); + float num6 = 0f; + float num7 = (num4 + num5) / 2f; + float y; + if (num4 == num5) + { + y = (num6 = 0f); + } + else + { + float num8 = num4 - num5; + y = (((double)num7 > 0.5) ? (num8 / (2f - num4 - num5)) : (num8 / (num4 + num5))); + if (num4 == num) + { + num6 = (num2 - num3) / num8 + (float)((num2 < num3) ? 6 : 0); + } + if (num4 == num2) + { + num6 = (num3 - num) / num8 + 2f; + } + if (num4 == num3) + { + num6 = (num - num2) / num8 + 4f; + } + num6 /= 6f; + } + return new Vector3(num6, y, num7); + } + protected void DrawMenu() + { + Main.render = false; + Star.UpdateStars(); + Cloud.UpdateClouds(); + Main.holyTiles = 0; + Main.evilTiles = 0; + Main.shroomTiles = 0; + Main.bloodTiles = 0; + Main.bloodTiles = 0; + Main.jungleTiles = 0; + Main.chatMode = false; + for (int i = 0; i < Main.numChatLines; i++) + { + Main.chatLine[i] = new ChatLine(); + } + this.DrawFPS(); + Main.screenLastPosition = Main.screenPosition; + Main.screenPosition.Y = (float)(Main.worldSurface * 16.0 - (double)Main.screenHeight); + if (Main.grabSky) + { + Main.screenPosition.X = Main.screenPosition.X + (float)(Main.mouseX - Main.screenWidth / 2) * 0.02f; + } + else + { + Main.screenPosition.X = Main.screenPosition.X + 2f; + } + if (Main.screenPosition.X > 2.14748352E+09f) + { + Main.screenPosition.X = 0f; + } + if (Main.screenPosition.X < -2.14748352E+09f) + { + Main.screenPosition.X = 0f; + } + Main.background = 0; + byte b = (byte)((255 + Main.tileColor.R * 2) / 3); + Color color = new Color((int)b, (int)b, (int)b, 255); + this.logoRotation += this.logoRotationSpeed * 3E-05f; + if ((double)this.logoRotation > 0.1) + { + this.logoRotationDirection = -1f; + } + else + { + if ((double)this.logoRotation < -0.1) + { + this.logoRotationDirection = 1f; + } + } + if (this.logoRotationSpeed < 20f & this.logoRotationDirection == 1f) + { + this.logoRotationSpeed += 1f; + } + else + { + if (this.logoRotationSpeed > -20f & this.logoRotationDirection == -1f) + { + this.logoRotationSpeed -= 1f; + } + } + this.logoScale += this.logoScaleSpeed * 1E-05f; + if ((double)this.logoScale > 1.1) + { + this.logoScaleDirection = -1f; + } + else + { + if ((double)this.logoScale < 0.9) + { + this.logoScaleDirection = 1f; + } + } + if (this.logoScaleSpeed < 50f & this.logoScaleDirection == 1f) + { + this.logoScaleSpeed += 1f; + } + else + { + if (this.logoScaleSpeed > -50f & this.logoScaleDirection == -1f) + { + this.logoScaleSpeed -= 1f; + } + } + Color color2 = new Color((int)((byte)((float)color.R * ((float)Main.LogoA / 255f))), (int)((byte)((float)color.G * ((float)Main.LogoA / 255f))), (int)((byte)((float)color.B * ((float)Main.LogoA / 255f))), (int)((byte)((float)color.A * ((float)Main.LogoA / 255f)))); + Color color3 = new Color((int)((byte)((float)color.R * ((float)Main.LogoB / 255f))), (int)((byte)((float)color.G * ((float)Main.LogoB / 255f))), (int)((byte)((float)color.B * ((float)Main.LogoB / 255f))), (int)((byte)((float)color.A * ((float)Main.LogoB / 255f)))); + this.spriteBatch.Draw(Main.logoTexture, new Vector2((float)(Main.screenWidth / 2), 100f), new Rectangle?(new Rectangle(0, 0, Main.logoTexture.Width, Main.logoTexture.Height)), color2, this.logoRotation, new Vector2((float)(Main.logoTexture.Width / 2), (float)(Main.logoTexture.Height / 2)), this.logoScale, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.logo2Texture, new Vector2((float)(Main.screenWidth / 2), 100f), new Rectangle?(new Rectangle(0, 0, Main.logoTexture.Width, Main.logoTexture.Height)), color3, this.logoRotation, new Vector2((float)(Main.logoTexture.Width / 2), (float)(Main.logoTexture.Height / 2)), this.logoScale, SpriteEffects.None, 0f); + if (Main.dayTime) + { + Main.LogoA += 2; + if (Main.LogoA > 255) + { + Main.LogoA = 255; + } + Main.LogoB--; + if (Main.LogoB < 0) + { + Main.LogoB = 0; + } + } + else + { + Main.LogoB += 2; + if (Main.LogoB > 255) + { + Main.LogoB = 255; + } + Main.LogoA--; + if (Main.LogoA < 0) + { + Main.LogoA = 0; + Main.LogoT = true; + } + } + int num = 250; + int num2 = Main.screenWidth / 2; + int num3 = 80; + int num4 = 0; + int num5 = Main.menuMode; + int num6 = -1; + int num7 = 0; + int num8 = 0; + bool flag = false; + bool flag2 = false; + bool flag3 = false; + int num9 = 0; + bool[] array = new bool[Main.maxMenuItems]; + bool[] array2 = new bool[Main.maxMenuItems]; + bool[] array3 = new bool[Main.maxMenuItems]; + int[] array4 = new int[Main.maxMenuItems]; + int[] array5 = new int[Main.maxMenuItems]; + byte[] array6 = new byte[Main.maxMenuItems]; + float[] array7 = new float[Main.maxMenuItems]; + bool[] array8 = new bool[Main.maxMenuItems]; + for (int j = 0; j < Main.maxMenuItems; j++) + { + array[j] = false; + array2[j] = false; + array4[j] = 0; + array5[j] = 0; + array7[j] = 1f; + } + string[] array9 = new string[Main.maxMenuItems]; + if (Main.menuMode == -1) + { + Main.menuMode = 0; + } + if (Main.menuMode == 1212) + { + if (this.focusMenu == 2) + { + array9[0] = "Wählen Sie die Sprache"; + } + else + { + if (this.focusMenu == 3) + { + array9[0] = "Selezionare la lingua"; + } + else + { + if (this.focusMenu == 4) + { + array9[0] = "Sélectionnez la langue"; + } + else + { + if (this.focusMenu == 5) + { + array9[0] = "Seleccione el idioma"; + } + else + { + array9[0] = "Select language"; + } + } + } + } + num3 = 50; + num = 200; + array4[1] = 25; + array4[2] = 25; + array4[3] = 25; + array4[4] = 25; + array4[5] = 25; + array[0] = true; + array9[1] = "English"; + array9[2] = "Deutsch"; + array9[3] = "Italiano"; + array9[4] = "Française"; + array9[5] = "Español"; + num4 = 6; + if (this.selectedMenu >= 1) + { + Lang.lang = this.selectedMenu; + Lang.setLang(false); + Main.menuMode = 0; + Main.PlaySound(10, -1, -1, 1); + this.SaveSettings(); + } + } + else + { + if (Main.menuMode == 1213) + { + if (this.focusMenu == 1) + { + array9[0] = "Select language"; + } + else + { + if (this.focusMenu == 2) + { + array9[0] = "Wählen Sie die Sprache"; + } + else + { + if (this.focusMenu == 3) + { + array9[0] = "Selezionare la lingua"; + } + else + { + if (this.focusMenu == 4) + { + array9[0] = "Sélectionnez la langue"; + } + else + { + if (this.focusMenu == 5) + { + array9[0] = "Seleccione el idioma"; + } + else + { + array9[0] = Lang.menu[102]; + } + } + } + } + } + num3 = 48; + num = 180; + array4[1] = 25; + array4[2] = 25; + array4[3] = 25; + array4[4] = 25; + array4[5] = 25; + array4[6] = 50; + array[0] = true; + array9[1] = "English"; + array9[2] = "Deutsch"; + array9[3] = "Italiano"; + array9[4] = "Française"; + array9[5] = "Español"; + array9[6] = Lang.menu[5]; + num4 = 7; + if (this.selectedMenu == 6) + { + Main.menuMode = 11; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu >= 1) + { + Lang.lang = this.selectedMenu; + Lang.setLang(false); + Main.PlaySound(12, -1, -1, 1); + this.SaveSettings(); + } + } + } + else + { + if (Main.netMode == 2) + { + bool flag4 = true; + for (int k = 0; k < 8; k++) + { + if (k < 255) + { + try + { + array9[k] = Netplay.serverSock[k].statusText; + if (Netplay.serverSock[k].active && Main.showSpam) + { + string[] array10; + string[] expr_83A = array10 = array9; + IntPtr intPtr; + int expr_83F = (int)(intPtr = (IntPtr)k); + object obj = array10[(int)intPtr]; + expr_83A[expr_83F] = string.Concat(new object[] + { + obj, + " (", + NetMessage.buffer[k].spamCount, + ")" + }); + } + } + catch + { + array9[k] = ""; + } + array[k] = true; + if (array9[k] != "" && array9[k] != null) + { + flag4 = false; + } + } + } + if (flag4) + { + array9[0] = Lang.menu[0]; + array9[1] = Lang.menu[1] + Netplay.serverPort + "."; + } + num4 = 11; + array9[9] = Main.statusText; + array[9] = true; + num = 170; + num3 = 30; + array4[10] = 20; + array4[10] = 40; + array9[10] = Lang.menu[2]; + if (this.selectedMenu == 10) + { + Netplay.disconnect = true; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 31) + { + string password = Netplay.password; + Netplay.password = Main.GetInputText(Netplay.password); + if (password != Netplay.password) + { + Main.PlaySound(12, -1, -1, 1); + } + array9[0] = Lang.menu[3]; + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + array9[1] = Netplay.password; + if (this.textBlinkerState == 1) + { + string[] array10; + (array10 = array9)[1] = array10[1] + "|"; + array5[1] = 1; + } + else + { + string[] array10; + (array10 = array9)[1] = array10[1] + " "; + } + array[0] = true; + array[1] = true; + array4[1] = -20; + array4[2] = 20; + array9[2] = Lang.menu[4]; + array9[3] = Lang.menu[5]; + num4 = 4; + if (this.selectedMenu == 3) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + Netplay.disconnect = true; + Netplay.password = ""; + } + else + { + if (this.selectedMenu == 2 || Main.inputTextEnter) + { + NetMessage.SendData(38, -1, -1, Netplay.password, 0, 0f, 0f, 0f, 0); + Main.menuMode = 14; + } + } + } + else + { + if (Main.netMode == 1 || Main.menuMode == 14) + { + num4 = 2; + array9[0] = Main.statusText; + array[0] = true; + num = 300; + array9[1] = Lang.menu[6]; + if (this.selectedMenu != 1) + { + goto IL_443A; + } + Netplay.disconnect = true; + Netplay.clientSock.tcpClient.Close(); + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + Main.netMode = 0; + try + { + this.tServer.Kill(); + goto IL_443A; + } + catch + { + goto IL_443A; + } + } + if (Main.menuMode == 30) + { + string password2 = Netplay.password; + Netplay.password = Main.GetInputText(Netplay.password); + if (password2 != Netplay.password) + { + Main.PlaySound(12, -1, -1, 1); + } + array9[0] = Lang.menu[7]; + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + array9[1] = Netplay.password; + if (this.textBlinkerState == 1) + { + string[] array10; + (array10 = array9)[1] = array10[1] + "|"; + array5[1] = 1; + } + else + { + string[] array10; + (array10 = array9)[1] = array10[1] + " "; + } + array[0] = true; + array[1] = true; + array4[1] = -20; + array4[2] = 20; + array9[2] = Lang.menu[4]; + array9[3] = Lang.menu[5]; + num4 = 4; + if (this.selectedMenu == 3) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 6; + Netplay.password = ""; + } + else + { + if (this.selectedMenu == 2 || Main.inputTextEnter || Main.autoPass) + { + this.tServer.StartInfo.FileName = "TerrariaServer.exe"; + this.tServer.StartInfo.Arguments = string.Concat(new object[] + { + "-autoshutdown -world \"", + Main.worldPathName, + "\" -password \"", + Netplay.password, + "\" -lang ", + Lang.lang + }); + if (Main.libPath != "") + { + ProcessStartInfo expr_CE4 = this.tServer.StartInfo; + expr_CE4.Arguments = expr_CE4.Arguments + " -loadlib " + Main.libPath; + } + this.tServer.StartInfo.UseShellExecute = false; + this.tServer.StartInfo.CreateNoWindow = true; + this.tServer.Start(); + Netplay.SetIP("127.0.0.1"); + Main.autoPass = true; + Main.statusText = Lang.menu[8]; + Netplay.StartClient(); + Main.menuMode = 10; + } + } + } + else + { + if (Main.menuMode == 15) + { + num4 = 2; + array9[0] = Main.statusText; + array[0] = true; + num = 80; + num3 = 400; + array9[1] = Lang.menu[5]; + if (this.selectedMenu == 1) + { + Netplay.disconnect = true; + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + Main.netMode = 0; + } + } + else + { + if (Main.menuMode == 200) + { + num4 = 3; + array9[0] = Lang.menu[9]; + array[0] = true; + num -= 30; + array4[1] = 70; + array4[2] = 50; + array9[1] = Lang.menu[10]; + array9[2] = Lang.menu[6]; + if (this.selectedMenu == 1) + { + if (File.Exists(Main.worldPathName + ".bak")) + { + File.Copy(Main.worldPathName + ".bak", Main.worldPathName, true); + File.Delete(Main.worldPathName + ".bak"); + Main.PlaySound(10, -1, -1, 1); + WorldGen.playWorld(); + Main.menuMode = 10; + } + else + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + Main.netMode = 0; + } + } + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + Main.netMode = 0; + } + } + else + { + if (Main.menuMode == 201) + { + num4 = 3; + array9[0] = Lang.menu[9]; + array[0] = true; + array[1] = true; + num -= 30; + array4[1] = -30; + array4[2] = 50; + array9[1] = Lang.menu[11]; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + Main.netMode = 0; + } + } + else + { + if (Main.menuMode == 10) + { + num4 = 1; + array9[0] = Main.statusText; + array[0] = true; + num = 300; + } + else + { + if (Main.menuMode == 100) + { + num4 = 1; + array9[0] = Main.statusText; + array[0] = true; + num = 300; + } + else + { + if (Main.menuMode == 0) + { + Main.eclipse = false; + Main.ServerSideCharacter = false; + Main.menuMultiplayer = false; + Main.menuServer = false; + Main.netMode = 0; + array9[0] = Lang.menu[12]; + array9[1] = Lang.menu[13]; + array9[2] = Lang.menu[14]; + array9[3] = Lang.menu[15]; + num4 = 4; + if (this.selectedMenu == 3) + { + this.QuitGame(); + } + if (this.selectedMenu == 1) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 12; + } + if (this.selectedMenu == 2) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 11; + } + if (this.selectedMenu == 0) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1; + Main.LoadPlayers(); + } + } + else + { + if (Main.menuMode == 1) + { + Main.ServerSideCharacter = false; + Main.myPlayer = 0; + num = 180; + num3 = 40; + num4 = 10; + array4[7] += 10; + array4[8] += 10; + array4[9] += 10; + for (int l = 0; l < num4; l++) + { + array7[l] = 0.8f; + } + array9[7] = Lang.menu[16]; + array9[8] = Lang.menu[17]; + if (Main.numLoadPlayers >= Main.maxLoadPlayer) + { + array2[7] = true; + array9[7] = ""; + } + else + { + if (Main.numLoadPlayers == 0) + { + array2[8] = true; + array9[8] = ""; + } + } + array9[9] = Lang.menu[5]; + for (int m = 0; m < 7; m++) + { + if (m + Main.menuSkip < Main.numLoadPlayers) + { + array9[m] = Main.loadPlayer[m + Main.menuSkip].name; + array6[m] = Main.loadPlayer[m + Main.menuSkip].difficulty; + } + else + { + array9[m] = null; + } + } + bool[] array11 = new bool[num4]; + if (Main.numLoadPlayers > 7 + Main.menuSkip) + { + this.menuWide[6] = true; + array6[6] = 0; + array11[6] = true; + array9[6] = "▼"; + array7[6] = 0.6f; + array4[6] += 8; + array3[6] = true; + } + if (Main.menuSkip > 0) + { + this.menuWide[0] = true; + array6[0] = 0; + array11[0] = true; + array9[0] = "▲"; + array7[0] = 0.6f; + array4[0] += 8; + array3[0] = true; + } + array11[7] = true; + array11[8] = true; + array11[9] = true; + if (this.focusMenu >= 0 && this.focusMenu < Main.numLoadPlayers && !array11[this.focusMenu]) + { + num6 = this.focusMenu + Main.menuSkip; + Vector2 vector = Main.fontDeathText.MeasureString(array9[num6 - Main.menuSkip]); + num7 = (int)((double)(Main.screenWidth / 2) + (double)vector.X * 0.5 + 10.0); + num8 = num + num3 * this.focusMenu + 4; + } + if (this.selectedMenu == 0 && Main.menuSkip > 0) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip -= 5; + if (Main.menuSkip < 0) + { + Main.menuSkip = 0; + } + } + else + { + if (this.selectedMenu == 6 && Main.menuSkip < Main.numLoadPlayers - 7) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip += 5; + if (Main.menuSkip >= Main.numLoadPlayers - 7) + { + Main.menuSkip = Main.numLoadPlayers - 7; + } + } + else + { + if (this.selectedMenu == 9) + { + Main.autoJoin = false; + Main.autoPass = false; + Main.PlaySound(11, -1, -1, 1); + if (Main.menuMultiplayer) + { + Main.menuMode = 12; + Main.menuMultiplayer = false; + Main.menuServer = false; + } + else + { + Main.menuMode = 0; + } + } + else + { + if (this.selectedMenu == 7) + { + Main.loadPlayer[Main.numLoadPlayers] = new Player(); + Main.loadPlayer[Main.numLoadPlayers].inventory[0].SetDefaults("Copper Shortsword"); + Main.loadPlayer[Main.numLoadPlayers].inventory[0].Prefix(-1); + Main.loadPlayer[Main.numLoadPlayers].inventory[1].SetDefaults("Copper Pickaxe"); + Main.loadPlayer[Main.numLoadPlayers].inventory[1].Prefix(-1); + Main.loadPlayer[Main.numLoadPlayers].inventory[2].SetDefaults("Copper Axe"); + Main.loadPlayer[Main.numLoadPlayers].inventory[2].Prefix(-1); + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 2; + } + else + { + if (this.selectedMenu == 8) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 4; + } + else + { + if (this.selectedMenu >= 0) + { + if (Main.menuMultiplayer) + { + Main.ServerSideCharacter = false; + this.selectedPlayer = this.selectedMenu + Main.menuSkip; + Main.player[Main.myPlayer] = (Player)Main.loadPlayer[this.selectedPlayer].Clone(); + Main.playerPathName = Main.loadPlayerPath[this.selectedPlayer]; + Main.PlaySound(10, -1, -1, 1); + if (Main.autoJoin) + { + if (Netplay.SetIP(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartClient(); + } + else + { + if (Netplay.SetIP2(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartClient(); + } + } + Main.autoJoin = false; + } + else + { + if (Main.menuServer) + { + Main.LoadWorlds(); + Main.menuMode = 6; + } + else + { + Main.menuMode = 13; + Main.clrInput(); + } + } + } + else + { + Main.ServerSideCharacter = false; + Main.myPlayer = 0; + this.selectedPlayer = this.selectedMenu + Main.menuSkip; + Main.player[Main.myPlayer] = (Player)Main.loadPlayer[this.selectedPlayer].Clone(); + Main.playerPathName = Main.loadPlayerPath[this.selectedPlayer]; + Main.LoadWorlds(); + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 6; + } + } + } + } + } + } + } + } + else + { + if (Main.menuMode == 2) + { + if (this.selectedMenu == 0) + { + Main.menuMode = 17; + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.loadPlayer[Main.numLoadPlayers].hairColor; + } + if (this.selectedMenu == 1) + { + Main.menuMode = 18; + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.loadPlayer[Main.numLoadPlayers].eyeColor; + } + if (this.selectedMenu == 2) + { + Main.menuMode = 19; + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.loadPlayer[Main.numLoadPlayers].skinColor; + } + if (this.selectedMenu == 3) + { + Main.menuMode = 20; + Main.PlaySound(10, -1, -1, 1); + } + array9[0] = Lang.menu[18]; + array9[1] = Lang.menu[19]; + array9[2] = Lang.menu[20]; + array9[3] = Lang.menu[21]; + num = 220; + for (int n = 0; n < 9; n++) + { + if (n < 6) + { + array7[n] = 0.75f; + } + else + { + array7[n] = 0.9f; + } + } + num3 = 38; + array4[6] = 6; + array4[7] = 12; + array4[8] = 18; + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 176; + if (Main.loadPlayer[num6].male) + { + array9[4] = Lang.menu[22]; + } + else + { + array9[4] = Lang.menu[23]; + } + if (this.selectedMenu == 4) + { + if (Main.loadPlayer[num6].male) + { + Main.PlaySound(20, -1, -1, 1); + Main.loadPlayer[num6].male = false; + } + else + { + Main.PlaySound(1, -1, -1, 1); + Main.loadPlayer[num6].male = true; + } + } + if (Main.loadPlayer[num6].difficulty == 2) + { + array9[5] = Lang.menu[24]; + array6[5] = Main.loadPlayer[num6].difficulty; + } + else + { + if (Main.loadPlayer[num6].difficulty == 1) + { + array9[5] = Lang.menu[25]; + array6[5] = Main.loadPlayer[num6].difficulty; + } + else + { + array9[5] = Lang.menu[26]; + } + } + if (this.selectedMenu == 5) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 222; + } + if (this.selectedMenu == 7) + { + Main.PlaySound(12, -1, -1, 1); + Main.loadPlayer[num6].hair = Main.rand.Next(51); + Main.loadPlayer[num6].eyeColor = this.randColor(); + while ((int)(Main.loadPlayer[num6].eyeColor.R + Main.loadPlayer[num6].eyeColor.G + Main.loadPlayer[num6].eyeColor.B) > 300) + { + Main.loadPlayer[num6].eyeColor = this.randColor(); + } + Main.loadPlayer[num6].hairColor = this.randColor(); + Main.loadPlayer[num6].pantsColor = this.randColor(); + Main.loadPlayer[num6].shirtColor = this.randColor(); + Main.loadPlayer[num6].shoeColor = this.randColor(); + Main.loadPlayer[num6].skinColor = this.randColor(); + float num10 = (float)Main.rand.Next(60, 120) * 0.01f; + if (num10 > 1f) + { + num10 = 1f; + } + Main.loadPlayer[num6].skinColor.R = (byte)((float)Main.rand.Next(240, 255) * num10); + Main.loadPlayer[num6].skinColor.G = (byte)((float)Main.rand.Next(110, 140) * num10); + Main.loadPlayer[num6].skinColor.B = (byte)((float)Main.rand.Next(75, 110) * num10); + Main.loadPlayer[num6].underShirtColor = this.randColor(); + int num11 = Main.loadPlayer[num6].hair + 1; + if (num11 == 5 || num11 == 6 || num11 == 7 || num11 == 10 || num11 == 12 || num11 == 19 || num11 == 22 || num11 == 23 || num11 == 26 || num11 == 27 || num11 == 30 || num11 == 33) + { + Main.loadPlayer[num6].male = false; + } + else + { + Main.loadPlayer[num6].male = true; + } + } + array9[7] = Lang.menu[27]; + array9[6] = Lang.menu[28]; + array9[8] = Lang.menu[5]; + num4 = 9; + if (this.selectedMenu == 8) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 1; + } + else + { + if (this.selectedMenu == 6) + { + Main.PlaySound(10, -1, -1, 1); + Main.loadPlayer[Main.numLoadPlayers].name = ""; + Main.menuMode = 3; + Main.clrInput(); + } + } + } + else + { + if (Main.menuMode == 222) + { + if (this.focusMenu == 3) + { + array9[0] = Lang.menu[29]; + } + else + { + if (this.focusMenu == 2) + { + array9[0] = Lang.menu[30]; + } + else + { + if (this.focusMenu == 1) + { + array9[0] = Lang.menu[31]; + } + else + { + array9[0] = Lang.menu[32]; + } + } + } + num3 = 50; + array4[1] = 25; + array4[2] = 25; + array4[3] = 25; + array[0] = true; + array9[1] = Lang.menu[26]; + array9[2] = Lang.menu[25]; + array6[2] = 1; + array9[3] = Lang.menu[24]; + array6[3] = 2; + num4 = 4; + if (this.selectedMenu == 1) + { + Main.loadPlayer[Main.numLoadPlayers].difficulty = 0; + Main.menuMode = 2; + } + else + { + if (this.selectedMenu == 2) + { + Main.menuMode = 2; + Main.loadPlayer[Main.numLoadPlayers].difficulty = 1; + } + else + { + if (this.selectedMenu == 3) + { + Main.loadPlayer[Main.numLoadPlayers].difficulty = 2; + Main.menuMode = 2; + } + } + } + } + else + { + if (Main.menuMode == 20) + { + if (this.selectedMenu == 0) + { + Main.menuMode = 21; + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.loadPlayer[Main.numLoadPlayers].shirtColor; + } + if (this.selectedMenu == 1) + { + Main.menuMode = 22; + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.loadPlayer[Main.numLoadPlayers].underShirtColor; + } + if (this.selectedMenu == 2) + { + Main.menuMode = 23; + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.loadPlayer[Main.numLoadPlayers].pantsColor; + } + if (this.selectedMenu == 3) + { + this.selColor = Main.loadPlayer[Main.numLoadPlayers].shoeColor; + Main.menuMode = 24; + Main.PlaySound(10, -1, -1, 1); + } + array9[0] = Lang.menu[33]; + array9[1] = Lang.menu[34]; + array9[2] = Lang.menu[35]; + array9[3] = Lang.menu[36]; + num = 260; + num3 = 50; + array4[5] = 20; + array9[5] = Lang.menu[5]; + num4 = 6; + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + if (this.selectedMenu == 5) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 2; + } + } + else + { + if (Main.menuMode == 17) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 390; + num = 260; + num3 = 60; + Main.loadPlayer[num6].hairColor = this.selColor; + num4 = 3; + array9[0] = Lang.menu[37] + " " + (Main.loadPlayer[num6].hair + 1); + array9[1] = Lang.menu[38]; + array[1] = true; + array4[2] = 150; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 0) + { + Main.PlaySound(12, -1, -1, 1); + Main.loadPlayer[num6].hair++; + if (Main.loadPlayer[num6].hair >= 51) + { + Main.loadPlayer[num6].hair = 0; + } + } + else + { + if (this.selectedMenu2 == 0) + { + Main.PlaySound(12, -1, -1, 1); + Main.loadPlayer[num6].hair--; + if (Main.loadPlayer[num6].hair < 0) + { + Main.loadPlayer[num6].hair = 50; + } + } + } + if (this.selectedMenu == 2) + { + Main.menuMode = 2; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 18) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.loadPlayer[num6].eyeColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[39]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 2; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 19) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.loadPlayer[num6].skinColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[40]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 2; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 21) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.loadPlayer[num6].shirtColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[41]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 20; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 22) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.loadPlayer[num6].underShirtColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[42]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 20; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 23) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.loadPlayer[num6].pantsColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[43]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 20; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 24) + { + num6 = Main.numLoadPlayers; + num7 = Main.screenWidth / 2 - 16; + num8 = 210; + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.loadPlayer[num6].shoeColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[44]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 20; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 3) + { + string name = Main.loadPlayer[Main.numLoadPlayers].name; + Main.loadPlayer[Main.numLoadPlayers].name = Main.GetInputText(Main.loadPlayer[Main.numLoadPlayers].name); + if (Main.loadPlayer[Main.numLoadPlayers].name.Length > Player.nameLen) + { + Main.loadPlayer[Main.numLoadPlayers].name = Main.loadPlayer[Main.numLoadPlayers].name.Substring(0, Player.nameLen); + } + if (name != Main.loadPlayer[Main.numLoadPlayers].name) + { + Main.PlaySound(12, -1, -1, 1); + } + array9[0] = Lang.menu[45]; + array2[2] = true; + if (Main.loadPlayer[Main.numLoadPlayers].name != "") + { + if (Main.loadPlayer[Main.numLoadPlayers].name.Substring(0, 1) == " ") + { + Main.loadPlayer[Main.numLoadPlayers].name = ""; + } + for (int num12 = 0; num12 < Main.loadPlayer[Main.numLoadPlayers].name.Length; num12++) + { + if (Main.loadPlayer[Main.numLoadPlayers].name.Substring(num12, 1) != " ") + { + array2[2] = false; + } + } + } + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + array9[1] = Main.loadPlayer[Main.numLoadPlayers].name; + if (this.textBlinkerState == 1) + { + string[] array10; + (array10 = array9)[1] = array10[1] + "|"; + array5[1] = 1; + } + else + { + string[] array10; + (array10 = array9)[1] = array10[1] + " "; + } + array[0] = true; + array[1] = true; + array4[1] = -20; + array4[2] = 20; + array9[2] = Lang.menu[4]; + array9[3] = Lang.menu[5]; + num4 = 4; + if (this.selectedMenu == 3) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 2; + } + if (this.selectedMenu == 2 || (!array2[2] && Main.inputTextEnter)) + { + Main.loadPlayer[Main.numLoadPlayers].name.Trim(); + Main.loadPlayerPath[Main.numLoadPlayers] = Main.getPlayerPathName(Main.loadPlayer[Main.numLoadPlayers].name); + Player.SavePlayer(Main.loadPlayer[Main.numLoadPlayers], Main.loadPlayerPath[Main.numLoadPlayers]); + Main.LoadPlayers(); + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1; + } + } + else + { + if (Main.menuMode == 4) + { + num = 180; + num3 = 40; + num4 = 8; + array9[7] = Lang.menu[5]; + array4[7] += 40; + for (int num13 = 0; num13 < num4; num13++) + { + array7[num13] = 0.8f; + } + for (int num14 = 0; num14 < 7; num14++) + { + if (num14 + Main.menuSkip < Main.numLoadPlayers) + { + array9[num14] = Main.loadPlayer[num14 + Main.menuSkip].name; + array6[num14] = Main.loadPlayer[num14 + Main.menuSkip].difficulty; + } + else + { + array9[num14] = null; + } + } + bool[] array12 = new bool[num4]; + array12[7] = true; + if (Main.numLoadPlayers > 7 + Main.menuSkip) + { + this.menuWide[6] = true; + array6[6] = 0; + array12[6] = true; + array9[6] = "▼"; + array7[6] = 0.6f; + array4[6] += 8; + array3[6] = true; + } + if (Main.menuSkip > 0) + { + this.menuWide[0] = true; + array6[0] = 0; + array12[0] = true; + array9[0] = "▲"; + array7[0] = 0.6f; + array4[0] += 8; + array3[0] = true; + } + if (this.focusMenu >= 0 && this.focusMenu < Main.numLoadPlayers && !array12[this.focusMenu]) + { + num6 = this.focusMenu + Main.menuSkip; + Vector2 vector2 = Main.fontDeathText.MeasureString(array9[num6 - Main.menuSkip]); + num7 = (int)((double)(Main.screenWidth / 2) + (double)vector2.X * 0.5 + 10.0); + num8 = num + num3 * this.focusMenu + 4; + } + if (this.selectedMenu == 0 && Main.menuSkip > 0) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip -= 5; + if (Main.menuSkip < 0) + { + Main.menuSkip = 0; + } + } + else + { + if (this.selectedMenu == 6 && Main.menuSkip < Main.numLoadPlayers - 7) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip += 5; + if (Main.menuSkip >= Main.numLoadPlayers - 7) + { + Main.menuSkip = Main.numLoadPlayers - 7; + } + } + else + { + if (this.selectedMenu == 7) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 1; + } + else + { + if (this.selectedMenu >= 0) + { + this.selectedPlayer = this.selectedMenu + Main.menuSkip; + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 5; + } + } + } + } + } + else + { + if (Main.menuMode == 5) + { + array9[0] = Lang.menu[46] + " " + Main.loadPlayer[this.selectedPlayer].name + "?"; + array[0] = true; + array9[1] = Lang.menu[104]; + array9[2] = Lang.menu[105]; + num4 = 3; + if (this.selectedMenu == 1) + { + Main.ErasePlayer(this.selectedPlayer); + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1; + } + else + { + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 1; + } + } + } + else + { + if (Main.menuMode == 6) + { + num = 180; + num3 = 40; + num4 = 10; + array4[7] += 10; + array4[8] += 10; + array4[9] += 10; + for (int num15 = 0; num15 < num4; num15++) + { + array7[num15] = 0.8f; + } + array9[7] = Lang.menu[47]; + array9[8] = Lang.menu[17]; + if (Main.numLoadWorlds >= Main.maxLoadWorld) + { + array2[7] = true; + array9[7] = ""; + } + else + { + if (Main.numLoadWorlds == 0) + { + array2[8] = true; + array9[8] = ""; + } + } + array9[9] = Lang.menu[5]; + for (int num16 = 0; num16 < 7; num16++) + { + if (num16 + Main.menuSkip < Main.numLoadWorlds) + { + array9[num16] = Main.loadWorld[num16 + Main.menuSkip]; + } + else + { + array9[num16] = null; + } + } + if (Main.numLoadWorlds > 7 + Main.menuSkip) + { + this.menuWide[6] = true; + array9[6] = "more"; + array9[6] = "▼"; + array7[6] = 0.6f; + array4[6] += 8; + } + if (Main.menuSkip > 0) + { + array9[0] = "▲"; + array7[0] = 0.6f; + array4[0] += 8; + this.menuWide[0] = true; + } + if (this.selectedMenu == 0 && Main.menuSkip > 0) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip -= 5; + if (Main.menuSkip < 0) + { + Main.menuSkip = 0; + } + } + else + { + if (this.selectedMenu == 6 && Main.menuSkip < Main.numLoadWorlds - 7) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip += 5; + if (Main.menuSkip >= Main.numLoadWorlds - 7) + { + Main.menuSkip = Main.numLoadWorlds - 7; + } + } + else + { + if (this.selectedMenu == 9) + { + if (Main.menuMultiplayer) + { + Main.menuMode = 12; + } + else + { + Main.menuMode = 1; + } + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu == 7) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 16; + Main.newWorldName = Lang.gen[57] + " " + (Main.numLoadWorlds + 1); + } + else + { + if (this.selectedMenu == 8) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 8; + } + else + { + if (this.selectedMenu >= 0) + { + if (Main.menuMultiplayer) + { + Main.PlaySound(10, -1, -1, 1); + Main.worldPathName = Main.loadWorldPath[this.selectedMenu + Main.menuSkip]; + Main.menuMode = 30; + Main.GetInputText(""); + } + else + { + Main.PlaySound(10, -1, -1, 1); + Main.worldPathName = Main.loadWorldPath[this.selectedMenu + Main.menuSkip]; + WorldGen.playWorld(); + Main.menuMode = 10; + } + } + } + } + } + } + } + } + else + { + if (Main.menuMode == 7) + { + string text = Main.newWorldName; + Main.newWorldName = Main.GetInputText(Main.newWorldName); + if (Main.newWorldName.Length > 20) + { + Main.newWorldName = Main.newWorldName.Substring(0, 20); + } + if (text != Main.newWorldName) + { + Main.PlaySound(12, -1, -1, 1); + } + array9[0] = Lang.menu[48]; + array2[2] = true; + if (Main.newWorldName != "") + { + if (Main.newWorldName.Substring(0, 1) == " ") + { + Main.newWorldName = ""; + } + for (int num17 = 0; num17 < Main.newWorldName.Length; num17++) + { + if (Main.newWorldName != " ") + { + array2[2] = false; + } + } + } + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + array9[1] = Main.newWorldName; + if (this.textBlinkerState == 1) + { + string[] array10; + (array10 = array9)[1] = array10[1] + "|"; + array5[1] = 1; + } + else + { + string[] array10; + (array10 = array9)[1] = array10[1] + " "; + } + array[0] = true; + array[1] = true; + array4[1] = -20; + array4[2] = 20; + array9[2] = Lang.menu[4]; + array9[3] = Lang.menu[5]; + num4 = 4; + if (this.selectedMenu == 3) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 16; + } + if (this.selectedMenu == 2 || (!array2[2] && Main.inputTextEnter)) + { + Main.menuMode = 10; + Main.worldName = Main.newWorldName; + Main.worldPathName = Main.getWorldPathName(Main.worldName); + WorldGen.CreateNewWorld(); + } + } + else + { + if (Main.menuMode == 8) + { + num = 180; + num3 = 40; + num4 = 8; + array4[7] += 30; + for (int num18 = 0; num18 < num4; num18++) + { + array7[num18] = 0.8f; + } + array9[7] = Lang.menu[5]; + for (int num19 = 0; num19 < 7; num19++) + { + if (num19 < Main.numLoadWorlds) + { + array9[num19] = Main.loadWorld[num19 + Main.menuSkip]; + } + else + { + array9[num19] = null; + } + } + if (Main.numLoadWorlds > 7 + Main.menuSkip) + { + array9[6] = "more"; + array9[6] = "▼"; + array7[6] = 0.6f; + array4[6] += 8; + this.menuWide[6] = true; + } + if (Main.menuSkip > 0) + { + array9[0] = "▲"; + array7[0] = 0.6f; + array4[0] += 8; + this.menuWide[0] = true; + } + if (this.selectedMenu == 0 && Main.menuSkip > 0) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip -= 5; + if (Main.menuSkip < 0) + { + Main.menuSkip = 0; + } + } + else + { + if (this.selectedMenu == 6 && Main.menuSkip < Main.numLoadWorlds - 7) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuSkip += 5; + if (Main.menuSkip >= Main.numLoadPlayers - 7) + { + Main.menuSkip = Main.numLoadWorlds - 7; + } + } + else + { + if (this.selectedMenu == 7) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 6; + } + else + { + if (this.selectedMenu >= 0) + { + this.selectedWorld = this.selectedMenu + Main.menuSkip; + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 9; + } + } + } + } + } + else + { + if (Main.menuMode == 9) + { + array9[0] = Lang.menu[46] + " " + Main.loadWorld[this.selectedWorld] + "?"; + array[0] = true; + array9[1] = Lang.menu[104]; + array9[2] = Lang.menu[105]; + num4 = 3; + if (this.selectedMenu == 1) + { + Main.EraseWorld(this.selectedWorld); + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 6; + } + else + { + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 6; + } + } + } + else + { + if (Main.menuMode == 1111) + { + num = 210; + num3 = 46; + for (int num20 = 0; num20 < 7; num20++) + { + array7[num20] = 0.9f; + } + array4[7] = 10; + num4 = 8; + if (this.graphics.IsFullScreen) + { + array9[0] = Lang.menu[49]; + } + else + { + array9[0] = Lang.menu[50]; + } + this.bgScroll = (int)Math.Round((double)((1f - Main.caveParrallax) * 500f)); + array9[1] = Lang.menu[51]; + array9[2] = Lang.menu[52]; + if (Main.fixedTiming) + { + array9[3] = Lang.menu[53]; + } + else + { + array9[3] = Lang.menu[54]; + } + if (Lighting.lightMode == 0) + { + array9[4] = Lang.menu[55]; + } + else + { + if (Lighting.lightMode == 1) + { + array9[4] = Lang.menu[56]; + } + else + { + if (Lighting.lightMode == 2) + { + array9[4] = Lang.menu[57]; + } + else + { + if (Lighting.lightMode == 3) + { + array9[4] = Lang.menu[58]; + } + } + } + } + if (Main.qaStyle == 0) + { + array9[5] = Lang.menu[59]; + } + else + { + if (Main.qaStyle == 1) + { + array9[5] = Lang.menu[60]; + } + else + { + if (Main.qaStyle == 2) + { + array9[5] = Lang.menu[61]; + } + else + { + array9[5] = Lang.menu[62]; + } + } + } + if (Main.owBack) + { + array9[6] = Lang.menu[100]; + } + else + { + array9[6] = Lang.menu[101]; + } + if (this.selectedMenu == 6) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.owBack) + { + Main.owBack = false; + } + else + { + Main.owBack = true; + } + } + array9[7] = Lang.menu[5]; + if (this.selectedMenu == 7) + { + Main.PlaySound(11, -1, -1, 1); + this.SaveSettings(); + Main.menuMode = 11; + } + if (this.selectedMenu == 5) + { + Main.PlaySound(12, -1, -1, 1); + Main.qaStyle++; + if (Main.qaStyle > 3) + { + Main.qaStyle = 0; + } + } + if (this.selectedMenu == 4) + { + Main.PlaySound(12, -1, -1, 1); + Lighting.lightMode++; + if (Lighting.lightMode >= 4) + { + Lighting.lightMode = 0; + } + } + if (this.selectedMenu == 3) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.fixedTiming) + { + Main.fixedTiming = false; + } + else + { + Main.fixedTiming = true; + } + } + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 28; + } + if (this.selectedMenu == 1) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 111; + } + if (this.selectedMenu == 0) + { + this.graphics.ToggleFullScreen(); + } + } + else + { + if (Main.menuMode == 11) + { + num = 176; + num3 = 37; + array4[10] = 8; + num4 = 11; + for (int num21 = 0; num21 < 11; num21++) + { + array7[num21] = 0.73f; + } + array9[0] = Lang.menu[63]; + array9[1] = Lang.menu[64]; + array9[2] = Lang.menu[65]; + array9[3] = Lang.menu[66]; + array9[4] = "Map Controls"; + if (Main.autoSave) + { + array9[5] = Lang.menu[67]; + } + else + { + array9[5] = Lang.menu[68]; + } + if (Main.autoPause) + { + array9[6] = Lang.menu[69]; + } + else + { + array9[6] = Lang.menu[70]; + } + if (Main.showItemText) + { + array9[7] = Lang.menu[71]; + } + else + { + array9[7] = Lang.menu[72]; + } + if (Main.mapEnabled) + { + array9[8] = Lang.menu[112]; + } + else + { + array9[8] = Lang.menu[113]; + } + array9[10] = Lang.menu[5]; + array9[9] = Lang.menu[103]; + if (this.selectedMenu == 9) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1213; + } + if (this.selectedMenu == 10) + { + Main.PlaySound(11, -1, -1, 1); + this.SaveSettings(); + Main.menuMode = 0; + } + if (this.selectedMenu == 8) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.mapEnabled) + { + Main.mapEnabled = false; + } + else + { + Main.mapEnabled = true; + } + } + if (this.selectedMenu == 7) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.showItemText) + { + Main.showItemText = false; + } + else + { + Main.showItemText = true; + } + } + if (this.selectedMenu == 6) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.autoPause) + { + Main.autoPause = false; + } + else + { + Main.autoPause = true; + } + } + if (this.selectedMenu == 5) + { + Main.PlaySound(12, -1, -1, 1); + if (Main.autoSave) + { + Main.autoSave = false; + } + else + { + Main.autoSave = true; + } + } + if (this.selectedMenu == 4) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 272727; + } + if (this.selectedMenu == 3) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 27; + } + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 26; + } + if (this.selectedMenu == 1) + { + Main.PlaySound(10, -1, -1, 1); + this.selColor = Main.mouseColor; + Main.menuMode = 25; + } + if (this.selectedMenu == 0) + { + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1111; + } + } + else + { + if (Main.menuMode == 111) + { + num = 240; + num3 = 60; + num4 = 3; + array9[0] = Lang.menu[73]; + array9[1] = this.graphics.PreferredBackBufferWidth + "x" + this.graphics.PreferredBackBufferHeight; + array[0] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 1) + { + Main.PlaySound(12, -1, -1, 1); + int num22 = 0; + for (int num23 = 0; num23 < this.numDisplayModes; num23++) + { + if (this.displayWidth[num23] == this.graphics.PreferredBackBufferWidth && this.displayHeight[num23] == this.graphics.PreferredBackBufferHeight) + { + num22 = num23; + break; + } + } + num22++; + if (num22 >= this.numDisplayModes) + { + num22 = 0; + } + this.graphics.PreferredBackBufferWidth = this.displayWidth[num22]; + this.graphics.PreferredBackBufferHeight = this.displayHeight[num22]; + } + if (this.selectedMenu == 2) + { + if (this.graphics.IsFullScreen) + { + this.graphics.ApplyChanges(); + } + Main.menuMode = 1111; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 25) + { + flag = true; + num9 = 370; + num = 240; + num3 = 60; + Main.mouseColor = this.selColor; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[64]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 11; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 26) + { + flag2 = true; + num = 240; + num3 = 60; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[65]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 11; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 28) + { + Main.caveParrallax = 1f - (float)this.bgScroll / 500f; + flag3 = true; + num = 240; + num3 = 60; + num4 = 3; + array9[0] = ""; + array9[1] = Lang.menu[52]; + array[1] = true; + array4[2] = 170; + array4[1] = 10; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 2) + { + Main.menuMode = 1111; + Main.PlaySound(11, -1, -1, 1); + } + } + else + { + if (Main.menuMode == 272727) + { + num = 200; + num3 = 30; + num4 = 14; + string[] array13 = new string[12]; + array13[0] = Main.cMapStyle; + array13[1] = Main.cMapFull; + array13[2] = Main.cMapZoomIn; + array13[3] = Main.cMapZoomOut; + array13[4] = Main.cMapAlphaUp; + array13[5] = Main.cMapAlphaDown; + if (this.setKey >= 0) + { + array13[this.setKey] = "_"; + } + array9[0] = Lang.menu[106] + array13[0]; + array9[1] = Lang.menu[107] + array13[1]; + array9[2] = Lang.menu[108] + array13[2]; + array9[3] = Lang.menu[109] + array13[3]; + array9[4] = Lang.menu[110] + array13[4]; + array9[5] = Lang.menu[111] + array13[5]; + for (int num24 = 0; num24 < 6; num24++) + { + array8[num24] = true; + array7[num24] = 0.55f; + array5[num24] = -140; + } + array7[6] = 0.8f; + array7[6] = 0.8f; + array4[6] = 6; + array9[6] = Lang.menu[86]; + array4[7] = 16; + array9[7] = Lang.menu[5]; + if (this.selectedMenu == 7) + { + Main.menuMode = 11; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu == 6) + { + Main.cMapStyle = "Tab"; + Main.cMapFull = "M"; + Main.cMapZoomIn = "Add"; + Main.cMapZoomOut = "Subtract"; + Main.cMapAlphaUp = "PageUp"; + Main.cMapAlphaDown = "PageDown"; + this.setKey = -1; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu >= 0) + { + this.setKey = this.selectedMenu; + } + } + } + if (this.setKey >= 0) + { + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + if (pressedKeys.Length > 0) + { + string text2 = string.Concat(pressedKeys[0]); + if (text2 != "None") + { + if (this.setKey == 0) + { + Main.cMapStyle = text2; + } + if (this.setKey == 1) + { + Main.cMapFull = text2; + } + if (this.setKey == 2) + { + Main.cMapZoomIn = text2; + } + if (this.setKey == 3) + { + Main.cMapZoomOut = text2; + } + if (this.setKey == 4) + { + Main.cMapAlphaUp = text2; + } + if (this.setKey == 5) + { + Main.cMapAlphaDown = text2; + } + this.setKey = -1; + } + } + } + } + else + { + if (Main.menuMode == 27) + { + num = 176; + num3 = 28; + num4 = 14; + string[] array14 = new string[] + { + Main.cUp, + Main.cDown, + Main.cLeft, + Main.cRight, + Main.cJump, + Main.cThrowItem, + Main.cInv, + Main.cHeal, + Main.cMana, + Main.cBuff, + Main.cHook, + Main.cTorch + }; + if (this.setKey >= 0) + { + array14[this.setKey] = "_"; + } + array9[0] = Lang.menu[74] + array14[0]; + array9[1] = Lang.menu[75] + array14[1]; + array9[2] = Lang.menu[76] + array14[2]; + array9[3] = Lang.menu[77] + array14[3]; + array9[4] = Lang.menu[78] + array14[4]; + array9[5] = Lang.menu[79] + array14[5]; + array9[6] = Lang.menu[80] + array14[6]; + array9[7] = Lang.menu[81] + array14[7]; + array9[8] = Lang.menu[82] + array14[8]; + array9[9] = Lang.menu[83] + array14[9]; + array9[10] = Lang.menu[84] + array14[10]; + array9[11] = Lang.menu[85] + array14[11]; + for (int num25 = 0; num25 < 12; num25++) + { + array8[num25] = true; + array7[num25] = 0.55f; + array5[num25] = -80; + } + array7[12] = 0.8f; + array7[13] = 0.8f; + array4[12] = 6; + array9[12] = Lang.menu[86]; + array4[13] = 16; + array9[13] = Lang.menu[5]; + if (this.selectedMenu == 13) + { + Main.menuMode = 11; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu == 12) + { + Main.cUp = "W"; + Main.cDown = "S"; + Main.cLeft = "A"; + Main.cRight = "D"; + Main.cJump = "Space"; + Main.cThrowItem = "T"; + Main.cInv = "Escape"; + Main.cHeal = "H"; + Main.cMana = "M"; + Main.cBuff = "B"; + Main.cHook = "E"; + Main.cTorch = "LeftShift"; + this.setKey = -1; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu >= 0) + { + this.setKey = this.selectedMenu; + } + } + } + if (this.setKey >= 0) + { + Keys[] pressedKeys2 = Main.keyState.GetPressedKeys(); + if (pressedKeys2.Length > 0) + { + string text3 = string.Concat(pressedKeys2[0]); + if (text3 != "None") + { + if (this.setKey == 0) + { + Main.cUp = text3; + } + if (this.setKey == 1) + { + Main.cDown = text3; + } + if (this.setKey == 2) + { + Main.cLeft = text3; + } + if (this.setKey == 3) + { + Main.cRight = text3; + } + if (this.setKey == 4) + { + Main.cJump = text3; + } + if (this.setKey == 5) + { + Main.cThrowItem = text3; + } + if (this.setKey == 6) + { + Main.cInv = text3; + } + if (this.setKey == 7) + { + Main.cHeal = text3; + } + if (this.setKey == 8) + { + Main.cMana = text3; + } + if (this.setKey == 9) + { + Main.cBuff = text3; + } + if (this.setKey == 10) + { + Main.cHook = text3; + } + if (this.setKey == 11) + { + Main.cTorch = text3; + } + this.setKey = -1; + } + } + } + } + else + { + if (Main.menuMode == 12) + { + Main.menuServer = false; + array9[0] = Lang.menu[87]; + array9[1] = Lang.menu[88]; + array9[2] = Lang.menu[5]; + if (this.selectedMenu == 0) + { + Main.LoadPlayers(); + Main.menuMultiplayer = true; + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1; + } + else + { + if (this.selectedMenu == 1) + { + Main.LoadPlayers(); + Main.PlaySound(10, -1, -1, 1); + Main.menuMode = 1; + Main.menuMultiplayer = true; + Main.menuServer = true; + } + } + if (this.selectedMenu == 2) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 0; + } + num4 = 3; + } + else + { + if (Main.menuMode == 13) + { + string text4 = Main.getIP; + Main.getIP = Main.GetInputText(Main.getIP); + if (text4 != Main.getIP) + { + Main.PlaySound(12, -1, -1, 1); + } + array9[0] = Lang.menu[89]; + array2[9] = true; + if (Main.getIP != "") + { + if (Main.getIP.Substring(0, 1) == " ") + { + Main.getIP = ""; + } + for (int num26 = 0; num26 < Main.getIP.Length; num26++) + { + if (Main.getIP != " ") + { + array2[9] = false; + } + } + } + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + array9[1] = Main.getIP; + if (this.textBlinkerState == 1) + { + string[] array10; + (array10 = array9)[1] = array10[1] + "|"; + array5[1] = 1; + } + else + { + string[] array10; + (array10 = array9)[1] = array10[1] + " "; + } + array[0] = true; + array[1] = true; + array4[9] = 44; + array4[10] = 64; + array9[9] = Lang.menu[4]; + array9[10] = Lang.menu[5]; + num4 = 11; + num = 180; + num3 = 30; + array4[1] = 19; + for (int num27 = 2; num27 < 9; num27++) + { + int num28 = num27 - 2; + if (Main.recentWorld[num28] != null && Main.recentWorld[num28] != "") + { + array9[num27] = string.Concat(new object[] + { + Main.recentWorld[num28], + " (", + Main.recentIP[num28], + ":", + Main.recentPort[num28], + ")" + }); + } + else + { + array9[num27] = ""; + array[num27] = true; + } + array7[num27] = 0.6f; + array4[num27] = 40; + } + if (this.selectedMenu >= 2 && this.selectedMenu < 9) + { + Main.autoPass = false; + int num29 = this.selectedMenu - 2; + Netplay.serverPort = Main.recentPort[num29]; + Main.getIP = Main.recentIP[num29]; + if (Netplay.SetIP(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartClient(); + } + else + { + if (Netplay.SetIP2(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartClient(); + } + } + } + if (this.selectedMenu == 10) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 1; + } + if (this.selectedMenu == 9 || (!array2[2] && Main.inputTextEnter)) + { + Main.PlaySound(12, -1, -1, 1); + Main.menuMode = 131; + Main.clrInput(); + } + } + else + { + if (Main.menuMode == 131) + { + int num30 = 7777; + string text5 = Main.getPort; + Main.getPort = Main.GetInputText(Main.getPort); + if (text5 != Main.getPort) + { + Main.PlaySound(12, -1, -1, 1); + } + array9[0] = Lang.menu[90]; + array2[2] = true; + if (Main.getPort != "") + { + bool flag5 = false; + try + { + num30 = Convert.ToInt32(Main.getPort); + if (num30 > 0 && num30 <= 65535) + { + flag5 = true; + } + } + catch + { + } + if (flag5) + { + array2[2] = false; + } + } + this.textBlinkerCount++; + if (this.textBlinkerCount >= 20) + { + if (this.textBlinkerState == 0) + { + this.textBlinkerState = 1; + } + else + { + this.textBlinkerState = 0; + } + this.textBlinkerCount = 0; + } + array9[1] = Main.getPort; + if (this.textBlinkerState == 1) + { + string[] array10; + (array10 = array9)[1] = array10[1] + "|"; + array5[1] = 1; + } + else + { + string[] array10; + (array10 = array9)[1] = array10[1] + " "; + } + array[0] = true; + array[1] = true; + array4[1] = -20; + array4[2] = 20; + array9[2] = Lang.menu[4]; + array9[3] = Lang.menu[5]; + num4 = 4; + if (this.selectedMenu == 3) + { + Main.PlaySound(11, -1, -1, 1); + Main.menuMode = 1; + } + if (this.selectedMenu == 2 || (!array2[2] && Main.inputTextEnter)) + { + Netplay.serverPort = num30; + Main.autoPass = false; + if (Netplay.SetIP(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartClient(); + } + else + { + if (Netplay.SetIP2(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartClient(); + } + } + } + } + else + { + if (Main.menuMode == 16) + { + num = 200; + num3 = 60; + array4[1] = 30; + array4[2] = 30; + array4[3] = 30; + array4[4] = 70; + array9[0] = Lang.menu[91]; + array[0] = true; + array9[1] = Lang.menu[92]; + array9[2] = Lang.menu[93]; + array9[3] = Lang.menu[94]; + array9[4] = Lang.menu[5]; + num4 = 5; + if (this.selectedMenu == 4) + { + Main.menuMode = 6; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (this.selectedMenu > 0) + { + if (this.selectedMenu == 1) + { + Main.maxTilesX = 4200; + Main.maxTilesY = 1200; + } + else + { + if (this.selectedMenu == 2) + { + Main.maxTilesX = 6400; + Main.maxTilesY = 1800; + } + else + { + Main.maxTilesX = 8400; + Main.maxTilesY = 2400; + } + } + Main.clrInput(); + Main.menuMode = 7; + Main.PlaySound(10, -1, -1, 1); + WorldGen.setWorldSize(); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + IL_443A: + if (Main.menuMode != num5) + { + this.blockMouse = true; + Main.menuSkip = 0; + num4 = 0; + for (int num31 = 0; num31 < Main.maxMenuItems; num31++) + { + this.menuItemScale[num31] = 0.8f; + } + } + if (!Main.mouseLeft) + { + this.blockMouse = true; + } + int num32 = this.focusMenu; + this.selectedMenu = -1; + this.selectedMenu2 = -1; + this.focusMenu = -1; + for (int num33 = 0; num33 < num4; num33++) + { + if (array9[num33] != null) + { + if (!flag) + { + this.grabColorSlider = 0; + this.hBar = -1f; + this.sBar = -1f; + this.lBar = -1f; + } + if (flag) + { + if (!Main.mouseLeft) + { + this.grabColorSlider = 0; + this.blockMouse = false; + } + int num34 = num9; + int num35 = Main.screenWidth / 2 - this.hueTexture.Width / 2; + int num36 = 167; + Vector3 vector3 = Main.rgbToHsl(this.selColor); + float num37 = vector3.X; + float num38 = vector3.Y; + float num39 = vector3.Z; + if (this.hBar == -1f || this.sBar == -1f || this.lBar == -1f) + { + this.hBar = num37; + this.sBar = num38; + this.lBar = num39; + } + else + { + num37 = this.hBar; + num38 = this.sBar; + num39 = this.lBar; + } + this.spriteBatch.Draw(this.hueTexture, new Vector2((float)num35, (float)num34), Color.White); + this.spriteBatch.Draw(this.colorSliderTexture, new Vector2((float)num35 + (float)(this.hueTexture.Width - 2) * this.hBar - (float)(this.colorSliderTexture.Width / 2), (float)(num34 - this.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Color.White); + if (((Main.mouseX > num35 - 4 && Main.mouseX < num35 + this.hueTexture.Width + 4 && Main.mouseY > num34 - 4 && Main.mouseY < num34 + this.hueTexture.Height + 4) || this.grabColorSlider == 1) && Main.mouseLeft && !this.blockMouse) + { + this.grabColorSlider = 1; + num37 = (float)(Main.mouseX - num35); + num37 /= (float)this.hueTexture.Width; + if (num37 < 0f) + { + num37 = 0f; + } + if (num37 > 1f) + { + num37 = 1f; + } + this.hBar = num37; + } + num34 += 26; + this.spriteBatch.Draw(this.colorBarTexture, new Vector2((float)num35, (float)num34), Color.White); + for (int num40 = 0; num40 <= num36; num40++) + { + float saturation = (float)num40 / (float)num36; + Color color4 = Main.hslToRgb(num37, saturation, num39); + this.spriteBatch.Draw(this.colorBlipTexture, new Vector2((float)(num35 + num40 + 5), (float)(num34 + 4)), color4); + } + this.spriteBatch.Draw(this.colorSliderTexture, new Vector2((float)num35 + (float)(this.hueTexture.Width - 2) * this.sBar - (float)(this.colorSliderTexture.Width / 2), (float)(num34 - this.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Color.White); + if (((Main.mouseX > num35 - 4 && Main.mouseX < num35 + this.hueTexture.Width + 4 && Main.mouseY > num34 - 4 && Main.mouseY < num34 + this.hueTexture.Height + 4) || this.grabColorSlider == 2) && Main.mouseLeft && !this.blockMouse) + { + this.grabColorSlider = 2; + num38 = (float)(Main.mouseX - num35); + num38 /= (float)this.hueTexture.Width; + if (num38 < 0f) + { + num38 = 0f; + } + if (num38 > 1f) + { + num38 = 1f; + } + this.sBar = num38; + } + num34 += 26; + this.spriteBatch.Draw(this.colorBarTexture, new Vector2((float)num35, (float)num34), Color.White); + float num41 = 0.15f; + for (int num42 = 0; num42 <= num36; num42++) + { + float luminosity = (float)num42 / (float)num36; + Color color5 = Main.hslToRgb(num37, num38, luminosity); + this.spriteBatch.Draw(this.colorBlipTexture, new Vector2((float)(num35 + num42 + 5), (float)(num34 + 4)), color5); + } + this.spriteBatch.Draw(this.colorSliderTexture, new Vector2((float)num35 + (float)(this.hueTexture.Width - 2) * ((this.lBar - num41) / (1f - num41)) - (float)(this.colorSliderTexture.Width / 2), (float)(num34 - this.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Color.White); + if (((Main.mouseX > num35 - 4 && Main.mouseX < num35 + this.hueTexture.Width + 4 && Main.mouseY > num34 - 4 && Main.mouseY < num34 + this.hueTexture.Height + 4) || this.grabColorSlider == 3) && Main.mouseLeft && !this.blockMouse) + { + this.grabColorSlider = 3; + num39 = (float)(Main.mouseX - num35); + num39 /= (float)this.hueTexture.Width; + if (num39 < 0f) + { + num39 = 0f; + } + if (num39 > 1f) + { + num39 = 1f; + } + num39 = num39 * (1f - num41) + num41; + this.lBar = num39; + } + this.selColor = Main.hslToRgb(this.hBar, this.sBar, this.lBar); + } + else + { + if (flag) + { + string text6 = ""; + for (int num43 = 0; num43 < 6; num43++) + { + int num44 = num9; + int num45 = 370 + Main.screenWidth / 2 - 400; + if (num43 == 0) + { + text6 = Lang.menu[95]; + } + if (num43 == 1) + { + text6 = Lang.menu[96]; + num44 += 30; + } + if (num43 == 2) + { + text6 = Lang.menu[97]; + num44 += 60; + } + if (num43 == 3) + { + text6 = string.Concat(this.selColor.R); + num45 += 90; + } + if (num43 == 4) + { + text6 = string.Concat(this.selColor.G); + num45 += 90; + num44 += 30; + } + if (num43 == 5) + { + text6 = string.Concat(this.selColor.B); + num45 += 90; + num44 += 60; + } + for (int num46 = 0; num46 < 5; num46++) + { + Color color6 = Color.Black; + if (num46 == 4) + { + color6 = color; + color6.R = (byte)((255 + color6.R) / 2); + color6.G = (byte)((255 + color6.R) / 2); + color6.B = (byte)((255 + color6.R) / 2); + } + int num47 = 255; + int num48 = (int)color6.R - (255 - num47); + if (num48 < 0) + { + num48 = 0; + } + color6 = new Color((int)((byte)num48), (int)((byte)num48), (int)((byte)num48), (int)((byte)num47)); + int num49 = 0; + int num50 = 0; + if (num46 == 0) + { + num49 = -2; + } + if (num46 == 1) + { + num49 = 2; + } + if (num46 == 2) + { + num50 = -2; + } + if (num46 == 3) + { + num50 = 2; + } + this.spriteBatch.DrawString(Main.fontDeathText, text6, new Vector2((float)(num45 + num49), (float)(num44 + num50)), color6, 0f, default(Vector2), 0.5f, SpriteEffects.None, 0f); + } + } + bool flag6 = false; + for (int num51 = 0; num51 < 2; num51++) + { + for (int num52 = 0; num52 < 3; num52++) + { + int num53 = num9 + num52 * 30 - 12; + int num54 = 360 + Main.screenWidth / 2 - 400; + float scale = 0.9f; + if (num51 == 0) + { + num54 -= 70; + num53 += 2; + } + else + { + num54 -= 40; + } + text6 = "-"; + if (num51 == 1) + { + text6 = "+"; + } + Vector2 vector4 = new Vector2(24f, 24f); + int num55 = 142; + if (Main.mouseX > num54 && (float)Main.mouseX < (float)num54 + vector4.X && Main.mouseY > num53 + 13 && (float)Main.mouseY < (float)(num53 + 13) + vector4.Y) + { + if (this.focusColor != (num51 + 1) * (num52 + 10)) + { + Main.PlaySound(12, -1, -1, 1); + } + this.focusColor = (num51 + 1) * (num52 + 10); + flag6 = true; + num55 = 255; + if (Main.mouseLeft) + { + if (this.colorDelay <= 1) + { + if (this.colorDelay == 0) + { + this.colorDelay = 40; + } + else + { + this.colorDelay = 3; + } + int num56 = num51; + if (num51 == 0) + { + num56 = -1; + if (this.selColor.R + this.selColor.G + this.selColor.B <= 150) + { + num56 = 0; + } + } + if (num52 == 0 && (int)this.selColor.R + num56 >= 0 && (int)this.selColor.R + num56 <= 255) + { + this.selColor.R = (byte)((int)this.selColor.R + num56); + } + if (num52 == 1 && (int)this.selColor.G + num56 >= 0 && (int)this.selColor.G + num56 <= 255) + { + this.selColor.G = (byte)((int)this.selColor.G + num56); + } + if (num52 == 2 && (int)this.selColor.B + num56 >= 0 && (int)this.selColor.B + num56 <= 255) + { + this.selColor.B = (byte)((int)this.selColor.B + num56); + } + } + this.colorDelay--; + } + else + { + this.colorDelay = 0; + } + } + for (int num57 = 0; num57 < 5; num57++) + { + Color color7 = Color.Black; + if (num57 == 4) + { + color7 = color; + color7.R = (byte)((255 + color7.R) / 2); + color7.G = (byte)((255 + color7.R) / 2); + color7.B = (byte)((255 + color7.R) / 2); + } + int num58 = (int)color7.R - (255 - num55); + if (num58 < 0) + { + num58 = 0; + } + color7 = new Color((int)((byte)num58), (int)((byte)num58), (int)((byte)num58), (int)((byte)num55)); + int num59 = 0; + int num60 = 0; + if (num57 == 0) + { + num59 = -2; + } + if (num57 == 1) + { + num59 = 2; + } + if (num57 == 2) + { + num60 = -2; + } + if (num57 == 3) + { + num60 = 2; + } + this.spriteBatch.DrawString(Main.fontDeathText, text6, new Vector2((float)(num54 + num59), (float)(num53 + num60)), color7, 0f, default(Vector2), scale, SpriteEffects.None, 0f); + } + } + } + if (!flag6) + { + this.focusColor = 0; + this.colorDelay = 0; + } + } + } + if (flag3) + { + int num61 = 400; + string text7 = ""; + for (int num62 = 0; num62 < 4; num62++) + { + int num63 = num61; + int num64 = 370 + Main.screenWidth / 2 - 400; + if (num62 == 0) + { + text7 = Lang.menu[52] + ": " + this.bgScroll; + } + for (int num65 = 0; num65 < 5; num65++) + { + Color color8 = Color.Black; + if (num65 == 4) + { + color8 = color; + color8.R = (byte)((255 + color8.R) / 2); + color8.G = (byte)((255 + color8.R) / 2); + color8.B = (byte)((255 + color8.R) / 2); + } + int num66 = 255; + int num67 = (int)color8.R - (255 - num66); + if (num67 < 0) + { + num67 = 0; + } + color8 = new Color((int)((byte)num67), (int)((byte)num67), (int)((byte)num67), (int)((byte)num66)); + int num68 = 0; + int num69 = 0; + if (num65 == 0) + { + num68 = -2; + } + if (num65 == 1) + { + num68 = 2; + } + if (num65 == 2) + { + num69 = -2; + } + if (num65 == 3) + { + num69 = 2; + } + this.spriteBatch.DrawString(Main.fontDeathText, text7, new Vector2((float)(num64 + num68), (float)(num63 + num69)), color8, 0f, default(Vector2), 0.5f, SpriteEffects.None, 0f); + } + } + bool flag7 = false; + for (int num70 = 0; num70 < 2; num70++) + { + for (int num71 = 0; num71 < 1; num71++) + { + int num72 = num61 + num71 * 30 - 12; + int num73 = 360 + Main.screenWidth / 2 - 400; + float scale2 = 0.9f; + if (num70 == 0) + { + num73 -= 70; + num72 += 2; + } + else + { + num73 -= 40; + } + text7 = "-"; + if (num70 == 1) + { + text7 = "+"; + } + Vector2 vector5 = new Vector2(24f, 24f); + int num74 = 142; + if (Main.mouseX > num73 && (float)Main.mouseX < (float)num73 + vector5.X && Main.mouseY > num72 + 13 && (float)Main.mouseY < (float)(num72 + 13) + vector5.Y) + { + if (this.focusColor != (num70 + 1) * (num71 + 10)) + { + Main.PlaySound(12, -1, -1, 1); + } + this.focusColor = (num70 + 1) * (num71 + 10); + flag7 = true; + num74 = 255; + if (Main.mouseLeft) + { + if (this.colorDelay <= 1) + { + if (this.colorDelay == 0) + { + this.colorDelay = 40; + } + else + { + this.colorDelay = 3; + } + int num75 = (num70 != null) ? num70 : -1; + if (num71 == 0) + { + this.bgScroll += num75; + if (this.bgScroll > 100) + { + this.bgScroll = 100; + } + if (this.bgScroll < 0) + { + this.bgScroll = 0; + } + } + } + this.colorDelay--; + } + else + { + this.colorDelay = 0; + } + } + for (int num76 = 0; num76 < 5; num76++) + { + Color color9 = Color.Black; + if (num76 == 4) + { + color9 = color; + color9.R = (byte)((255 + color9.R) / 2); + color9.G = (byte)((255 + color9.R) / 2); + color9.B = (byte)((255 + color9.R) / 2); + } + int num77 = (int)color9.R - (255 - num74); + if (num77 < 0) + { + num77 = 0; + } + color9 = new Color((int)((byte)num77), (int)((byte)num77), (int)((byte)num77), (int)((byte)num74)); + int num78 = 0; + int num79 = 0; + if (num76 == 0) + { + num78 = -2; + } + if (num76 == 1) + { + num78 = 2; + } + if (num76 == 2) + { + num79 = -2; + } + if (num76 == 3) + { + num79 = 2; + } + this.spriteBatch.DrawString(Main.fontDeathText, text7, new Vector2((float)(num73 + num78), (float)(num72 + num79)), color9, 0f, default(Vector2), scale2, SpriteEffects.None, 0f); + } + } + } + if (!flag7) + { + this.focusColor = 0; + this.colorDelay = 0; + } + } + if (flag2) + { + int num80 = 400; + string text8 = ""; + for (int num81 = 0; num81 < 4; num81++) + { + int num82 = num80; + int num83 = 370 + Main.screenWidth / 2 - 400; + if (num81 == 0) + { + text8 = Lang.menu[98]; + } + if (num81 == 1) + { + text8 = Lang.menu[99]; + num82 += 30; + } + if (num81 == 2) + { + text8 = Math.Round((double)(Main.soundVolume * 100f)) + "%"; + num83 += 90; + } + if (num81 == 3) + { + text8 = Math.Round((double)(Main.musicVolume * 100f)) + "%"; + num83 += 90; + num82 += 30; + } + for (int num84 = 0; num84 < 5; num84++) + { + Color color10 = Color.Black; + if (num84 == 4) + { + color10 = color; + color10.R = (byte)((255 + color10.R) / 2); + color10.G = (byte)((255 + color10.R) / 2); + color10.B = (byte)((255 + color10.R) / 2); + } + int num85 = 255; + int num86 = (int)color10.R - (255 - num85); + if (num86 < 0) + { + num86 = 0; + } + color10 = new Color((int)((byte)num86), (int)((byte)num86), (int)((byte)num86), (int)((byte)num85)); + int num87 = 0; + int num88 = 0; + if (num84 == 0) + { + num87 = -2; + } + if (num84 == 1) + { + num87 = 2; + } + if (num84 == 2) + { + num88 = -2; + } + if (num84 == 3) + { + num88 = 2; + } + this.spriteBatch.DrawString(Main.fontDeathText, text8, new Vector2((float)(num83 + num87), (float)(num82 + num88)), color10, 0f, default(Vector2), 0.5f, SpriteEffects.None, 0f); + } + } + bool flag8 = false; + for (int num89 = 0; num89 < 2; num89++) + { + for (int num90 = 0; num90 < 2; num90++) + { + int num91 = num80 + num90 * 30 - 12; + int num92 = 360 + Main.screenWidth / 2 - 400; + float scale3 = 0.9f; + if (num89 == 0) + { + num92 -= 70; + num91 += 2; + } + else + { + num92 -= 40; + } + text8 = "-"; + if (num89 == 1) + { + text8 = "+"; + } + Vector2 vector6 = new Vector2(24f, 24f); + int num93 = 142; + if (Main.mouseX > num92 && (float)Main.mouseX < (float)num92 + vector6.X && Main.mouseY > num91 + 13 && (float)Main.mouseY < (float)(num91 + 13) + vector6.Y) + { + if (this.focusColor != (num89 + 1) * (num90 + 10)) + { + Main.PlaySound(12, -1, -1, 1); + } + this.focusColor = (num89 + 1) * (num90 + 10); + flag8 = true; + num93 = 255; + if (Main.mouseLeft) + { + if (this.colorDelay <= 1) + { + if (this.colorDelay == 0) + { + this.colorDelay = 40; + } + else + { + this.colorDelay = 3; + } + int num94 = (num89 != null) ? num89 : -1; + if (num90 == 0) + { + Main.soundVolume += (float)num94 * 0.01f; + if (Main.soundVolume > 1f) + { + Main.soundVolume = 1f; + } + if (Main.soundVolume < 0f) + { + Main.soundVolume = 0f; + } + } + if (num90 == 1) + { + Main.musicVolume += (float)num94 * 0.01f; + if (Main.musicVolume > 1f) + { + Main.musicVolume = 1f; + } + if (Main.musicVolume < 0f) + { + Main.musicVolume = 0f; + } + } + } + this.colorDelay--; + } + else + { + this.colorDelay = 0; + } + } + for (int num95 = 0; num95 < 5; num95++) + { + Color color11 = Color.Black; + if (num95 == 4) + { + color11 = color; + color11.R = (byte)((255 + color11.R) / 2); + color11.G = (byte)((255 + color11.R) / 2); + color11.B = (byte)((255 + color11.R) / 2); + } + int num96 = (int)color11.R - (255 - num93); + if (num96 < 0) + { + num96 = 0; + } + color11 = new Color((int)((byte)num96), (int)((byte)num96), (int)((byte)num96), (int)((byte)num93)); + int num97 = 0; + int num98 = 0; + if (num95 == 0) + { + num97 = -2; + } + if (num95 == 1) + { + num97 = 2; + } + if (num95 == 2) + { + num98 = -2; + } + if (num95 == 3) + { + num98 = 2; + } + this.spriteBatch.DrawString(Main.fontDeathText, text8, new Vector2((float)(num92 + num97), (float)(num91 + num98)), color11, 0f, default(Vector2), scale3, SpriteEffects.None, 0f); + } + } + } + if (!flag8) + { + this.focusColor = 0; + this.colorDelay = 0; + } + } + for (int num99 = 0; num99 < 5; num99++) + { + Color color12 = Color.Black; + if (num99 == 4) + { + color12 = color; + if (array6[num33] == 2) + { + color12 = Main.hcColor; + } + else + { + if (array6[num33] == 1) + { + color12 = Main.mcColor; + } + } + color12.R = (byte)((255 + color12.R) / 2); + color12.G = (byte)((255 + color12.G) / 2); + color12.B = (byte)((255 + color12.B) / 2); + } + int num100 = (int)(255f * (this.menuItemScale[num33] * 2f - 1f)); + if (array[num33]) + { + num100 = 255; + } + int num101 = (int)color12.R - (255 - num100); + if (num101 < 0) + { + num101 = 0; + } + int num102 = (int)color12.G - (255 - num100); + if (num102 < 0) + { + num102 = 0; + } + int num103 = (int)color12.B - (255 - num100); + if (num103 < 0) + { + num103 = 0; + } + color12 = new Color((int)((byte)num101), (int)((byte)num102), (int)((byte)num103), (int)((byte)num100)); + if (array3[num33]) + { + if (num99 == 4) + { + color12.R = (byte)((int)(color12.R * Main.mouseTextColor) / 300); + color12.G = (byte)((int)(color12.G * Main.mouseTextColor) / 300); + color12.B = (byte)((int)(color12.B * Main.mouseTextColor) / 300); + color12.A = (byte)((int)(color12.A * Main.mouseTextColor) / 300); + } + else + { + color12.A -= (byte)(Main.mouseTextColor / 5); + } + } + int num104 = 0; + int num105 = 0; + if (num99 == 0) + { + num104 = -2; + } + if (num99 == 1) + { + num104 = 2; + } + if (num99 == 2) + { + num105 = -2; + } + if (num99 == 3) + { + num105 = 2; + } + Vector2 origin = Main.fontDeathText.MeasureString(array9[num33]); + origin.X *= 0.5f; + origin.Y *= 0.5f; + float num106 = this.menuItemScale[num33]; + if (Main.menuMode == 15 && num33 == 0) + { + num106 *= 0.35f; + } + else + { + if (Main.netMode == 2) + { + num106 *= 0.5f; + } + } + num106 *= array7[num33]; + if (!array8[num33]) + { + this.spriteBatch.DrawString(Main.fontDeathText, array9[num33], new Vector2((float)(num2 + num104 + array5[num33]), (float)(num + num3 * num33 + num105) + origin.Y * array7[num33] + (float)array4[num33]), color12, 0f, origin, num106, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.DrawString(Main.fontDeathText, array9[num33], new Vector2((float)(num2 + num104 + array5[num33]), (float)(num + num3 * num33 + num105) + origin.Y * array7[num33] + (float)array4[num33]), color12, 0f, new Vector2(0f, origin.Y), num106, SpriteEffects.None, 0f); + } + } + if (!array8[num33]) + { + int num107 = 0; + if (this.menuWide[num33]) + { + num107 = 14; + } + this.menuWide[num33] = false; + if ((float)Main.mouseX > (float)num2 - (float)(array9[num33].Length * 10) * array7[num33] + (float)array5[num33] - (float)num107 && (float)Main.mouseX < (float)num2 + (float)(array9[num33].Length * 10) * array7[num33] + (float)array5[num33] + (float)num107 && Main.mouseY > num + num3 * num33 + array4[num33] && (float)Main.mouseY < (float)(num + num3 * num33 + array4[num33]) + 50f * array7[num33] && Main.hasFocus) + { + this.focusMenu = num33; + if (array[num33] || array2[num33]) + { + this.focusMenu = -1; + } + else + { + if (num32 != this.focusMenu) + { + Main.PlaySound(12, -1, -1, 1); + } + if (Main.mouseLeftRelease && Main.mouseLeft) + { + this.selectedMenu = num33; + } + if (Main.mouseRightRelease && Main.mouseRight) + { + this.selectedMenu2 = num33; + } + } + } + } + else + { + if (Main.mouseX > num2 + array5[num33] && (float)Main.mouseX < (float)num2 + (float)(array9[num33].Length * 20) * array7[num33] + (float)array5[num33] && Main.mouseY > num + num3 * num33 + array4[num33] && (float)Main.mouseY < (float)(num + num3 * num33 + array4[num33]) + 50f * array7[num33] && Main.hasFocus) + { + this.focusMenu = num33; + if (array[num33] || array2[num33]) + { + this.focusMenu = -1; + } + else + { + if (num32 != this.focusMenu) + { + Main.PlaySound(12, -1, -1, 1); + } + if (Main.mouseLeftRelease && Main.mouseLeft) + { + this.selectedMenu = num33; + } + if (Main.mouseRightRelease && Main.mouseRight) + { + this.selectedMenu2 = num33; + } + } + } + } + } + } + for (int num108 = 0; num108 < Main.maxMenuItems; num108++) + { + if (num108 == this.focusMenu) + { + if (this.menuItemScale[num108] < 1f) + { + this.menuItemScale[num108] += 0.02f; + } + if (this.menuItemScale[num108] > 1f) + { + this.menuItemScale[num108] = 1f; + } + } + else + { + if ((double)this.menuItemScale[num108] > 0.8) + { + this.menuItemScale[num108] -= 0.02f; + } + } + } + if (num6 >= 0 && num6 <= Main.numLoadPlayers) + { + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); + Main.loadPlayer[num6].PlayerFrame(); + Main.loadPlayer[num6].position.X = (float)num7 + Main.screenPosition.X; + Main.loadPlayer[num6].position.Y = (float)num8 + Main.screenPosition.Y; + this.DrawPlayer(Main.loadPlayer[num6]); + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); + } + for (int num109 = 0; num109 < 5; num109++) + { + Color color13 = Color.Black; + if (num109 == 4) + { + color13 = color; + color13.R = (byte)((255 + color13.R) / 2); + color13.G = (byte)((255 + color13.R) / 2); + color13.B = (byte)((255 + color13.R) / 2); + } + color13.A = (byte)((float)color13.A * 0.3f); + int num110 = 0; + int num111 = 0; + if (num109 == 0) + { + num110 = -2; + } + if (num109 == 1) + { + num110 = 2; + } + if (num109 == 2) + { + num111 = -2; + } + if (num109 == 3) + { + num111 = 2; + } + string text9 = "Copyright © 2013 Re-Logic"; + Vector2 origin2 = Main.fontMouseText.MeasureString(text9); + origin2.X *= 0.5f; + origin2.Y *= 0.5f; + this.spriteBatch.DrawString(Main.fontMouseText, text9, new Vector2((float)Main.screenWidth - origin2.X + (float)num110 - 10f, (float)Main.screenHeight - origin2.Y + (float)num111 - 2f), color13, 0f, origin2, 1f, SpriteEffects.None, 0f); + } + for (int num112 = 0; num112 < 5; num112++) + { + Color color14 = Color.Black; + if (num112 == 4) + { + color14 = color; + color14.R = (byte)((255 + color14.R) / 2); + color14.G = (byte)((255 + color14.R) / 2); + color14.B = (byte)((255 + color14.R) / 2); + } + color14.A = (byte)((float)color14.A * 0.3f); + int num113 = 0; + int num114 = 0; + if (num112 == 0) + { + num113 = -2; + } + if (num112 == 1) + { + num113 = 2; + } + if (num112 == 2) + { + num114 = -2; + } + if (num112 == 3) + { + num114 = 2; + } + Vector2 origin3 = Main.fontMouseText.MeasureString(Main.versionNumber); + origin3.X *= 0.5f; + origin3.Y *= 0.5f; + this.spriteBatch.DrawString(Main.fontMouseText, Main.versionNumber, new Vector2(origin3.X + (float)num113 + 10f, (float)Main.screenHeight - origin3.Y + (float)num114 - 2f), color14, 0f, origin3, 1f, SpriteEffects.None, 0f); + } + this.spriteBatch.Draw(Main.cursorTexture, new Vector2((float)(Main.mouseX + 1), (float)(Main.mouseY + 1)), new Rectangle?(new Rectangle(0, 0, Main.cursorTexture.Width, Main.cursorTexture.Height)), new Color((int)((float)Main.cursorColor.R * 0.2f), (int)((float)Main.cursorColor.G * 0.2f), (int)((float)Main.cursorColor.B * 0.2f), (int)((float)Main.cursorColor.A * 0.5f)), 0f, default(Vector2), Main.cursorScale * 1.1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.cursorTexture, new Vector2((float)Main.mouseX, (float)Main.mouseY), new Rectangle?(new Rectangle(0, 0, Main.cursorTexture.Width, Main.cursorTexture.Height)), Main.cursorColor, 0f, default(Vector2), Main.cursorScale, SpriteEffects.None, 0f); + if (Main.fadeCounter > 0) + { + Color white = Color.White; + Main.fadeCounter--; + float num115 = (float)Main.fadeCounter / 75f * 255f; + byte b2 = (byte)num115; + white = new Color((int)b2, (int)b2, (int)b2, (int)b2); + this.spriteBatch.Draw(Main.fadeTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), white); + } + this.spriteBatch.End(); + if (Main.mouseLeft) + { + Main.mouseLeftRelease = false; + } + else + { + Main.mouseLeftRelease = true; + } + if (Main.mouseRight) + { + Main.mouseRightRelease = false; + return; + } + Main.mouseRightRelease = true; + } + public static void CursorColor() + { + Main.cursorAlpha += (float)Main.cursorColorDirection * 0.015f; + if (Main.cursorAlpha >= 1f) + { + Main.cursorAlpha = 1f; + Main.cursorColorDirection = -1; + } + if ((double)Main.cursorAlpha <= 0.6) + { + Main.cursorAlpha = 0.6f; + Main.cursorColorDirection = 1; + } + float num = Main.cursorAlpha * 0.3f + 0.7f; + byte r = (byte)((float)Main.mouseColor.R * Main.cursorAlpha); + byte g = (byte)((float)Main.mouseColor.G * Main.cursorAlpha); + byte b = (byte)((float)Main.mouseColor.B * Main.cursorAlpha); + byte b2 = (byte)(255f * num); + Main.cursorColor = new Color((int)r, (int)g, (int)b, (int)b2); + Main.cursorScale = Main.cursorAlpha * 0.3f + 0.7f + 0.1f; + } + protected void DrawSplash(GameTime gameTime) + { + base.GraphicsDevice.Clear(Color.Black); + base.Draw(gameTime); + this.spriteBatch.Begin(); + this.splashCounter++; + Color white = Color.White; + byte b = 0; + if (this.splashCounter <= 75) + { + float num = (float)this.splashCounter / 75f * 255f; + b = (byte)num; + } + else + { + if (this.splashCounter <= 125) + { + b = 255; + } + else + { + if (this.splashCounter <= 200) + { + int num2 = 125 - this.splashCounter; + float num3 = (float)num2 / 75f * 255f; + b = (byte)num3; + } + else + { + Main.showSplash = false; + Main.fadeCounter = 75; + } + } + } + white = new Color((int)b, (int)b, (int)b, (int)b); + this.spriteBatch.Draw(Main.loTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), white); + this.spriteBatch.End(); + } + protected void DrawBackground() + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int num = (int)(255f * (1f - Main.gfxQuality) + 140f * Main.gfxQuality); + int num2 = (int)(200f * (1f - Main.gfxQuality) + 40f * Main.gfxQuality); + int num3 = 128; + Vector2 value = new Vector2((float)Main.offScreenRange, (float)Main.offScreenRange); + if (Main.drawToScreen) + { + value = default(Vector2); + } + float num4 = 0.9f; + float num5 = num4; + float num6 = num4; + float num7 = num4; + float num8 = 0f; + if (Main.bloodTiles > Main.evilTiles && Main.bloodTiles > Main.holyTiles) + { + num8 = (float)Main.bloodTiles / 800f; + } + else + { + if (Main.holyTiles > Main.evilTiles) + { + num8 = (float)Main.holyTiles / 800f; + } + else + { + if (Main.evilTiles > Main.holyTiles) + { + num8 = (float)Main.evilTiles / 800f; + } + } + } + if (num8 > 1f) + { + num8 = 1f; + } + if (num8 < 0f) + { + num8 = 0f; + } + float num9 = (float)((double)Main.screenPosition.Y - Main.worldSurface * 16.0) / 300f; + if (num9 < 0f) + { + num9 = 0f; + } + else + { + if (num9 > 1f) + { + num9 = 1f; + } + } + float num10 = 1f * (1f - num9) + num5 * num9; + Lighting.brightness = Lighting.defBrightness * (1f - num9) + 1f * num9; + float num11 = (float)((double)(Main.screenPosition.Y - (float)(Main.screenHeight / 2) + 200f) - Main.rockLayer * 16.0) / 300f; + if (num11 < 0f) + { + num11 = 0f; + } + else + { + if (num11 > 1f) + { + num11 = 1f; + } + } + if (Main.bloodTiles > Main.evilTiles && Main.bloodTiles > Main.holyTiles) + { + num5 = 1f * num8 + num5 * (1f - num8); + num6 = 0.55f * num8 + num6 * (1f - num8); + num7 = 0.5f * num8 + num7 * (1f - num8); + } + else + { + if (Main.evilTiles > 0) + { + num5 = 0.8f * num8 + num5 * (1f - num8); + num6 = 0.75f * num8 + num6 * (1f - num8); + num7 = 1.1f * num8 + num7 * (1f - num8); + } + else + { + if (Main.holyTiles > 0) + { + num5 = 1f * num8 + num5 * (1f - num8); + num6 = 0.7f * num8 + num6 * (1f - num8); + num7 = 0.9f * num8 + num7 * (1f - num8); + } + } + } + num5 = 1f * (num10 - num11) + num5 * num11; + num6 = 1f * (num10 - num11) + num6 * num11; + num7 = 1f * (num10 - num11) + num7 * num11; + int num12 = (int)((Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f); + int num13; + if (num12 <= Main.caveBackX[0]) + { + num13 = Main.caveBackStyle[0]; + } + else + { + if (num12 <= Main.treeX[1]) + { + num13 = Main.caveBackStyle[1]; + } + else + { + if (num12 <= Main.treeX[2]) + { + num13 = Main.caveBackStyle[2]; + } + else + { + num13 = Main.caveBackStyle[3]; + } + } + } + num13 += 3; + if (Main.snowTiles > 300 && (Main.screenPosition.Y + (float)Main.screenHeight) / 16f < (float)(Main.maxTilesY - 250)) + { + num13 = 1; + } + if (Main.jungleTiles > 80) + { + if (num13 == 1) + { + if (Main.jungleTiles > Main.snowTiles) + { + num13 = 11; + } + } + else + { + num13 = 11; + } + } + if (Main.shroomTiles > 200) + { + num13 = 2; + } + if (num13 != Main.ugBack) + { + Main.oldUgBack = Main.ugBack; + Main.ugBack = num13; + Main.ugBackTransition = 1f; + } + if (Main.ugBackTransition > 0f) + { + Main.ugBackTransition -= 0.25f; + } + if (Main.ugBackTransition < 0f) + { + Main.ugBackTransition = 0f; + } + int[] array = new int[6]; + int[] array2 = new int[6]; + for (int i = 0; i < 2; i++) + { + int num14 = Main.ugBack; + if (i == 1) + { + num14 = Main.oldUgBack; + } + int[] array3 = new int[6]; + if (num14 == 0) + { + array3[0] = 1; + array3[1] = 2; + array3[2] = 4; + array3[3] = 3; + array3[4] = 6; + array3[5] = 5; + } + else + { + if (num14 == 1) + { + if (Main.iceBackStyle == 0) + { + array3[1] = 33; + array3[3] = 32; + array3[0] = 40; + array3[2] = 34; + } + else + { + if (Main.iceBackStyle == 1) + { + array3[1] = 118; + array3[3] = 117; + array3[0] = 160; + array3[2] = 161; + } + else + { + if (Main.iceBackStyle == 2) + { + array3[1] = 165; + array3[3] = 167; + array3[0] = 164; + array3[2] = 166; + } + else + { + array3[1] = 120; + array3[3] = 119; + array3[0] = 162; + array3[2] = 163; + } + } + } + array3[4] = array3[3]; + } + else + { + if (num14 == 2) + { + array3[0] = 62; + array3[1] = 63; + array3[2] = 64; + array3[3] = 65; + array3[4] = 143 + Main.hellBackStyle; + } + else + { + if (num14 == 3) + { + array3[0] = 66; + array3[1] = 67; + array3[2] = 68; + array3[3] = 69; + array3[4] = 128 + Main.hellBackStyle; + } + else + { + if (num14 == 4) + { + array3[0] = 70; + array3[1] = 71; + array3[2] = 68; + array3[3] = 72; + array3[4] = 128 + Main.hellBackStyle; + } + else + { + if (num14 == 5) + { + array3[0] = 73; + array3[1] = 74; + array3[2] = 75; + array3[3] = 76; + array3[4] = 131 + Main.hellBackStyle; + } + else + { + if (num14 == 6) + { + array3[0] = 77; + array3[1] = 78; + array3[2] = 79; + array3[3] = 80; + array3[4] = 134 + Main.hellBackStyle; + } + else + { + if (num14 == 7) + { + array3[0] = 77; + array3[1] = 81; + array3[2] = 79; + array3[3] = 82; + array3[4] = 134 + Main.hellBackStyle; + } + else + { + if (num14 == 8) + { + array3[0] = 83; + array3[1] = 84; + array3[2] = 85; + array3[3] = 86; + array3[4] = 137 + Main.hellBackStyle; + } + else + { + if (num14 == 9) + { + array3[0] = 83; + array3[1] = 87; + array3[2] = 88; + array3[3] = 89; + array3[4] = 137 + Main.hellBackStyle; + } + else + { + if (num14 == 10) + { + array3[0] = 121; + array3[1] = 122; + array3[2] = 123; + array3[3] = 124; + array3[4] = 140 + Main.hellBackStyle; + } + else + { + if (num14 == 11) + { + if (Main.jungleBackStyle == 0) + { + array3[0] = 153; + array3[1] = 147; + array3[2] = 148; + array3[3] = 149; + array3[4] = 150 + Main.hellBackStyle; + } + else + { + array3[0] = 146; + array3[1] = 154; + array3[2] = 155; + array3[3] = 156; + array3[4] = 157 + Main.hellBackStyle; + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.hellBackStyle == 0) + { + array3[5] = 125; + } + if (Main.hellBackStyle == 1) + { + array3[5] = 126; + } + if (Main.hellBackStyle == 2) + { + array3[5] = 127; + } + this.LoadBackground(array3[0]); + this.LoadBackground(array3[1]); + this.LoadBackground(array3[2]); + this.LoadBackground(array3[3]); + this.LoadBackground(array3[4]); + this.LoadBackground(array3[5]); + if (i == 0) + { + for (int j = 0; j < 6; j++) + { + array[j] = array3[j]; + } + } + else + { + for (int k = 0; k < 6; k++) + { + array2[k] = array3[k]; + } + } + } + Lighting.defBrightness = 1.2f * (1f - num11) + 1f * num11; + this.bgParrallax = (double)Main.caveParrallax; + this.bgStart = (int)(-Math.IEEERemainder((double)num3 + (double)Main.screenPosition.X * this.bgParrallax, (double)num3) - (double)(num3 / 2)) - (int)value.X; + this.bgLoops = Main.screenWidth / num3 + 2; + this.bgTop = (int)((float)((int)Main.worldSurface * 16 - 16) - Main.screenPosition.Y + 16f); + for (int l = 0; l < this.bgLoops; l++) + { + for (int m = 0; m < num3 / 16; m++) + { + float num15 = (float)this.bgStart + Main.screenPosition.X; + num15 = -(float)Math.IEEERemainder((double)num15, 16.0); + num15 = (float)Math.Round((double)num15); + int num16 = (int)num15; + if (num16 == -8) + { + num16 = 8; + } + float num17 = (float)(this.bgStart + num3 * l + m * 16 + 8); + float num18 = (float)this.bgTop; + Color color = Lighting.GetColor((int)((num17 + Main.screenPosition.X) / 16f), (int)((Main.screenPosition.Y + num18) / 16f)); + color.R = (byte)((float)color.R * num5); + color.G = (byte)((float)color.G * num6); + color.B = (byte)((float)color.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[0]], new Vector2((float)(this.bgStart + num3 * l + 16 * m + num16), (float)this.bgTop) + value, new Rectangle?(new Rectangle(16 * m + num16 + 16, 0, 16, 16)), color); + if (Main.ugBackTransition > 0f) + { + Color color2 = color; + color2.R = (byte)((float)color2.R * Main.ugBackTransition); + color2.G = (byte)((float)color2.G * Main.ugBackTransition); + color2.B = (byte)((float)color2.B * Main.ugBackTransition); + color2.A = (byte)((float)color2.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[0]], new Vector2((float)(this.bgStart + num3 * l + 16 * m + num16), (float)this.bgTop) + value, new Rectangle?(new Rectangle(16 * m + num16 + 16, 0, 16, 16)), color2); + } + } + } + double num19 = (double)(Main.maxTilesY - 230); + double num20 = (double)((int)((num19 - Main.worldSurface) / 6.0) * 6); + num19 = Main.worldSurface + num20 - 5.0; + bool flag = false; + bool flag2 = false; + this.bgTop = (int)((float)((int)Main.worldSurface * 16) - Main.screenPosition.Y + 16f); + if (Main.worldSurface * 16.0 <= (double)(Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.offScreenRange)) + { + this.bgParrallax = (double)Main.caveParrallax; + this.bgStart = (int)(-Math.IEEERemainder((double)num3 + (double)Main.screenPosition.X * this.bgParrallax, (double)num3) - (double)(num3 / 2)) - (int)value.X; + this.bgLoops = (Main.screenWidth + (int)value.X * 2) / num3 + 2; + if (Main.worldSurface * 16.0 < (double)(Main.screenPosition.Y - 16f)) + { + this.bgStartY = (int)(Math.IEEERemainder((double)this.bgTop, (double)Main.backgroundHeight[2]) - (double)Main.backgroundHeight[2]); + this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int)value.Y * 2) / Main.backgroundHeight[2] + 1; + } + else + { + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int)value.Y * 2) / Main.backgroundHeight[2] + 1; + } + if (Main.rockLayer * 16.0 < (double)(Main.screenPosition.Y + 600f)) + { + this.bgLoopsY = (int)(Main.rockLayer * 16.0 - (double)Main.screenPosition.Y + 600.0 - (double)this.bgStartY) / Main.backgroundHeight[2]; + flag2 = true; + } + float num21 = (float)this.bgStart + Main.screenPosition.X; + num21 = -(float)Math.IEEERemainder((double)num21, 16.0); + num21 = (float)Math.Round((double)num21); + int num22 = (int)num21; + if (num22 == -8) + { + num22 = 8; + } + for (int n = 0; n < this.bgLoops; n++) + { + for (int num23 = 0; num23 < this.bgLoopsY; num23++) + { + for (int num24 = 0; num24 < num3 / 16; num24++) + { + for (int num25 = 0; num25 < 6; num25++) + { + float num26 = (float)(this.bgStartY + num23 * 96 + num25 * 16 + 8); + float num27 = (float)(this.bgStart + num3 * n + num24 * 16 + 8); + int num28 = (int)((num27 + Main.screenPosition.X) / 16f); + int num29 = (int)((num26 + Main.screenPosition.Y) / 16f); + Color color3 = Lighting.GetColor(num28, num29); + if (Main.tile[num28, num29] == null) + { + Main.tile[num28, num29] = new Tile(); + } + if (color3.R > 0 || color3.G > 0 || color3.B > 0) + { + if (((int)color3.R > num || (double)color3.G > (double)num * 1.1 || (double)color3.B > (double)num * 1.2) && !Main.tile[num28, num29].active() && Main.wallLight[(int)Main.tile[num28, num29].wall] && Main.ugBackTransition == 0f) + { + try + { + for (int num30 = 0; num30 < 9; num30++) + { + int num31 = 0; + int num32 = 0; + int width = 4; + int height = 4; + Color color4 = color3; + Color color5 = color3; + if (num30 == 0 && !Main.tile[num28 - 1, num29 - 1].active()) + { + color5 = Lighting.GetColor(num28 - 1, num29 - 1); + } + if (num30 == 1) + { + width = 8; + num31 = 4; + if (!Main.tile[num28, num29 - 1].active()) + { + color5 = Lighting.GetColor(num28, num29 - 1); + } + } + if (num30 == 2) + { + if (!Main.tile[num28 + 1, num29 - 1].active()) + { + color5 = Lighting.GetColor(num28 + 1, num29 - 1); + } + if (Main.tile[num28 + 1, num29 - 1] == null) + { + Main.tile[num28 + 1, num29 - 1] = new Tile(); + } + num31 = 12; + } + if (num30 == 3) + { + if (!Main.tile[num28 - 1, num29].active()) + { + color5 = Lighting.GetColor(num28 - 1, num29); + } + height = 8; + num32 = 4; + } + if (num30 == 4) + { + width = 8; + height = 8; + num31 = 4; + num32 = 4; + } + if (num30 == 5) + { + num31 = 12; + num32 = 4; + height = 8; + if (!Main.tile[num28 + 1, num29].active()) + { + color5 = Lighting.GetColor(num28 + 1, num29); + } + } + if (num30 == 6) + { + if (!Main.tile[num28 - 1, num29 + 1].active()) + { + color5 = Lighting.GetColor(num28 - 1, num29 + 1); + } + num32 = 12; + } + if (num30 == 7) + { + width = 8; + height = 4; + num31 = 4; + num32 = 12; + if (!Main.tile[num28, num29 + 1].active()) + { + color5 = Lighting.GetColor(num28, num29 + 1); + } + } + if (num30 == 8) + { + if (!Main.tile[num28 + 1, num29 + 1].active()) + { + color5 = Lighting.GetColor(num28 + 1, num29 + 1); + } + num31 = 12; + num32 = 12; + } + color4.R = (byte)((color3.R + color5.R) / 2); + color4.G = (byte)((color3.G + color5.G) / 2); + color4.B = (byte)((color3.B + color5.B) / 2); + color4.R = (byte)((float)color4.R * num5); + color4.G = (byte)((float)color4.G * num6); + color4.B = (byte)((float)color4.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num31 + num22), (float)(this.bgStartY + Main.backgroundHeight[array[1]] * num23 + 16 * num25 + num32)) + value, new Rectangle?(new Rectangle(16 * num24 + num31 + num22 + 16, 16 * num25 + num32, width, height)), color4); + if (Main.ugBackTransition > 0f) + { + Color color6 = color4; + color6.R = (byte)((float)color6.R * Main.ugBackTransition); + color6.G = (byte)((float)color6.G * Main.ugBackTransition); + color6.B = (byte)((float)color6.B * Main.ugBackTransition); + color6.A = (byte)((float)color6.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num31 + num22), (float)(this.bgStartY + Main.backgroundHeight[array2[1]] * num23 + 16 * num25 + num32)) + value, new Rectangle?(new Rectangle(16 * num24 + num31 + num22 + 16, 16 * num25 + num32, width, height)), color6); + } + } + goto IL_181F; + } + catch + { + color3.R = (byte)((float)color3.R * num5); + color3.G = (byte)((float)color3.G * num6); + color3.B = (byte)((float)color3.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num22), (float)(this.bgStartY + Main.backgroundHeight[array[1]] * num23 + 16 * num25)) + value, new Rectangle?(new Rectangle(16 * num24 + num22 + 16, 16 * num25, 16, 16)), color3); + goto IL_181F; + } + } + if (((int)color3.R > num2 || (double)color3.G > (double)num2 * 1.1 || (double)color3.B > (double)num2 * 1.2) && Main.ugBackTransition == 0f) + { + for (int num33 = 0; num33 < 4; num33++) + { + int num34 = 0; + int num35 = 0; + Color color7 = color3; + Color color8 = color3; + if (num33 == 0) + { + if (Lighting.Brighter(num28, num29 - 1, num28 - 1, num29)) + { + color8 = Lighting.GetColor(num28 - 1, num29); + } + else + { + color8 = Lighting.GetColor(num28, num29 - 1); + } + } + if (num33 == 1) + { + if (Lighting.Brighter(num28, num29 - 1, num28 + 1, num29)) + { + color8 = Lighting.GetColor(num28 + 1, num29); + } + else + { + color8 = Lighting.GetColor(num28, num29 - 1); + } + num34 = 8; + } + if (num33 == 2) + { + if (Lighting.Brighter(num28, num29 + 1, num28 - 1, num29)) + { + color8 = Lighting.GetColor(num28 - 1, num29); + } + else + { + color8 = Lighting.GetColor(num28, num29 + 1); + } + num35 = 8; + } + if (num33 == 3) + { + if (Lighting.Brighter(num28, num29 + 1, num28 + 1, num29)) + { + color8 = Lighting.GetColor(num28 + 1, num29); + } + else + { + color8 = Lighting.GetColor(num28, num29 + 1); + } + num34 = 8; + num35 = 8; + } + color7.R = (byte)((color3.R + color8.R) / 2); + color7.G = (byte)((color3.G + color8.G) / 2); + color7.B = (byte)((color3.B + color8.B) / 2); + color7.R = (byte)((float)color7.R * num5); + color7.G = (byte)((float)color7.G * num6); + color7.B = (byte)((float)color7.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num34 + num22), (float)(this.bgStartY + Main.backgroundHeight[array[1]] * num23 + 16 * num25 + num35)) + value, new Rectangle?(new Rectangle(16 * num24 + num34 + num22 + 16, 16 * num25 + num35, 8, 8)), color7); + if (Main.ugBackTransition > 0f) + { + Color color9 = color7; + color9.R = (byte)((float)color9.R * Main.ugBackTransition); + color9.G = (byte)((float)color9.G * Main.ugBackTransition); + color9.B = (byte)((float)color9.B * Main.ugBackTransition); + color9.A = (byte)((float)color9.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num34 + num22), (float)(this.bgStartY + Main.backgroundHeight[array2[1]] * num23 + 16 * num25 + num35)) + value, new Rectangle?(new Rectangle(16 * num24 + num34 + num22 + 16, 16 * num25 + num35, 8, 8)), color9); + } + } + } + else + { + color3.R = (byte)((float)color3.R * num5); + color3.G = (byte)((float)color3.G * num6); + color3.B = (byte)((float)color3.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num22), (float)(this.bgStartY + Main.backgroundHeight[array[1]] * num23 + 16 * num25)) + value, new Rectangle?(new Rectangle(16 * num24 + num22 + 16, 16 * num25, 16, 16)), color3); + if (Main.ugBackTransition > 0f) + { + Color color10 = color3; + color10.R = (byte)((float)color10.R * Main.ugBackTransition); + color10.G = (byte)((float)color10.G * Main.ugBackTransition); + color10.B = (byte)((float)color10.B * Main.ugBackTransition); + color10.A = (byte)((float)color10.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num22), (float)(this.bgStartY + Main.backgroundHeight[array2[1]] * num23 + 16 * num25)) + value, new Rectangle?(new Rectangle(16 * num24 + num22 + 16, 16 * num25, 16, 16)), color10); + } + } + } + else + { + color3.R = (byte)((float)color3.R * num5); + color3.G = (byte)((float)color3.G * num6); + color3.B = (byte)((float)color3.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[1]], new Vector2((float)(this.bgStart + num3 * n + 16 * num24 + num22), (float)(this.bgStartY + Main.backgroundHeight[array[1]] * num23 + 16 * num25)) + value, new Rectangle?(new Rectangle(16 * num24 + num22 + 16, 16 * num25, 16, 16)), color3); + } + IL_181F:; + } + } + } + } + if (flag2) + { + this.bgParrallax = (double)Main.caveParrallax; + this.bgStart = (int)(-Math.IEEERemainder((double)num3 + (double)Main.screenPosition.X * this.bgParrallax, (double)num3) - (double)(num3 / 2)) - (int)value.X; + this.bgLoops = (Main.screenWidth + (int)value.X * 2) / num3 + 2; + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + if (this.bgTop > -32) + { + for (int num36 = 0; num36 < this.bgLoops; num36++) + { + for (int num37 = 0; num37 < num3 / 16; num37++) + { + float num38 = (float)(this.bgStart + num3 * num36 + num37 * 16 + 8); + float num39 = (float)this.bgTop; + Color color11 = Lighting.GetColor((int)((num38 + Main.screenPosition.X) / 16f), (int)((Main.screenPosition.Y + num39) / 16f)); + color11.R = (byte)((float)color11.R * num5); + color11.G = (byte)((float)color11.G * num6); + color11.B = (byte)((float)color11.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[2]], new Vector2((float)(this.bgStart + num3 * num36 + 16 * num37 + num22), (float)this.bgTop) + value, new Rectangle?(new Rectangle(16 * num37 + num22 + 16, 0, 16, 16)), color11); + if (Main.ugBackTransition > 0f) + { + Color color12 = color11; + color12.R = (byte)((float)color12.R * Main.ugBackTransition); + color12.G = (byte)((float)color12.G * Main.ugBackTransition); + color12.B = (byte)((float)color12.B * Main.ugBackTransition); + color12.A = (byte)((float)color12.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[2]], new Vector2((float)(this.bgStart + num3 * num36 + 16 * num37 + num22), (float)this.bgTop) + value, new Rectangle?(new Rectangle(16 * num37 + num22 + 16, 0, 16, 16)), color12); + } + } + } + } + } + } + this.bgTop = (int)((float)((int)Main.rockLayer * 16) - Main.screenPosition.Y + 16f + 600f - 8f); + if (Main.rockLayer * 16.0 <= (double)(Main.screenPosition.Y + 600f)) + { + this.bgParrallax = (double)Main.caveParrallax; + this.bgStart = (int)(-Math.IEEERemainder((double)num3 + (double)Main.screenPosition.X * this.bgParrallax, (double)num3) - (double)(num3 / 2)) - (int)value.X; + this.bgLoops = (Main.screenWidth + (int)value.X * 2) / num3 + 2; + if (Main.rockLayer * 16.0 + (double)Main.screenHeight < (double)(Main.screenPosition.Y - 16f)) + { + this.bgStartY = (int)(Math.IEEERemainder((double)this.bgTop, (double)Main.backgroundHeight[3]) - (double)Main.backgroundHeight[3]); + this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int)value.Y * 2) / Main.backgroundHeight[2] + 1; + } + else + { + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int)value.Y * 2) / Main.backgroundHeight[2] + 1; + } + if (num19 * 16.0 < (double)(Main.screenPosition.Y + 600f)) + { + this.bgLoopsY = (int)(num19 * 16.0 - (double)Main.screenPosition.Y + 600.0 - (double)this.bgStartY) / Main.backgroundHeight[2]; + flag = true; + } + float num40 = (float)this.bgStart + Main.screenPosition.X; + num40 = -(float)Math.IEEERemainder((double)num40, 16.0); + num40 = (float)Math.Round((double)num40); + int num41 = (int)num40; + if (num41 == -8) + { + num41 = 8; + } + for (int num42 = 0; num42 < this.bgLoops; num42++) + { + for (int num43 = 0; num43 < this.bgLoopsY; num43++) + { + for (int num44 = 0; num44 < num3 / 16; num44++) + { + for (int num45 = 0; num45 < 6; num45++) + { + float num46 = (float)(this.bgStartY + num43 * 96 + num45 * 16 + 8); + float num47 = (float)(this.bgStart + num3 * num42 + num44 * 16 + 8); + int num48 = (int)((num47 + Main.screenPosition.X) / 16f); + int num49 = (int)((num46 + Main.screenPosition.Y) / 16f); + Color color13 = Lighting.GetColor(num48, num49); + if (Main.tile[num48, num49] == null) + { + Main.tile[num48, num49] = new Tile(); + } + bool flag3 = false; + if (Main.caveParrallax != 0f) + { + if (Main.tile[num48 - 1, num49] == null) + { + Main.tile[num48 - 1, num49] = new Tile(); + } + if (Main.tile[num48 + 1, num49] == null) + { + Main.tile[num48 + 1, num49] = new Tile(); + } + if (Main.wallLight[(int)Main.tile[num48, num49].wall] || Main.wallLight[(int)Main.tile[num48 - 1, num49].wall] || Main.wallLight[(int)Main.tile[num48 + 1, num49].wall]) + { + flag3 = true; + } + } + else + { + if (Main.wallLight[(int)Main.tile[num48, num49].wall]) + { + flag3 = true; + } + } + if ((flag3 || color13.R == 0 || color13.G == 0 || color13.B == 0) && (color13.R > 0 || color13.G > 0 || color13.B > 0) && (Main.wallLight[(int)Main.tile[num48, num49].wall] || Main.caveParrallax != 0f)) + { + if (Lighting.lightMode < 2 && color13.R < 230 && color13.G < 230 && color13.B < 230 && Main.ugBackTransition == 0f) + { + if (((int)color13.R > num || (double)color13.G > (double)num * 1.1 || (double)color13.B > (double)num * 1.2) && !Main.tile[num48, num49].active()) + { + for (int num50 = 0; num50 < 9; num50++) + { + int num51 = 0; + int num52 = 0; + int width2 = 4; + int height2 = 4; + Color color14 = color13; + Color color15 = color13; + if (num50 == 0 && !Main.tile[num48 - 1, num49 - 1].active()) + { + color15 = Lighting.GetColor(num48 - 1, num49 - 1); + } + if (num50 == 1) + { + width2 = 8; + num51 = 4; + if (!Main.tile[num48, num49 - 1].active()) + { + color15 = Lighting.GetColor(num48, num49 - 1); + } + } + if (num50 == 2) + { + if (!Main.tile[num48 + 1, num49 - 1].active()) + { + color15 = Lighting.GetColor(num48 + 1, num49 - 1); + } + num51 = 12; + } + if (num50 == 3) + { + if (!Main.tile[num48 - 1, num49].active()) + { + color15 = Lighting.GetColor(num48 - 1, num49); + } + height2 = 8; + num52 = 4; + } + if (num50 == 4) + { + width2 = 8; + height2 = 8; + num51 = 4; + num52 = 4; + } + if (num50 == 5) + { + num51 = 12; + num52 = 4; + height2 = 8; + if (!Main.tile[num48 + 1, num49].active()) + { + color15 = Lighting.GetColor(num48 + 1, num49); + } + } + if (num50 == 6) + { + if (!Main.tile[num48 - 1, num49 + 1].active()) + { + color15 = Lighting.GetColor(num48 - 1, num49 + 1); + } + num52 = 12; + } + if (num50 == 7) + { + width2 = 8; + height2 = 4; + num51 = 4; + num52 = 12; + if (!Main.tile[num48, num49 + 1].active()) + { + color15 = Lighting.GetColor(num48, num49 + 1); + } + } + if (num50 == 8) + { + if (!Main.tile[num48 + 1, num49 + 1].active()) + { + color15 = Lighting.GetColor(num48 + 1, num49 + 1); + } + num51 = 12; + num52 = 12; + } + color14.R = (byte)((color13.R + color15.R) / 2); + color14.G = (byte)((color13.G + color15.G) / 2); + color14.B = (byte)((color13.B + color15.B) / 2); + color14.R = (byte)((float)color14.R * num5); + color14.G = (byte)((float)color14.G * num6); + color14.B = (byte)((float)color14.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num51 + num41), (float)(this.bgStartY + Main.backgroundHeight[array[3]] * num43 + 16 * num45 + num52)) + value, new Rectangle?(new Rectangle(16 * num44 + num51 + num41 + 16, 16 * num45 + num52, width2, height2)), color14); + if (Main.ugBackTransition > 0f) + { + Color color16 = color14; + color16.R = (byte)((float)color16.R * Main.ugBackTransition); + color16.G = (byte)((float)color16.G * Main.ugBackTransition); + color16.B = (byte)((float)color16.B * Main.ugBackTransition); + color16.A = (byte)((float)color16.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num51 + num41), (float)(this.bgStartY + Main.backgroundHeight[array2[3]] * num43 + 16 * num45 + num52)) + value, new Rectangle?(new Rectangle(16 * num44 + num51 + num41 + 16, 16 * num45 + num52, width2, height2)), color16); + } + } + } + else + { + if ((int)color13.R > num2 || (double)color13.G > (double)num2 * 1.1 || (double)color13.B > (double)num2 * 1.2) + { + for (int num53 = 0; num53 < 4; num53++) + { + int num54 = 0; + int num55 = 0; + Color color17 = color13; + Color color18 = color13; + if (num53 == 0) + { + if (Lighting.Brighter(num48, num49 - 1, num48 - 1, num49)) + { + color18 = Lighting.GetColor(num48 - 1, num49); + } + else + { + color18 = Lighting.GetColor(num48, num49 - 1); + } + } + if (num53 == 1) + { + if (Lighting.Brighter(num48, num49 - 1, num48 + 1, num49)) + { + color18 = Lighting.GetColor(num48 + 1, num49); + } + else + { + color18 = Lighting.GetColor(num48, num49 - 1); + } + num54 = 8; + } + if (num53 == 2) + { + if (Lighting.Brighter(num48, num49 + 1, num48 - 1, num49)) + { + color18 = Lighting.GetColor(num48 - 1, num49); + } + else + { + color18 = Lighting.GetColor(num48, num49 + 1); + } + num55 = 8; + } + if (num53 == 3) + { + if (Lighting.Brighter(num48, num49 + 1, num48 + 1, num49)) + { + color18 = Lighting.GetColor(num48 + 1, num49); + } + else + { + color18 = Lighting.GetColor(num48, num49 + 1); + } + num54 = 8; + num55 = 8; + } + color17.R = (byte)((color13.R + color18.R) / 2); + color17.G = (byte)((color13.G + color18.G) / 2); + color17.B = (byte)((color13.B + color18.B) / 2); + color17.R = (byte)((float)color17.R * num5); + color17.G = (byte)((float)color17.G * num6); + color17.B = (byte)((float)color17.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num54 + num41), (float)(this.bgStartY + Main.backgroundHeight[array[3]] * num43 + 16 * num45 + num55)) + value, new Rectangle?(new Rectangle(16 * num44 + num54 + num41 + 16, 16 * num45 + num55, 8, 8)), color17); + if (Main.ugBackTransition > 0f) + { + Color color19 = color17; + color19.R = (byte)((float)color19.R * Main.ugBackTransition); + color19.G = (byte)((float)color19.G * Main.ugBackTransition); + color19.B = (byte)((float)color19.B * Main.ugBackTransition); + color19.A = (byte)((float)color19.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num54 + num41), (float)(this.bgStartY + Main.backgroundHeight[array2[3]] * num43 + 16 * num45 + num55)) + value, new Rectangle?(new Rectangle(16 * num44 + num54 + num41 + 16, 16 * num45 + num55, 8, 8)), color19); + } + } + } + else + { + color13.R = (byte)((float)color13.R * num5); + color13.G = (byte)((float)color13.G * num6); + color13.B = (byte)((float)color13.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num41), (float)(this.bgStartY + Main.backgroundHeight[array[3]] * num43 + 16 * num45)) + value, new Rectangle?(new Rectangle(16 * num44 + num41 + 16, 16 * num45, 16, 16)), color13); + if (Main.ugBackTransition > 0f) + { + Color color20 = color13; + color20.R = (byte)((float)color20.R * Main.ugBackTransition); + color20.G = (byte)((float)color20.G * Main.ugBackTransition); + color20.B = (byte)((float)color20.B * Main.ugBackTransition); + color20.A = (byte)((float)color20.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num41), (float)(this.bgStartY + Main.backgroundHeight[array2[3]] * num43 + 16 * num45)) + value, new Rectangle?(new Rectangle(16 * num44 + num41 + 16, 16 * num45, 16, 16)), color20); + } + } + } + } + else + { + color13.R = (byte)((float)color13.R * num5); + color13.G = (byte)((float)color13.G * num6); + color13.B = (byte)((float)color13.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num41), (float)(this.bgStartY + Main.backgroundHeight[array[3]] * num43 + 16 * num45)) + value, new Rectangle?(new Rectangle(16 * num44 + num41 + 16, 16 * num45, 16, 16)), color13); + if (Main.ugBackTransition > 0f) + { + Color color21 = color13; + color21.R = (byte)((float)color21.R * Main.ugBackTransition); + color21.G = (byte)((float)color21.G * Main.ugBackTransition); + color21.B = (byte)((float)color21.B * Main.ugBackTransition); + color21.A = (byte)((float)color21.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[3]], new Vector2((float)(this.bgStart + num3 * num42 + 16 * num44 + num41), (float)(this.bgStartY + Main.backgroundHeight[array2[3]] * num43 + 16 * num45)) + value, new Rectangle?(new Rectangle(16 * num44 + num41 + 16, 16 * num45, 16, 16)), color21); + } + } + } + } + } + } + } + num3 = 128; + if (flag) + { + this.bgParrallax = (double)Main.caveParrallax; + this.bgStart = (int)(-Math.IEEERemainder((double)num3 + (double)Main.screenPosition.X * this.bgParrallax, (double)num3) - (double)(num3 / 2)) - (int)value.X; + this.bgLoops = (Main.screenWidth + (int)value.X * 2) / num3 + 2; + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + for (int num56 = 0; num56 < this.bgLoops; num56++) + { + for (int num57 = 0; num57 < num3 / 16; num57++) + { + float num58 = (float)(this.bgStart + num3 * num56 + num57 * 16 + 8); + float num59 = (float)this.bgTop; + Color color22 = Lighting.GetColor((int)((num58 + Main.screenPosition.X) / 16f), (int)((Main.screenPosition.Y + num59) / 16f)); + color22.R = (byte)((float)color22.R * num5); + color22.G = (byte)((float)color22.G * num6); + color22.B = (byte)((float)color22.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[4]], new Vector2((float)(this.bgStart + num3 * num56 + 16 * num57 + num41), (float)this.bgTop) + value, new Rectangle?(new Rectangle(16 * num57 + num41 + 16, Main.magmaBGFrame * 16, 16, 16)), color22); + if (Main.ugBackTransition > 0f) + { + Color color23 = color22; + color23.R = (byte)((float)color23.R * Main.ugBackTransition); + color23.G = (byte)((float)color23.G * Main.ugBackTransition); + color23.B = (byte)((float)color23.B * Main.ugBackTransition); + color23.A = (byte)((float)color23.A * Main.ugBackTransition); + this.spriteBatch.Draw(Main.backgroundTexture[array2[4]], new Vector2((float)(this.bgStart + num3 * num56 + 16 * num57 + num41), (float)this.bgTop) + value, new Rectangle?(new Rectangle(16 * num57 + num41 + 16, Main.magmaBGFrame * 16, 16, 16)), color23); + } + } + } + } + } + this.bgTop = (int)((float)((int)num19 * 16) - Main.screenPosition.Y + 16f + 600f) - 8; + if (num19 * 16.0 <= (double)(Main.screenPosition.Y + 600f)) + { + this.bgStart = (int)(-Math.IEEERemainder((double)num3 + (double)Main.screenPosition.X * this.bgParrallax, (double)num3) - (double)(num3 / 2)) - (int)value.X; + this.bgLoops = (Main.screenWidth + (int)value.X * 2) / num3 + 2; + if (num19 * 16.0 + (double)Main.screenHeight < (double)(Main.screenPosition.Y - 16f)) + { + this.bgStartY = (int)(Math.IEEERemainder((double)this.bgTop, (double)Main.backgroundHeight[2]) - (double)Main.backgroundHeight[2]); + this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int)value.Y * 2) / Main.backgroundHeight[2] + 1; + } + else + { + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int)value.Y * 2) / Main.backgroundHeight[2] + 1; + } + num = (int)((double)num * 1.5); + num2 = (int)((double)num2 * 1.5); + float num60 = (float)this.bgStart + Main.screenPosition.X; + num60 = -(float)Math.IEEERemainder((double)num60, 16.0); + num60 = (float)Math.Round((double)num60); + int num61 = (int)num60; + if (num61 == -8) + { + num61 = 8; + } + for (int num62 = 0; num62 < this.bgLoops; num62++) + { + for (int num63 = 0; num63 < this.bgLoopsY; num63++) + { + for (int num64 = 0; num64 < num3 / 16; num64++) + { + for (int num65 = 0; num65 < 6; num65++) + { + float num66 = (float)(this.bgStartY + num63 * 96 + num65 * 16 + 8); + float num67 = (float)(this.bgStart + num3 * num62 + num64 * 16 + 8); + int num68 = (int)((num67 + Main.screenPosition.X) / 16f); + int num69 = (int)((num66 + Main.screenPosition.Y) / 16f); + Color color24 = Lighting.GetColor(num68, num69); + if (Main.tile[num68, num69] == null) + { + Main.tile[num68, num69] = new Tile(); + } + bool flag4 = false; + if (Main.caveParrallax != 0f) + { + if (Main.tile[num68 - 1, num69] == null) + { + Main.tile[num68 - 1, num69] = new Tile(); + } + if (Main.tile[num68 + 1, num69] == null) + { + Main.tile[num68 + 1, num69] = new Tile(); + } + if (Main.wallLight[(int)Main.tile[num68, num69].wall] || Main.wallLight[(int)Main.tile[num68 - 1, num69].wall] || Main.wallLight[(int)Main.tile[num68 + 1, num69].wall]) + { + flag4 = true; + } + } + else + { + if (Main.wallLight[(int)Main.tile[num68, num69].wall]) + { + flag4 = true; + } + } + if ((flag4 || color24.R == 0 || color24.G == 0 || color24.B == 0) && (color24.R > 0 || color24.G > 0 || color24.B > 0) && (Main.wallLight[(int)Main.tile[num68, num69].wall] || Main.caveParrallax != 0f)) + { + if (Lighting.lightMode < 2 && color24.R < 230 && color24.G < 230 && color24.B < 230) + { + if (((int)color24.R > num || (double)color24.G > (double)num * 1.1 || (double)color24.B > (double)num * 1.2) && !Main.tile[num68, num69].active()) + { + for (int num70 = 0; num70 < 9; num70++) + { + int num71 = 0; + int num72 = 0; + int width3 = 4; + int height3 = 4; + Color color25 = color24; + Color color26 = color24; + if (num70 == 0 && !Main.tile[num68 - 1, num69 - 1].active()) + { + color26 = Lighting.GetColor(num68 - 1, num69 - 1); + } + if (num70 == 1) + { + width3 = 8; + num71 = 4; + if (!Main.tile[num68, num69 - 1].active()) + { + color26 = Lighting.GetColor(num68, num69 - 1); + } + } + if (num70 == 2) + { + if (!Main.tile[num68 + 1, num69 - 1].active()) + { + color26 = Lighting.GetColor(num68 + 1, num69 - 1); + } + num71 = 12; + } + if (num70 == 3) + { + if (!Main.tile[num68 - 1, num69].active()) + { + color26 = Lighting.GetColor(num68 - 1, num69); + } + height3 = 8; + num72 = 4; + } + if (num70 == 4) + { + width3 = 8; + height3 = 8; + num71 = 4; + num72 = 4; + } + if (num70 == 5) + { + num71 = 12; + num72 = 4; + height3 = 8; + if (!Main.tile[num68 + 1, num69].active()) + { + color26 = Lighting.GetColor(num68 + 1, num69); + } + } + if (num70 == 6) + { + if (!Main.tile[num68 - 1, num69 + 1].active()) + { + color26 = Lighting.GetColor(num68 - 1, num69 + 1); + } + num72 = 12; + } + if (num70 == 7) + { + width3 = 8; + height3 = 4; + num71 = 4; + num72 = 12; + if (!Main.tile[num68, num69 + 1].active()) + { + color26 = Lighting.GetColor(num68, num69 + 1); + } + } + if (num70 == 8) + { + if (!Main.tile[num68 + 1, num69 + 1].active()) + { + color26 = Lighting.GetColor(num68 + 1, num69 + 1); + } + num71 = 12; + num72 = 12; + } + color25.R = (byte)((color24.R + color26.R) / 2); + color25.G = (byte)((color24.G + color26.G) / 2); + color25.B = (byte)((color24.B + color26.B) / 2); + color25.R = (byte)((float)color25.R * num5); + color25.G = (byte)((float)color25.G * num6); + color25.B = (byte)((float)color25.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[5]], new Vector2((float)(this.bgStart + num3 * num62 + 16 * num64 + num71 + num61), (float)(this.bgStartY + Main.backgroundHeight[2] * num63 + 16 * num65 + num72)) + value, new Rectangle?(new Rectangle(16 * num64 + num71 + num61 + 16, 16 * num65 + Main.backgroundHeight[2] * Main.magmaBGFrame + num72, width3, height3)), color25, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + if ((int)color24.R > num2 || (double)color24.G > (double)num2 * 1.1 || (double)color24.B > (double)num2 * 1.2) + { + for (int num73 = 0; num73 < 4; num73++) + { + int num74 = 0; + int num75 = 0; + Color color27 = color24; + Color color28 = color24; + if (num73 == 0) + { + if (Lighting.Brighter(num68, num69 - 1, num68 - 1, num69)) + { + color28 = Lighting.GetColor(num68 - 1, num69); + } + else + { + color28 = Lighting.GetColor(num68, num69 - 1); + } + } + if (num73 == 1) + { + if (Lighting.Brighter(num68, num69 - 1, num68 + 1, num69)) + { + color28 = Lighting.GetColor(num68 + 1, num69); + } + else + { + color28 = Lighting.GetColor(num68, num69 - 1); + } + num74 = 8; + } + if (num73 == 2) + { + if (Lighting.Brighter(num68, num69 + 1, num68 - 1, num69)) + { + color28 = Lighting.GetColor(num68 - 1, num69); + } + else + { + color28 = Lighting.GetColor(num68, num69 + 1); + } + num75 = 8; + } + if (num73 == 3) + { + if (Lighting.Brighter(num68, num69 + 1, num68 + 1, num69)) + { + color28 = Lighting.GetColor(num68 + 1, num69); + } + else + { + color28 = Lighting.GetColor(num68, num69 + 1); + } + num74 = 8; + num75 = 8; + } + color27.R = (byte)((color24.R + color28.R) / 2); + color27.G = (byte)((color24.G + color28.G) / 2); + color27.B = (byte)((color24.B + color28.B) / 2); + color27.R = (byte)((float)color27.R * num5); + color27.G = (byte)((float)color27.G * num6); + color27.B = (byte)((float)color27.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[5]], new Vector2((float)(this.bgStart + num3 * num62 + 16 * num64 + num74 + num61), (float)(this.bgStartY + Main.backgroundHeight[2] * num63 + 16 * num65 + num75)) + value, new Rectangle?(new Rectangle(16 * num64 + num74 + num61 + 16, 16 * num65 + Main.backgroundHeight[2] * Main.magmaBGFrame + num75, 8, 8)), color27, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + color24.R = (byte)((float)color24.R * num5); + color24.G = (byte)((float)color24.G * num6); + color24.B = (byte)((float)color24.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[5]], new Vector2((float)(this.bgStart + num3 * num62 + 16 * num64 + num61), (float)(this.bgStartY + Main.backgroundHeight[2] * num63 + 16 * num65)) + value, new Rectangle?(new Rectangle(16 * num64 + num61 + 16, 16 * num65 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + else + { + color24.R = (byte)((float)color24.R * num5); + color24.G = (byte)((float)color24.G * num6); + color24.B = (byte)((float)color24.B * num7); + this.spriteBatch.Draw(Main.backgroundTexture[array[5]], new Vector2((float)(this.bgStart + num3 * num62 + 16 * num64 + num61), (float)(this.bgStartY + Main.backgroundHeight[2] * num63 + 16 * num65)) + value, new Rectangle?(new Rectangle(16 * num64 + num61 + 16, 16 * num65 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + } + } + Lighting.brightness = Lighting.defBrightness; + Main.renderTimer[3] = (float)stopwatch.ElapsedMilliseconds; + } + protected void RenderBackground() + { + if (Main.drawToScreen) + { + return; + } + base.GraphicsDevice.SetRenderTarget(this.backWaterTarget); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + try + { + this.drawWaters(true); + } + catch + { + } + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + base.GraphicsDevice.SetRenderTarget(this.backgroundTarget); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + if (Main.ignoreErrors) + { + try + { + this.DrawBackground(); + goto IL_A3; + } + catch + { + goto IL_A3; + } + } + this.DrawBackground(); + IL_A3: + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + protected void DrawToMap() + { + if (!Main.mapEnabled) + { + return; + } + int num = Main.maxTilesX / Main.textureMax; + int num2 = Main.maxTilesY / Main.textureMax; + for (int i = 0; i <= num; i++) + { + for (int j = 0; j <= num2; j++) + { + if (!this.checkMap(i, j)) + { + return; + } + } + } + if (Main.clearMap) + { + int num3 = Main.maxTilesX / Main.textureMax; + int num4 = Main.maxTilesY / Main.textureMax; + for (int k = 0; k <= num3; k++) + { + for (int l = 0; l <= num4; l++) + { + base.GraphicsDevice.SetRenderTarget(this.mapTarget[k, l]); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + base.GraphicsDevice.SetRenderTarget(null); + } + } + Main.clearMap = false; + } + int num5 = -1; + int num6 = -1; + bool flag = false; + int num7 = 0; + Main.mapUnfinished = false; + int num8 = Main.mapMinY; + int num9 = Main.mapMinY; + int num10 = Main.mapMaxY; + int num11 = Main.mapMaxY; + int num12 = 1; + if (Main.mapMinY / Main.textureMax != Main.mapMaxY / Main.textureMax) + { + num10 = Main.textureMax; + num9 = Main.textureMax; + num12 = 2; + } + for (int m = 0; m < num12; m++) + { + if (m == 0) + { + Main.mapMinY = num8; + Main.mapMaxY = num10; + } + else + { + if (m == 1) + { + Main.mapMinY = num9; + Main.mapMaxY = num11; + } + } + for (int n = Main.mapMinX; n < Main.mapMaxX; n++) + { + for (int num13 = Main.mapMinY; num13 < Main.mapMaxY; num13++) + { + if (Main.map[n, num13] != null && Main.map[n, num13].changed()) + { + num7++; + if (num7 < Main.maxMapUpdates) + { + if (Main.loadMap) + { + Main.loadMapLastX = n; + } + Main.map[n, num13].changed(false); + int num14 = n / Main.textureMax; + int num15 = num13 / Main.textureMax; + if (num14 != num5 || num15 != num6) + { + num5 = num14; + num6 = num15; + if (flag) + { + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + flag = true; + base.GraphicsDevice.SetRenderTarget(this.mapTarget[num14, num15]); + this.spriteBatch.Begin(); + } + int num16 = n - num14 * Main.textureMax; + int num17 = num13 - num15 * Main.textureMax; + Color color = Main.map[n, num13].getColor(num13); + int num18 = 1; + int num19 = 1; + int num20 = num13 + 1; + while (num20 < Main.mapMaxY && Main.map[n, num20] != null && Main.map[n, num20].changed() && Main.map[n, num13].isTheSameAs(Main.map[n, num20], num13, num20) && num20 / Main.textureMax == num15) + { + Main.map[n, num20].changed(false); + num18++; + num20++; + num13++; + } + if (num20 == num13 + 1) + { + num20 = n + 1; + while (num20 < Main.mapMaxX && Main.map[num20, num13] != null && Main.map[num20, num13].changed() && Main.map[n, num13].isTheSameAs(Main.map[num20, num13], num13, num13) && num20 / Main.textureMax == num14) + { + Main.map[num20, num13].changed(false); + num19++; + num20++; + } + } + this.spriteBatch.Draw(Main.magicPixel, new Vector2((float)num16, (float)num17), new Rectangle?(new Rectangle(0, 0, num19, num18)), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + Main.mapUnfinished = true; + } + } + } + } + } + for (int num21 = 0; num21 < Map.numUpdateTile; num21++) + { + int num22 = (int)Map.updateTileX[num21]; + int num23 = (int)Map.updateTileY[num21]; + if (Main.map[num22, num23] != null && Main.map[num22, num23].changed()) + { + Main.map[num22, num23].changed(false); + int num24 = num22 / Main.textureMax; + int num25 = num23 / Main.textureMax; + if (num24 != num5 || num25 != num6) + { + num5 = num24; + num6 = num25; + if (flag) + { + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + flag = true; + base.GraphicsDevice.SetRenderTarget(this.mapTarget[num24, num25]); + this.spriteBatch.Begin(); + } + int num26 = num22 - num24 * Main.textureMax; + int num27 = num23 - num25 * Main.textureMax; + Color color2 = Main.map[num22, num23].getColor(num23); + this.spriteBatch.Draw(Main.magicPixel, new Vector2((float)num26, (float)num27), new Rectangle?(new Rectangle(0, 0, 1, 1)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + Map.numUpdateTile = 0; + if (flag) + { + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + Main.mapReady = true; + if (!Main.mapUnfinished) + { + Main.loadMapLastX = 0; + Main.loadMap = false; + Main.loadMapLock = false; + } + } + protected void DrawMap() + { + string cursorText = ""; + if (!Main.mapEnabled) + { + return; + } + if (!Main.mapReady) + { + return; + } + float num = 0f; + float num2 = 0f; + float num3 = num; + float num4 = num2; + byte b = 255; + int arg_40_0 = Main.maxTilesX / Main.textureMax; + int num5 = Main.maxTilesY / Main.textureMax; + float num6 = (float)Lighting.offScreenTiles; + float num7 = (float)Lighting.offScreenTiles; + float num8 = (float)(Main.maxTilesX - Lighting.offScreenTiles - 1); + float num9 = (float)(Main.maxTilesY - Lighting.offScreenTiles - 42); + float num10 = 0f; + float num11 = 0f; + num6 = 10f; + num7 = 10f; + num8 = (float)(Main.maxTilesX - 10); + num9 = (float)(Main.maxTilesY - 10); + num = 200f; + num2 = 300f; + float num12 = 0f; + float num13 = 0f; + float num14 = num8 - 1f; + float num15 = num9 - 1f; + float num16; + if (Main.mapFullscreen) + { + num16 = Main.mapFullscreenScale; + } + else + { + if (Main.mapStyle == 1) + { + num16 = Main.mapMinimapScale; + } + else + { + num16 = Main.mapOverlayScale; + } + } + bool flag = false; + if (!Main.mapFullscreen && num16 > 1f) + { + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); + flag = true; + } + if (Main.mapFullscreen) + { + if (Main.mouseLeft && base.IsActive) + { + if (Main.mouseLeftRelease) + { + Main.grabMapX = (float)Main.mouseX; + Main.grabMapY = (float)Main.mouseY; + } + else + { + float num17 = (float)Main.mouseX - Main.grabMapX; + float num18 = (float)Main.mouseY - Main.grabMapY; + Main.grabMapX = (float)Main.mouseX; + Main.grabMapY = (float)Main.mouseY; + num17 *= 0.06255f; + num18 *= 0.06255f; + Main.mapFullscreenPos.X = Main.mapFullscreenPos.X - num17 * (16f / Main.mapFullscreenScale); + Main.mapFullscreenPos.Y = Main.mapFullscreenPos.Y - num18 * (16f / Main.mapFullscreenScale); + } + } + Main.player[Main.myPlayer].mouseInterface = true; + float num19 = (float)Main.screenWidth / (float)Main.maxTilesX * 0.8f; + if (Main.mapFullscreenScale < num19) + { + Main.mapFullscreenScale = num19; + } + if (Main.mapFullscreenScale > 16f) + { + Main.mapFullscreenScale = 16f; + } + num16 = Main.mapFullscreenScale; + b = 255; + if (Main.mapFullscreenPos.X < num6) + { + Main.mapFullscreenPos.X = num6; + } + if (Main.mapFullscreenPos.X > num8) + { + Main.mapFullscreenPos.X = num8; + } + if (Main.mapFullscreenPos.Y < num7) + { + Main.mapFullscreenPos.Y = num7; + } + if (Main.mapFullscreenPos.Y > num9) + { + Main.mapFullscreenPos.Y = num9; + } + float num20 = Main.mapFullscreenPos.X; + float num21 = Main.mapFullscreenPos.Y; + if (Main.resetMapFull) + { + Main.resetMapFull = false; + num20 = (Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f; + num21 = (Main.screenPosition.Y + (float)(Main.screenHeight / 2)) / 16f; + Main.mapFullscreenPos.X = num20; + Main.mapFullscreenPos.Y = num21; + } + num20 *= num16; + num21 *= num16; + num = -num20 + (float)(Main.screenWidth / 2); + num2 = -num21 + (float)(Main.screenHeight / 2); + num += num6 * num16; + num2 += num7 * num16; + float num22 = (float)(Main.maxTilesX / 840); + num22 *= Main.mapFullscreenScale; + float num23 = num; + float num24 = num2; + float num25 = (float)this.mapTexture.Width; + float num26 = (float)this.mapTexture.Height; + if (Main.maxTilesX == 8400) + { + num22 *= 0.999f; + num23 -= 40.6f * num22; + num24 = num2 - 5f * num22; + num25 -= 8.045f; + num25 *= num22; + num26 += 0.12f; + num26 *= num22; + if ((double)num22 < 1.2) + { + num26 += 1f; + } + } + else + { + if (Main.maxTilesX == 6400) + { + num22 *= 1.09f; + num23 -= 38.8f * num22; + num24 = num2 - 3.85f * num22; + num25 -= 13.6f; + num25 *= num22; + num26 -= 6.92f; + num26 *= num22; + if ((double)num22 < 1.2) + { + num26 += 2f; + } + } + else + { + if (Main.maxTilesX == 6300) + { + num22 *= 1.09f; + num23 -= 39.8f * num22; + num24 = num2 - 4.08f * num22; + num25 -= 26.69f; + num25 *= num22; + num26 -= 6.92f; + num26 *= num22; + if ((double)num22 < 1.2) + { + num26 += 2f; + } + } + else + { + if (Main.maxTilesX == 4200) + { + num22 *= 0.998f; + num23 -= 37.3f * num22; + num24 -= 1.7f * num22; + num25 -= 16f; + num25 *= num22; + num26 -= 8.31f; + num26 *= num22; + } + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); + flag = true; + if (Main.screenPosition.Y > (float)((Main.maxTilesY - 232) * 16)) + { + this.spriteBatch.Draw(this.mapBG3Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White); + } + else + { + if (Main.player[Main.myPlayer].zoneDungeon) + { + this.spriteBatch.Draw(this.mapBG5Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White); + } + else + { + if ((double)Main.screenPosition.Y > Main.worldSurface * 16.0) + { + if (Main.player[Main.myPlayer].zoneSnow) + { + this.spriteBatch.Draw(this.mapBG4Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White); + } + else + { + this.spriteBatch.Draw(this.mapBG2Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White); + } + } + else + { + int num27 = (int)((Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f); + if (Main.player[Main.myPlayer].zoneEvil) + { + this.spriteBatch.Draw(this.mapBG6Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + if (Main.player[Main.myPlayer].zoneBlood) + { + this.spriteBatch.Draw(this.mapBG7Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + if (Main.player[Main.myPlayer].zoneHoly) + { + this.spriteBatch.Draw(this.mapBG8Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + if ((double)(Main.screenPosition.Y / 16f) < Main.worldSurface + 10.0 && (num27 < 380 || num27 > Main.maxTilesX - 380)) + { + this.spriteBatch.Draw(this.mapBG11Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + if (Main.player[Main.myPlayer].zoneSnow) + { + this.spriteBatch.Draw(this.mapBG12Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + if (Main.player[Main.myPlayer].zoneJungle) + { + this.spriteBatch.Draw(this.mapBG9Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + if (Main.sandTiles > 1000) + { + this.spriteBatch.Draw(this.mapBG10Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + else + { + this.spriteBatch.Draw(this.mapBG1Texture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + } + } + } + } + } + } + } + } + } + Rectangle destinationRectangle = new Rectangle((int)num23, (int)num24, (int)num25, (int)num26); + this.spriteBatch.Draw(this.mapTexture, destinationRectangle, Color.White); + if (num16 < 1f) + { + this.spriteBatch.End(); + this.spriteBatch.Begin(); + flag = false; + } + } + else + { + if (Main.mapStyle == 1) + { + Main.miniMapWidth = 240; + Main.miniMapHeight = 240; + Main.miniMapX = Main.screenWidth - Main.miniMapWidth - 52; + Main.miniMapY = 90; + float arg_938_0 = (float)Main.miniMapHeight / (float)Main.maxTilesY; + if ((double)Main.mapMinimapScale < 0.2) + { + Main.mapMinimapScale = 0.2f; + } + if (Main.mapMinimapScale > 3f) + { + Main.mapMinimapScale = 3f; + } + if ((double)Main.mapMinimapAlpha < 0.01) + { + Main.mapMinimapAlpha = 0.01f; + } + if (Main.mapMinimapAlpha > 1f) + { + Main.mapMinimapAlpha = 1f; + } + num16 = Main.mapMinimapScale; + b = (byte)(255f * Main.mapMinimapAlpha); + num = (float)Main.miniMapX; + num2 = (float)Main.miniMapY; + num3 = num; + num4 = num2; + float num28 = (Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f; + float num29 = (Main.screenPosition.Y + (float)(Main.screenHeight / 2)) / 16f; + num10 = -(num28 - (float)((int)((Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f))) * num16; + num11 = -(num29 - (float)((int)((Main.screenPosition.Y + (float)(Main.screenHeight / 2)) / 16f))) * num16; + num14 = (float)Main.miniMapWidth / num16; + num15 = (float)Main.miniMapHeight / num16; + num12 = (float)((int)num28) - num14 / 2f; + num13 = (float)((int)num29) - num15 / 2f; + float num30 = (float)Main.maxTilesY + num13; + num30 *= num16; + float x = num3 - 6f; + float y = num4 - 6f; + this.spriteBatch.Draw(Main.miniMapFrame2Texture, new Vector2(x, y), new Rectangle?(new Rectangle(0, 0, Main.miniMapFrame2Texture.Width, Main.miniMapFrame2Texture.Height)), new Color((int)b, (int)b, (int)b, (int)b), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + if (Main.mapStyle == 2) + { + float num31 = (float)Main.screenWidth / (float)Main.maxTilesX; + if (Main.mapOverlayScale < num31) + { + Main.mapOverlayScale = num31; + } + if (Main.mapOverlayScale > 16f) + { + Main.mapOverlayScale = 16f; + } + if ((double)Main.mapOverlayAlpha < 0.01) + { + Main.mapOverlayAlpha = 0.01f; + } + if (Main.mapOverlayAlpha > 1f) + { + Main.mapOverlayAlpha = 1f; + } + num16 = Main.mapOverlayScale; + b = (byte)(255f * Main.mapOverlayAlpha); + int arg_B8A_0 = Main.maxTilesX; + int arg_B90_0 = Main.maxTilesY; + float num32 = (Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f; + float num33 = (Main.screenPosition.Y + (float)(Main.screenHeight / 2)) / 16f; + num32 *= num16; + num33 *= num16; + num = -num32 + (float)(Main.screenWidth / 2); + num2 = -num33 + (float)(Main.screenHeight / 2); + num += num6 * num16; + num2 += num7 * num16; + } + } + } + if (Main.mapStyle == 1 && !Main.mapFullscreen) + { + if (num12 < num6) + { + num -= (num12 - num6) * num16; + } + if (num13 < num7) + { + num2 -= (num13 - num7) * num16; + } + } + num14 = num12 + num14; + num15 = num13 + num15; + if (num12 > num6) + { + num6 = num12; + } + if (num13 > num7) + { + num7 = num13; + } + if (num14 < num8) + { + num8 = num14; + } + if (num15 < num9) + { + num9 = num15; + } + float num34 = (float)Main.textureMax * num16; + float num35 = num; + float num36 = 0f; + for (int i = 0; i <= 4; i++) + { + if ((float)((i + 1) * Main.textureMax) > num6 && (float)(i * Main.textureMax) < num6 + num8) + { + for (int j = 0; j <= num5; j++) + { + if ((float)((j + 1) * Main.textureMax) > num7 && (float)(j * Main.textureMax) < num7 + num9) + { + float num37 = num + (float)((int)((float)i * num34)); + float num38 = num2 + (float)((int)((float)j * num34)); + float num39 = (float)(i * Main.textureMax); + float num40 = (float)(j * Main.textureMax); + float num41 = 0f; + float num42 = 0f; + if (num39 < num6) + { + num41 = num6 - num39; + } + else + { + num37 -= num6 * num16; + } + if (num40 < num7) + { + num42 = num7 - num40; + num38 = num2; + } + else + { + num38 -= num7 * num16; + } + num37 = num35; + float num43 = (float)Main.textureMax; + float num44 = (float)Main.textureMax; + float num45 = (float)((i + 1) * Main.textureMax); + float num46 = (float)((j + 1) * Main.textureMax); + if (num45 >= num8) + { + num43 -= num45 - num8; + } + if (num46 >= num9) + { + num44 -= num46 - num9; + } + num37 += num10; + num38 += num11; + if (num43 > num41) + { + if (this.mapTarget[i, j].IsContentLost) + { + Main.refreshMap = true; + Main.clearMap = true; + } + this.spriteBatch.Draw(this.mapTarget[i, j], new Vector2(num37, num38), new Rectangle?(new Rectangle((int)num41, (int)num42, (int)num43 - (int)num41, (int)num44 - (int)num42)), new Color((int)b, (int)b, (int)b, (int)b), 0f, default(Vector2), num16, SpriteEffects.None, 0f); + } + num36 = (float)((int)num43 - (int)num41) * num16; + } + if (j == num5) + { + num35 += num36; + } + } + } + } + if (flag) + { + this.spriteBatch.End(); + this.spriteBatch.Begin(); + } + if (!Main.mapFullscreen) + { + if (Main.mapStyle == 2) + { + float num47 = (num16 * 0.2f * 2f + 1f) / 3f; + if (num47 > 1f) + { + num47 = 1f; + } + if (num16 < 10f) + { + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && Main.npc[k].townNPC) + { + int num48 = NPC.TypeToNum(Main.npc[k].type); + if (num48 > 0) + { + SpriteEffects effects = SpriteEffects.None; + if (Main.npc[k].direction > 0) + { + effects = SpriteEffects.FlipHorizontally; + } + float num49 = (Main.npc[k].position.X + (float)(Main.npc[k].width / 2)) / 16f * num16; + float num50 = (Main.npc[k].position.Y + (float)(Main.npc[k].height / 2)) / 16f * num16; + num49 += num; + num50 += num2; + num49 -= 10f * num16; + num50 -= 10f * num16; + this.spriteBatch.Draw(Main.npcHeadTexture[num48], new Vector2(num49, num50), new Rectangle?(new Rectangle(0, 0, Main.npcHeadTexture[num48].Width, Main.npcHeadTexture[num48].Height)), new Color((int)b, (int)b, (int)b, (int)b), 0f, new Vector2((float)(Main.npcHeadTexture[num48].Width / 2), (float)(Main.npcHeadTexture[num48].Height / 2)), num47, effects, 0f); + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + for (int l = 0; l < 255; l++) + { + if (Main.player[l].active && !Main.player[l].dead && l != Main.myPlayer && ((!Main.player[Main.myPlayer].hostile && !Main.player[l].hostile) || Main.player[Main.myPlayer].team == Main.player[l].team)) + { + float num51 = (Main.player[l].position.X + (float)(Main.player[l].width / 2)) / 16f * num16; + float num52 = Main.player[l].position.Y / 16f * num16; + num51 += num; + num52 += num2; + num51 -= 6f; + num52 -= 2f; + num52 -= 2f - num16 / 5f * 2f; + num51 -= 10f * num16; + num52 -= 10f * num16; + this.DrawPlayerHead(Main.player[l], num51, num52, (float)b / 255f, num47); + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(); + } + } + if (Main.mapStyle == 1) + { + float num53 = num3 - 6f; + float num54 = num4 - 6f; + float num55 = (num16 * 0.25f * 2f + 1f) / 3f; + if (num55 > 1f) + { + num55 = 1f; + } + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && Main.npc[m].townNPC) + { + int num56 = NPC.TypeToNum(Main.npc[m].type); + if (num56 > 0) + { + SpriteEffects effects2 = SpriteEffects.None; + if (Main.npc[m].direction > 0) + { + effects2 = SpriteEffects.FlipHorizontally; + } + float num57 = ((Main.npc[m].position.X + (float)(Main.npc[m].width / 2)) / 16f - num12) * num16; + float num58 = ((Main.npc[m].position.Y + Main.npc[m].gfxOffY + (float)(Main.npc[m].height / 2)) / 16f - num13) * num16; + num57 += num3; + num58 += num4; + num58 -= 2f * num16 / 5f; + if (num57 > (float)(Main.miniMapX + 12) && num57 < (float)(Main.miniMapX + Main.miniMapWidth - 16) && num58 > (float)(Main.miniMapY + 10) && num58 < (float)(Main.miniMapY + Main.miniMapHeight - 14)) + { + this.spriteBatch.Draw(Main.npcHeadTexture[num56], new Vector2(num57 + num10, num58 + num11), new Rectangle?(new Rectangle(0, 0, Main.npcHeadTexture[num56].Width, Main.npcHeadTexture[num56].Height)), new Color((int)b, (int)b, (int)b, (int)b), 0f, new Vector2((float)(Main.npcHeadTexture[num56].Width / 2), (float)(Main.npcHeadTexture[num56].Height / 2)), num55, effects2, 0f); + float num59 = num57 - (float)(Main.npcHeadTexture[num56].Width / 2) * num55; + float num60 = num58 - (float)(Main.npcHeadTexture[num56].Height / 2) * num55; + float num61 = num59 + (float)Main.npcHeadTexture[num56].Width * num55; + float num62 = num60 + (float)Main.npcHeadTexture[num56].Height * num55; + if ((float)Main.mouseX >= num59 && (float)Main.mouseX <= num61 && (float)Main.mouseY >= num60 && (float)Main.mouseY <= num62) + { + string text; + if (num56 == 11) + { + text = Main.npc[m].displayName; + } + else + { + text = Main.npc[m].displayName + " the " + Main.npc[m].name; + } + cursorText = text; + } + } + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + for (int n = 0; n < 255; n++) + { + if (Main.player[n].active && !Main.player[n].dead && ((!Main.player[Main.myPlayer].hostile && !Main.player[n].hostile) || Main.player[Main.myPlayer].team == Main.player[n].team)) + { + float num63 = ((Main.player[n].position.X + (float)(Main.player[n].width / 2)) / 16f - num12) * num16; + float num64 = ((Main.player[n].position.Y + Main.player[n].gfxOffY + (float)(Main.player[n].height / 2)) / 16f - num13) * num16; + num63 += num3; + num64 += num4; + num63 -= 6f; + num64 -= 6f; + num64 -= 2f - num16 / 5f * 2f; + num63 += num10; + num64 += num11; + if (n == Main.myPlayer && Main.zoomX == 0f && Main.zoomY == 0f) + { + num63 = num3 + (float)(Main.miniMapWidth / 2); + num64 = num4 + (float)(Main.miniMapHeight / 2); + num64 -= 3f; + num63 -= 4f; + } + if (num63 > (float)(Main.miniMapX + 6) && num63 < (float)(Main.miniMapX + Main.miniMapWidth - 16) && num64 > (float)(Main.miniMapY + 6) && num64 < (float)(Main.miniMapY + Main.miniMapHeight - 14)) + { + this.DrawPlayerHead(Main.player[n], num63, num64, (float)b / 255f, num55); + if (n != Main.myPlayer) + { + float num65 = num63 + 4f - 14f * num55; + float num66 = num64 + 2f - 14f * num55; + float num67 = num65 + 28f * num55; + float num68 = num66 + 28f * num55; + if ((float)Main.mouseX >= num65 && (float)Main.mouseX <= num67 && (float)Main.mouseY >= num66 && (float)Main.mouseY <= num68) + { + cursorText = Main.player[n].name; + } + } + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(); + this.spriteBatch.Draw(Main.miniMapFrameTexture, new Vector2(num53, num54), new Rectangle?(new Rectangle(0, 0, Main.miniMapFrameTexture.Width, Main.miniMapFrameTexture.Height)), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + for (int num69 = 0; num69 < 3; num69++) + { + float num70 = num53 + 148f + (float)(num69 * 26); + float num71 = num54 + 234f; + if ((float)Main.mouseX > num70 && (float)Main.mouseX < num70 + 22f && (float)Main.mouseY > num71 && (float)Main.mouseY < num71 + 22f) + { + Main.player[Main.myPlayer].mouseInterface = true; + this.spriteBatch.Draw(Main.miniMapButtonTexture[num69], new Vector2(num70, num71), new Rectangle?(new Rectangle(0, 0, Main.miniMapButtonTexture[num69].Width, Main.miniMapButtonTexture[num69].Height)), Color.White, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + if (Main.mouseLeft) + { + if (Main.mouseLeftRelease) + { + Main.PlaySound(12, -1, -1, 1); + } + if (num69 == 0) + { + Main.mapMinimapScale = 1.25f; + } + else + { + if (num69 == 1) + { + Main.mapMinimapScale *= 0.975f; + } + else + { + if (num69 == 2) + { + Main.mapMinimapScale *= 1.025f; + } + } + } + } + } + } + } + } + if (Main.mapFullscreen) + { + int num72 = (int)((-num + (float)Main.mouseX) / num16 + num6); + int num73 = (int)((-num2 + (float)Main.mouseY) / num16 + num7); + bool flag2 = false; + if ((float)num72 < num6) + { + flag2 = true; + } + if ((float)num72 >= num8) + { + flag2 = true; + } + if ((float)num73 < num7) + { + flag2 = true; + } + if ((float)num73 >= num9) + { + flag2 = true; + } + if (!flag2 && Main.map[num72, num73] != null && Main.map[num72, num73].active()) + { + int type = (int)Main.map[num72, num73].type; + if (type == 105) + { + if (Main.map[num72, num73].option() == 2) + { + cursorText = "Vase"; + } + else + { + cursorText = Main.tileName[type]; + } + } + else + { + if (type == 240) + { + if (Main.map[num72, num73].option() == 0) + { + cursorText = "Trophy"; + } + else + { + if (Main.map[num72, num73].option() == 2) + { + cursorText = Main.npcName[21]; + } + else + { + cursorText = Main.tileName[type]; + } + } + } + else + { + if (type == 241) + { + if (Main.map[num72, num73].option() == 0) + { + cursorText = Main.itemName[1417]; + } + else + { + cursorText = Main.tileName[type]; + } + } + else + { + if (Main.tileName[type] != null && Main.tileName[type] != "") + { + cursorText = Main.tileName[type]; + } + else + { + if (type == 178) + { + if (Main.map[num72, num73].option() == 0) + { + cursorText = Main.itemName[181]; + } + if (Main.map[num72, num73].option() == 1) + { + cursorText = Main.itemName[180]; + } + if (Main.map[num72, num73].option() == 2) + { + cursorText = Main.itemName[177]; + } + if (Main.map[num72, num73].option() == 3) + { + cursorText = Main.itemName[179]; + } + if (Main.map[num72, num73].option() == 4) + { + cursorText = Main.itemName[178]; + } + if (Main.map[num72, num73].option() == 5) + { + cursorText = Main.itemName[182]; + } + if (Main.map[num72, num73].option() == 6) + { + cursorText = Main.itemName[999]; + } + } + else + { + if (type == 82 || type == 83 || type == 84) + { + if (Main.map[num72, num73].option() == 0) + { + cursorText = Main.itemName[313]; + } + if (Main.map[num72, num73].option() == 1) + { + cursorText = Main.itemName[314]; + } + if (Main.map[num72, num73].option() == 2) + { + cursorText = Main.itemName[315]; + } + if (Main.map[num72, num73].option() == 3) + { + cursorText = Main.itemName[316]; + } + if (Main.map[num72, num73].option() == 4) + { + cursorText = Main.itemName[317]; + } + if (Main.map[num72, num73].option() == 5) + { + cursorText = Main.itemName[318]; + } + } + else + { + if (type == 227) + { + cursorText = Main.itemName[1107 + (int)Main.map[num72, num73].option()]; + } + } + } + } + } + } + } + } + float num74 = (num16 * 0.25f * 2f + 1f) / 3f; + if (num74 > 1f) + { + num74 = 1f; + } + for (int num75 = 0; num75 < 200; num75++) + { + if (Main.npc[num75].active && Main.npc[num75].townNPC) + { + int num76 = NPC.TypeToNum(Main.npc[num75].type); + if (num76 > 0) + { + SpriteEffects effects3 = SpriteEffects.None; + if (Main.npc[num75].direction > 0) + { + effects3 = SpriteEffects.FlipHorizontally; + } + float num77 = (Main.npc[num75].position.X + (float)(Main.npc[num75].width / 2)) / 16f * num16; + float num78 = (Main.npc[num75].position.Y + Main.npc[num75].gfxOffY + (float)(Main.npc[num75].height / 2)) / 16f * num16; + num77 += num; + num78 += num2; + num77 -= 10f * num16; + num78 -= 10f * num16; + this.spriteBatch.Draw(Main.npcHeadTexture[num76], new Vector2(num77, num78), new Rectangle?(new Rectangle(0, 0, Main.npcHeadTexture[num76].Width, Main.npcHeadTexture[num76].Height)), new Color((int)b, (int)b, (int)b, (int)b), 0f, new Vector2((float)(Main.npcHeadTexture[num76].Width / 2), (float)(Main.npcHeadTexture[num76].Height / 2)), num74, effects3, 0f); + float num79 = num77 - (float)(Main.npcHeadTexture[num76].Width / 2) * num74; + float num80 = num78 - (float)(Main.npcHeadTexture[num76].Height / 2) * num74; + float num81 = num79 + (float)Main.npcHeadTexture[num76].Width * num74; + float num82 = num80 + (float)Main.npcHeadTexture[num76].Height * num74; + if ((float)Main.mouseX >= num79 && (float)Main.mouseX <= num81 && (float)Main.mouseY >= num80 && (float)Main.mouseY <= num82) + { + string text2; + if (num76 == 11) + { + text2 = Main.npc[num75].displayName; + } + else + { + text2 = Main.npc[num75].displayName + " the " + Main.npc[num75].name; + } + cursorText = text2; + } + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + for (int num83 = 0; num83 < 255; num83++) + { + if (Main.player[num83].active && !Main.player[num83].dead) + { + float num84 = ((Main.player[num83].position.X + (float)(Main.player[num83].width / 2)) / 16f - num12) * num16; + float num85 = ((Main.player[num83].position.Y + Main.player[num83].gfxOffY + (float)(Main.player[num83].height / 2)) / 16f - num13) * num16; + num84 += num; + num85 += num2; + num84 -= 6f; + num85 -= 2f; + num85 -= 2f - num16 / 5f * 2f; + num84 -= 10f * num16; + num85 -= 10f * num16; + this.DrawPlayerHead(Main.player[num83], num84, num85, (float)b / 255f, num74); + float num86 = num84 + 4f - 14f * num74; + float num87 = num85 + 2f - 14f * num74; + float num88 = num86 + 28f * num74; + float num89 = num87 + 28f * num74; + if ((float)Main.mouseX >= num86 && (float)Main.mouseX <= num88 && (float)Main.mouseY >= num87 && (float)Main.mouseY <= num89) + { + cursorText = Main.player[num83].name; + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(); + int num90 = 10; + int num91 = Main.screenHeight - 40; + int num92 = 0; + int num93 = 130; + if (Main.mouseX >= num90 && Main.mouseX <= num90 + 32 && Main.mouseY >= num91 && Main.mouseY <= num91 + 30) + { + num93 = 255; + num92 += 4; + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(10, -1, -1, 1); + Main.mapFullscreen = false; + } + } + this.spriteBatch.Draw(this.mapIconTexture[num92], new Vector2((float)num90, (float)num91), new Rectangle?(new Rectangle(0, 0, this.mapIconTexture[num92].Width, this.mapIconTexture[num92].Height)), new Color(num93, num93, num93, num93), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.cursorTexture, new Vector2((float)(Main.mouseX + 1), (float)(Main.mouseY + 1)), new Rectangle?(new Rectangle(0, 0, Main.cursorTexture.Width, Main.cursorTexture.Height)), new Color((int)((float)Main.cursorColor.R * 0.2f), (int)((float)Main.cursorColor.G * 0.2f), (int)((float)Main.cursorColor.B * 0.2f), (int)((float)Main.cursorColor.A * 0.5f)), 0f, default(Vector2), Main.cursorScale * 1.1f, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.cursorTexture, new Vector2((float)Main.mouseX, (float)Main.mouseY), new Rectangle?(new Rectangle(0, 0, Main.cursorTexture.Width, Main.cursorTexture.Height)), Main.cursorColor, 0f, default(Vector2), Main.cursorScale, SpriteEffects.None, 0f); + } + if (cursorText != "") + { + this.MouseText(cursorText, 0, 0); + } + } + protected void RenderTiles() + { + if (Main.drawToScreen) + { + return; + } + this.RenderBlack(); + base.GraphicsDevice.SetRenderTarget(this.tileTarget); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + if (Main.ignoreErrors) + { + try + { + this.DrawTiles(true); + goto IL_58; + } + catch + { + goto IL_58; + } + } + this.DrawTiles(true); + IL_58: + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + protected void RenderTiles2() + { + if (Main.drawToScreen) + { + return; + } + base.GraphicsDevice.SetRenderTarget(this.tile2Target); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + if (Main.ignoreErrors) + { + try + { + this.DrawTiles(false); + goto IL_52; + } + catch + { + goto IL_52; + } + } + this.DrawTiles(false); + IL_52: + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + protected void RenderWater() + { + if (Main.drawToScreen) + { + return; + } + base.GraphicsDevice.SetRenderTarget(this.waterTarget); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + try + { + this.drawWaters(false); + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].mech) + { + this.DrawWires(); + } + } + catch + { + } + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + protected bool FullTile(int x, int y) + { + if (Main.tile[x - 1, y].halfBrick() || Main.tile[x - 1, y].slope() != 0) + { + return false; + } + if (Main.tile[x + 1, y].halfBrick() || Main.tile[x + 1, y].slope() != 0) + { + return false; + } + if (Main.tile[x, y].active() && Main.tileSolid[(int)Main.tile[x, y].type] && !Main.tileSolidTop[(int)Main.tile[x, y].type] && Main.tile[x, y].type != 10 && Main.tile[x, y].type != 54 && Main.tile[x, y].type != 138 && Main.tile[x, y].type != 191) + { + int frameX = (int)Main.tile[x, y].frameX; + int frameY = (int)Main.tile[x, y].frameY; + if (frameY == 18) + { + if (frameX >= 18 && frameX <= 54) + { + return true; + } + if (frameX >= 108 && frameX <= 144) + { + return true; + } + } + else + { + if (frameY >= 90 && frameY <= 196) + { + if (frameX <= 70) + { + return true; + } + if (frameX >= 144 && frameX <= 232) + { + return true; + } + } + } + } + return false; + } + protected void DrawBlack() + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + Vector2 value = new Vector2((float)Main.offScreenRange, (float)Main.offScreenRange); + if (Main.drawToScreen) + { + value = default(Vector2); + } + int num = (int)((Main.tileColor.R + Main.tileColor.G + Main.tileColor.B) / 3); + float num2 = (float)((double)num * 0.4) / 255f; + if (Lighting.lightMode == 2) + { + num2 = (float)(Main.tileColor.R - 55) / 255f; + if (num2 < 0f) + { + num2 = 0f; + } + } + else + { + if (Lighting.lightMode == 3) + { + num2 = (float)(num - 55) / 255f; + if (num2 < 0f) + { + num2 = 0f; + } + } + } + int num3 = (int)((Main.screenPosition.X - value.X) / 16f - 1f); + int num4 = (int)((Main.screenPosition.X + (float)Main.screenWidth + value.X) / 16f) + 2; + int num5 = (int)((Main.screenPosition.Y - value.Y) / 16f - 1f); + int num6 = (int)((Main.screenPosition.Y + (float)Main.screenHeight + value.Y) / 16f) + 5; + int num7 = Main.offScreenRange / 16; + int num8 = Main.offScreenRange / 16; + if (num3 - num7 < 0) + { + num3 = num7; + } + if (num4 + num7 > Main.maxTilesX) + { + num4 = Main.maxTilesX - num7; + } + if (num5 - num8 < 0) + { + num5 = num8; + } + if (num6 + num8 > Main.maxTilesY) + { + num6 = Main.maxTilesY - num8; + } + for (int i = num5 - num8; i < num6 + num8; i++) + { + if ((double)i <= Main.worldSurface) + { + for (int j = num3 - num7; j < num4 + num7; j++) + { + if (Main.tile[j, i] == null) + { + Main.tile[j, i] = new Tile(); + } + if (Lighting.Brightness(j, i) <= num2 && (Main.tile[j, i].liquid < 250 || WorldGen.SolidTile(j, i) || (Main.tile[j, i].liquid > 250 && Lighting.Brightness(j, i) == 0f)) && (Main.tile[j, i].wall < 88 || Main.tile[j, i].wall > 92 || (Main.tile[j, i].active() && Main.tileBlockLight[(int)Main.tile[j, i].type]))) + { + int num9 = j; + j++; + while (Main.tile[j, i] != null && Lighting.Brightness(j, i) < num2 && (Main.tile[j, i].liquid < 250 || WorldGen.SolidTile(j, i) || (Main.tile[j, i].liquid > 250 && Lighting.Brightness(j, i) == 0f))) + { + j++; + if (j >= num4 + num7) + { + break; + } + } + j--; + int width = (j - num9 + 1) * 16; + this.spriteBatch.Draw(Main.blackTileTexture, new Vector2((float)(num9 * 16 - (int)Main.screenPosition.X), (float)(i * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(new Rectangle(0, 0, width, 16)), Color.Black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + Main.renderTimer[5] = (float)stopwatch.ElapsedMilliseconds; + } + protected void RenderBlack() + { + if (Main.drawToScreen) + { + return; + } + base.GraphicsDevice.SetRenderTarget(this.blackTarget); + base.GraphicsDevice.DepthStencilState = new DepthStencilState + { + DepthBufferEnable = true + }; + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + this.DrawBlack(); + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + protected void DrawWalls() + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int num = (int)(255f * (1f - Main.gfxQuality) + 100f * Main.gfxQuality); + int num2 = (int)(120f * (1f - Main.gfxQuality) + 40f * Main.gfxQuality); + Vector2 value = new Vector2((float)Main.offScreenRange, (float)Main.offScreenRange); + if (Main.drawToScreen) + { + value = default(Vector2); + } + int num3 = (int)((Main.tileColor.R + Main.tileColor.G + Main.tileColor.B) / 3); + float num4 = (float)((double)num3 * 0.53) / 255f; + if (Lighting.lightMode == 2) + { + num4 = (float)(Main.tileColor.R - 12) / 255f; + } + if (Lighting.lightMode == 3) + { + num4 = (float)(num3 - 12) / 255f; + } + int num5 = (int)((Main.screenPosition.X - value.X) / 16f - 1f); + int num6 = (int)((Main.screenPosition.X + (float)Main.screenWidth + value.X) / 16f) + 2; + int num7 = (int)((Main.screenPosition.Y - value.Y) / 16f - 1f); + int num8 = (int)((Main.screenPosition.Y + (float)Main.screenHeight + value.Y) / 16f) + 5; + int num9 = Main.offScreenRange / 16; + int num10 = Main.offScreenRange / 16; + if (num5 - num9 < 0) + { + num5 = num9; + } + if (num6 + num9 > Main.maxTilesX) + { + num6 = Main.maxTilesX - num9; + } + if (num7 - num10 < 0) + { + num7 = num10; + } + if (num8 + num10 > Main.maxTilesY) + { + num8 = Main.maxTilesY - num10; + } + for (int i = num7 - num10; i < num8 + num10; i++) + { + if ((double)i <= Main.worldSurface) + { + for (int j = num5 - num9; j < num6 + num9; j++) + { + if (Main.tile[j, i] == null) + { + Main.tile[j, i] = new Tile(); + } + if (Lighting.Brightness(j, i) < num4 && (Main.tile[j, i].liquid < 250 || WorldGen.SolidTile(j, i) || (Main.tile[j, i].liquid > 250 && Lighting.Brightness(j, i) == 0f)) && (Lighting.Brightness(j, i) == 0f || Main.tile[j, i].wall < 88 || Main.tile[j, i].wall > 93)) + { + this.spriteBatch.Draw(Main.blackTileTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X), (float)(i * 16 - (int)Main.screenPosition.Y)) + value, Lighting.GetBlackness(j, i)); + } + } + } + } + for (int k = num7 - num10; k < num8 + num10; k++) + { + for (int l = num5 - num9; l < num6 + num9; l++) + { + if (Main.tile[l, k] == null) + { + Main.tile[l, k] = new Tile(); + } + if (Main.tile[l, k].wall > 0 && Lighting.Brightness(l, k) > 0f && !this.FullTile(l, k)) + { + this.LoadWall((int)Main.tile[l, k].wall); + Color color = Lighting.GetColor(l, k); + if (Lighting.lightMode < 2 && !Main.wallLight[(int)Main.tile[l, k].wall] && (Main.tile[l, k].wall < 88 || Main.tile[l, k].wall > 93) && !WorldGen.SolidTile(l, k)) + { + if ((int)color.R > num || (double)color.G > (double)num * 1.1 || (double)color.B > (double)num * 1.2) + { + for (int m = 0; m < 9; m++) + { + int num11 = 0; + int num12 = 0; + int width = 12; + int height = 12; + Color color2 = color; + Color color3 = color; + if (m == 0) + { + color3 = Lighting.GetColor(l - 1, k - 1); + } + if (m == 1) + { + width = 8; + num11 = 12; + color3 = Lighting.GetColor(l, k - 1); + } + if (m == 2) + { + color3 = Lighting.GetColor(l + 1, k - 1); + num11 = 20; + } + if (m == 3) + { + color3 = Lighting.GetColor(l - 1, k); + height = 8; + num12 = 12; + } + if (m == 4) + { + width = 8; + height = 8; + num11 = 12; + num12 = 12; + } + if (m == 5) + { + num11 = 20; + num12 = 12; + height = 8; + color3 = Lighting.GetColor(l + 1, k); + } + if (m == 6) + { + color3 = Lighting.GetColor(l - 1, k + 1); + num12 = 20; + } + if (m == 7) + { + width = 12; + num11 = 12; + num12 = 20; + color3 = Lighting.GetColor(l, k + 1); + } + if (m == 8) + { + color3 = Lighting.GetColor(l + 1, k + 1); + num11 = 20; + num12 = 20; + } + color2.R = (byte)((color.R + color3.R) / 2); + color2.G = (byte)((color.G + color3.G) / 2); + color2.B = (byte)((color.B + color3.B) / 2); + if (Main.tile[l, k].wall == 44) + { + color2.R = (byte)Main.DiscoR; + color2.G = (byte)Main.DiscoG; + color2.B = (byte)Main.DiscoB; + } + if (Main.canDrawColorWall(l, k)) + { + this.spriteBatch.Draw(Main.wallAltTexture[(int)Main.tile[l, k].wall, (int)Main.tile[l, k].wallColor()], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8 + num11), (float)(k * 16 - (int)Main.screenPosition.Y - 8 + num12)) + value, new Rectangle?(new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2) + num11, (int)(Main.tile[l, k].wallFrameY() * 2) + num12, width, height)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.wallTexture[(int)Main.tile[l, k].wall], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8 + num11), (float)(k * 16 - (int)Main.screenPosition.Y - 8 + num12)) + value, new Rectangle?(new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2) + num11, (int)(Main.tile[l, k].wallFrameY() * 2) + num12, width, height)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + else + { + if ((int)color.R > num2 || (double)color.G > (double)num2 * 1.1 || (double)color.B > (double)num2 * 1.2) + { + for (int n = 0; n < 4; n++) + { + int num13 = 0; + int num14 = 0; + Color color4 = color; + Color color5 = color; + if (n == 0) + { + if (Lighting.Brighter(l, k - 1, l - 1, k)) + { + color5 = Lighting.GetColor(l - 1, k); + } + else + { + color5 = Lighting.GetColor(l, k - 1); + } + } + if (n == 1) + { + if (Lighting.Brighter(l, k - 1, l + 1, k)) + { + color5 = Lighting.GetColor(l + 1, k); + } + else + { + color5 = Lighting.GetColor(l, k - 1); + } + num13 = 16; + } + if (n == 2) + { + if (Lighting.Brighter(l, k + 1, l - 1, k)) + { + color5 = Lighting.GetColor(l - 1, k); + } + else + { + color5 = Lighting.GetColor(l, k + 1); + } + num14 = 16; + } + if (n == 3) + { + if (Lighting.Brighter(l, k + 1, l + 1, k)) + { + color5 = Lighting.GetColor(l + 1, k); + } + else + { + color5 = Lighting.GetColor(l, k + 1); + } + num13 = 16; + num14 = 16; + } + color4.R = (byte)((color.R + color5.R) / 2); + color4.G = (byte)((color.G + color5.G) / 2); + color4.B = (byte)((color.B + color5.B) / 2); + if (Main.tile[l, k].wall == 44) + { + color4.R = (byte)Main.DiscoR; + color4.G = (byte)Main.DiscoG; + color4.B = (byte)Main.DiscoB; + } + if (Main.canDrawColorWall(l, k)) + { + this.spriteBatch.Draw(Main.wallAltTexture[(int)Main.tile[l, k].wall, (int)Main.tile[l, k].wallColor()], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8 + num13), (float)(k * 16 - (int)Main.screenPosition.Y - 8 + num14)) + value, new Rectangle?(new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2) + num13, (int)(Main.tile[l, k].wallFrameY() * 2) + num14, 16, 16)), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.wallTexture[(int)Main.tile[l, k].wall], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8 + num13), (float)(k * 16 - (int)Main.screenPosition.Y - 8 + num14)) + value, new Rectangle?(new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2) + num13, (int)(Main.tile[l, k].wallFrameY() * 2) + num14, 16, 16)), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + else + { + if (Main.tile[l, k].wall == 44) + { + Color color6 = default(Color); + color6.R = (byte)Main.DiscoR; + color6.G = (byte)Main.DiscoG; + color6.B = (byte)Main.DiscoB; + color6.A = 255; + Rectangle value2 = new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2), (int)(Main.tile[l, k].wallFrameY() * 2), 32, 32); + this.spriteBatch.Draw(Main.wallTexture[(int)Main.tile[l, k].wall], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8), (float)(k * 16 - (int)Main.screenPosition.Y - 8)) + value, new Rectangle?(value2), color6, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + Rectangle value2 = new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2), (int)(Main.tile[l, k].wallFrameY() * 2), 32, 32); + if (Main.canDrawColorWall(l, k)) + { + this.spriteBatch.Draw(Main.wallAltTexture[(int)Main.tile[l, k].wall, (int)Main.tile[l, k].wallColor()], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8), (float)(k * 16 - (int)Main.screenPosition.Y - 8)) + value, new Rectangle?(value2), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.wallTexture[(int)Main.tile[l, k].wall], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8), (float)(k * 16 - (int)Main.screenPosition.Y - 8)) + value, new Rectangle?(value2), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + else + { + if (Main.tile[l, k].wall == 44) + { + Color color7 = default(Color); + color7.R = (byte)Main.DiscoR; + color7.G = (byte)Main.DiscoG; + color7.B = (byte)Main.DiscoB; + color7.A = 255; + Rectangle value2 = new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2), (int)(Main.tile[l, k].wallFrameY() * 2), 32, 32); + this.spriteBatch.Draw(Main.wallTexture[(int)Main.tile[l, k].wall], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8), (float)(k * 16 - (int)Main.screenPosition.Y - 8)) + value, new Rectangle?(value2), color7, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + Rectangle value2 = new Rectangle((int)(Main.tile[l, k].wallFrameX() * 2), (int)(Main.tile[l, k].wallFrameY() * 2), 32, 32); + if (Main.canDrawColorWall(l, k)) + { + this.spriteBatch.Draw(Main.wallAltTexture[(int)Main.tile[l, k].wall, (int)Main.tile[l, k].wallColor()], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8), (float)(k * 16 - (int)Main.screenPosition.Y - 8)) + value, new Rectangle?(value2), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.wallTexture[(int)Main.tile[l, k].wall], new Vector2((float)(l * 16 - (int)Main.screenPosition.X - 8), (float)(k * 16 - (int)Main.screenPosition.Y - 8)) + value, new Rectangle?(value2), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + if ((double)color.R > (double)num2 * 0.4 || (double)color.G > (double)num2 * 0.35 || (double)color.B > (double)num2 * 0.3) + { + bool flag = false; + if (Main.tile[l - 1, k].wall > 0 && Main.wallBlend[(int)Main.tile[l - 1, k].wall] != Main.wallBlend[(int)Main.tile[l, k].wall]) + { + flag = true; + } + bool flag2 = false; + if (Main.tile[l + 1, k].wall > 0 && Main.wallBlend[(int)Main.tile[l + 1, k].wall] != Main.wallBlend[(int)Main.tile[l, k].wall]) + { + flag2 = true; + } + bool flag3 = false; + if (Main.tile[l, k - 1].wall > 0 && Main.wallBlend[(int)Main.tile[l, k - 1].wall] != Main.wallBlend[(int)Main.tile[l, k].wall]) + { + flag3 = true; + } + bool flag4 = false; + if (Main.tile[l, k + 1].wall > 0 && Main.wallBlend[(int)Main.tile[l, k + 1].wall] != Main.wallBlend[(int)Main.tile[l, k].wall]) + { + flag4 = true; + } + if (flag) + { + this.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float)(l * 16 - (int)Main.screenPosition.X), (float)(k * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(new Rectangle(0, 0, 2, 16)), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (flag2) + { + this.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float)(l * 16 - (int)Main.screenPosition.X + 14), (float)(k * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(new Rectangle(14, 0, 2, 16)), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (flag3) + { + this.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float)(l * 16 - (int)Main.screenPosition.X), (float)(k * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(new Rectangle(0, 0, 16, 2)), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (flag4) + { + this.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float)(l * 16 - (int)Main.screenPosition.X), (float)(k * 16 - (int)Main.screenPosition.Y + 14)) + value, new Rectangle?(new Rectangle(0, 14, 16, 2)), Lighting.GetColor(l, k), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + } + Main.renderTimer[2] = (float)stopwatch.ElapsedMilliseconds; + } + protected void RenderWalls() + { + if (Main.drawToScreen) + { + return; + } + base.GraphicsDevice.SetRenderTarget(this.wallTarget); + base.GraphicsDevice.DepthStencilState = new DepthStencilState + { + DepthBufferEnable = true + }; + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(); + if (Main.ignoreErrors) + { + try + { + this.DrawWalls(); + goto IL_69; + } + catch + { + goto IL_69; + } + } + this.DrawWalls(); + IL_69: + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + } + protected void ReleaseTargets() + { + try + { + if (!Main.dedServ) + { + Main.offScreenRange = 0; + Main.targetSet = false; + this.waterTarget.Dispose(); + this.backWaterTarget.Dispose(); + this.blackTarget.Dispose(); + this.tileTarget.Dispose(); + this.tile2Target.Dispose(); + this.wallTarget.Dispose(); + this.backgroundTarget.Dispose(); + } + } + catch + { + } + } + protected bool checkMap(int i, int j) + { + if (!Main.initMap[i, j]) + { + try + { + int width = Main.textureMax; + int height = Main.textureMax; + if (i == Main.mapTargetX - 1) + { + width = 400; + } + if (j == Main.mapTargetY - 1) + { + height = 400; + } + this.mapTarget[i, j] = new RenderTarget2D(base.GraphicsDevice, width, height, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth16, 0, RenderTargetUsage.PreserveContents); + } + catch + { + Main.mapEnabled = false; + for (int k = 0; k < Main.mapTargetX; k++) + { + for (int l = 0; l < Main.mapTargetY; l++) + { + try + { + Main.initMap[k, l] = false; + this.mapTarget[k, l].Dispose(); + } + catch + { + } + } + } + return false; + } + Main.initMap[i, j] = true; + return true; + } + return true; + } + protected void InitMap() + { + int num = Main.mapTargetX; + int num2 = Main.mapTargetY; + if (Main.mapEnabled) + { + try + { + for (int i = 0; i < num; i++) + { + for (int j = 0; j < num2; j++) + { + this.mapTarget[i, j] = new RenderTarget2D(base.GraphicsDevice, Main.textureMax, Main.textureMax, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + } + } + Main.mapInit = true; + } + catch + { + Main.mapEnabled = false; + for (int k = 0; k < num; k++) + { + for (int l = 0; l < num2; l++) + { + try + { + if (this.mapTarget[k, l] != null) + { + this.mapTarget[k, l].Dispose(); + } + } + catch + { + } + } + } + } + } + } + protected void InitTargets() + { + try + { + if (!Main.dedServ) + { + Main.offScreenRange = 192; + Main.targetSet = true; + if (base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2 > 2048) + { + Main.offScreenRange = (2048 - base.GraphicsDevice.PresentationParameters.BackBufferWidth) / 2; + } + this.waterTarget = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.backWaterTarget = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.blackTarget = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.tileTarget = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.tile2Target = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.wallTarget = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.backgroundTarget = new RenderTarget2D(base.GraphicsDevice, base.GraphicsDevice.PresentationParameters.BackBufferWidth + Main.offScreenRange * 2, base.GraphicsDevice.PresentationParameters.BackBufferHeight + Main.offScreenRange * 2, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + } + } + catch + { + Lighting.lightMode = 2; + Main.mapEnabled = false; + this.SaveSettings(); + try + { + this.ReleaseTargets(); + } + catch + { + } + } + } + protected void DrawWires() + { + float arg_05_0 = Main.gfxQuality; + float arg_0B_0 = Main.gfxQuality; + Vector2 value = new Vector2((float)Main.offScreenRange, (float)Main.offScreenRange); + if (Main.drawToScreen) + { + value = default(Vector2); + } + int num = (int)((Main.screenPosition.X - value.X) / 16f - 1f); + int num2 = (int)((Main.screenPosition.X + (float)Main.screenWidth + value.X) / 16f) + 2; + int num3 = (int)((Main.screenPosition.Y - value.Y) / 16f - 1f); + int num4 = (int)((Main.screenPosition.Y + (float)Main.screenHeight + value.Y) / 16f) + 5; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + for (int i = num3; i < num4; i++) + { + for (int j = num; j < num2; j++) + { + if (Main.tile[j, i].wire() && Lighting.Brightness(j, i) > 0f) + { + Rectangle value2 = new Rectangle(0, 0, 16, 16); + bool flag = Main.tile[j, i - 1].wire(); + bool flag2 = Main.tile[j, i + 1].wire(); + bool flag3 = Main.tile[j - 1, i].wire(); + bool flag4 = Main.tile[j + 1, i].wire(); + if (flag) + { + if (flag2) + { + if (flag3) + { + if (flag4) + { + value2 = new Rectangle(18, 18, 16, 16); + } + else + { + value2 = new Rectangle(54, 0, 16, 16); + } + } + else + { + if (flag4) + { + value2 = new Rectangle(36, 0, 16, 16); + } + else + { + value2 = new Rectangle(0, 0, 16, 16); + } + } + } + else + { + if (flag3) + { + if (flag4) + { + value2 = new Rectangle(0, 18, 16, 16); + } + else + { + value2 = new Rectangle(54, 18, 16, 16); + } + } + else + { + if (flag4) + { + value2 = new Rectangle(36, 18, 16, 16); + } + else + { + value2 = new Rectangle(36, 36, 16, 16); + } + } + } + } + else + { + if (flag2) + { + if (flag3) + { + if (flag4) + { + value2 = new Rectangle(72, 0, 16, 16); + } + else + { + value2 = new Rectangle(72, 18, 16, 16); + } + } + else + { + if (flag4) + { + value2 = new Rectangle(0, 36, 16, 16); + } + else + { + value2 = new Rectangle(18, 36, 16, 16); + } + } + } + else + { + if (flag3) + { + if (flag4) + { + value2 = new Rectangle(18, 0, 16, 16); + } + else + { + value2 = new Rectangle(54, 36, 16, 16); + } + } + else + { + if (flag4) + { + value2 = new Rectangle(72, 36, 16, 16); + } + else + { + value2 = new Rectangle(0, 54, 16, 16); + } + } + } + } + Color color = Lighting.GetColor(j, i); + this.spriteBatch.Draw(Main.wireTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X), (float)(i * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(value2), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.tile[j, i].wire2() && Lighting.Brightness(j, i) > 0f) + { + Rectangle value3 = new Rectangle(0, 0, 16, 16); + bool flag5 = Main.tile[j, i - 1].wire2(); + bool flag6 = Main.tile[j, i + 1].wire2(); + bool flag7 = Main.tile[j - 1, i].wire2(); + bool flag8 = Main.tile[j + 1, i].wire2(); + if (flag5) + { + if (flag6) + { + if (flag7) + { + if (flag8) + { + value3 = new Rectangle(18, 18, 16, 16); + } + else + { + value3 = new Rectangle(54, 0, 16, 16); + } + } + else + { + if (flag8) + { + value3 = new Rectangle(36, 0, 16, 16); + } + else + { + value3 = new Rectangle(0, 0, 16, 16); + } + } + } + else + { + if (flag7) + { + if (flag8) + { + value3 = new Rectangle(0, 18, 16, 16); + } + else + { + value3 = new Rectangle(54, 18, 16, 16); + } + } + else + { + if (flag8) + { + value3 = new Rectangle(36, 18, 16, 16); + } + else + { + value3 = new Rectangle(36, 36, 16, 16); + } + } + } + } + else + { + if (flag6) + { + if (flag7) + { + if (flag8) + { + value3 = new Rectangle(72, 0, 16, 16); + } + else + { + value3 = new Rectangle(72, 18, 16, 16); + } + } + else + { + if (flag8) + { + value3 = new Rectangle(0, 36, 16, 16); + } + else + { + value3 = new Rectangle(18, 36, 16, 16); + } + } + } + else + { + if (flag7) + { + if (flag8) + { + value3 = new Rectangle(18, 0, 16, 16); + } + else + { + value3 = new Rectangle(54, 36, 16, 16); + } + } + else + { + if (flag8) + { + value3 = new Rectangle(72, 36, 16, 16); + } + else + { + value3 = new Rectangle(0, 54, 16, 16); + } + } + } + } + Color color2 = Lighting.GetColor(j, i); + int num5 = 1; + if (Main.tile[j, i].wire()) + { + num5++; + } + float num6 = 1f / (float)num5; + byte r = (byte)((float)color2.R * num6); + byte g = (byte)((float)color2.G * num6); + byte b = (byte)((float)color2.B * num6); + byte b2 = (byte)((float)color2.A * num6); + color2 = new Color((int)r, (int)g, (int)b, (int)b2); + this.spriteBatch.Draw(Main.wire2Texture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X), (float)(i * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(value3), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.tile[j, i].wire3() && Lighting.Brightness(j, i) > 0f) + { + Rectangle value4 = new Rectangle(0, 0, 16, 16); + bool flag9 = Main.tile[j, i - 1].wire3(); + bool flag10 = Main.tile[j, i + 1].wire3(); + bool flag11 = Main.tile[j - 1, i].wire3(); + bool flag12 = Main.tile[j + 1, i].wire3(); + if (flag9) + { + if (flag10) + { + if (flag11) + { + if (flag12) + { + value4 = new Rectangle(18, 18, 16, 16); + } + else + { + value4 = new Rectangle(54, 0, 16, 16); + } + } + else + { + if (flag12) + { + value4 = new Rectangle(36, 0, 16, 16); + } + else + { + value4 = new Rectangle(0, 0, 16, 16); + } + } + } + else + { + if (flag11) + { + if (flag12) + { + value4 = new Rectangle(0, 18, 16, 16); + } + else + { + value4 = new Rectangle(54, 18, 16, 16); + } + } + else + { + if (flag12) + { + value4 = new Rectangle(36, 18, 16, 16); + } + else + { + value4 = new Rectangle(36, 36, 16, 16); + } + } + } + } + else + { + if (flag10) + { + if (flag11) + { + if (flag12) + { + value4 = new Rectangle(72, 0, 16, 16); + } + else + { + value4 = new Rectangle(72, 18, 16, 16); + } + } + else + { + if (flag12) + { + value4 = new Rectangle(0, 36, 16, 16); + } + else + { + value4 = new Rectangle(18, 36, 16, 16); + } + } + } + else + { + if (flag11) + { + if (flag12) + { + value4 = new Rectangle(18, 0, 16, 16); + } + else + { + value4 = new Rectangle(54, 36, 16, 16); + } + } + else + { + if (flag12) + { + value4 = new Rectangle(72, 36, 16, 16); + } + else + { + value4 = new Rectangle(0, 54, 16, 16); + } + } + } + } + Color color3 = Lighting.GetColor(j, i); + int num7 = 1; + if (Main.tile[j, i].wire()) + { + num7++; + } + if (Main.tile[j, i].wire2()) + { + num7++; + } + float num8 = 1f / (float)num7; + byte r2 = (byte)((float)color3.R * num8); + byte g2 = (byte)((float)color3.G * num8); + byte b3 = (byte)((float)color3.B * num8); + byte b4 = (byte)((float)color3.A * num8); + color3 = new Color((int)r2, (int)g2, (int)b3, (int)b4); + this.spriteBatch.Draw(Main.wire3Texture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X), (float)(i * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(value4), color3, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.tile[j, i].actuator() && Lighting.Brightness(j, i) > 0f) + { + Color color4 = Lighting.GetColor(j, i); + this.spriteBatch.Draw(Main.actuatorTexture, new Vector2((float)(j * 16 - (int)Main.screenPosition.X), (float)(i * 16 - (int)Main.screenPosition.Y)) + value, new Rectangle?(new Rectangle(0, 0, Main.actuatorTexture.Width, Main.actuatorTexture.Height)), color4, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + } + public static void FindWaterfalls() + { + Main.waterfallDist = (int)(75f * Main.gfxQuality) + 25; + Main.wfTileMax = (int)(175f * Main.gfxQuality) + 25; + int num = 160; + Main.wfTileNum = 0; + int num2 = (int)(Main.screenPosition.X / 16f - 1f); + int num3 = (int)((Main.screenPosition.X + (float)Main.screenWidth) / 16f) + 2; + int num4 = (int)(Main.screenPosition.Y / 16f - 1f); + int num5 = (int)((Main.screenPosition.Y + (float)Main.screenHeight) / 16f) + 2; + num2 -= Main.waterfallDist; + num3 += Main.waterfallDist; + num4 -= Main.waterfallDist; + num5 += 20; + if (num2 < 0) + { + num2 = 0; + } + if (num3 > Main.maxTilesX) + { + num3 = Main.maxTilesX; + } + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesY) + { + num5 = Main.maxTilesY; + } + for (int i = num2; i < num3; i++) + { + for (int j = num4; j < num5; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + if (Main.tile[i, j].halfBrick() && (Main.tile[i, j - 1].liquid < 16 || WorldGen.SolidTile(i, j - 1))) + { + if (Main.tile[i - 1, j] == null) + { + return; + } + if (Main.tile[i + 1, j] == null) + { + return; + } + if (((int)Main.tile[i - 1, j].liquid > num || (int)Main.tile[i + 1, j].liquid > num) && ((Main.tile[i - 1, j].liquid == 0 && !WorldGen.SolidTile(i - 1, j) && Main.tile[i - 1, j].slope() == 0) || (Main.tile[i + 1, j].liquid == 0 && !WorldGen.SolidTile(i + 1, j) && Main.tile[i + 1, j].slope() == 0)) && Main.wfTileNum < Main.wfTileMax) + { + Main.wfTileType[Main.wfTileNum] = 0; + if (Main.tile[i, j - 1].lava()) + { + Main.wfTileType[Main.wfTileNum] = 1; + } + if (Main.tile[i + 1, j].lava()) + { + Main.wfTileType[Main.wfTileNum] = 1; + } + if (Main.tile[i - 1, j].lava()) + { + Main.wfTileType[Main.wfTileNum] = 1; + } + if (Main.tile[i, j - 1].honey()) + { + Main.wfTileType[Main.wfTileNum] = 14; + } + if (Main.tile[i + 1, j].honey()) + { + Main.wfTileType[Main.wfTileNum] = 14; + } + if (Main.tile[i - 1, j].honey()) + { + Main.wfTileType[Main.wfTileNum] = 14; + } + Main.wfTileX[Main.wfTileNum] = i; + Main.wfTileY[Main.wfTileNum] = j; + Main.wfTileNum++; + } + } + if (Main.tile[i, j].type == 196 && !WorldGen.SolidTile(i, j + 1) && Main.wfTileNum < Main.wfTileMax) + { + Main.wfTileType[Main.wfTileNum] = 11; + Main.wfTileX[Main.wfTileNum] = i; + Main.wfTileY[Main.wfTileNum] = j + 1; + Main.wfTileNum++; + } + } + } + } + } + protected void drawWaterfalls() + { + Main.drewLava = false; + if (Main.liquidAlpha[0] > 0f) + { + this.DrawWaterfall(0, Main.liquidAlpha[0]); + } + if (Main.liquidAlpha[2] > 0f) + { + this.DrawWaterfall(3, Main.liquidAlpha[2]); + } + if (Main.liquidAlpha[3] > 0f) + { + this.DrawWaterfall(4, Main.liquidAlpha[3]); + } + if (Main.liquidAlpha[4] > 0f) + { + this.DrawWaterfall(5, Main.liquidAlpha[4]); + } + if (Main.liquidAlpha[5] > 0f) + { + this.DrawWaterfall(6, Main.liquidAlpha[5]); + } + if (Main.liquidAlpha[6] > 0f) + { + this.DrawWaterfall(7, Main.liquidAlpha[6]); + } + if (Main.liquidAlpha[7] > 0f) + { + this.DrawWaterfall(8, Main.liquidAlpha[7]); + } + if (Main.liquidAlpha[8] > 0f) + { + this.DrawWaterfall(9, Main.liquidAlpha[8]); + } + if (Main.liquidAlpha[9] > 0f) + { + this.DrawWaterfall(10, Main.liquidAlpha[9]); + } + if (Main.liquidAlpha[10] > 0f) + { + this.DrawWaterfall(13, Main.liquidAlpha[10]); + } + } + protected void drawWaters(bool bg = false) + { + if (!bg) + { + if (Main.bgStyle == 1 || (Main.bgStyle == 5 && Main.evilTiles > Main.holyTiles)) + { + Main.waterStyle = 2; + } + else + { + if (Main.bgStyle == 3) + { + Main.waterStyle = 3; + } + else + { + if (Main.bgStyle == 8) + { + Main.waterStyle = 10; + } + else + { + if (Main.bgStyle == 6 || (Main.bgStyle == 5 && Main.evilTiles < Main.holyTiles)) + { + Main.waterStyle = 4; + } + else + { + if (Main.bgStyle == 7) + { + Main.waterStyle = 5; + } + else + { + if (Main.bgStyle == 2) + { + Main.waterStyle = 6; + } + else + { + if ((double)(Main.screenPosition.Y / 16f) > Main.rockLayer + 40.0) + { + if (Main.shroomTiles > 300) + { + Main.waterStyle = 7; + } + else + { + Main.waterStyle = 8; + } + } + else + { + if ((double)(Main.screenPosition.Y / 16f) > Main.worldSurface) + { + Main.waterStyle = 7; + } + else + { + Main.waterStyle = 0; + } + } + } + } + } + } + } + } + if (Main.bgStyle != 4 && Main.bloodMoon && !Main.dayTime) + { + Main.waterStyle = 9; + } + if (Main.fountainColor >= 0) + { + Main.waterStyle = Main.fountainColor; + } + if (Main.waterStyle == 0) + { + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[0] += 0.2f; + if (Main.liquidAlpha[0] > 1f) + { + Main.liquidAlpha[0] = 1f; + } + } + if (Main.waterStyle == 2) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[2] += 0.2f; + if (Main.liquidAlpha[2] > 1f) + { + Main.liquidAlpha[2] = 1f; + } + } + if (Main.waterStyle == 3) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[3] += 0.2f; + if (Main.liquidAlpha[3] > 1f) + { + Main.liquidAlpha[3] = 1f; + } + } + if (Main.waterStyle == 4) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[4] += 0.2f; + if (Main.liquidAlpha[4] > 1f) + { + Main.liquidAlpha[4] = 1f; + } + } + if (Main.waterStyle == 5) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[5] += 0.2f; + if (Main.liquidAlpha[5] > 1f) + { + Main.liquidAlpha[5] = 1f; + } + } + if (Main.waterStyle == 6) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[6] += 0.2f; + if (Main.liquidAlpha[6] > 1f) + { + Main.liquidAlpha[6] = 1f; + } + } + if (Main.waterStyle == 7) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[7] += 0.2f; + if (Main.liquidAlpha[7] > 1f) + { + Main.liquidAlpha[7] = 1f; + } + } + if (Main.waterStyle == 8) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[8] += 0.2f; + if (Main.liquidAlpha[8] > 1f) + { + Main.liquidAlpha[8] = 1f; + } + } + if (Main.waterStyle == 9) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[10] -= 0.2f; + if (Main.liquidAlpha[10] < 0f) + { + Main.liquidAlpha[10] = 0f; + } + Main.liquidAlpha[9] += 0.2f; + if (Main.liquidAlpha[9] > 1f) + { + Main.liquidAlpha[9] = 1f; + } + } + if (Main.waterStyle == 10) + { + Main.liquidAlpha[0] -= 0.2f; + if (Main.liquidAlpha[0] < 0f) + { + Main.liquidAlpha[0] = 0f; + } + Main.liquidAlpha[2] -= 0.2f; + if (Main.liquidAlpha[2] < 0f) + { + Main.liquidAlpha[2] = 0f; + } + Main.liquidAlpha[3] -= 0.2f; + if (Main.liquidAlpha[3] < 0f) + { + Main.liquidAlpha[3] = 0f; + } + Main.liquidAlpha[4] -= 0.2f; + if (Main.liquidAlpha[4] < 0f) + { + Main.liquidAlpha[4] = 0f; + } + Main.liquidAlpha[5] -= 0.2f; + if (Main.liquidAlpha[5] < 0f) + { + Main.liquidAlpha[5] = 0f; + } + Main.liquidAlpha[6] -= 0.2f; + if (Main.liquidAlpha[6] < 0f) + { + Main.liquidAlpha[6] = 0f; + } + Main.liquidAlpha[7] -= 0.2f; + if (Main.liquidAlpha[7] < 0f) + { + Main.liquidAlpha[7] = 0f; + } + Main.liquidAlpha[8] -= 0.2f; + if (Main.liquidAlpha[8] < 0f) + { + Main.liquidAlpha[8] = 0f; + } + Main.liquidAlpha[9] -= 0.2f; + if (Main.liquidAlpha[9] < 0f) + { + Main.liquidAlpha[9] = 0f; + } + Main.liquidAlpha[10] += 0.2f; + if (Main.liquidAlpha[10] > 1f) + { + Main.liquidAlpha[10] = 1f; + } + } + } + Main.drewLava = false; + if (Main.liquidAlpha[0] > 0f) + { + if (bg) + { + this.DrawWater(bg, 0, 1f); + } + else + { + this.DrawWater(bg, 0, Main.liquidAlpha[0]); + } + } + if (Main.liquidAlpha[2] > 0f) + { + if (bg) + { + if (Main.waterStyle < 2) + { + this.DrawWater(bg, 2, Main.liquidAlpha[2]); + } + else + { + this.DrawWater(bg, 2, 1f); + } + } + else + { + this.DrawWater(bg, 2, Main.liquidAlpha[2]); + } + } + if (Main.liquidAlpha[3] > 0f) + { + if (bg) + { + if (Main.waterStyle < 3) + { + this.DrawWater(bg, 3, Main.liquidAlpha[3]); + } + else + { + this.DrawWater(bg, 3, 1f); + } + } + else + { + this.DrawWater(bg, 3, Main.liquidAlpha[3]); + } + } + if (Main.liquidAlpha[4] > 0f) + { + if (bg) + { + if (Main.waterStyle < 4) + { + this.DrawWater(bg, 4, Main.liquidAlpha[4]); + } + else + { + this.DrawWater(bg, 4, 1f); + } + } + else + { + this.DrawWater(bg, 4, Main.liquidAlpha[4]); + } + } + if (Main.liquidAlpha[5] > 0f) + { + if (bg) + { + if (Main.waterStyle < 5) + { + this.DrawWater(bg, 5, Main.liquidAlpha[5]); + } + else + { + this.DrawWater(bg, 5, 1f); + } + } + else + { + this.DrawWater(bg, 5, Main.liquidAlpha[5]); + } + } + if (Main.liquidAlpha[6] > 0f) + { + if (bg) + { + if (Main.waterStyle < 6) + { + this.DrawWater(bg, 6, Main.liquidAlpha[6]); + } + else + { + this.DrawWater(bg, 6, 1f); + } + } + else + { + this.DrawWater(bg, 6, Main.liquidAlpha[6]); + } + } + if (Main.liquidAlpha[7] > 0f) + { + if (bg) + { + if (Main.waterStyle < 7) + { + this.DrawWater(bg, 7, Main.liquidAlpha[7]); + } + else + { + this.DrawWater(bg, 7, 1f); + } + } + else + { + this.DrawWater(bg, 7, Main.liquidAlpha[7]); + } + } + if (Main.liquidAlpha[8] > 0f) + { + if (bg) + { + if (Main.waterStyle < 8) + { + this.DrawWater(bg, 8, Main.liquidAlpha[8]); + } + else + { + this.DrawWater(bg, 8, 1f); + } + } + else + { + this.DrawWater(bg, 8, Main.liquidAlpha[8]); + } + } + if (Main.liquidAlpha[9] > 0f) + { + if (bg) + { + if (Main.waterStyle < 9) + { + this.DrawWater(bg, 9, Main.liquidAlpha[9]); + } + else + { + this.DrawWater(bg, 9, 1f); + } + } + else + { + this.DrawWater(bg, 9, Main.liquidAlpha[9]); + } + } + if (Main.liquidAlpha[10] > 0f) + { + if (bg) + { + if (Main.waterStyle < 10) + { + this.DrawWater(bg, 10, Main.liquidAlpha[10]); + return; + } + this.DrawWater(bg, 10, 1f); + return; + } + else + { + this.DrawWater(bg, 10, Main.liquidAlpha[10]); + } + } + } + protected void DrawWaterfall(int Style = 0, float Alpha = 1f) + { + for (int i = 0; i < Main.wfTileNum; i++) + { + float num = 0f; + int num2 = Main.waterfallDist; + int num3 = 0; + int num4 = Main.wfTileType[i]; + int num5 = Main.wfTileX[i]; + int num6 = Main.wfTileY[i]; + int num7 = 0; + int num8 = 0; + int num9 = 0; + int num10 = 0; + int num11 = 0; + int num12 = (int)(32f * Main.wFallFrame); + if (num4 == 1 || num4 == 14) + { + num12 = (int)(32f * Main.wFallFrame2); + } + if (num4 == 11) + { + num12 = (int)(14f * Main.wFallFrame3); + } + if (num4 == 0) + { + num4 = Style; + } + if ((num4 != 1 && num4 != 2 && num4 != 11 && num4 != 14) || !Main.drewLava) + { + if (num4 == 11) + { + num2 /= 4; + if ((float)(num6 + num2) >= Main.screenPosition.Y / 16f && (float)num5 >= Main.screenPosition.X / 16f - 1f && (float)num5 <= (Main.screenPosition.X + (float)Main.screenWidth) / 16f + 1f) + { + float num13 = Main.wFallFrame3; + if (num5 % 2 == 0) + { + num13 += 3f; + } + while (num13 > 7f) + { + num13 -= 8f; + } + num12 = (int)(18f * num13); + float num14 = Main.wFallFrame4; + if (num5 % 2 == 0) + { + num14 += 2f; + } + if (num14 > 7f) + { + num14 -= 8f; + } + int x = (int)(18f * num14); + for (int j = 0; j < num2; j++) + { + if (num <= -16f) + { + num5--; + num += 16f; + } + if (num >= 16f) + { + num5++; + num -= 16f; + } + if (num6 % 2 == 0) + { + num += 1f; + } + else + { + num -= 1f; + } + Color color = Lighting.GetColor(num5, num6); + float num15 = 0.3f; + num15 *= Alpha; + if (j > num2 - 8) + { + float num16 = (float)(num2 - j) / 8f; + num15 *= num16; + } + float num17 = (float)color.R * num15; + float num18 = (float)color.G * num15; + float num19 = (float)color.B * num15; + float num20 = (float)color.A * num15; + color = new Color((int)num17, (int)num18, (int)num19, (int)num20); + SpriteEffects effects = SpriteEffects.None; + this.spriteBatch.Draw(Main.waterfallTexture[12], new Vector2((float)(num5 * 16 + 8) + num, (float)(num6 * 16 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x, 0, 16, 16)), color, 0f, new Vector2(8f, 8f), 1f, SpriteEffects.None, 0f); + color = Lighting.GetColor(num5, num6); + num15 = 0.6f; + num15 *= Alpha; + if (j > num2 - 8) + { + float num21 = (float)(num2 - j) / 8f; + num15 *= num21; + } + num17 = (float)color.R * num15; + num18 = (float)color.G * num15; + num19 = (float)color.B * num15; + num20 = (float)color.A * num15; + color = new Color((int)num17, (int)num18, (int)num19, (int)num20); + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 + 8) + num, (float)(num6 * 16 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 0, 16, 16)), color, (float)Main.rand.Next(-100, 100) * 0.001f, new Vector2(8f, 8f), 1f, effects, 0f); + num6++; + if (WorldGen.SolidTile(num5, num6) || Main.tile[num5, num6].liquid > 64) + { + break; + } + } + } + } + else + { + int num22 = 0; + for (int k = 0; k < num2; k++) + { + if (num22 < 2) + { + if (num4 == 1) + { + float num23 = 0.55f; + num23 += (float)(270 - (int)Main.mouseTextColor) / 900f; + num23 *= 0.4f; + float r = num23; + float g = num23 * 0.3f; + float num24 = num23 * 0.1f; + Lighting.addLight(num5, num6, r, g, num24); + } + else + { + if (num4 == 2) + { + float num25 = (float)Main.DiscoR / 255f; + float num26 = (float)Main.DiscoG / 255f; + float num27 = (float)Main.DiscoB / 255f; + num25 *= 0.2f; + num26 *= 0.2f; + num27 *= 0.2f; + Lighting.addLight(num5, num6, num25, num26, num27); + } + } + int num28 = (int)(Main.tile[num5, num6].liquid / 16); + int num29 = 0; + int num30 = num10; + int num31; + int num32; + if (Main.tile[num5, num6 + 1].slope() != 0) + { + if (Main.tile[num5, num6 + 1].slope() == 1) + { + num29 = 1; + num31 = 1; + num9 = 1; + num10 = num9; + } + else + { + num29 = -1; + num31 = -1; + num9 = -1; + num10 = num9; + } + num32 = 1; + } + else + { + if (((!WorldGen.SolidTile(num5, num6 + 1) || Main.tile[num5, num6 + 1].type == 162) && !Main.tile[num5, num6].halfBrick()) || (!Main.tile[num5, num6 + 1].active() && !Main.tile[num5, num6].halfBrick())) + { + num22 = 0; + num32 = 1; + num31 = 0; + } + else + { + if ((WorldGen.SolidTile(num5 - 1, num6) || Main.tile[num5 - 1, num6].slope() != 0 || Main.tile[num5 - 1, num6].liquid > 0) && !WorldGen.SolidTile(num5 + 1, num6) && Main.tile[num5 + 1, num6].liquid == 0) + { + if (num9 == -1) + { + num22++; + } + num31 = 1; + num32 = 0; + num9 = 1; + } + else + { + if ((WorldGen.SolidTile(num5 + 1, num6) || Main.tile[num5 + 1, num6].slope() != 0 || Main.tile[num5 + 1, num6].liquid > 0) && !WorldGen.SolidTile(num5 - 1, num6) && Main.tile[num5 - 1, num6].liquid == 0) + { + if (num9 == 1) + { + num22++; + } + num31 = -1; + num32 = 0; + num9 = -1; + } + else + { + if (((!WorldGen.SolidTile(num5 + 1, num6) && Main.tile[num5, num6].slope() == 0) || Main.tile[num5 + 1, num6].liquid == 0) && !WorldGen.SolidTile(num5 - 1, num6) && Main.tile[num5, num6].slope() == 0 && Main.tile[num5 - 1, num6].liquid == 0) + { + num32 = 0; + num31 = num9; + } + else + { + num22++; + num32 = 0; + num31 = 0; + } + } + } + } + } + if (num22 >= 2) + { + num9 *= -1; + num31 *= -1; + } + if (Main.tile[num5, num6 + 1].active() && Main.tile[num5, num6 + 1].type == 160) + { + num4 = 2; + } + if (Main.tile[num5, num6].active() && Main.tile[num5, num6].type == 160) + { + num4 = 2; + } + if (WorldGen.SolidTile(num5, num6 + 1) && !Main.tile[num5, num6].halfBrick()) + { + num3 = 8; + } + else + { + if (num8 != 0) + { + num3 = 0; + } + } + Color color2 = Lighting.GetColor(num5, num6); + Color color3 = color2; + float num33 = 0.6f; + if (Main.tile[num5, num6].wall == 0 && (double)num6 < Main.worldSurface) + { + num33 = 1f; + } + num33 *= Alpha; + if (num4 == 1) + { + num33 = 1f; + } + if (num4 == 14) + { + num33 = 0.8f; + } + if (k > num2 - 10) + { + float num34 = (float)(num2 - k) / 10f; + num33 *= num34; + } + float num35 = (float)color2.R * num33; + float num36 = (float)color2.G * num33; + float num37 = (float)color2.B * num33; + float num38 = (float)color2.A * num33; + if (num4 == 1) + { + if (num35 < 190f * num33) + { + num35 = 190f * num33; + } + if (num36 < 190f * num33) + { + num36 = 190f * num33; + } + if (num37 < 190f * num33) + { + num37 = 190f * num33; + } + } + else + { + if (num4 == 2) + { + num35 = (float)Main.DiscoR * num33; + num36 = (float)Main.DiscoG * num33; + num37 = (float)Main.DiscoB * num33; + } + } + color2 = new Color((int)num35, (int)num36, (int)num37, (int)num38); + if (k > 50 && (color3.R > 20 || color3.B > 20 || color3.G > 20)) + { + float num39 = (float)color3.R; + if ((float)color3.G > num39) + { + num39 = (float)color3.G; + } + if ((float)color3.B > num39) + { + num39 = (float)color3.B; + } + num39 /= 30f; + int num40 = Main.rand.Next(20000); + if ((float)num40 < num39) + { + Color newColor = new Color(255, 255, 255); + int num41 = Dust.NewDust(new Vector2((float)(num5 * 16 - num9 * 7), (float)(num6 * 16 + 6)), 10, 8, 43, 0f, 0f, 254, newColor, 0.5f); + Main.dust[num41].velocity *= 0f; + } + } + if (num7 == 0 && num29 != 0 && num8 == 1 && num9 != num10) + { + num29 = 0; + num9 = num10; + if (num9 == 1) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 - 16), (float)(num6 * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 - 16), (float)(num6 * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 8)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + } + if (num11 != 0 && num31 == 0 && num32 == 1) + { + if (num9 == 1) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 0, 16, 16 - num28 - 8)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 0, 16, 16 - num28 - 8)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + if (num3 == 8 && num8 == 1 && num11 == 0) + { + if (num10 == -1) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 8)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 - 16), (float)(num6 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 8)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + } + if (num29 != 0 && num7 == 0) + { + if (num30 == 1) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 - 16), (float)(num6 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + if (num32 == 1 && num29 == 0 && num11 == 0) + { + if (num9 == -1) + { + if (num8 == 0) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 0, 16, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + else + { + if (num8 == 0) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 0, 16, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 - 16), (float)(num6 * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(num12, 24, 32, 16 - num28)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + } + } + else + { + if (num31 == 1) + { + if (Main.tile[num5, num6].liquid <= 0 || Main.tile[num5, num6].halfBrick()) + { + if (num29 == 1) + { + for (int l = 0; l < 8; l++) + { + int num42 = l * 2; + int num43 = 14 - l * 2; + int num44 = num42; + num3 = 8; + if (num7 == 0 && l < 2) + { + num44 = 4; + } + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 + num42), (float)(num6 * 16 + num3 + num44)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num12 + num43, 0, 2, 16 - num3)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num12, 0, 16, 16)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + } + } + else + { + if (num31 == -1) + { + if (Main.tile[num5, num6].liquid <= 0 || Main.tile[num5, num6].halfBrick()) + { + if (num29 == -1) + { + for (int m = 0; m < 8; m++) + { + int num45 = m * 2; + int num46 = m * 2; + int num47 = 14 - m * 2; + num3 = 8; + if (num7 == 0 && m > 5) + { + num47 = 4; + } + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16 + num45), (float)(num6 * 16 + num3 + num47)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num12 + num46, 0, 2, 16 - num3)), color2, 0f, default(Vector2), 1f, SpriteEffects.FlipHorizontally, 0f); + } + } + else + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num12, 0, 16, 16)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + else + { + if (num31 == 0 && num32 == 0) + { + if (Main.tile[num5, num6].liquid <= 0 || Main.tile[num5, num6].halfBrick()) + { + this.spriteBatch.Draw(Main.waterfallTexture[num4], new Vector2((float)(num5 * 16), (float)(num6 * 16 + num3)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + num12, 0, 16, 16)), color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + k = 1000; + } + } + } + } + if (Main.tile[num5, num6].liquid > 0 && !Main.tile[num5, num6].halfBrick()) + { + k = 1000; + } + num8 = num32; + num10 = num9; + num7 = num31; + num5 += num31; + num6 += num32; + num11 = num29; + if ((Main.tile[num5 - 1, num6].active() && (Main.tile[num5 - 1, num6].type == 189 || Main.tile[num5 - 1, num6].type == 196)) || (Main.tile[num5 + 1, num6].active() && (Main.tile[num5 + 1, num6].type == 189 || Main.tile[num5 + 1, num6].type == 196)) || (Main.tile[num5, num6 + 1].active() && (Main.tile[num5, num6 + 1].type == 189 || Main.tile[num5, num6 + 1].type == 196))) + { + float num48 = (float)(Main.maxTilesX / 4200); + num2 = (int)(40f * num48 * Main.gfxQuality); + } + } + } + } + } + } + } + public static int GetTreeStyle(int X) + { + int num; + if (X <= Main.treeX[0]) + { + num = Main.treeStyle[0]; + } + else + { + if (X <= Main.treeX[1]) + { + num = Main.treeStyle[1]; + } + else + { + if (X <= Main.treeX[2]) + { + num = Main.treeStyle[2]; + } + else + { + num = Main.treeStyle[3]; + } + } + } + if (num == 0) + { + return 0; + } + if (num == 5) + { + return 10; + } + return 5 + num; + } + protected void lookForColorTiles() + { + int num = (int)(Main.screenPosition.X / 16f - 2f); + int num2 = (int)((Main.screenPosition.X + (float)Main.screenWidth) / 16f) + 3; + int num3 = (int)(Main.screenPosition.Y / 16f - 2f); + int num4 = (int)((Main.screenPosition.Y + (float)Main.screenHeight) / 16f) + 3; + if (num < 1) + { + num = 1; + } + if (num2 > Main.maxTilesX - 2) + { + num = Main.maxTilesX - 2; + } + for (int i = num; i < num2; i++) + { + if (i > 0) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] != null) + { + if (Main.tile[i, j].active() && Main.tile[i, j].color() > 0) + { + this.tileColorCheck((int)Main.tile[i, j].type, (int)Main.tile[i, j].color()); + } + if (Main.tile[i, j].wall > 0 && Main.tile[i, j].wallColor() > 0) + { + this.wallColorCheck((int)Main.tile[i, j].wall, (int)Main.tile[i, j].wallColor()); + } + } + } + } + } + for (int k = 0; k < Main.numTreeStyles; k++) + { + for (int l = 0; l < Main.numTileColors; l++) + { + if (Main.checkTreeAlt[k, l]) + { + this.treeColorCheck(k, l); + Main.checkTreeAlt[k, l] = false; + } + } + } + } + protected void tileColorCheck(int t, int c) + { + this.LoadTiles(t); + if (c >= Main.numTileColors) + { + return; + } + if (!Main.tileAltTextureInit[t, c]) + { + Main.tileAltTexture[t, c] = new RenderTarget2D(base.GraphicsDevice, Main.tileTexture[t].Width, Main.tileTexture[t].Height, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.tileAltTextureInit[t, c] = true; + } + if (Main.tileAltTexture[t, c].IsContentLost) + { + Main.tileAltTextureDrawn[t, c] = false; + } + if (!Main.tileAltTextureDrawn[t, c]) + { + base.GraphicsDevice.SetRenderTarget(Main.tileAltTexture[t, c]); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c > 0 && c < 13 && (t == 0 || t == 2 || t == 5 || t == 23 || t == 59 || t == 60 || t == 70 || t == 109 || t == 199)) + { + int index = c + 27; + Main.tileShader.CurrentTechnique.Passes[index].Apply(); + } + else + { + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + } + this.spriteBatch.Draw(Main.tileTexture[t], new Rectangle(0, 0, Main.tileTexture[t].Width, Main.tileTexture[t].Height), Color.White); + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + Main.tileAltTextureDrawn[t, c] = true; + } + } + protected void treeColorCheck(int t, int c) + { + if (!Main.treeAltTextureInit[t, c]) + { + Main.treeTopAltTexture[t, c] = new RenderTarget2D(base.GraphicsDevice, Main.treeTopTexture[t].Width, Main.treeTopTexture[t].Height, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.treeBranchAltTexture[t, c] = new RenderTarget2D(base.GraphicsDevice, Main.treeBranchTexture[t].Width, Main.treeBranchTexture[t].Height, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.treeAltTextureInit[t, c] = true; + } + if (Main.treeTopAltTexture[t, c].IsContentLost || Main.treeBranchAltTexture[t, c].IsContentLost) + { + Main.treeAltTextureDrawn[t, c] = false; + } + if (!Main.treeAltTextureDrawn[t, c]) + { + base.GraphicsDevice.SetRenderTarget(Main.treeTopAltTexture[t, c]); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c > 0 && c < 13) + { + int index = c + 27; + Main.tileShader.CurrentTechnique.Passes[index].Apply(); + } + else + { + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + } + this.spriteBatch.Draw(Main.treeTopTexture[t], new Rectangle(0, 0, Main.treeTopTexture[t].Width, Main.treeTopTexture[t].Height), Color.White); + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + base.GraphicsDevice.SetRenderTarget(Main.treeBranchAltTexture[t, c]); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c > 0 && c < 13) + { + int index2 = c + 27; + Main.tileShader.CurrentTechnique.Passes[index2].Apply(); + } + else + { + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + } + this.spriteBatch.Draw(Main.treeBranchTexture[t], new Rectangle(0, 0, Main.treeBranchTexture[t].Width, Main.treeBranchTexture[t].Height), Color.White); + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + Main.treeAltTextureDrawn[t, c] = true; + } + } + protected void wallColorCheck(int t, int c) + { + this.LoadWall(t); + if (!Main.wallAltTextureInit[t, c]) + { + Main.wallAltTexture[t, c] = new RenderTarget2D(base.GraphicsDevice, Main.wallTexture[t].Width, Main.wallTexture[t].Height, false, base.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.wallAltTextureInit[t, c] = true; + } + if (Main.wallAltTexture[t, c].IsContentLost) + { + Main.wallAltTextureDrawn[t, c] = false; + } + if (!Main.wallAltTextureDrawn[t, c]) + { + base.GraphicsDevice.SetRenderTarget(Main.wallAltTexture[t, c]); + base.GraphicsDevice.Clear(new Color(0, 0, 0, 0)); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + this.spriteBatch.Draw(Main.wallTexture[t], new Rectangle(0, 0, Main.wallTexture[t].Width, Main.wallTexture[t].Height), Color.White); + this.spriteBatch.End(); + base.GraphicsDevice.SetRenderTarget(null); + Main.wallAltTextureDrawn[t, c] = true; + } + } + public void UpdateWeather() + { + Main.cloudLimit = 200; + if (Main.windSpeed < Main.windSpeedSet) + { + Main.windSpeed += 0.001f * (float)Main.dayRate; + if (Main.windSpeed > Main.windSpeedSet) + { + Main.windSpeed = Main.windSpeedSet; + } + } + else + { + if (Main.windSpeed > Main.windSpeedSet) + { + Main.windSpeed -= 0.001f * (float)Main.dayRate; + if (Main.windSpeed < Main.windSpeedSet) + { + Main.windSpeed = Main.windSpeedSet; + } + } + } + if (Main.netMode == 1) + { + return; + } + if (Main.netMode != 2 && Main.gameMenu) + { + return; + } + Main.windSpeedSpeed += (float)Main.rand.Next(-10, 11) * 0.0001f; + if (!Main.dayTime) + { + Main.windSpeedSpeed += (float)Main.rand.Next(-10, 11) * 0.0002f; + } + if ((double)Main.windSpeedSpeed < -0.002) + { + Main.windSpeedSpeed = -0.002f; + } + if ((double)Main.windSpeedSpeed > 0.002) + { + Main.windSpeedSpeed = 0.002f; + } + Main.windSpeedTemp += Main.windSpeedSpeed; + if (Main.raining) + { + Main.windSpeedTemp += Main.windSpeedSpeed * 2f; + } + float num = 0.3f + 0.5f * Main.cloudAlpha; + if (Main.windSpeedTemp < -num) + { + Main.windSpeedTemp = -num; + } + if (Main.windSpeedTemp > num) + { + Main.windSpeedTemp = num; + } + if (Main.rand.Next(60) == 0) + { + Main.numCloudsTemp += Main.rand.Next(-1, 2); + } + if ((float)Main.rand.Next(1000) < 50f * Main.cloudBGAlpha) + { + Main.numCloudsTemp++; + } + if ((float)Main.rand.Next(1000) < 25f * (1f - Main.cloudBGAlpha)) + { + Main.numCloudsTemp--; + } + if ((float)Main.rand.Next(1000) < 200f * Main.cloudAlpha && Main.numCloudsTemp < Main.cloudLimit / 2) + { + Main.numCloudsTemp++; + } + if ((float)Main.rand.Next(1000) < 50f * Main.cloudAlpha) + { + Main.numCloudsTemp++; + } + if (Main.numCloudsTemp > Main.cloudLimit / 4 && Main.rand.Next(100) == 0) + { + Main.numCloudsTemp -= Main.rand.Next(1, 3); + } + if (Main.numCloudsTemp < Main.cloudLimit / 4 && Main.rand.Next(100) == 0) + { + Main.numCloudsTemp += Main.rand.Next(1, 3); + } + if (Main.cloudBGActive <= 0f && Main.numCloudsTemp > Main.cloudLimit / 2 && Main.cloudAlpha == 0f) + { + Main.numCloudsTemp = Main.cloudLimit / 2; + } + if (Main.numCloudsTemp < 0) + { + Main.numCloudsTemp = 0; + } + if (Main.numCloudsTemp > Main.cloudLimit) + { + Main.numCloudsTemp = Main.cloudLimit; + } + Main.weatherCounter -= Main.dayRate; + if (Main.weatherCounter <= 0) + { + Main.numClouds = Main.numCloudsTemp; + Main.windSpeedSet = Main.windSpeedTemp; + Main.weatherCounter = Main.rand.Next(3600, 18000); + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + } + protected void LoadBackground(int i) + { + if (i >= 0 && !Main.backgroundLoaded[i]) + { + Main.backgroundTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Background_", + i + })); + Main.backgroundWidth[i] = Main.backgroundTexture[i].Width; + Main.backgroundHeight[i] = Main.backgroundTexture[i].Height; + Main.backgroundLoaded[i] = true; + } + } + protected void LoadNPC(int i) + { + if (!Main.NPCLoaded[i] || Main.npcTexture[i] == null) + { + Main.npcTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "NPC_", + i + })); + Main.NPCLoaded[i] = true; + } + } + protected void LoadProjectile(int i) + { + if (!Main.projectileLoaded[i]) + { + Main.projectileTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Projectile_", + i + })); + Main.projectileLoaded[i] = true; + } + } + protected void LoadGore(int i) + { + if (!Main.goreLoaded[i]) + { + Main.goreTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Gore_", + i + })); + Main.goreLoaded[i] = true; + } + } + protected void LoadWall(int i) + { + if (!Main.wallLoaded[i]) + { + Main.wallTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Wall_", + i + })); + Main.wallLoaded[i] = true; + } + } + protected void LoadTiles(int i) + { + if (!Main.tileSetsLoaded[i]) + { + Main.tileTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Tiles_", + i + })); + Main.tileSetsLoaded[i] = true; + } + } + protected void LoadItemFlames(int i) + { + if (!Main.itemFlameLoaded[i]) + { + try + { + Main.itemFlameTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "ItemFlame_", + i + })); + } + catch + { + } + Main.itemFlameLoaded[i] = true; + } + } + protected void LoadWings(int i) + { + if (!Main.wingsLoaded[i]) + { + Main.wingsTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Wings_", + i + })); + Main.wingsLoaded[i] = true; + } + } + protected void LoadHair(int i) + { + if (!Main.hairLoaded[i]) + { + Main.playerHairTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Player_Hair_", + i + 1 + })); + Main.playerHairAltTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Player_HairAlt_", + i + 1 + })); + Main.hairLoaded[i] = true; + } + } + protected void LoadArmorHead(int i) + { + if (!Main.armorHeadLoaded[i]) + { + Main.armorHeadTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Armor_Head_", + i + })); + Main.armorHeadLoaded[i] = true; + } + } + protected void LoadArmorBody(int i) + { + if (!Main.armorBodyLoaded[i]) + { + Main.femaleBodyTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Female_Body_", + i + })); + Main.armorBodyTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Armor_Body_", + i + })); + Main.armorArmTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Armor_Arm_", + i + })); + Main.armorBodyLoaded[i] = true; + } + } + protected void LoadArmorLegs(int i) + { + if (!Main.armorLegsLoaded[i]) + { + Main.armorLegTexture[i] = base.Content.Load(string.Concat(new object[] + { + "Images", + Path.DirectorySeparatorChar, + "Armor_Legs_", + i + })); + Main.armorLegsLoaded[i] = true; + } + } + protected void DrawSurfaceBG() + { + if (!Main.mapFullscreen && (double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < 200; i++) + { + if (Main.cloud[i].active && Main.cloud[i].scale < 1f) + { + Color color = Main.cloud[i].cloudColor(Main.bgColor); + float num = Main.cloud[i].scale * 0.8f; + float num2 = (Main.cloud[i].scale + 1f) / 2f * 0.9f; + color.R = (byte)((float)color.R * num); + color.G = (byte)((float)color.G * num2); + Main.atmo = 1f; + if (Main.atmo < 1f) + { + color.R = (byte)((float)color.R * Main.atmo); + color.G = (byte)((float)color.G * Main.atmo); + color.B = (byte)((float)color.B * Main.atmo); + color.A = (byte)((float)color.A * Main.atmo); + } + float num3 = Main.cloud[i].position.Y * ((float)Main.screenHeight / 600f); + num3 = Main.cloud[i].position.Y + (float)((int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 750.0 + 830.0)) + (float)((int)this.scAdj); + this.spriteBatch.Draw(Main.cloudTexture[Main.cloud[i].type], new Vector2(Main.cloud[i].position.X + (float)Main.cloudTexture[Main.cloud[i].type].Width * 0.5f, num3 + (float)Main.cloudTexture[Main.cloud[i].type].Height * 0.5f), new Rectangle?(new Rectangle(0, 0, Main.cloudTexture[Main.cloud[i].type].Width, Main.cloudTexture[Main.cloud[i].type].Height)), color, Main.cloud[i].rotation, new Vector2((float)Main.cloudTexture[Main.cloud[i].type].Width * 0.5f, (float)Main.cloudTexture[Main.cloud[i].type].Height * 0.5f), Main.cloud[i].scale, Main.cloud[i].spriteDir, 0f); + } + } + } + Main.atmo = 1f; + Main.bgScale *= 2f; + this.bgParrallax = 0.15; + if (Main.atmo < 1f) + { + Main.backColor.R = (byte)((float)Main.backColor.R * Main.atmo); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.atmo); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.atmo); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.atmo); + } + if (!Main.mapFullscreen && (double)(Main.screenPosition.Y / 16f) <= Main.worldSurface + 10.0) + { + if (Main.owBack) + { + if (Main.cloudBGActive > 0f) + { + Main.cloudBGAlpha += 0.0005f * (float)Main.dayRate; + if (Main.cloudBGAlpha > 1f) + { + Main.cloudBGAlpha = 1f; + } + } + else + { + Main.cloudBGAlpha -= 0.0005f * (float)Main.dayRate; + if (Main.cloudBGAlpha < 0f) + { + Main.cloudBGAlpha = 0f; + } + } + if (Main.cloudBGAlpha > 0f) + { + this.LoadBackground(Main.cloudBG[0]); + this.LoadBackground(Main.cloudBG[1]); + Main.bgScale *= 2f; + this.bgParrallax = 0.15; + float num4 = Main.cloudBGAlpha; + if (num4 > 1f) + { + num4 = 1f; + } + Main.bgScale = 1.65f; + this.bgParrallax = 0.090000003576278687; + if (base.IsActive) + { + Main.cloudBGX[0] += Main.windSpeed * (float)this.bgParrallax * 5f * (float)Main.dayRate; + } + if (Main.cloudBGX[0] > (float)Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale) + { + Main.cloudBGX[0] -= (float)Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale; + } + if (Main.cloudBGX[0] < (float)(-(float)Main.backgroundWidth[Main.cloudBG[0]]) * Main.bgScale) + { + Main.cloudBGX[0] += (float)Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale; + } + Main.bgW = (int)((float)Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 900.0 + 600.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = -150; + } + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2) - (double)Main.bgW); + this.bgStart += (int)Main.cloudBGX[0]; + this.bgLoops = Main.screenWidth / Main.bgW + 2 + 2; + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * num4); + Main.backColor.G = (byte)((float)Main.backColor.G * num4); + Main.backColor.B = (byte)((float)Main.backColor.B * num4); + Main.backColor.A = (byte)((float)Main.backColor.A * num4); + for (int j = 0; j < this.bgLoops; j++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.cloudBG[0]], new Vector2((float)(this.bgStart + Main.bgW * j), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.cloudBG[0]], Main.backgroundHeight[Main.cloudBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + num4 = Main.cloudBGAlpha * 1.5f; + if (num4 > 1f) + { + num4 = 1f; + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * num4); + Main.backColor.G = (byte)((float)Main.backColor.G * num4); + Main.backColor.B = (byte)((float)Main.backColor.B * num4); + Main.backColor.A = (byte)((float)Main.backColor.A * num4); + Main.bgScale = 1.85f; + this.bgParrallax = 0.12; + if (base.IsActive) + { + Main.cloudBGX[1] += Main.windSpeed * (float)this.bgParrallax * 5f * (float)Main.dayRate; + } + if (Main.cloudBGX[1] > (float)Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale) + { + Main.cloudBGX[1] -= (float)Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale; + } + if (Main.cloudBGX[1] < (float)(-(float)Main.backgroundWidth[Main.cloudBG[1]]) * Main.bgScale) + { + Main.cloudBGX[1] += (float)Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale; + } + Main.bgW = (int)((float)Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1100.0 + 750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = -50; + } + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2) - (double)Main.bgW); + this.bgStart += (int)Main.cloudBGX[1]; + this.bgLoops = Main.screenWidth / Main.bgW + 2 + 2; + for (int k = 0; k < this.bgLoops; k++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.cloudBG[1]], new Vector2((float)(this.bgStart + Main.bgW * k), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.cloudBG[1]], Main.backgroundHeight[Main.cloudBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + this.LoadBackground(Main.treeMntBG[0]); + this.LoadBackground(Main.treeMntBG[1]); + Main.bgScale = 1f; + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1300.0 + 1090.0) + (int)this.scAdj; + Main.bgScale *= 2f; + this.bgParrallax = 0.15; + Main.bgW = (int)((float)Main.backgroundWidth[Main.treeMntBG[0]] * Main.bgScale); + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if (Main.gameMenu) + { + this.bgTop = 100; + } + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[0]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[0]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[0]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[0]); + if (Main.bgAlpha2[0] > 0f) + { + if (Main.treeMntBG[0] == 93 || (Main.treeMntBG[0] >= 168 && Main.treeMntBG[0] <= 170)) + { + this.bgTop -= 50; + } + if (Main.treeMntBG[0] == 171) + { + this.bgTop -= 100; + } + if (Main.treeMntBG[0] == 176) + { + this.bgTop += 250; + } + if (Main.treeMntBG[0] == 179) + { + this.bgTop -= 100; + } + for (int l = 0; l < this.bgLoops; l++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.treeMntBG[0]], new Vector2((float)(this.bgStart + Main.bgW * l), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.treeMntBG[0]], Main.backgroundHeight[Main.treeMntBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + if (Main.treeMntBG[0] == 93 || (Main.treeMntBG[0] >= 168 && Main.treeMntBG[0] <= 170)) + { + this.bgTop += 50; + } + if (Main.treeMntBG[0] == 171) + { + this.bgTop += 100; + } + if (Main.treeMntBG[0] == 176) + { + this.bgTop -= 250; + } + if (Main.treeMntBG[0] == 179) + { + this.bgTop += 100; + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[1]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[1]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[1]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[1]); + if (Main.bgAlpha2[1] > 0f) + { + this.LoadBackground(23); + for (int m = 0; m < this.bgLoops; m++) + { + this.spriteBatch.Draw(Main.backgroundTexture[23], new Vector2((float)(this.bgStart + Main.bgW * m), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[23], Main.backgroundHeight[23])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[2]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[2]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[2]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[2]); + if (Main.bgAlpha2[2] > 0f) + { + this.LoadBackground(24); + for (int n = 0; n < this.bgLoops; n++) + { + this.spriteBatch.Draw(Main.backgroundTexture[24], new Vector2((float)(this.bgStart + Main.bgW * n), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[24], Main.backgroundHeight[24])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[4]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[4]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[4]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[4]); + if (Main.bgAlpha2[4] > 0f) + { + this.LoadBackground(Main.snowMntBG[0]); + for (int num5 = 0; num5 < this.bgLoops; num5++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.snowMntBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num5), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.snowMntBG[0]], Main.backgroundHeight[Main.snowMntBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[5]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[5]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[5]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[5]); + if (Main.bgAlpha2[5] > 0f) + { + this.LoadBackground(24); + for (int num6 = 0; num6 < this.bgLoops; num6++) + { + this.spriteBatch.Draw(Main.backgroundTexture[24], new Vector2((float)(this.bgStart + Main.bgW * num6), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[24], Main.backgroundHeight[24])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + } + this.cTop = (float)(this.bgTop - 50); + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num7 = 0; num7 < 200; num7++) + { + if (Main.cloud[num7].active && (double)Main.cloud[num7].scale < 1.15 && Main.cloud[num7].scale >= 1f) + { + Color color2 = Main.cloud[num7].cloudColor(Main.bgColor); + if (Main.atmo < 1f) + { + color2.R = (byte)((float)color2.R * Main.atmo); + color2.G = (byte)((float)color2.G * Main.atmo); + color2.B = (byte)((float)color2.B * Main.atmo); + color2.A = (byte)((float)color2.A * Main.atmo); + } + float num8 = Main.cloud[num7].position.Y * ((float)Main.screenHeight / 600f); + float num9 = (float)((double)(Main.screenPosition.Y / 16f - 24f) / Main.worldSurface); + if (num9 < 0f) + { + num9 = 0f; + } + if (num9 > 1f) + { + } + if (Main.gameMenu) + { + } + this.spriteBatch.Draw(Main.cloudTexture[Main.cloud[num7].type], new Vector2(Main.cloud[num7].position.X + (float)Main.cloudTexture[Main.cloud[num7].type].Width * 0.5f, num8 + (float)Main.cloudTexture[Main.cloud[num7].type].Height * 0.5f + this.cTop + 200f), new Rectangle?(new Rectangle(0, 0, Main.cloudTexture[Main.cloud[num7].type].Width, Main.cloudTexture[Main.cloud[num7].type].Height)), color2, Main.cloud[num7].rotation, new Vector2((float)Main.cloudTexture[Main.cloud[num7].type].Width * 0.5f, (float)Main.cloudTexture[Main.cloud[num7].type].Height * 0.5f), Main.cloud[num7].scale, Main.cloud[num7].spriteDir, 0f); + } + } + } + if (Main.holyTiles > 0 && Main.owBack) + { + this.bgParrallax = 0.17; + Main.bgScale = 1.1f; + Main.bgScale *= 2f; + Main.bgW = (int)((double)(3500f * Main.bgScale) * 1.05); + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgLoops = Main.screenWidth / Main.bgW + 2; + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1400.0 + 900.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 230; + this.bgStart -= 500; + } + Color color3 = Main.trueBackColor; + float num10 = (float)Main.holyTiles / 400f; + if (num10 > 0.5f) + { + num10 = 0.5f; + } + color3.R = (byte)((float)color3.R * num10); + color3.G = (byte)((float)color3.G * num10); + color3.B = (byte)((float)color3.B * num10); + color3.A = (byte)((float)color3.A * num10 * 0.8f); + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + this.LoadBackground(18); + this.LoadBackground(19); + for (int num11 = 0; num11 < this.bgLoops; num11++) + { + this.spriteBatch.Draw(Main.backgroundTexture[18], new Vector2((float)(this.bgStart + Main.bgW * num11), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[18], Main.backgroundHeight[18])), color3, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.backgroundTexture[19], new Vector2((float)(this.bgStart + Main.bgW * num11 + 1700), (float)(this.bgTop + 100)), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[19], Main.backgroundHeight[19])), color3, 0f, default(Vector2), Main.bgScale * 0.9f, SpriteEffects.None, 0f); + } + } + } + if (Main.treeMntBG[1] > -1) + { + this.LoadBackground(Main.treeMntBG[1]); + this.bgParrallax = 0.2; + Main.bgScale = 1.15f; + Main.bgScale *= 2f; + Main.bgW = (int)((float)Main.backgroundWidth[Main.treeMntBG[1]] * Main.bgScale); + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgLoops = Main.screenWidth / Main.bgW + 2; + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1400.0 + 1260.0) + (int)this.scAdj; + } + if (Main.owBack) + { + if (Main.gameMenu) + { + this.bgTop = 230; + this.bgStart -= 500; + } + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[0]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[0]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[0]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[0]); + if (Main.bgAlpha2[0] > 0f && Main.treeMntBG[1] > -1) + { + if (Main.treeMntBG[1] == 172) + { + this.bgTop += 130; + } + if (Main.treeMntBG[1] == 177) + { + this.bgTop += 200; + } + if (Main.treeMntBG[1] >= 180 && Main.treeMntBG[1] <= 183) + { + this.bgTop -= 350; + } + for (int num12 = 0; num12 < this.bgLoops; num12++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.treeMntBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num12), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.treeMntBG[1]], Main.backgroundHeight[Main.treeMntBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + if (Main.treeMntBG[1] == 172) + { + this.bgTop -= 130; + } + if (Main.treeMntBG[1] == 177) + { + this.bgTop -= 200; + } + if (Main.treeMntBG[1] >= 180 && Main.treeMntBG[1] <= 183) + { + this.bgTop += 350; + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[1]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[1]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[1]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[1]); + if (Main.bgAlpha2[1] > 0f) + { + this.LoadBackground(22); + for (int num13 = 0; num13 < this.bgLoops; num13++) + { + this.spriteBatch.Draw(Main.backgroundTexture[22], new Vector2((float)(this.bgStart + Main.bgW * num13), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[22], Main.backgroundHeight[22])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[2]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[2]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[2]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[2]); + if (Main.bgAlpha2[2] > 0f) + { + this.LoadBackground(25); + for (int num14 = 0; num14 < this.bgLoops; num14++) + { + this.spriteBatch.Draw(Main.backgroundTexture[25], new Vector2((float)(this.bgStart + Main.bgW * num14), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[25], Main.backgroundHeight[25])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[3]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[3]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[3]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[3]); + if (Main.bgAlpha2[3] > 0f) + { + this.LoadBackground(Main.oceanBG); + for (int num15 = 0; num15 < this.bgLoops; num15++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.oceanBG], new Vector2((float)(this.bgStart + Main.bgW * num15), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.oceanBG], Main.backgroundHeight[Main.oceanBG])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[4]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[4]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[4]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[4]); + if (Main.bgAlpha2[4] > 0f) + { + this.LoadBackground(Main.snowMntBG[1]); + for (int num16 = 0; num16 < this.bgLoops; num16++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.snowMntBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num16), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.snowMntBG[1]], Main.backgroundHeight[Main.snowMntBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha2[5]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha2[5]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha2[5]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha2[5]); + if (Main.bgAlpha2[5] > 0f) + { + this.LoadBackground(42); + for (int num17 = 0; num17 < this.bgLoops; num17++) + { + this.spriteBatch.Draw(Main.backgroundTexture[42], new Vector2((float)(this.bgStart + Main.bgW * num17), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[42], Main.backgroundHeight[42])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + } + this.cTop = (float)this.bgTop * 1.01f - 150f; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num18 = 0; num18 < 200; num18++) + { + if (Main.cloud[num18].active && Main.cloud[num18].scale >= 1.15f) + { + Color color4 = Main.cloud[num18].cloudColor(Main.bgColor); + if (Main.atmo < 1f) + { + color4.R = (byte)((float)color4.R * Main.atmo); + color4.G = (byte)((float)color4.G * Main.atmo); + color4.B = (byte)((float)color4.B * Main.atmo); + color4.A = (byte)((float)color4.A * Main.atmo); + } + float num19 = Main.cloud[num18].position.Y * ((float)Main.screenHeight / 600f) - 100f; + float num20 = (float)((double)(Main.screenPosition.Y / 16f - 24f) / Main.worldSurface); + if (num20 < 0f) + { + num20 = 0f; + } + if (num20 > 1f) + { + } + if (Main.gameMenu) + { + } + this.spriteBatch.Draw(Main.cloudTexture[Main.cloud[num18].type], new Vector2(Main.cloud[num18].position.X + (float)Main.cloudTexture[Main.cloud[num18].type].Width * 0.5f, num19 + (float)Main.cloudTexture[Main.cloud[num18].type].Height * 0.5f + this.cTop), new Rectangle?(new Rectangle(0, 0, Main.cloudTexture[Main.cloud[num18].type].Width, Main.cloudTexture[Main.cloud[num18].type].Height)), color4, Main.cloud[num18].rotation, new Vector2((float)Main.cloudTexture[Main.cloud[num18].type].Width * 0.5f, (float)Main.cloudTexture[Main.cloud[num18].type].Height * 0.5f), Main.cloud[num18].scale, Main.cloud[num18].spriteDir, 0f); + } + } + } + } + if (!Main.mapFullscreen) + { + for (int num21 = 0; num21 < 10; num21++) + { + if (Main.bgStyle == num21) + { + Main.bgAlpha[num21] += Main.tranSpeed; + if (Main.bgAlpha[num21] > 1f) + { + Main.bgAlpha[num21] = 1f; + } + } + else + { + Main.bgAlpha[num21] -= Main.tranSpeed; + if (Main.bgAlpha[num21] < 0f) + { + Main.bgAlpha[num21] = 0f; + } + } + if (Main.owBack) + { + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte)((float)Main.backColor.R * Main.bgAlpha[num21]); + Main.backColor.G = (byte)((float)Main.backColor.G * Main.bgAlpha[num21]); + Main.backColor.B = (byte)((float)Main.backColor.B * Main.bgAlpha[num21]); + Main.backColor.A = (byte)((float)Main.backColor.A * Main.bgAlpha[num21]); + if (Main.bgAlpha[num21] > 0f && num21 == 3) + { + this.LoadBackground(Main.jungleBG[0]); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + Main.bgW = (int)((float)Main.backgroundWidth[Main.jungleBG[0]] * Main.bgScale); + this.bgParrallax = 0.4; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1660.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + if (Main.jungleBG[0] == 59) + { + this.bgTop -= 200; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num22 = 0; num22 < this.bgLoops; num22++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.jungleBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num22), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.jungleBG[0]], Main.backgroundHeight[Main.jungleBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + this.LoadBackground(Main.jungleBG[1]); + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + Main.bgW = (int)((float)Main.backgroundWidth[Main.jungleBG[1]] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1840.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + if (Main.jungleBG[1] == 60) + { + this.bgTop -= 175; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num23 = 0; num23 < this.bgLoops; num23++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.jungleBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num23), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.jungleBG[1]], Main.backgroundHeight[Main.jungleBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.FlipHorizontally, 0f); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.jungleBG[2]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.jungleBG[2]] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2060.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.jungleBG[2] == 61) + { + this.bgTop -= 150; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num24 = 0; num24 < this.bgLoops; num24++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.jungleBG[2]], new Vector2((float)(this.bgStart + Main.bgW * num24), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.jungleBG[2]], Main.backgroundHeight[Main.jungleBG[2]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 2) + { + this.LoadBackground(Main.desertBG[0]); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + Main.bgW = (int)((float)Main.backgroundWidth[Main.desertBG[0]] * Main.bgScale); + this.bgParrallax = 0.37; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num25 = 0; num25 < this.bgLoops; num25++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.desertBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num25), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.desertBG[0]], Main.backgroundHeight[Main.desertBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.desertBG[1]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.desertBG[1]] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2150.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num26 = 0; num26 < this.bgLoops; num26++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.desertBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num26), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.desertBG[1]], Main.backgroundHeight[Main.desertBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 5) + { + this.LoadBackground(26); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + Main.bgW = (int)((float)Main.backgroundWidth[26] * Main.bgScale); + this.bgParrallax = 0.37; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num27 = 0; num27 < this.bgLoops; num27++) + { + this.spriteBatch.Draw(Main.backgroundTexture[26], new Vector2((float)(this.bgStart + Main.bgW * num27), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[26], Main.backgroundHeight[26])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(27); + Main.bgW = (int)((float)Main.backgroundWidth[27] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2150.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num28 = 0; num28 < this.bgLoops; num28++) + { + this.spriteBatch.Draw(Main.backgroundTexture[27], new Vector2((float)(this.bgStart + Main.bgW * num28), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[27], Main.backgroundHeight[27])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 1) + { + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.corruptBG[0]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.corruptBG[0]] * Main.bgScale); + this.bgParrallax = 0.4; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + if (Main.corruptBG[0] == 56) + { + this.bgTop -= 100; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num29 = 0; num29 < this.bgLoops; num29++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.corruptBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num29), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.corruptBG[0]], Main.backgroundHeight[Main.corruptBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + this.LoadBackground(Main.corruptBG[1]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.corruptBG[1]] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + if (Main.corruptBG[0] == 56) + { + this.bgTop -= 100; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + try + { + for (int num30 = 0; num30 < this.bgLoops; num30++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.corruptBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num30), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.corruptBG[1]], Main.backgroundHeight[Main.corruptBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.FlipHorizontally, 0f); + } + } + catch + { + this.LoadBackground(Main.corruptBG[1]); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.corruptBG[2]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.corruptBG[2]] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.corruptBG[0] == 56) + { + this.bgTop -= 100; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num31 = 0; num31 < this.bgLoops; num31++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.corruptBG[2]], new Vector2((float)(this.bgStart + Main.bgW * num31), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.corruptBG[2]], Main.backgroundHeight[Main.corruptBG[2]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 6) + { + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.hallowBG[0]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.hallowBG[0]] * Main.bgScale); + this.bgParrallax = 0.4; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num32 = 0; num32 < this.bgLoops; num32++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.hallowBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num32), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.hallowBG[0]], Main.backgroundHeight[Main.hallowBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + this.LoadBackground(Main.hallowBG[1]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.hallowBG[1]] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num33 = 0; num33 < this.bgLoops; num33++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.hallowBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num33), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.hallowBG[1]], Main.backgroundHeight[Main.hallowBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.hallowBG[2]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.hallowBG[2]] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num34 = 0; num34 < this.bgLoops; num34++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.hallowBG[2]], new Vector2((float)(this.bgStart + Main.bgW * num34), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.hallowBG[2]], Main.backgroundHeight[Main.hallowBG[2]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 0) + { + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.bgParrallax = 0.4; + if (Main.treeBG[0] == 91) + { + this.bgParrallax = 0.27000001072883606; + Main.bgScale = 1.2f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] == 173) + { + this.bgParrallax = 0.25; + Main.bgScale = 1.3f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] == 178) + { + this.bgParrallax = 0.30000001192092896; + Main.bgScale = 1.2f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] == 184) + { + this.bgParrallax = 0.25; + Main.bgScale = 1.2f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] >= 0) + { + this.LoadBackground(Main.treeBG[0]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.treeBG[0]] * Main.bgScale); + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int)this.scAdj; + if (Main.treeBG[0] == 91) + { + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1600.0 + 1400.0) + (int)this.scAdj; + } + if (Main.treeBG[0] == 173) + { + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1600.0 + 1400.0) + (int)this.scAdj; + } + if (Main.treeBG[0] == 184) + { + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1600.0 + 1400.0) + (int)this.scAdj; + } + if (Main.gameMenu) + { + this.bgTop = 320; + } + if (Main.treeBG[0] == 50) + { + this.bgTop -= 50; + } + if (Main.treeBG[0] == 53) + { + this.bgTop -= 100; + } + if (Main.treeBG[0] == 91) + { + this.bgTop += 200; + } + if (Main.treeBG[0] == 173) + { + this.bgTop += 200; + } + if (Main.treeBG[0] == 178) + { + this.bgTop += 75; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num35 = 0; num35 < this.bgLoops; num35++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.treeBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num35), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.treeBG[0]], Main.backgroundHeight[Main.treeBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.treeBG[1] >= 0) + { + this.LoadBackground(Main.treeBG[1]); + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + Main.bgW = (int)((float)Main.backgroundWidth[Main.treeBG[1]] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + if (Main.treeBG[1] == 51) + { + this.bgTop -= 50; + } + if (Main.treeBG[1] == 54) + { + this.bgTop -= 100; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num36 = 0; num36 < this.bgLoops; num36++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.treeBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num36), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.treeBG[1]], Main.backgroundHeight[Main.treeBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.FlipHorizontally, 0f); + } + } + } + if (Main.treeBG[2] >= 0) + { + this.LoadBackground(Main.treeBG[2]); + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.bgParrallax = 0.49; + if (Main.treeBG[0] == 91) + { + Main.bgScale = 1.3f; + Main.bgScale *= 2f; + this.bgParrallax = 0.42; + } + Main.bgW = (int)((float)Main.backgroundWidth[Main.treeBG[2]] * Main.bgScale); + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.treeBG[2] == 52) + { + this.bgTop -= 50; + } + if (Main.treeBG[2] == 55) + { + this.bgTop -= 100; + } + if (Main.treeBG[2] == 92) + { + this.bgTop += 150; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num37 = 0; num37 < this.bgLoops; num37++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.treeBG[2]], new Vector2((float)(this.bgStart + Main.bgW * num37), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.treeBG[2]], Main.backgroundHeight[Main.treeBG[2]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 7) + { + if (Main.snowBG[0] >= 0) + { + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.snowBG[0]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.snowBG[0]] * Main.bgScale); + this.bgParrallax = 0.4; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num38 = 0; num38 < this.bgLoops; num38++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.snowBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num38), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.snowBG[0]], Main.backgroundHeight[Main.snowBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.snowBG[1] >= 0) + { + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + this.LoadBackground(Main.snowBG[1]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.snowBG[1]] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num39 = 0; num39 < this.bgLoops; num39++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.snowBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num39), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.snowBG[1]], Main.backgroundHeight[Main.snowBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.snowBG[2] >= 0) + { + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.snowBG[2]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.snowBG[2]] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num40 = 0; num40 < this.bgLoops; num40++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.snowBG[2]], new Vector2((float)(this.bgStart + Main.bgW * num40), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.snowBG[2]], Main.backgroundHeight[Main.snowBG[2]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 8) + { + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.crimsonBG[0]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.crimsonBG[0]] * Main.bgScale); + this.bgParrallax = 0.4; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int)this.scAdj; + if (Main.crimsonBG[0] == 105) + { + this.bgTop += 50; + } + if (Main.crimsonBG[0] == 174) + { + this.bgTop -= 350; + } + if (Main.gameMenu) + { + this.bgTop = 320; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num41 = 0; num41 < this.bgLoops; num41++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.crimsonBG[0]], new Vector2((float)(this.bgStart + Main.bgW * num41), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.crimsonBG[0]], Main.backgroundHeight[Main.crimsonBG[0]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + if (Main.crimsonBG[1] > -1) + { + this.LoadBackground(Main.crimsonBG[1]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.crimsonBG[1]] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num42 = 0; num42 < this.bgLoops; num42++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.crimsonBG[1]], new Vector2((float)(this.bgStart + Main.bgW * num42), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.crimsonBG[1]], Main.backgroundHeight[Main.crimsonBG[1]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.crimsonBG[2]); + Main.bgW = (int)((float)Main.backgroundWidth[Main.crimsonBG[2]] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.crimsonBG[2] == 175) + { + this.bgStart -= 1000; + this.bgTop -= 400; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num43 = 0; num43 < this.bgLoops; num43++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.crimsonBG[2]], new Vector2((float)(this.bgStart + Main.bgW * num43), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[Main.crimsonBG[2]], Main.backgroundHeight[Main.crimsonBG[2]])), Main.backColor, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + if (Main.bgAlpha[num21] > 0f && num21 == 9) + { + float num44 = (float)Main.backColor.A / 255f; + Color color5 = Main.backColor; + float num45 = (float)Main.rand.Next(28, 42) * 0.001f; + num45 += (float)(270 - (int)Main.mouseTextColor) / 5000f; + float num46 = 0.1f; + float num47 = 0.15f + num45 / 2f; + float num48 = 0.3f + num45; + num46 *= 255f; + num47 *= 255f; + num48 *= 255f; + num46 *= 0.33f * num44; + num47 *= 0.33f * num44; + num48 *= 0.33f * num44; + if (num46 > 255f) + { + num46 = 255f; + } + if (num47 > 255f) + { + num47 = 255f; + } + if (num48 > 255f) + { + num48 = 255f; + } + if (num46 > (float)color5.R) + { + color5.R = (byte)num46; + } + if (num47 > (float)color5.G) + { + color5.G = (byte)num47; + } + if (num48 > (float)color5.B) + { + color5.B = (byte)num48; + } + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(46); + Main.bgW = (int)((float)Main.backgroundWidth[46] * Main.bgScale); + this.bgParrallax = 0.4; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1800.0 + 1400.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 320; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num49 = 0; num49 < this.bgLoops; num49++) + { + this.spriteBatch.Draw(Main.backgroundTexture[46], new Vector2((float)(this.bgStart + Main.bgW * num49), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[46], Main.backgroundHeight[46])), color5, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + color5 = Main.backColor; + num45 = (float)Main.rand.Next(28, 42) * 0.001f; + num45 += (float)(270 - (int)Main.mouseTextColor) / 5000f; + num46 = 0.1f; + num47 = 0.175f + num45 / 2f; + num48 = 0.3f + num45; + num46 *= 255f; + num47 *= 255f; + num48 *= 255f; + num46 *= 0.5f * num44; + num47 *= 0.5f * num44; + num48 *= 0.5f * num44; + if (num46 > 255f) + { + num46 = 255f; + } + if (num47 > 255f) + { + num47 = 255f; + } + if (num48 > 255f) + { + num48 = 255f; + } + if (num46 > (float)color5.R) + { + color5.R = (byte)num46; + } + if (num47 > (float)color5.G) + { + color5.G = (byte)num47; + } + if (num48 > (float)color5.B) + { + color5.B = (byte)num48; + } + Main.bgScale = 1.32f; + Main.bgScale *= 2f; + this.LoadBackground(47); + Main.bgW = (int)((float)Main.backgroundWidth[47] * Main.bgScale); + this.bgParrallax = 0.43; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1950.0 + 1675.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num50 = 0; num50 < this.bgLoops; num50++) + { + this.spriteBatch.Draw(Main.backgroundTexture[47], new Vector2((float)(this.bgStart + Main.bgW * num50), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[47], Main.backgroundHeight[47])), color5, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + color5 = Main.backColor; + num45 = (float)Main.rand.Next(28, 42) * 0.001f; + num45 += (float)(270 - (int)Main.mouseTextColor) / 3000f; + num46 = 0.125f; + num47 = 0.2f + num45 / 2f; + num48 = 0.3f + num45; + num46 *= 255f * num44 * 0.75f; + num47 *= 255f * num44 * 0.75f; + num48 *= 255f * num44 * 0.75f; + if (num46 > 255f) + { + num46 = 255f; + } + if (num47 > 255f) + { + num47 = 255f; + } + if (num48 > 255f) + { + num48 = 255f; + } + if (num46 > (float)color5.R) + { + color5.R = (byte)num46; + } + if (num47 > (float)color5.G) + { + color5.G = (byte)num47; + } + if (num48 > (float)color5.B) + { + color5.B = (byte)num48; + } + Main.bgScale = 1.36f; + Main.bgScale *= 2f; + this.LoadBackground(48); + Main.bgW = (int)((float)Main.backgroundWidth[48] * Main.bgScale); + this.bgParrallax = 0.49; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.bgW) - (double)(Main.bgW / 2)); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 2100.0 + 1950.0) + (int)this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int num51 = 0; num51 < this.bgLoops; num51++) + { + this.spriteBatch.Draw(Main.backgroundTexture[48], new Vector2((float)(this.bgStart + Main.bgW * num51), (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.backgroundWidth[48], Main.backgroundHeight[48])), color5, 0f, default(Vector2), Main.bgScale, SpriteEffects.None, 0f); + } + } + } + } + } + } + if (!Main.mapFullscreen && Main.cloudAlpha > 0f && (double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + this.bgParrallax = 0.1; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.backgroundWidth[Main.background]) - (double)(Main.backgroundWidth[Main.background] / 2)); + this.bgLoops = Main.screenWidth / Main.backgroundWidth[Main.background] + 2; + this.bgStartY = 0; + this.bgLoopsY = 0; + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0); + for (int num52 = 0; num52 < this.bgLoops; num52++) + { + Color color6 = Main.bgColor; + this.bgStart = 0; + float num53 = Main.cloudAlpha; + color6.R = (byte)((float)color6.R * num53); + color6.G = (byte)((float)color6.G * num53); + color6.B = (byte)((float)color6.B * num53); + color6.A = (byte)((float)color6.A * num53); + this.spriteBatch.Draw(Main.backgroundTexture[49], new Rectangle(this.bgStart + Main.backgroundWidth[49] * num52, this.bgTop, Main.backgroundWidth[49], Main.backgroundHeight[49]), color6); + } + } + } + protected override void Draw(GameTime gameTime) + { + if (!Main.gameMenu) + { + this.lookForColorTiles(); + } + if (Main.loadMap) + { + Main.mapMinX = 0; + Main.mapMaxX = Main.maxTilesX; + Main.mapMinY = 0; + Main.mapMaxY = Main.maxTilesY; + Main.refreshMap = false; + this.DrawToMap(); + } + if (Lighting.lightMode >= 2) + { + Main.drawToScreen = true; + } + else + { + Main.drawToScreen = false; + } + if (Main.drawToScreen && Main.targetSet) + { + this.ReleaseTargets(); + } + if (!Main.drawToScreen && !Main.targetSet) + { + this.InitTargets(); + } + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + Main.fpsCount++; + if (!base.IsActive) + { + Main.maxQ = true; + } + if (!Main.dedServ) + { + bool flag = false; + if (Main.screenWidth != base.GraphicsDevice.Viewport.Width || Main.screenHeight != base.GraphicsDevice.Viewport.Height) + { + Main.mapTime = Main.mapTimeMax + 30; + flag = true; + if (Main.gamePaused) + { + Main.renderNow = true; + } + } + Main.screenWidth = base.GraphicsDevice.Viewport.Width; + Main.screenHeight = base.GraphicsDevice.Viewport.Height; + if (Main.screenWidth > Main.maxScreenW) + { + Main.screenWidth = Main.maxScreenW; + flag = true; + } + if (Main.screenHeight > Main.maxScreenH) + { + Main.screenHeight = Main.maxScreenH; + flag = true; + } + if (Main.screenWidth < Main.minScreenW) + { + Main.screenWidth = Main.minScreenW; + flag = true; + } + if (Main.screenHeight < Main.minScreenH) + { + Main.screenHeight = Main.minScreenH; + flag = true; + } + if (flag) + { + this.graphics.PreferredBackBufferWidth = Main.screenWidth; + this.graphics.PreferredBackBufferHeight = Main.screenHeight; + this.graphics.ApplyChanges(); + if (!Main.drawToScreen) + { + this.InitTargets(); + } + } + } + Main.CursorColor(); + Main.drawTime++; + Main.screenLastPosition = Main.screenPosition; + if (Main.stackSplit == 0) + { + Main.stackCounter = 0; + Main.stackDelay = 7; + Main.superFastStack = 0; + } + else + { + Main.stackCounter++; + int num = 30; + if (num == 7) + { + num = 30; + } + else + { + if (Main.stackDelay == 6) + { + num = 25; + } + else + { + if (Main.stackDelay == 5) + { + num = 20; + } + else + { + if (Main.stackDelay == 4) + { + num = 15; + } + else + { + if (Main.stackDelay == 3) + { + num = 10; + } + else + { + num = 5; + } + } + } + } + } + if (Main.stackCounter >= num) + { + Main.stackDelay--; + if (Main.stackDelay < 2) + { + Main.stackDelay = 2; + Main.superFastStack++; + } + Main.stackCounter = 0; + } + } + Main.mouseTextColor += (byte)Main.mouseTextColorChange; + if (Main.mouseTextColor >= 250) + { + Main.mouseTextColorChange = -4; + } + if (Main.mouseTextColor <= 175) + { + Main.mouseTextColorChange = 4; + } + if (Main.myPlayer >= 0) + { + Main.player[Main.myPlayer].mouseInterface = false; + } + if (Main.mapTime > 0) + { + Main.mapTime--; + } + if (Main.gameMenu) + { + Main.mapTime = Main.mapTimeMax; + } + Main.toolTip = new Item(); + if (!Main.gameMenu && Main.netMode != 2) + { + if (Main.cameraX != 0f && !Main.player[Main.myPlayer].pulley) + { + Main.cameraX = 0f; + } + if (Main.cameraX > 0f) + { + Main.cameraX -= 1f; + if (Main.cameraX < 0f) + { + Main.cameraX = 0f; + } + } + if (Main.cameraX < 0f) + { + Main.cameraX += 1f; + if (Main.cameraX > 0f) + { + Main.cameraX = 0f; + } + } + Main.screenPosition.X = Main.player[Main.myPlayer].position.X + (float)Main.player[Main.myPlayer].width * 0.5f - (float)Main.screenWidth * 0.5f + Main.cameraX; + Main.screenPosition.Y = Main.player[Main.myPlayer].position.Y + (float)Main.player[Main.myPlayer].height * 0.5f - (float)Main.screenHeight * 0.5f + Main.player[Main.myPlayer].gfxOffY; + float num2 = 0f; + float num3 = 0f; + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1254 && Main.player[Main.myPlayer].scope && Main.mouseRight) + { + int num4 = Main.mouseX; + int num5 = Main.mouseY; + if (num4 > Main.screenWidth) + { + num4 = Main.screenWidth; + } + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.screenHeight) + { + num5 = Main.screenHeight; + } + if (num5 < 0) + { + num5 = 0; + } + num2 = (float)(num4 - Main.screenWidth / 2) / 1.25f; + num3 += (float)(num5 - Main.screenHeight / 2) / 1.25f; + } + else + { + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1254 && Main.mouseRight) + { + int num6 = Main.mouseX; + int num7 = Main.mouseY; + if (num6 > Main.screenWidth) + { + num6 = Main.screenWidth; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.screenHeight) + { + num7 = Main.screenHeight; + } + if (num7 < 0) + { + num7 = 0; + } + num2 = (float)(num6 - Main.screenWidth / 2) / 1.5f; + num3 += (float)(num7 - Main.screenHeight / 2) / 1.5f; + } + else + { + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1299) + { + int num8 = Main.mouseX; + int num9 = Main.mouseY; + if (num8 > Main.screenWidth) + { + num8 = Main.screenWidth; + } + if (num8 < 0) + { + num8 = 0; + } + if (num9 > Main.screenHeight) + { + num9 = Main.screenHeight; + } + if (num9 < 0) + { + num9 = 0; + } + num2 = (float)(num8 - Main.screenWidth / 2) / 1.5f; + num3 += (float)(num9 - Main.screenHeight / 2) / 1.5f; + } + else + { + if (Main.player[Main.myPlayer].scope && Main.mouseRight) + { + int num10 = Main.mouseX; + int num11 = Main.mouseY; + if (num10 > Main.screenWidth) + { + num10 = Main.screenWidth; + } + if (num10 < 0) + { + num10 = 0; + } + if (num11 > Main.screenHeight) + { + num11 = Main.screenHeight; + } + if (num11 < 0) + { + num11 = 0; + } + num2 = (float)(num10 - Main.screenWidth / 2) / 2f; + num3 += (float)(num11 - Main.screenHeight / 2) / 2f; + } + } + } + } + float num12 = 24f; + float num13 = num2 - Main.zoomX; + float num14 = num3 - Main.zoomY; + float num15 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num15 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + if (num15 < num12) + { + Main.zoomX = num2; + Main.zoomY = num3; + } + else + { + num15 = num12 / num15; + num13 *= num15; + num14 *= num15; + Main.zoomX += num13; + Main.zoomY += num14; + } + Main.screenPosition.X = Main.screenPosition.X + Main.zoomX; + Main.screenPosition.Y = Main.screenPosition.Y + Main.zoomY; + Main.screenPosition.X = (float)((int)Main.screenPosition.X); + Main.screenPosition.Y = (float)((int)Main.screenPosition.Y); + } + if (!Main.gameMenu && Main.netMode != 2) + { + if (Main.screenPosition.X < Main.leftWorld + 640f + 16f) + { + Main.screenPosition.X = Main.leftWorld + 640f + 16f; + } + else + { + if (Main.screenPosition.X + (float)Main.screenWidth > Main.rightWorld - 640f - 32f) + { + Main.screenPosition.X = Main.rightWorld - (float)Main.screenWidth - 640f - 32f; + } + } + if (Main.screenPosition.Y < Main.topWorld + 640f + 16f) + { + Main.screenPosition.Y = Main.topWorld + 640f + 16f; + } + else + { + if (Main.screenPosition.Y + (float)Main.screenHeight > Main.bottomWorld - 640f - 32f) + { + Main.screenPosition.Y = Main.bottomWorld - (float)Main.screenHeight - 640f - 32f; + } + } + } + if (Main.showSplash) + { + this.DrawSplash(gameTime); + return; + } + Main.sunCircle += 0.01f; + if ((double)Main.sunCircle > 6.285) + { + Main.sunCircle -= 6.285f; + } + if (!Main.gameMenu) + { + Main.findWaterfallCount++; + if (Main.findWaterfallCount >= 30) + { + Main.findWaterfallCount = 0; + Main.FindWaterfalls(); + } + if (Main.renderNow) + { + Main.screenLastPosition = Main.screenPosition; + Main.renderNow = false; + Main.renderCount = 99; + int tempLightCount = Lighting.tempLightCount; + this.Draw(gameTime); + Lighting.tempLightCount = tempLightCount; + Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); + Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); + this.RenderTiles(); + Main.sceneTilePos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneTilePos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + this.RenderBackground(); + Main.sceneBackgroundPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneBackgroundPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + this.RenderWalls(); + Main.sceneWallPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneWallPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + this.RenderTiles2(); + Main.sceneTile2Pos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneTile2Pos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + this.RenderWater(); + Main.sceneWaterPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneWaterPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + Main.renderCount = 99; + } + else + { + if (Main.renderCount == 3) + { + this.RenderTiles(); + Main.sceneTilePos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneTilePos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Main.renderCount == 2) + { + this.RenderBackground(); + Main.sceneBackgroundPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneBackgroundPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Main.renderCount == 2) + { + this.RenderWalls(); + Main.sceneWallPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneWallPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Main.renderCount == 3) + { + this.RenderTiles2(); + Main.sceneTile2Pos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneTile2Pos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Main.renderCount == 1) + { + this.RenderWater(); + Main.sceneWaterPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneWaterPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + } + if (Main.render && !Main.gameMenu) + { + if (Math.Abs(Main.sceneTilePos.X - (Main.screenPosition.X - (float)Main.offScreenRange)) > (float)Main.offScreenRange || Math.Abs(Main.sceneTilePos.Y - (Main.screenPosition.Y - (float)Main.offScreenRange)) > (float)Main.offScreenRange) + { + this.RenderTiles(); + Main.sceneTilePos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneTilePos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Math.Abs(Main.sceneTile2Pos.X - (Main.screenPosition.X - (float)Main.offScreenRange)) > (float)Main.offScreenRange || Math.Abs(Main.sceneTile2Pos.Y - (Main.screenPosition.Y - (float)Main.offScreenRange)) > (float)Main.offScreenRange) + { + this.RenderTiles2(); + Main.sceneTile2Pos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneTile2Pos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Math.Abs(Main.sceneBackgroundPos.X - (Main.screenPosition.X - (float)Main.offScreenRange)) > (float)Main.offScreenRange || Math.Abs(Main.sceneBackgroundPos.Y - (Main.screenPosition.Y - (float)Main.offScreenRange)) > (float)Main.offScreenRange) + { + this.RenderBackground(); + Main.sceneBackgroundPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneBackgroundPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Math.Abs(Main.sceneWallPos.X - (Main.screenPosition.X - (float)Main.offScreenRange)) > (float)Main.offScreenRange || Math.Abs(Main.sceneWallPos.Y - (Main.screenPosition.Y - (float)Main.offScreenRange)) > (float)Main.offScreenRange) + { + this.RenderWalls(); + Main.sceneWallPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneWallPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + if (Math.Abs(Main.sceneWaterPos.X - (Main.screenPosition.X - (float)Main.offScreenRange)) > (float)Main.offScreenRange || Math.Abs(Main.sceneWaterPos.Y - (Main.screenPosition.Y - (float)Main.offScreenRange)) > (float)Main.offScreenRange) + { + this.RenderWater(); + Main.sceneWaterPos.X = Main.screenPosition.X - (float)Main.offScreenRange; + Main.sceneWaterPos.Y = Main.screenPosition.Y - (float)Main.offScreenRange; + } + } + } + if (!Main.loadMap) + { + if (Main.updateMap) + { + if (base.IsActive || Main.netMode == 1) + { + if (Main.refreshMap || Main.mapUnfinished) + { + if (Main.refreshMap) + { + Main.refreshMap = false; + for (int i = 0; i < Main.maxTilesX; i++) + { + for (int j = 0; j < Main.maxTilesY; j++) + { + if (Main.map[i, j] != null) + { + Main.map[i, j].changed(true); + } + } + } + } + Main.mapMinX = 0; + Main.mapMaxX = Main.maxTilesX; + Main.mapMinY = 0; + Main.mapMaxY = Main.maxTilesY; + } + this.DrawToMap(); + Main.updateMap = false; + } + else + { + if (Main.mapUnfinished) + { + Main.mapMinX = 0; + Main.mapMaxX = Main.maxTilesX; + Main.mapMinY = 0; + Main.mapMaxY = Main.maxTilesY; + this.DrawToMap(); + } + else + { + if (Map.numUpdateTile > 0) + { + this.DrawToMap(); + } + } + } + } + else + { + if (Main.mapUnfinished) + { + Main.mapMinX = 0; + Main.mapMaxX = Main.maxTilesX; + Main.mapMinY = 0; + Main.mapMaxY = Main.maxTilesY; + this.DrawToMap(); + } + } + } + this.bgParrallax = 0.1; + this.bgStart = (int)(-Math.IEEERemainder((double)Main.screenPosition.X * this.bgParrallax, (double)Main.backgroundWidth[Main.background]) - (double)(Main.backgroundWidth[Main.background] / 2)); + this.bgLoops = Main.screenWidth / Main.backgroundWidth[Main.background] + 2; + this.bgStartY = 0; + this.bgLoopsY = 0; + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0); + Main.bgColor = Color.White; + if (Main.gameMenu || Main.netMode == 2) + { + this.bgTop = -200; + } + int num16 = (int)(Main.time / 54000.0 * (double)(Main.screenWidth + Main.sunTexture.Width * 2)) - Main.sunTexture.Width; + int num17 = 0; + Color white = Color.White; + float num18 = 1f; + float rotation = (float)(Main.time / 54000.0) * 2f - 7.3f; + int num19 = (int)(Main.time / 32400.0 * (double)(Main.screenWidth + Main.moonTexture[Main.moonType].Width * 2)) - Main.moonTexture[Main.moonType].Width; + int num20 = 0; + Color white2 = Color.White; + float num21 = 1f; + float rotation2 = (float)(Main.time / 32400.0) * 2f - 7.3f; + if (Main.dayTime) + { + double num22; + if (Main.time < 27000.0) + { + num22 = Math.Pow(1.0 - Main.time / 54000.0 * 2.0, 2.0); + num17 = (int)((double)this.bgTop + num22 * 250.0 + 180.0); + } + else + { + num22 = Math.Pow((Main.time / 54000.0 - 0.5) * 2.0, 2.0); + num17 = (int)((double)this.bgTop + num22 * 250.0 + 180.0); + } + num18 = (float)(1.2 - num22 * 0.4); + } + else + { + double num23; + if (Main.time < 16200.0) + { + num23 = Math.Pow(1.0 - Main.time / 32400.0 * 2.0, 2.0); + num20 = (int)((double)this.bgTop + num23 * 250.0 + 180.0); + } + else + { + num23 = Math.Pow((Main.time / 32400.0 - 0.5) * 2.0, 2.0); + num20 = (int)((double)this.bgTop + num23 * 250.0 + 180.0); + } + num21 = (float)(1.2 - num23 * 0.4); + } + if (Main.dayTime) + { + if (Main.time < 13500.0) + { + float num24 = (float)(Main.time / 13500.0); + white.R = (byte)(num24 * 200f + 55f); + white.G = (byte)(num24 * 180f + 75f); + white.B = (byte)(num24 * 250f + 5f); + Main.bgColor.R = (byte)(num24 * 230f + 25f); + Main.bgColor.G = (byte)(num24 * 220f + 35f); + Main.bgColor.B = (byte)(num24 * 220f + 35f); + } + if (Main.time > 45900.0) + { + float num24 = (float)(1.0 - (Main.time / 54000.0 - 0.85) * 6.666666666666667); + white.R = (byte)(num24 * 120f + 55f); + white.G = (byte)(num24 * 100f + 25f); + white.B = (byte)(num24 * 120f + 55f); + Main.bgColor.R = (byte)(num24 * 200f + 35f); + Main.bgColor.G = (byte)(num24 * 85f + 35f); + Main.bgColor.B = (byte)(num24 * 135f + 35f); + } + else + { + if (Main.time > 37800.0) + { + float num24 = (float)(1.0 - (Main.time / 54000.0 - 0.7) * 6.666666666666667); + white.R = (byte)(num24 * 80f + 175f); + white.G = (byte)(num24 * 130f + 125f); + white.B = (byte)(num24 * 100f + 155f); + Main.bgColor.R = (byte)(num24 * 20f + 235f); + Main.bgColor.G = (byte)(num24 * 135f + 120f); + Main.bgColor.B = (byte)(num24 * 85f + 170f); + } + } + } + if (!Main.dayTime) + { + if (Main.bloodMoon) + { + if (Main.time < 16200.0) + { + float num24 = (float)(1.0 - Main.time / 16200.0); + white2.R = (byte)(num24 * 10f + 205f); + white2.G = (byte)(num24 * 170f + 55f); + white2.B = (byte)(num24 * 200f + 55f); + Main.bgColor.R = (byte)(40f - num24 * 40f + 35f); + Main.bgColor.G = (byte)(num24 * 20f + 15f); + Main.bgColor.B = (byte)(num24 * 20f + 15f); + } + else + { + if (Main.time >= 16200.0) + { + float num24 = (float)((Main.time / 32400.0 - 0.5) * 2.0); + white2.R = (byte)(num24 * 50f + 205f); + white2.G = (byte)(num24 * 100f + 155f); + white2.B = (byte)(num24 * 100f + 155f); + white2.R = (byte)(num24 * 10f + 205f); + white2.G = (byte)(num24 * 170f + 55f); + white2.B = (byte)(num24 * 200f + 55f); + Main.bgColor.R = (byte)(40f - num24 * 40f + 35f); + Main.bgColor.G = (byte)(num24 * 20f + 15f); + Main.bgColor.B = (byte)(num24 * 20f + 15f); + } + } + } + else + { + if (Main.time < 16200.0) + { + float num24 = (float)(1.0 - Main.time / 16200.0); + white2.R = (byte)(num24 * 10f + 205f); + white2.G = (byte)(num24 * 70f + 155f); + white2.B = (byte)(num24 * 100f + 155f); + Main.bgColor.R = (byte)(num24 * 30f + 5f); + Main.bgColor.G = (byte)(num24 * 30f + 5f); + Main.bgColor.B = (byte)(num24 * 30f + 5f); + } + else + { + if (Main.time >= 16200.0) + { + float num24 = (float)((Main.time / 32400.0 - 0.5) * 2.0); + white2.R = (byte)(num24 * 50f + 205f); + white2.G = (byte)(num24 * 100f + 155f); + white2.B = (byte)(num24 * 100f + 155f); + Main.bgColor.R = (byte)(num24 * 20f + 5f); + Main.bgColor.G = (byte)(num24 * 30f + 5f); + Main.bgColor.B = (byte)(num24 * 30f + 5f); + } + } + } + } + float num25 = 0.0005f * (float)Main.dayRate; + if (Main.gameMenu) + { + num25 *= 20f; + } + if (Main.raining) + { + if (Main.cloudAlpha > Main.maxRaining) + { + Main.cloudAlpha -= num25; + if (Main.cloudAlpha < Main.maxRaining) + { + Main.cloudAlpha = Main.maxRaining; + } + } + else + { + if (Main.cloudAlpha < Main.maxRaining) + { + Main.cloudAlpha += num25; + if (Main.cloudAlpha > Main.maxRaining) + { + Main.cloudAlpha = Main.maxRaining; + } + } + } + } + else + { + Main.cloudAlpha -= num25; + if (Main.cloudAlpha < 0f) + { + Main.cloudAlpha = 0f; + } + } + if (Main.cloudAlpha > 0f) + { + float num26 = 1f - Main.cloudAlpha * 0.9f; + Main.bgColor.R = (byte)((float)Main.bgColor.R * num26); + Main.bgColor.G = (byte)((float)Main.bgColor.G * num26); + Main.bgColor.B = (byte)((float)Main.bgColor.B * num26); + } + if (Main.gameMenu || Main.netMode == 2) + { + this.bgTop = 0; + if (!Main.dayTime) + { + Main.bgColor.R = 35; + Main.bgColor.G = 35; + Main.bgColor.B = 35; + } + } + if (Main.gameMenu) + { + Main.bgDelay = 1000; + Main.evilTiles = (int)(Main.bgAlpha[1] * 500f); + } + if (Main.evilTiles > 0) + { + float num27 = (float)Main.evilTiles / 500f; + if (num27 > 1f) + { + num27 = 1f; + } + int num28 = (int)Main.bgColor.R; + int num29 = (int)Main.bgColor.G; + int num30 = (int)Main.bgColor.B; + num28 -= (int)(100f * num27 * ((float)Main.bgColor.R / 255f)); + num29 -= (int)(140f * num27 * ((float)Main.bgColor.G / 255f)); + num30 -= (int)(80f * num27 * ((float)Main.bgColor.B / 255f)); + if (num28 < 15) + { + num28 = 15; + } + if (num29 < 15) + { + num29 = 15; + } + if (num30 < 15) + { + num30 = 15; + } + Main.bgColor.R = (byte)num28; + Main.bgColor.G = (byte)num29; + Main.bgColor.B = (byte)num30; + num28 = (int)white.R; + num29 = (int)white.G; + num30 = (int)white.B; + num28 -= (int)(100f * num27 * ((float)white.R / 255f)); + num29 -= (int)(100f * num27 * ((float)white.G / 255f)); + num30 -= (int)(0f * num27 * ((float)white.B / 255f)); + if (num28 < 15) + { + num28 = 15; + } + if (num29 < 15) + { + num29 = 15; + } + if (num30 < 15) + { + num30 = 15; + } + white.R = (byte)num28; + white.G = (byte)num29; + white.B = (byte)num30; + num28 = (int)white2.R; + num29 = (int)white2.G; + num30 = (int)white2.B; + num28 -= (int)(140f * num27 * ((float)white2.R / 255f)); + num29 -= (int)(190f * num27 * ((float)white2.G / 255f)); + num30 -= (int)(170f * num27 * ((float)white2.B / 255f)); + if (num28 < 15) + { + num28 = 15; + } + if (num29 < 15) + { + num29 = 15; + } + if (num30 < 15) + { + num30 = 15; + } + white2.R = (byte)num28; + white2.G = (byte)num29; + white2.B = (byte)num30; + } + if (Main.bloodTiles > 0) + { + float num31 = (float)Main.bloodTiles / 400f; + if (num31 > 1f) + { + num31 = 1f; + } + int num32 = (int)Main.bgColor.R; + int num33 = (int)Main.bgColor.G; + int num34 = (int)Main.bgColor.B; + num32 -= (int)(70f * num31 * ((float)Main.bgColor.G / 255f)); + num33 -= (int)(110f * num31 * ((float)Main.bgColor.G / 255f)); + num34 -= (int)(150f * num31 * ((float)Main.bgColor.B / 255f)); + if (num32 < 15) + { + num32 = 15; + } + if (num33 < 15) + { + num33 = 15; + } + if (num34 < 15) + { + num34 = 15; + } + Main.bgColor.R = (byte)num32; + Main.bgColor.G = (byte)num33; + Main.bgColor.B = (byte)num34; + num32 = (int)white.R; + num33 = (int)white.G; + num34 = (int)white.B; + num33 -= (int)(90f * num31 * ((float)white.G / 255f)); + num34 -= (int)(110f * num31 * ((float)white.B / 255f)); + if (num32 < 15) + { + num32 = 15; + } + if (num33 < 15) + { + num33 = 15; + } + if (num34 < 15) + { + num34 = 15; + } + white.R = (byte)num32; + white.G = (byte)num33; + white.B = (byte)num34; + num32 = (int)white2.R; + num33 = (int)white2.G; + num34 = (int)white2.B; + num32 -= (int)(100f * num31 * ((float)white2.R / 255f)); + num33 -= (int)(120f * num31 * ((float)white2.G / 255f)); + num34 -= (int)(180f * num31 * ((float)white2.B / 255f)); + if (num32 < 15) + { + num32 = 15; + } + if (num33 < 15) + { + num33 = 15; + } + if (num34 < 15) + { + num34 = 15; + } + white2.R = (byte)num32; + white2.G = (byte)num33; + white2.B = (byte)num34; + } + if (Main.jungleTiles > 0) + { + float num35 = (float)Main.jungleTiles / 200f; + if (num35 > 1f) + { + num35 = 1f; + } + int num36 = (int)Main.bgColor.R; + int num37 = (int)Main.bgColor.G; + int num38 = (int)Main.bgColor.B; + num36 -= (int)(40f * num35 * ((float)Main.bgColor.R / 255f)); + num38 -= (int)(70f * num35 * ((float)Main.bgColor.B / 255f)); + if (num37 > 255) + { + num37 = 255; + } + if (num37 < 15) + { + num37 = 15; + } + if (num36 > 255) + { + num36 = 255; + } + if (num36 < 15) + { + num36 = 15; + } + if (num38 < 15) + { + num38 = 15; + } + Main.bgColor.R = (byte)num36; + Main.bgColor.G = (byte)num37; + Main.bgColor.B = (byte)num38; + num36 = (int)white.R; + num37 = (int)white.G; + num38 = (int)white.B; + num36 -= (int)(30f * num35 * ((float)white.R / 255f)); + num38 -= (int)(10f * num35 * ((float)white.B / 255f)); + if (num36 < 15) + { + num36 = 15; + } + if (num37 < 15) + { + num37 = 15; + } + if (num38 < 15) + { + num38 = 15; + } + white.R = (byte)num36; + white.G = (byte)num37; + white.B = (byte)num38; + num36 = (int)white2.R; + num37 = (int)white2.G; + num38 = (int)white2.B; + num37 -= (int)(140f * num35 * ((float)white2.R / 255f)); + num36 -= (int)(170f * num35 * ((float)white2.G / 255f)); + num38 -= (int)(190f * num35 * ((float)white2.B / 255f)); + if (num36 < 15) + { + num36 = 15; + } + if (num37 < 15) + { + num37 = 15; + } + if (num38 < 15) + { + num38 = 15; + } + white2.R = (byte)num36; + white2.G = (byte)num37; + white2.B = (byte)num38; + } + if (Main.shroomTiles > 0) + { + float num39 = (float)Main.shroomTiles / 160f; + if (num39 > Main.shroomLight) + { + Main.shroomLight += 0.01f; + } + if (num39 < Main.shroomLight) + { + Main.shroomLight -= 0.01f; + } + } + else + { + Main.shroomLight -= 0.02f; + } + if (Main.shroomLight < 0f) + { + Main.shroomLight = 0f; + } + if (Main.shroomLight > 1f) + { + Main.shroomLight = 1f; + } + if (Main.shroomLight > 0f) + { + float num40 = Main.shroomLight; + int num41 = (int)Main.bgColor.R; + int num42 = (int)Main.bgColor.G; + int num43 = (int)Main.bgColor.B; + num42 -= (int)(250f * num40 * ((float)Main.bgColor.G / 255f)); + num41 -= (int)(250f * num40 * ((float)Main.bgColor.R / 255f)); + num43 -= (int)(250f * num40 * ((float)Main.bgColor.B / 255f)); + if (num42 < 15) + { + num42 = 15; + } + if (num41 < 15) + { + num41 = 15; + } + if (num43 < 15) + { + num43 = 15; + } + Main.bgColor.R = (byte)num41; + Main.bgColor.G = (byte)num42; + Main.bgColor.B = (byte)num43; + num41 = (int)white.R; + num42 = (int)white.G; + num43 = (int)white.B; + num42 -= (int)(10f * num40 * ((float)white.G / 255f)); + num41 -= (int)(30f * num40 * ((float)white.R / 255f)); + num43 -= (int)(10f * num40 * ((float)white.B / 255f)); + if (num41 < 15) + { + num41 = 15; + } + if (num42 < 15) + { + num42 = 15; + } + if (num43 < 15) + { + num43 = 15; + } + white.R = (byte)num41; + white.G = (byte)num42; + white.B = (byte)num43; + num41 = (int)white2.R; + num42 = (int)white2.G; + num43 = (int)white2.B; + num42 -= (int)(140f * num40 * ((float)white2.R / 255f)); + num41 -= (int)(170f * num40 * ((float)white2.G / 255f)); + num43 -= (int)(190f * num40 * ((float)white2.B / 255f)); + if (num41 < 15) + { + num41 = 15; + } + if (num42 < 15) + { + num42 = 15; + } + if (num43 < 15) + { + num43 = 15; + } + white2.R = (byte)num41; + white2.G = (byte)num42; + white2.B = (byte)num43; + } + if (Lighting.lightMode < 2) + { + if (Main.bgColor.R < 10) + { + Main.bgColor.R = 10; + } + if (Main.bgColor.G < 10) + { + Main.bgColor.G = 10; + } + if (Main.bgColor.B < 10) + { + Main.bgColor.B = 10; + } + } + else + { + if (Main.bgColor.R < 15) + { + Main.bgColor.R = 15; + } + if (Main.bgColor.G < 15) + { + Main.bgColor.G = 15; + } + if (Main.bgColor.B < 15) + { + Main.bgColor.B = 15; + } + } + if (Main.bloodMoon) + { + if (Main.bgColor.R < 25) + { + Main.bgColor.R = 25; + } + if (Main.bgColor.G < 25) + { + Main.bgColor.G = 25; + } + if (Main.bgColor.B < 25) + { + Main.bgColor.B = 25; + } + } + if (Main.eclipse && Main.dayTime) + { + float num44 = 1242f; + Main.eclipseLight = (float)(Main.time / (double)num44); + if (Main.eclipseLight > 1f) + { + Main.eclipseLight = 1f; + } + } + else + { + if (Main.eclipseLight > 0f) + { + Main.eclipseLight -= 0.01f; + if (Main.eclipseLight < 0f) + { + Main.eclipseLight = 0f; + } + } + } + if (Main.eclipseLight > 0f) + { + float num45 = 1f - 0.925f * Main.eclipseLight; + float num46 = 1f - 0.96f * Main.eclipseLight; + float num47 = 1f - 1f * Main.eclipseLight; + int num48 = (int)((float)Main.bgColor.R * num45); + int num49 = (int)((float)Main.bgColor.G * num46); + int num50 = (int)((float)Main.bgColor.B * num47); + Main.bgColor.R = (byte)num48; + Main.bgColor.G = (byte)num49; + Main.bgColor.B = (byte)num50; + white.R = 255; + white.G = 127; + white.B = 67; + if (Main.bgColor.R < 20) + { + Main.bgColor.R = 20; + } + if (Main.bgColor.G < 10) + { + Main.bgColor.G = 10; + } + if (Lighting.lightMode >= 2) + { + if (Main.bgColor.R < 20) + { + Main.bgColor.R = 20; + } + if (Main.bgColor.G < 14) + { + Main.bgColor.G = 14; + } + if (Main.bgColor.B < 6) + { + Main.bgColor.B = 6; + } + } + } + Main.tileColor.A = 255; + Main.tileColor.R = (byte)((Main.bgColor.R + Main.bgColor.B + Main.bgColor.G) / 3); + Main.tileColor.G = (byte)((Main.bgColor.R + Main.bgColor.B + Main.bgColor.G) / 3); + Main.tileColor.B = (byte)((Main.bgColor.R + Main.bgColor.B + Main.bgColor.G) / 3); + Main.tileColor.R = (byte)((Main.bgColor.R + Main.bgColor.G + Main.bgColor.B + Main.bgColor.R * 7) / 10); + Main.tileColor.G = (byte)((Main.bgColor.R + Main.bgColor.G + Main.bgColor.B + Main.bgColor.G * 7) / 10); + Main.tileColor.B = (byte)((Main.bgColor.R + Main.bgColor.G + Main.bgColor.B + Main.bgColor.B * 7) / 10); + if (Main.tileColor.R >= 255 && Main.tileColor.G >= 255) + { + byte arg_2856_0 = Main.tileColor.B; + } + float num51 = (float)(Main.maxTilesX / 4200); + num51 *= num51; + Main.atmo = (float)((double)((Main.screenPosition.Y + (float)(Main.screenHeight / 2)) / 16f - (65f + 10f * num51)) / (Main.worldSurface / 5.0)); + if (Main.atmo < 0f) + { + Main.atmo = 0f; + } + if (Main.atmo > 1f) + { + Main.atmo = 1f; + } + if (Main.gameMenu) + { + Main.atmo = 1f; + } + Main.bgColor.R = (byte)((float)Main.bgColor.R * Main.atmo); + Main.bgColor.G = (byte)((float)Main.bgColor.G * Main.atmo); + Main.bgColor.B = (byte)((float)Main.bgColor.B * Main.atmo); + if ((double)Main.atmo <= 0.05) + { + Main.bgColor.R = 0; + Main.bgColor.G = 0; + Main.bgColor.B = 0; + Main.bgColor.A = 0; + } + base.GraphicsDevice.Clear(Color.Black); + base.Draw(gameTime); + if (Main.gameMenu || Main.player[Main.myPlayer].gravDir == 1f) + { + this.Transform = Matrix.CreateScale(1f, 1f, 1f) * Matrix.CreateRotationZ(0f) * Matrix.CreateTranslation(new Vector3(0f, 0f, 0f)); + this.Rasterizer = RasterizerState.CullCounterClockwise; + } + else + { + this.Transform = Matrix.CreateScale(1f, -1f, 1f) * Matrix.CreateRotationZ(0f) * Matrix.CreateTranslation(new Vector3(0f, (float)Main.screenHeight, 0f)); + this.Rasterizer = RasterizerState.CullClockwise; + } + this.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.Rasterizer, null, this.Transform); + if (!Main.mapFullscreen) + { + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int k = 0; k < this.bgLoops; k++) + { + this.spriteBatch.Draw(Main.backgroundTexture[Main.background], new Rectangle(this.bgStart + Main.backgroundWidth[Main.background] * k, this.bgTop, Main.backgroundWidth[Main.background], Main.backgroundHeight[Main.background]), Main.bgColor); + } + } + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0 && 255f * (1f - Main.cloudAlpha) - (float)Main.bgColor.R - 25f > 0f && Main.netMode != 2) + { + for (int l = 0; l < Main.numStars; l++) + { + Color color = default(Color); + float num52 = (float)Main.evilTiles / 500f; + if (num52 > 1f) + { + num52 = 1f; + } + num52 = 1f - num52 * 0.5f; + if (Main.evilTiles <= 0) + { + num52 = 1f; + } + int num53 = (int)((float)(255 - Main.bgColor.R - 100) * Main.star[l].twinkle * num52); + int num54 = (int)((float)(255 - Main.bgColor.G - 100) * Main.star[l].twinkle * num52); + int num55 = (int)((float)(255 - Main.bgColor.B - 100) * Main.star[l].twinkle * num52); + if (num53 < 0) + { + num53 = 0; + } + if (num54 < 0) + { + num54 = 0; + } + if (num55 < 0) + { + num55 = 0; + } + color.R = (byte)num53; + color.G = (byte)((float)num54 * num52); + color.B = (byte)((float)num55 * num52); + float num56 = Main.star[l].position.X * ((float)Main.screenWidth / 800f); + float num57 = Main.star[l].position.Y * ((float)Main.screenHeight / 600f); + this.spriteBatch.Draw(Main.starTexture[Main.star[l].type], new Vector2(num56 + (float)Main.starTexture[Main.star[l].type].Width * 0.5f, num57 + (float)Main.starTexture[Main.star[l].type].Height * 0.5f + (float)this.bgTop), new Rectangle?(new Rectangle(0, 0, Main.starTexture[Main.star[l].type].Width, Main.starTexture[Main.star[l].type].Height)), color, Main.star[l].rotation, new Vector2((float)Main.starTexture[Main.star[l].type].Width * 0.5f, (float)Main.starTexture[Main.star[l].type].Height * 0.5f), Main.star[l].scale * Main.star[l].twinkle, SpriteEffects.None, 0f); + } + } + if ((double)(Main.screenPosition.Y / 16f) < Main.worldSurface + 2.0) + { + if (Main.dayTime) + { + num18 *= 1.1f; + if (Main.eclipse) + { + float num58 = 1f - Main.shroomLight; + num58 -= Main.cloudAlpha * 1.5f; + if (num58 < 0f) + { + num58 = 0f; + } + Color color2 = new Color((int)((byte)(255f * num58)), (int)((byte)((float)white.G * num58)), (int)((byte)((float)white.B * num58)), (int)((byte)(255f * num58))); + Color color3 = new Color((int)((byte)((float)white.R * num58)), (int)((byte)((float)white.G * num58)), (int)((byte)((float)white.B * num58)), (int)((byte)((float)(white.B - 60) * num58))); + this.spriteBatch.Draw(Main.sun3Texture, new Vector2((float)num16, (float)(num17 + (int)Main.sunModY)), new Rectangle?(new Rectangle(0, 0, Main.sun3Texture.Width, Main.sun3Texture.Height)), color2, rotation, new Vector2((float)(Main.sun3Texture.Width / 2), (float)(Main.sun3Texture.Height / 2)), num18, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.sun3Texture, new Vector2((float)num16, (float)(num17 + (int)Main.sunModY)), new Rectangle?(new Rectangle(0, 0, Main.sun3Texture.Width, Main.sun3Texture.Height)), color3, rotation, new Vector2((float)(Main.sun3Texture.Width / 2), (float)(Main.sun3Texture.Height / 2)), num18, SpriteEffects.None, 0f); + } + else + { + if (!Main.gameMenu && Main.player[Main.myPlayer].head == 12) + { + float num59 = 1f - Main.shroomLight; + num59 -= Main.cloudAlpha * 1.5f; + if (num59 < 0f) + { + num59 = 0f; + } + Color color4 = new Color((int)((byte)(255f * num59)), (int)((byte)((float)white.G * num59)), (int)((byte)((float)white.B * num59)), (int)((byte)(255f * num59))); + Color color5 = new Color((int)((byte)((float)white.R * num59)), (int)((byte)((float)white.G * num59)), (int)((byte)((float)white.B * num59)), (int)((byte)((float)(white.B - 60) * num59))); + this.spriteBatch.Draw(Main.sun2Texture, new Vector2((float)num16, (float)(num17 + (int)Main.sunModY)), new Rectangle?(new Rectangle(0, 0, Main.sun2Texture.Width, Main.sun2Texture.Height)), color4, rotation, new Vector2((float)(Main.sun2Texture.Width / 2), (float)(Main.sun2Texture.Height / 2)), num18, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.sun2Texture, new Vector2((float)num16, (float)(num17 + (int)Main.sunModY)), new Rectangle?(new Rectangle(0, 0, Main.sun2Texture.Width, Main.sun2Texture.Height)), color5, rotation, new Vector2((float)(Main.sun2Texture.Width / 2), (float)(Main.sun2Texture.Height / 2)), num18, SpriteEffects.None, 0f); + } + else + { + float num60 = 1f - Main.shroomLight; + num60 -= Main.cloudAlpha * 1.5f; + if (num60 < 0f) + { + num60 = 0f; + } + Color color6 = new Color((int)((byte)(255f * num60)), (int)((byte)((float)white.G * num60)), (int)((byte)((float)white.B * num60)), (int)((byte)(255f * num60))); + Color color7 = new Color((int)((byte)((float)white.R * num60)), (int)((byte)((float)white.G * num60)), (int)((byte)((float)white.B * num60)), (int)((byte)((float)white.B * num60))); + this.spriteBatch.Draw(Main.sunTexture, new Vector2((float)num16, (float)(num17 + (int)Main.sunModY)), new Rectangle?(new Rectangle(0, 0, Main.sunTexture.Width, Main.sunTexture.Height)), color6, rotation, new Vector2((float)(Main.sunTexture.Width / 2), (float)(Main.sunTexture.Height / 2)), num18, SpriteEffects.None, 0f); + this.spriteBatch.Draw(Main.sunTexture, new Vector2((float)num16, (float)(num17 + (int)Main.sunModY)), new Rectangle?(new Rectangle(0, 0, Main.sunTexture.Width, Main.sunTexture.Height)), color7, rotation, new Vector2((float)(Main.sunTexture.Width / 2), (float)(Main.sunTexture.Height / 2)), num18, SpriteEffects.None, 0f); + } + } + } + if (!Main.dayTime) + { + float num61 = 1f - Main.cloudAlpha * 1.5f; + if (num61 < 0f) + { + num61 = 0f; + } + white2.R = (byte)((float)white2.R * num61); + white2.G = (byte)((float)white2.G * num61); + white2.B = (byte)((float)white2.B * num61); + white2.A = (byte)((float)white2.A * num61); + this.spriteBatch.Draw(Main.moonTexture[Main.moonType], new Vector2((float)num19, (float)(num20 + (int)Main.moonModY)), new Rectangle?(new Rectangle(0, Main.moonTexture[Main.moonType].Width * Main.moonPhase, Main.moonTexture[Main.moonType].Width, Main.moonTexture[Main.moonType].Width)), white2, rotation2, new Vector2((float)(Main.moonTexture[Main.moonType].Width / 2), (float)(Main.moonTexture[Main.moonType].Width / 2)), num21, SpriteEffects.None, 0f); + } + } + Rectangle value; + if (Main.dayTime) + { + value = new Rectangle((int)((double)num16 - (double)Main.sunTexture.Width * 0.5 * (double)num18), (int)((double)num17 - (double)Main.sunTexture.Height * 0.5 * (double)num18 + (double)Main.sunModY), (int)((float)Main.sunTexture.Width * num18), (int)((float)Main.sunTexture.Width * num18)); + } + else + { + value = new Rectangle((int)((double)num19 - (double)Main.moonTexture[Main.moonType].Width * 0.5 * (double)num21), (int)((double)num20 - (double)Main.moonTexture[Main.moonType].Width * 0.5 * (double)num21 + (double)Main.moonModY), (int)((float)Main.moonTexture[Main.moonType].Width * num21), (int)((float)Main.moonTexture[Main.moonType].Width * num21)); + } + Rectangle rectangle = new Rectangle(Main.mouseX, Main.mouseY, 1, 1); + Main.sunModY = (short)((double)Main.sunModY * 0.999); + Main.moonModY = (short)((double)Main.moonModY * 0.999); + if (Main.gameMenu && Main.netMode != 1) + { + if (Main.mouseLeft && Main.hasFocus) + { + if (rectangle.Intersects(value) || Main.grabSky) + { + if (Main.dayTime) + { + Main.time = 54000.0 * (double)((float)(Main.mouseX + Main.sunTexture.Width) / ((float)Main.screenWidth + (float)(Main.sunTexture.Width * 2))); + Main.sunModY = (short)(Main.mouseY - num17); + if (Main.time > 53990.0) + { + Main.time = 53990.0; + } + } + else + { + Main.time = 32400.0 * (double)((float)(Main.mouseX + Main.moonTexture[Main.moonType].Width) / ((float)Main.screenWidth + (float)(Main.moonTexture[Main.moonType].Width * 2))); + Main.moonModY = (short)(Main.mouseY - num20); + if (Main.time > 32390.0) + { + Main.time = 32390.0; + } + } + if (Main.time < 10.0) + { + Main.time = 10.0; + } + if (Main.netMode != 0) + { + NetMessage.SendData(18, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + Main.grabSky = true; + } + } + else + { + Main.grabSky = false; + } + } + } + this.scAdj = 1f - (float)((double)(Main.screenPosition.Y + (float)Main.screenHeight) / (Main.worldSurface * 16.0)); + this.scAdj = (float)(Main.worldSurface * 16.0) / (Main.screenPosition.Y + (float)Main.screenHeight); + float num62 = (float)Main.maxTilesY * 0.15f * 16f; + num62 -= Main.screenPosition.Y; + if (num62 < 0f) + { + num62 = 0f; + } + num62 *= 0.00025f; + float num63 = num62 * num62; + this.scAdj *= 0.45f - num63; + if ((double)Main.maxTilesY <= 1200.0) + { + this.scAdj *= -500f; + } + else + { + if ((double)Main.maxTilesY <= 1800.0) + { + this.scAdj *= -300f; + } + else + { + this.scAdj *= -150f; + } + } + this.screenOff = (float)(Main.screenHeight - 600); + this.bgTop = (int)((double)(-(double)Main.screenPosition.Y + this.screenOff / 2f) / (Main.worldSurface * 16.0) * 1200.0 + 1190.0) + (int)this.scAdj; + this.cTop = (float)(this.bgTop - 50); + if (Main.resetClouds) + { + Cloud.resetClouds(); + Main.resetClouds = false; + } + Main.bgScale = 1f; + Main.bgW = (int)((float)Main.backgroundWidth[Main.treeMntBG[0]] * Main.bgScale); + Main.backColor = Main.bgColor; + Main.trueBackColor = Main.backColor; + int num64 = Main.bgStyle; + int num65 = (int)((Main.screenPosition.X + (float)(Main.screenWidth / 2)) / 16f); + if ((double)(Main.screenPosition.Y / 16f) < Main.worldSurface + 10.0 && (num65 < 380 || num65 > Main.maxTilesX - 380)) + { + num64 = 4; + } + else + { + if (Main.shroomTiles > 100) + { + num64 = 9; + } + else + { + if (Main.sandTiles > 1000) + { + if (Main.player[Main.myPlayer].zoneEvil) + { + num64 = 5; + } + else + { + if (Main.player[Main.myPlayer].zoneBlood) + { + num64 = 5; + } + else + { + if (Main.player[Main.myPlayer].zoneHoly) + { + num64 = 5; + } + else + { + num64 = 2; + } + } + } + } + else + { + if (Main.player[Main.myPlayer].zoneHoly) + { + num64 = 6; + } + else + { + if (Main.player[Main.myPlayer].zoneEvil) + { + num64 = 1; + } + else + { + if (Main.player[Main.myPlayer].zoneBlood) + { + num64 = 8; + } + else + { + if (Main.player[Main.myPlayer].zoneJungle) + { + num64 = 3; + } + else + { + if (Main.player[Main.myPlayer].zoneSnow) + { + num64 = 7; + } + else + { + num64 = 0; + } + } + } + } + } + } + } + } + int num66 = 30; + Main.tranSpeed = 0.05f; + if (num64 == 0) + { + num66 = 60; + } + if (Main.bgDelay < 0) + { + Main.bgDelay++; + } + else + { + if (num64 != Main.bgStyle) + { + Main.bgDelay++; + if (Main.bgDelay > num66) + { + Main.bgDelay = -60; + Main.bgStyle = num64; + if (num64 == 0) + { + Main.bgDelay = 0; + } + } + } + else + { + if (Main.bgDelay > 0) + { + Main.bgDelay--; + } + } + } + if (Main.gameMenu) + { + Main.tranSpeed = 0.02f; + if (!Main.dayTime) + { + Main.bgStyle = 1; + } + else + { + Main.bgStyle = 0; + } + num64 = Main.bgStyle; + } + if (Main.quickBG > 0) + { + Main.quickBG--; + Main.bgStyle = num64; + Main.tranSpeed = 1f; + } + if (Main.bgStyle == 2) + { + Main.bgAlpha2[0] -= Main.tranSpeed; + if (Main.bgAlpha2[0] < 0f) + { + Main.bgAlpha2[0] = 0f; + } + Main.bgAlpha2[1] += Main.tranSpeed; + if (Main.bgAlpha2[1] > 1f) + { + Main.bgAlpha2[1] = 1f; + } + Main.bgAlpha2[2] -= Main.tranSpeed; + if (Main.bgAlpha2[2] < 0f) + { + Main.bgAlpha2[2] = 0f; + } + Main.bgAlpha2[3] -= Main.tranSpeed; + if (Main.bgAlpha2[3] < 0f) + { + Main.bgAlpha2[3] = 0f; + } + Main.bgAlpha2[4] -= Main.tranSpeed; + if (Main.bgAlpha2[4] < 0f) + { + Main.bgAlpha2[4] = 0f; + } + Main.bgAlpha2[5] -= Main.tranSpeed; + if (Main.bgAlpha2[5] < 0f) + { + Main.bgAlpha2[5] = 0f; + } + Main.bgAlpha2[6] -= Main.tranSpeed; + if (Main.bgAlpha2[6] < 0f) + { + Main.bgAlpha2[6] = 0f; + } + } + else + { + if (Main.bgStyle == 5 || Main.bgStyle == 1 || Main.bgStyle == 6) + { + Main.bgAlpha2[0] -= Main.tranSpeed; + if (Main.bgAlpha2[0] < 0f) + { + Main.bgAlpha2[0] = 0f; + } + Main.bgAlpha2[1] -= Main.tranSpeed; + if (Main.bgAlpha2[1] < 0f) + { + Main.bgAlpha2[1] = 0f; + } + Main.bgAlpha2[2] += Main.tranSpeed; + if (Main.bgAlpha2[2] > 1f) + { + Main.bgAlpha2[2] = 1f; + } + Main.bgAlpha2[3] -= Main.tranSpeed; + if (Main.bgAlpha2[3] < 0f) + { + Main.bgAlpha2[3] = 0f; + } + Main.bgAlpha2[4] -= Main.tranSpeed; + if (Main.bgAlpha2[4] < 0f) + { + Main.bgAlpha2[4] = 0f; + } + Main.bgAlpha2[5] -= Main.tranSpeed; + if (Main.bgAlpha2[5] < 0f) + { + Main.bgAlpha2[5] = 0f; + } + Main.bgAlpha2[6] -= Main.tranSpeed; + if (Main.bgAlpha2[6] < 0f) + { + Main.bgAlpha2[6] = 0f; + } + } + else + { + if (Main.bgStyle == 4) + { + Main.bgAlpha2[0] -= Main.tranSpeed; + if (Main.bgAlpha2[0] < 0f) + { + Main.bgAlpha2[0] = 0f; + } + Main.bgAlpha2[1] -= Main.tranSpeed; + if (Main.bgAlpha2[1] < 0f) + { + Main.bgAlpha2[1] = 0f; + } + Main.bgAlpha2[2] -= Main.tranSpeed; + if (Main.bgAlpha2[2] < 0f) + { + Main.bgAlpha2[2] = 0f; + } + Main.bgAlpha2[3] += Main.tranSpeed; + if (Main.bgAlpha2[3] > 1f) + { + Main.bgAlpha2[3] = 1f; + } + Main.bgAlpha2[4] -= Main.tranSpeed; + if (Main.bgAlpha2[4] < 0f) + { + Main.bgAlpha2[4] = 0f; + } + Main.bgAlpha2[5] -= Main.tranSpeed; + if (Main.bgAlpha2[5] < 0f) + { + Main.bgAlpha2[5] = 0f; + } + Main.bgAlpha2[6] -= Main.tranSpeed; + if (Main.bgAlpha2[6] < 0f) + { + Main.bgAlpha2[6] = 0f; + } + } + else + { + if (Main.bgStyle == 7) + { + Main.bgAlpha2[0] -= Main.tranSpeed; + if (Main.bgAlpha2[0] < 0f) + { + Main.bgAlpha2[0] = 0f; + } + Main.bgAlpha2[1] -= Main.tranSpeed; + if (Main.bgAlpha2[1] < 0f) + { + Main.bgAlpha2[1] = 0f; + } + Main.bgAlpha2[2] -= Main.tranSpeed; + if (Main.bgAlpha2[2] < 0f) + { + Main.bgAlpha2[2] = 0f; + } + Main.bgAlpha2[3] -= Main.tranSpeed; + if (Main.bgAlpha2[3] < 0f) + { + Main.bgAlpha2[3] = 0f; + } + Main.bgAlpha2[4] += Main.tranSpeed; + if (Main.bgAlpha2[4] > 1f) + { + Main.bgAlpha2[4] = 1f; + } + Main.bgAlpha2[5] -= Main.tranSpeed; + if (Main.bgAlpha2[5] < 0f) + { + Main.bgAlpha2[5] = 0f; + } + Main.bgAlpha2[6] -= Main.tranSpeed; + if (Main.bgAlpha2[6] < 0f) + { + Main.bgAlpha2[6] = 0f; + } + } + else + { + if (Main.bgStyle == 8) + { + Main.bgAlpha2[0] -= Main.tranSpeed; + if (Main.bgAlpha2[0] < 0f) + { + Main.bgAlpha2[0] = 0f; + } + Main.bgAlpha2[1] -= Main.tranSpeed; + if (Main.bgAlpha2[1] < 0f) + { + Main.bgAlpha2[1] = 0f; + } + Main.bgAlpha2[2] -= Main.tranSpeed; + if (Main.bgAlpha2[2] < 0f) + { + Main.bgAlpha2[2] = 0f; + } + Main.bgAlpha2[3] -= Main.tranSpeed; + if (Main.bgAlpha2[3] < 0f) + { + Main.bgAlpha2[3] = 0f; + } + Main.bgAlpha2[4] -= Main.tranSpeed; + if (Main.bgAlpha2[4] < 0f) + { + Main.bgAlpha2[4] = 0f; + } + Main.bgAlpha2[5] += Main.tranSpeed; + if (Main.bgAlpha2[5] > 1f) + { + Main.bgAlpha2[5] = 1f; + } + Main.bgAlpha2[6] -= Main.tranSpeed; + if (Main.bgAlpha2[6] < 0f) + { + Main.bgAlpha2[6] = 0f; + } + } + else + { + if (Main.bgStyle == 9) + { + Main.bgAlpha2[0] += Main.tranSpeed; + if (Main.bgAlpha2[0] > 1f) + { + Main.bgAlpha2[0] = 1f; + } + Main.bgAlpha2[1] -= Main.tranSpeed; + if (Main.bgAlpha2[1] < 0f) + { + Main.bgAlpha2[1] = 0f; + } + Main.bgAlpha2[2] -= Main.tranSpeed; + if (Main.bgAlpha2[2] < 0f) + { + Main.bgAlpha2[2] = 0f; + } + Main.bgAlpha2[3] -= Main.tranSpeed; + if (Main.bgAlpha2[3] < 0f) + { + Main.bgAlpha2[3] = 0f; + } + Main.bgAlpha2[4] -= Main.tranSpeed; + if (Main.bgAlpha2[4] < 0f) + { + Main.bgAlpha2[4] = 0f; + } + Main.bgAlpha2[5] -= Main.tranSpeed; + if (Main.bgAlpha2[5] < 0f) + { + Main.bgAlpha2[5] = 0f; + } + Main.bgAlpha2[6] += Main.tranSpeed; + if (Main.bgAlpha2[6] > 1f) + { + Main.bgAlpha2[6] = 1f; + } + } + else + { + Main.bgAlpha2[0] += Main.tranSpeed; + if (Main.bgAlpha2[0] > 1f) + { + Main.bgAlpha2[0] = 1f; + } + Main.bgAlpha2[1] -= Main.tranSpeed; + if (Main.bgAlpha2[1] < 0f) + { + Main.bgAlpha2[1] = 0f; + } + Main.bgAlpha2[2] -= Main.tranSpeed; + if (Main.bgAlpha2[2] < 0f) + { + Main.bgAlpha2[2] = 0f; + } + Main.bgAlpha2[3] -= Main.tranSpeed; + if (Main.bgAlpha2[3] < 0f) + { + Main.bgAlpha2[3] = 0f; + } + Main.bgAlpha2[4] -= Main.tranSpeed; + if (Main.bgAlpha2[4] < 0f) + { + Main.bgAlpha2[4] = 0f; + } + Main.bgAlpha2[5] -= Main.tranSpeed; + if (Main.bgAlpha2[5] < 0f) + { + Main.bgAlpha2[5] = 0f; + } + Main.bgAlpha2[6] -= Main.tranSpeed; + if (Main.bgAlpha2[6] < 0f) + { + Main.bgAlpha2[6] = 0f; + } + } + } + } + } + } + } + if (Main.ignoreErrors) + { + try + { + this.DrawSurfaceBG(); + goto IL_4520; + } + catch + { + goto IL_4520; + } + } + this.DrawSurfaceBG(); + IL_4520: + if (Main.gameMenu || Main.netMode == 2) + { + for (int m = 0; m < Main.maxRain; m++) + { + if (Main.rain[m].active) + { + Color color8 = Main.bgColor; + float num67 = 0.85f; + color8.R = (byte)((float)color8.R * num67); + color8.G = (byte)((float)color8.G * num67); + color8.B = (byte)((float)color8.B * num67); + color8.A = (byte)((float)color8.A * num67); + float rotation3 = (float)Math.Atan2((double)Main.rain[m].velocity.X, (double)(-(double)Main.rain[m].velocity.Y)); + this.spriteBatch.Draw(Main.rainTexture[(int)Main.rain[m].type], Main.rain[m].position - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, Main.rainTexture[(int)Main.rain[m].type].Width, Main.rainTexture[(int)Main.rain[m].type].Height)), color8, rotation3, default(Vector2), Main.rain[m].scale, SpriteEffects.None, 0f); + if (base.IsActive) + { + Main.rain[m].Update(); + } + } + } + this.DrawMenu(); + return; + } + this.firstTileX = (int)(Main.screenPosition.X / 16f - 1f); + this.lastTileX = (int)((Main.screenPosition.X + (float)Main.screenWidth) / 16f) + 2; + this.firstTileY = (int)(Main.screenPosition.Y / 16f - 1f); + this.lastTileY = (int)((Main.screenPosition.Y + (float)Main.screenHeight) / 16f) + 2; + if (this.firstTileX < 0) + { + this.firstTileX = 0; + } + if (this.lastTileX > Main.maxTilesX) + { + this.lastTileX = Main.maxTilesX; + } + if (this.firstTileY < 0) + { + this.firstTileY = 0; + } + if (this.lastTileY > Main.maxTilesY) + { + this.lastTileY = Main.maxTilesY; + } + if (!Main.drawSkip) + { + Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); + } + if (!Main.mapFullscreen) + { + Color arg_47FE_0 = Color.White; + if (Main.drawToScreen) + { + this.drawWaters(true); + } + else + { + this.spriteBatch.Draw(this.backWaterTarget, Main.sceneBackgroundPos - Main.screenPosition, Color.White); + } + float x = (Main.sceneBackgroundPos.X - Main.screenPosition.X + (float)Main.offScreenRange) * Main.caveParrallax - (float)Main.offScreenRange; + if (Main.drawToScreen) + { + this.DrawBackground(); + } + else + { + this.spriteBatch.Draw(this.backgroundTarget, new Vector2(x, Main.sceneBackgroundPos.Y - Main.screenPosition.Y), Color.White); + } + Main.magmaBGFrameCounter++; + if (Main.magmaBGFrameCounter >= 8) + { + Main.magmaBGFrameCounter = 0; + Main.magmaBGFrame++; + if (Main.magmaBGFrame >= 3) + { + Main.magmaBGFrame = 0; + } + } + try + { + if (Main.drawToScreen) + { + this.DrawBlack(); + this.DrawWalls(); + } + else + { + this.spriteBatch.Draw(this.blackTarget, Main.sceneTilePos - Main.screenPosition, Color.White); + this.spriteBatch.Draw(this.wallTarget, Main.sceneWallPos - Main.screenPosition, Color.White); + } + this.DrawWoF(); + if (Main.player[Main.myPlayer].detectCreature) + { + if (Main.drawToScreen) + { + this.DrawTiles(false); + this.drawWaterfalls(); + this.DrawTiles(true); + } + else + { + this.spriteBatch.Draw(this.tile2Target, Main.sceneTile2Pos - Main.screenPosition, Color.White); + this.drawWaterfalls(); + this.spriteBatch.Draw(this.tileTarget, Main.sceneTilePos - Main.screenPosition, Color.White); + } + this.DrawNPCs(true); + this.DrawNPCs(false); + } + else + { + if (Main.drawToScreen) + { + this.DrawTiles(false); + this.drawWaterfalls(); + this.DrawNPCs(true); + this.DrawTiles(true); + } + else + { + this.spriteBatch.Draw(this.tile2Target, Main.sceneTile2Pos - Main.screenPosition, Color.White); + this.drawWaterfalls(); + this.DrawNPCs(true); + this.spriteBatch.Draw(this.tileTarget, Main.sceneTilePos - Main.screenPosition, Color.White); + } + this.DrawNPCs(false); + } + } + catch + { + } + if (Main.ignoreErrors) + { + for (int n = 0; n < 1000; n++) + { + if (Main.projectile[n].active && Main.projectile[n].type > 0 && !Main.projectile[n].hide) + { + try + { + this.DrawProj(n); + } + catch + { + Main.projectile[n].active = false; + } + } + } + } + else + { + for (int num68 = 0; num68 < 1000; num68++) + { + if (Main.projectile[num68].active && Main.projectile[num68].type > 0 && !Main.projectile[num68].hide) + { + this.DrawProj(num68); + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.Rasterizer, null, this.Transform); + for (int num69 = 0; num69 < 255; num69++) + { + if (Main.player[num69].active && !Main.player[num69].outOfRange) + { + if (Main.player[num69].ghost) + { + Vector2 position = Main.player[num69].position; + Main.player[num69].position = Main.player[num69].shadowPos[0]; + Main.player[num69].shadow = 0.5f; + this.DrawGhost(Main.player[num69]); + Main.player[num69].position = Main.player[num69].shadowPos[1]; + Main.player[num69].shadow = 0.7f; + this.DrawGhost(Main.player[num69]); + Main.player[num69].position = Main.player[num69].shadowPos[2]; + Main.player[num69].shadow = 0.9f; + this.DrawGhost(Main.player[num69]); + Main.player[num69].position = position; + Main.player[num69].shadow = 0f; + this.DrawGhost(Main.player[num69]); + } + else + { + if (Main.player[num69].inventory[Main.player[num69].selectedItem].flame) + { + Main.player[num69].itemFlameCount--; + if (Main.player[num69].itemFlameCount <= 0) + { + Main.player[num69].itemFlameCount = 5; + for (int num70 = 0; num70 < 7; num70++) + { + Main.player[num69].itemFlamePos[num70].X = (float)Main.rand.Next(-10, 11) * 0.15f; + Main.player[num69].itemFlamePos[num70].Y = (float)Main.rand.Next(-10, 1) * 0.35f; + } + } + } + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + if (Main.player[num69].head == 111 && Main.player[num69].body == 73 && Main.player[num69].legs == 62) + { + flag3 = true; + flag4 = true; + } + if (Main.player[num69].head == 107 && Main.player[num69].body == 69 && Main.player[num69].legs == 58) + { + flag3 = true; + flag2 = true; + } + if (Main.player[num69].head == 108 && Main.player[num69].body == 70 && Main.player[num69].legs == 59) + { + flag3 = true; + flag2 = true; + } + if (Main.player[num69].head == 109 && Main.player[num69].body == 71 && Main.player[num69].legs == 60) + { + flag3 = true; + flag2 = true; + } + if (Main.player[num69].head == 110 && Main.player[num69].body == 72 && Main.player[num69].legs == 61) + { + flag3 = true; + flag2 = true; + } + if (Main.player[num69].body == 67 && Main.player[num69].legs == 56 && Main.player[num69].head >= 103 && Main.player[num69].head <= 105) + { + flag2 = true; + } + if ((Main.player[num69].head == 78 || Main.player[num69].head == 79 || Main.player[num69].head == 80) && Main.player[num69].body == 51 && Main.player[num69].legs == 47) + { + flag3 = true; + } + if (Main.player[num69].dashDelay < 0) + { + flag2 = true; + } + if (Main.player[num69].head == 5 && Main.player[num69].body == 5 && Main.player[num69].legs == 5) + { + flag2 = true; + } + if (Main.player[num69].head == 74 && Main.player[num69].body == 48 && Main.player[num69].legs == 44) + { + flag2 = true; + } + if (Main.player[num69].head == 76 && Main.player[num69].body == 49 && Main.player[num69].legs == 45) + { + flag2 = true; + } + if (Main.player[num69].head == 7 && Main.player[num69].body == 7 && Main.player[num69].legs == 7) + { + flag2 = true; + } + if (Main.player[num69].head == 22 && Main.player[num69].body == 14 && Main.player[num69].legs == 14) + { + flag2 = true; + } + if (Main.player[num69].dye[0].dye == 30 && Main.player[num69].dye[1].dye == 30 && Main.player[num69].dye[2].dye == 30 && Main.player[num69].head == 4 && Main.player[num69].body == 27 && Main.player[num69].legs == 26) + { + flag2 = true; + flag4 = true; + } + if (Main.player[num69].body == 17 && Main.player[num69].legs == 16 && (Main.player[num69].head == 29 || Main.player[num69].head == 30 || Main.player[num69].head == 31)) + { + flag2 = true; + } + if (Main.player[num69].body == 19 && Main.player[num69].legs == 18 && (Main.player[num69].head == 35 || Main.player[num69].head == 36 || Main.player[num69].head == 37)) + { + flag4 = true; + } + if (Main.myPlayer == num69) + { + bool flag5 = false; + if (Main.player[num69].wings == 3 || (Main.player[num69].wings >= 16 && Main.player[num69].wings <= 19)) + { + flag5 = true; + } + else + { + if (Main.player[num69].head == 45 || (Main.player[num69].head >= 106 && Main.player[num69].head <= 110)) + { + flag5 = true; + } + else + { + if (Main.player[num69].body == 26 || (Main.player[num69].body >= 68 && Main.player[num69].body <= 74)) + { + flag5 = true; + } + else + { + if (Main.player[num69].legs == 25 || (Main.player[num69].legs >= 57 && Main.player[num69].legs <= 63)) + { + flag5 = true; + } + } + } + } + if (flag5) + { + Player expr_525E_cp_0 = Main.player[num69]; + expr_525E_cp_0.velocity.X = expr_525E_cp_0.velocity.X * 0.9f; + if (Main.player[num69].velocity.Y < 0f) + { + Player expr_5295_cp_0 = Main.player[num69]; + expr_5295_cp_0.velocity.Y = expr_5295_cp_0.velocity.Y + 0.2f; + } + Main.player[num69].jump = 0; + Main.player[num69].statDefense = -1000; + Main.player[num69].AddBuff(23, 2, false); + Main.player[num69].AddBuff(80, 2, false); + Main.player[num69].AddBuff(67, 2, false); + Main.player[num69].AddBuff(32, 2, false); + Main.player[num69].AddBuff(31, 2, false); + Main.player[num69].AddBuff(33, 2, false); + } + } + if (Main.player[num69].body == 26 && Main.player[num69].legs == 25 && Main.player[num69].head == 45) + { + flag4 = true; + flag2 = true; + } + if (Main.player[num69].body == 26 && Main.player[num69].legs == 25 && Main.player[num69].head == 63) + { + flag4 = true; + flag2 = true; + } + if (Main.player[num69].body == 24 && Main.player[num69].legs == 23 && (Main.player[num69].head == 41 || Main.player[num69].head == 42 || Main.player[num69].head == 43)) + { + flag4 = true; + flag2 = true; + } + if (Main.player[num69].body == 36 && Main.player[num69].head == 56) + { + flag4 = true; + } + if (flag4) + { + Vector2 position2 = Main.player[num69].position; + if (!Main.gamePaused) + { + Main.player[num69].ghostFade += Main.player[num69].ghostDir * 0.075f; + } + if ((double)Main.player[num69].ghostFade < 0.1) + { + Main.player[num69].ghostDir = 1f; + Main.player[num69].ghostFade = 0.1f; + } + if ((double)Main.player[num69].ghostFade > 0.9) + { + Main.player[num69].ghostDir = -1f; + Main.player[num69].ghostFade = 0.9f; + } + Main.player[num69].position.X = position2.X - Main.player[num69].ghostFade * 5f; + Player expr_5516_cp_0 = Main.player[num69]; + expr_5516_cp_0.position.Y = expr_5516_cp_0.position.Y + Main.player[num69].gfxOffY; + Main.player[num69].shadow = Main.player[num69].ghostFade; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position.X = position2.X + Main.player[num69].ghostFade * 5f; + Main.player[num69].shadow = Main.player[num69].ghostFade; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position = position2; + Main.player[num69].position.Y = position2.Y - Main.player[num69].ghostFade * 5f; + Player expr_55F5_cp_0 = Main.player[num69]; + expr_55F5_cp_0.position.Y = expr_55F5_cp_0.position.Y + Main.player[num69].gfxOffY; + Main.player[num69].shadow = Main.player[num69].ghostFade; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position.Y = position2.Y + Main.player[num69].ghostFade * 5f; + Player expr_5670_cp_0 = Main.player[num69]; + expr_5670_cp_0.position.Y = expr_5670_cp_0.position.Y + Main.player[num69].gfxOffY; + Main.player[num69].shadow = Main.player[num69].ghostFade; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position = position2; + Main.player[num69].shadow = 0f; + } + if (flag2) + { + Vector2 position3 = Main.player[num69].position; + Main.player[num69].position = Main.player[num69].shadowPos[0]; + Main.player[num69].shadow = 0.5f; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position = Main.player[num69].shadowPos[1]; + Main.player[num69].shadow = 0.7f; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position = Main.player[num69].shadowPos[2]; + Main.player[num69].shadow = 0.9f; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position = position3; + Main.player[num69].shadow = 0f; + } + if (flag3) + { + for (int num71 = 0; num71 < 4; num71++) + { + Vector2 position4 = Main.player[num69].position; + Player expr_5803_cp_0 = Main.player[num69]; + expr_5803_cp_0.position.X = expr_5803_cp_0.position.X + (float)Main.rand.Next(-20, 21) * 0.1f; + Player expr_5831_cp_0 = Main.player[num69]; + expr_5831_cp_0.position.Y = expr_5831_cp_0.position.Y + (float)Main.rand.Next(-20, 21) * 0.1f; + Player expr_585F_cp_0 = Main.player[num69]; + expr_585F_cp_0.position.Y = expr_585F_cp_0.position.Y + Main.player[num69].gfxOffY; + Main.player[num69].shadow = 0.9f; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].position = position4; + Main.player[num69].shadow = 0f; + } + } + if (Main.player[num69].shadowDodge) + { + Main.player[num69].shadowDodgeCount += 1f; + if (Main.player[num69].shadowDodgeCount > 30f) + { + Main.player[num69].shadowDodgeCount = 30f; + } + } + else + { + Main.player[num69].shadowDodgeCount -= 1f; + if (Main.player[num69].shadowDodgeCount < 0f) + { + Main.player[num69].shadowDodgeCount = 0f; + } + } + if (Main.player[num69].shadowDodgeCount > 0f) + { + Vector2 position5 = Main.player[num69].position; + Player expr_5989_cp_0 = Main.player[num69]; + expr_5989_cp_0.position.Y = expr_5989_cp_0.position.Y + Main.player[num69].gfxOffY; + Player expr_59AF_cp_0 = Main.player[num69]; + expr_59AF_cp_0.position.X = expr_59AF_cp_0.position.X + Main.player[num69].shadowDodgeCount; + Main.player[num69].shadow = 0.5f + (float)Main.rand.Next(-10, 11) * 0.005f; + this.DrawPlayer(Main.player[num69]); + Player expr_5A0B_cp_0 = Main.player[num69]; + expr_5A0B_cp_0.position.X = expr_5A0B_cp_0.position.X - Main.player[num69].shadowDodgeCount * 2f; + Main.player[num69].shadow = 0.5f + (float)Main.rand.Next(-10, 11) * 0.005f; + this.DrawPlayer(Main.player[num69]); + Main.player[num69].shadow = 0f; + Main.player[num69].position = position5; + } + this.DrawPlayer(Main.player[num69]); + } + } + } + this.spriteBatch.End(); + this.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.Rasterizer, null, this.Transform); + if (!Main.gamePaused) + { + Main.essScale += (float)Main.essDir * 0.01f; + if (Main.essScale > 1f) + { + Main.essDir = -1; + Main.essScale = 1f; + } + if ((double)Main.essScale < 0.7) + { + Main.essDir = 1; + Main.essScale = 0.7f; + } + } + for (int num72 = 0; num72 < 400; num72++) + { + if (Main.item[num72].active && Main.item[num72].type > 0) + { + int arg_5B8C_0 = (int)((double)Main.item[num72].position.X + (double)Main.item[num72].width * 0.5) / 16; + int arg_5B92_0 = Lighting.offScreenTiles; + int arg_5BC3_0 = (int)((double)Main.item[num72].position.Y + (double)Main.item[num72].height * 0.5) / 16; + int arg_5BC9_0 = Lighting.offScreenTiles; + Color color9 = Lighting.GetColor((int)((double)Main.item[num72].position.X + (double)Main.item[num72].width * 0.5) / 16, (int)((double)Main.item[num72].position.Y + (double)Main.item[num72].height * 0.5) / 16); + if (!Main.gamePaused && base.IsActive && ((Main.item[num72].type >= 71 && Main.item[num72].type <= 74) || Main.item[num72].type == 58 || Main.item[num72].type == 109) && color9.R > 60) + { + float num73 = (float)Main.rand.Next(500) - (Math.Abs(Main.item[num72].velocity.X) + Math.Abs(Main.item[num72].velocity.Y)) * 10f; + if (num73 < (float)(color9.R / 50)) + { + int num74 = Dust.NewDust(Main.item[num72].position, Main.item[num72].width, Main.item[num72].height, 43, 0f, 0f, 254, default(Color), 0.5f); + Main.dust[num74].velocity *= 0f; + } + } + float rotation4 = Main.item[num72].velocity.X * 0.2f; + float num75 = 1f; + Color alpha = Main.item[num72].GetAlpha(color9); + if (Main.item[num72].type == 662 || Main.item[num72].type == 663) + { + alpha.R = (byte)Main.DiscoR; + alpha.G = (byte)Main.DiscoG; + alpha.B = (byte)Main.DiscoB; + alpha.A = 255; + } + if (Main.item[num72].type == 520 || Main.item[num72].type == 521 || Main.item[num72].type == 547 || Main.item[num72].type == 548 || Main.item[num72].type == 549) + { + num75 = Main.essScale; + alpha.R = (byte)((float)alpha.R * num75); + alpha.G = (byte)((float)alpha.G * num75); + alpha.B = (byte)((float)alpha.B * num75); + alpha.A = (byte)((float)alpha.A * num75); + } + else + { + if (Main.item[num72].type == 58 || Main.item[num72].type == 184) + { + num75 = Main.essScale * 0.25f + 0.75f; + alpha.R = (byte)((float)alpha.R * num75); + alpha.G = (byte)((float)alpha.G * num75); + alpha.B = (byte)((float)alpha.B * num75); + alpha.A = (byte)((float)alpha.A * num75); + } + } + float num76 = (float)(Main.item[num72].height - Main.itemTexture[Main.item[num72].type].Height); + float num77 = (float)(Main.item[num72].width / 2 - Main.itemTexture[Main.item[num72].type].Width / 2); + if (Main.item[num72].type >= 1522 && Main.item[num72].type <= 1527) + { + this.spriteBatch.Draw(Main.itemTexture[Main.item[num72].type], new Vector2(Main.item[num72].position.X - Main.screenPosition.X + (float)(Main.itemTexture[Main.item[num72].type].Width / 2) + num77, Main.item[num72].position.Y - Main.screenPosition.Y + (float)(Main.itemTexture[Main.item[num72].type].Height / 2) + num76 + 2f), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.item[num72].type].Width, Main.itemTexture[Main.item[num72].type].Height)), new Color(250, 250, 250, (int)(Main.mouseTextColor / 2)), rotation4, new Vector2((float)(Main.itemTexture[Main.item[num72].type].Width / 2), (float)(Main.itemTexture[Main.item[num72].type].Height / 2)), (float)Main.mouseTextColor / 1000f + 0.8f, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.Draw(Main.itemTexture[Main.item[num72].type], new Vector2(Main.item[num72].position.X - Main.screenPosition.X + (float)(Main.itemTexture[Main.item[num72].type].Width / 2) + num77, Main.item[num72].position.Y - Main.screenPosition.Y + (float)(Main.itemTexture[Main.item[num72].type].Height / 2) + num76 + 2f), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.item[num72].type].Width, Main.itemTexture[Main.item[num72].type].Height)), alpha, rotation4, new Vector2((float)(Main.itemTexture[Main.item[num72].type].Width / 2), (float)(Main.itemTexture[Main.item[num72].type].Height / 2)), num75, SpriteEffects.None, 0f); + if (Main.item[num72].color != default(Color)) + { + this.spriteBatch.Draw(Main.itemTexture[Main.item[num72].type], new Vector2(Main.item[num72].position.X - Main.screenPosition.X + (float)(Main.itemTexture[Main.item[num72].type].Width / 2) + num77, Main.item[num72].position.Y - Main.screenPosition.Y + (float)(Main.itemTexture[Main.item[num72].type].Height / 2) + num76 + 2f), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[Main.item[num72].type].Width, Main.itemTexture[Main.item[num72].type].Height)), Main.item[num72].GetColor(color9), rotation4, new Vector2((float)(Main.itemTexture[Main.item[num72].type].Width / 2), (float)(Main.itemTexture[Main.item[num72].type].Height / 2)), num75, SpriteEffects.None, 0f); + } + } + } + } + for (int num78 = 0; num78 < Main.maxRain; num78++) + { + if (Main.rain[num78].active) + { + Color color10 = Lighting.GetColor((int)((double)Main.rain[num78].position.X + 4.0) / 16, (int)((double)Main.rain[num78].position.Y + 4.0) / 16); + float num79 = 0.85f; + color10.R = (byte)((float)color10.R * num79); + color10.G = (byte)((float)color10.G * num79); + color10.B = (byte)((float)color10.B * num79); + color10.A = (byte)((float)color10.A * num79); + float rotation5 = (float)Math.Atan2((double)Main.rain[num78].velocity.X, (double)(-(double)Main.rain[num78].velocity.Y)); + this.spriteBatch.Draw(Main.rainTexture[(int)Main.rain[num78].type], Main.rain[num78].position - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, Main.rainTexture[(int)Main.rain[num78].type].Width, Main.rainTexture[(int)Main.rain[num78].type].Height)), color10, rotation5, default(Vector2), Main.rain[num78].scale, SpriteEffects.None, 0f); + if (base.IsActive) + { + Main.rain[num78].Update(); + } + } + } + if (Main.ignoreErrors) + { + try + { + this.DrawGore(); + goto IL_653E; + } + catch + { + goto IL_653E; + } + } + this.DrawGore(); + IL_653E: + Rectangle value2 = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 50, Main.screenWidth + 1000, Main.screenHeight + 100); + for (int num80 = 0; num80 < Main.numDust; num80++) + { + if (Main.dust[num80].active) + { + if (Main.dust[num80].type >= 130 && Main.dust[num80].type <= 134) + { + value2.X -= 500; + value2.Y -= 500; + value2.Width += 1000; + value2.Height += 1000; + } + if (new Rectangle((int)Main.dust[num80].position.X, (int)Main.dust[num80].position.Y, 4, 4).Intersects(value2)) + { + if (Main.dust[num80].type >= 130 && Main.dust[num80].type <= 134) + { + float num81 = Math.Abs(Main.dust[num80].velocity.X) + Math.Abs(Main.dust[num80].velocity.Y); + num81 *= 0.3f; + num81 *= 10f; + if (num81 > 10f) + { + num81 = 10f; + } + int num82 = 0; + while ((float)num82 < num81) + { + Vector2 velocity = Main.dust[num80].velocity; + Vector2 value3 = Main.dust[num80].position - velocity * (float)num82; + float scale = Main.dust[num80].scale * (1f - (float)num82 / 10f); + Color color11 = Lighting.GetColor((int)((double)Main.dust[num80].position.X + 4.0) / 16, (int)((double)Main.dust[num80].position.Y + 4.0) / 16); + color11 = Main.dust[num80].GetAlpha(color11); + this.spriteBatch.Draw(Main.dustTexture, value3 - Main.screenPosition, new Rectangle?(Main.dust[num80].frame), color11, Main.dust[num80].rotation, new Vector2(4f, 4f), scale, SpriteEffects.None, 0f); + num82++; + } + } + Color color12 = Lighting.GetColor((int)((double)Main.dust[num80].position.X + 4.0) / 16, (int)((double)Main.dust[num80].position.Y + 4.0) / 16); + if (Main.dust[num80].type == 6 || Main.dust[num80].type == 15 || (Main.dust[num80].noLight && Main.dust[num80].type < 86 && Main.dust[num80].type > 91) || (Main.dust[num80].type >= 59 && Main.dust[num80].type <= 64)) + { + color12 = Color.White; + } + color12 = Main.dust[num80].GetAlpha(color12); + this.spriteBatch.Draw(Main.dustTexture, Main.dust[num80].position - Main.screenPosition, new Rectangle?(Main.dust[num80].frame), color12, Main.dust[num80].rotation, new Vector2(4f, 4f), Main.dust[num80].scale, SpriteEffects.None, 0f); + if (Main.dust[num80].color != default(Color)) + { + this.spriteBatch.Draw(Main.dustTexture, Main.dust[num80].position - Main.screenPosition, new Rectangle?(Main.dust[num80].frame), Main.dust[num80].GetColor(color12), Main.dust[num80].rotation, new Vector2(4f, 4f), Main.dust[num80].scale, SpriteEffects.None, 0f); + } + if (color12 == Color.Black) + { + Main.dust[num80].active = false; + } + } + else + { + Main.dust[num80].active = false; + } + } + } + if (Main.drawToScreen) + { + this.drawWaters(false); + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].mech) + { + this.DrawWires(); + } + } + else + { + this.spriteBatch.Draw(this.waterTarget, Main.sceneWaterPos - Main.screenPosition, Color.White); + } + if (!Main.mapFullscreen && Main.mapStyle == 2) + { + if (Main.ignoreErrors) + { + try + { + this.DrawMap(); + goto IL_6A73; + } + catch + { + goto IL_6A73; + } + } + this.DrawMap(); + } + IL_6A73: + this.spriteBatch.End(); + this.spriteBatch.Begin(); + if (!Main.hideUI) + { + for (int num83 = 0; num83 < 255; num83++) + { + if (Main.player[num83].active && Main.player[num83].chatShowTime > 0 && num83 != Main.myPlayer && !Main.player[num83].dead) + { + Vector2 vector = Main.fontMouseText.MeasureString(Main.player[num83].chatText); + Vector2 vector2; + vector2.X = Main.player[num83].position.X + (float)(Main.player[num83].width / 2) - vector.X / 2f; + vector2.Y = Main.player[num83].position.Y - vector.Y - 2f; + if (Main.player[Main.myPlayer].gravDir == -1f) + { + vector2.Y -= Main.screenPosition.Y; + vector2.Y = Main.screenPosition.Y + (float)Main.screenHeight - vector2.Y; + } + for (int num84 = 0; num84 < 5; num84++) + { + int num85 = 0; + int num86 = 0; + Color black = Color.Black; + if (num84 == 0) + { + num85 = -2; + } + if (num84 == 1) + { + num85 = 2; + } + if (num84 == 2) + { + num86 = -2; + } + if (num84 == 3) + { + num86 = 2; + } + if (num84 == 4) + { + black = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor); + } + this.spriteBatch.DrawString(Main.fontMouseText, Main.player[num83].chatText, new Vector2(vector2.X + (float)num85 - Main.screenPosition.X, vector2.Y + (float)num86 - Main.screenPosition.Y), black, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + } + } + for (int num87 = 0; num87 < 100; num87++) + { + if (Main.combatText[num87].active) + { + int num88 = 0; + if (Main.combatText[num87].crit) + { + num88 = 1; + } + Vector2 vector3 = Main.fontCombatText[num88].MeasureString(Main.combatText[num87].text); + Vector2 origin = new Vector2(vector3.X * 0.5f, vector3.Y * 0.5f); + float arg_6CFF_0 = Main.combatText[num87].scale; + float num89 = (float)Main.combatText[num87].color.R; + float num90 = (float)Main.combatText[num87].color.G; + float num91 = (float)Main.combatText[num87].color.B; + float num92 = (float)Main.combatText[num87].color.A; + num89 *= Main.combatText[num87].scale * Main.combatText[num87].alpha * 0.3f; + num91 *= Main.combatText[num87].scale * Main.combatText[num87].alpha * 0.3f; + num90 *= Main.combatText[num87].scale * Main.combatText[num87].alpha * 0.3f; + num92 *= Main.combatText[num87].scale * Main.combatText[num87].alpha; + Color color13 = new Color((int)num89, (int)num90, (int)num91, (int)num92); + for (int num93 = 0; num93 < 5; num93++) + { + int num94 = 0; + int num95 = 0; + if (num93 == 0) + { + num94--; + } + else + { + if (num93 == 1) + { + num94++; + } + else + { + if (num93 == 2) + { + num95--; + } + else + { + if (num93 == 3) + { + num95++; + } + else + { + num89 = (float)Main.combatText[num87].color.R * Main.combatText[num87].scale * Main.combatText[num87].alpha; + num91 = (float)Main.combatText[num87].color.B * Main.combatText[num87].scale * Main.combatText[num87].alpha; + num90 = (float)Main.combatText[num87].color.G * Main.combatText[num87].scale * Main.combatText[num87].alpha; + num92 = (float)Main.combatText[num87].color.A * Main.combatText[num87].scale * Main.combatText[num87].alpha; + color13 = new Color((int)num89, (int)num90, (int)num91, (int)num92); + } + } + } + } + if (Main.player[Main.myPlayer].gravDir == -1f) + { + float num96 = Main.combatText[num87].position.Y - Main.screenPosition.Y; + num96 = (float)Main.screenHeight - num96; + this.spriteBatch.DrawString(Main.fontCombatText[num88], Main.combatText[num87].text, new Vector2(Main.combatText[num87].position.X - Main.screenPosition.X + (float)num94 + origin.X, num96 + (float)num95 + origin.Y), color13, Main.combatText[num87].rotation, origin, Main.combatText[num87].scale, SpriteEffects.None, 0f); + } + else + { + this.spriteBatch.DrawString(Main.fontCombatText[num88], Main.combatText[num87].text, new Vector2(Main.combatText[num87].position.X - Main.screenPosition.X + (float)num94 + origin.X, Main.combatText[num87].position.Y - Main.screenPosition.Y + (float)num95 + origin.Y), color13, Main.combatText[num87].rotation, origin, Main.combatText[num87].scale, SpriteEffects.None, 0f); + } + } + } + } + for (int num97 = 0; num97 < 20; num97++) + { + if (Main.itemText[num97].active) + { + string text = Main.itemText[num97].name; + if (Main.itemText[num97].stack > 1) + { + text = string.Concat(new object[] + { + text, + " (", + Main.itemText[num97].stack, + ")" + }); + } + Vector2 vector4 = Main.fontMouseText.MeasureString(text); + Vector2 origin2 = new Vector2(vector4.X * 0.5f, vector4.Y * 0.5f); + float arg_7152_0 = Main.itemText[num97].scale; + float num98 = (float)Main.itemText[num97].color.R; + float num99 = (float)Main.itemText[num97].color.G; + float num100 = (float)Main.itemText[num97].color.B; + float num101 = (float)Main.itemText[num97].color.A; + num98 *= Main.itemText[num97].scale * Main.itemText[num97].alpha * 0.3f; + num100 *= Main.itemText[num97].scale * Main.itemText[num97].alpha * 0.3f; + num99 *= Main.itemText[num97].scale * Main.itemText[num97].alpha * 0.3f; + num101 *= Main.itemText[num97].scale * Main.itemText[num97].alpha; + Color color14 = new Color((int)num98, (int)num99, (int)num100, (int)num101); + for (int num102 = 0; num102 < 5; num102++) + { + int num103 = 0; + int num104 = 0; + if (num102 == 0) + { + num103 -= 2; + } + else + { + if (num102 == 1) + { + num103 += 2; + } + else + { + if (num102 == 2) + { + num104 -= 2; + } + else + { + if (num102 == 3) + { + num104 += 2; + } + else + { + num98 = (float)Main.itemText[num97].color.R * Main.itemText[num97].scale * Main.itemText[num97].alpha; + num100 = (float)Main.itemText[num97].color.B * Main.itemText[num97].scale * Main.itemText[num97].alpha; + num99 = (float)Main.itemText[num97].color.G * Main.itemText[num97].scale * Main.itemText[num97].alpha; + num101 = (float)Main.itemText[num97].color.A * Main.itemText[num97].scale * Main.itemText[num97].alpha; + color14 = new Color((int)num98, (int)num99, (int)num100, (int)num101); + } + } + } + } + if (num102 < 4) + { + num101 = (float)Main.itemText[num97].color.A * Main.itemText[num97].scale * Main.itemText[num97].alpha; + color14 = new Color(0, 0, 0, (int)num101); + } + float num105 = Main.itemText[num97].position.Y - Main.screenPosition.Y + (float)num104; + if (Main.player[Main.myPlayer].gravDir == -1f) + { + num105 = (float)Main.screenHeight - num105; + } + this.spriteBatch.DrawString(Main.fontMouseText, text, new Vector2(Main.itemText[num97].position.X - Main.screenPosition.X + (float)num103 + origin2.X, num105 + origin2.Y), color14, Main.itemText[num97].rotation, origin2, Main.itemText[num97].scale, SpriteEffects.None, 0f); + } + } + } + if (Main.netMode == 1 && Netplay.clientSock.statusText != "" && Netplay.clientSock.statusText != null) + { + string text2 = string.Concat(new object[] + { + Netplay.clientSock.statusText, + ": ", + (int)((float)Netplay.clientSock.statusCount / (float)Netplay.clientSock.statusMax * 100f), + "%" + }); + this.spriteBatch.DrawString(Main.fontMouseText, text2, new Vector2(628f - Main.fontMouseText.MeasureString(text2).X * 0.5f + (float)(Main.screenWidth - 800), 84f), new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + if (Main.BlackFadeIn > 0) + { + if (Main.BlackFadeIn < 0) + { + Main.BlackFadeIn = 0; + } + int num106 = Main.BlackFadeIn; + if (num106 > 255) + { + num106 = 255; + } + Main.BlackFadeIn -= 25; + this.spriteBatch.Draw(Main.loTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(0, 0, 0, num106)); + } + this.DrawFPS(); + if (!Main.mapFullscreen) + { + if (Main.ignoreErrors) + { + try + { + this.DrawInterface(); + goto IL_7619; + } + catch + { + goto IL_7619; + } + } + this.DrawInterface(); + } + } + else + { + Main.maxQ = true; + } + IL_7619: + this.spriteBatch.End(); + if (Main.mouseLeft) + { + Main.mouseLeftRelease = false; + } + else + { + Main.mouseLeftRelease = true; + } + if (Main.mouseRight) + { + Main.mouseRightRelease = false; + } + else + { + Main.mouseRightRelease = true; + } + if (Main.mouseState.RightButton != ButtonState.Pressed) + { + Main.stackSplit = 0; + } + if (Main.stackSplit > 0) + { + Main.stackSplit--; + } + if (Main.renderCount < 10) + { + Main.drawTimer[Main.renderCount] = (float)stopwatch.ElapsedMilliseconds; + if (Main.drawTimerMaxDelay[Main.renderCount] > 0f) + { + Main.drawTimerMaxDelay[Main.renderCount] -= 1f; + } + else + { + Main.drawTimerMax[Main.renderCount] = 0f; + } + if (Main.drawTimer[Main.renderCount] > Main.drawTimerMax[Main.renderCount]) + { + Main.drawTimerMax[Main.renderCount] = Main.drawTimer[Main.renderCount]; + Main.drawTimerMaxDelay[Main.renderCount] = 100f; + } + } + return; + } + if (Main.player[Main.myPlayer].talkNPC >= 0 || Main.player[Main.myPlayer].sign >= 0 || Main.playerInventory) + { + Main.player[Main.myPlayer].toggleInv(); + } + this.DrawMap(); + this.DrawFPS(); + this.DrawPlayerChat(); + this.spriteBatch.End(); + if (Main.mouseLeft) + { + Main.mouseLeftRelease = false; + return; + } + Main.mouseLeftRelease = true; + } + private static void UpdateInvasion() + { + if (Main.invasionType > 0) + { + if (Main.invasionSize <= 0) + { + if (Main.invasionType == 1) + { + NPC.downedGoblins = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + else + { + if (Main.invasionType == 2) + { + NPC.downedFrost = true; + } + else + { + if (Main.invasionType == 3) + { + NPC.downedPirates = true; + } + } + } + Main.InvasionWarning(); + Main.invasionType = 0; + Main.invasionDelay = 7; + } + if (Main.invasionX == (double)Main.spawnTileX) + { + return; + } + float num = (float)Main.dayRate; + if (Main.invasionX > (double)Main.spawnTileX) + { + Main.invasionX -= (double)num; + if (Main.invasionX <= (double)Main.spawnTileX) + { + Main.invasionX = (double)Main.spawnTileX; + Main.InvasionWarning(); + } + else + { + Main.invasionWarn--; + } + } + else + { + if (Main.invasionX < (double)Main.spawnTileX) + { + Main.invasionX += (double)num; + if (Main.invasionX >= (double)Main.spawnTileX) + { + Main.invasionX = (double)Main.spawnTileX; + Main.InvasionWarning(); + } + else + { + Main.invasionWarn--; + } + } + } + if (Main.invasionWarn <= 0) + { + Main.invasionWarn = 3600; + Main.InvasionWarning(); + } + } + } + private static void InvasionWarning() + { + string text; + if (Main.invasionSize <= 0) + { + if (Main.invasionType == 2) + { + text = Lang.misc[4]; + } + else + { + if (Main.invasionType == 3) + { + text = Lang.misc[24]; + } + else + { + text = Lang.misc[0]; + } + } + } + else + { + if (Main.invasionX < (double)Main.spawnTileX) + { + if (Main.invasionType == 2) + { + text = Lang.misc[5]; + } + else + { + if (Main.invasionType == 3) + { + text = Lang.misc[25]; + } + else + { + text = Lang.misc[1]; + } + } + } + else + { + if (Main.invasionX > (double)Main.spawnTileX) + { + if (Main.invasionType == 2) + { + text = Lang.misc[6]; + } + else + { + if (Main.invasionType == 3) + { + text = Lang.misc[26]; + } + else + { + text = Lang.misc[2]; + } + } + } + else + { + if (Main.invasionType == 2) + { + text = Lang.misc[7]; + } + else + { + if (Main.invasionType == 3) + { + text = Lang.misc[27]; + } + else + { + text = Lang.misc[3]; + } + } + } + } + } + if (Main.netMode == 0) + { + Main.NewText(text, 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, text, 255, 175f, 75f, 255f, 0); + } + } + public static void StartInvasion(int type = 1) + { + if (Main.invasionType == 0 && Main.invasionDelay == 0) + { + int num = 0; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && Main.player[i].statLifeMax >= 200) + { + num++; + } + } + if (num > 0) + { + Main.invasionType = type; + Main.invasionSize = 80 + 40 * num; + if (type == 3) + { + Main.invasionSize += 40 + 20 * num; + } + Main.invasionWarn = 0; + if (Main.rand.Next(2) == 0) + { + Main.invasionX = 0.0; + return; + } + Main.invasionX = (double)Main.maxTilesX; + } + } + } + private static void UpdateClient() + { + if (Main.myPlayer == 255) + { + Netplay.disconnect = true; + } + Main.netPlayCounter++; + if (Main.netPlayCounter > 3600) + { + Main.netPlayCounter = 0; + } + if (Math.IEEERemainder((double)Main.netPlayCounter, 420.0) == 0.0) + { + NetMessage.SendData(13, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Math.IEEERemainder((double)Main.netPlayCounter, 900.0) == 0.0) + { + NetMessage.SendData(36, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(16, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(40, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + if (Netplay.clientSock.active) + { + Netplay.clientSock.timeOut++; + if (!Main.stopTimeOuts && Netplay.clientSock.timeOut > 60 * Main.timeOut) + { + Main.statusText = Lang.inter[43]; + Netplay.disconnect = true; + } + } + for (int i = 0; i < 400; i++) + { + if (Main.item[i].active && Main.item[i].owner == Main.myPlayer) + { + Main.item[i].FindOwner(i); + } + } + } + private static void UpdateServer() + { + Main.netPlayCounter++; + if (Main.netPlayCounter > 3600) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + NetMessage.syncPlayers(); + Main.netPlayCounter = 0; + } + for (int i = 0; i < Main.maxNetPlayers; i++) + { + if (Main.player[i].active && Netplay.serverSock[i].active) + { + Netplay.serverSock[i].SpamUpdate(); + } + } + if (Math.IEEERemainder((double)Main.netPlayCounter, 900.0) == 0.0) + { + bool flag = true; + int num = Main.lastItemUpdate; + int num2 = 0; + while (flag) + { + num++; + if (num >= 400) + { + num = 0; + } + num2++; + if (!Main.item[num].active || Main.item[num].owner == 255) + { + NetMessage.SendData(21, -1, -1, "", num, 0f, 0f, 0f, 0); + } + if (num2 >= Main.maxItemUpdates || num == Main.lastItemUpdate) + { + flag = false; + } + } + Main.lastItemUpdate = num; + } + for (int j = 0; j < 400; j++) + { + if (Main.item[j].active && (Main.item[j].owner == 255 || !Main.player[Main.item[j].owner].active)) + { + Main.item[j].FindOwner(j); + } + } + for (int k = 0; k < 255; k++) + { + if (Netplay.serverSock[k].active) + { + Netplay.serverSock[k].timeOut++; + if (!Main.stopTimeOuts && Netplay.serverSock[k].timeOut > 60 * Main.timeOut) + { + Netplay.serverSock[k].kill = true; + } + } + if (Main.player[k].active) + { + ServerSock.CheckSection(k, Main.player[k].position); + } + } + } + public static void NewText(string newText, byte R = 255, byte G = 255, byte B = 255, bool force = false) + { + int num = 80; + if (!force && newText.Length > num) + { + string text = newText; + while (text.Length > num) + { + int num2 = num; + int num3 = num2; + while (text.Substring(num3, 1) != " ") + { + num3--; + if (num3 < 1) + { + break; + } + } + if (num3 == 0) + { + while (text.Substring(num2, 1) != " ") + { + num2++; + if (num2 >= text.Length - 1) + { + break; + } + } + } + else + { + num2 = num3; + } + if (num2 >= text.Length - 1) + { + num2 = text.Length; + } + string newText2 = text.Substring(0, num2); + Main.NewText(newText2, R, G, B, true); + text = text.Substring(num2); + if (text.Length > 0) + { + while (text.Substring(0, 1) == " ") + { + text = text.Substring(1); + } + } + } + if (text.Length > 0) + { + Main.NewText(text, R, G, B, true); + } + return; + } + for (int i = Main.numChatLines - 1; i > 0; i--) + { + Main.chatLine[i].text = Main.chatLine[i - 1].text; + Main.chatLine[i].showTime = Main.chatLine[i - 1].showTime; + Main.chatLine[i].color = Main.chatLine[i - 1].color; + } + if (R == 0 && G == 0 && B == 0) + { + Main.chatLine[0].color = Color.White; + } + else + { + Main.chatLine[0].color = new Color((int)R, (int)G, (int)B); + } + Main.chatLine[0].text = newText; + Main.chatLine[0].showTime = Main.chatLength; + Main.PlaySound(12, -1, -1, 1); + } + private static void StopRain() + { + Main.rainTime = 0; + Main.raining = false; + Main.maxRaining = 0f; + } + private static void StartRain() + { + int num = 86400; + int num2 = num / 24; + Main.rainTime = Main.rand.Next(num2 * 8, num); + if (Main.rand.Next(3) == 0) + { + Main.rainTime += Main.rand.Next(0, num2); + } + if (Main.rand.Next(4) == 0) + { + Main.rainTime += Main.rand.Next(0, num2 * 2); + } + if (Main.rand.Next(5) == 0) + { + Main.rainTime += Main.rand.Next(0, num2 * 3); + } + if (Main.rand.Next(6) == 0) + { + Main.rainTime += Main.rand.Next(0, num2 * 4); + } + if (Main.rand.Next(7) == 0) + { + Main.rainTime += Main.rand.Next(0, num2 * 5); + } + if (Main.rand.Next(8) == 0) + { + Main.rainTime += Main.rand.Next(0, num2 * 6); + } + float num3 = 1f; + if (Main.rand.Next(2) == 0) + { + num3 += 0.1f; + } + if (Main.rand.Next(3) == 0) + { + num3 += 0.2f; + } + if (Main.rand.Next(4) == 0) + { + num3 += 0.3f; + } + if (Main.rand.Next(5) == 0) + { + num3 += 0.4f; + } + Main.rainTime = (int)((float)Main.rainTime * num3); + Main.ChangeRain(); + Main.raining = true; + } + private static void ChangeRain() + { + if (Main.cloudBGActive >= 1f || (double)Main.numClouds > 150.0) + { + if (Main.rand.Next(3) == 0) + { + Main.maxRaining = (float)Main.rand.Next(20, 90) * 0.01f; + return; + } + Main.maxRaining = (float)Main.rand.Next(40, 90) * 0.01f; + return; + } + else + { + if ((double)Main.numClouds > 100.0) + { + if (Main.rand.Next(3) == 0) + { + Main.maxRaining = (float)Main.rand.Next(10, 70) * 0.01f; + return; + } + Main.maxRaining = (float)Main.rand.Next(20, 60) * 0.01f; + return; + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.maxRaining = (float)Main.rand.Next(5, 40) * 0.01f; + return; + } + Main.maxRaining = (float)Main.rand.Next(5, 30) * 0.01f; + return; + } + } + } + private static void UpdateTime() + { + if ((Main.netMode != 1 && !Main.gameMenu) || Main.netMode == 2) + { + if (Main.raining) + { + Main.rainTime -= Main.dayRate; + int num = 86400; + num /= Main.dayRate; + int num2 = num / 24; + if (Main.rainTime <= 0) + { + Main.StopRain(); + } + else + { + if (Main.rand.Next(num2 * 2) == 0) + { + Main.ChangeRain(); + } + } + } + else + { + int num3 = 86400; + num3 /= Main.dayRate; + if (Main.rand.Next(num3 * 5) == 0) + { + Main.StartRain(); + } + else + { + if (Main.cloudBGActive >= 1f && Main.rand.Next(num3 * 4) == 0) + { + Main.StartRain(); + } + } + } + } + if (Main.maxRaining != Main.oldMaxRaining) + { + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + Main.oldMaxRaining = Main.maxRaining; + } + Main.time += (double)Main.dayRate; + if (!Main.dayTime) + { + Main.eclipse = false; + if (WorldGen.spawnEye && Main.netMode != 1 && Main.time > 4860.0) + { + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && (double)Main.player[i].position.Y < Main.worldSurface * 16.0) + { + NPC.SpawnOnPlayer(i, 4); + WorldGen.spawnEye = false; + break; + } + } + } + if (WorldGen.spawnHardBoss > 0 && Main.netMode != 1 && Main.time > 4860.0) + { + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && !Main.player[j].dead && (double)Main.player[j].position.Y < Main.worldSurface * 16.0) + { + if (WorldGen.spawnHardBoss == 1) + { + NPC.SpawnOnPlayer(j, 134); + } + else + { + if (WorldGen.spawnHardBoss == 2) + { + NPC.SpawnOnPlayer(j, 125); + NPC.SpawnOnPlayer(j, 126); + } + else + { + if (WorldGen.spawnHardBoss == 3) + { + NPC.SpawnOnPlayer(j, 127); + } + } + } + WorldGen.spawnHardBoss = 0; + break; + } + } + } + if (Main.time > 32400.0) + { + Main.checkXMas(); + if (Main.invasionDelay > 0) + { + Main.invasionDelay--; + } + WorldGen.spawnNPC = 0; + Main.checkForSpawns = 0; + Main.time = 0.0; + Main.bloodMoon = false; + Main.dayTime = true; + Main.moonPhase++; + if (Main.moonPhase >= 8) + { + Main.moonPhase = 0; + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + WorldGen.saveAndPlay(); + } + if (Main.netMode != 1 && WorldGen.shadowOrbSmashed) + { + if (!NPC.downedGoblins) + { + if (Main.rand.Next(3) == 0) + { + Main.StartInvasion(1); + } + } + else + { + if ((Main.hardMode && Main.rand.Next(60) == 0) || (!Main.hardMode && Main.rand.Next(30) == 0)) + { + Main.StartInvasion(1); + } + } + if (Main.invasionType == 0 && Main.hardMode && NPC.downedPirates && Main.rand.Next(60) == 0) + { + Main.StartInvasion(3); + } + } + if (Main.hardMode && NPC.downedMechBossAny && Main.rand.Next(25) == 0 && Main.netMode != 1) + { + Main.eclipse = true; + if (Main.eclipse) + { + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[20], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[20], 255, 50f, 255f, 130f, 0); + } + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + } + if (Main.time > 16200.0 && WorldGen.spawnMeteor) + { + WorldGen.spawnMeteor = false; + WorldGen.dropMeteor(); + return; + } + } + else + { + Main.bloodMoon = false; + if (Main.time > 54000.0) + { + WorldGen.spawnNPC = 0; + Main.checkForSpawns = 0; + if (Main.rand.Next(50) == 0 && Main.netMode != 1 && WorldGen.shadowOrbSmashed) + { + WorldGen.spawnMeteor = true; + } + Main.eclipse = false; + if (!NPC.downedBoss1 && Main.netMode != 1) + { + bool flag = false; + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active && Main.player[k].statLifeMax >= 200 && Main.player[k].statDefense > 10) + { + flag = true; + break; + } + } + if (flag && Main.rand.Next(3) == 0) + { + int num4 = 0; + for (int l = 0; l < 200; l++) + { + if (Main.npc[l].active && Main.npc[l].townNPC) + { + num4++; + } + } + if (num4 >= 4) + { + WorldGen.spawnEye = true; + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[9], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[9], 255, 50f, 255f, 130f, 0); + } + } + } + } + } + if (Main.netMode != 1 && WorldGen.altarCount > 0 && Main.hardMode && !WorldGen.spawnEye && Main.rand.Next(10) == 0 && (!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3)) + { + int m = 0; + while (m < 1000) + { + int num5 = Main.rand.Next(3) + 1; + if (num5 == 1 && !NPC.downedMechBoss1) + { + WorldGen.spawnHardBoss = num5; + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[28], 50, 255, 130, false); + break; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[28], 255, 50f, 255f, 130f, 0); + break; + } + break; + } + else + { + if (num5 == 2 && !NPC.downedMechBoss2) + { + WorldGen.spawnHardBoss = num5; + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[29], 50, 255, 130, false); + break; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[29], 255, 50f, 255f, 130f, 0); + break; + } + break; + } + else + { + if (num5 == 3 && !NPC.downedMechBoss3) + { + WorldGen.spawnHardBoss = num5; + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[30], 50, 255, 130, false); + break; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[30], 255, 50f, 255f, 130f, 0); + break; + } + break; + } + else + { + m++; + } + } + } + } + } + if (!WorldGen.spawnEye && Main.moonPhase != 4 && Main.rand.Next(9) == 0 && Main.netMode != 1) + { + for (int n = 0; n < 255; n++) + { + if (Main.player[n].active && Main.player[n].statLifeMax > 120) + { + Main.bloodMoon = true; + break; + } + } + if (Main.bloodMoon) + { + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[8], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[8], 255, 50f, 255f, 130f, 0); + } + } + } + } + Main.time = 0.0; + Main.dayTime = false; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + if (Main.netMode != 1) + { + Main.checkForSpawns++; + if (Main.checkForSpawns >= 7200 / Main.worldRate) + { + int num6 = 0; + for (int num7 = 0; num7 < 255; num7++) + { + if (Main.player[num7].active) + { + num6++; + } + } + for (int num8 = 0; num8 < 301; num8++) + { + Main.nextNPC[num8] = false; + } + Main.checkForSpawns = 0; + WorldGen.spawnNPC = 0; + int num9 = 0; + int num10 = 0; + int num11 = 0; + int num12 = 0; + int num13 = 0; + int num14 = 0; + int num15 = 0; + int num16 = 0; + int num17 = 0; + int num18 = 0; + int num19 = 0; + int num20 = 0; + int num21 = 0; + int num22 = 0; + int num23 = 0; + int num24 = 0; + int num25 = 0; + int num26 = 0; + int num27 = 0; + int num28 = 0; + int num29 = 0; + for (int num30 = 0; num30 < 200; num30++) + { + if (Main.npc[num30].active && Main.npc[num30].townNPC) + { + if (Main.npc[num30].type != 37 && !Main.npc[num30].homeless) + { + WorldGen.QuickFindHome(num30); + } + if (Main.npc[num30].type == 37) + { + num14++; + } + if (Main.npc[num30].type == 17) + { + num9++; + } + if (Main.npc[num30].type == 18) + { + num10++; + } + if (Main.npc[num30].type == 19) + { + num12++; + } + if (Main.npc[num30].type == 20) + { + num11++; + } + if (Main.npc[num30].type == 22) + { + num13++; + } + if (Main.npc[num30].type == 38) + { + num15++; + } + if (Main.npc[num30].type == 54) + { + num16++; + } + if (Main.npc[num30].type == 107) + { + num18++; + } + if (Main.npc[num30].type == 108) + { + num17++; + } + if (Main.npc[num30].type == 124) + { + num19++; + } + if (Main.npc[num30].type == 142) + { + num20++; + } + if (Main.npc[num30].type == 160) + { + num21++; + } + if (Main.npc[num30].type == 178) + { + num22++; + } + if (Main.npc[num30].type == 207) + { + num23++; + } + if (Main.npc[num30].type == 208) + { + num24++; + } + if (Main.npc[num30].type == 209) + { + num25++; + } + if (Main.npc[num30].type == 227) + { + num26++; + } + if (Main.npc[num30].type == 228) + { + num27++; + } + if (Main.npc[num30].type == 229) + { + num28++; + } + num29++; + } + } + if (WorldGen.spawnNPC == 0) + { + int num31 = 0; + bool flag2 = false; + int num32 = 0; + bool flag3 = false; + bool flag4 = false; + bool flag5 = false; + for (int num33 = 0; num33 < 255; num33++) + { + if (Main.player[num33].active) + { + for (int num34 = 0; num34 < 58; num34++) + { + if (Main.player[num33].inventory[num34] != null & Main.player[num33].inventory[num34].stack > 0) + { + if (Main.player[num33].inventory[num34].type == 71) + { + num31 += Main.player[num33].inventory[num34].stack; + } + if (Main.player[num33].inventory[num34].type == 72) + { + num31 += Main.player[num33].inventory[num34].stack * 100; + } + if (Main.player[num33].inventory[num34].type == 73) + { + num31 += Main.player[num33].inventory[num34].stack * 10000; + } + if (Main.player[num33].inventory[num34].type == 74) + { + num31 += Main.player[num33].inventory[num34].stack * 1000000; + } + if (Main.player[num33].inventory[num34].ammo == 14 || Main.player[num33].inventory[num34].useAmmo == 14) + { + flag3 = true; + } + if (Main.player[num33].inventory[num34].type == 166 || Main.player[num33].inventory[num34].type == 167 || Main.player[num33].inventory[num34].type == 168 || Main.player[num33].inventory[num34].type == 235) + { + flag4 = true; + } + if (Main.player[num33].inventory[num34].dye > 0 || (Main.player[num33].inventory[num34].type >= 1107 && Main.player[num33].inventory[num34].type <= 1120)) + { + flag5 = true; + } + } + } + int num35 = Main.player[num33].statLifeMax / 20; + if (num35 > 5) + { + flag2 = true; + } + num32 += num35; + if (!flag5) + { + for (int num36 = 0; num36 < 3; num36++) + { + if (Main.player[num33].dye[num36] != null && Main.player[num33].dye[num36].stack > 0 && Main.player[num33].dye[num36].dye > 0) + { + flag5 = true; + } + } + } + } + } + if (!NPC.downedBoss3 && num14 == 0) + { + int num37 = NPC.NewNPC(Main.dungeonX * 16 + 8, Main.dungeonY * 16, 37, 0); + Main.npc[num37].homeless = false; + Main.npc[num37].homeTileX = Main.dungeonX; + Main.npc[num37].homeTileY = Main.dungeonY; + } + bool flag6 = false; + if (Main.rand.Next(50) == 0) + { + flag6 = true; + } + if (num13 < 1) + { + Main.nextNPC[22] = true; + } + if ((double)num31 > 5000.0 && num9 < 1) + { + Main.nextNPC[17] = true; + } + if (flag2 && num10 < 1 && num9 > 0) + { + Main.nextNPC[18] = true; + } + if (flag3 && num12 < 1) + { + Main.nextNPC[19] = true; + } + if ((NPC.downedBoss1 || NPC.downedBoss2 || NPC.downedBoss3) && num11 < 1) + { + Main.nextNPC[20] = true; + } + if (flag4 && num9 > 0 && num15 < 1) + { + Main.nextNPC[38] = true; + } + if (NPC.downedBoss3 && num16 < 1) + { + Main.nextNPC[54] = true; + } + if (NPC.savedGoblin && num18 < 1) + { + Main.nextNPC[107] = true; + } + if (NPC.savedWizard && num17 < 1) + { + Main.nextNPC[108] = true; + } + if (NPC.savedMech && num19 < 1) + { + Main.nextNPC[124] = true; + } + if (NPC.downedFrost && num20 < 1 && Main.xMas) + { + Main.nextNPC[142] = true; + } + if (NPC.downedMechBossAny && num22 < 1) + { + Main.nextNPC[178] = true; + } + if (flag5 && num23 < 1) + { + Main.nextNPC[207] = true; + } + if (NPC.downedQueenBee && num27 < 1) + { + Main.nextNPC[228] = true; + } + if (NPC.downedPirates && num28 < 1) + { + Main.nextNPC[229] = true; + } + if (num21 < 1 && Main.hardMode) + { + Main.nextNPC[160] = true; + } + if (Main.hardMode && NPC.downedPlantBoss && num25 < 1) + { + Main.nextNPC[209] = true; + } + if (num29 >= 4 && num26 < 1) + { + Main.nextNPC[227] = true; + } + if (flag6 && num24 < 1 && num29 >= 8) + { + Main.nextNPC[208] = true; + } + if (WorldGen.spawnNPC == 0 && num13 < 1) + { + WorldGen.spawnNPC = 22; + } + if (WorldGen.spawnNPC == 0 && (double)num31 > 5000.0 && num9 < 1) + { + WorldGen.spawnNPC = 17; + } + if (WorldGen.spawnNPC == 0 && flag2 && num10 < 1 && num9 > 0) + { + WorldGen.spawnNPC = 18; + } + if (WorldGen.spawnNPC == 0 && flag3 && num12 < 1) + { + WorldGen.spawnNPC = 19; + } + if (WorldGen.spawnNPC == 0 && (NPC.downedBoss1 || NPC.downedBoss2 || NPC.downedBoss3) && num11 < 1) + { + WorldGen.spawnNPC = 20; + } + if (WorldGen.spawnNPC == 0 && flag4 && num9 > 0 && num15 < 1) + { + WorldGen.spawnNPC = 38; + } + if (WorldGen.spawnNPC == 0 && NPC.downedBoss3 && num16 < 1) + { + WorldGen.spawnNPC = 54; + } + if (WorldGen.spawnNPC == 0 && NPC.savedGoblin && num18 < 1) + { + WorldGen.spawnNPC = 107; + } + if (WorldGen.spawnNPC == 0 && NPC.savedWizard && num17 < 1) + { + WorldGen.spawnNPC = 108; + } + if (WorldGen.spawnNPC == 0 && NPC.savedMech && num19 < 1) + { + WorldGen.spawnNPC = 124; + } + if (WorldGen.spawnNPC == 0 && NPC.downedFrost && num20 < 1 && Main.xMas) + { + WorldGen.spawnNPC = 142; + } + if (WorldGen.spawnNPC == 0 && NPC.downedMechBossAny && num22 < 1) + { + WorldGen.spawnNPC = 178; + } + if (WorldGen.spawnNPC == 0 && flag5 && num23 < 1) + { + WorldGen.spawnNPC = 207; + } + if (NPC.downedQueenBee && WorldGen.spawnNPC == 0 && num27 < 1) + { + WorldGen.spawnNPC = 228; + } + if (NPC.downedPirates && WorldGen.spawnNPC == 0 && num28 < 1) + { + WorldGen.spawnNPC = 229; + } + if (WorldGen.spawnNPC == 0 && Main.hardMode && num21 < 1) + { + WorldGen.spawnNPC = 160; + } + if (Main.hardMode && NPC.downedPlantBoss && WorldGen.spawnNPC == 0 && num25 < 1) + { + WorldGen.spawnNPC = 209; + } + if (WorldGen.spawnNPC == 0 && num29 >= 4 && num26 < 1) + { + WorldGen.spawnNPC = 227; + } + if (flag6 && WorldGen.spawnNPC == 0 && num29 >= 8 && num24 < 1) + { + WorldGen.spawnNPC = 208; + } + } + } + } + } + } + public static int DamageVar(float dmg) + { + float num = dmg * (1f + (float)Main.rand.Next(-15, 16) * 0.01f); + return (int)Math.Round((double)num); + } + public static double CalculateDamage(int Damage, int Defense) + { + double num = (double)Damage - (double)Defense * 0.5; + if (num < 1.0) + { + num = 1.0; + } + return num; + } + public static void PlaySound(int type, int x = -1, int y = -1, int Style = 1) + { + int num = Style; + try + { + if (!Main.dedServ) + { + if (Main.soundVolume != 0f) + { + bool flag = false; + float num2 = 1f; + float num3 = 0f; + if (x == -1 || y == -1) + { + flag = true; + } + else + { + if (WorldGen.gen) + { + return; + } + if (Main.netMode == 2) + { + return; + } + Rectangle value = new Rectangle((int)(Main.screenPosition.X - (float)(Main.screenWidth * 2)), (int)(Main.screenPosition.Y - (float)(Main.screenHeight * 2)), Main.screenWidth * 5, Main.screenHeight * 5); + Rectangle rectangle = new Rectangle(x, y, 1, 1); + Vector2 vector = new Vector2(Main.screenPosition.X + (float)Main.screenWidth * 0.5f, Main.screenPosition.Y + (float)Main.screenHeight * 0.5f); + if (rectangle.Intersects(value)) + { + flag = true; + } + if (flag) + { + num3 = ((float)x - vector.X) / ((float)Main.screenWidth * 0.5f); + float num4 = Math.Abs((float)x - vector.X); + float num5 = Math.Abs((float)y - vector.Y); + float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); + num2 = 1f - num6 / ((float)Main.screenWidth * 1.5f); + } + } + if (num3 < -1f) + { + num3 = -1f; + } + if (num3 > 1f) + { + num3 = 1f; + } + if (num2 > 1f) + { + num2 = 1f; + } + if (num2 > 0f) + { + if (flag) + { + num2 *= Main.soundVolume; + if (type == 0) + { + int num7 = Main.rand.Next(3); + Main.soundInstanceDig[num7].Stop(); + Main.soundInstanceDig[num7] = Main.soundDig[num7].CreateInstance(); + Main.soundInstanceDig[num7].Volume = num2; + Main.soundInstanceDig[num7].Pan = num3; + Main.soundInstanceDig[num7].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceDig[num7].Play(); + } + else + { + if (type == 1) + { + int num8 = Main.rand.Next(3); + Main.soundInstancePlayerHit[num8].Stop(); + Main.soundInstancePlayerHit[num8] = Main.soundPlayerHit[num8].CreateInstance(); + Main.soundInstancePlayerHit[num8].Volume = num2; + Main.soundInstancePlayerHit[num8].Pan = num3; + Main.soundInstancePlayerHit[num8].Play(); + } + else + { + if (type == 2) + { + if (num == 1) + { + int num9 = Main.rand.Next(3); + if (num9 == 1) + { + num = 18; + } + if (num9 == 2) + { + num = 19; + } + } + if (num != 9 && num != 10 && num != 24 && num != 26 && num != 34) + { + Main.soundInstanceItem[num].Stop(); + } + Main.soundInstanceItem[num] = Main.soundItem[num].CreateInstance(); + Main.soundInstanceItem[num].Volume = num2; + Main.soundInstanceItem[num].Pan = num3; + if (num == 47) + { + Main.soundInstanceItem[num].Pitch = (float)Main.rand.Next(-5, 6) * 0.19f; + } + else + { + Main.soundInstanceItem[num].Pitch = (float)Main.rand.Next(-6, 7) * 0.01f; + } + if (num == 26 || num == 35) + { + Main.soundInstanceItem[num].Volume = num2 * 0.75f; + Main.soundInstanceItem[num].Pitch = Main.harpNote; + } + Main.soundInstanceItem[num].Play(); + } + else + { + if (type == 3) + { + Main.soundInstanceNPCHit[num].Stop(); + Main.soundInstanceNPCHit[num] = Main.soundNPCHit[num].CreateInstance(); + Main.soundInstanceNPCHit[num].Volume = num2; + Main.soundInstanceNPCHit[num].Pan = num3; + Main.soundInstanceNPCHit[num].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceNPCHit[num].Play(); + } + else + { + if (type == 4) + { + if (num != 10 || Main.soundInstanceNPCKilled[num].State != SoundState.Playing) + { + Main.soundInstanceNPCKilled[num] = Main.soundNPCKilled[num].CreateInstance(); + Main.soundInstanceNPCKilled[num].Volume = num2; + Main.soundInstanceNPCKilled[num].Pan = num3; + Main.soundInstanceNPCKilled[num].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceNPCKilled[num].Play(); + } + } + else + { + if (type == 5) + { + Main.soundInstancePlayerKilled.Stop(); + Main.soundInstancePlayerKilled = Main.soundPlayerKilled.CreateInstance(); + Main.soundInstancePlayerKilled.Volume = num2; + Main.soundInstancePlayerKilled.Pan = num3; + Main.soundInstancePlayerKilled.Play(); + } + else + { + if (type == 6) + { + Main.soundInstanceGrass.Stop(); + Main.soundInstanceGrass = Main.soundGrass.CreateInstance(); + Main.soundInstanceGrass.Volume = num2; + Main.soundInstanceGrass.Pan = num3; + Main.soundInstanceGrass.Pitch = (float)Main.rand.Next(-30, 31) * 0.01f; + Main.soundInstanceGrass.Play(); + } + else + { + if (type == 7) + { + Main.soundInstanceGrab.Stop(); + Main.soundInstanceGrab = Main.soundGrab.CreateInstance(); + Main.soundInstanceGrab.Volume = num2; + Main.soundInstanceGrab.Pan = num3; + Main.soundInstanceGrab.Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceGrab.Play(); + } + else + { + if (type == 8) + { + Main.soundInstanceDoorOpen.Stop(); + Main.soundInstanceDoorOpen = Main.soundDoorOpen.CreateInstance(); + Main.soundInstanceDoorOpen.Volume = num2; + Main.soundInstanceDoorOpen.Pan = num3; + Main.soundInstanceDoorOpen.Pitch = (float)Main.rand.Next(-20, 21) * 0.01f; + Main.soundInstanceDoorOpen.Play(); + } + else + { + if (type == 9) + { + Main.soundInstanceDoorClosed.Stop(); + Main.soundInstanceDoorClosed = Main.soundDoorClosed.CreateInstance(); + Main.soundInstanceDoorClosed.Volume = num2; + Main.soundInstanceDoorClosed.Pan = num3; + Main.soundInstanceDoorOpen.Pitch = (float)Main.rand.Next(-20, 21) * 0.01f; + Main.soundInstanceDoorClosed.Play(); + } + else + { + if (type == 10) + { + Main.soundInstanceMenuOpen.Stop(); + Main.soundInstanceMenuOpen = Main.soundMenuOpen.CreateInstance(); + Main.soundInstanceMenuOpen.Volume = num2; + Main.soundInstanceMenuOpen.Pan = num3; + Main.soundInstanceMenuOpen.Play(); + } + else + { + if (type == 11) + { + Main.soundInstanceMenuClose.Stop(); + Main.soundInstanceMenuClose = Main.soundMenuClose.CreateInstance(); + Main.soundInstanceMenuClose.Volume = num2; + Main.soundInstanceMenuClose.Pan = num3; + Main.soundInstanceMenuClose.Play(); + } + else + { + if (type == 12) + { + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.soundInstanceMenuTick.Volume = num2; + Main.soundInstanceMenuTick.Pan = num3; + Main.soundInstanceMenuTick.Play(); + } + else + { + if (type == 13) + { + Main.soundInstanceShatter.Stop(); + Main.soundInstanceShatter = Main.soundShatter.CreateInstance(); + Main.soundInstanceShatter.Volume = num2; + Main.soundInstanceShatter.Pan = num3; + Main.soundInstanceShatter.Play(); + } + else + { + if (type == 14) + { + int num10 = Main.rand.Next(3); + Main.soundInstanceZombie[num10] = Main.soundZombie[num10].CreateInstance(); + Main.soundInstanceZombie[num10].Volume = num2 * 0.4f; + Main.soundInstanceZombie[num10].Pan = num3; + Main.soundInstanceZombie[num10].Play(); + } + else + { + if (type == 15) + { + if (Main.soundInstanceRoar[num].State == SoundState.Stopped) + { + Main.soundInstanceRoar[num] = Main.soundRoar[num].CreateInstance(); + Main.soundInstanceRoar[num].Volume = num2; + Main.soundInstanceRoar[num].Pan = num3; + Main.soundInstanceRoar[num].Play(); + } + } + else + { + if (type == 16) + { + Main.soundInstanceDoubleJump.Stop(); + Main.soundInstanceDoubleJump = Main.soundDoubleJump.CreateInstance(); + Main.soundInstanceDoubleJump.Volume = num2; + Main.soundInstanceDoubleJump.Pan = num3; + Main.soundInstanceDoubleJump.Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceDoubleJump.Play(); + } + else + { + if (type == 17) + { + Main.soundInstanceRun.Stop(); + Main.soundInstanceRun = Main.soundRun.CreateInstance(); + Main.soundInstanceRun.Volume = num2; + Main.soundInstanceRun.Pan = num3; + Main.soundInstanceRun.Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceRun.Play(); + } + else + { + if (type == 18) + { + Main.soundInstanceCoins = Main.soundCoins.CreateInstance(); + Main.soundInstanceCoins.Volume = num2; + Main.soundInstanceCoins.Pan = num3; + Main.soundInstanceCoins.Play(); + } + else + { + if (type == 19) + { + if (Main.soundInstanceSplash[num].State == SoundState.Stopped) + { + Main.soundInstanceSplash[num] = Main.soundSplash[num].CreateInstance(); + Main.soundInstanceSplash[num].Volume = num2; + Main.soundInstanceSplash[num].Pan = num3; + Main.soundInstanceSplash[num].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceSplash[num].Play(); + } + } + else + { + if (type == 20) + { + int num11 = Main.rand.Next(3); + Main.soundInstanceFemaleHit[num11].Stop(); + Main.soundInstanceFemaleHit[num11] = Main.soundFemaleHit[num11].CreateInstance(); + Main.soundInstanceFemaleHit[num11].Volume = num2; + Main.soundInstanceFemaleHit[num11].Pan = num3; + Main.soundInstanceFemaleHit[num11].Play(); + } + else + { + if (type == 21) + { + int num12 = Main.rand.Next(3); + Main.soundInstanceTink[num12].Stop(); + Main.soundInstanceTink[num12] = Main.soundTink[num12].CreateInstance(); + Main.soundInstanceTink[num12].Volume = num2; + Main.soundInstanceTink[num12].Pan = num3; + Main.soundInstanceTink[num12].Play(); + } + else + { + if (type == 22) + { + Main.soundInstanceUnlock.Stop(); + Main.soundInstanceUnlock = Main.soundUnlock.CreateInstance(); + Main.soundInstanceUnlock.Volume = num2; + Main.soundInstanceUnlock.Pan = num3; + Main.soundInstanceUnlock.Play(); + } + else + { + if (type == 23) + { + Main.soundInstanceDrown.Stop(); + Main.soundInstanceDrown = Main.soundDrown.CreateInstance(); + Main.soundInstanceDrown.Volume = num2; + Main.soundInstanceDrown.Pan = num3; + Main.soundInstanceDrown.Play(); + } + else + { + if (type == 24) + { + Main.soundInstanceChat = Main.soundChat.CreateInstance(); + Main.soundInstanceChat.Volume = num2; + Main.soundInstanceChat.Pan = num3; + Main.soundInstanceChat.Play(); + } + else + { + if (type == 25) + { + Main.soundInstanceMaxMana = Main.soundMaxMana.CreateInstance(); + Main.soundInstanceMaxMana.Volume = num2; + Main.soundInstanceMaxMana.Pan = num3; + Main.soundInstanceMaxMana.Play(); + } + else + { + if (type == 26) + { + int num13 = Main.rand.Next(3, 5); + Main.soundInstanceZombie[num13] = Main.soundZombie[num13].CreateInstance(); + Main.soundInstanceZombie[num13].Volume = num2 * 0.9f; + Main.soundInstanceZombie[num13].Pan = num3; + Main.soundInstanceSplash[num].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceZombie[num13].Play(); + } + else + { + if (type == 27) + { + if (Main.soundInstancePixie.State == SoundState.Playing) + { + Main.soundInstancePixie.Volume = num2; + Main.soundInstancePixie.Pan = num3; + Main.soundInstancePixie.Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + } + else + { + Main.soundInstancePixie.Stop(); + Main.soundInstancePixie = Main.soundPixie.CreateInstance(); + Main.soundInstancePixie.Volume = num2; + Main.soundInstancePixie.Pan = num3; + Main.soundInstancePixie.Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstancePixie.Play(); + } + } + else + { + if (type == 28) + { + if (Main.soundInstanceMech[num].State != SoundState.Playing) + { + Main.soundInstanceMech[num] = Main.soundMech[num].CreateInstance(); + Main.soundInstanceMech[num].Volume = num2; + Main.soundInstanceMech[num].Pan = num3; + Main.soundInstanceMech[num].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceMech[num].Play(); + } + } + else + { + if (type == 29) + { + if (Main.soundInstanceMech[num].State != SoundState.Playing) + { + Main.soundInstanceMech[num] = Main.soundZombie[num].CreateInstance(); + Main.soundInstanceMech[num].Volume = num2; + Main.soundInstanceMech[num].Pan = num3; + Main.soundInstanceMech[num].Pitch = (float)Main.rand.Next(-10, 11) * 0.01f; + Main.soundInstanceMech[num].Play(); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + catch + { + } + } + [CompilerGenerated] + private static void b__0(char keyStroke) + { + if (Main.keyCount < 10) + { + Main.keyInt[Main.keyCount] = (int)keyStroke; + Main.keyString[Main.keyCount] = string.Concat(keyStroke); + Main.keyCount++; + } + } + } +} diff --git a/Terraria/Map.cs b/Terraria/Map.cs new file mode 100644 index 0000000..3cff46e --- /dev/null +++ b/Terraria/Map.cs @@ -0,0 +1,2370 @@ +using Microsoft.Xna.Framework; +using System; +using System.Diagnostics; +using System.IO; +namespace Terraria +{ + public class Map + { + public static int maxUpdateTile = 1000; + public static int numUpdateTile = 0; + public static short[] updateTileX = new short[Map.maxUpdateTile]; + public static short[] updateTileY = new short[Map.maxUpdateTile]; + public static bool saveLock = false; + private static object padlock = new object(); + public byte type; + public byte light; + public byte misc; + public byte misc2; + public bool isTheSameAs(Map newMap, int j, int c) + { + if (this.light == newMap.light && this.color() == 0 && newMap.color() == 0) + { + if (this.active()) + { + if (newMap.active() && this.type == newMap.type && this.option() == newMap.option()) + { + return true; + } + } + else + { + if (this.lava()) + { + if (newMap.lava()) + { + return true; + } + } + else + { + if (this.water()) + { + if (newMap.water()) + { + return true; + } + } + else + { + if (this.honey()) + { + if (newMap.honey()) + { + return true; + } + } + else + { + if (this.wall()) + { + if (newMap.wall() && this.type == newMap.type && this.type != 27) + { + return true; + } + } + else + { + if (!this.active() && !newMap.active() && !newMap.lava() && !newMap.water() && !newMap.wall()) + { + if ((double)j > Main.worldSurface) + { + if ((double)j < Main.rockLayer) + { + if ((double)c > Main.worldSurface && (double)c < Main.rockLayer && this.type == newMap.type) + { + return true; + } + } + else + { + if (j < Main.maxTilesY - 200) + { + if ((double)c >= Main.rockLayer && c < Main.maxTilesY - 200 && this.type == newMap.type) + { + return true; + } + } + else + { + if (c >= Main.maxTilesY - 200) + { + return true; + } + } + } + } + else + { + if (j == c) + { + return true; + } + } + } + } + } + } + } + } + } + return false; + } + public bool active() + { + return (this.misc & 1) == 1; + } + public void active(bool active) + { + if (active) + { + this.misc |= 1; + return; + } + this.misc = (byte)((int)this.misc & -2); + } + public bool water() + { + return (this.misc & 2) == 2; + } + public void water(bool water) + { + if (water) + { + this.misc |= 2; + return; + } + this.misc = (byte)((int)this.misc & -3); + } + public bool lava() + { + return (this.misc & 4) == 4; + } + public void lava(bool lava) + { + if (lava) + { + this.misc |= 4; + return; + } + this.misc = (byte)((int)this.misc & -5); + } + public bool honey() + { + return (this.misc2 & 64) == 64; + } + public void honey(bool honey) + { + if (honey) + { + this.misc2 |= 64; + return; + } + this.misc2 = (byte)((int)this.misc2 & -65); + } + public bool changed() + { + return (this.misc & 8) == 8; + } + public void changed(bool changed) + { + if (changed) + { + this.misc |= 8; + return; + } + this.misc = (byte)((int)this.misc & -9); + } + public bool wall() + { + return (this.misc & 16) == 16; + } + public void wall(bool wall) + { + if (wall) + { + this.misc |= 16; + return; + } + this.misc = (byte)((int)this.misc & -17); + } + public byte option() + { + byte b = 0; + if ((this.misc & 32) == 32) + { + b += 1; + } + if ((this.misc & 64) == 64) + { + b += 2; + } + if ((this.misc & 128) == 128) + { + b += 4; + } + if ((this.misc2 & 1) == 1) + { + b += 8; + } + return b; + } + public void option(byte option) + { + if ((option & 1) == 1) + { + this.misc |= 32; + } + else + { + this.misc = (byte)((int)this.misc & -33); + } + if ((option & 2) == 2) + { + this.misc |= 64; + } + else + { + this.misc = (byte)((int)this.misc & -65); + } + if ((option & 4) == 4) + { + this.misc |= 128; + } + else + { + this.misc = (byte)((int)this.misc & -129); + } + if ((option & 8) == 8) + { + this.misc2 |= 1; + return; + } + this.misc2 = (byte)((int)this.misc2 & -2); + } + public byte color() + { + byte b = 0; + if ((this.misc2 & 2) == 2) + { + b += 1; + } + if ((this.misc2 & 4) == 4) + { + b += 2; + } + if ((this.misc2 & 8) == 8) + { + b += 4; + } + if ((this.misc2 & 16) == 16) + { + b += 8; + } + if ((this.misc2 & 32) == 32) + { + b += 16; + } + return b; + } + public void color(byte color) + { + if (color > 27) + { + color = 27; + } + if ((color & 1) == 1) + { + this.misc2 |= 2; + } + else + { + this.misc2 = (byte)((int)this.misc2 & -3); + } + if ((color & 2) == 2) + { + this.misc2 |= 4; + } + else + { + this.misc2 = (byte)((int)this.misc2 & -5); + } + if ((color & 4) == 4) + { + this.misc2 |= 8; + } + else + { + this.misc2 = (byte)((int)this.misc2 & -9); + } + if ((color & 8) == 8) + { + this.misc2 |= 16; + } + else + { + this.misc2 = (byte)((int)this.misc2 & -17); + } + if ((color & 16) == 16) + { + this.misc2 |= 32; + return; + } + this.misc2 = (byte)((int)this.misc2 & -33); + } + public object Clone() + { + return base.MemberwiseClone(); + } + public static void clearMap() + { + try + { + for (int i = 0; i < Main.maxTilesX; i++) + { + float num = (float)i / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[65], + " ", + (int)(num * 100f + 1f), + "%" + }); + for (int j = 0; j < Main.maxTilesY; j++) + { + if (Main.map[i, j] != null) + { + Main.map[i, j] = null; + } + } + } + } + catch + { + } + } + public static void loadMap() + { + Map.saveLock = false; + if (!Main.mapEnabled) + { + return; + } + string text = Main.playerPathName.Substring(0, Main.playerPathName.Length - 4); + string path = string.Concat(new object[] + { + text, + Path.DirectorySeparatorChar, + Main.worldID, + ".map" + }); + if (!File.Exists(path)) + { + return; + } + using (FileStream fileStream = new FileStream(path, FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader(fileStream)) + { + try + { + int num = binaryReader.ReadInt32(); + if (num > Main.curRelease) + { + try + { + binaryReader.Close(); + fileStream.Close(); + } + catch + { + } + } + else + { + Main.worldName = binaryReader.ReadString(); + Main.worldID = binaryReader.ReadInt32(); + Main.maxTilesY = binaryReader.ReadInt32(); + Main.maxTilesX = binaryReader.ReadInt32(); + for (int i = 0; i < Main.maxTilesX; i++) + { + float num2 = (float)i / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[67], + " ", + (int)(num2 * 100f + 1f), + "%" + }); + for (int j = 0; j < Main.maxTilesY; j++) + { + bool flag = binaryReader.ReadBoolean(); + Main.map[i, j] = new Map(); + if (flag) + { + Main.map[i, j].type = binaryReader.ReadByte(); + Main.map[i, j].light = binaryReader.ReadByte(); + Main.map[i, j].misc = binaryReader.ReadByte(); + if (num >= 50) + { + Main.map[i, j].misc2 = binaryReader.ReadByte(); + } + else + { + Main.map[i, j].misc2 = 0; + } + Main.map[i, j].changed(true); + int num3 = (int)binaryReader.ReadInt16(); + if (Main.map[i, j].light == 255) + { + if (num3 > 0) + { + for (int k = j + 1; k < j + num3 + 1; k++) + { + Main.map[i, k] = new Map(); + Main.map[i, k].type = Main.map[i, j].type; + Main.map[i, k].misc = Main.map[i, j].misc; + Main.map[i, k].misc2 = Main.map[i, j].misc2; + Main.map[i, k].light = Main.map[i, j].light; + Main.map[i, k].changed(true); + } + j += num3; + } + } + else + { + if (num3 > 0) + { + for (int l = j + 1; l < j + num3 + 1; l++) + { + byte b = binaryReader.ReadByte(); + if (b > 18) + { + Main.map[i, l] = new Map(); + Main.map[i, l].type = Main.map[i, j].type; + Main.map[i, l].misc = Main.map[i, j].misc; + Main.map[i, l].misc2 = Main.map[i, j].misc2; + Main.map[i, l].light = b; + Main.map[i, l].changed(true); + } + } + j += num3; + } + } + } + else + { + int num4 = (int)binaryReader.ReadInt16(); + if (num4 > 0) + { + j += num4; + if (Main.map[i, j] != null) + { + Main.map[i, j] = new Map(); + } + } + } + } + } + binaryReader.Close(); + fileStream.Close(); + Main.clearMap = true; + Main.loadMap = true; + Main.loadMapLock = true; + Main.refreshMap = false; + } + } + catch + { + Map.clearMap(); + } + } + } + } + public static void saveMap() + { + if (!Main.mapEnabled) + { + return; + } + if (Map.saveLock) + { + return; + } + string text = Main.playerPathName.Substring(0, Main.playerPathName.Length - 4); + lock (Map.padlock) + { + try + { + Map.saveLock = true; + try + { + Directory.CreateDirectory(text); + } + catch + { + } + text = string.Concat(new object[] + { + text, + Path.DirectorySeparatorChar, + Main.worldID, + ".map" + }); + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + string text2 = text + ".sav"; + bool flag2 = false; + if (!Main.gameMenu) + { + flag2 = true; + } + using (FileStream fileStream = new FileStream(text2, FileMode.Create)) + { + using (BinaryWriter binaryWriter = new BinaryWriter(fileStream)) + { + binaryWriter.Write(Main.curRelease); + binaryWriter.Write(Main.worldName); + binaryWriter.Write(Main.worldID); + binaryWriter.Write(Main.maxTilesY); + binaryWriter.Write(Main.maxTilesX); + for (int i = 0; i < Main.maxTilesX; i++) + { + if (!flag2) + { + float num = (float)i / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[66], + " ", + (int)(num * 100f + 1f), + "%" + }); + } + for (int j = 0; j < Main.maxTilesY; j++) + { + bool value = false; + if (Main.map[i, j] != null && Main.map[i, j].light > 18) + { + value = true; + binaryWriter.Write(value); + binaryWriter.Write(Main.map[i, j].type); + binaryWriter.Write(Main.map[i, j].light); + binaryWriter.Write(Main.map[i, j].misc); + binaryWriter.Write(Main.map[i, j].misc2); + int num2 = 1; + if (Main.map[i, j].light == 255) + { + while (j + num2 < Main.maxTilesY && Main.map[i, j + num2] != null && Main.map[i, j].type == Main.map[i, j + num2].type && Main.map[i, j].misc == Main.map[i, j + num2].misc && Main.map[i, j].misc2 == Main.map[i, j + num2].misc2 && Main.map[i, j + num2].light == 255) + { + num2++; + } + num2--; + binaryWriter.Write((short)num2); + j += num2; + } + else + { + while (j + num2 < Main.maxTilesY && Main.map[i, j + num2] != null && Main.map[i, j + num2].light > 18 && Main.map[i, j].type == Main.map[i, j + num2].type && Main.map[i, j].misc == Main.map[i, j + num2].misc && Main.map[i, j].misc2 == Main.map[i, j + num2].misc2) + { + num2++; + } + num2--; + binaryWriter.Write((short)num2); + if (num2 > 0) + { + for (int k = j + 1; k < j + num2 + 1; k++) + { + binaryWriter.Write(Main.map[i, k].light); + } + } + j += num2; + } + } + else + { + binaryWriter.Write(value); + int num3 = 1; + while (j + num3 < Main.maxTilesY && (Main.map[i, j + num3] == null || Main.map[i, j + num3].light == 0)) + { + num3++; + } + num3--; + binaryWriter.Write((short)num3); + j += num3; + } + } + } + binaryWriter.Close(); + fileStream.Close(); + File.Copy(text2, text, true); + File.Delete(text2); + } + } + } + catch + { + } + Map.saveLock = false; + } + } + public Color mapColor(Color oldColor) + { + Color color = WorldGen.paintColor((int)this.color()); + float num = (float)oldColor.R / 255f; + float num2 = (float)oldColor.G / 255f; + float num3 = (float)oldColor.B / 255f; + if (num2 > num) + { + num = num2; + } + if (num3 > num) + { + num = num3; + } + float num4 = num; + byte r = (byte)((float)color.R * num4); + byte g = (byte)((float)color.G * num4); + byte b = (byte)((float)color.B * num4); + return new Color((int)r, (int)g, (int)b, (int)oldColor.A); + } + public Color tileColor(int j) + { + if (this.active()) + { + switch (this.type) + { + case 0: + case 5: + case 30: + case 191: + return new Color(151, 107, 75); + case 1: + case 38: + case 48: + case 130: + case 138: + return new Color(128, 128, 128); + case 2: + return new Color(28, 216, 94); + case 3: + case 192: + return new Color(26, 196, 84); + case 4: + if (this.option() == 0) + { + return new Color(169, 125, 93); + } + return new Color(253, 221, 3); + case 6: + return new Color(140, 101, 80); + case 7: + case 47: + return new Color(150, 67, 22); + case 8: + case 45: + return new Color(185, 164, 23); + case 9: + case 46: + return new Color(185, 194, 195); + case 10: + case 11: + return new Color(119, 105, 79); + case 12: + return new Color(174, 24, 69); + case 13: + return new Color(133, 213, 247); + case 14: + case 15: + case 18: + case 19: + case 55: + case 79: + case 86: + case 87: + case 88: + case 89: + case 94: + case 101: + case 104: + case 106: + case 114: + case 128: + case 139: + case 216: + return new Color(191, 142, 111); + case 16: + return new Color(140, 130, 116); + case 17: + case 90: + case 96: + case 97: + case 99: + case 132: + case 142: + case 143: + case 144: + case 207: + case 209: + case 212: + case 217: + case 218: + case 219: + case 220: + case 228: + return new Color(144, 148, 144); + case 20: + return new Color(163, 116, 81); + case 21: + if (this.option() == 0) + { + return new Color(174, 129, 92); + } + if (this.option() == 1) + { + return new Color(233, 207, 94); + } + if (this.option() == 2) + { + return new Color(137, 128, 200); + } + if (this.option() == 3) + { + return new Color(160, 160, 160); + } + return new Color(106, 210, 255); + case 22: + case 140: + return new Color(98, 95, 167); + case 23: + return new Color(141, 137, 223); + case 24: + return new Color(122, 116, 218); + case 25: + return new Color(109, 90, 128); + case 26: + if (this.option() == 1) + { + return new Color(214, 127, 133); + } + return new Color(119, 101, 125); + case 27: + if (this.option() == 1) + { + return new Color(226, 196, 49); + } + return new Color(54, 154, 54); + case 28: + if (this.option() == 0) + { + return new Color(151, 79, 80); + } + if (this.option() == 1) + { + return new Color(90, 139, 140); + } + if (this.option() == 2) + { + return new Color(192, 136, 70); + } + if (this.option() == 3) + { + return new Color(203, 185, 151); + } + if (this.option() == 4) + { + return new Color(73, 56, 41); + } + if (this.option() == 5) + { + return new Color(148, 159, 67); + } + if (this.option() == 6) + { + return new Color(138, 172, 67); + } + if (this.option() == 8) + { + return new Color(198, 87, 93); + } + return new Color(226, 122, 47); + case 29: + return new Color(175, 105, 128); + case 31: + if (this.option() == 1) + { + return new Color(212, 105, 105); + } + return new Color(141, 120, 168); + case 32: + return new Color(151, 135, 183); + case 33: + case 93: + case 98: + case 100: + case 173: + case 174: + return new Color(253, 221, 3); + case 34: + return new Color(235, 166, 135); + case 35: + return new Color(197, 216, 219); + case 36: + case 102: + return new Color(229, 212, 73); + case 37: + return new Color(104, 86, 84); + case 39: + return new Color(181, 62, 59); + case 40: + return new Color(146, 81, 68); + case 41: + return new Color(66, 84, 109); + case 42: + return new Color(251, 235, 127); + case 43: + return new Color(84, 100, 63); + case 44: + return new Color(107, 68, 99); + case 49: + return new Color(89, 201, 255); + case 50: + return new Color(170, 48, 114); + case 51: + return new Color(192, 202, 203); + case 52: + return new Color(23, 177, 76); + case 53: + return new Color(186, 168, 84); + case 54: + return new Color(200, 246, 254); + case 56: + return new Color(43, 40, 84); + case 57: + return new Color(68, 68, 76); + case 58: + case 76: + return new Color(142, 66, 66); + case 59: + case 120: + return new Color(92, 68, 73); + case 60: + return new Color(143, 215, 29); + case 61: + return new Color(135, 196, 26); + case 62: + return new Color(121, 176, 24); + case 63: + return new Color(110, 140, 182); + case 64: + return new Color(196, 96, 114); + case 65: + return new Color(56, 150, 97); + case 66: + return new Color(160, 118, 58); + case 67: + return new Color(140, 58, 166); + case 68: + return new Color(125, 191, 197); + case 69: + return new Color(190, 150, 92); + case 70: + return new Color(93, 127, 255); + case 71: + case 72: + case 190: + return new Color(182, 175, 130); + case 73: + return new Color(27, 197, 109); + case 74: + return new Color(96, 197, 27); + case 75: + return new Color(26, 26, 26); + case 77: + return new Color(238, 85, 70); + case 78: + return new Color(121, 110, 97); + case 80: + case 188: + return new Color(73, 120, 17); + case 81: + return new Color(245, 133, 191); + case 82: + case 83: + case 84: + if (this.option() == 0) + { + return new Color(246, 197, 26); + } + if (this.option() == 1) + { + return new Color(76, 150, 216); + } + if (this.option() == 2) + { + return new Color(185, 214, 42); + } + if (this.option() == 3) + { + return new Color(167, 203, 37); + } + if (this.option() == 4) + { + return new Color(72, 145, 125); + } + return new Color(177, 69, 49); + case 85: + return new Color(192, 192, 192); + case 91: + return new Color(13, 88, 130); + case 92: + return new Color(213, 229, 237); + case 95: + return new Color(255, 162, 31); + case 103: + return new Color(141, 98, 77); + case 105: + if (this.option() == 1) + { + return new Color(177, 92, 31); + } + if (this.option() == 2) + { + return new Color(201, 188, 170); + } + return new Color(144, 148, 144); + case 107: + case 121: + return new Color(11, 80, 143); + case 108: + case 122: + return new Color(91, 169, 169); + case 109: + return new Color(78, 193, 227); + case 110: + return new Color(48, 186, 135); + case 111: + case 150: + return new Color(128, 26, 52); + case 112: + return new Color(103, 98, 122); + case 113: + return new Color(48, 208, 234); + case 115: + return new Color(33, 171, 207); + case 116: + case 118: + return new Color(238, 225, 218); + case 117: + return new Color(181, 172, 190); + case 119: + return new Color(107, 92, 108); + case 123: + return new Color(106, 107, 118); + case 124: + return new Color(73, 51, 36); + case 125: + return new Color(141, 175, 255); + case 126: + return new Color(159, 209, 229); + case 129: + return new Color(255, 117, 224); + case 131: + return new Color(52, 52, 52); + case 133: + if (this.option() == 0) + { + return new Color(231, 53, 56); + } + return new Color(192, 189, 221); + case 134: + if (this.option() == 0) + { + return new Color(166, 187, 153); + } + return new Color(241, 129, 249); + case 136: + return new Color(213, 203, 204); + case 137: + if (this.option() == 0) + { + return new Color(144, 148, 144); + } + return new Color(141, 56, 0); + case 141: + return new Color(192, 59, 59); + case 145: + return new Color(192, 30, 30); + case 146: + return new Color(43, 192, 30); + case 147: + case 148: + return new Color(211, 236, 241); + case 149: + if (j % 3 == 0) + { + return new Color(220, 50, 50); + } + if (j % 3 == 1) + { + return new Color(0, 220, 50); + } + return new Color(50, 50, 220); + case 151: + case 154: + return new Color(190, 171, 94); + case 152: + return new Color(128, 133, 184); + case 153: + return new Color(239, 141, 126); + case 155: + return new Color(131, 162, 161); + case 156: + return new Color(170, 171, 157); + case 157: + return new Color(104, 100, 126); + case 158: + case 232: + return new Color(145, 81, 85); + case 159: + return new Color(148, 133, 98); + case 160: + if (j % 3 == 0) + { + return new Color(200, 0, 0); + } + if (j % 3 == 1) + { + return new Color(0, 200, 0); + } + return new Color(0, 0, 200); + case 161: + return new Color(144, 195, 232); + case 162: + return new Color(184, 219, 240); + case 163: + return new Color(174, 145, 214); + case 164: + return new Color(218, 182, 204); + case 165: + if (this.option() == 0) + { + return new Color(115, 173, 229); + } + if (this.option() == 1) + { + return new Color(100, 100, 100); + } + if (this.option() == 2) + { + return new Color(152, 152, 152); + } + return new Color(227, 125, 22); + case 166: + case 175: + return new Color(129, 125, 93); + case 167: + return new Color(62, 82, 114); + case 168: + case 176: + return new Color(132, 157, 127); + case 169: + case 177: + return new Color(152, 171, 198); + case 170: + return new Color(228, 219, 162); + case 171: + return new Color(177, 192, 176); + case 172: + return new Color(181, 194, 217); + case 178: + if (this.option() == 0) + { + return new Color(208, 94, 201); + } + if (this.option() == 1) + { + return new Color(233, 146, 69); + } + if (this.option() == 2) + { + return new Color(71, 146, 251); + } + if (this.option() == 3) + { + return new Color(60, 226, 133); + } + if (this.option() == 4) + { + return new Color(250, 30, 71); + } + if (this.option() == 6) + { + return new Color(255, 217, 120); + } + return new Color(166, 176, 204); + case 179: + return new Color(49, 134, 114); + case 180: + return new Color(126, 134, 49); + case 181: + return new Color(134, 59, 49); + case 182: + return new Color(43, 86, 140); + case 183: + return new Color(121, 49, 134); + case 184: + if (this.option() == 0) + { + return new Color(29, 106, 88); + } + if (this.option() == 1) + { + return new Color(94, 100, 36); + } + if (this.option() == 2) + { + return new Color(96, 44, 40); + } + if (this.option() == 3) + { + return new Color(34, 63, 102); + } + return new Color(79, 35, 95); + case 185: + case 186: + case 187: + if (this.option() == 0) + { + return new Color(99, 99, 99); + } + if (this.option() == 1) + { + return new Color(114, 81, 56); + } + if (this.option() == 2) + { + return new Color(133, 133, 101); + } + if (this.option() == 3) + { + return new Color(151, 200, 211); + } + if (this.option() == 4) + { + return new Color(177, 183, 161); + } + if (this.option() == 5) + { + return new Color(134, 114, 38); + } + if (this.option() == 6) + { + return new Color(82, 62, 66); + } + if (this.option() == 7) + { + return new Color(143, 117, 121); + } + if (this.option() == 8) + { + return new Color(177, 92, 31); + } + return new Color(85, 73, 87); + case 189: + return new Color(223, 255, 255); + case 193: + return new Color(56, 121, 255); + case 194: + return new Color(157, 157, 107); + case 195: + return new Color(134, 22, 34); + case 196: + return new Color(147, 144, 178); + case 197: + return new Color(97, 200, 225); + case 198: + return new Color(62, 61, 52); + case 199: + return new Color(208, 80, 80); + case 200: + return new Color(216, 152, 144); + case 201: + return new Color(203, 61, 64); + case 202: + return new Color(213, 178, 28); + case 203: + return new Color(128, 44, 45); + case 204: + return new Color(125, 55, 65); + case 205: + return new Color(186, 50, 52); + case 206: + return new Color(124, 175, 201); + case 208: + return new Color(88, 105, 118); + case 211: + return new Color(191, 233, 115); + case 213: + return new Color(137, 120, 67); + case 214: + return new Color(103, 103, 103); + case 215: + return new Color(254, 121, 2); + case 221: + return new Color(239, 90, 50); + case 222: + return new Color(231, 96, 228); + case 223: + return new Color(57, 85, 101); + case 224: + return new Color(107, 132, 139); + case 225: + return new Color(227, 125, 22); + case 226: + return new Color(141, 56, 0); + case 227: + if (this.option() == 0) + { + return new Color(74, 197, 155); + } + if (this.option() == 1) + { + return new Color(54, 153, 88); + } + if (this.option() == 2) + { + return new Color(63, 126, 207); + } + if (this.option() == 3) + { + return new Color(240, 180, 4); + } + if (this.option() == 4) + { + return new Color(45, 68, 168); + } + if (this.option() == 5) + { + return new Color(61, 92, 0); + } + if (this.option() == 6) + { + return new Color(216, 112, 152); + } + return new Color(200, 40, 24); + case 229: + return new Color(255, 156, 12); + case 230: + return new Color(131, 79, 13); + case 231: + return new Color(224, 194, 101); + case 233: + return new Color(107, 182, 29); + case 234: + return new Color(53, 44, 41); + case 235: + return new Color(214, 184, 46); + case 236: + return new Color(149, 232, 87); + case 237: + return new Color(255, 241, 51); + case 238: + return new Color(225, 128, 206); + case 239: + return new Color(224, 194, 101); + case 240: + if (this.option() == 1) + { + return new Color(99, 50, 30); + } + if (this.option() == 2) + { + return new Color(153, 153, 117); + } + return new Color(120, 85, 60); + case 241: + return new Color(77, 74, 72); + case 242: + case 245: + case 246: + return new Color(99, 50, 30); + case 244: + return new Color(200, 245, 253); + case 247: + return new Color(140, 150, 150); + } + } + if (this.lava()) + { + return new Color(253, 32, 3); + } + if (this.water()) + { + return new Color(9, 61, 191); + } + if (this.honey()) + { + return new Color(254, 194, 20); + } + if (this.wall()) + { + switch (this.type) + { + case 1: + case 5: + case 44: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + return new Color(52, 52, 52); + case 2: + case 16: + case 59: + return new Color(88, 61, 46); + case 3: + return new Color(61, 58, 78); + case 4: + return new Color(73, 51, 36); + case 6: + return new Color(91, 30, 30); + case 7: + case 17: + return new Color(27, 31, 42); + case 8: + case 18: + return new Color(31, 39, 26); + case 9: + case 19: + return new Color(41, 28, 36); + case 10: + return new Color(74, 62, 12); + case 11: + return new Color(46, 56, 59); + case 12: + return new Color(75, 32, 11); + case 13: + return new Color(67, 37, 37); + case 14: + case 20: + return new Color(15, 15, 15); + case 15: + return new Color(52, 43, 45); + case 22: + return new Color(113, 99, 99); + case 23: + return new Color(38, 38, 43); + case 24: + return new Color(53, 39, 41); + case 25: + return new Color(11, 35, 62); + case 26: + return new Color(21, 63, 70); + case 27: + if (j % 2 == 0) + { + return new Color(88, 61, 46); + } + return new Color(52, 52, 52); + case 28: + return new Color(81, 84, 101); + case 29: + return new Color(88, 23, 23); + case 30: + return new Color(28, 88, 23); + case 31: + return new Color(78, 87, 99); + case 32: + return new Color(86, 17, 40); + case 33: + return new Color(49, 47, 83); + case 34: + case 37: + return new Color(69, 67, 41); + case 35: + return new Color(51, 51, 70); + case 36: + return new Color(87, 59, 55); + case 38: + return new Color(49, 57, 49); + case 39: + return new Color(78, 79, 73); + case 40: + return new Color(85, 102, 103); + case 41: + return new Color(52, 50, 62); + case 42: + return new Color(71, 42, 44); + case 43: + return new Color(73, 66, 50); + case 45: + return new Color(60, 59, 51); + case 46: + return new Color(48, 57, 47); + case 47: + return new Color(71, 77, 85); + case 54: + return new Color(40, 56, 50); + case 55: + return new Color(49, 48, 36); + case 56: + return new Color(43, 33, 32); + case 57: + return new Color(31, 40, 49); + case 58: + return new Color(48, 35, 52); + case 60: + return new Color(1, 52, 20); + case 61: + return new Color(55, 39, 26); + case 62: + return new Color(39, 33, 26); + case 63: + case 65: + case 66: + case 68: + return new Color(30, 80, 48); + case 64: + case 67: + return new Color(53, 80, 30); + case 69: + return new Color(43, 42, 68); + case 70: + return new Color(30, 70, 80); + case 71: + return new Color(78, 105, 135); + case 72: + return new Color(52, 84, 12); + case 73: + return new Color(190, 204, 223); + case 74: + case 80: + return new Color(64, 62, 80); + case 75: + return new Color(65, 65, 35); + case 76: + return new Color(20, 46, 104); + case 77: + return new Color(61, 13, 16); + case 78: + return new Color(63, 39, 26); + case 79: + return new Color(51, 47, 96); + case 81: + return new Color(101, 51, 51); + case 82: + return new Color(77, 64, 34); + case 83: + return new Color(62, 38, 41); + case 84: + return new Color(48, 78, 93); + case 85: + return new Color(54, 63, 69); + case 86: + case 108: + return new Color(138, 73, 38); + case 87: + return new Color(50, 15, 8); + case 94: + case 100: + return new Color(32, 40, 45); + case 95: + case 101: + return new Color(44, 41, 50); + case 96: + case 102: + return new Color(72, 50, 77); + case 97: + case 103: + return new Color(78, 50, 69); + case 98: + case 104: + return new Color(36, 45, 44); + case 99: + case 105: + return new Color(38, 49, 50); + } + } + if ((double)j < Main.worldSurface) + { + float num = (float)j / (float)Main.worldSurface; + float num2 = 1f - num; + Color color = new Color((int)((byte)(num2 * 50f)), (int)((byte)(num2 * 40f)), (int)((byte)(num2 * 255f))); + Color color2 = new Color((int)((byte)(num * 145f)), (int)((byte)(num * 185f)), (int)((byte)(num * 255f))); + Color result = new Color((int)(color.R + color2.R), (int)(color.G + color2.G), (int)(color.B + color2.B)); + float num3 = 1f; + result = new Color((int)((byte)((float)result.R * num3)), (int)((byte)((float)result.G * num3)), (int)((byte)((float)result.B * num3)), (int)((byte)(255f * num3))); + return result; + } + if ((double)j < Main.rockLayer) + { + Color color3 = new Color(88, 61, 46); + Color color4 = new Color(37, 78, 123); + float num4 = (float)this.type / 255f; + float num5 = 1f - num4; + return new Color((int)((byte)((float)color3.R * num5 + (float)color4.R * num4)), (int)((byte)((float)color3.G * num5 + (float)color4.G * num4)), (int)((byte)((float)color3.B * num5 + (float)color4.B * num4))); + } + if (j < Main.maxTilesY - 200) + { + Color color5 = new Color(74, 67, 60); + Color color6 = new Color(53, 70, 97); + float num6 = (float)this.type / 255f; + float num7 = 1f - num6; + return new Color((int)((byte)((float)color5.R * num7 + (float)color6.R * num6)), (int)((byte)((float)color5.G * num7 + (float)color6.G * num6)), (int)((byte)((float)color5.B * num7 + (float)color6.B * num6))); + } + return new Color(50, 44, 38); + } + public Color getColor(int j) + { + Color oldColor = this.tileColor(j); + if (this.color() > 0) + { + oldColor = this.mapColor(oldColor); + } + float num = (float)this.light / 255f; + return new Color((int)((byte)((float)oldColor.R * num)), (int)((byte)((float)oldColor.G * num)), (int)((byte)((float)oldColor.B * num)), 255); + } + public void setTile(int i, int j, byte Light) + { + if (Main.tile[i, j] == null) + { + return; + } + bool flag = false; + if (this.light < Light) + { + this.light = Light; + this.changed(true); + } + if (Main.tile[i, j] != null && Main.tile[i, j].active() && Main.tile[i, j].type != 135 && Main.tile[i, j].type != 127 && Main.tile[i, j].type != 210 && (Main.tile[i, j].type != 51 || (i + j) % 2 != 0)) + { + if (!this.active()) + { + this.changed(true); + } + this.active(true); + if (this.type != Main.tile[i, j].type) + { + this.changed(true); + } + this.type = Main.tile[i, j].type; + if (this.type == 160) + { + if (this.color() != 0) + { + this.changed(true); + } + this.color(0); + } + else + { + if (this.color() != Main.tile[i, j].color()) + { + this.changed(true); + } + this.color(Main.tile[i, j].color()); + } + this.lava(false); + this.water(false); + this.honey(false); + flag = true; + if (Main.tile[i, j].type == 4) + { + if (Main.tile[i, j].frameX < 66) + { + this.option(1); + } + else + { + this.option(0); + } + } + else + { + if (Main.tile[i, j].type == 21) + { + int num = (int)(Main.tile[i, j].frameX / 36); + if (num == 1 || num == 2 || num == 10 || num == 13 || num == 15) + { + this.option(1); + } + else + { + if (num == 3 || num == 4) + { + this.option(2); + } + else + { + if (num == 6) + { + this.option(3); + } + else + { + if (num == 11 || num == 17) + { + this.option(4); + } + else + { + this.option(0); + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 28) + { + if (Main.tile[i, j].frameY < 144) + { + this.option(0); + } + else + { + if (Main.tile[i, j].frameY < 252) + { + this.option(1); + } + else + { + if (Main.tile[i, j].frameY < 360 || (Main.tile[i, j].frameY > 900 && Main.tile[i, j].frameY < 1008)) + { + this.option(2); + } + else + { + if (Main.tile[i, j].frameY < 468) + { + this.option(3); + } + else + { + if (Main.tile[i, j].frameY < 576) + { + this.option(4); + } + else + { + if (Main.tile[i, j].frameY < 684) + { + this.option(5); + } + else + { + if (Main.tile[i, j].frameY < 792) + { + this.option(6); + } + else + { + if (Main.tile[i, j].frameY < 898) + { + this.option(8); + } + else + { + this.option(7); + } + } + } + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 27) + { + if (Main.tile[i, j].frameY < 34) + { + this.option(1); + } + else + { + this.option(0); + } + } + else + { + if (Main.tile[i, j].type == 31) + { + if (Main.tile[i, j].frameX > 36) + { + this.option(1); + } + else + { + this.option(0); + } + } + else + { + if (Main.tile[i, j].type == 26) + { + if (Main.tile[i, j].frameX >= 54) + { + this.option(1); + } + else + { + this.option(0); + } + } + else + { + if (Main.tile[i, j].type == 137) + { + if (Main.tile[i, j].frameY == 0) + { + this.option(0); + } + else + { + this.option(1); + } + } + else + { + if (Main.tile[i, j].type == 82 || Main.tile[i, j].type == 83 || Main.tile[i, j].type == 84) + { + if (Main.tile[i, j].frameX < 18) + { + this.option(0); + } + else + { + if (Main.tile[i, j].frameX < 36) + { + this.option(1); + } + else + { + if (Main.tile[i, j].frameX < 54) + { + this.option(2); + } + else + { + if (Main.tile[i, j].frameX < 72) + { + this.option(3); + } + else + { + if (Main.tile[i, j].frameX < 90) + { + this.option(4); + } + else + { + this.option(6); + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 105) + { + if (Main.tile[i, j].frameX >= 1548 && Main.tile[i, j].frameX <= 1654) + { + this.option(1); + } + if (Main.tile[i, j].frameX >= 1656 && Main.tile[i, j].frameX <= 1798) + { + this.option(2); + } + else + { + this.option(0); + } + } + else + { + if (Main.tile[i, j].type == 133) + { + if (Main.tile[i, j].frameX < 52) + { + this.option(0); + } + else + { + this.option(1); + } + } + else + { + if (Main.tile[i, j].type == 134) + { + if (Main.tile[i, j].frameX < 28) + { + this.option(0); + } + else + { + this.option(1); + } + } + else + { + if (Main.tile[i, j].type == 165) + { + if (Main.tile[i, j].frameX < 54) + { + this.option(0); + } + else + { + if (Main.tile[i, j].frameX < 106) + { + this.option(1); + } + else + { + if (Main.tile[i, j].frameX < 162) + { + this.option(2); + } + else + { + this.option(3); + } + } + } + } + else + { + if (Main.tile[i, j].type == 178) + { + if (Main.tile[i, j].frameX < 18) + { + this.option(0); + } + else + { + if (Main.tile[i, j].frameX < 36) + { + this.option(1); + } + else + { + if (Main.tile[i, j].frameX < 54) + { + this.option(2); + } + else + { + if (Main.tile[i, j].frameX < 72) + { + this.option(3); + } + else + { + if (Main.tile[i, j].frameX < 90) + { + this.option(4); + } + else + { + if (Main.tile[i, j].frameX < 108) + { + this.option(5); + } + else + { + this.option(6); + } + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 184) + { + if (Main.tile[i, j].frameX < 22) + { + this.option(0); + } + else + { + if (Main.tile[i, j].frameX < 44) + { + this.option(1); + } + else + { + if (Main.tile[i, j].frameX < 66) + { + this.option(2); + } + else + { + if (Main.tile[i, j].frameX < 88) + { + this.option(3); + } + else + { + this.option(4); + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 185) + { + if (Main.tile[i, j].frameY < 18) + { + int num2 = (int)(Main.tile[i, j].frameX / 18); + if (num2 < 6 || num2 == 28 || num2 == 29 || num2 == 30 || num2 == 31 || num2 == 32) + { + this.option(0); + } + else + { + if (num2 < 12 || num2 == 33 || num2 == 34 || num2 == 35) + { + this.option(1); + } + else + { + if (num2 < 28) + { + this.option(2); + } + else + { + if (num2 < 48) + { + this.option(3); + } + else + { + if (num2 < 54) + { + this.option(4); + } + } + } + } + } + } + else + { + int num3 = (int)(Main.tile[i, j].frameX / 36); + if (num3 < 6 || num3 == 19 || num3 == 20 || num3 == 21 || num3 == 22 || num3 == 23 || num3 == 24 || num3 == 33 || num3 == 38 || num3 == 39 || num3 == 40) + { + this.option(0); + } + else + { + if (num3 < 16) + { + this.option(2); + } + else + { + if (num3 < 19 || num3 == 31 || num3 == 32) + { + this.option(1); + } + else + { + if (num3 < 31) + { + this.option(3); + } + else + { + if (num3 < 38) + { + this.option(4); + } + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 186) + { + int num4 = (int)(Main.tile[i, j].frameX / 54); + if (num4 < 7) + { + this.option(2); + } + else + { + if (num4 < 22 || num4 == 33 || num4 == 34 || num4 == 35) + { + this.option(0); + } + else + { + if (num4 < 25) + { + this.option(1); + } + else + { + if (num4 == 25) + { + this.option(5); + } + else + { + if (num4 < 32) + { + this.option(3); + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 187) + { + int num5 = (int)(Main.tile[i, j].frameX / 54); + if (num5 < 3 || num5 == 14 || num5 == 15 || num5 == 16) + { + this.option(0); + } + else + { + if (num5 < 6) + { + this.option(6); + } + else + { + if (num5 < 9) + { + this.option(7); + } + else + { + if (num5 < 14) + { + this.option(4); + } + else + { + if (num5 < 18) + { + this.option(4); + } + else + { + if (num5 < 23) + { + this.option(8); + } + else + { + if (num5 < 25) + { + this.option(0); + } + else + { + if (num5 < 29) + { + this.option(1); + } + } + } + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 227) + { + int num6 = (int)(Main.tile[i, j].frameX / 34); + this.option((byte)num6); + } + else + { + if (Main.tile[i, j].type == 240) + { + int num7 = (int)(Main.tile[i, j].frameX / 54); + if (num7 >= 0 && num7 <= 11) + { + this.option(0); + } + else + { + if (num7 >= 12 && num7 <= 15) + { + this.option(1); + } + else + { + if (num7 == 16 || num7 == 17) + { + this.option(2); + } + else + { + if (num7 >= 18 && num7 <= 35) + { + this.option(1); + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 241) + { + short arg_CCB_0 = (short)(Main.tile[i, j].frameY / 54); + this.option(0); + } + else + { + this.option(0); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (!flag) + { + if (this.active()) + { + this.changed(true); + } + this.active(false); + if (Main.tile[i, j] != null && Main.tile[i, j].liquid > 32) + { + if (this.color() != 0) + { + this.changed(true); + } + this.color(0); + if (this.wall()) + { + this.changed(true); + } + if (Main.tile[i, j].lava()) + { + if (!this.lava()) + { + this.changed(true); + } + this.lava(true); + this.water(false); + this.honey(false); + return; + } + if (Main.tile[i, j].honey()) + { + if (!this.honey()) + { + this.changed(true); + } + this.honey(true); + this.lava(false); + this.water(false); + return; + } + if (!this.water()) + { + this.changed(true); + } + this.water(true); + this.lava(false); + this.honey(false); + return; + } + else + { + if (this.lava() || this.water() || this.honey()) + { + this.changed(true); + } + this.lava(false); + this.water(false); + this.honey(false); + if (Main.tile[i, j] != null && Main.tile[i, j].wall > 0) + { + if (!this.wall()) + { + this.changed(true); + } + this.wall(true); + if (Main.tile[i, j].wall != this.type) + { + this.changed(true); + } + this.type = Main.tile[i, j].wall; + if (this.type != 21) + { + if (this.color() != Main.tile[i, j].wallColor()) + { + this.changed(true); + } + this.color(Main.tile[i, j].wallColor()); + return; + } + if (this.color() != 0) + { + this.changed(true); + } + this.color(0); + if ((double)j < Main.worldSurface) + { + if (this.light < 255) + { + this.changed(true); + } + this.light = 255; + return; + } + } + else + { + if ((double)j < Main.worldSurface) + { + if (this.color() != 0) + { + this.changed(true); + } + this.color(0); + if (this.wall()) + { + this.changed(true); + } + this.wall(false); + if (this.water() || this.lava() || this.honey()) + { + this.changed(true); + } + this.water(false); + this.lava(false); + this.honey(false); + if (this.light < 255) + { + this.light = 255; + this.changed(true); + return; + } + } + else + { + if (j < Main.maxTilesY - 200) + { + if (this.color() != 0) + { + this.changed(true); + } + this.color(0); + if (this.wall()) + { + this.changed(true); + } + this.wall(false); + if (this.water() || this.lava() || this.honey()) + { + this.changed(true); + } + this.water(false); + this.lava(false); + this.honey(false); + float num8 = Main.screenPosition.X / 16f - 5f; + float num9 = (Main.screenPosition.X + (float)Main.screenWidth) / 16f + 5f; + float num10 = Main.screenPosition.Y / 16f - 5f; + float num11 = (Main.screenPosition.Y + (float)Main.screenHeight) / 16f + 5f; + if (((float)i < num8 || (float)i > num9 || (float)j < num10 || (float)j > num11) && i > 40 && i < Main.maxTilesX - 40 && j > 40 && j < Main.maxTilesY - 40) + { + if (this.changed()) + { + byte b = 0; + for (int k = i - 36; k <= i + 30; k += 10) + { + for (int l = j - 36; l <= j + 30; l += 10) + { + if (Main.map[k, l] != null && Main.map[k, l].active()) + { + int num12 = (int)Main.map[k, l].type; + if (num12 == 147 || num12 == 161 || num12 == 162 || num12 == 163 || num12 == 164 || num12 == 200) + { + b = 255; + break; + } + } + } + if (b != 0) + { + break; + } + } + if (this.type != b) + { + this.changed(true); + } + this.type = b; + return; + } + } + else + { + float num13 = (float)Main.snowTiles / 1000f; + num13 *= 255f; + if (num13 > 255f) + { + num13 = 255f; + } + if ((float)this.type != num13) + { + this.changed(true); + this.type = (byte)num13; + } + } + } + } + } + } + } + } + } +} diff --git a/Terraria/NPC.cs b/Terraria/NPC.cs new file mode 100644 index 0000000..b54e240 --- /dev/null +++ b/Terraria/NPC.cs @@ -0,0 +1,40617 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class NPC + { + public const int maxBuffs = 5; + public float teleportTime; + public static int immuneTime = 20; + public static int maxAI = 4; + public int netSpam; + public static bool noStream = false; + private static int spawnSpaceX = 3; + private static int spawnSpaceY = 3; + public float gfxOffY; + public float stepSpeed; + private static float gravity = 0.3f; + public bool teleporting; + private static int maxAttack = 20; + private static int[] attackNPC = new int[NPC.maxAttack]; + private byte netStream; + private byte[] streamPlayer = new byte[255]; + public Vector2[] oldPos = new Vector2[10]; + public bool setFrameSize; + public static int golemBoss = -1; + public static int plantBoss = -1; + public static int crimsonBoss = -1; + public int netSkip; + public bool netAlways; + public int realLife = -1; + public static int sWidth = 1920; + public static int sHeight = 1080; + private static int spawnRangeX = (int)((double)(NPC.sWidth / 16) * 0.7); + private static int spawnRangeY = (int)((double)(NPC.sHeight / 16) * 0.7); + public static int safeRangeX = (int)((double)(NPC.sWidth / 16) * 0.52); + public static int safeRangeY = (int)((double)(NPC.sHeight / 16) * 0.52); + private static int activeRangeX = (int)((double)NPC.sWidth * 2.1); + private static int activeRangeY = (int)((double)NPC.sHeight * 2.1); + private static int townRangeX = NPC.sWidth; + private static int townRangeY = NPC.sHeight; + public float npcSlots = 1f; + private static bool noSpawnCycle = false; + private static int activeTime = 750; + private static int defaultSpawnRate = 600; + private static int defaultMaxSpawns = 5; + public bool wet; + public bool honeyWet; + public byte wetCount; + public bool lavaWet; + public int[] buffType = new int[5]; + public int[] buffTime = new int[5]; + public bool[] buffImmune = new bool[81]; + public bool midas; + public bool ichor; + public bool onFire; + public bool onFire2; + public bool onFrostBurn; + public bool poisoned; + public bool venom; + public int lifeRegen; + public int lifeRegenCount; + public bool confused; + public static bool downedBoss1 = false; + public static bool downedBoss2 = false; + public static bool downedBoss3 = false; + public static bool downedQueenBee = false; + public static bool savedGoblin = false; + public static bool savedWizard = false; + public static bool savedMech = false; + public static bool downedGoblins = false; + public static bool downedFrost = false; + public static bool downedPirates = false; + public static bool downedClown = false; + public static bool downedPlantBoss = false; + public static bool downedGolemBoss = false; + public static bool downedMechBossAny = false; + public static bool downedMechBoss1 = false; + public static bool downedMechBoss2 = false; + public static bool downedMechBoss3 = false; + private static int spawnRate = NPC.defaultSpawnRate; + private static int maxSpawns = NPC.defaultMaxSpawns; + public int soundDelay; + public Vector2 position; + public Vector2 velocity; + public Vector2 oldPosition; + public Vector2 oldVelocity; + public int width; + public int height; + public bool active; + public int[] immune = new int[256]; + public int direction = 1; + public int directionY = 1; + public int type; + public float[] ai = new float[NPC.maxAI]; + public float[] localAI = new float[NPC.maxAI]; + public int aiAction; + public int aiStyle; + public bool justHit; + public int timeLeft; + public int target = -1; + public int damage; + public int defense; + public int defDamage; + public int defDefense; + public int soundHit; + public int soundKilled; + public int life; + public int lifeMax; + public Rectangle targetRect; + public double frameCounter; + public Rectangle frame; + public string name; + public string displayName; + public Color color; + public int alpha; + public float scale = 1f; + public float knockBackResist = 1f; + public int oldDirection; + public int oldDirectionY; + public int oldTarget; + public int whoAmI; + public float rotation; + public bool noGravity; + public bool noTileCollide; + public bool netUpdate; + public bool netUpdate2; + public bool collideX; + public bool collideY; + public bool boss; + public int spriteDirection = -1; + public bool behindTiles; + public bool lavaImmune; + public float value; + public bool dontTakeDamage; + public int netID; + public bool townNPC; + public bool homeless; + public int homeTileX = -1; + public int homeTileY = -1; + public bool oldHomeless; + public int oldHomeTileX = -1; + public int oldHomeTileY = -1; + public bool friendly; + public bool closeDoor; + public int doorX; + public int doorY; + public int friendlyRegen; + public static void clrNames() + { + for (int i = 0; i < 301; i++) + { + Main.chrName[i] = ""; + } + } + public static void setNames() + { + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random(); + } + int num = WorldGen.genRand.Next(24); + string text; + if (num == 0) + { + text = "Molly"; + } + else + { + if (num == 1) + { + text = "Amy"; + } + else + { + if (num == 2) + { + text = "Claire"; + } + else + { + if (num == 3) + { + text = "Emily"; + } + else + { + if (num == 4) + { + text = "Katie"; + } + else + { + if (num == 5) + { + text = "Madeline"; + } + else + { + if (num == 6) + { + text = "Katelyn"; + } + else + { + if (num == 7) + { + text = "Emma"; + } + else + { + if (num == 8) + { + text = "Abigail"; + } + else + { + if (num == 9) + { + text = "Carly"; + } + else + { + if (num == 10) + { + text = "Jenna"; + } + else + { + if (num == 11) + { + text = "Heather"; + } + else + { + if (num == 12) + { + text = "Katherine"; + } + else + { + if (num == 13) + { + text = "Caitlin"; + } + else + { + if (num == 14) + { + text = "Kaitlin"; + } + else + { + if (num == 15) + { + text = "Holly"; + } + else + { + if (num == 16) + { + text = "Kaitlyn"; + } + else + { + if (num == 17) + { + text = "Hannah"; + } + else + { + if (num == 18) + { + text = "Kathryn"; + } + else + { + if (num == 19) + { + text = "Lorraine"; + } + else + { + if (num == 20) + { + text = "Helen"; + } + else + { + if (num == 21) + { + text = "Kayla"; + } + else + { + if (num == 22) + { + text = "Lisa"; + } + else + { + text = "Allison"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[18] == "") + { + Main.chrName[18] = text; + } + num = WorldGen.genRand.Next(24); + if (num == 0) + { + text = "Shayna"; + } + else + { + if (num == 1) + { + text = "Korrie"; + } + else + { + if (num == 2) + { + text = "Ginger"; + } + else + { + if (num == 3) + { + text = "Brooke"; + } + else + { + if (num == 4) + { + text = "Jenny"; + } + else + { + if (num == 5) + { + text = "Autumn"; + } + else + { + if (num == 6) + { + text = "Nancy"; + } + else + { + if (num == 7) + { + text = "Ella"; + } + else + { + if (num == 8) + { + text = "Kayla"; + } + else + { + if (num == 9) + { + text = "Selah"; + } + else + { + if (num == 10) + { + text = "Sophia"; + } + else + { + if (num == 11) + { + text = "Marshanna"; + } + else + { + if (num == 12) + { + text = "Lauren"; + } + else + { + if (num == 13) + { + text = "Trisha"; + } + else + { + if (num == 14) + { + text = "Shirlena"; + } + else + { + if (num == 15) + { + text = "Sheena"; + } + else + { + if (num == 16) + { + text = "Ellen"; + } + else + { + if (num == 17) + { + text = "Amy"; + } + else + { + if (num == 18) + { + text = "Dawn"; + } + else + { + if (num == 19) + { + text = "Susana"; + } + else + { + if (num == 20) + { + text = "Meredith"; + } + else + { + if (num == 21) + { + text = "Selene"; + } + else + { + if (num == 22) + { + text = "Terra"; + } + else + { + text = "Sally"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[124] == "") + { + Main.chrName[124] = text; + } + num = WorldGen.genRand.Next(24); + if (num == 0) + { + text = "DeShawn"; + } + else + { + if (num == 1) + { + text = "DeAndre"; + } + else + { + if (num == 2) + { + text = "Marquis"; + } + else + { + if (num == 3) + { + text = "Darnell"; + } + else + { + if (num == 4) + { + text = "Terrell"; + } + else + { + if (num == 5) + { + text = "Malik"; + } + else + { + if (num == 6) + { + text = "Trevon"; + } + else + { + if (num == 7) + { + text = "Tyrone"; + } + else + { + if (num == 8) + { + text = "Willie"; + } + else + { + if (num == 9) + { + text = "Dominique"; + } + else + { + if (num == 10) + { + text = "Demetrius"; + } + else + { + if (num == 11) + { + text = "Reginald"; + } + else + { + if (num == 12) + { + text = "Jamal"; + } + else + { + if (num == 13) + { + text = "Maurice"; + } + else + { + if (num == 14) + { + text = "Jalen"; + } + else + { + if (num == 15) + { + text = "Darius"; + } + else + { + if (num == 16) + { + text = "Xavier"; + } + else + { + if (num == 17) + { + text = "Terrance"; + } + else + { + if (num == 18) + { + text = "Andre"; + } + else + { + if (num == 19) + { + text = "Dante"; + } + else + { + if (num == 20) + { + text = "Brimst"; + } + else + { + if (num == 21) + { + text = "Bronson"; + } + else + { + if (num == 22) + { + text = "Tony"; + } + else + { + text = "Darryl"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[19] == "") + { + Main.chrName[19] = text; + } + num = WorldGen.genRand.Next(35); + if (num == 0) + { + text = "Joe"; + } + else + { + if (num == 1) + { + text = "Connor"; + } + else + { + if (num == 2) + { + text = "Tanner"; + } + else + { + if (num == 3) + { + text = "Wyatt"; + } + else + { + if (num == 4) + { + text = "Cody"; + } + else + { + if (num == 5) + { + text = "Levi"; + } + else + { + if (num == 6) + { + text = "Luke"; + } + else + { + if (num == 7) + { + text = "Jack"; + } + else + { + if (num == 8) + { + text = "Scott"; + } + else + { + if (num == 9) + { + text = "Logan"; + } + else + { + if (num == 10) + { + text = "Cole"; + } + else + { + if (num == 11) + { + text = "Asher"; + } + else + { + if (num == 12) + { + text = "Bradley"; + } + else + { + if (num == 13) + { + text = "Jacob"; + } + else + { + if (num == 14) + { + text = "Garrett"; + } + else + { + if (num == 15) + { + text = "Dylan"; + } + else + { + if (num == 16) + { + text = "Maxwell"; + } + else + { + if (num == 17) + { + text = "Steve"; + } + else + { + if (num == 18) + { + text = "Brett"; + } + else + { + if (num == 19) + { + text = "Andrew"; + } + else + { + if (num == 20) + { + text = "Harley"; + } + else + { + if (num == 21) + { + text = "Kyle"; + } + else + { + if (num == 22) + { + text = "Jake"; + } + else + { + if (num == 23) + { + text = "Ryan"; + } + else + { + if (num == 24) + { + text = "Jeffrey"; + } + else + { + if (num == 25) + { + text = "Seth"; + } + else + { + if (num == 26) + { + text = "Marty"; + } + else + { + if (num == 27) + { + text = "Brandon"; + } + else + { + if (num == 28) + { + text = "Zach"; + } + else + { + if (num == 29) + { + text = "Jeff"; + } + else + { + if (num == 30) + { + text = "Daniel"; + } + else + { + if (num == 31) + { + text = "Trent"; + } + else + { + if (num == 32) + { + text = "Kevin"; + } + else + { + if (num == 33) + { + text = "Brian"; + } + else + { + text = "Colin"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[22] == "") + { + Main.chrName[22] = text; + } + num = WorldGen.genRand.Next(22); + if (num == 0) + { + text = "Alalia"; + } + else + { + if (num == 1) + { + text = "Alalia"; + } + else + { + if (num == 2) + { + text = "Alura"; + } + else + { + if (num == 3) + { + text = "Ariella"; + } + else + { + if (num == 4) + { + text = "Caelia"; + } + else + { + if (num == 5) + { + text = "Calista"; + } + else + { + if (num == 6) + { + text = "Chryseis"; + } + else + { + if (num == 7) + { + text = "Emerenta"; + } + else + { + if (num == 8) + { + text = "Elysia"; + } + else + { + if (num == 9) + { + text = "Evvie"; + } + else + { + if (num == 10) + { + text = "Faye"; + } + else + { + if (num == 11) + { + text = "Felicitae"; + } + else + { + if (num == 12) + { + text = "Lunette"; + } + else + { + if (num == 13) + { + text = "Nata"; + } + else + { + if (num == 14) + { + text = "Nissa"; + } + else + { + if (num == 15) + { + text = "Tatiana"; + } + else + { + if (num == 16) + { + text = "Rosalva"; + } + else + { + if (num == 17) + { + text = "Shea"; + } + else + { + if (num == 18) + { + text = "Tania"; + } + else + { + if (num == 19) + { + text = "Isis"; + } + else + { + if (num == 20) + { + text = "Celestia"; + } + else + { + text = "Xylia"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[20] == "") + { + Main.chrName[20] = text; + } + num = WorldGen.genRand.Next(22); + if (num == 0) + { + text = "Dolbere"; + } + else + { + if (num == 1) + { + text = "Bazdin"; + } + else + { + if (num == 2) + { + text = "Durim"; + } + else + { + if (num == 3) + { + text = "Tordak"; + } + else + { + if (num == 4) + { + text = "Garval"; + } + else + { + if (num == 5) + { + text = "Morthal"; + } + else + { + if (num == 6) + { + text = "Oten"; + } + else + { + if (num == 7) + { + text = "Dolgen"; + } + else + { + if (num == 8) + { + text = "Gimli"; + } + else + { + if (num == 9) + { + text = "Gimut"; + } + else + { + if (num == 10) + { + text = "Duerthen"; + } + else + { + if (num == 11) + { + text = "Beldin"; + } + else + { + if (num == 12) + { + text = "Jarut"; + } + else + { + if (num == 13) + { + text = "Ovbere"; + } + else + { + if (num == 14) + { + text = "Norkas"; + } + else + { + if (num == 15) + { + text = "Dolgrim"; + } + else + { + if (num == 16) + { + text = "Boften"; + } + else + { + if (num == 17) + { + text = "Norsun"; + } + else + { + if (num == 18) + { + text = "Dias"; + } + else + { + if (num == 19) + { + text = "Fikod"; + } + else + { + if (num == 20) + { + text = "Urist"; + } + else + { + text = "Darur"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[38] == "") + { + Main.chrName[38] = text; + } + num = WorldGen.genRand.Next(21); + if (num == 0) + { + text = "Dalamar"; + } + else + { + if (num == 1) + { + text = "Dulais"; + } + else + { + if (num == 2) + { + text = "Elric"; + } + else + { + if (num == 3) + { + text = "Arddun"; + } + else + { + if (num == 4) + { + text = "Maelor"; + } + else + { + if (num == 5) + { + text = "Leomund"; + } + else + { + if (num == 6) + { + text = "Hirael"; + } + else + { + if (num == 7) + { + text = "Gwentor"; + } + else + { + if (num == 8) + { + text = "Greum"; + } + else + { + if (num == 9) + { + text = "Gearroid"; + } + else + { + if (num == 10) + { + text = "Fizban"; + } + else + { + if (num == 11) + { + text = "Ningauble"; + } + else + { + if (num == 12) + { + text = "Seonag"; + } + else + { + if (num == 13) + { + text = "Sargon"; + } + else + { + if (num == 14) + { + text = "Merlyn"; + } + else + { + if (num == 15) + { + text = "Magius"; + } + else + { + if (num == 16) + { + text = "Berwyn"; + } + else + { + if (num == 17) + { + text = "Arwyn"; + } + else + { + if (num == 18) + { + text = "Alasdair"; + } + else + { + if (num == 19) + { + text = "Tagar"; + } + else + { + text = "Xanadu"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[108] == "") + { + Main.chrName[108] = text; + } + num = WorldGen.genRand.Next(23); + if (num == 0) + { + text = "Alfred"; + } + else + { + if (num == 1) + { + text = "Barney"; + } + else + { + if (num == 2) + { + text = "Calvin"; + } + else + { + if (num == 3) + { + text = "Edmund"; + } + else + { + if (num == 4) + { + text = "Edwin"; + } + else + { + if (num == 5) + { + text = "Eugene"; + } + else + { + if (num == 6) + { + text = "Frank"; + } + else + { + if (num == 7) + { + text = "Frederick"; + } + else + { + if (num == 8) + { + text = "Gilbert"; + } + else + { + if (num == 9) + { + text = "Gus"; + } + else + { + if (num == 10) + { + text = "Wilbur"; + } + else + { + if (num == 11) + { + text = "Seymour"; + } + else + { + if (num == 12) + { + text = "Louis"; + } + else + { + if (num == 13) + { + text = "Humphrey"; + } + else + { + if (num == 14) + { + text = "Harold"; + } + else + { + if (num == 15) + { + text = "Milton"; + } + else + { + if (num == 16) + { + text = "Mortimer"; + } + else + { + if (num == 17) + { + text = "Howard"; + } + else + { + if (num == 18) + { + text = "Walter"; + } + else + { + if (num == 19) + { + text = "Finn"; + } + else + { + if (num == 20) + { + text = "Isacc"; + } + else + { + if (num == 21) + { + text = "Joseph"; + } + else + { + text = "Ralph"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[17] == "") + { + Main.chrName[17] = text; + } + num = WorldGen.genRand.Next(24); + if (num == 0) + { + text = "Sebastian"; + } + else + { + if (num == 1) + { + text = "Rupert"; + } + else + { + if (num == 2) + { + text = "Clive"; + } + else + { + if (num == 3) + { + text = "Nigel"; + } + else + { + if (num == 4) + { + text = "Mervyn"; + } + else + { + if (num == 5) + { + text = "Cedric"; + } + else + { + if (num == 6) + { + text = "Pip"; + } + else + { + if (num == 7) + { + text = "Cyril"; + } + else + { + if (num == 8) + { + text = "Fitz"; + } + else + { + if (num == 9) + { + text = "Lloyd"; + } + else + { + if (num == 10) + { + text = "Arthur"; + } + else + { + if (num == 11) + { + text = "Rodney"; + } + else + { + if (num == 12) + { + text = "Graham"; + } + else + { + if (num == 13) + { + text = "Edward"; + } + else + { + if (num == 14) + { + text = "Alfred"; + } + else + { + if (num == 15) + { + text = "Edmund"; + } + else + { + if (num == 16) + { + text = "Henry"; + } + else + { + if (num == 17) + { + text = "Herald"; + } + else + { + if (num == 18) + { + text = "Roland"; + } + else + { + if (num == 19) + { + text = "Lincoln"; + } + else + { + if (num == 20) + { + text = "Lloyd"; + } + else + { + if (num == 21) + { + text = "Edgar"; + } + else + { + if (num == 22) + { + text = "Eustace"; + } + else + { + text = "Rodrick"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[54] == "") + { + Main.chrName[54] = text; + } + num = WorldGen.genRand.Next(25); + if (num == 0) + { + text = "Grodax"; + } + else + { + if (num == 1) + { + text = "Sarx"; + } + else + { + if (num == 2) + { + text = "Xon"; + } + else + { + if (num == 3) + { + text = "Mrunok"; + } + else + { + if (num == 4) + { + text = "Nuxatk"; + } + else + { + if (num == 5) + { + text = "Tgerd"; + } + else + { + if (num == 6) + { + text = "Darz"; + } + else + { + if (num == 7) + { + text = "Smador"; + } + else + { + if (num == 8) + { + text = "Stazen"; + } + else + { + if (num == 9) + { + text = "Mobart"; + } + else + { + if (num == 10) + { + text = "Knogs"; + } + else + { + if (num == 11) + { + text = "Tkanus"; + } + else + { + if (num == 12) + { + text = "Negurk"; + } + else + { + if (num == 13) + { + text = "Nort"; + } + else + { + if (num == 14) + { + text = "Durnok"; + } + else + { + if (num == 15) + { + text = "Trogem"; + } + else + { + if (num == 16) + { + text = "Stezom"; + } + else + { + if (num == 17) + { + text = "Gnudar"; + } + else + { + if (num == 18) + { + text = "Ragz"; + } + else + { + if (num == 19) + { + text = "Fahd"; + } + else + { + if (num == 20) + { + text = "Xanos"; + } + else + { + if (num == 21) + { + text = "Arback"; + } + else + { + if (num == 22) + { + text = "Fjell"; + } + else + { + if (num == 23) + { + text = "Dalek"; + } + else + { + text = "Knub"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[107] == "") + { + Main.chrName[107] = text; + } + num = WorldGen.genRand.Next(12); + if (num == 0) + { + text = "Reishi"; + } + else + { + if (num == 1) + { + text = "Maitake"; + } + else + { + if (num == 2) + { + text = "Chanterelle"; + } + else + { + if (num == 3) + { + text = "Porcini"; + } + else + { + if (num == 4) + { + text = "Shimeji"; + } + else + { + if (num == 5) + { + text = "Amanita"; + } + else + { + if (num == 6) + { + text = "Muscaria"; + } + else + { + if (num == 7) + { + text = "Agaric"; + } + else + { + if (num == 8) + { + text = "Cremini"; + } + else + { + if (num == 9) + { + text = "Morel"; + } + else + { + if (num == 10) + { + text = "Enoki"; + } + else + { + text = "Shiitake"; + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[160] == "") + { + Main.chrName[160] = text; + } + num = WorldGen.genRand.Next(20); + if (num == 0) + { + text = "Whitney"; + } + else + { + if (num == 1) + { + text = "Verity"; + } + else + { + if (num == 2) + { + text = "Ada"; + } + else + { + if (num == 3) + { + text = "Cornelia"; + } + else + { + if (num == 4) + { + text = "Lydia"; + } + else + { + if (num == 5) + { + text = "Leila"; + } + else + { + if (num == 6) + { + text = "Minerva"; + } + else + { + if (num == 7) + { + text = "Emeline"; + } + else + { + if (num == 8) + { + text = "Cynthia"; + } + else + { + if (num == 9) + { + text = "Fidelia"; + } + else + { + if (num == 10) + { + text = "Lilly"; + } + else + { + if (num == 11) + { + text = "Phoebe"; + } + else + { + if (num == 12) + { + text = "Zylphia"; + } + else + { + if (num == 13) + { + text = "Zelda"; + } + else + { + if (num == 14) + { + text = "Selina"; + } + else + { + if (num == 15) + { + text = "Hope"; + } + else + { + if (num == 16) + { + text = "Isabella"; + } + else + { + if (num == 17) + { + text = "Judith"; + } + else + { + if (num == 18) + { + text = "Savannah"; + } + else + { + text = "Vivian"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[178] == "") + { + Main.chrName[178] = text; + } + num = WorldGen.genRand.Next(16); + if (num == 0) + { + text = "Abdosir"; + } + else + { + if (num == 1) + { + text = "Akbar"; + } + else + { + if (num == 2) + { + text = "Bodashtart"; + } + else + { + if (num == 3) + { + text = "Danel"; + } + else + { + if (num == 4) + { + text = "Hanno"; + } + else + { + if (num == 5) + { + text = "Hiram"; + } + else + { + if (num == 6) + { + text = "Kanmi"; + } + else + { + if (num == 7) + { + text = "Philosir"; + } + else + { + if (num == 8) + { + text = "Tabnit"; + } + else + { + if (num == 9) + { + text = "Yutpan"; + } + else + { + if (num == 10) + { + text = "Ahirom"; + } + else + { + if (num == 11) + { + text = "Batnoam"; + } + else + { + if (num == 12) + { + text = "Sikarbaal"; + } + else + { + if (num == 13) + { + text = "Hannibal"; + } + else + { + if (num == 14) + { + text = "Yehomilk"; + } + else + { + text = "Ahinadab"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[207] == "") + { + Main.chrName[207] = text; + } + num = WorldGen.genRand.Next(18); + if (num == 0) + { + text = "Candy"; + } + else + { + if (num == 1) + { + text = "Roxanne"; + } + else + { + if (num == 2) + { + text = "Trixy"; + } + else + { + if (num == 3) + { + text = "Destiny"; + } + else + { + if (num == 4) + { + text = "Lexus"; + } + else + { + if (num == 5) + { + text = "Bambi"; + } + else + { + if (num == 6) + { + text = "Bailey"; + } + else + { + if (num == 7) + { + text = "Glitter"; + } + else + { + if (num == 8) + { + text = "Sparkle"; + } + else + { + if (num == 9) + { + text = "Paris"; + } + else + { + if (num == 10) + { + text = "Dazzle"; + } + else + { + if (num == 11) + { + text = "Fantasy"; + } + else + { + if (num == 12) + { + text = "Bunny"; + } + else + { + if (num == 13) + { + text = "Sugar"; + } + else + { + if (num == 14) + { + text = "Fantasia"; + } + else + { + if (num == 15) + { + text = "Star"; + } + else + { + if (num == 16) + { + text = "Isis"; + } + else + { + text = "Cherry"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[208] == "") + { + Main.chrName[208] = text; + } + num = WorldGen.genRand.Next(23); + if (num == 0) + { + text = "Alpha"; + } + else + { + if (num == 1) + { + text = "Beta"; + } + else + { + if (num == 2) + { + text = "Delta"; + } + else + { + if (num == 3) + { + text = "Omega"; + } + else + { + if (num == 4) + { + text = "Gamma"; + } + else + { + if (num == 5) + { + text = "Theta"; + } + else + { + if (num == 6) + { + text = "Kappa"; + } + else + { + if (num == 7) + { + text = "Omicron"; + } + else + { + if (num == 8) + { + text = "Sigma"; + } + else + { + if (num == 9) + { + text = "Upsilon"; + } + else + { + if (num == 10) + { + text = "Phi"; + } + else + { + if (num == 11) + { + text = "Zeta"; + } + else + { + if (num == 12) + { + text = "Lambda"; + } + else + { + if (num == 13) + { + text = "Nu"; + } + else + { + if (num == 14) + { + text = "Ci"; + } + else + { + if (num == 15) + { + text = "Rho"; + } + else + { + if (num == 16) + { + text = "Phi"; + } + else + { + if (num == 17) + { + text = "Fender"; + } + else + { + if (num == 18) + { + text = "T-3E0"; + } + else + { + if (num == 19) + { + text = "Niner-7"; + } + else + { + if (num == 20) + { + text = "A.N.D.Y"; + } + else + { + if (num == 21) + { + text = "Syn-X"; + } + else + { + text = "Mu"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[209] == "") + { + Main.chrName[209] = text; + } + num = WorldGen.genRand.Next(17); + if (num == 0) + { + text = "Marco"; + } + else + { + if (num == 1) + { + text = "Guido"; + } + else + { + if (num == 2) + { + text = "Enzo"; + } + else + { + if (num == 3) + { + text = "Martino"; + } + else + { + if (num == 4) + { + text = "Mauro"; + } + else + { + if (num == 5) + { + text = "Lorenzo"; + } + else + { + if (num == 6) + { + text = "Ludo"; + } + else + { + if (num == 7) + { + text = "Luciano"; + } + else + { + if (num == 8) + { + text = "Carlo"; + } + else + { + if (num == 9) + { + text = "Bruno"; + } + else + { + if (num == 10) + { + text = "Mario"; + } + else + { + if (num == 11) + { + text = "Leonardo"; + } + else + { + if (num == 12) + { + text = "Raphael"; + } + else + { + if (num == 13) + { + text = "Luigi"; + } + else + { + if (num == 14) + { + text = "Luca"; + } + else + { + if (num == 15) + { + text = "Darren"; + } + else + { + text = "Stefano"; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[227] == "") + { + Main.chrName[227] = text; + } + num = WorldGen.genRand.Next(10); + if (num == 0) + { + text = "Abibe"; + } + else + { + if (num == 1) + { + text = "Jamundi"; + } + else + { + if (num == 2) + { + text = "U'wa"; + } + else + { + if (num == 3) + { + text = "Tairona"; + } + else + { + if (num == 4) + { + text = "Xirigua"; + } + else + { + if (num == 5) + { + text = "Zop'a"; + } + else + { + if (num == 6) + { + text = "Opuni"; + } + else + { + if (num == 7) + { + text = "Kogi-ghi"; + } + else + { + if (num == 8) + { + text = "Konah"; + } + else + { + text = "Gboto"; + } + } + } + } + } + } + } + } + } + if (Main.chrName[228] == "") + { + Main.chrName[228] = text; + } + num = WorldGen.genRand.Next(11); + if (num == 0) + { + text = "David"; + } + else + { + if (num == 1) + { + text = "Red Beard"; + } + else + { + if (num == 2) + { + text = "Jack"; + } + else + { + if (num == 3) + { + text = "Black Beard"; + } + else + { + if (num == 4) + { + text = "Captain Morgan"; + } + else + { + if (num == 5) + { + text = "Wet Beard"; + } + else + { + if (num == 6) + { + text = "James T. Beard"; + } + else + { + if (num == 7) + { + text = "Gunpowder Garry"; + } + else + { + if (num == 8) + { + text = "Captain Stoney Dirt"; + } + else + { + if (num == 9) + { + text = "Jake"; + } + else + { + text = "Captain Bullywort"; + } + } + } + } + } + } + } + } + } + } + if (Main.chrName[229] == "") + { + Main.chrName[229] = text; + } + } + public void netDefaults(int type) + { + if (type < 0) + { + if (type == -1) + { + this.SetDefaults("Slimeling"); + return; + } + if (type == -2) + { + this.SetDefaults("Slimer2"); + return; + } + if (type == -3) + { + this.SetDefaults("Green Slime"); + return; + } + if (type == -4) + { + this.SetDefaults("Pinky"); + return; + } + if (type == -5) + { + this.SetDefaults("Baby Slime"); + return; + } + if (type == -6) + { + this.SetDefaults("Black Slime"); + return; + } + if (type == -7) + { + this.SetDefaults("Purple Slime"); + return; + } + if (type == -8) + { + this.SetDefaults("Red Slime"); + return; + } + if (type == -9) + { + this.SetDefaults("Yellow Slime"); + return; + } + if (type == -10) + { + this.SetDefaults("Jungle Slime"); + return; + } + if (type == -11) + { + this.SetDefaults("Little Eater"); + return; + } + if (type == -12) + { + this.SetDefaults("Big Eater"); + return; + } + if (type == -13) + { + this.SetDefaults("Short Bones"); + return; + } + if (type == -14) + { + this.SetDefaults("Big Boned"); + return; + } + if (type == -15) + { + this.SetDefaults("Heavy Skeleton"); + return; + } + if (type == -16) + { + this.SetDefaults("Little Stinger"); + return; + } + if (type == -17) + { + this.SetDefaults("Big Stinger"); + return; + } + if (type == -18) + { + this.SetDefaults("Tiny Moss Hornet"); + return; + } + if (type == -19) + { + this.SetDefaults("Little Moss Hornet"); + return; + } + if (type == -20) + { + this.SetDefaults("Big Moss Hornet"); + return; + } + if (type == -21) + { + this.SetDefaults("Giant Moss Hornet"); + return; + } + if (type == -22) + { + this.SetDefaults("Little Crimera"); + return; + } + if (type == -23) + { + this.SetDefaults("Big Crimera"); + return; + } + if (type == -24) + { + this.SetDefaults("Little Crimslime"); + return; + } + if (type == -25) + { + this.SetDefaults("Big Crimslime"); + return; + } + if (type == -26) + { + this.SetDefaults("Small Zombie"); + return; + } + if (type == -27) + { + this.SetDefaults("Big Zombie"); + return; + } + if (type == -28) + { + this.SetDefaults("Small Bald Zombie"); + return; + } + if (type == -29) + { + this.SetDefaults("Big Bald Zombie"); + return; + } + if (type == -30) + { + this.SetDefaults("Small Pincushion Zombie"); + return; + } + if (type == -31) + { + this.SetDefaults("Big Pincushion Zombie"); + return; + } + if (type == -32) + { + this.SetDefaults("Small Slimed Zombie"); + return; + } + if (type == -33) + { + this.SetDefaults("Big Slimed Zombie"); + return; + } + if (type == -34) + { + this.SetDefaults("Small Swamp Zombie"); + return; + } + if (type == -35) + { + this.SetDefaults("Big Swamp Zombie"); + return; + } + if (type == -36) + { + this.SetDefaults("Small Twiggy Zombie"); + return; + } + if (type == -37) + { + this.SetDefaults("Big Twiggy Zombie"); + return; + } + if (type == -38) + { + this.SetDefaults("Cataract Eye 2"); + return; + } + if (type == -39) + { + this.SetDefaults("Sleepy Eye 2"); + return; + } + if (type == -40) + { + this.SetDefaults("Dialated Eye 2"); + return; + } + if (type == -41) + { + this.SetDefaults("Green Eye 2"); + return; + } + if (type == -42) + { + this.SetDefaults("Purple Eye 2"); + return; + } + if (type == -43) + { + this.SetDefaults("Demon Eye 2"); + return; + } + if (type == -44) + { + this.SetDefaults("Small Female Zombie"); + return; + } + if (type == -45) + { + this.SetDefaults("Big Female Zombie"); + return; + } + if (type == -46) + { + this.SetDefaults("Small Skeleton"); + return; + } + if (type == -47) + { + this.SetDefaults("Big Skeleton"); + return; + } + if (type == -48) + { + this.SetDefaults("Small Headache Skeleton"); + return; + } + if (type == -49) + { + this.SetDefaults("Big Headache Skeleton"); + return; + } + if (type == -50) + { + this.SetDefaults("Small Misassembled Skeleton"); + return; + } + if (type == -51) + { + this.SetDefaults("Big Misassembled Skeleton"); + return; + } + if (type == -52) + { + this.SetDefaults("Small Pantless Skeleton"); + return; + } + if (type == -53) + { + this.SetDefaults("Big Pantless Skeleton"); + return; + } + if (type == -54) + { + this.SetDefaults("Small Rain Zombie"); + return; + } + if (type == -55) + { + this.SetDefaults("Big Rain Zombie"); + return; + } + if (type == -56) + { + this.SetDefaults("Little Hornet Fatty"); + return; + } + if (type == -57) + { + this.SetDefaults("Big Hornet Fatty"); + return; + } + if (type == -58) + { + this.SetDefaults("Little Hornet Honey"); + return; + } + if (type == -59) + { + this.SetDefaults("Big Hornet Honey"); + return; + } + if (type == -60) + { + this.SetDefaults("Little Hornet Leafy"); + return; + } + if (type == -61) + { + this.SetDefaults("Big Hornet Leafy"); + return; + } + if (type == -62) + { + this.SetDefaults("Little Hornet Spikey"); + return; + } + if (type == -63) + { + this.SetDefaults("Big Hornet Spikey"); + return; + } + if (type == -64) + { + this.SetDefaults("Little Hornet Stingy"); + return; + } + if (type == -65) + { + this.SetDefaults("Big Hornet Stingy"); + return; + } + } + else + { + this.SetDefaults(type, -1f); + } + } + public void SetDefaults(string Name) + { + this.SetDefaults(0, -1f); + if (Name == "Slimeling") + { + this.SetDefaults(81, 0.6f); + this.name = Name; + this.damage = 45; + this.defense = 10; + this.life = 90; + this.knockBackResist = 1.2f; + this.value = 100f; + this.netID = -1; + } + else + { + if (Name == "Slimer2") + { + this.SetDefaults(81, 0.9f); + this.displayName = "Slimer"; + this.name = Name; + this.damage = 45; + this.defense = 20; + this.life = 90; + this.knockBackResist = 1.2f; + this.value = 100f; + this.netID = -2; + } + else + { + if (Name == "Green Slime") + { + this.SetDefaults(1, 0.9f); + this.name = Name; + this.damage = 6; + this.defense = 0; + this.life = 14; + this.knockBackResist = 1.2f; + this.color = new Color(0, 220, 40, 100); + this.value = 3f; + this.netID = -3; + } + else + { + if (Name == "Pinky") + { + this.SetDefaults(1, 0.6f); + this.name = Name; + this.damage = 5; + this.defense = 5; + this.life = 150; + this.knockBackResist = 1.4f; + this.color = new Color(250, 30, 90, 90); + this.value = 10000f; + this.netID = -4; + } + else + { + if (Name == "Baby Slime") + { + this.SetDefaults(1, 0.9f); + this.name = Name; + this.damage = 13; + this.defense = 4; + this.life = 30; + this.knockBackResist = 0.95f; + this.alpha = 120; + this.color = new Color(0, 0, 0, 50); + this.value = 10f; + this.netID = -5; + } + else + { + if (Name == "Black Slime") + { + this.SetDefaults(1, -1f); + this.name = Name; + this.damage = 15; + this.defense = 4; + this.life = 45; + this.color = new Color(0, 0, 0, 50); + this.value = 20f; + this.netID = -6; + } + else + { + if (Name == "Purple Slime") + { + this.SetDefaults(1, 1.2f); + this.name = Name; + this.damage = 12; + this.defense = 6; + this.life = 40; + this.knockBackResist = 0.9f; + this.color = new Color(200, 0, 255, 150); + this.value = 10f; + this.netID = -7; + } + else + { + if (Name == "Red Slime") + { + this.SetDefaults(1, -1f); + this.name = Name; + this.damage = 12; + this.defense = 4; + this.life = 35; + this.color = new Color(255, 30, 0, 100); + this.value = 8f; + this.netID = -8; + } + else + { + if (Name == "Yellow Slime") + { + this.SetDefaults(1, 1.2f); + this.name = Name; + this.damage = 15; + this.defense = 7; + this.life = 45; + this.color = new Color(255, 255, 0, 100); + this.value = 10f; + this.netID = -9; + } + else + { + if (Name == "Jungle Slime") + { + this.SetDefaults(1, 1.1f); + this.name = Name; + this.damage = 18; + this.defense = 6; + this.life = 60; + this.color = new Color(143, 215, 93, 100); + this.value = 500f; + this.netID = -10; + } + else + { + if (Name == "Little Eater") + { + this.SetDefaults(6, 0.85f); + this.name = Name; + this.displayName = "Eater of Souls"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -11; + } + else + { + if (Name == "Big Eater") + { + this.SetDefaults(6, 1.15f); + this.name = Name; + this.displayName = "Eater of Souls"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -12; + } + else + { + if (Name == "Short Bones") + { + this.SetDefaults(31, 0.9f); + this.name = Name; + this.displayName = "Angry Bones"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.netID = -13; + } + else + { + if (Name == "Big Boned") + { + this.SetDefaults(31, 1.15f); + this.name = Name; + this.displayName = "Angry Bones"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((double)((float)this.damage * this.scale) * 1.1); + this.life = (int)((double)((float)this.life * this.scale) * 1.1); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots = 2f; + this.knockBackResist *= 2f - this.scale; + this.netID = -14; + } + else + { + if (Name == "Heavy Skeleton") + { + this.SetDefaults(77, 1.15f); + this.name = Name; + this.displayName = "Armored Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((double)((float)this.damage * this.scale) * 1.1); + this.life = 400; + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots = 2f; + this.knockBackResist *= 2f - this.scale; + this.height = 44; + this.netID = -15; + } + else + { + if (Name == "Little Stinger") + { + this.SetDefaults(42, 0.85f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -16; + } + else + { + if (Name == "Big Stinger") + { + this.SetDefaults(42, 1.2f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -17; + } + else + { + if (Name == "Tiny Moss Hornet") + { + this.SetDefaults(176, 0.8f); + this.displayName = "Moss Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -18; + } + else + { + if (Name == "Little Moss Hornet") + { + this.SetDefaults(176, 0.9f); + this.displayName = "Moss Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -19; + } + else + { + if (Name == "Big Moss Hornet") + { + this.SetDefaults(176, 1.1f); + this.displayName = "Moss Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -20; + } + else + { + if (Name == "Giant Moss Hornet") + { + this.SetDefaults(176, 1.2f); + this.displayName = "Moss Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -21; + } + else + { + if (Name == "Little Crimera") + { + this.SetDefaults(173, 0.85f); + this.displayName = "Crimera"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -22; + } + else + { + if (Name == "Big Crimera") + { + this.SetDefaults(173, 1.15f); + this.displayName = "Crimera"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -23; + } + else + { + if (Name == "Little Crimslime") + { + this.SetDefaults(183, 0.85f); + this.displayName = "Crimslime"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -24; + } + else + { + if (Name == "Big Crimslime") + { + this.SetDefaults(183, 1.15f); + this.displayName = "Crimslime"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -25; + } + else + { + if (Name == "Small Zombie") + { + this.SetDefaults(3, 0.9f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -26; + } + else + { + if (Name == "Big Zombie") + { + this.SetDefaults(3, 1.1f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -27; + } + else + { + if (Name == "Small Bald Zombie") + { + this.SetDefaults(132, 0.85f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -28; + } + else + { + if (Name == "Big Bald Zombie") + { + this.SetDefaults(132, 1.15f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -29; + } + else + { + if (Name == "Small Pincushion Zombie") + { + this.SetDefaults(186, 0.93f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -30; + } + else + { + if (Name == "Big Pincushion Zombie") + { + this.SetDefaults(186, 1.13f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -31; + } + else + { + if (Name == "Small Slimed Zombie") + { + this.SetDefaults(187, 0.89f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -32; + } + else + { + if (Name == "Big Slimed Zombie") + { + this.SetDefaults(187, 1.11f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -33; + } + else + { + if (Name == "Small Swamp Zombie") + { + this.SetDefaults(188, 0.87f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -34; + } + else + { + if (Name == "Big Swamp Zombie") + { + this.SetDefaults(188, 1.13f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -35; + } + else + { + if (Name == "Small Twiggy Zombie") + { + this.SetDefaults(189, 0.92f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -36; + } + else + { + if (Name == "Big Twiggy Zombie") + { + this.SetDefaults(189, 1.08f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -37; + } + else + { + if (Name == "Cataract Eye 2") + { + this.SetDefaults(190, 1.15f); + this.name = Name; + this.displayName = "Demon Eye"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -38; + } + else + { + if (Name == "Sleepy Eye 2") + { + this.SetDefaults(191, 1.1f); + this.name = Name; + this.displayName = "Demon Eye"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -39; + } + else + { + if (Name == "Dialated Eye 2") + { + this.SetDefaults(192, 0.9f); + this.name = Name; + this.displayName = "Demon Eye"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -40; + } + else + { + if (Name == "Green Eye 2") + { + this.SetDefaults(193, 0.85f); + this.name = Name; + this.displayName = "Demon Eye"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -41; + } + else + { + if (Name == "Purple Eye 2") + { + this.SetDefaults(194, 1.1f); + this.name = Name; + this.displayName = "Demon Eye"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -42; + } + else + { + if (Name == "Demon Eye 2") + { + this.SetDefaults(2, 1.15f); + this.name = Name; + this.displayName = "Demon Eye"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -43; + } + else + { + if (Name == "Small Female Zombie") + { + this.SetDefaults(200, 0.87f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -44; + } + else + { + if (Name == "Big Female Zombie") + { + this.SetDefaults(200, 1.05f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -45; + } + else + { + if (Name == "Small Skeleton") + { + this.SetDefaults(21, 0.9f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -46; + } + else + { + if (Name == "Big Skeleton") + { + this.SetDefaults(21, 1.1f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -47; + } + else + { + if (Name == "Small Headache Skeleton") + { + this.SetDefaults(201, 0.93f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -48; + } + else + { + if (Name == "Big Headache Skeleton") + { + this.SetDefaults(201, 1.07f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -49; + } + else + { + if (Name == "Small Misassembled Skeleton") + { + this.SetDefaults(202, 0.87f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -50; + } + else + { + if (Name == "Big Misassembled Skeleton") + { + this.SetDefaults(202, 1.13f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -51; + } + else + { + if (Name == "Small Pantless Skeleton") + { + this.SetDefaults(203, 0.85f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -52; + } + else + { + if (Name == "Big Pantless Skeleton") + { + this.SetDefaults(203, 1.15f); + this.name = Name; + this.displayName = "Skeleton"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -53; + } + else + { + if (Name == "Small Rain Zombie") + { + this.SetDefaults(223, 0.9f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -54; + } + else + { + if (Name == "Big Rain Zombie") + { + this.SetDefaults(223, 1.1f); + this.name = Name; + this.displayName = "Zombie"; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -55; + } + else + { + if (Name == "Little Hornet Fatty") + { + this.SetDefaults(231, 0.85f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -56; + } + else + { + if (Name == "Big Hornet Fatty") + { + this.SetDefaults(231, 1.25f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -57; + } + else + { + if (Name == "Little Hornet Honey") + { + this.SetDefaults(232, 0.8f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -58; + } + else + { + if (Name == "Big Hornet Honey") + { + this.SetDefaults(232, 1.15f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -59; + } + else + { + if (Name == "Little Hornet Leafy") + { + this.SetDefaults(233, 0.92f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -60; + } + else + { + if (Name == "Big Hornet Leafy") + { + this.SetDefaults(233, 1.1f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -61; + } + else + { + if (Name == "Little Hornet Spikey") + { + this.SetDefaults(234, 0.78f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -62; + } + else + { + if (Name == "Big Hornet Spikey") + { + this.SetDefaults(234, 1.16f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -63; + } + else + { + if (Name == "Little Hornet Stingy") + { + this.SetDefaults(235, 0.87f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -64; + } + else + { + if (Name == "Big Hornet Stingy") + { + this.SetDefaults(235, 1.21f); + this.displayName = "Hornet"; + this.name = Name; + this.defense = (int)((float)this.defense * this.scale); + this.damage = (int)((float)this.damage * this.scale); + this.life = (int)((float)this.life * this.scale); + this.value = (float)((int)(this.value * this.scale)); + this.npcSlots *= this.scale; + this.knockBackResist *= 2f - this.scale; + this.netID = -65; + } + else + { + if (Name != "") + { + for (int i = 1; i < 301; i++) + { + if (Main.npcName[i] == Name) + { + this.SetDefaults(i, -1f); + return; + } + } + this.SetDefaults(0, -1f); + this.active = false; + } + else + { + this.active = false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + this.displayName = Lang.npcName(this.netID, false); + this.lifeMax = this.life; + this.defDamage = this.damage; + this.defDefense = this.defense; + } + public static bool MechSpawn(float x, float y, int type) + { + int num = 0; + int num2 = 0; + int num3 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].type == type) + { + num++; + Vector2 vector = new Vector2(x, y); + float num4 = Main.npc[i].position.X - vector.X; + float num5 = Main.npc[i].position.Y - vector.Y; + float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); + if (num6 < 200f) + { + num2++; + } + if (num6 < 600f) + { + num3++; + } + } + } + return num2 < 3 && num3 < 6 && num < 10; + } + public static int TypeToNum(int type) + { + if (type == 17) + { + return 2; + } + if (type == 18) + { + return 3; + } + if (type == 19) + { + return 6; + } + if (type == 20) + { + return 5; + } + if (type == 22) + { + return 1; + } + if (type == 38) + { + return 4; + } + if (type == 54) + { + return 7; + } + if (type == 107) + { + return 9; + } + if (type == 108) + { + return 10; + } + if (type == 124) + { + return 8; + } + if (type == 142) + { + return 11; + } + if (type == 160) + { + return 12; + } + if (type == 178) + { + return 13; + } + if (type == 207) + { + return 14; + } + if (type == 208) + { + return 15; + } + if (type == 209) + { + return 16; + } + if (type == 227) + { + return 17; + } + if (type == 228) + { + return 18; + } + if (type == 229) + { + return 19; + } + return -1; + } + public static int NumToType(int type) + { + if (type == 2) + { + return 17; + } + if (type == 3) + { + return 18; + } + if (type == 6) + { + return 19; + } + if (type == 5) + { + return 20; + } + if (type == 1) + { + return 22; + } + if (type == 4) + { + return 38; + } + if (type == 7) + { + return 54; + } + if (type == 9) + { + return 107; + } + if (type == 10) + { + return 108; + } + if (type == 8) + { + return 124; + } + if (type == 11) + { + return 142; + } + if (type == 12) + { + return 160; + } + if (type == 13) + { + return 178; + } + if (type == 14) + { + return 207; + } + if (type == 15) + { + return 208; + } + if (type == 16) + { + return 209; + } + if (type == 17) + { + return 227; + } + if (type == 18) + { + return 228; + } + if (type == 19) + { + return 229; + } + return -1; + } + public void SetDefaults(int Type, float scaleOverride = -1f) + { + NPC.noStream = false; + this.netStream = 32; + bool flag = false; + this.netID = 0; + this.netAlways = false; + this.netSpam = 0; + for (int i = 0; i < this.oldPos.Length; i++) + { + this.oldPos[i].X = 0f; + this.oldPos[i].Y = 0f; + } + for (int j = 0; j < 5; j++) + { + this.buffTime[j] = 0; + this.buffType[j] = 0; + } + for (int k = 0; k < 81; k++) + { + this.buffImmune[k] = false; + } + this.setFrameSize = false; + this.buffImmune[31] = true; + this.netSkip = -2; + this.realLife = -1; + this.lifeRegen = 0; + this.lifeRegenCount = 0; + this.poisoned = false; + this.venom = false; + this.onFire = false; + this.midas = false; + this.ichor = false; + this.onFrostBurn = false; + this.confused = false; + this.onFire2 = false; + this.justHit = false; + this.dontTakeDamage = false; + this.npcSlots = 1f; + this.lavaImmune = false; + this.lavaWet = false; + this.wetCount = 0; + this.wet = false; + this.townNPC = false; + this.homeless = false; + this.homeTileX = -1; + this.homeTileY = -1; + this.friendly = false; + this.behindTiles = false; + this.boss = false; + this.noTileCollide = false; + this.rotation = 0f; + this.active = true; + this.alpha = 0; + this.color = default(Color); + this.collideX = false; + this.collideY = false; + this.direction = 0; + this.oldDirection = this.direction; + this.frameCounter = 0.0; + this.netUpdate = true; + this.netUpdate2 = false; + this.knockBackResist = 1f; + this.name = ""; + this.displayName = ""; + this.noGravity = false; + this.scale = 1f; + this.soundHit = 0; + this.soundKilled = 0; + this.spriteDirection = -1; + this.target = 255; + this.oldTarget = this.target; + this.targetRect = default(Rectangle); + this.timeLeft = NPC.activeTime; + this.type = Type; + this.value = 0f; + for (int l = 0; l < NPC.maxAI; l++) + { + this.ai[l] = 0f; + } + for (int m = 0; m < NPC.maxAI; m++) + { + this.localAI[m] = 0f; + } + if (this.type == 1) + { + this.name = "Blue Slime"; + this.width = 24; + this.height = 18; + this.aiStyle = 1; + this.damage = 7; + this.defense = 2; + this.lifeMax = 25; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 175; + this.color = new Color(0, 80, 255, 100); + this.value = 25f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 2) + { + this.name = "Demon Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 18; + this.defense = 2; + this.lifeMax = 60; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 75f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 3) + { + this.name = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 14; + this.defense = 6; + this.lifeMax = 45; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 60f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 4) + { + this.name = "Eye of Cthulhu"; + this.width = 100; + this.height = 110; + this.aiStyle = 4; + this.damage = 15; + this.defense = 12; + this.lifeMax = 2800; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.noGravity = true; + this.noTileCollide = true; + this.timeLeft = NPC.activeTime * 30; + this.boss = true; + this.value = 30000f; + this.npcSlots = 5f; + } + else + { + if (this.type == 5) + { + this.name = "Servant of Cthulhu"; + this.width = 20; + this.height = 20; + this.aiStyle = 5; + this.damage = 12; + this.defense = 0; + this.lifeMax = 8; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + } + else + { + if (this.type == 6) + { + this.npcSlots = 1f; + this.name = "Eater of Souls"; + this.width = 30; + this.height = 30; + this.aiStyle = 5; + this.damage = 22; + this.defense = 8; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.knockBackResist = 0.5f; + this.value = 90f; + } + else + { + if (this.type == 7) + { + this.displayName = "Devourer"; + this.npcSlots = 3.5f; + this.name = "Devourer Head"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.damage = 31; + this.defense = 2; + this.lifeMax = 100; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 140f; + this.netAlways = true; + } + else + { + if (this.type == 8) + { + this.displayName = "Devourer"; + this.name = "Devourer Body"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 16; + this.defense = 6; + this.lifeMax = 100; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 140f; + NPC.noStream = true; + } + else + { + if (this.type == 9) + { + this.displayName = "Devourer"; + this.name = "Devourer Tail"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 13; + this.defense = 10; + this.lifeMax = 100; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 140f; + NPC.noStream = true; + } + else + { + if (this.type == 10) + { + this.displayName = "Giant Worm"; + this.name = "Giant Worm Head"; + this.width = 14; + this.height = 14; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 8; + this.defense = 0; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 40f; + } + else + { + if (this.type == 11) + { + this.displayName = "Giant Worm"; + this.name = "Giant Worm Body"; + this.width = 14; + this.height = 14; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 4; + this.defense = 4; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 40f; + NPC.noStream = true; + } + else + { + if (this.type == 12) + { + this.displayName = "Giant Worm"; + this.name = "Giant Worm Tail"; + this.width = 14; + this.height = 14; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 4; + this.defense = 6; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 40f; + NPC.noStream = true; + } + else + { + if (this.type == 13) + { + this.displayName = "Eater of Worlds"; + this.npcSlots = 5f; + this.name = "Eater of Worlds Head"; + this.width = 38; + this.height = 38; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 22; + this.defense = 2; + this.lifeMax = 65; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 300f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 14) + { + this.displayName = "Eater of Worlds"; + this.name = "Eater of Worlds Body"; + this.width = 38; + this.height = 38; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 13; + this.defense = 4; + this.lifeMax = 150; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 300f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 15) + { + this.displayName = "Eater of Worlds"; + this.name = "Eater of Worlds Tail"; + this.width = 38; + this.height = 38; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 11; + this.defense = 8; + this.lifeMax = 220; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 300f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 16) + { + this.npcSlots = 2f; + this.name = "Mother Slime"; + this.width = 36; + this.height = 24; + this.aiStyle = 1; + this.damage = 20; + this.defense = 7; + this.lifeMax = 90; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 120; + this.color = new Color(0, 0, 0, 50); + this.value = 75f; + this.scale = 1.25f; + this.knockBackResist = 0.6f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 17) + { + this.townNPC = true; + this.friendly = true; + this.name = "Merchant"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 18) + { + this.townNPC = true; + this.friendly = true; + this.name = "Nurse"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 19) + { + this.townNPC = true; + this.friendly = true; + this.name = "Arms Dealer"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 20) + { + this.townNPC = true; + this.friendly = true; + this.name = "Dryad"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 21) + { + this.name = "Skeleton"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 20; + this.defense = 8; + this.lifeMax = 60; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 100f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 22) + { + this.townNPC = true; + this.friendly = true; + this.name = "Guide"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 23) + { + this.name = "Meteor Head"; + this.width = 22; + this.height = 22; + this.aiStyle = 5; + this.damage = 40; + this.defense = 6; + this.lifeMax = 26; + this.soundHit = 3; + this.soundKilled = 3; + this.noGravity = true; + this.noTileCollide = true; + this.value = 80f; + this.knockBackResist = 0.4f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 24) + { + this.npcSlots = 3f; + this.name = "Fire Imp"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 30; + this.defense = 16; + this.lifeMax = 70; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.lavaImmune = true; + this.value = 350f; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 25) + { + this.name = "Burning Sphere"; + this.width = 16; + this.height = 16; + this.aiStyle = 9; + this.damage = 30; + this.defense = 0; + this.lifeMax = 1; + this.soundHit = 3; + this.soundKilled = 3; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.alpha = 100; + } + else + { + if (this.type == 26) + { + this.name = "Goblin Peon"; + this.scale = 0.9f; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 12; + this.defense = 4; + this.lifeMax = 60; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.8f; + this.value = 100f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 27) + { + this.name = "Goblin Thief"; + this.scale = 0.95f; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 20; + this.defense = 6; + this.lifeMax = 80; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.7f; + this.value = 200f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 28) + { + this.name = "Goblin Warrior"; + this.scale = 1.1f; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 25; + this.defense = 8; + this.lifeMax = 110; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.value = 150f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 29) + { + this.name = "Goblin Sorcerer"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 20; + this.defense = 2; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.6f; + this.value = 200f; + } + else + { + if (this.type == 30) + { + this.name = "Chaos Ball"; + this.width = 16; + this.height = 16; + this.aiStyle = 9; + this.damage = 20; + this.defense = 0; + this.lifeMax = 1; + this.soundHit = 3; + this.soundKilled = 3; + this.noGravity = true; + this.noTileCollide = true; + this.alpha = 100; + this.knockBackResist = 0f; + } + else + { + if (this.type == 31) + { + this.name = "Angry Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 26; + this.defense = 8; + this.lifeMax = 80; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.8f; + this.value = 130f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 32) + { + this.name = "Dark Caster"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 20; + this.defense = 2; + this.lifeMax = 50; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.6f; + this.value = 140f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 33) + { + this.name = "Water Sphere"; + this.width = 16; + this.height = 16; + this.aiStyle = 9; + this.damage = 20; + this.defense = 0; + this.lifeMax = 1; + this.soundHit = 3; + this.soundKilled = 3; + this.noGravity = true; + this.noTileCollide = true; + this.alpha = 255; + this.knockBackResist = 0f; + } + else + { + if (this.type == 34) + { + this.name = "Cursed Skull"; + this.width = 26; + this.height = 28; + this.aiStyle = 10; + this.damage = 35; + this.defense = 6; + this.lifeMax = 40; + this.soundHit = 2; + this.soundKilled = 2; + this.noGravity = true; + this.noTileCollide = true; + this.value = 150f; + this.knockBackResist = 0.2f; + this.npcSlots = 0.75f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 35) + { + this.displayName = "Skeletron"; + this.name = "Skeletron Head"; + this.width = 80; + this.height = 102; + this.aiStyle = 11; + this.damage = 32; + this.defense = 10; + this.lifeMax = 4400; + this.soundHit = 2; + this.soundKilled = 2; + this.noGravity = true; + this.noTileCollide = true; + this.value = 50000f; + this.knockBackResist = 0f; + this.boss = true; + this.npcSlots = 6f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 36) + { + this.displayName = "Skeletron"; + this.name = "Skeletron Hand"; + this.width = 52; + this.height = 52; + this.aiStyle = 12; + this.damage = 20; + this.defense = 14; + this.lifeMax = 600; + this.soundHit = 2; + this.soundKilled = 2; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 37) + { + this.townNPC = true; + this.friendly = true; + this.name = "Old Man"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 38) + { + this.townNPC = true; + this.friendly = true; + this.name = "Demolitionist"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 39) + { + this.npcSlots = 6f; + this.name = "Bone Serpent Head"; + this.displayName = "Bone Serpent"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 30; + this.defense = 10; + this.lifeMax = 250; + this.soundHit = 2; + this.soundKilled = 5; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 1200f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 40) + { + this.name = "Bone Serpent Body"; + this.displayName = "Bone Serpent"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 15; + this.defense = 12; + this.lifeMax = 250; + this.soundHit = 2; + this.soundKilled = 5; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 1200f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 41) + { + this.name = "Bone Serpent Tail"; + this.displayName = "Bone Serpent"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 10; + this.defense = 18; + this.lifeMax = 250; + this.soundHit = 2; + this.soundKilled = 5; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 1200f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 42) + { + this.name = "Hornet"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 26; + this.defense = 12; + this.lifeMax = 48; + this.soundHit = 1; + this.knockBackResist = 0.5f; + this.soundKilled = 1; + this.value = 200f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 43) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Man Eater"; + this.width = 30; + this.height = 30; + this.aiStyle = 13; + this.damage = 34; + this.defense = 10; + this.lifeMax = 110; + this.soundHit = 1; + this.knockBackResist = 0f; + this.soundKilled = 1; + this.value = 350f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 44) + { + this.name = "Undead Miner"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 22; + this.defense = 9; + this.lifeMax = 70; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 250f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 45) + { + this.name = "Tim"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 20; + this.defense = 4; + this.lifeMax = 200; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.6f; + this.value = 5000f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 46) + { + this.name = "Bunny"; + this.width = 18; + this.height = 20; + this.aiStyle = 7; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 1; + } + else + { + if (this.type == 47) + { + this.name = "Corrupt Bunny"; + this.width = 18; + this.height = 20; + this.aiStyle = 3; + this.damage = 20; + this.defense = 4; + this.lifeMax = 70; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 500f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 48) + { + this.name = "Harpy"; + this.width = 24; + this.height = 34; + this.aiStyle = 14; + this.damage = 25; + this.defense = 8; + this.lifeMax = 100; + this.soundHit = 1; + this.knockBackResist = 0.6f; + this.soundKilled = 1; + this.value = 300f; + } + else + { + if (this.type == 49) + { + this.npcSlots = 0.5f; + this.name = "Cave Bat"; + this.width = 22; + this.height = 18; + this.aiStyle = 14; + this.damage = 13; + this.defense = 2; + this.lifeMax = 16; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 4; + this.value = 90f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 50) + { + this.boss = true; + this.name = "King Slime"; + this.width = 98; + this.height = 92; + this.aiStyle = 15; + this.damage = 40; + this.defense = 10; + this.lifeMax = 2000; + this.knockBackResist = 0f; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 30; + this.value = 10000f; + this.scale = 1.25f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 51) + { + this.npcSlots = 0.5f; + this.name = "Jungle Bat"; + this.width = 22; + this.height = 18; + this.aiStyle = 14; + this.damage = 20; + this.defense = 4; + this.lifeMax = 34; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 4; + this.value = 80f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 52) + { + this.name = "Doctor Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 20; + this.defense = 10; + this.lifeMax = 500; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 1000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 53) + { + this.name = "The Groom"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 14; + this.defense = 8; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 1000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 54) + { + this.townNPC = true; + this.friendly = true; + this.name = "Clothier"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 55) + { + this.noGravity = true; + this.name = "Goldfish"; + this.width = 20; + this.height = 18; + this.aiStyle = 16; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 56) + { + this.noTileCollide = true; + this.noGravity = true; + this.name = "Snatcher"; + this.width = 30; + this.height = 30; + this.aiStyle = 13; + this.damage = 25; + this.defense = 10; + this.lifeMax = 60; + this.soundHit = 1; + this.knockBackResist = 0f; + this.soundKilled = 1; + this.value = 90f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 57) + { + this.noGravity = true; + this.name = "Corrupt Goldfish"; + this.width = 18; + this.height = 20; + this.aiStyle = 16; + this.damage = 30; + this.defense = 6; + this.lifeMax = 100; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 500f; + } + else + { + if (this.type == 58) + { + this.npcSlots = 0.5f; + this.noGravity = true; + this.name = "Piranha"; + this.width = 18; + this.height = 20; + this.aiStyle = 16; + this.damage = 25; + this.defense = 2; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 50f; + } + else + { + if (this.type == 59) + { + this.name = "Lava Slime"; + this.width = 24; + this.height = 18; + this.aiStyle = 1; + this.damage = 15; + this.defense = 10; + this.lifeMax = 50; + this.soundHit = 1; + this.soundKilled = 1; + this.scale = 1.1f; + this.alpha = 50; + this.lavaImmune = true; + this.value = 120f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 60) + { + this.npcSlots = 0.5f; + this.name = "Hellbat"; + this.width = 22; + this.height = 18; + this.aiStyle = 14; + this.damage = 35; + this.defense = 8; + this.lifeMax = 46; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 4; + this.value = 120f; + this.scale = 1.1f; + this.lavaImmune = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 61) + { + this.name = "Vulture"; + this.width = 36; + this.height = 36; + this.aiStyle = 17; + this.damage = 15; + this.defense = 4; + this.lifeMax = 40; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 60f; + } + else + { + if (this.type == 62) + { + this.npcSlots = 2f; + this.name = "Demon"; + this.width = 28; + this.height = 48; + this.aiStyle = 14; + this.damage = 32; + this.defense = 8; + this.lifeMax = 120; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 300f; + this.lavaImmune = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 63) + { + this.noGravity = true; + this.name = "Blue Jellyfish"; + this.width = 26; + this.height = 26; + this.aiStyle = 18; + this.damage = 20; + this.defense = 2; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 100f; + this.alpha = 20; + } + else + { + if (this.type == 64) + { + this.noGravity = true; + this.name = "Pink Jellyfish"; + this.width = 26; + this.height = 26; + this.aiStyle = 18; + this.damage = 30; + this.defense = 6; + this.lifeMax = 70; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 100f; + this.alpha = 20; + } + else + { + if (this.type == 65) + { + this.noGravity = true; + this.name = "Shark"; + this.width = 100; + this.height = 24; + this.aiStyle = 16; + this.damage = 40; + this.defense = 2; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 400f; + this.knockBackResist = 0.7f; + } + else + { + if (this.type == 66) + { + this.npcSlots = 2f; + this.name = "Voodoo Demon"; + this.width = 28; + this.height = 48; + this.aiStyle = 14; + this.damage = 32; + this.defense = 8; + this.lifeMax = 140; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 1000f; + this.lavaImmune = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 67) + { + this.name = "Crab"; + this.width = 28; + this.height = 20; + this.aiStyle = 3; + this.damage = 20; + this.defense = 10; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 60f; + } + else + { + if (this.type == 68) + { + this.name = "Dungeon Guardian"; + this.width = 80; + this.height = 102; + this.aiStyle = 11; + this.damage = 1000; + this.defense = 9000; + this.lifeMax = 9999; + this.soundHit = 2; + this.soundKilled = 2; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 69) + { + this.name = "Antlion"; + this.width = 24; + this.height = 24; + this.aiStyle = 19; + this.damage = 10; + this.defense = 6; + this.lifeMax = 45; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.value = 60f; + this.behindTiles = true; + } + else + { + if (this.type == 70) + { + this.npcSlots = 0.3f; + this.name = "Spike Ball"; + this.width = 34; + this.height = 34; + this.aiStyle = 20; + this.damage = 32; + this.defense = 100; + this.lifeMax = 100; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.noGravity = true; + this.noTileCollide = true; + this.dontTakeDamage = true; + this.scale = 1.5f; + } + else + { + if (this.type == 71) + { + this.npcSlots = 2f; + this.name = "Dungeon Slime"; + this.width = 36; + this.height = 24; + this.aiStyle = 1; + this.damage = 30; + this.defense = 7; + this.lifeMax = 150; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 60; + this.value = 150f; + this.scale = 1.25f; + this.knockBackResist = 0.6f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 72) + { + this.npcSlots = 0.3f; + this.name = "Blazing Wheel"; + this.width = 34; + this.height = 34; + this.aiStyle = 21; + this.damage = 24; + this.defense = 100; + this.lifeMax = 100; + this.alpha = 100; + this.behindTiles = true; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.noGravity = true; + this.dontTakeDamage = true; + this.scale = 1.2f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 73) + { + this.name = "Goblin Scout"; + this.scale = 0.95f; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 20; + this.defense = 6; + this.lifeMax = 80; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.7f; + this.value = 200f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 74 || this.type == 297 || this.type == 298) + { + this.name = "Bird"; + this.width = 14; + this.height = 14; + this.aiStyle = 24; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + } + else + { + if (this.type == 75) + { + this.noGravity = true; + this.name = "Pixie"; + this.width = 20; + this.height = 20; + this.aiStyle = 22; + this.damage = 55; + this.defense = 20; + this.lifeMax = 150; + this.soundHit = 5; + this.knockBackResist = 0.6f; + this.soundKilled = 7; + this.value = 350f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 77) + { + this.name = "Armored Skeleton"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 40; + this.defense = 28; + this.lifeMax = 260; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 78) + { + this.name = "Mummy"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 50; + this.defense = 16; + this.lifeMax = 130; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.6f; + this.value = 600f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 79) + { + this.name = "Dark Mummy"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 60; + this.defense = 18; + this.lifeMax = 180; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.5f; + this.value = 700f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 80) + { + this.name = "Light Mummy"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 55; + this.defense = 18; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.55f; + this.value = 700f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 81) + { + this.name = "Corrupt Slime"; + this.width = 40; + this.height = 30; + this.aiStyle = 1; + this.damage = 55; + this.defense = 20; + this.lifeMax = 170; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 55; + this.value = 400f; + this.scale = 1.1f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 82) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Wraith"; + this.width = 24; + this.height = 44; + this.aiStyle = 22; + this.damage = 65; + this.defense = 16; + this.lifeMax = 160; + this.soundHit = 1; + this.soundKilled = 6; + this.alpha = 100; + this.value = 500f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.7f; + } + else + { + if (this.type == 83) + { + this.name = "Cursed Hammer"; + this.width = 40; + this.height = 40; + this.aiStyle = 23; + this.damage = 80; + this.defense = 18; + this.lifeMax = 200; + this.soundHit = 4; + this.soundKilled = 6; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.4f; + } + else + { + if (this.type == 84) + { + this.name = "Enchanted Sword"; + this.width = 40; + this.height = 40; + this.aiStyle = 23; + this.damage = 80; + this.defense = 18; + this.lifeMax = 200; + this.soundHit = 4; + this.soundKilled = 6; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.4f; + } + else + { + if (this.type == 85) + { + this.name = "Mimic"; + this.width = 24; + this.height = 24; + this.aiStyle = 25; + this.damage = 80; + this.defense = 30; + this.lifeMax = 500; + this.soundHit = 4; + this.soundKilled = 6; + this.value = 100000f; + this.knockBackResist = 0.3f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 86) + { + this.name = "Unicorn"; + this.width = 46; + this.height = 42; + this.aiStyle = 26; + this.damage = 65; + this.defense = 30; + this.lifeMax = 400; + this.soundHit = 12; + this.soundKilled = 18; + this.knockBackResist = 0.3f; + this.value = 1000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 87) + { + this.displayName = "Wyvern"; + this.noTileCollide = true; + this.npcSlots = 5f; + this.name = "Wyvern Head"; + this.width = 32; + this.height = 32; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 80; + this.defense = 10; + this.lifeMax = 4000; + this.soundHit = 7; + this.soundKilled = 8; + this.noGravity = true; + this.knockBackResist = 0f; + this.value = 10000f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 88) + { + this.displayName = "Wyvern"; + this.noTileCollide = true; + this.name = "Wyvern Legs"; + this.width = 32; + this.height = 32; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 40; + this.defense = 20; + this.lifeMax = 4000; + this.soundHit = 7; + this.soundKilled = 8; + this.noGravity = true; + this.knockBackResist = 0f; + this.value = 10000f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 89) + { + this.displayName = "Wyvern"; + this.noTileCollide = true; + this.name = "Wyvern Body"; + this.width = 32; + this.height = 32; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 40; + this.defense = 20; + this.lifeMax = 4000; + this.soundHit = 7; + this.soundKilled = 8; + this.noGravity = true; + this.knockBackResist = 0f; + this.value = 2000f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 90) + { + this.displayName = "Wyvern"; + this.noTileCollide = true; + this.name = "Wyvern Body 2"; + this.width = 32; + this.height = 32; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 40; + this.defense = 20; + this.lifeMax = 4000; + this.soundHit = 7; + this.soundKilled = 8; + this.noGravity = true; + this.knockBackResist = 0f; + this.value = 10000f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 91) + { + this.displayName = "Wyvern"; + this.noTileCollide = true; + this.name = "Wyvern Body 3"; + this.width = 32; + this.height = 32; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 40; + this.defense = 20; + this.lifeMax = 4000; + this.soundHit = 7; + this.soundKilled = 8; + this.noGravity = true; + this.knockBackResist = 0f; + this.value = 10000f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 92) + { + this.displayName = "Wyvern"; + this.noTileCollide = true; + this.name = "Wyvern Tail"; + this.width = 32; + this.height = 32; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 40; + this.defense = 20; + this.lifeMax = 4000; + this.soundHit = 7; + this.soundKilled = 8; + this.noGravity = true; + this.knockBackResist = 0f; + this.value = 10000f; + this.scale = 1f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 93) + { + this.npcSlots = 0.5f; + this.name = "Giant Bat"; + this.width = 26; + this.height = 20; + this.aiStyle = 14; + this.damage = 45; + this.defense = 16; + this.lifeMax = 100; + this.soundHit = 1; + this.knockBackResist = 0.75f; + this.soundKilled = 4; + this.value = 400f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 94) + { + this.npcSlots = 1f; + this.name = "Corruptor"; + this.width = 44; + this.height = 44; + this.aiStyle = 5; + this.damage = 60; + this.defense = 32; + this.lifeMax = 230; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.knockBackResist = 0.55f; + this.value = 500f; + } + else + { + if (this.type == 95) + { + this.displayName = "Digger"; + this.name = "Digger Head"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 45; + this.defense = 10; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.scale = 0.9f; + this.value = 300f; + } + else + { + if (this.type == 96) + { + this.displayName = "Digger"; + this.name = "Digger Body"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 28; + this.defense = 20; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.scale = 0.9f; + this.value = 300f; + NPC.noStream = true; + } + else + { + if (this.type == 97) + { + this.displayName = "Digger"; + this.name = "Digger Tail"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 26; + this.defense = 30; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.scale = 0.9f; + this.value = 300f; + NPC.noStream = true; + } + else + { + if (this.type == 98) + { + this.displayName = "World Feeder"; + this.npcSlots = 3.5f; + this.name = "Seeker Head"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 70; + this.defense = 36; + this.lifeMax = 500; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 700f; + } + else + { + if (this.type == 99) + { + this.displayName = "World Feeder"; + this.name = "Seeker Body"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 55; + this.defense = 40; + this.lifeMax = 500; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 700f; + NPC.noStream = true; + } + else + { + if (this.type == 100) + { + this.displayName = "World Feeder"; + this.name = "Seeker Tail"; + this.width = 22; + this.height = 22; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 40; + this.defense = 44; + this.lifeMax = 500; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 700f; + NPC.noStream = true; + } + else + { + if (this.type == 101) + { + this.noGravity = true; + this.noTileCollide = true; + this.behindTiles = true; + this.name = "Clinger"; + this.width = 30; + this.height = 30; + this.aiStyle = 13; + this.damage = 70; + this.defense = 30; + this.lifeMax = 320; + this.soundHit = 1; + this.knockBackResist = 0.2f; + this.soundKilled = 1; + this.value = 600f; + } + else + { + if (this.type == 102) + { + this.npcSlots = 0.5f; + this.noGravity = true; + this.name = "Angler Fish"; + this.width = 18; + this.height = 20; + this.aiStyle = 16; + this.damage = 80; + this.defense = 22; + this.lifeMax = 90; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 500f; + } + else + { + if (this.type == 103) + { + this.noGravity = true; + this.name = "Green Jellyfish"; + this.width = 26; + this.height = 26; + this.aiStyle = 18; + this.damage = 80; + this.defense = 30; + this.lifeMax = 120; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 800f; + this.alpha = 20; + } + else + { + if (this.type == 104) + { + this.name = "Werewolf"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 70; + this.defense = 40; + this.lifeMax = 400; + this.soundHit = 6; + this.soundKilled = 1; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 105) + { + this.friendly = true; + this.name = "Bound Goblin"; + this.width = 18; + this.height = 34; + this.aiStyle = 0; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.scale = 0.9f; + } + else + { + if (this.type == 106) + { + this.friendly = true; + this.name = "Bound Wizard"; + this.width = 18; + this.height = 40; + this.aiStyle = 0; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 107) + { + this.townNPC = true; + this.friendly = true; + this.name = "Goblin Tinkerer"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.scale = 0.9f; + } + else + { + if (this.type == 108) + { + this.townNPC = true; + this.friendly = true; + this.name = "Wizard"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 109) + { + this.name = "Clown"; + this.width = 34; + this.height = 78; + this.aiStyle = 3; + this.damage = 50; + this.defense = 20; + this.lifeMax = 400; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 8000f; + } + else + { + if (this.type == 110) + { + this.name = "Skeleton Archer"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 45; + this.defense = 14; + this.lifeMax = 210; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.55f; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 111) + { + this.name = "Goblin Archer"; + this.scale = 0.95f; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 20; + this.defense = 6; + this.lifeMax = 80; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.7f; + this.value = 200f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 112) + { + this.name = "Vile Spit"; + this.width = 16; + this.height = 16; + this.aiStyle = 9; + this.damage = 65; + this.defense = 0; + this.lifeMax = 1; + this.soundHit = 0; + this.soundKilled = 9; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.scale = 0.9f; + this.alpha = 80; + } + else + { + if (this.type == 113) + { + this.npcSlots = 10f; + this.name = "Wall of Flesh"; + this.width = 100; + this.height = 100; + this.aiStyle = 27; + this.damage = 50; + this.defense = 12; + this.lifeMax = 8000; + this.soundHit = 8; + this.soundKilled = 10; + this.noGravity = true; + this.noTileCollide = true; + this.behindTiles = true; + this.knockBackResist = 0f; + this.scale = 1.2f; + this.boss = true; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.value = 80000f; + } + else + { + if (this.type == 114) + { + this.name = "Wall of Flesh Eye"; + this.displayName = "Wall of Flesh"; + this.width = 100; + this.height = 100; + this.aiStyle = 28; + this.damage = 50; + this.defense = 0; + this.lifeMax = 8000; + this.soundHit = 8; + this.soundKilled = 10; + this.noGravity = true; + this.noTileCollide = true; + this.behindTiles = true; + this.knockBackResist = 0f; + this.scale = 1.2f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.value = 80000f; + } + else + { + if (this.type == 115) + { + this.name = "The Hungry"; + this.width = 30; + this.height = 30; + this.aiStyle = 29; + this.damage = 30; + this.defense = 10; + this.lifeMax = 240; + this.soundHit = 9; + this.soundKilled = 11; + this.noGravity = true; + this.behindTiles = true; + this.noTileCollide = true; + this.knockBackResist = 1.1f; + } + else + { + if (this.type == 116) + { + this.name = "The Hungry II"; + this.displayName = "The Hungry"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 30; + this.defense = 6; + this.lifeMax = 80; + this.soundHit = 9; + this.knockBackResist = 0.8f; + this.soundKilled = 12; + } + else + { + if (this.type == 117) + { + this.displayName = "Leech"; + this.name = "Leech Head"; + this.width = 14; + this.height = 14; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 26; + this.defense = 2; + this.lifeMax = 60; + this.soundHit = 9; + this.soundKilled = 12; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + } + else + { + if (this.type == 118) + { + this.displayName = "Leech"; + this.name = "Leech Body"; + this.width = 14; + this.height = 14; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 22; + this.defense = 6; + this.lifeMax = 60; + this.soundHit = 9; + this.soundKilled = 12; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + } + else + { + if (this.type == 119) + { + this.displayName = "Leech"; + this.name = "Leech Tail"; + this.width = 14; + this.height = 14; + this.aiStyle = 6; + this.netAlways = true; + this.damage = 18; + this.defense = 10; + this.lifeMax = 60; + this.soundHit = 9; + this.soundKilled = 12; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + } + else + { + if (this.type == 120) + { + this.name = "Chaos Elemental"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 40; + this.defense = 30; + this.lifeMax = 370; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.4f; + this.value = 600f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 121) + { + this.name = "Slimer"; + this.width = 40; + this.height = 30; + this.aiStyle = 14; + this.damage = 45; + this.defense = 20; + this.lifeMax = 60; + this.soundHit = 1; + this.alpha = 55; + this.knockBackResist = 0.8f; + this.scale = 1.1f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 122) + { + this.noGravity = true; + this.name = "Gastropod"; + this.width = 20; + this.height = 20; + this.aiStyle = 22; + this.damage = 60; + this.defense = 22; + this.lifeMax = 220; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 600f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 123) + { + this.friendly = true; + this.name = "Bound Mechanic"; + this.width = 18; + this.height = 34; + this.aiStyle = 0; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.scale = 0.9f; + } + else + { + if (this.type == 124) + { + this.townNPC = true; + this.friendly = true; + this.name = "Mechanic"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 125) + { + this.name = "Retinazer"; + this.width = 100; + this.height = 110; + this.aiStyle = 30; + this.damage = 40; + this.defense = 10; + this.lifeMax = 20000; + this.soundHit = 1; + this.soundKilled = 14; + this.knockBackResist = 0f; + this.noGravity = true; + this.noTileCollide = true; + this.timeLeft = NPC.activeTime * 30; + this.boss = true; + this.value = 120000f; + this.npcSlots = 5f; + this.boss = true; + } + else + { + if (this.type == 126) + { + this.name = "Spazmatism"; + this.width = 100; + this.height = 110; + this.aiStyle = 31; + this.damage = 40; + this.defense = 10; + this.lifeMax = 20000; + this.soundHit = 1; + this.soundKilled = 14; + this.knockBackResist = 0f; + this.noGravity = true; + this.noTileCollide = true; + this.timeLeft = NPC.activeTime * 30; + this.boss = true; + this.value = 120000f; + this.npcSlots = 5f; + this.boss = true; + } + else + { + if (this.type == 127) + { + this.name = "Skeletron Prime"; + this.width = 80; + this.height = 102; + this.aiStyle = 32; + this.damage = 45; + this.defense = 22; + this.lifeMax = 25000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.value = 120000f; + this.knockBackResist = 0f; + this.boss = true; + this.npcSlots = 6f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.boss = true; + } + else + { + if (this.type == 128) + { + this.name = "Prime Cannon"; + this.width = 52; + this.height = 52; + this.aiStyle = 35; + this.damage = 30; + this.defense = 20; + this.lifeMax = 6000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.netAlways = true; + } + else + { + if (this.type == 129) + { + this.name = "Prime Saw"; + this.width = 52; + this.height = 52; + this.aiStyle = 33; + this.damage = 47; + this.defense = 36; + this.lifeMax = 8000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.netAlways = true; + } + else + { + if (this.type == 130) + { + this.name = "Prime Vice"; + this.width = 52; + this.height = 52; + this.aiStyle = 34; + this.damage = 40; + this.defense = 30; + this.lifeMax = 8000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.netAlways = true; + } + else + { + if (this.type == 131) + { + this.name = "Prime Laser"; + this.width = 52; + this.height = 52; + this.aiStyle = 36; + this.damage = 29; + this.defense = 20; + this.lifeMax = 5000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.netAlways = true; + } + else + { + if (this.type == 132) + { + this.displayName = "Zombie"; + this.name = "Bald Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 15; + this.defense = 5; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 65f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 133) + { + this.name = "Wandering Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 40; + this.defense = 20; + this.lifeMax = 300; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 500f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 134) + { + this.displayName = "The Destroyer"; + this.npcSlots = 5f; + this.name = "The Destroyer"; + this.width = 38; + this.height = 38; + this.aiStyle = 37; + this.damage = 50; + this.defense = 0; + this.lifeMax = 60000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.value = 120000f; + this.scale = 1.25f; + this.boss = true; + this.netAlways = true; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + flag = true; + } + else + { + if (this.type == 135) + { + this.displayName = "The Destroyer"; + this.npcSlots = 5f; + this.name = "The Destroyer Body"; + this.width = 38; + this.height = 38; + this.aiStyle = 37; + this.damage = 35; + this.defense = 26; + this.lifeMax = 60000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.netAlways = true; + this.scale = 1.25f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 136) + { + this.displayName = "The Destroyer"; + this.npcSlots = 5f; + this.name = "The Destroyer Tail"; + this.width = 38; + this.height = 38; + this.aiStyle = 37; + this.damage = 20; + this.defense = 30; + this.lifeMax = 60000; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.behindTiles = true; + this.scale = 1.25f; + this.netAlways = true; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + NPC.noStream = true; + } + else + { + if (this.type == 139) + { + this.npcSlots = 1f; + this.name = "Probe"; + this.width = 30; + this.height = 30; + this.aiStyle = 5; + this.damage = 40; + this.defense = 18; + this.lifeMax = 180; + this.soundHit = 4; + this.soundKilled = 14; + this.noGravity = true; + this.knockBackResist = 0.8f; + this.noTileCollide = true; + } + else + { + if (this.type == 137) + { + this.name = "Illuminant Bat"; + this.width = 26; + this.height = 20; + this.aiStyle = 14; + this.damage = 75; + this.defense = 30; + this.lifeMax = 200; + this.soundHit = 1; + this.knockBackResist = 0.75f; + this.soundKilled = 6; + this.value = 500f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 138) + { + this.name = "Illuminant Slime"; + this.width = 24; + this.height = 18; + this.aiStyle = 1; + this.damage = 70; + this.defense = 30; + this.lifeMax = 180; + this.soundHit = 1; + this.soundKilled = 6; + this.alpha = 100; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.85f; + this.scale = 1.05f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 140) + { + this.name = "Possessed Armor"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 55; + this.defense = 28; + this.lifeMax = 260; + this.soundHit = 4; + this.soundKilled = 6; + this.knockBackResist = 0.4f; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + this.buffImmune[24] = true; + } + else + { + if (this.type == 141) + { + this.name = "Toxic Sludge"; + this.width = 34; + this.height = 28; + this.aiStyle = 1; + this.damage = 50; + this.defense = 18; + this.lifeMax = 150; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 55; + this.value = 400f; + this.scale = 1.1f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + this.knockBackResist = 0.8f; + } + else + { + if (this.type == 142) + { + this.townNPC = true; + this.friendly = true; + this.name = "Santa Claus"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 143) + { + this.name = "Snowman Gangsta"; + this.width = 26; + this.height = 40; + this.aiStyle = 38; + this.damage = 50; + this.defense = 20; + this.lifeMax = 200; + this.soundHit = 11; + this.soundKilled = 15; + this.knockBackResist = 0.6f; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 144) + { + this.name = "Mister Stabby"; + this.width = 26; + this.height = 40; + this.aiStyle = 38; + this.damage = 65; + this.defense = 26; + this.lifeMax = 240; + this.soundHit = 11; + this.soundKilled = 15; + this.knockBackResist = 0.6f; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 145) + { + this.name = "Snow Balla"; + this.width = 26; + this.height = 40; + this.aiStyle = 38; + this.damage = 55; + this.defense = 22; + this.lifeMax = 220; + this.soundHit = 11; + this.soundKilled = 15; + this.knockBackResist = 0.6f; + this.value = 400f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 147) + { + this.name = "Ice Slime"; + this.width = 24; + this.height = 18; + this.aiStyle = 1; + this.damage = 8; + this.defense = 4; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 50; + this.value = 50f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 148) + { + this.name = "Penguin"; + this.width = 16; + this.height = 34; + this.aiStyle = 7; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 1; + } + else + { + if (this.type == 149) + { + this.name = "Penguin"; + this.width = 16; + this.height = 34; + this.aiStyle = 7; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 1; + } + else + { + if (this.type == 150) + { + this.npcSlots = 0.5f; + this.name = "Ice Bat"; + this.width = 22; + this.height = 22; + this.aiStyle = 14; + this.damage = 18; + this.defense = 6; + this.lifeMax = 30; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 4; + this.value = 130f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 151) + { + this.npcSlots = 0.5f; + this.name = "Lava bat"; + this.width = 22; + this.height = 22; + this.aiStyle = 14; + this.damage = 50; + this.defense = 16; + this.lifeMax = 160; + this.soundHit = 1; + this.knockBackResist = 0.6f; + this.soundKilled = 4; + this.value = 400f; + this.scale = 1.15f; + this.lavaImmune = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 152) + { + this.npcSlots = 0.5f; + this.name = "Giant Flying Fox"; + this.width = 38; + this.height = 34; + this.aiStyle = 14; + this.damage = 80; + this.defense = 24; + this.lifeMax = 220; + this.soundHit = 1; + this.knockBackResist = 0.65f; + this.soundKilled = 4; + this.value = 400f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 153) + { + this.npcSlots = 2f; + this.name = "Giant Tortoise"; + this.width = 46; + this.height = 32; + this.aiStyle = 39; + this.damage = 80; + this.defense = 30; + this.lifeMax = 470; + this.soundHit = 7; + this.knockBackResist = 0.3f; + this.soundKilled = 5; + this.value = 500f; + this.noGravity = false; + this.buffImmune[31] = false; + } + else + { + if (this.type == 154) + { + this.npcSlots = 1.5f; + this.name = "Ice Tortoise"; + this.width = 46; + this.height = 32; + this.aiStyle = 39; + this.damage = 55; + this.defense = 28; + this.lifeMax = 400; + this.soundHit = 7; + this.knockBackResist = 0.3f; + this.soundKilled = 5; + this.value = 450f; + this.noGravity = false; + this.buffImmune[31] = false; + } + else + { + if (this.type == 155) + { + this.name = "Wolf"; + this.width = 46; + this.height = 30; + this.aiStyle = 26; + this.damage = 65; + this.defense = 30; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.3f; + this.value = 1000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 156) + { + this.npcSlots = 2f; + this.name = "Red Devil"; + this.width = 28; + this.height = 48; + this.aiStyle = 14; + this.damage = 50; + this.defense = 40; + this.lifeMax = 600; + this.soundHit = 1; + this.knockBackResist = 0.5f; + this.soundKilled = 1; + this.value = 1200f; + this.lavaImmune = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 157) + { + this.npcSlots = 0.5f; + this.noGravity = true; + this.name = "Arapaima"; + this.width = 74; + this.height = 20; + this.aiStyle = 16; + this.damage = 75; + this.defense = 30; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 500f; + } + else + { + if (this.type == 158) + { + this.npcSlots = 2f; + this.name = "Vampire"; + this.width = 22; + this.height = 22; + this.aiStyle = 14; + this.damage = 60; + this.defense = 30; + this.lifeMax = 500; + this.soundHit = 1; + this.knockBackResist = 0.75f; + this.soundKilled = 6; + this.value = 5000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 159) + { + this.npcSlots = 2f; + this.name = "Vampire"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 80; + this.defense = 20; + this.lifeMax = 500; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.4f; + this.value = 5000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 160) + { + this.townNPC = true; + this.friendly = true; + this.name = "Truffle"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 161) + { + this.name = "Zombie Eskimo"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 16; + this.defense = 8; + this.lifeMax = 50; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.45f; + this.value = 80f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 162) + { + this.name = "Frankenstein"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 60; + this.defense = 18; + this.lifeMax = 220; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.3f; + this.value = 600f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 163) + { + this.name = "Black Recluse"; + this.width = 50; + this.height = 20; + this.aiStyle = 3; + this.damage = 90; + this.defense = 40; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.25f; + this.value = 500f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + this.npcSlots = 0.5f; + this.timeLeft = NPC.activeTime * 2; + } + else + { + if (this.type == 238) + { + this.noGravity = true; + this.name = "Black Recluse"; + this.width = 50; + this.height = 20; + this.aiStyle = 40; + this.damage = 100; + this.defense = 40; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.25f; + this.value = 500f; + this.timeLeft = NPC.activeTime * 2; + this.npcSlots = 0.5f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 164) + { + this.name = "Wall Creeper"; + this.width = 50; + this.height = 20; + this.aiStyle = 3; + this.damage = 30; + this.defense = 10; + this.lifeMax = 80; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.25f; + this.value = 100f; + this.timeLeft = NPC.activeTime * 2; + this.npcSlots = 0.5f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 165) + { + this.noGravity = true; + this.name = "Wall Creeper"; + this.width = 50; + this.height = 20; + this.aiStyle = 40; + this.damage = 30; + this.defense = 10; + this.lifeMax = 80; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.25f; + this.value = 100f; + this.timeLeft = NPC.activeTime * 2; + this.npcSlots = 0.5f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 166) + { + this.name = "Swamp Thing"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 80; + this.defense = 32; + this.lifeMax = 350; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.2f; + this.value = 1000f; + this.buffImmune[31] = false; + this.buffImmune[20] = true; + } + else + { + if (this.type == 167) + { + this.name = "Undead Viking"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 24; + this.defense = 10; + this.lifeMax = 70; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 200f; + this.buffImmune[31] = false; + this.buffImmune[20] = true; + } + else + { + if (this.type == 168) + { + this.name = "Corrupt Penguin"; + this.width = 16; + this.height = 34; + this.aiStyle = 3; + this.damage = 20; + this.defense = 4; + this.lifeMax = 70; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 500f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 169) + { + this.noGravity = true; + this.name = "Ice Elemental"; + this.width = 18; + this.height = 40; + this.aiStyle = 22; + this.damage = 55; + this.defense = 20; + this.lifeMax = 200; + this.soundHit = 5; + this.knockBackResist = 0.6f; + this.soundKilled = 7; + this.value = 1500f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.buffImmune[31] = false; + this.buffImmune[44] = true; + } + else + { + if (this.type == 170) + { + this.name = "Pigron"; + this.width = 44; + this.height = 36; + this.aiStyle = 2; + this.damage = 70; + this.defense = 16; + this.lifeMax = 210; + this.soundHit = 7; + this.soundKilled = 17; + this.knockBackResist = 0.5f; + this.value = 2000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 171) + { + this.name = "Pigron"; + this.width = 44; + this.height = 36; + this.aiStyle = 2; + this.damage = 70; + this.defense = 16; + this.lifeMax = 210; + this.soundHit = 7; + this.soundKilled = 17; + this.knockBackResist = 0.5f; + this.value = 2000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 172) + { + this.name = "Rune Wizard"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 200; + this.defense = 30; + this.lifeMax = 600; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.3f; + this.value = 5000f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 173) + { + this.npcSlots = 1f; + this.name = "Crimera"; + this.width = 30; + this.height = 30; + this.aiStyle = 5; + this.damage = 22; + this.defense = 8; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.knockBackResist = 0.5f; + this.value = 90f; + } + else + { + if (this.type == 174) + { + this.npcSlots = 1f; + this.name = "Herpling"; + this.width = 52; + this.height = 26; + this.aiStyle = 41; + this.damage = 65; + this.defense = 26; + this.lifeMax = 220; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.3f; + this.value = 450f; + } + else + { + if (this.type == 175) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Angry Trapper"; + this.width = 30; + this.height = 30; + this.aiStyle = 13; + this.damage = 100; + this.defense = 30; + this.lifeMax = 300; + this.soundHit = 1; + this.knockBackResist = 0.25f; + this.soundKilled = 1; + this.value = 650f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 176) + { + this.name = "Moss Hornet"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 70; + this.defense = 22; + this.lifeMax = 220; + this.soundHit = 1; + this.knockBackResist = 0.5f; + this.soundKilled = 1; + this.value = 600f; + this.noGravity = true; + this.buffImmune[20] = true; + this.npcSlots = 1.5f; + } + else + { + if (this.type == 177) + { + this.npcSlots = 1f; + this.name = "Derpling"; + this.width = 58; + this.height = 44; + this.aiStyle = 41; + this.damage = 80; + this.defense = 26; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.value = 500f; + } + else + { + if (this.type == 178) + { + this.townNPC = true; + this.friendly = true; + this.name = "Steampunker"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 179) + { + this.name = "Crimson Axe"; + this.width = 40; + this.height = 40; + this.aiStyle = 23; + this.damage = 80; + this.defense = 18; + this.lifeMax = 200; + this.soundHit = 4; + this.soundKilled = 6; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.4f; + } + else + { + if (this.type == 180) + { + this.name = "Pigron"; + this.width = 44; + this.height = 36; + this.aiStyle = 2; + this.damage = 70; + this.defense = 16; + this.lifeMax = 210; + this.soundHit = 7; + this.soundKilled = 17; + this.knockBackResist = 0.5f; + this.value = 4000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 181) + { + this.name = "Face Monster"; + this.width = 18; + this.height = 44; + this.aiStyle = 3; + this.damage = 25; + this.defense = 10; + this.lifeMax = 70; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 200f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 182) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Floaty Gross"; + this.width = 24; + this.height = 62; + this.aiStyle = 22; + this.damage = 65; + this.defense = 18; + this.lifeMax = 240; + this.soundHit = 1; + this.soundKilled = 2; + this.alpha = 100; + this.value = 500f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.7f; + } + else + { + if (this.type == 183) + { + this.name = "Crimslime"; + this.width = 40; + this.height = 30; + this.aiStyle = 1; + this.damage = 60; + this.defense = 26; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 55; + this.value = 400f; + this.scale = 1.1f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 184) + { + this.name = "Spiked Ice Slime"; + this.width = 24; + this.height = 18; + this.aiStyle = 1; + this.damage = 12; + this.defense = 8; + this.lifeMax = 60; + this.scale = 1.1f; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 50; + this.value = 200f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 185) + { + this.name = "Snow Flinx"; + this.width = 28; + this.height = 28; + this.aiStyle = 3; + this.damage = 26; + this.defense = 12; + this.lifeMax = 70; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 1.1f; + this.value = 200f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 186) + { + this.name = "Pincushion Zombie"; + this.displayName = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 16; + this.defense = 8; + this.lifeMax = 50; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.45f; + this.value = 65f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 187) + { + this.name = "Slimed Zombie"; + this.displayName = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 13; + this.defense = 6; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.55f; + this.value = 55f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 188) + { + this.name = "Swamp Zombie"; + this.displayName = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 13; + this.defense = 8; + this.lifeMax = 45; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.45f; + this.value = 80f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 189) + { + this.name = "Twiggy Zombie"; + this.displayName = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 16; + this.defense = 4; + this.lifeMax = 45; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.55f; + this.value = 70f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 190) + { + this.name = "Cataract Eye"; + this.displayName = "Demon Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 18; + this.defense = 4; + this.lifeMax = 65; + this.soundHit = 1; + this.knockBackResist = 0.7f; + this.soundKilled = 1; + this.value = 75f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 191) + { + this.name = "Sleepy Eye"; + this.displayName = "Demon Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 16; + this.defense = 2; + this.lifeMax = 60; + this.soundHit = 1; + this.knockBackResist = 0.85f; + this.soundKilled = 1; + this.value = 75f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 192) + { + this.name = "Dialated Eye"; + this.displayName = "Demon Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 18; + this.defense = 2; + this.lifeMax = 50; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 75f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 193) + { + this.name = "Green Eye"; + this.displayName = "Demon Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 20; + this.defense = 0; + this.lifeMax = 60; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 75f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 194) + { + this.name = "Purple Eye"; + this.displayName = "Demon Eye"; + this.width = 30; + this.height = 32; + this.aiStyle = 2; + this.damage = 14; + this.defense = 4; + this.lifeMax = 60; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 75f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 195) + { + this.name = "Lost Girl"; + this.width = 18; + this.height = 40; + this.aiStyle = 42; + this.damage = 10; + this.defense = 30; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 196) + { + this.name = "Nymph"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 35; + this.defense = 16; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 10000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 197) + { + this.name = "Armored Viking"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 50; + this.defense = 28; + this.lifeMax = 280; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.45f; + this.value = 500f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 198) + { + this.name = "Lihzahrd"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 38; + this.defense = 20; + this.lifeMax = 400; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.4f; + this.value = 650f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 199) + { + this.name = "Lihzahrd"; + this.width = 42; + this.height = 30; + this.aiStyle = 3; + this.damage = 60; + this.defense = 30; + this.lifeMax = 400; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.value = 650f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 200) + { + this.name = "Female Zombie"; + this.displayName = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 12; + this.defense = 4; + this.lifeMax = 38; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.6f; + this.value = 65f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 201) + { + this.name = "Headache Skeleton"; + this.displayName = "Skeleton"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 20; + this.defense = 12; + this.lifeMax = 55; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 130f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 202) + { + this.name = "Misassembled Skeleton"; + this.displayName = "Skeleton"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 18; + this.defense = 8; + this.lifeMax = 65; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 120f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 203) + { + this.name = "Pantless Skeleton"; + this.displayName = "Skeleton"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 22; + this.defense = 8; + this.lifeMax = 60; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 110f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 204) + { + this.name = "Spiked Jungle Slime"; + this.width = 24; + this.height = 18; + this.aiStyle = 1; + this.damage = 28; + this.defense = 8; + this.lifeMax = 65; + this.scale = 1.15f; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 50; + this.value = 300f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 205) + { + this.name = "Moth"; + this.width = 40; + this.height = 40; + this.aiStyle = 5; + this.damage = 70; + this.defense = 28; + this.lifeMax = 1000; + this.soundHit = 1; + this.knockBackResist = 0.4f; + this.soundKilled = 1; + this.value = 600f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 206) + { + this.name = "Icy Merman"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 60; + this.defense = 30; + this.lifeMax = 280; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + this.value = 500f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 207) + { + this.townNPC = true; + this.friendly = true; + this.name = "Dye Trader"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 208) + { + this.townNPC = true; + this.friendly = true; + this.name = "Party Girl"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 209) + { + this.townNPC = true; + this.friendly = true; + this.name = "Cyborg"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 210) + { + this.name = "Bee"; + this.width = 12; + this.height = 12; + this.aiStyle = 5; + this.damage = 20; + this.defense = 5; + this.lifeMax = 20; + this.soundHit = 1; + this.knockBackResist = 0.5f; + this.soundKilled = 1; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 211) + { + this.name = "Bee"; + this.width = 8; + this.height = 8; + this.aiStyle = 5; + this.damage = 15; + this.defense = 2; + this.lifeMax = 10; + this.soundHit = 1; + this.knockBackResist = 0.5f; + this.soundKilled = 1; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 212) + { + this.name = "Pirate Deckhand"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 35; + this.defense = 16; + this.lifeMax = 200; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.4f; + this.value = 700f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 213) + { + this.name = "Pirate Corsair"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 50; + this.defense = 20; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.2f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 214) + { + this.name = "Pirate Deadeye"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 30; + this.defense = 12; + this.lifeMax = 150; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.3f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 215) + { + this.name = "Pirate Crossbower"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 35; + this.defense = 18; + this.lifeMax = 260; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.35f; + this.value = 1500f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 216) + { + this.name = "Pirate Captain"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 70; + this.defense = 28; + this.lifeMax = 2000; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.value = 50000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 217) + { + this.name = "Cochineal Beetle"; + this.width = 28; + this.height = 20; + this.aiStyle = 3; + this.damage = 20; + this.defense = 10; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 16; + this.value = 60f; + } + else + { + if (this.type == 218) + { + this.name = "Cyan Beetle"; + this.width = 28; + this.height = 20; + this.aiStyle = 3; + this.damage = 20; + this.defense = 10; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 16; + this.value = 60f; + } + else + { + if (this.type == 219) + { + this.name = "Lac Beetle"; + this.width = 28; + this.height = 20; + this.aiStyle = 3; + this.damage = 20; + this.defense = 10; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 16; + this.value = 60f; + } + else + { + if (this.type == 220) + { + this.name = "Sea Snail"; + this.width = 28; + this.height = 20; + this.aiStyle = 3; + this.damage = 20; + this.defense = 10; + this.lifeMax = 40; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 60f; + } + else + { + if (this.type == 221) + { + this.noGravity = true; + this.name = "Squid"; + this.width = 26; + this.height = 26; + this.aiStyle = 18; + this.damage = 20; + this.defense = 2; + this.lifeMax = 30; + this.soundHit = 1; + this.soundKilled = 1; + this.value = 100f; + this.alpha = 20; + } + else + { + if (this.type == 222) + { + this.name = "Queen Bee"; + this.width = 66; + this.height = 66; + this.aiStyle = 43; + this.damage = 30; + this.defense = 8; + this.lifeMax = 3400; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.noGravity = true; + this.noTileCollide = true; + this.timeLeft = NPC.activeTime * 30; + this.boss = true; + this.value = 100000f; + this.npcSlots = 5f; + } + else + { + if (this.type == 223) + { + this.name = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 16; + this.defense = 8; + this.lifeMax = 50; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.45f; + this.value = 70f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 224) + { + this.name = "Flying Fish"; + this.width = 32; + this.height = 18; + this.aiStyle = 44; + this.damage = 9; + this.defense = 4; + this.lifeMax = 20; + this.soundHit = 1; + this.knockBackResist = 0.8f; + this.soundKilled = 1; + this.value = 90f; + this.buffImmune[31] = false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type == 225) + { + this.name = "Umbrella Slime"; + this.width = 38; + this.height = 26; + this.aiStyle = 1; + this.damage = 10; + this.defense = 5; + this.lifeMax = 35; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.75f; + this.value = 25f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 226) + { + this.npcSlots = 0.5f; + this.name = "Flying Snake"; + this.width = 34; + this.height = 50; + this.aiStyle = 14; + this.damage = 85; + this.defense = 28; + this.lifeMax = 260; + this.soundHit = 1; + this.knockBackResist = 0.65f; + this.soundKilled = 1; + this.value = 400f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 227) + { + this.townNPC = true; + this.friendly = true; + this.name = "Painter"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 228) + { + this.townNPC = true; + this.friendly = true; + this.name = "Witch Doctor"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 229) + { + this.townNPC = true; + this.friendly = true; + this.name = "Pirate"; + this.width = 18; + this.height = 40; + this.aiStyle = 7; + this.damage = 10; + this.defense = 15; + this.lifeMax = 250; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.5f; + } + else + { + if (this.type == 230) + { + this.name = "Goldfish"; + this.width = 18; + this.height = 20; + this.aiStyle = 7; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 1; + } + else + { + if (this.type == 231) + { + this.name = "Hornet Fatty"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 22; + this.defense = 16; + this.lifeMax = 50; + this.soundHit = 1; + this.knockBackResist = 0.3f; + this.soundKilled = 1; + this.value = 200f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 232) + { + this.name = "Hornet Honey"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 28; + this.defense = 12; + this.lifeMax = 42; + this.soundHit = 1; + this.knockBackResist = 0.6f; + this.soundKilled = 1; + this.value = 200f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 233) + { + this.name = "Hornet Leafy"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 30; + this.defense = 14; + this.lifeMax = 38; + this.soundHit = 1; + this.knockBackResist = 0.45f; + this.soundKilled = 1; + this.value = 200f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 234) + { + this.name = "Hornet Spikey"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 32; + this.defense = 6; + this.lifeMax = 42; + this.soundHit = 1; + this.knockBackResist = 0.55f; + this.soundKilled = 1; + this.value = 200f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 235) + { + this.name = "Hornet Stingy"; + this.width = 34; + this.height = 32; + this.aiStyle = 5; + this.damage = 34; + this.defense = 4; + this.lifeMax = 38; + this.soundHit = 1; + this.knockBackResist = 0.6f; + this.soundKilled = 1; + this.value = 200f; + this.noGravity = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 236) + { + this.name = "Jungle Creeper"; + this.width = 50; + this.height = 20; + this.aiStyle = 3; + this.damage = 50; + this.defense = 14; + this.lifeMax = 120; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.25f; + this.value = 1000f; + this.timeLeft = NPC.activeTime * 2; + this.npcSlots = 0.75f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 237) + { + this.noGravity = true; + this.name = "Jungle Creeper"; + this.width = 50; + this.height = 20; + this.aiStyle = 40; + this.damage = 50; + this.defense = 14; + this.lifeMax = 120; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0.25f; + this.value = 1000f; + this.timeLeft = NPC.activeTime * 2; + this.npcSlots = 0.75f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 239) + { + this.name = "Blood Crawler"; + this.width = 50; + this.height = 20; + this.aiStyle = 3; + this.damage = 30; + this.defense = 8; + this.lifeMax = 60; + this.soundHit = 13; + this.soundKilled = 19; + this.knockBackResist = 0.5f; + this.value = 130f; + this.timeLeft = NPC.activeTime * 2; + this.buffImmune[20] = true; + } + else + { + if (this.type == 240) + { + this.noGravity = true; + this.name = "Blood Crawler"; + this.width = 50; + this.height = 20; + this.aiStyle = 40; + this.damage = 30; + this.defense = 8; + this.lifeMax = 60; + this.soundHit = 13; + this.soundKilled = 19; + this.knockBackResist = 0.5f; + this.value = 130f; + this.timeLeft = NPC.activeTime * 2; + this.buffImmune[20] = true; + } + else + { + if (this.type == 241) + { + this.npcSlots = 0.5f; + this.noGravity = true; + this.name = "Blood Feeder"; + this.width = 18; + this.height = 20; + this.aiStyle = 16; + this.damage = 30; + this.defense = 4; + this.lifeMax = 20; + this.soundHit = 13; + this.soundKilled = 19; + this.value = 350f; + } + else + { + if (this.type == 242) + { + this.noGravity = true; + this.name = "Blood Jelly"; + this.width = 26; + this.height = 26; + this.aiStyle = 18; + this.damage = 75; + this.defense = 20; + this.lifeMax = 150; + this.soundHit = 13; + this.soundKilled = 19; + this.value = 800f; + this.alpha = 20; + } + else + { + if (this.type == 243) + { + this.name = "Ice Golem"; + this.width = 30; + this.height = 114; + this.aiStyle = 3; + this.damage = 50; + this.defense = 32; + this.lifeMax = 3000; + this.soundHit = 5; + this.soundKilled = 7; + this.knockBackResist = 0.05f; + this.value = (float)Item.buyPrice(0, 1, 50, 0); + this.buffImmune[20] = true; + this.buffImmune[44] = true; + } + else + { + if (this.type == 244) + { + this.name = "Rainbow Slime"; + this.width = 60; + this.height = 42; + this.aiStyle = 1; + this.damage = 85; + this.defense = 26; + this.lifeMax = 400; + this.soundHit = 1; + this.soundKilled = 1; + this.alpha = 175; + this.value = (float)Item.buyPrice(0, 0, 20, 0); + this.knockBackResist = 0.3f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 245) + { + this.name = "Golem"; + this.width = 140; + this.height = 140; + this.aiStyle = 45; + this.damage = 70; + this.defense = 24; + this.lifeMax = 8000; + this.soundHit = 4; + this.soundKilled = 14; + this.knockBackResist = 0f; + this.alpha = 255; + this.boss = true; + } + else + { + if (this.type == 246) + { + this.noGravity = true; + this.name = "Golem Head"; + this.width = 70; + this.height = 70; + this.aiStyle = 46; + this.damage = 60; + this.defense = 18; + this.lifeMax = 15000; + this.soundHit = 4; + this.soundKilled = 0; + this.knockBackResist = 0f; + this.alpha = 255; + } + else + { + if (this.type == 247 || this.type == 248) + { + this.noGravity = true; + this.name = "Golem Fist"; + this.width = 40; + this.height = 30; + this.aiStyle = 47; + this.damage = 55; + this.defense = 28; + this.lifeMax = 6000; + this.soundHit = 4; + this.soundKilled = 14; + this.alpha = 255; + } + else + { + if (this.type == 249) + { + this.noGravity = true; + this.name = "Golem Head"; + this.width = 70; + this.height = 70; + this.aiStyle = 48; + this.damage = 80; + this.defense = 30; + this.lifeMax = 10000; + this.soundHit = 4; + this.soundKilled = 14; + this.knockBackResist = 0f; + this.dontTakeDamage = true; + } + else + { + if (this.type == 250) + { + this.name = "Angry Nimbus"; + this.width = 34; + this.height = 26; + this.aiStyle = 49; + this.damage = 50; + this.defense = 24; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.3f; + this.value = 300f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 251) + { + this.name = "Eyezor"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 50; + this.defense = 30; + this.lifeMax = 1000; + this.soundHit = 1; + this.soundKilled = 2; + this.knockBackResist = 0.3f; + this.value = (float)Item.buyPrice(0, 0, 50, 0); + this.buffImmune[31] = false; + } + else + { + if (this.type == 252) + { + this.noGravity = true; + this.npcSlots = 0.5f; + this.name = "Parrot"; + this.width = 32; + this.height = 32; + this.aiStyle = 5; + this.damage = 80; + this.defense = 12; + this.lifeMax = 100; + this.soundHit = 1; + this.knockBackResist = 0.7f; + this.soundKilled = 4; + this.value = 500f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 253) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Reaper"; + this.width = 24; + this.height = 44; + this.aiStyle = 22; + this.damage = 80; + this.defense = 18; + this.lifeMax = 300; + this.soundHit = 1; + this.soundKilled = 6; + this.alpha = 100; + this.value = 1500f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + this.knockBackResist = 0.6f; + } + else + { + if (this.type == 254) + { + this.name = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 40; + this.defense = 10; + this.lifeMax = 180; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 255) + { + this.name = "Zombie"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 38; + this.defense = 16; + this.lifeMax = 220; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.3f; + this.value = 1200f; + this.buffImmune[31] = false; + } + else + { + if (this.type == 256) + { + this.noGravity = true; + this.name = "Fungo Fish"; + this.width = 26; + this.height = 26; + this.aiStyle = 18; + this.damage = 90; + this.defense = 20; + this.lifeMax = 140; + this.soundHit = 1; + this.soundKilled = 6; + this.value = 1200f; + this.alpha = 20; + this.npcSlots = 0.3f; + } + else + { + if (this.type == 257) + { + this.name = "Anomura Fungus"; + this.width = 44; + this.height = 34; + this.aiStyle = 3; + this.damage = 38; + this.defense = 24; + this.lifeMax = 230; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.3f; + this.value = 1300f; + this.buffImmune[31] = false; + this.npcSlots = 0.3f; + } + else + { + if (this.type == 258) + { + this.name = "Mushi Ladybug"; + this.width = 30; + this.height = 24; + this.aiStyle = 3; + this.damage = 60; + this.defense = 16; + this.lifeMax = 220; + this.soundHit = 1; + this.soundKilled = 6; + this.knockBackResist = 0.3f; + this.value = 1500f; + this.buffImmune[31] = false; + this.npcSlots = 0.3f; + } + else + { + if (this.type == 259) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Fungi Bulb"; + this.width = 20; + this.height = 20; + this.aiStyle = 13; + this.damage = 24; + this.defense = 4; + this.lifeMax = 90; + this.soundHit = 1; + this.knockBackResist = 0f; + this.soundKilled = 1; + this.value = 350f; + this.buffImmune[20] = true; + this.npcSlots = 0.3f; + } + else + { + if (this.type == 260) + { + this.noGravity = true; + this.noTileCollide = true; + this.name = "Giant Fungi Bulb"; + this.width = 36; + this.height = 36; + this.aiStyle = 13; + this.damage = 70; + this.defense = 20; + this.lifeMax = 300; + this.soundHit = 1; + this.knockBackResist = 0f; + this.soundKilled = 1; + this.value = 1250f; + this.buffImmune[20] = true; + this.npcSlots = 0.3f; + } + else + { + if (this.type == 261) + { + this.name = "Fungi Spore"; + this.width = 12; + this.height = 12; + this.aiStyle = 50; + this.damage = 80; + this.defense = 0; + this.lifeMax = 1; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.npcSlots = 0f; + } + else + { + if (this.type == 262) + { + this.noTileCollide = true; + this.name = "Plantera"; + this.width = 86; + this.height = 86; + this.aiStyle = 51; + this.damage = 50; + this.defense = 14; + this.lifeMax = 30000; + this.soundHit = 1; + this.soundKilled = 1; + this.knockBackResist = 0f; + this.noGravity = true; + this.boss = true; + this.npcSlots = 16f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 263) + { + this.noTileCollide = true; + this.noGravity = true; + this.name = "Plantera's Hook"; + this.width = 40; + this.height = 40; + this.aiStyle = 52; + this.damage = 60; + this.defense = 24; + this.lifeMax = 4000; + this.dontTakeDamage = true; + this.soundHit = 1; + this.soundKilled = 1; + this.buffImmune[20] = true; + } + else + { + if (this.type == 264) + { + this.name = "Plantera's Tentacle"; + this.width = 24; + this.height = 24; + this.aiStyle = 53; + this.damage = 60; + this.defense = 20; + this.lifeMax = 1000; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.buffImmune[20] = true; + } + else + { + if (this.type == 265) + { + this.name = "Spore"; + this.width = 18; + this.height = 18; + this.aiStyle = 50; + this.damage = 70; + this.defense = 0; + this.lifeMax = 1; + this.soundHit = 1; + this.soundKilled = 1; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0f; + this.npcSlots = 0f; + } + else + { + if (this.type == 266) + { + this.name = "Brain of Cthulhu"; + this.dontTakeDamage = true; + this.width = 160; + this.height = 110; + this.aiStyle = 54; + this.damage = 30; + this.defense = 14; + this.lifeMax = 1000; + this.soundHit = 9; + this.soundKilled = 11; + this.knockBackResist = 0f; + this.noGravity = true; + this.noTileCollide = true; + this.timeLeft = NPC.activeTime * 30; + this.boss = true; + this.value = 50000f; + this.npcSlots = 6f; + } + else + { + if (this.type == 267) + { + this.name = "Creeper"; + this.width = 30; + this.height = 30; + this.aiStyle = 55; + this.damage = 20; + this.defense = 10; + this.lifeMax = 100; + this.soundHit = 9; + this.soundKilled = 11; + this.noGravity = true; + this.noTileCollide = true; + this.knockBackResist = 0.8f; + } + else + { + if (this.type == 268) + { + this.noGravity = true; + this.name = "Ichor Sticker"; + this.width = 28; + this.height = 56; + this.aiStyle = 22; + this.damage = 55; + this.defense = 20; + this.lifeMax = 340; + this.soundHit = 13; + this.soundKilled = 19; + this.knockBackResist = 0.6f; + this.value = 450f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 269) + { + this.name = "Rusty Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 70; + this.defense = 34; + this.lifeMax = 550; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.3f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 270) + { + this.name = "Rusty Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 55; + this.defense = 50; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.2f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 271) + { + this.name = "Rusty Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 70; + this.defense = 40; + this.lifeMax = 450; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.25f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 272) + { + this.name = "Rusty Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 75; + this.defense = 28; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.35f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 273) + { + this.name = "Blue Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 45; + this.defense = 50; + this.lifeMax = 500; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.15f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 274) + { + this.name = "Blue Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 65; + this.defense = 34; + this.lifeMax = 350; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 275) + { + this.name = "Blue Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 45; + this.defense = 50; + this.lifeMax = 550; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.15f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 276) + { + this.name = "Blue Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 85; + this.defense = 54; + this.lifeMax = 500; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.2f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 277) + { + this.name = "Hell Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 70; + this.defense = 32; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 278) + { + this.name = "Hell Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 65; + this.defense = 48; + this.lifeMax = 450; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.3f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 279) + { + this.name = "Hell Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 40; + this.defense = 54; + this.lifeMax = 500; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.2f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 280) + { + this.name = "Hell Armored Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 75; + this.defense = 34; + this.lifeMax = 500; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 281) + { + this.name = "Ragged Caster"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 40; + this.defense = 20; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.6f; + this.value = 1500f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 282) + { + this.name = "Ragged Caster"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 35; + this.defense = 28; + this.lifeMax = 450; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 1500f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 283) + { + this.name = "Necromancer"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 50; + this.defense = 18; + this.lifeMax = 300; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.55f; + this.value = 1500f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 284) + { + this.name = "Necromancer"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 35; + this.defense = 24; + this.lifeMax = 450; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.5f; + this.value = 1500f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 285) + { + this.name = "Diabolist"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 50; + this.defense = 12; + this.lifeMax = 200; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.7f; + this.value = 1500f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 286) + { + this.name = "Diabolist"; + this.width = 18; + this.height = 40; + this.aiStyle = 8; + this.damage = 60; + this.defense = 10; + this.lifeMax = 250; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.65f; + this.value = 1500f; + this.npcSlots = 2f; + this.buffImmune[20] = true; + } + else + { + if (this.type == 287) + { + this.name = "Bone Lee"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 90; + this.defense = 42; + this.lifeMax = 1000; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.3f; + this.value = 2000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 288) + { + this.name = "Dungeon Spirit"; + this.width = 20; + this.height = 20; + this.aiStyle = 56; + this.damage = 70; + this.defense = 30; + this.lifeMax = 200; + this.knockBackResist = 0.2f; + this.soundHit = 1; + this.soundKilled = 6; + this.value = 500f; + this.noTileCollide = true; + this.noGravity = true; + flag = true; + } + else + { + if (this.type == 289) + { + this.name = "Giant Cursed Skull"; + this.width = 44; + this.height = 44; + this.aiStyle = 10; + this.damage = 60; + this.defense = 20; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.noGravity = true; + this.noTileCollide = true; + this.value = 150f; + this.knockBackResist = 0.2f; + this.npcSlots = 0.75f; + this.buffImmune[20] = true; + this.buffImmune[24] = true; + this.buffImmune[39] = true; + } + else + { + if (this.type == 290) + { + this.name = "Paladin"; + this.width = 34; + this.height = 62; + this.aiStyle = 3; + this.damage = 100; + this.defense = 50; + this.lifeMax = 5000; + this.soundHit = 4; + this.soundKilled = 6; + this.knockBackResist = 0f; + this.value = 50000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 291) + { + this.name = "Skeleton Sniper"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 60; + this.defense = 28; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 292) + { + this.name = "Tactical Skeleton"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 60; + this.defense = 28; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 293) + { + this.name = "Skeleton Commando"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 60; + this.defense = 28; + this.lifeMax = 400; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.4f; + this.value = 1000f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 294) + { + this.name = "Angry Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 34; + this.defense = 6; + this.lifeMax = 70; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.9f; + this.value = 130f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 295) + { + this.name = "Angry Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 28; + this.defense = 12; + this.lifeMax = 70; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.7f; + this.value = 130f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 296) + { + this.name = "Angry Bones"; + this.width = 18; + this.height = 40; + this.aiStyle = 3; + this.damage = 24; + this.defense = 14; + this.lifeMax = 120; + this.soundHit = 2; + this.soundKilled = 2; + this.knockBackResist = 0.6f; + this.value = 130f; + this.buffImmune[20] = true; + this.buffImmune[31] = false; + } + else + { + if (this.type == 299) + { + this.name = "Squirrel"; + this.width = 18; + this.height = 20; + this.aiStyle = 7; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 1; + } + else + { + if (this.type == 300) + { + this.name = "Mouse"; + this.width = 14; + this.height = 12; + this.aiStyle = 7; + this.damage = 0; + this.defense = 0; + this.lifeMax = 5; + this.soundHit = 1; + this.soundKilled = 4; + this.npcSlots = 0.25f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (flag) + { + for (int n = 0; n < 81; n++) + { + this.buffImmune[n] = true; + } + } + if (Main.dedServ) + { + this.frame = default(Rectangle); + } + else + { + if (Main.NPCLoaded[this.type]) + { + this.frame = new Rectangle(0, 0, Main.npcTexture[this.type].Width, Main.npcTexture[this.type].Height / Main.npcFrameCount[this.type]); + } + else + { + this.setFrameSize = true; + } + } + if (scaleOverride > 0f) + { + int num = (int)((float)this.width * this.scale); + int num2 = (int)((float)this.height * this.scale); + this.position.X = this.position.X + (float)(num / 2); + this.position.Y = this.position.Y + (float)num2; + this.scale = scaleOverride; + this.width = (int)((float)this.width * this.scale); + this.height = (int)((float)this.height * this.scale); + if (this.height == 16 || this.height == 32) + { + this.height++; + } + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)this.height; + } + else + { + this.width = (int)((float)this.width * this.scale); + this.height = (int)((float)this.height * this.scale); + } + if (this.buffImmune[20]) + { + this.buffImmune[70] = true; + } + this.life = this.lifeMax; + this.defDamage = this.damage; + this.defDefense = this.defense; + this.netID = this.type; + this.displayName = Lang.npcName(this.netID, false); + } + public void AI() + { + if (this.aiStyle == 0) + { + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && Main.player[i].talkNPC == this.whoAmI) + { + if (this.type == 105) + { + this.Transform(107); + return; + } + if (this.type == 106) + { + this.Transform(108); + return; + } + if (this.type == 123) + { + this.Transform(124); + return; + } + } + } + this.velocity.X = this.velocity.X * 0.93f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + this.TargetClosest(true); + this.spriteDirection = this.direction; + return; + } + if (this.aiStyle == 1) + { + if (this.type == 244) + { + float num = (float)Main.DiscoR / 255f; + float num2 = (float)Main.DiscoG / 255f; + float num3 = (float)Main.DiscoB / 255f; + num *= 1f; + num2 *= 1f; + num3 *= 1f; + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), num, num2, num3); + this.color.R = (byte)Main.DiscoR; + this.color.G = (byte)Main.DiscoG; + this.color.B = (byte)Main.DiscoB; + this.color.A = 100; + this.alpha = 175; + } + bool flag = false; + if (!Main.dayTime || this.life != this.lifeMax || (double)this.position.Y > Main.worldSurface * 16.0) + { + flag = true; + } + if (this.type == 81) + { + flag = true; + if (Main.rand.Next(30) == 0) + { + int num4 = Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, this.alpha, this.color, 1f); + Main.dust[num4].velocity *= 0.3f; + } + } + if (this.type == 183) + { + flag = true; + } + if (this.type == 147 && Main.rand.Next(10) == 0) + { + int num5 = Dust.NewDust(this.position, this.width, this.height, 76, 0f, 0f, 0, default(Color), 1f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 0.1f; + } + if (this.type == 244) + { + flag = true; + this.ai[0] += 2f; + } + if (this.type == 184) + { + if (Main.rand.Next(8) == 0) + { + int num6 = Dust.NewDust(this.position - this.velocity, this.width, this.height, 76, 0f, 0f, 0, default(Color), 1f); + Main.dust[num6].noGravity = true; + Main.dust[num6].velocity *= 0.15f; + } + flag = true; + if (this.localAI[0] > 0f) + { + this.localAI[0] -= 1f; + } + if (!this.wet) + { + Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num7 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector.X; + float num8 = Main.player[this.target].position.Y - vector.Y; + float num9 = (float)Math.Sqrt((double)(num7 * num7 + num8 * num8)); + if (num9 < 200f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && this.velocity.Y == 0f) + { + this.ai[0] = -40f; + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + if (Main.netMode != 1 && this.localAI[0] == 0f) + { + num8 = Main.player[this.target].position.Y - vector.Y - (float)Main.rand.Next(0, 200); + num9 = (float)Math.Sqrt((double)(num7 * num7 + num8 * num8)); + num9 = 4.5f / num9; + num7 *= num9; + num8 *= num9; + this.localAI[0] = 50f; + Projectile.NewProjectile(vector.X, vector.Y, num7, num8, 174, 9, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + if (this.type == 204) + { + flag = true; + if (this.localAI[0] > 0f) + { + this.localAI[0] -= 1f; + } + if (!this.wet) + { + Vector2 vector2 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num10 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector2.X; + float num11 = Main.player[this.target].position.Y - vector2.Y; + float num12 = (float)Math.Sqrt((double)(num10 * num10 + num11 * num11)); + if (num12 < 400f && Collision.CanHit(new Vector2(this.position.X, this.position.Y - 20f), this.width, this.height + 20, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && this.velocity.Y == 0f) + { + this.ai[0] = -80f; + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + if (Main.netMode != 1 && this.localAI[0] == 0f) + { + num11 = Main.player[this.target].position.Y - vector2.Y - (float)Main.rand.Next(-30, 20); + num11 -= num12 * 0.05f; + num10 = Main.player[this.target].position.X - vector2.X - (float)Main.rand.Next(-20, 20); + num12 = (float)Math.Sqrt((double)(num10 * num10 + num11 * num11)); + num12 = 7f / num12; + num10 *= num12; + num11 *= num12; + this.localAI[0] = 65f; + Projectile.NewProjectile(vector2.X, vector2.Y, num10, num11, 176, 13, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + if (this.type == 59) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 1f, 0.3f, 0.1f); + int num13 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1.7f); + Main.dust[num13].noGravity = true; + } + if (this.ai[2] > 1f) + { + this.ai[2] -= 1f; + } + if (this.wet) + { + if (this.collideY) + { + this.velocity.Y = -2f; + } + if (this.velocity.Y < 0f && this.ai[3] == this.position.X) + { + this.direction *= -1; + this.ai[2] = 200f; + } + if (this.velocity.Y > 0f) + { + this.ai[3] = this.position.X; + } + if (this.type == 59) + { + if (this.velocity.Y > 2f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + else + { + if (this.directionY < 0) + { + this.velocity.Y = this.velocity.Y - 0.8f; + } + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -10f) + { + this.velocity.Y = -10f; + } + } + else + { + if (this.velocity.Y > 2f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + if (this.ai[2] == 1f && flag) + { + this.TargetClosest(true); + } + } + this.aiAction = 0; + if (this.ai[2] == 0f) + { + this.ai[0] = -100f; + this.ai[2] = 1f; + this.TargetClosest(true); + } + if (this.velocity.Y == 0f) + { + if (this.ai[3] == this.position.X) + { + this.direction *= -1; + this.ai[2] = 200f; + } + this.ai[3] = 0f; + this.velocity.X = this.velocity.X * 0.8f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if (flag) + { + this.ai[0] += 1f; + } + this.ai[0] += 1f; + if (this.type == 59) + { + this.ai[0] += 2f; + } + if (this.type == 71) + { + this.ai[0] += 3f; + } + if (this.type == 138) + { + this.ai[0] += 2f; + } + if (this.type == 183) + { + this.ai[0] += 1f; + } + if (this.type == 81) + { + if (this.scale >= 0f) + { + this.ai[0] += 4f; + } + else + { + this.ai[0] += 1f; + } + } + if (this.ai[0] >= 0f) + { + this.netUpdate = true; + if (flag && this.ai[2] == 1f) + { + this.TargetClosest(true); + } + if (this.ai[1] == 2f) + { + this.velocity.Y = -8f; + if (this.type == 59) + { + this.velocity.Y = this.velocity.Y - 2f; + } + this.velocity.X = this.velocity.X + (float)(3 * this.direction); + if (this.type == 59) + { + this.velocity.X = this.velocity.X + 0.5f * (float)this.direction; + } + this.ai[0] = -200f; + this.ai[1] = 0f; + this.ai[3] = this.position.X; + } + else + { + this.velocity.Y = -6f; + this.velocity.X = this.velocity.X + (float)(2 * this.direction); + if (this.type == 59) + { + this.velocity.X = this.velocity.X + (float)(2 * this.direction); + } + this.ai[0] = -120f; + this.ai[1] += 1f; + } + if (this.type == 141) + { + this.velocity.Y = this.velocity.Y * 1.3f; + this.velocity.X = this.velocity.X * 1.2f; + return; + } + } + else + { + if (this.ai[0] >= -30f) + { + this.aiAction = 1; + return; + } + } + } + else + { + if (this.target < 255 && ((this.direction == 1 && this.velocity.X < 3f) || (this.direction == -1 && this.velocity.X > -3f))) + { + if ((this.direction == -1 && (double)this.velocity.X < 0.1) || (this.direction == 1 && (double)this.velocity.X > -0.1)) + { + this.velocity.X = this.velocity.X + 0.2f * (float)this.direction; + return; + } + this.velocity.X = this.velocity.X * 0.93f; + return; + } + } + } + else + { + if (this.aiStyle == 2) + { + if ((this.type == 170 || this.type == 171 || this.type == 180) && Main.rand.Next(1000) == 0) + { + Main.PlaySound(29, (int)this.position.X, (int)this.position.Y, 9); + } + this.noGravity = true; + if (!this.noTileCollide) + { + if (this.collideX) + { + this.velocity.X = this.oldVelocity.X * -0.5f; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.velocity.Y = this.oldVelocity.Y * -0.5f; + if (this.velocity.Y > 0f && this.velocity.Y < 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -1f) + { + this.velocity.Y = -1f; + } + } + } + if (Main.dayTime && (double)this.position.Y <= Main.worldSurface * 16.0 && (this.type == 2 || this.type == 133 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194)) + { + if (this.timeLeft > 10) + { + this.timeLeft = 10; + } + this.directionY = -1; + if (this.velocity.Y > 0f) + { + this.direction = 1; + } + this.direction = -1; + if (this.velocity.X > 0f) + { + this.direction = 1; + } + } + else + { + this.TargetClosest(true); + } + if (this.type == 170 || this.type == 171 || this.type == 180) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + if (this.ai[1] > 0f && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[1] = 0f; + this.ai[0] = 0f; + this.netUpdate = true; + } + } + else + { + if (this.ai[1] == 0f) + { + this.ai[0] += 1f; + } + } + if (this.ai[0] >= 300f) + { + this.ai[1] = 1f; + this.ai[0] = 0f; + this.netUpdate = true; + } + if (this.ai[1] == 0f) + { + this.alpha = 0; + this.noTileCollide = false; + } + else + { + this.wet = false; + this.alpha = 200; + this.noTileCollide = true; + } + this.rotation = this.velocity.Y * 0.1f * (float)this.direction; + this.TargetClosest(true); + if (this.direction == -1 && this.velocity.X > -4f && this.position.X > Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + this.velocity.X = this.velocity.X - 0.08f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.04f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - 0.2f; + } + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 4f && this.position.X + (float)this.width < Main.player[this.target].position.X) + { + this.velocity.X = this.velocity.X + 0.08f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.04f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + 0.2f; + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -2.5 && this.position.Y > Main.player[this.target].position.Y + (float)Main.player[this.target].height) + { + this.velocity.Y = this.velocity.Y - 0.1f; + if ((double)this.velocity.Y > 2.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.15f; + } + } + if ((double)this.velocity.Y < -2.5) + { + this.velocity.Y = -2.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 2.5 && this.position.Y + (float)this.height < Main.player[this.target].position.Y) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if ((double)this.velocity.Y < -2.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.15f; + } + } + if ((double)this.velocity.Y > 2.5) + { + this.velocity.Y = 2.5f; + } + } + } + } + else + { + if (this.type == 116) + { + this.TargetClosest(true); + Lighting.addLight((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.3f, 0.2f, 0.1f); + if (this.direction == -1 && this.velocity.X > -6f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 6f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - 0.2f; + } + } + if (this.velocity.X < -6f) + { + this.velocity.X = -6f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 6f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -6f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + 0.2f; + } + } + if (this.velocity.X > 6f) + { + this.velocity.X = 6f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -2.5) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if ((double)this.velocity.Y > 2.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.15f; + } + } + if ((double)this.velocity.Y < -2.5) + { + this.velocity.Y = -2.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if ((double)this.velocity.Y < -2.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.15f; + } + } + if ((double)this.velocity.Y > 2.5) + { + this.velocity.Y = 2.5f; + } + } + } + if (Main.rand.Next(40) == 0) + { + int num14 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), 5, this.velocity.X, 2f, 0, default(Color), 1f); + Dust expr_1B42_cp_0 = Main.dust[num14]; + expr_1B42_cp_0.velocity.X = expr_1B42_cp_0.velocity.X * 0.5f; + Dust expr_1B60_cp_0 = Main.dust[num14]; + expr_1B60_cp_0.velocity.Y = expr_1B60_cp_0.velocity.Y * 0.1f; + } + } + else + { + if (this.type == 133) + { + if ((double)this.life < (double)this.lifeMax * 0.5) + { + if (this.direction == -1 && this.velocity.X > -6f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 6f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -6f) + { + this.velocity.X = -6f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 6f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -6f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > 6f) + { + this.velocity.X = 6f; + } + } + } + if (this.directionY == -1 && this.velocity.Y > -4f) + { + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y > 4f) + { + this.velocity.Y = this.velocity.Y - 0.1f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + } + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + else + { + if (this.directionY == 1 && this.velocity.Y < 4f) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + } + if (this.velocity.Y > 4f) + { + this.velocity.Y = 4f; + } + } + } + } + else + { + if (this.direction == -1 && this.velocity.X > -4f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 4f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + } + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = -1.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + } + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = 1.5f; + } + } + } + } + } + else + { + float num15 = 4f; + float num16 = 1.5f; + num15 *= 1f + (1f - this.scale); + num16 *= 1f + (1f - this.scale); + if (this.direction == -1 && this.velocity.X > -num15) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > num15) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -num15) + { + this.velocity.X = -num15; + } + } + else + { + if (this.direction == 1 && this.velocity.X < num15) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -num15) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > num15) + { + this.velocity.X = num15; + } + } + } + if (this.directionY == -1 && this.velocity.Y > -num16) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.velocity.Y > num16) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + } + if (this.velocity.Y < -num16) + { + this.velocity.Y = -num16; + } + } + else + { + if (this.directionY == 1 && this.velocity.Y < num16) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if (this.velocity.Y < -num16) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + } + if (this.velocity.Y > num16) + { + this.velocity.Y = num16; + } + } + } + } + } + } + if ((this.type == 2 || this.type == 133 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194) && Main.rand.Next(40) == 0) + { + int num17 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), 5, this.velocity.X, 2f, 0, default(Color), 1f); + Dust expr_251E_cp_0 = Main.dust[num17]; + expr_251E_cp_0.velocity.X = expr_251E_cp_0.velocity.X * 0.5f; + Dust expr_253C_cp_0 = Main.dust[num17]; + expr_253C_cp_0.velocity.Y = expr_253C_cp_0.velocity.Y * 0.1f; + } + if (this.wet && this.type != 170 && this.type != 171 && this.type != 172) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + this.TargetClosest(true); + return; + } + } + else + { + if (this.aiStyle == 3) + { + bool flag2 = false; + if (this.velocity.X == 0f) + { + flag2 = true; + } + if (this.justHit) + { + flag2 = false; + } + if (Main.netMode != 1 && this.type == 198 && (double)this.life <= (double)this.lifeMax * 0.55) + { + this.Transform(199); + } + int num18 = 60; + if (this.type == 120) + { + num18 = 180; + if (this.ai[3] == -120f) + { + this.velocity *= 0f; + this.ai[3] = 0f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + Vector2 vector3 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num19 = this.oldPos[2].X + (float)this.width * 0.5f - vector3.X; + float num20 = this.oldPos[2].Y + (float)this.height * 0.5f - vector3.Y; + float num21 = (float)Math.Sqrt((double)(num19 * num19 + num20 * num20)); + num21 = 2f / num21; + num19 *= num21; + num20 *= num21; + for (int j = 0; j < 20; j++) + { + int num22 = Dust.NewDust(this.position, this.width, this.height, 71, num19, num20, 200, default(Color), 2f); + Main.dust[num22].noGravity = true; + Dust expr_27D5_cp_0 = Main.dust[num22]; + expr_27D5_cp_0.velocity.X = expr_27D5_cp_0.velocity.X * 2f; + } + for (int k = 0; k < 20; k++) + { + int num23 = Dust.NewDust(this.oldPos[2], this.width, this.height, 71, -num19, -num20, 200, default(Color), 2f); + Main.dust[num23].noGravity = true; + Dust expr_2856_cp_0 = Main.dust[num23]; + expr_2856_cp_0.velocity.X = expr_2856_cp_0.velocity.X * 2f; + } + } + } + bool flag3 = false; + bool flag4 = true; + if (this.type == 47 || this.type == 67 || this.type == 109 || this.type == 110 || this.type == 111 || this.type == 120 || this.type == 163 || this.type == 164 || this.type == 239 || this.type == 168 || this.type == 199 || this.type == 206 || this.type == 214 || this.type == 215 || this.type == 216 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 220 || this.type == 226 || this.type == 243 || this.type == 251 || this.type == 257 || this.type == 258 || this.type == 290 || this.type == 291 || this.type == 292 || this.type == 293) + { + flag4 = false; + } + if ((this.type != 110 && this.type != 111 && this.type != 206 && this.type != 216 && this.type != 214 && this.type != 215 && this.type != 291 && this.type != 292 && this.type != 293) || this.ai[2] <= 0f) + { + if (this.velocity.Y == 0f && ((this.velocity.X > 0f && this.direction < 0) || (this.velocity.X < 0f && this.direction > 0))) + { + flag3 = true; + } + if (this.position.X == this.oldPosition.X || this.ai[3] >= (float)num18 || flag3) + { + this.ai[3] += 1f; + } + else + { + if ((double)Math.Abs(this.velocity.X) > 0.9 && this.ai[3] > 0f) + { + this.ai[3] -= 1f; + } + } + if (this.ai[3] > (float)(num18 * 10)) + { + this.ai[3] = 0f; + } + if (this.justHit) + { + this.ai[3] = 0f; + } + if (this.ai[3] == (float)num18) + { + this.netUpdate = true; + } + } + if ((Main.eclipse || !Main.dayTime || (double)this.position.Y > Main.worldSurface * 16.0 || this.type == 26 || this.type == 27 || this.type == 28 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 67 || this.type == 73 || this.type == 77 || this.type == 78 || this.type == 79 || this.type == 80 || this.type == 110 || this.type == 111 || this.type == 120 || this.type == 168 || this.type == 181 || this.type == 185 || this.type == 198 || this.type == 199 || this.type == 198 || this.type == 206 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 220 || this.type == 239 || this.type == 243 || this.type == 254 || (this.type == 255 | this.type == 257) || this.type == 258 || this.type == 291 || this.type == 292 || this.type == 293 || (this.type >= 212 && this.type <= 216)) && this.ai[3] < (float)num18) + { + if ((this.type == 3 || this.type == 21 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 77 || this.type == 110 || this.type == 132 || this.type == 167 || this.type == 161 || this.type == 162 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 197 || this.type == 200 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 223 || this.type == 291 || this.type == 292 || this.type == 293) && Main.rand.Next(1000) == 0) + { + Main.PlaySound(14, (int)this.position.X, (int)this.position.Y, 1); + } + if ((this.type == 78 || this.type == 79 || this.type == 80) && Main.rand.Next(500) == 0) + { + Main.PlaySound(26, (int)this.position.X, (int)this.position.Y, 1); + } + if (this.type == 159 && Main.rand.Next(500) == 0) + { + Main.PlaySound(29, (int)this.position.X, (int)this.position.Y, 7); + } + if (this.type == 162 && Main.rand.Next(500) == 0) + { + Main.PlaySound(29, (int)this.position.X, (int)this.position.Y, 6); + } + if (this.type == 181 && Main.rand.Next(500) == 0) + { + Main.PlaySound(29, (int)this.position.X, (int)this.position.Y, 8); + } + if (this.type >= 269 && this.type <= 280 && Main.rand.Next(1000) == 0) + { + Main.PlaySound(14, (int)this.position.X, (int)this.position.Y, 1); + } + this.TargetClosest(true); + } + else + { + if ((this.type != 110 && this.type != 111 && this.type != 206 && this.type != 216 && this.type != 214 && this.type != 215 && this.type != 291 && this.type != 292 && this.type != 293) || this.ai[2] <= 0f) + { + if (Main.dayTime && (double)(this.position.Y / 16f) < Main.worldSurface && this.timeLeft > 10) + { + this.timeLeft = 10; + } + if (this.velocity.X == 0f) + { + if (this.velocity.Y == 0f) + { + this.ai[0] += 1f; + if (this.ai[0] >= 2f) + { + this.direction *= -1; + this.spriteDirection = this.direction; + this.ai[0] = 0f; + } + } + } + else + { + this.ai[0] = 0f; + } + if (this.direction == 0) + { + this.direction = 1; + } + } + } + if (this.type == 159) + { + if (this.type == 159 && ((this.velocity.X > 0f && this.direction < 0) || (this.velocity.X < 0f && this.direction > 0))) + { + this.velocity.X = this.velocity.X * 0.95f; + } + if (this.velocity.X < -6f || this.velocity.X > 6f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < 6f && this.direction == 1) + { + if (this.velocity.Y == 0f && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > 6f) + { + this.velocity.X = 6f; + } + } + else + { + if (this.velocity.X > -6f && this.direction == -1) + { + if (this.velocity.Y == 0f && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -6f) + { + this.velocity.X = -6f; + } + } + } + } + } + else + { + if (this.type == 199) + { + if (this.velocity.X < -4f || this.velocity.X > 4f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < 4f && this.direction == 1) + { + if (this.velocity.Y == 0f && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.8f; + } + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + else + { + if (this.velocity.X > -4f && this.direction == -1) + { + if (this.velocity.Y == 0f && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.8f; + } + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + } + } + } + else + { + if (this.type == 120 || this.type == 166 || this.type == 213 || this.type == 258) + { + if (this.velocity.X < -3f || this.velocity.X > 3f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < 3f && this.direction == 1) + { + if (this.velocity.Y == 0f && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + } + else + { + if (this.velocity.X > -3f && this.direction == -1) + { + if (this.velocity.Y == 0f && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + } + } + } + } + else + { + if (this.type == 27 || this.type == 77 || this.type == 104 || this.type == 163 || this.type == 162 || this.type == 196 || this.type == 197 || this.type == 212 || this.type == 257) + { + if (this.velocity.X < -2f || this.velocity.X > 2f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < 2f && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > 2f) + { + this.velocity.X = 2f; + } + } + else + { + if (this.velocity.X > -2f && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -2f) + { + this.velocity.X = -2f; + } + } + } + } + } + else + { + if (this.type == 109) + { + if (this.velocity.X < -2f || this.velocity.X > 2f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < 2f && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.04f; + if (this.velocity.X > 2f) + { + this.velocity.X = 2f; + } + } + else + { + if (this.velocity.X > -2f && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.04f; + if (this.velocity.X < -2f) + { + this.velocity.X = -2f; + } + } + } + } + } + else + { + if (this.type == 21 || this.type == 26 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 73 || this.type == 140 || this.type == 164 || this.type == 239 || this.type == 167 || this.type == 168 || this.type == 185 || this.type == 198 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 226 || this.type == 181 || this.type == 254) + { + float num24 = 1.5f; + if (this.type == 294) + { + num24 = 2f; + } + if (this.type == 295) + { + num24 = 1.75f; + } + if (this.type == 296) + { + num24 = 1.25f; + } + if (this.type == 201) + { + num24 = 1.1f; + } + if (this.type == 202) + { + num24 = 0.9f; + } + if (this.type == 203) + { + num24 = 1.2f; + } + if (this.type == 21 || this.type == 201 || this.type == 202 || this.type == 203) + { + num24 *= 1f + (1f - this.scale); + } + if (this.velocity.X < -num24 || this.velocity.X > num24) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < num24 && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > num24) + { + this.velocity.X = num24; + } + } + else + { + if (this.velocity.X > -num24 && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -num24) + { + this.velocity.X = -num24; + } + } + } + } + } + else + { + if (this.type >= 269 && this.type <= 280) + { + float num25 = 1.5f; + if (this.type == 269) + { + num25 = 2f; + } + if (this.type == 270) + { + num25 = 1f; + } + if (this.type == 271) + { + num25 = 1.5f; + } + if (this.type == 272) + { + num25 = 3f; + } + if (this.type == 273) + { + num25 = 1.25f; + } + if (this.type == 274) + { + num25 = 3f; + } + if (this.type == 275) + { + num25 = 3.25f; + } + if (this.type == 276) + { + num25 = 2f; + } + if (this.type == 277) + { + num25 = 2.75f; + } + if (this.type == 278) + { + num25 = 1.8f; + } + if (this.type == 279) + { + num25 = 1.3f; + } + if (this.type == 280) + { + num25 = 2.5f; + } + num25 *= 1f + (1f - this.scale); + if (this.velocity.X < -num25 || this.velocity.X > num25) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < num25 && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > num25) + { + this.velocity.X = num25; + } + } + else + { + if (this.velocity.X > -num25 && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -num25) + { + this.velocity.X = -num25; + } + } + } + } + } + else + { + if (this.type == 67 || this.type == 220) + { + if (this.velocity.X < -0.5f || this.velocity.X > 0.5f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.7f; + } + } + else + { + if (this.velocity.X < 0.5f && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.03f; + if (this.velocity.X > 0.5f) + { + this.velocity.X = 0.5f; + } + } + else + { + if (this.velocity.X > -0.5f && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.03f; + if (this.velocity.X < -0.5f) + { + this.velocity.X = -0.5f; + } + } + } + } + } + else + { + if (this.type == 78 || this.type == 79 || this.type == 80) + { + float num26 = 1f; + float num27 = 0.05f; + if (this.life < this.lifeMax / 2) + { + num26 = 2f; + num27 = 0.1f; + } + if (this.type == 79) + { + num26 *= 1.5f; + } + if (this.velocity.X < -num26 || this.velocity.X > num26) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.7f; + } + } + else + { + if (this.velocity.X < num26 && this.direction == 1) + { + this.velocity.X = this.velocity.X + num27; + if (this.velocity.X > num26) + { + this.velocity.X = num26; + } + } + else + { + if (this.velocity.X > -num26 && this.direction == -1) + { + this.velocity.X = this.velocity.X - num27; + if (this.velocity.X < -num26) + { + this.velocity.X = -num26; + } + } + } + } + } + else + { + if (this.type == 287) + { + float num28 = 5f; + float num29 = 0.2f; + if (this.velocity.X < -num28 || this.velocity.X > num28) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.7f; + } + } + else + { + if (this.velocity.X < num28 && this.direction == 1) + { + this.velocity.X = this.velocity.X + num29; + if (this.velocity.X > num28) + { + this.velocity.X = num28; + } + } + else + { + if (this.velocity.X > -num28 && this.direction == -1) + { + this.velocity.X = this.velocity.X - num29; + if (this.velocity.X < -num28) + { + this.velocity.X = -num28; + } + } + } + } + } + else + { + if (this.type == 243) + { + float num30 = 1f; + float num31 = 0.07f; + num30 += (1f - (float)this.life / (float)this.lifeMax) * 1.5f; + num31 += (1f - (float)this.life / (float)this.lifeMax) * 0.15f; + if (this.velocity.X < -num30 || this.velocity.X > num30) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.7f; + } + } + else + { + if (this.velocity.X < num30 && this.direction == 1) + { + this.velocity.X = this.velocity.X + num31; + if (this.velocity.X > num30) + { + this.velocity.X = num30; + } + } + else + { + if (this.velocity.X > -num30 && this.direction == -1) + { + this.velocity.X = this.velocity.X - num31; + if (this.velocity.X < -num30) + { + this.velocity.X = -num30; + } + } + } + } + } + else + { + if (this.type == 251) + { + float num32 = 1f; + float num33 = 0.08f; + num32 += (1f - (float)this.life / (float)this.lifeMax) * 2f; + num33 += (1f - (float)this.life / (float)this.lifeMax) * 0.2f; + if (this.velocity.X < -num32 || this.velocity.X > num32) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.7f; + } + } + else + { + if (this.velocity.X < num32 && this.direction == 1) + { + this.velocity.X = this.velocity.X + num33; + if (this.velocity.X > num32) + { + this.velocity.X = num32; + } + } + else + { + if (this.velocity.X > -num32 && this.direction == -1) + { + this.velocity.X = this.velocity.X - num33; + if (this.velocity.X < -num32) + { + this.velocity.X = -num32; + } + } + } + } + } + else + { + if (this.type != 110 && this.type != 111 && this.type != 206 && this.type != 214 && this.type != 215 && this.type != 216 && this.type != 290 && this.type != 291 && this.type != 292 && this.type != 293) + { + float num34 = 1f; + if (this.type == 186) + { + num34 = 1.1f; + } + if (this.type == 187) + { + num34 = 0.9f; + } + if (this.type == 188) + { + num34 = 1.2f; + } + if (this.type == 189) + { + num34 = 0.8f; + } + if (this.type == 132) + { + num34 = 0.95f; + } + if (this.type == 200) + { + num34 = 0.87f; + } + if (this.type == 223) + { + num34 = 1.05f; + } + if (this.type == 3 || this.type == 132 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223) + { + num34 *= 1f + (1f - this.scale); + } + if (this.velocity.X < -num34 || this.velocity.X > num34) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < num34 && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > num34) + { + this.velocity.X = num34; + } + } + else + { + if (this.velocity.X > -num34 && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -num34) + { + this.velocity.X = -num34; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type >= 277 && this.type <= 280) + { + Lighting.addLight((int)this.center().X / 16, (int)this.center().Y / 16, 0.2f, 0.1f, 0f); + } + if (this.type == 258) + { + if (this.velocity.Y != 0f) + { + this.TargetClosest(true); + this.spriteDirection = this.direction; + if (Main.player[this.target].center().X < this.position.X && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + else + { + if (Main.player[this.target].center().X > this.position.X + (float)this.width && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + } + if (Main.player[this.target].center().X < this.position.X && this.velocity.X > -5f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (Main.player[this.target].center().X > this.position.X + (float)this.width && this.velocity.X < 5f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + } + } + else + { + if (Main.player[this.target].center().Y + 50f < this.position.Y && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.velocity.Y = -7f; + } + } + } + if (this.type == 185) + { + if (this.velocity.Y == 0f) + { + this.rotation = 0f; + this.localAI[0] = 0f; + } + else + { + if (this.localAI[0] == 1f) + { + this.rotation += this.velocity.X * 0.05f; + } + } + } + if (this.type == 159 && Main.netMode != 1) + { + Vector2 vector4 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num35 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector4.X; + float num36 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector4.Y; + float num37 = (float)Math.Sqrt((double)(num35 * num35 + num36 * num36)); + if (num37 > 300f) + { + this.Transform(158); + } + } + if (this.type == 164 && Main.netMode != 1 && this.velocity.Y == 0f) + { + int num38 = (int)this.center().X / 16; + int num39 = (int)this.center().Y / 16; + bool flag5 = false; + for (int l = num38 - 1; l <= num38 + 1; l++) + { + for (int m = num39 - 1; m <= num39 + 1; m++) + { + if (Main.tile[l, m].wall > 0) + { + flag5 = true; + } + } + } + if (flag5) + { + this.Transform(165); + } + } + if (this.type == 239 && Main.netMode != 1 && this.velocity.Y == 0f) + { + int num40 = (int)this.center().X / 16; + int num41 = (int)this.center().Y / 16; + bool flag6 = false; + for (int n = num40 - 1; n <= num40 + 1; n++) + { + for (int num42 = num41 - 1; num42 <= num41 + 1; num42++) + { + if (Main.tile[n, num42].wall > 0) + { + flag6 = true; + } + } + } + if (flag6) + { + this.Transform(240); + } + } + if (this.type == 163 && Main.netMode != 1 && this.velocity.Y == 0f) + { + int num43 = (int)this.center().X / 16; + int num44 = (int)this.center().Y / 16; + bool flag7 = false; + for (int num45 = num43 - 1; num45 <= num43 + 1; num45++) + { + for (int num46 = num44 - 1; num46 <= num44 + 1; num46++) + { + if (Main.tile[num45, num46].wall > 0) + { + flag7 = true; + } + } + } + if (flag7) + { + this.Transform(238); + } + } + if (this.type == 236 && Main.netMode != 1 && this.velocity.Y == 0f) + { + int num47 = (int)this.center().X / 16; + int num48 = (int)this.center().Y / 16; + bool flag8 = false; + for (int num49 = num47 - 1; num49 <= num47 + 1; num49++) + { + for (int num50 = num48 - 1; num50 <= num48 + 1; num50++) + { + if (Main.tile[num49, num50].wall > 0) + { + flag8 = true; + } + } + } + if (flag8) + { + this.Transform(237); + } + } + if (this.type == 243) + { + if (this.justHit && Main.rand.Next(3) == 0) + { + this.ai[2] -= (float)Main.rand.Next(30); + } + if (this.ai[2] < 0f) + { + this.ai[2] = 0f; + } + if (this.confused) + { + this.ai[2] = 0f; + } + this.ai[2] += 1f; + float num51 = (float)Main.rand.Next(30, 900); + num51 *= (float)this.life / (float)this.lifeMax; + num51 += 30f; + if (Main.netMode != 1 && this.ai[2] >= num51 && this.velocity.Y == 0f && !Main.player[this.target].dead && !Main.player[this.target].frozen && ((this.direction > 0 && this.center().X < Main.player[this.target].center().X) || (this.direction < 0 && this.center().X > Main.player[this.target].center().X)) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num52 = 15f; + Vector2 vector5 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + 20f); + vector5.X += (float)(10 * this.direction); + float num53 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector5.X; + float num54 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector5.Y; + num53 += (float)Main.rand.Next(-40, 41); + num54 += (float)Main.rand.Next(-40, 41); + float num55 = (float)Math.Sqrt((double)(num53 * num53 + num54 * num54)); + this.netUpdate = true; + num55 = num52 / num55; + num53 *= num55; + num54 *= num55; + int num56 = 32; + int num57 = 257; + vector5.X += num53 * 3f; + vector5.Y += num54 * 3f; + Projectile.NewProjectile(vector5.X, vector5.Y, num53, num54, num57, num56, 0f, Main.myPlayer, 0f, 0f); + this.ai[2] = 0f; + } + } + if (this.type == 251) + { + if (this.justHit) + { + this.ai[2] -= (float)Main.rand.Next(30); + } + if (this.ai[2] < 0f) + { + this.ai[2] = 0f; + } + if (this.confused) + { + this.ai[2] = 0f; + } + this.ai[2] += 1f; + float num58 = (float)Main.rand.Next(60, 1800); + num58 *= (float)this.life / (float)this.lifeMax; + num58 += 15f; + if (Main.netMode != 1 && this.ai[2] >= num58 && this.velocity.Y == 0f && !Main.player[this.target].dead && !Main.player[this.target].frozen && ((this.direction > 0 && this.center().X < Main.player[this.target].center().X) || (this.direction < 0 && this.center().X > Main.player[this.target].center().X)) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num59 = 15f; + Vector2 vector6 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + 12f); + vector6.X += (float)(6 * this.direction); + float num60 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector6.X; + float num61 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector6.Y; + num60 += (float)Main.rand.Next(-40, 41); + num61 += (float)Main.rand.Next(-30, 0); + float num62 = (float)Math.Sqrt((double)(num60 * num60 + num61 * num61)); + this.netUpdate = true; + num62 = num59 / num62; + num60 *= num62; + num61 *= num62; + int num63 = 30; + int num64 = 83; + vector6.X += num60 * 3f; + vector6.Y += num61 * 3f; + Projectile.NewProjectile(vector6.X, vector6.Y, num60, num61, num64, num63, 0f, Main.myPlayer, 0f, 0f); + this.ai[2] = 0f; + } + } + if (this.type == 110 || this.type == 111 || this.type == 206 || this.type == 214 || this.type == 215 || this.type == 216 || this.type == 290 || this.type == 291 || this.type == 292 || this.type == 293) + { + if (this.confused) + { + this.ai[2] = 0f; + } + else + { + if (this.ai[1] > 0f) + { + this.ai[1] -= 1f; + } + if (this.justHit) + { + this.ai[1] = 30f; + this.ai[2] = 0f; + } + int num65 = 70; + if (this.type == 291) + { + num65 = 200; + } + if (this.type == 292) + { + num65 = 120; + } + if (this.type == 293) + { + num65 = 90; + } + if (this.type == 111) + { + num65 = 180; + } + if (this.type == 206) + { + num65 = 50; + } + if (this.type == 214) + { + num65 = 40; + } + if (this.type == 215) + { + num65 = 80; + } + if (this.type == 290) + { + num65 = 30; + } + bool flag9 = false; + if (this.type == 216) + { + if (this.localAI[2] >= 20f) + { + flag9 = true; + } + if (flag9) + { + num65 = 60; + } + else + { + num65 = 8; + } + } + if (this.ai[2] > 0f) + { + this.TargetClosest(true); + if (this.ai[1] == (float)(num65 / 2)) + { + if (this.type == 216) + { + this.localAI[2] += 1f; + } + float num66 = 11f; + if (this.type == 111) + { + num66 = 9f; + } + if (this.type == 206) + { + num66 = 7f; + } + if (this.type == 290) + { + num66 = 9f; + } + if (this.type == 293) + { + num66 = 4f; + } + if (this.type == 214) + { + num66 = 14f; + } + if (this.type == 215) + { + num66 = 16f; + } + Vector2 vector7 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + if (this.type == 206) + { + vector7.Y -= 10f; + } + if (this.type == 290) + { + vector7.Y -= 10f; + } + float num67 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector7.X; + float num68 = Math.Abs(num67) * 0.1f; + if (this.type == 291 || this.type == 292) + { + num68 = 0f; + } + if (this.type == 215) + { + num68 = Math.Abs(num67) * 0.08f; + } + if (this.type == 214 || (this.type == 216 && !flag9)) + { + num68 = 0f; + } + float num69 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector7.Y - num68; + if (this.type == 291) + { + num67 += (float)Main.rand.Next(-40, 41) * 0.2f; + num69 += (float)Main.rand.Next(-40, 41) * 0.2f; + } + else + { + if (this.type != 292) + { + num67 += (float)Main.rand.Next(-40, 41); + num69 += (float)Main.rand.Next(-40, 41); + } + } + float num70 = (float)Math.Sqrt((double)(num67 * num67 + num69 * num69)); + this.netUpdate = true; + num70 = num66 / num70; + num67 *= num70; + num69 *= num70; + int num71 = 35; + if (this.type == 111) + { + num71 = 11; + } + if (this.type == 206) + { + num71 = 37; + } + int num72 = 82; + if (this.type == 111) + { + num72 = 81; + } + if (this.type == 206) + { + num72 = 177; + } + if (this.type == 291) + { + num72 = 302; + num71 = 100; + } + if (this.type == 290) + { + num72 = 300; + num71 = 60; + } + if (this.type == 293) + { + num72 = 303; + num71 = 60; + } + if (this.type == 214) + { + num72 = 180; + num71 = 25; + } + if (this.type == 215) + { + num72 = 82; + num71 = 40; + } + if (this.type == 292) + { + num71 = 50; + num72 = 180; + } + if (this.type == 216) + { + num72 = 180; + num71 = 30; + if (flag9) + { + num71 = 100; + num72 = 240; + this.localAI[2] = 0f; + } + } + vector7.X += num67; + vector7.Y += num69; + if (Main.netMode != 1) + { + if (this.type == 292) + { + for (int num73 = 0; num73 < 4; num73++) + { + num67 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector7.X; + num69 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector7.Y; + num70 = (float)Math.Sqrt((double)(num67 * num67 + num69 * num69)); + num70 = 12f / num70; + num67 += (float)Main.rand.Next(-40, 41); + num69 += (float)Main.rand.Next(-40, 41); + num67 *= num70; + num69 *= num70; + Projectile.NewProjectile(vector7.X, vector7.Y, num67, num69, num72, num71, 0f, Main.myPlayer, 0f, 0f); + } + } + else + { + Projectile.NewProjectile(vector7.X, vector7.Y, num67, num69, num72, num71, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Math.Abs(num69) > Math.Abs(num67) * 2f) + { + if (num69 > 0f) + { + this.ai[2] = 1f; + } + else + { + this.ai[2] = 5f; + } + } + else + { + if (Math.Abs(num67) > Math.Abs(num69) * 2f) + { + this.ai[2] = 3f; + } + else + { + if (num69 > 0f) + { + this.ai[2] = 2f; + } + else + { + this.ai[2] = 4f; + } + } + } + } + if (this.velocity.Y != 0f || this.ai[1] <= 0f) + { + this.ai[2] = 0f; + this.ai[1] = 0f; + } + else + { + this.velocity.X = this.velocity.X * 0.9f; + this.spriteDirection = this.direction; + } + } + if (this.ai[2] <= 0f && this.velocity.Y == 0f && this.ai[1] <= 0f && !Main.player[this.target].dead && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num74 = 10f; + Vector2 vector8 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num75 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector8.X; + float num76 = Math.Abs(num75) * 0.1f; + float num77 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector8.Y - num76; + num75 += (float)Main.rand.Next(-40, 41); + num77 += (float)Main.rand.Next(-40, 41); + float num78 = (float)Math.Sqrt((double)(num75 * num75 + num77 * num77)); + float num79 = 700f; + if (this.type == 214) + { + num79 = 550f; + } + if (this.type == 215) + { + num79 = 800f; + } + if (num78 < num79) + { + this.netUpdate = true; + this.velocity.X = this.velocity.X * 0.5f; + num78 = num74 / num78; + num75 *= num78; + num77 *= num78; + this.ai[2] = 3f; + this.ai[1] = (float)num65; + if (Math.Abs(num77) > Math.Abs(num75) * 2f) + { + if (num77 > 0f) + { + this.ai[2] = 1f; + } + else + { + this.ai[2] = 5f; + } + } + else + { + if (Math.Abs(num75) > Math.Abs(num77) * 2f) + { + this.ai[2] = 3f; + } + else + { + if (num77 > 0f) + { + this.ai[2] = 2f; + } + else + { + this.ai[2] = 4f; + } + } + } + } + } + if (this.ai[2] <= 0f) + { + float num80 = 1f; + float num81 = 0.07f; + if (this.type == 214) + { + num80 = 2f; + num81 = 0.09f; + } + else + { + if (this.type == 215) + { + num80 = 1.5f; + num81 = 0.08f; + } + } + if (this.velocity.X < -num80 || this.velocity.X > num80) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < num80 && this.direction == 1) + { + this.velocity.X = this.velocity.X + num81; + if (this.velocity.X > num80) + { + this.velocity.X = num80; + } + } + else + { + if (this.velocity.X > -1f && this.direction == -1) + { + this.velocity.X = this.velocity.X - num81; + if (this.velocity.X < -num80) + { + this.velocity.X = -num80; + } + } + } + } + } + } + } + if (this.type == 109 && Main.netMode != 1 && !Main.player[this.target].dead) + { + if (this.justHit) + { + this.ai[2] = 0f; + } + this.ai[2] += 1f; + if (this.ai[2] > 450f) + { + Vector2 vector9 = new Vector2(this.position.X + (float)this.width * 0.5f - (float)(this.direction * 24), this.position.Y + 4f); + int num82 = 3 * this.direction; + int num83 = -5; + int num84 = Projectile.NewProjectile(vector9.X, vector9.Y, (float)num82, (float)num83, 75, 0, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num84].timeLeft = 300; + this.ai[2] = 0f; + } + } + bool flag10 = false; + if (this.velocity.Y == 0f) + { + int num85 = (int)(this.position.Y + (float)this.height + 7f) / 16; + int num86 = (int)this.position.X / 16; + int num87 = (int)(this.position.X + (float)this.width) / 16; + for (int num88 = num86; num88 <= num87; num88++) + { + if (Main.tile[num88, num85] == null) + { + return; + } + if (Main.tile[num88, num85].nactive() && Main.tileSolid[(int)Main.tile[num88, num85].type]) + { + flag10 = true; + break; + } + } + } + if (this.velocity.Y >= 0f) + { + int num89 = 0; + if (this.velocity.X < 0f) + { + num89 = -1; + } + if (this.velocity.X > 0f) + { + num89 = 1; + } + Vector2 vector10 = this.position; + vector10.X += this.velocity.X; + int num90 = (int)((vector10.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num89)) / 16f); + int num91 = (int)((vector10.Y + (float)this.height - 1f) / 16f); + if (Main.tile[num90, num91] == null) + { + Main.tile[num90, num91] = new Tile(); + } + if (Main.tile[num90, num91 - 1] == null) + { + Main.tile[num90, num91 - 1] = new Tile(); + } + if (Main.tile[num90, num91 - 2] == null) + { + Main.tile[num90, num91 - 2] = new Tile(); + } + if (Main.tile[num90, num91 - 3] == null) + { + Main.tile[num90, num91 - 3] = new Tile(); + } + if (Main.tile[num90, num91 + 1] == null) + { + Main.tile[num90, num91 + 1] = new Tile(); + } + if (Main.tile[num90 - num89, num91 - 3] == null) + { + Main.tile[num90 - num89, num91 - 3] = new Tile(); + } + if ((float)(num90 * 16) < vector10.X + (float)this.width && (float)(num90 * 16 + 16) > vector10.X && ((Main.tile[num90, num91].nactive() && Main.tile[num90, num91].slope() == 0 && Main.tile[num90, num91 - 1].slope() == 0 && Main.tileSolid[(int)Main.tile[num90, num91].type] && !Main.tileSolidTop[(int)Main.tile[num90, num91].type]) || (Main.tile[num90, num91 - 1].halfBrick() && Main.tile[num90, num91 - 1].nactive())) && (!Main.tile[num90, num91 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num90, num91 - 1].type] || Main.tileSolidTop[(int)Main.tile[num90, num91 - 1].type] || (Main.tile[num90, num91 - 1].halfBrick() && (!Main.tile[num90, num91 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num90, num91 - 4].type] || Main.tileSolidTop[(int)Main.tile[num90, num91 - 4].type]))) && (!Main.tile[num90, num91 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num90, num91 - 2].type] || Main.tileSolidTop[(int)Main.tile[num90, num91 - 2].type]) && (!Main.tile[num90, num91 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num90, num91 - 3].type] || Main.tileSolidTop[(int)Main.tile[num90, num91 - 3].type]) && (!Main.tile[num90 - num89, num91 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num90 - num89, num91 - 3].type])) + { + float num92 = (float)(num91 * 16); + if (Main.tile[num90, num91].halfBrick()) + { + num92 += 8f; + } + if (Main.tile[num90, num91 - 1].halfBrick()) + { + num92 -= 8f; + } + if (num92 < vector10.Y + (float)this.height) + { + float num93 = vector10.Y + (float)this.height - num92; + float num94 = 16.1f; + if (this.type == 163 || this.type == 164 || this.type == 236 || this.type == 239) + { + num94 += 8f; + } + if (num93 <= num94) + { + this.gfxOffY += this.position.Y + (float)this.height - num92; + this.position.Y = num92 - (float)this.height; + if (num93 < 9f) + { + this.stepSpeed = 1f; + } + else + { + this.stepSpeed = 2f; + } + } + } + } + } + if (flag10) + { + int num95 = (int)((this.position.X + (float)(this.width / 2) + (float)(15 * this.direction)) / 16f); + int num96 = (int)((this.position.Y + (float)this.height - 15f) / 16f); + if (this.type == 109 || this.type == 163 || this.type == 164 || this.type == 199 || this.type == 236 || this.type == 239 || this.type == 257 || this.type == 258 || this.type == 290) + { + num95 = (int)((this.position.X + (float)(this.width / 2) + (float)((this.width / 2 + 16) * this.direction)) / 16f); + } + if (Main.tile[num95, num96] == null) + { + Main.tile[num95, num96] = new Tile(); + } + if (Main.tile[num95, num96 - 1] == null) + { + Main.tile[num95, num96 - 1] = new Tile(); + } + if (Main.tile[num95, num96 - 2] == null) + { + Main.tile[num95, num96 - 2] = new Tile(); + } + if (Main.tile[num95, num96 - 3] == null) + { + Main.tile[num95, num96 - 3] = new Tile(); + } + if (Main.tile[num95, num96 + 1] == null) + { + Main.tile[num95, num96 + 1] = new Tile(); + } + if (Main.tile[num95 + this.direction, num96 - 1] == null) + { + Main.tile[num95 + this.direction, num96 - 1] = new Tile(); + } + if (Main.tile[num95 + this.direction, num96 + 1] == null) + { + Main.tile[num95 + this.direction, num96 + 1] = new Tile(); + } + if (Main.tile[num95 - this.direction, num96 + 1] == null) + { + Main.tile[num95 - this.direction, num96 + 1] = new Tile(); + } + Main.tile[num95, num96 + 1].halfBrick(); + if (Main.tile[num95, num96 - 1].nactive() && Main.tile[num95, num96 - 1].type == 10 && flag4) + { + this.ai[2] += 1f; + this.ai[3] = 0f; + if (this.ai[2] >= 60f) + { + if (!Main.bloodMoon && (this.type == 3 || this.type == 132 || this.type == 161 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223)) + { + this.ai[1] = 0f; + } + this.velocity.X = 0.5f * (float)(-(float)this.direction); + this.ai[1] += 5f; + if (this.type == 27) + { + this.ai[1] += 1f; + } + if (this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296) + { + this.ai[1] += 6f; + } + this.ai[2] = 0f; + bool flag11 = false; + if (this.ai[1] >= 10f) + { + flag11 = true; + this.ai[1] = 10f; + } + WorldGen.KillTile(num95, num96 - 1, true, false, false); + if ((Main.netMode != 1 || !flag11) && flag11 && Main.netMode != 1) + { + if (this.type == 26) + { + WorldGen.KillTile(num95, num96 - 1, false, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num95, (float)(num96 - 1), 0f, 0); + } + } + else + { + bool flag12 = WorldGen.OpenDoor(num95, num96 - 1, this.direction); + if (!flag12) + { + this.ai[3] = (float)num18; + this.netUpdate = true; + } + if (Main.netMode == 2 && flag12) + { + NetMessage.SendData(19, -1, -1, "", 0, (float)num95, (float)(num96 - 1), (float)this.direction, 0); + } + } + } + } + } + else + { + if ((this.velocity.X < 0f && this.spriteDirection == -1) || (this.velocity.X > 0f && this.spriteDirection == 1)) + { + if (Main.tile[num95, num96 - 2].nactive() && Main.tileSolid[(int)Main.tile[num95, num96 - 2].type]) + { + if (Main.tile[num95, num96 - 3].nactive() && Main.tileSolid[(int)Main.tile[num95, num96 - 3].type]) + { + this.velocity.Y = -8f; + this.netUpdate = true; + } + else + { + this.velocity.Y = -7f; + this.netUpdate = true; + } + } + else + { + if (Main.tile[num95, num96 - 1].nactive() && Main.tileSolid[(int)Main.tile[num95, num96 - 1].type]) + { + this.velocity.Y = -6f; + this.netUpdate = true; + } + else + { + if (this.position.Y + (float)this.height - (float)(num96 * 16) > 20f && Main.tile[num95, num96].nactive() && Main.tile[num95, num96].slope() == 0 && Main.tileSolid[(int)Main.tile[num95, num96].type]) + { + this.velocity.Y = -5f; + this.netUpdate = true; + } + else + { + if (this.directionY < 0 && this.type != 67 && (!Main.tile[num95, num96 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num95, num96 + 1].type]) && (!Main.tile[num95 + this.direction, num96 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num95 + this.direction, num96 + 1].type])) + { + this.velocity.Y = -8f; + this.velocity.X = this.velocity.X * 1.5f; + this.netUpdate = true; + } + else + { + if (flag4) + { + this.ai[1] = 0f; + this.ai[2] = 0f; + } + } + } + } + } + if (this.velocity.Y == 0f && flag2 && this.ai[3] == 1f) + { + this.velocity.Y = -5f; + } + } + if ((this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 77 || this.type == 104 || this.type == 168 || this.type == 196) && this.velocity.Y == 0f && Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))) < 100f && Math.Abs(this.position.Y + (float)(this.height / 2) - (Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2))) < 50f && ((this.direction > 0 && this.velocity.X >= 1f) || (this.direction < 0 && this.velocity.X <= -1f))) + { + this.velocity.X = this.velocity.X * 2f; + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + this.velocity.Y = -4f; + this.netUpdate = true; + } + if (this.type == 120 && this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 1.1f; + } + if (this.type == 287 && this.velocity.Y == 0f && Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))) < 150f && Math.Abs(this.position.Y + (float)(this.height / 2) - (Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2))) < 50f && ((this.direction > 0 && this.velocity.X >= 1f) || (this.direction < 0 && this.velocity.X <= -1f))) + { + this.velocity.X = (float)(8 * this.direction); + this.velocity.Y = -4f; + this.netUpdate = true; + } + if (this.type == 287 && this.velocity.Y < 0f) + { + this.velocity.X = this.velocity.X * 1.2f; + this.velocity.Y = this.velocity.Y * 1.1f; + } + } + } + else + { + if (flag4) + { + this.ai[1] = 0f; + this.ai[2] = 0f; + } + } + if (Main.netMode != 1 && this.type == 120 && this.ai[3] >= (float)num18) + { + int num97 = (int)Main.player[this.target].position.X / 16; + int num98 = (int)Main.player[this.target].position.Y / 16; + int num99 = (int)this.position.X / 16; + int num100 = (int)this.position.Y / 16; + int num101 = 20; + int num102 = 0; + bool flag13 = false; + if (Math.Abs(this.position.X - Main.player[this.target].position.X) + Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 2000f) + { + num102 = 100; + flag13 = true; + } + while (!flag13) + { + if (num102 >= 100) + { + return; + } + num102++; + int num103 = Main.rand.Next(num97 - num101, num97 + num101); + int num104 = Main.rand.Next(num98 - num101, num98 + num101); + for (int num105 = num104; num105 < num98 + num101; num105++) + { + if ((num105 < num98 - 4 || num105 > num98 + 4 || num103 < num97 - 4 || num103 > num97 + 4) && (num105 < num100 - 1 || num105 > num100 + 1 || num103 < num99 - 1 || num103 > num99 + 1) && Main.tile[num103, num105].nactive()) + { + bool flag14 = true; + if (this.type == 32 && Main.tile[num103, num105 - 1].wall == 0) + { + flag14 = false; + } + else + { + if (Main.tile[num103, num105 - 1].lava()) + { + flag14 = false; + } + } + if (flag14 && Main.tileSolid[(int)Main.tile[num103, num105].type] && !Collision.SolidTiles(num103 - 1, num103 + 1, num105 - 4, num105 - 1)) + { + this.position.X = (float)(num103 * 16 - this.width / 2); + this.position.Y = (float)(num105 * 16 - this.height); + this.netUpdate = true; + this.ai[3] = -120f; + } + } + } + } + } + } + else + { + if (this.aiStyle == 4) + { + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead || !Main.player[this.target].active) + { + this.TargetClosest(true); + } + bool dead = Main.player[this.target].dead; + float num106 = this.position.X + (float)(this.width / 2) - Main.player[this.target].position.X - (float)(Main.player[this.target].width / 2); + float num107 = this.position.Y + (float)this.height - 59f - Main.player[this.target].position.Y - (float)(Main.player[this.target].height / 2); + float num108 = (float)Math.Atan2((double)num107, (double)num106) + 1.57f; + if (num108 < 0f) + { + num108 += 6.283f; + } + else + { + if ((double)num108 > 6.283) + { + num108 -= 6.283f; + } + } + float num109 = 0f; + if (this.ai[0] == 0f && this.ai[1] == 0f) + { + num109 = 0.02f; + } + if (this.ai[0] == 0f && this.ai[1] == 2f && this.ai[2] > 40f) + { + num109 = 0.05f; + } + if (this.ai[0] == 3f && this.ai[1] == 0f) + { + num109 = 0.05f; + } + if (this.ai[0] == 3f && this.ai[1] == 2f && this.ai[2] > 40f) + { + num109 = 0.08f; + } + if (this.rotation < num108) + { + if ((double)(num108 - this.rotation) > 3.1415) + { + this.rotation -= num109; + } + else + { + this.rotation += num109; + } + } + else + { + if (this.rotation > num108) + { + if ((double)(this.rotation - num108) > 3.1415) + { + this.rotation += num109; + } + else + { + this.rotation -= num109; + } + } + } + if (this.rotation > num108 - num109 && this.rotation < num108 + num109) + { + this.rotation = num108; + } + if (this.rotation < 0f) + { + this.rotation += 6.283f; + } + else + { + if ((double)this.rotation > 6.283) + { + this.rotation -= 6.283f; + } + } + if (this.rotation > num108 - num109 && this.rotation < num108 + num109) + { + this.rotation = num108; + } + if (Main.rand.Next(5) == 0) + { + int num110 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), 5, this.velocity.X, 2f, 0, default(Color), 1f); + Dust expr_7973_cp_0 = Main.dust[num110]; + expr_7973_cp_0.velocity.X = expr_7973_cp_0.velocity.X * 0.5f; + Dust expr_7991_cp_0 = Main.dust[num110]; + expr_7991_cp_0.velocity.Y = expr_7991_cp_0.velocity.Y * 0.1f; + } + if (Main.dayTime || dead) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.timeLeft > 10) + { + this.timeLeft = 10; + return; + } + } + else + { + if (this.ai[0] == 0f) + { + if (this.ai[1] == 0f) + { + float num111 = 5f; + float num112 = 0.04f; + Vector2 vector11 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num113 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector11.X; + float num114 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 200f - vector11.Y; + float num115 = (float)Math.Sqrt((double)(num113 * num113 + num114 * num114)); + float num116 = num115; + num115 = num111 / num115; + num113 *= num115; + num114 *= num115; + if (this.velocity.X < num113) + { + this.velocity.X = this.velocity.X + num112; + if (this.velocity.X < 0f && num113 > 0f) + { + this.velocity.X = this.velocity.X + num112; + } + } + else + { + if (this.velocity.X > num113) + { + this.velocity.X = this.velocity.X - num112; + if (this.velocity.X > 0f && num113 < 0f) + { + this.velocity.X = this.velocity.X - num112; + } + } + } + if (this.velocity.Y < num114) + { + this.velocity.Y = this.velocity.Y + num112; + if (this.velocity.Y < 0f && num114 > 0f) + { + this.velocity.Y = this.velocity.Y + num112; + } + } + else + { + if (this.velocity.Y > num114) + { + this.velocity.Y = this.velocity.Y - num112; + if (this.velocity.Y > 0f && num114 < 0f) + { + this.velocity.Y = this.velocity.Y - num112; + } + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 600f) + { + this.ai[1] = 1f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.target = 255; + this.netUpdate = true; + } + else + { + if (this.position.Y + (float)this.height < Main.player[this.target].position.Y && num116 < 500f) + { + if (!Main.player[this.target].dead) + { + this.ai[3] += 1f; + } + if (this.ai[3] >= 110f) + { + this.ai[3] = 0f; + this.rotation = num108; + float num117 = 5f; + float num118 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector11.X; + float num119 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector11.Y; + float num120 = (float)Math.Sqrt((double)(num118 * num118 + num119 * num119)); + num120 = num117 / num120; + Vector2 vector12 = vector11; + Vector2 vector13; + vector13.X = num118 * num120; + vector13.Y = num119 * num120; + vector12.X += vector13.X * 10f; + vector12.Y += vector13.Y * 10f; + if (Main.netMode != 1) + { + int num121 = NPC.NewNPC((int)vector12.X, (int)vector12.Y, 5, 0); + Main.npc[num121].velocity.X = vector13.X; + Main.npc[num121].velocity.Y = vector13.Y; + if (Main.netMode == 2 && num121 < 200) + { + NetMessage.SendData(23, -1, -1, "", num121, 0f, 0f, 0f, 0); + } + } + Main.PlaySound(3, (int)vector12.X, (int)vector12.Y, 1); + for (int num122 = 0; num122 < 10; num122++) + { + Dust.NewDust(vector12, 20, 20, 5, vector13.X * 0.4f, vector13.Y * 0.4f, 0, default(Color), 1f); + } + } + } + } + } + else + { + if (this.ai[1] == 1f) + { + this.rotation = num108; + float num123 = 6f; + Vector2 vector14 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num124 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector14.X; + float num125 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector14.Y; + float num126 = (float)Math.Sqrt((double)(num124 * num124 + num125 * num125)); + num126 = num123 / num126; + this.velocity.X = num124 * num126; + this.velocity.Y = num125 * num126; + this.ai[1] = 2f; + } + else + { + if (this.ai[1] == 2f) + { + this.ai[2] += 1f; + if (this.ai[2] >= 40f) + { + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + if (this.ai[2] >= 150f) + { + this.ai[3] += 1f; + this.ai[2] = 0f; + this.target = 255; + this.rotation = num108; + if (this.ai[3] >= 3f) + { + this.ai[1] = 0f; + this.ai[3] = 0f; + } + else + { + this.ai[1] = 1f; + } + } + } + } + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[0] == 1f || this.ai[0] == 2f) + { + if (this.ai[0] == 1f) + { + this.ai[2] += 0.005f; + if ((double)this.ai[2] > 0.5) + { + this.ai[2] = 0.5f; + } + } + else + { + this.ai[2] -= 0.005f; + if (this.ai[2] < 0f) + { + this.ai[2] = 0f; + } + } + this.rotation += this.ai[2]; + this.ai[1] += 1f; + if (this.ai[1] == 100f) + { + this.ai[0] += 1f; + this.ai[1] = 0f; + if (this.ai[0] == 3f) + { + this.ai[2] = 0f; + } + else + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1); + for (int num127 = 0; num127 < 2; num127++) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 8, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6, 1f); + } + for (int num128 = 0; num128 < 20; num128++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + } + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + } + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + return; + } + } + else + { + this.damage = 23; + this.defense = 0; + if (this.ai[1] == 0f) + { + float num129 = 6f; + float num130 = 0.07f; + Vector2 vector15 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num131 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector15.X; + float num132 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 120f - vector15.Y; + float num133 = (float)Math.Sqrt((double)(num131 * num131 + num132 * num132)); + num133 = num129 / num133; + num131 *= num133; + num132 *= num133; + if (this.velocity.X < num131) + { + this.velocity.X = this.velocity.X + num130; + if (this.velocity.X < 0f && num131 > 0f) + { + this.velocity.X = this.velocity.X + num130; + } + } + else + { + if (this.velocity.X > num131) + { + this.velocity.X = this.velocity.X - num130; + if (this.velocity.X > 0f && num131 < 0f) + { + this.velocity.X = this.velocity.X - num130; + } + } + } + if (this.velocity.Y < num132) + { + this.velocity.Y = this.velocity.Y + num130; + if (this.velocity.Y < 0f && num132 > 0f) + { + this.velocity.Y = this.velocity.Y + num130; + } + } + else + { + if (this.velocity.Y > num132) + { + this.velocity.Y = this.velocity.Y - num130; + if (this.velocity.Y > 0f && num132 < 0f) + { + this.velocity.Y = this.velocity.Y - num130; + } + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 200f) + { + this.ai[1] = 1f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.target = 255; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[1] == 1f) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + this.rotation = num108; + float num134 = 6.8f; + Vector2 vector16 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num135 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector16.X; + float num136 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector16.Y; + float num137 = (float)Math.Sqrt((double)(num135 * num135 + num136 * num136)); + num137 = num134 / num137; + this.velocity.X = num135 * num137; + this.velocity.Y = num136 * num137; + this.ai[1] = 2f; + return; + } + if (this.ai[1] == 2f) + { + this.ai[2] += 1f; + if (this.ai[2] >= 40f) + { + this.velocity.X = this.velocity.X * 0.97f; + this.velocity.Y = this.velocity.Y * 0.97f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + if (this.ai[2] >= 130f) + { + this.ai[3] += 1f; + this.ai[2] = 0f; + this.target = 255; + this.rotation = num108; + if (this.ai[3] >= 3f) + { + this.ai[1] = 0f; + this.ai[3] = 0f; + return; + } + this.ai[1] = 1f; + return; + } + } + } + } + } + } + } + else + { + if (this.aiStyle == 5) + { + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead) + { + this.TargetClosest(true); + } + float num138 = 6f; + float num139 = 0.05f; + if (this.type == 6 || this.type == 173) + { + num138 = 4f; + num139 = 0.02f; + } + else + { + if (this.type == 94) + { + num138 = 4.2f; + num139 = 0.022f; + } + else + { + if (this.type == 252) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + num138 = 6f; + num139 = 0.1f; + } + else + { + num139 = 0.01f; + num138 = 2f; + } + } + else + { + if (this.type == 42 || (this.type >= 231 && this.type <= 235)) + { + num138 = 3.5f; + num139 = 0.021f; + if (this.type == 231) + { + num138 = 3f; + num139 = 0.017f; + } + num138 *= 1f - this.scale; + num139 *= 1f - this.scale; + } + else + { + if (this.type == 205) + { + num138 = 3.25f; + num139 = 0.018f; + } + else + { + if (this.type == 176) + { + num138 = 4f; + num139 = 0.017f; + } + else + { + if (this.type == 23) + { + num138 = 1f; + num139 = 0.03f; + } + else + { + if (this.type == 5) + { + num138 = 5f; + num139 = 0.03f; + } + else + { + if (this.type == 210 || this.type == 211) + { + this.localAI[0] += 1f; + float num140 = (this.localAI[0] - 60f) / 60f; + if (num140 > 1f) + { + num140 = 1f; + } + else + { + if (this.velocity.X > 6f) + { + this.velocity.X = 6f; + } + if (this.velocity.X < -6f) + { + this.velocity.X = -6f; + } + if (this.velocity.Y > 6f) + { + this.velocity.Y = 6f; + } + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + num138 = 5f; + num139 = 0.1f; + num139 *= num140; + } + } + } + } + } + } + } + } + } + Vector2 vector17 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num141 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2); + float num142 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2); + num141 = (float)((int)(num141 / 8f) * 8); + num142 = (float)((int)(num142 / 8f) * 8); + vector17.X = (float)((int)(vector17.X / 8f) * 8); + vector17.Y = (float)((int)(vector17.Y / 8f) * 8); + num141 -= vector17.X; + num142 -= vector17.Y; + float num143 = (float)Math.Sqrt((double)(num141 * num141 + num142 * num142)); + float num144 = num143; + bool flag15 = false; + if (num143 > 600f) + { + flag15 = true; + } + if (num143 == 0f) + { + num141 = this.velocity.X; + num142 = this.velocity.Y; + } + else + { + num143 = num138 / num143; + num141 *= num143; + num142 *= num143; + } + if (this.type == 6 || this.type == 42 || this.type == 94 || this.type == 139 || this.type == 173 || this.type == 176 || this.type == 205 || this.type == 210 || this.type == 211 || (this.type >= 231 && this.type <= 235)) + { + if (num144 > 100f || this.type == 42 || this.type == 94 || this.type == 176 || this.type == 210 || this.type == 211 || (this.type >= 231 && this.type <= 235)) + { + this.ai[0] += 1f; + if (this.ai[0] > 0f) + { + this.velocity.Y = this.velocity.Y + 0.023f; + } + else + { + this.velocity.Y = this.velocity.Y - 0.023f; + } + if (this.ai[0] < -100f || this.ai[0] > 100f) + { + this.velocity.X = this.velocity.X + 0.023f; + } + else + { + this.velocity.X = this.velocity.X - 0.023f; + } + if (this.ai[0] > 200f) + { + this.ai[0] = -200f; + } + } + if (num144 < 150f && (this.type == 6 || this.type == 94 || this.type == 173)) + { + this.velocity.X = this.velocity.X + num141 * 0.007f; + this.velocity.Y = this.velocity.Y + num142 * 0.007f; + } + } + if (Main.player[this.target].dead) + { + num141 = (float)this.direction * num138 / 2f; + num142 = -num138 / 2f; + } + if (this.velocity.X < num141) + { + this.velocity.X = this.velocity.X + num139; + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && this.velocity.X < 0f && num141 > 0f) + { + this.velocity.X = this.velocity.X + num139; + } + } + else + { + if (this.velocity.X > num141) + { + this.velocity.X = this.velocity.X - num139; + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && this.velocity.X > 0f && num141 < 0f) + { + this.velocity.X = this.velocity.X - num139; + } + } + } + if (this.velocity.Y < num142) + { + this.velocity.Y = this.velocity.Y + num139; + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && this.velocity.Y < 0f && num142 > 0f) + { + this.velocity.Y = this.velocity.Y + num139; + } + } + else + { + if (this.velocity.Y > num142) + { + this.velocity.Y = this.velocity.Y - num139; + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && this.velocity.Y > 0f && num142 < 0f) + { + this.velocity.Y = this.velocity.Y - num139; + } + } + } + if (this.type == 23) + { + if (num141 > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)num142, (double)num141); + } + else + { + if (num141 < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)num142, (double)num141) + 3.14f; + } + } + } + else + { + if (this.type == 139) + { + this.localAI[0] += 1f; + if (this.justHit) + { + this.localAI[0] = 0f; + } + if (Main.netMode != 1 && this.localAI[0] >= 120f) + { + this.localAI[0] = 0f; + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + int num145 = 25; + int num146 = 84; + Projectile.NewProjectile(vector17.X, vector17.Y, num141, num142, num146, num145, 0f, Main.myPlayer, 0f, 0f); + } + } + int num147 = (int)this.position.X + this.width / 2; + int num148 = (int)this.position.Y + this.height / 2; + num147 /= 16; + num148 /= 16; + if (!WorldGen.SolidTile(num147, num148)) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.3f, 0.1f, 0.05f); + } + if (num141 > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)num142, (double)num141); + } + if (num141 < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)num142, (double)num141) + 3.14f; + } + } + else + { + if (this.type == 6 || this.type == 94 || this.type == 173) + { + this.rotation = (float)Math.Atan2((double)num142, (double)num141) - 1.57f; + } + else + { + if (this.type == 42 || this.type == 176 || this.type == 205 || (this.type >= 231 && this.type <= 235)) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + } + } + } + if (this.type == 6 || this.type == 23 || this.type == 42 || this.type == 94 || this.type == 139 || this.type == 173 || this.type == 176 || this.type == 205 || this.type == 210 || this.type == 211 || (this.type >= 231 && this.type <= 235)) + { + float num149 = 0.7f; + if (this.type == 6 || this.type == 173) + { + num149 = 0.4f; + } + if (this.collideX) + { + this.netUpdate = true; + this.velocity.X = this.oldVelocity.X * -num149; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.netUpdate = true; + this.velocity.Y = this.oldVelocity.Y * -num149; + if (this.velocity.Y > 0f && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = 2f; + } + if (this.velocity.Y < 0f && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = -2f; + } + } + if (this.type == 23) + { + int num150 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num150].noGravity = true; + Dust expr_9A75_cp_0 = Main.dust[num150]; + expr_9A75_cp_0.velocity.X = expr_9A75_cp_0.velocity.X * 0.3f; + Dust expr_9A93_cp_0 = Main.dust[num150]; + expr_9A93_cp_0.velocity.Y = expr_9A93_cp_0.velocity.Y * 0.3f; + } + else + { + if (this.type != 42 && this.type != 139 && this.type != 176 && this.type != 205 && this.type != 210 && this.type != 211 && this.type != 252 && (this.type < 231 || this.type > 235) && Main.rand.Next(20) == 0) + { + int num151 = 18; + if (this.type == 173) + { + num151 = 5; + } + int num152 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), num151, this.velocity.X, 2f, 75, this.color, this.scale); + Dust expr_9BC9_cp_0 = Main.dust[num152]; + expr_9BC9_cp_0.velocity.X = expr_9BC9_cp_0.velocity.X * 0.5f; + Dust expr_9BE7_cp_0 = Main.dust[num152]; + expr_9BE7_cp_0.velocity.Y = expr_9BE7_cp_0.velocity.Y * 0.1f; + } + } + } + else + { + if (this.type != 252 && Main.rand.Next(40) == 0) + { + int num153 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), 5, this.velocity.X, 2f, 0, default(Color), 1f); + Dust expr_9C94_cp_0 = Main.dust[num153]; + expr_9C94_cp_0.velocity.X = expr_9C94_cp_0.velocity.X * 0.5f; + Dust expr_9CB2_cp_0 = Main.dust[num153]; + expr_9CB2_cp_0.velocity.Y = expr_9CB2_cp_0.velocity.Y * 0.1f; + } + } + if ((this.type == 6 || this.type == 94 || this.type == 173) && this.wet) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.3f; + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + if (this.type == 205 && this.wet) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + this.TargetClosest(true); + } + if (this.type == 42 || this.type == 176 || (this.type >= 231 && this.type <= 235)) + { + if (this.wet) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + this.TargetClosest(true); + } + if (this.ai[1] == 101f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + this.ai[1] = 0f; + } + if (Main.netMode != 1) + { + this.ai[1] += (float)Main.rand.Next(5, 20) * 0.1f * this.scale; + if (this.type == 176) + { + this.ai[1] += (float)Main.rand.Next(5, 20) * 0.1f * this.scale; + } + if (this.ai[1] >= 130f) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num154 = 8f; + Vector2 vector18 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)(this.height / 2)); + float num155 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector18.X + (float)Main.rand.Next(-20, 21); + float num156 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector18.Y + (float)Main.rand.Next(-20, 21); + if ((num155 < 0f && this.velocity.X < 0f) || (num155 > 0f && this.velocity.X > 0f)) + { + float num157 = (float)Math.Sqrt((double)(num155 * num155 + num156 * num156)); + num157 = num154 / num157; + num155 *= num157; + num156 *= num157; + int num158 = (int)(10f * this.scale); + if (this.type == 176) + { + num158 = (int)(30f * this.scale); + } + int num159 = 55; + int num160 = Projectile.NewProjectile(vector18.X, vector18.Y, num155, num156, num159, num158, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num160].timeLeft = 300; + this.ai[1] = 101f; + this.netUpdate = true; + } + else + { + this.ai[1] = 0f; + } + } + else + { + this.ai[1] = 0f; + } + } + } + } + if (this.type == 139 && flag15) + { + if ((this.velocity.X > 0f && num141 > 0f) || (this.velocity.X < 0f && num141 < 0f)) + { + if (Math.Abs(this.velocity.X) < 12f) + { + this.velocity.X = this.velocity.X * 1.05f; + } + } + else + { + this.velocity.X = this.velocity.X * 0.9f; + } + } + if (Main.netMode != 1 && this.type == 94 && !Main.player[this.target].dead) + { + if (this.justHit) + { + this.localAI[0] = 0f; + } + this.localAI[0] += 1f; + if (this.localAI[0] == 180f) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + NPC.NewNPC((int)(this.position.X + (float)(this.width / 2) + this.velocity.X), (int)(this.position.Y + (float)(this.height / 2) + this.velocity.Y), 112, 0); + } + this.localAI[0] = 0f; + } + } + if ((Main.dayTime && this.type != 173 && this.type != 6 && this.type != 23 && this.type != 42 && this.type != 94 && this.type != 176 && this.type != 205 && this.type != 210 && this.type != 211 && this.type != 252 && (this.type < 231 || this.type > 235)) || Main.player[this.target].dead) + { + this.velocity.Y = this.velocity.Y - num139 * 2f; + if (this.timeLeft > 10) + { + this.timeLeft = 10; + } + } + if (((this.velocity.X > 0f && this.oldVelocity.X < 0f) || (this.velocity.X < 0f && this.oldVelocity.X > 0f) || (this.velocity.Y > 0f && this.oldVelocity.Y < 0f) || (this.velocity.Y < 0f && this.oldVelocity.Y > 0f)) && !this.justHit) + { + this.netUpdate = true; + return; + } + } + else + { + if (this.aiStyle == 6) + { + if (this.type == 117 && this.localAI[1] == 0f) + { + this.localAI[1] = 1f; + Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 13); + int num161 = 1; + if (this.velocity.X < 0f) + { + num161 = -1; + } + for (int num162 = 0; num162 < 20; num162++) + { + Dust.NewDust(new Vector2(this.position.X - 20f, this.position.Y - 20f), this.width + 40, this.height + 40, 5, (float)(num161 * 8), -1f, 0, default(Color), 1f); + } + } + if (this.type >= 13 && this.type <= 15) + { + this.realLife = -1; + } + else + { + if (this.ai[3] > 0f) + { + this.realLife = (int)this.ai[3]; + } + } + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead) + { + this.TargetClosest(true); + } + if (Main.player[this.target].dead && this.timeLeft > 300) + { + this.timeLeft = 300; + } + if (Main.netMode != 1) + { + if (this.type == 87 && this.ai[0] == 0f) + { + this.ai[3] = (float)this.whoAmI; + this.realLife = this.whoAmI; + int num163 = this.whoAmI; + for (int num164 = 0; num164 < 14; num164++) + { + int num165 = 89; + if (num164 == 1 || num164 == 8) + { + num165 = 88; + } + else + { + if (num164 == 11) + { + num165 = 90; + } + else + { + if (num164 == 12) + { + num165 = 91; + } + else + { + if (num164 == 13) + { + num165 = 92; + } + } + } + } + int num166 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), num165, this.whoAmI); + Main.npc[num166].ai[3] = (float)this.whoAmI; + Main.npc[num166].realLife = this.whoAmI; + Main.npc[num166].ai[1] = (float)num163; + Main.npc[num163].ai[0] = (float)num166; + NetMessage.SendData(23, -1, -1, "", num166, 0f, 0f, 0f, 0); + num163 = num166; + } + } + if ((this.type == 7 || this.type == 8 || this.type == 10 || this.type == 11 || this.type == 13 || this.type == 14 || this.type == 39 || this.type == 40 || this.type == 95 || this.type == 96 || this.type == 98 || this.type == 99 || this.type == 117 || this.type == 118) && this.ai[0] == 0f) + { + if (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117) + { + if (this.type < 13 || this.type > 15) + { + this.ai[3] = (float)this.whoAmI; + this.realLife = this.whoAmI; + } + this.ai[2] = (float)Main.rand.Next(8, 13); + if (this.type == 10) + { + this.ai[2] = (float)Main.rand.Next(4, 7); + } + if (this.type == 13) + { + this.ai[2] = (float)Main.rand.Next(45, 56); + } + if (this.type == 39) + { + this.ai[2] = (float)Main.rand.Next(12, 19); + } + if (this.type == 95) + { + this.ai[2] = (float)Main.rand.Next(6, 12); + } + if (this.type == 98) + { + this.ai[2] = (float)Main.rand.Next(20, 26); + } + if (this.type == 117) + { + this.ai[2] = (float)Main.rand.Next(3, 6); + } + this.ai[0] = (float)NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), this.type + 1, this.whoAmI); + } + else + { + if ((this.type == 8 || this.type == 11 || this.type == 14 || this.type == 40 || this.type == 96 || this.type == 99 || this.type == 118) && this.ai[2] > 0f) + { + this.ai[0] = (float)NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), this.type, this.whoAmI); + } + else + { + this.ai[0] = (float)NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), this.type + 1, this.whoAmI); + } + } + if (this.type < 13 || this.type > 15) + { + Main.npc[(int)this.ai[0]].ai[3] = this.ai[3]; + Main.npc[(int)this.ai[0]].realLife = this.realLife; + } + Main.npc[(int)this.ai[0]].ai[1] = (float)this.whoAmI; + Main.npc[(int)this.ai[0]].ai[2] = this.ai[2] - 1f; + this.netUpdate = true; + } + if ((this.type == 8 || this.type == 9 || this.type == 11 || this.type == 12 || this.type == 40 || this.type == 41 || this.type == 96 || this.type == 97 || this.type == 99 || this.type == 100 || (this.type > 87 && this.type <= 92) || this.type == 118 || this.type == 119) && (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != this.aiStyle)) + { + this.life = 0; + this.HitEffect(0, 10.0); + this.active = false; + } + if ((this.type == 7 || this.type == 8 || this.type == 10 || this.type == 11 || this.type == 39 || this.type == 40 || this.type == 95 || this.type == 96 || this.type == 98 || this.type == 99 || (this.type >= 87 && this.type < 92) || this.type == 117 || this.type == 118) && (!Main.npc[(int)this.ai[0]].active || Main.npc[(int)this.ai[0]].aiStyle != this.aiStyle)) + { + this.life = 0; + this.HitEffect(0, 10.0); + this.active = false; + } + if (this.type == 13 || this.type == 14 || this.type == 15) + { + if (!Main.npc[(int)this.ai[1]].active && !Main.npc[(int)this.ai[0]].active) + { + this.life = 0; + this.HitEffect(0, 10.0); + this.active = false; + } + if (this.type == 13 && !Main.npc[(int)this.ai[0]].active) + { + this.life = 0; + this.HitEffect(0, 10.0); + this.active = false; + } + if (this.type == 15 && !Main.npc[(int)this.ai[1]].active) + { + this.life = 0; + this.HitEffect(0, 10.0); + this.active = false; + } + if (this.type == 14 && (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != this.aiStyle)) + { + this.type = 13; + int num167 = this.whoAmI; + float num168 = (float)this.life / (float)this.lifeMax; + float num169 = this.ai[0]; + this.SetDefaults(this.type, -1f); + this.life = (int)((float)this.lifeMax * num168); + this.ai[0] = num169; + this.TargetClosest(true); + this.netUpdate = true; + this.whoAmI = num167; + } + if (this.type == 14 && (!Main.npc[(int)this.ai[0]].active || Main.npc[(int)this.ai[0]].aiStyle != this.aiStyle)) + { + int num170 = this.whoAmI; + float num171 = (float)this.life / (float)this.lifeMax; + float num172 = this.ai[1]; + this.SetDefaults(this.type, -1f); + this.life = (int)((float)this.lifeMax * num171); + this.ai[1] = num172; + this.TargetClosest(true); + this.netUpdate = true; + this.whoAmI = num170; + } + if (this.life == 0) + { + bool flag16 = true; + for (int num173 = 0; num173 < 200; num173++) + { + if (Main.npc[num173].active && (Main.npc[num173].type == 13 || Main.npc[num173].type == 14 || Main.npc[num173].type == 15)) + { + flag16 = false; + break; + } + } + if (flag16) + { + this.boss = true; + this.NPCLoot(); + } + } + } + if (!this.active && Main.netMode == 2) + { + NetMessage.SendData(28, -1, -1, "", this.whoAmI, -1f, 0f, 0f, 0); + } + } + int num174 = (int)(this.position.X / 16f) - 1; + int num175 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num176 = (int)(this.position.Y / 16f) - 1; + int num177 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num174 < 0) + { + num174 = 0; + } + if (num175 > Main.maxTilesX) + { + num175 = Main.maxTilesX; + } + if (num176 < 0) + { + num176 = 0; + } + if (num177 > Main.maxTilesY) + { + num177 = Main.maxTilesY; + } + bool flag17 = false; + if (this.type >= 87 && this.type <= 92) + { + flag17 = true; + } + if (!flag17) + { + for (int num178 = num174; num178 < num175; num178++) + { + for (int num179 = num176; num179 < num177; num179++) + { + if (Main.tile[num178, num179] != null && ((Main.tile[num178, num179].nactive() && (Main.tileSolid[(int)Main.tile[num178, num179].type] || (Main.tileSolidTop[(int)Main.tile[num178, num179].type] && Main.tile[num178, num179].frameY == 0))) || Main.tile[num178, num179].liquid > 64)) + { + Vector2 vector19; + vector19.X = (float)(num178 * 16); + vector19.Y = (float)(num179 * 16); + if (this.position.X + (float)this.width > vector19.X && this.position.X < vector19.X + 16f && this.position.Y + (float)this.height > vector19.Y && this.position.Y < vector19.Y + 16f) + { + flag17 = true; + if (Main.rand.Next(100) == 0 && this.type != 117 && Main.tile[num178, num179].nactive()) + { + WorldGen.KillTile(num178, num179, true, true, false); + } + if (Main.netMode != 1 && Main.tile[num178, num179].type == 2) + { + byte arg_B1F3_0 = Main.tile[num178, num179 - 1].type; + } + } + } + } + } + } + if (!flag17 && (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117)) + { + Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + int num180 = 1000; + bool flag18 = true; + for (int num181 = 0; num181 < 255; num181++) + { + if (Main.player[num181].active) + { + Rectangle rectangle2 = new Rectangle((int)Main.player[num181].position.X - num180, (int)Main.player[num181].position.Y - num180, num180 * 2, num180 * 2); + if (rectangle.Intersects(rectangle2)) + { + flag18 = false; + break; + } + } + } + if (flag18) + { + flag17 = true; + } + } + if (this.type >= 87 && this.type <= 92) + { + if (this.velocity.X < 0f) + { + this.spriteDirection = 1; + } + else + { + if (this.velocity.X > 0f) + { + this.spriteDirection = -1; + } + } + } + float num182 = 8f; + float num183 = 0.07f; + if (this.type == 95) + { + num182 = 5.5f; + num183 = 0.045f; + } + if (this.type == 10) + { + num182 = 6f; + num183 = 0.05f; + } + if (this.type == 13) + { + num182 = 10f; + num183 = 0.07f; + } + if (this.type == 87) + { + num182 = 11f; + num183 = 0.25f; + } + if (this.type == 117 && Main.wof >= 0) + { + float num184 = (float)Main.npc[Main.wof].life / (float)Main.npc[Main.wof].lifeMax; + if ((double)num184 < 0.5) + { + num182 += 1f; + num183 += 0.1f; + } + if ((double)num184 < 0.25) + { + num182 += 1f; + num183 += 0.1f; + } + if ((double)num184 < 0.1) + { + num182 += 2f; + num183 += 0.1f; + } + } + Vector2 vector20 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num185 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2); + float num186 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2); + num185 = (float)((int)(num185 / 16f) * 16); + num186 = (float)((int)(num186 / 16f) * 16); + vector20.X = (float)((int)(vector20.X / 16f) * 16); + vector20.Y = (float)((int)(vector20.Y / 16f) * 16); + num185 -= vector20.X; + num186 -= vector20.Y; + float num187 = (float)Math.Sqrt((double)(num185 * num185 + num186 * num186)); + if (this.ai[1] > 0f && this.ai[1] < (float)Main.npc.Length) + { + try + { + vector20 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num185 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - vector20.X; + num186 = Main.npc[(int)this.ai[1]].position.Y + (float)(Main.npc[(int)this.ai[1]].height / 2) - vector20.Y; + } + catch + { + } + this.rotation = (float)Math.Atan2((double)num186, (double)num185) + 1.57f; + num187 = (float)Math.Sqrt((double)(num185 * num185 + num186 * num186)); + int num188 = this.width; + if (this.type >= 87 && this.type <= 92) + { + num188 = 42; + } + num187 = (num187 - (float)num188) / num187; + num185 *= num187; + num186 *= num187; + this.velocity = default(Vector2); + this.position.X = this.position.X + num185; + this.position.Y = this.position.Y + num186; + if (this.type >= 87 && this.type <= 92) + { + if (num185 < 0f) + { + this.spriteDirection = 1; + return; + } + if (num185 > 0f) + { + this.spriteDirection = -1; + return; + } + } + } + else + { + if (!flag17) + { + this.TargetClosest(true); + this.velocity.Y = this.velocity.Y + 0.11f; + if (this.velocity.Y > num182) + { + this.velocity.Y = num182; + } + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < (double)num182 * 0.4) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - num183 * 1.1f; + } + else + { + this.velocity.X = this.velocity.X + num183 * 1.1f; + } + } + else + { + if (this.velocity.Y == num182) + { + if (this.velocity.X < num185) + { + this.velocity.X = this.velocity.X + num183; + } + else + { + if (this.velocity.X > num185) + { + this.velocity.X = this.velocity.X - num183; + } + } + } + else + { + if (this.velocity.Y > 4f) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num183 * 0.9f; + } + else + { + this.velocity.X = this.velocity.X - num183 * 0.9f; + } + } + } + } + } + else + { + if (this.type != 87 && this.type != 117 && this.soundDelay == 0) + { + float num189 = num187 / 40f; + if (num189 < 10f) + { + num189 = 10f; + } + if (num189 > 20f) + { + num189 = 20f; + } + this.soundDelay = (int)num189; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 1); + } + num187 = (float)Math.Sqrt((double)(num185 * num185 + num186 * num186)); + float num190 = Math.Abs(num185); + float num191 = Math.Abs(num186); + float num192 = num182 / num187; + num185 *= num192; + num186 *= num192; + if ((this.type == 13 || this.type == 7) && !Main.player[this.target].zoneEvil && !Main.player[this.target].zoneBlood) + { + bool flag19 = true; + for (int num193 = 0; num193 < 255; num193++) + { + if (Main.player[num193].active && !Main.player[num193].dead && Main.player[num193].zoneEvil) + { + flag19 = false; + } + } + if (flag19) + { + if (Main.netMode != 1 && (double)(this.position.Y / 16f) > (Main.rockLayer + (double)Main.maxTilesY) / 2.0) + { + this.active = false; + int num194 = (int)this.ai[0]; + while (num194 > 0 && num194 < 200 && Main.npc[num194].active && Main.npc[num194].aiStyle == this.aiStyle) + { + int num195 = (int)Main.npc[num194].ai[0]; + Main.npc[num194].active = false; + this.life = 0; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, "", num194, 0f, 0f, 0f, 0); + } + num194 = num195; + } + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + } + num185 = 0f; + num186 = num182; + } + } + bool flag20 = false; + if (this.type == 87) + { + if (((this.velocity.X > 0f && num185 < 0f) || (this.velocity.X < 0f && num185 > 0f) || (this.velocity.Y > 0f && num186 < 0f) || (this.velocity.Y < 0f && num186 > 0f)) && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > num183 / 2f && num187 < 300f) + { + flag20 = true; + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < num182) + { + this.velocity *= 1.1f; + } + } + if (this.position.Y > Main.player[this.target].position.Y || (double)(Main.player[this.target].position.Y / 16f) > Main.worldSurface || Main.player[this.target].dead) + { + flag20 = true; + if (Math.Abs(this.velocity.X) < num182 / 2f) + { + if (this.velocity.X == 0f) + { + this.velocity.X = this.velocity.X - (float)this.direction; + } + this.velocity.X = this.velocity.X * 1.1f; + } + else + { + if (this.velocity.Y > -num182) + { + this.velocity.Y = this.velocity.Y - num183; + } + } + } + } + if (!flag20) + { + if ((this.velocity.X > 0f && num185 > 0f) || (this.velocity.X < 0f && num185 < 0f) || (this.velocity.Y > 0f && num186 > 0f) || (this.velocity.Y < 0f && num186 < 0f)) + { + if (this.velocity.X < num185) + { + this.velocity.X = this.velocity.X + num183; + } + else + { + if (this.velocity.X > num185) + { + this.velocity.X = this.velocity.X - num183; + } + } + if (this.velocity.Y < num186) + { + this.velocity.Y = this.velocity.Y + num183; + } + else + { + if (this.velocity.Y > num186) + { + this.velocity.Y = this.velocity.Y - num183; + } + } + if ((double)Math.Abs(num186) < (double)num182 * 0.2 && ((this.velocity.X > 0f && num185 < 0f) || (this.velocity.X < 0f && num185 > 0f))) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + num183 * 2f; + } + else + { + this.velocity.Y = this.velocity.Y - num183 * 2f; + } + } + if ((double)Math.Abs(num185) < (double)num182 * 0.2 && ((this.velocity.Y > 0f && num186 < 0f) || (this.velocity.Y < 0f && num186 > 0f))) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + num183 * 2f; + } + else + { + this.velocity.X = this.velocity.X - num183 * 2f; + } + } + } + else + { + if (num190 > num191) + { + if (this.velocity.X < num185) + { + this.velocity.X = this.velocity.X + num183 * 1.1f; + } + else + { + if (this.velocity.X > num185) + { + this.velocity.X = this.velocity.X - num183 * 1.1f; + } + } + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < (double)num182 * 0.5) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + num183; + } + else + { + this.velocity.Y = this.velocity.Y - num183; + } + } + } + else + { + if (this.velocity.Y < num186) + { + this.velocity.Y = this.velocity.Y + num183 * 1.1f; + } + else + { + if (this.velocity.Y > num186) + { + this.velocity.Y = this.velocity.Y - num183 * 1.1f; + } + } + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < (double)num182 * 0.5) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + num183; + } + else + { + this.velocity.X = this.velocity.X - num183; + } + } + } + } + } + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + if (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117) + { + if (flag17) + { + if (this.localAI[0] != 1f) + { + this.netUpdate = true; + } + this.localAI[0] = 1f; + } + else + { + if (this.localAI[0] != 0f) + { + this.netUpdate = true; + } + this.localAI[0] = 0f; + } + if (((this.velocity.X > 0f && this.oldVelocity.X < 0f) || (this.velocity.X < 0f && this.oldVelocity.X > 0f) || (this.velocity.Y > 0f && this.oldVelocity.Y < 0f) || (this.velocity.Y < 0f && this.oldVelocity.Y > 0f)) && !this.justHit) + { + this.netUpdate = true; + return; + } + } + } + } + else + { + if (this.aiStyle == 7) + { + bool flag21 = Main.raining; + if (!Main.dayTime) + { + flag21 = true; + } + if (this.type == 142 && Main.netMode != 1 && !Main.xMas) + { + this.StrikeNPC(9999, 0f, 0, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(28, -1, -1, "", this.whoAmI, 9999f, 0f, 0f, 0); + } + } + if ((this.type == 148 || this.type == 149) && this.localAI[0] == 0f) + { + this.localAI[0] = (float)Main.rand.Next(1, 5); + } + int num196 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num197 = (int)(this.position.Y + (float)this.height + 1f) / 16; + if (this.type == 107) + { + NPC.savedGoblin = true; + } + if (this.type == 108) + { + NPC.savedWizard = true; + } + if (this.type == 124) + { + NPC.savedMech = true; + } + if ((this.type == 46 || this.type == 148 || this.type == 149 || this.type == 230 || this.type == 299 || this.type == 300) && this.target == 255) + { + this.TargetClosest(true); + if (this.position.X < Main.player[this.target].position.X) + { + this.direction = 1; + this.spriteDirection = this.direction; + } + if (this.position.X > Main.player[this.target].position.X) + { + this.direction = -1; + this.spriteDirection = this.direction; + } + if (this.homeTileX == -1) + { + this.homeTileX = (int)((this.position.X + (float)(this.width / 2)) / 16f); + } + } + bool flag22 = false; + this.directionY = -1; + if (this.direction == 0) + { + this.direction = 1; + } + for (int num198 = 0; num198 < 255; num198++) + { + if (Main.player[num198].active && Main.player[num198].talkNPC == this.whoAmI) + { + flag22 = true; + if (this.ai[0] != 0f) + { + this.netUpdate = true; + } + this.ai[0] = 0f; + this.ai[1] = 300f; + this.ai[2] = 100f; + if (Main.player[num198].position.X + (float)(Main.player[num198].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + } + } + if (this.ai[3] > 0f) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + if (this.type == 37) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + } + if (this.type == 37 && Main.netMode != 1) + { + this.homeless = false; + this.homeTileX = Main.dungeonX; + this.homeTileY = Main.dungeonY; + if (NPC.downedBoss3) + { + this.ai[3] = 1f; + this.netUpdate = true; + } + } + int num199 = this.homeTileY; + if (Main.netMode != 1 && this.homeTileY > 0) + { + while (!WorldGen.SolidTile(this.homeTileX, num199) && num199 < Main.maxTilesY - 20) + { + num199++; + } + } + if (Main.netMode != 1 && this.townNPC && (flag21 || Main.tileDungeon[(int)Main.tile[num196, num197].type]) && (num196 != this.homeTileX || num197 != num199) && !this.homeless) + { + bool flag23 = true; + for (int num200 = 0; num200 < 2; num200++) + { + Rectangle rectangle3 = new Rectangle((int)(this.position.X + (float)(this.width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(this.position.Y + (float)(this.height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + if (num200 == 1) + { + rectangle3 = new Rectangle(this.homeTileX * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, num199 * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + } + for (int num201 = 0; num201 < 255; num201++) + { + if (Main.player[num201].active) + { + Rectangle rectangle4 = new Rectangle((int)Main.player[num201].position.X, (int)Main.player[num201].position.Y, Main.player[num201].width, Main.player[num201].height); + if (rectangle4.Intersects(rectangle3)) + { + flag23 = false; + break; + } + } + if (!flag23) + { + break; + } + } + } + if (flag23) + { + if (this.type == 37 || !Collision.SolidTiles(this.homeTileX - 1, this.homeTileX + 1, num199 - 3, num199 - 1)) + { + this.velocity.X = 0f; + this.velocity.Y = 0f; + this.position.X = (float)(this.homeTileX * 16 + 8 - this.width / 2); + this.position.Y = (float)(num199 * 16 - this.height) - 0.1f; + this.netUpdate = true; + } + else + { + this.homeless = true; + WorldGen.QuickFindHome(this.whoAmI); + } + } + } + if (this.ai[0] == 0f) + { + if (this.ai[2] > 0f) + { + this.ai[2] -= 1f; + } + if (flag21 && !flag22 && this.type != 46 && this.type != 148 && this.type != 149 && this.type != 230 && this.type != 299 && this.type != 300) + { + if (Main.netMode != 1) + { + if (num196 == this.homeTileX && num197 == num199) + { + if (this.velocity.X != 0f) + { + this.netUpdate = true; + } + if ((double)this.velocity.X > 0.1) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if ((double)this.velocity.X < -0.1) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + this.velocity.X = 0f; + } + } + } + else + { + if (!flag22) + { + if (num196 > this.homeTileX) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + this.ai[0] = 1f; + this.ai[1] = (float)(200 + Main.rand.Next(200)); + this.ai[2] = 0f; + this.netUpdate = true; + } + } + } + } + else + { + if (this.type == 300) + { + this.velocity.X = this.velocity.X * 0.5f; + } + if ((double)this.velocity.X > 0.1) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if ((double)this.velocity.X < -0.1) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + this.velocity.X = 0f; + } + } + if (Main.netMode != 1) + { + if (this.ai[1] > 0f) + { + this.ai[1] -= 1f; + } + if (this.ai[1] <= 0f) + { + this.ai[0] = 1f; + this.ai[1] = (float)(200 + Main.rand.Next(200)); + if (this.type == 46 || this.type == 148 || this.type == 149 || this.type == 230 || this.type == 299 || this.type == 300) + { + this.ai[1] += (float)Main.rand.Next(200, 400); + } + this.ai[2] = 0f; + this.netUpdate = true; + } + } + } + if (Main.netMode != 1 && (!flag21 || (num196 == this.homeTileX && num197 == num199))) + { + if (num196 < this.homeTileX - 25 || num196 > this.homeTileX + 25) + { + if (this.ai[2] == 0f) + { + if (num196 < this.homeTileX - 50 && this.direction == -1) + { + this.direction = 1; + this.netUpdate = true; + return; + } + if (num196 > this.homeTileX + 50 && this.direction == 1) + { + this.direction = -1; + this.netUpdate = true; + return; + } + } + } + else + { + if (Main.rand.Next(80) == 0 && this.ai[2] == 0f) + { + this.ai[2] = 200f; + this.direction *= -1; + this.netUpdate = true; + return; + } + } + } + } + else + { + if (this.ai[0] == 1f) + { + if (Main.netMode != 1 && flag21 && num196 == this.homeTileX && num197 == this.homeTileY && this.type != 46 && this.type != 148 && this.type != 149 && this.type != 230 && this.type != 299 && this.type != 300) + { + this.ai[0] = 0f; + this.ai[1] = (float)(200 + Main.rand.Next(200)); + this.ai[2] = 60f; + this.netUpdate = true; + return; + } + if (Main.netMode != 1 && !this.homeless && !Main.tileDungeon[(int)Main.tile[num196, num197].type] && (num196 < this.homeTileX - 35 || num196 > this.homeTileX + 35)) + { + if (this.position.X < (float)(this.homeTileX * 16) && this.direction == -1) + { + this.ai[1] -= 5f; + } + else + { + if (this.position.X > (float)(this.homeTileX * 16) && this.direction == 1) + { + this.ai[1] -= 5f; + } + } + } + this.ai[1] -= 1f; + if (this.ai[1] <= 0f) + { + this.ai[0] = 0f; + this.ai[1] = (float)(300 + Main.rand.Next(300)); + if (this.type == 46 || this.type == 148 || this.type == 149 || this.type == 230 || this.type == 299 || this.type == 300) + { + this.ai[1] -= (float)Main.rand.Next(100); + } + this.ai[2] = 60f; + this.netUpdate = true; + } + if (this.closeDoor && ((this.position.X + (float)(this.width / 2)) / 16f > (float)(this.doorX + 2) || (this.position.X + (float)(this.width / 2)) / 16f < (float)(this.doorX - 2))) + { + bool flag24 = WorldGen.CloseDoor(this.doorX, this.doorY, false); + if (flag24) + { + this.closeDoor = false; + NetMessage.SendData(19, -1, -1, "", 1, (float)this.doorX, (float)this.doorY, (float)this.direction, 0); + } + if ((this.position.X + (float)(this.width / 2)) / 16f > (float)(this.doorX + 4) || (this.position.X + (float)(this.width / 2)) / 16f < (float)(this.doorX - 4) || (this.position.Y + (float)(this.height / 2)) / 16f > (float)(this.doorY + 4) || (this.position.Y + (float)(this.height / 2)) / 16f < (float)(this.doorY - 4)) + { + this.closeDoor = false; + } + } + float num202 = 1f; + float num203 = 0.07f; + if (this.type == 299) + { + num202 = 1.5f; + } + if (this.type == 300) + { + num202 = 2f; + num203 = 1f; + } + if (this.velocity.X < -num202 || this.velocity.X > num202) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < num202 && this.direction == 1) + { + this.velocity.X = this.velocity.X + num203; + if (this.velocity.X > num202) + { + this.velocity.X = num202; + } + } + else + { + if (this.velocity.X > -num202 && this.direction == -1) + { + this.velocity.X = this.velocity.X - num203; + if (this.velocity.X > num202) + { + this.velocity.X = num202; + } + } + } + } + bool flag25 = (float)((this.homeTileY - 2) * 16) <= this.position.Y; + if ((this.direction == 1 && this.position.Y + (float)(this.width / 2) > (float)(this.homeTileX * 16)) || (this.direction == -1 && this.position.Y + (float)(this.width / 2) < (float)(this.homeTileX * 16))) + { + flag25 = true; + } + if (this.velocity.Y >= 0f) + { + int num204 = 0; + if (this.velocity.X < 0f) + { + num204 = -1; + } + if (this.velocity.X > 0f) + { + num204 = 1; + } + Vector2 vector21 = this.position; + vector21.X += this.velocity.X; + int num205 = (int)((vector21.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num204)) / 16f); + int num206 = (int)((vector21.Y + (float)this.height - 1f) / 16f); + if ((float)(num205 * 16) < vector21.X + (float)this.width && (float)(num205 * 16 + 16) > vector21.X) + { + if (Main.tile[num205, num206] == null) + { + Main.tile[num205, num206] = new Tile(); + } + if (Main.tile[num205, num206 - 1] == null) + { + Main.tile[num205, num206 - 1] = new Tile(); + } + if (Main.tile[num205, num206 - 2] == null) + { + Main.tile[num205, num206 - 2] = new Tile(); + } + if (Main.tile[num205, num206 - 3] == null) + { + Main.tile[num205, num206 - 3] = new Tile(); + } + if (Main.tile[num205, num206 + 1] == null) + { + Main.tile[num205, num206 + 1] = new Tile(); + } + if (((Main.tile[num205, num206].nactive() && Main.tile[num205, num206].slope() == 0 && Main.tile[num205, num206 - 1].slope() == 0 && ((Main.tileSolid[(int)Main.tile[num205, num206].type] && !Main.tileSolidTop[(int)Main.tile[num205, num206].type]) || (flag25 && Main.tileSolidTop[(int)Main.tile[num205, num206].type] && Main.tile[num205, num206].frameY == 0 && (!Main.tileSolid[(int)Main.tile[num205, num206 - 1].type] || !Main.tile[num205, num206 - 1].nactive()) && Main.tile[num205, num206].type != 16 && Main.tile[num205, num206].type != 18 && Main.tile[num205, num206].type != 134))) || (Main.tile[num205, num206 - 1].halfBrick() && Main.tile[num205, num206 - 1].nactive())) && (!Main.tile[num205, num206 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num205, num206 - 1].type] || Main.tileSolidTop[(int)Main.tile[num205, num206 - 1].type] || (Main.tile[num205, num206 - 1].halfBrick() && (!Main.tile[num205, num206 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num205, num206 - 4].type] || Main.tileSolidTop[(int)Main.tile[num205, num206 - 4].type]))) && (!Main.tile[num205, num206 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num205, num206 - 2].type] || Main.tileSolidTop[(int)Main.tile[num205, num206 - 2].type]) && (!Main.tile[num205, num206 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num205, num206 - 3].type] || Main.tileSolidTop[(int)Main.tile[num205, num206 - 3].type]) && (!Main.tile[num205 - num204, num206 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num205 - num204, num206 - 3].type] || Main.tileSolidTop[(int)Main.tile[num205 - num204, num206 - 3].type])) + { + float num207 = (float)(num206 * 16); + if (Main.tile[num205, num206].halfBrick()) + { + num207 += 8f; + } + if (Main.tile[num205, num206 - 1].halfBrick()) + { + num207 -= 8f; + } + if (num207 < vector21.Y + (float)this.height) + { + float num208 = vector21.Y + (float)this.height - num207; + if ((double)num208 <= 16.1) + { + this.gfxOffY += this.position.Y + (float)this.height - num207; + this.position.Y = num207 - (float)this.height; + if (num208 < 9f) + { + this.stepSpeed = 1f; + } + else + { + this.stepSpeed = 2f; + } + } + } + } + } + } + if (this.velocity.Y == 0f) + { + if (this.position.X == this.ai[2]) + { + this.direction *= -1; + } + this.ai[2] = -1f; + int num209 = (int)((this.position.X + (float)(this.width / 2) + (float)(15 * this.direction)) / 16f); + int num210 = (int)((this.position.Y + (float)this.height - 16f) / 16f); + if (Main.tile[num209, num210] == null) + { + Main.tile[num209, num210] = new Tile(); + } + if (Main.tile[num209, num210 - 1] == null) + { + Main.tile[num209, num210 - 1] = new Tile(); + } + if (Main.tile[num209, num210 - 2] == null) + { + Main.tile[num209, num210 - 2] = new Tile(); + } + if (Main.tile[num209, num210 - 3] == null) + { + Main.tile[num209, num210 - 3] = new Tile(); + } + if (Main.tile[num209, num210 + 1] == null) + { + Main.tile[num209, num210 + 1] = new Tile(); + } + if (Main.tile[num209 - this.direction, num210 + 1] == null) + { + Main.tile[num209 - this.direction, num210 + 1] = new Tile(); + } + if (Main.tile[num209 + this.direction, num210 - 1] == null) + { + Main.tile[num209 + this.direction, num210 - 1] = new Tile(); + } + if (Main.tile[num209 + this.direction, num210 + 1] == null) + { + Main.tile[num209 + this.direction, num210 + 1] = new Tile(); + } + Main.tile[num209 - this.direction, num210 + 1].halfBrick(); + if (this.townNPC && Main.tile[num209, num210 - 2].nactive() && Main.tile[num209, num210 - 2].type == 10 && (Main.rand.Next(10) == 0 || flag21)) + { + if (Main.netMode != 1) + { + bool flag26 = WorldGen.OpenDoor(num209, num210 - 2, this.direction); + if (flag26) + { + this.closeDoor = true; + this.doorX = num209; + this.doorY = num210 - 2; + NetMessage.SendData(19, -1, -1, "", 0, (float)num209, (float)(num210 - 2), (float)this.direction, 0); + this.netUpdate = true; + this.ai[1] += 80f; + return; + } + if (WorldGen.OpenDoor(num209, num210 - 2, -this.direction)) + { + this.closeDoor = true; + this.doorX = num209; + this.doorY = num210 - 2; + NetMessage.SendData(19, -1, -1, "", 0, (float)num209, (float)(num210 - 2), (float)(-(float)this.direction), 0); + this.netUpdate = true; + this.ai[1] += 80f; + return; + } + this.direction *= -1; + this.netUpdate = true; + return; + } + } + else + { + if ((this.velocity.X < 0f && this.spriteDirection == -1) || (this.velocity.X > 0f && this.spriteDirection == 1)) + { + if (Main.tile[num209, num210 - 2].nactive() && Main.tileSolid[(int)Main.tile[num209, num210 - 2].type] && !Main.tileSolidTop[(int)Main.tile[num209, num210 - 2].type]) + { + if ((this.direction == 1 && !Collision.SolidTiles(num209 - 2, num209 - 1, num210 - 5, num210 - 1)) || (this.direction == -1 && !Collision.SolidTiles(num209 + 1, num209 + 2, num210 - 5, num210 - 1))) + { + if (!Collision.SolidTiles(num209, num209, num210 - 5, num210 - 3)) + { + this.velocity.Y = -6f; + this.netUpdate = true; + } + else + { + if (this.type == 300) + { + if (WorldGen.SolidTile((int)(this.center().X / 16f) + this.direction, (int)(this.center().Y / 16f))) + { + this.direction *= -1; + this.velocity.X = this.velocity.X * 0f; + this.netUpdate = true; + } + } + else + { + this.direction *= -1; + this.netUpdate = true; + } + } + } + else + { + if (this.type == 300) + { + if (WorldGen.SolidTile((int)(this.center().X / 16f) + this.direction, (int)(this.center().Y / 16f))) + { + this.direction *= -1; + this.velocity.X = this.velocity.X * 0f; + this.netUpdate = true; + } + } + else + { + this.direction *= -1; + this.netUpdate = true; + } + } + } + else + { + if (Main.tile[num209, num210 - 1].nactive() && Main.tileSolid[(int)Main.tile[num209, num210 - 1].type] && !Main.tileSolidTop[(int)Main.tile[num209, num210 - 1].type]) + { + if ((this.direction == 1 && !Collision.SolidTiles(num209 - 2, num209 - 1, num210 - 4, num210 - 1)) || (this.direction == -1 && !Collision.SolidTiles(num209 + 1, num209 + 2, num210 - 4, num210 - 1))) + { + if (!Collision.SolidTiles(num209, num209, num210 - 4, num210 - 2)) + { + this.velocity.Y = -5f; + this.netUpdate = true; + } + else + { + this.direction *= -1; + this.netUpdate = true; + } + } + else + { + this.direction *= -1; + this.netUpdate = true; + } + } + else + { + if (this.position.Y + (float)this.height - (float)(num210 * 16) > 20f && Main.tile[num209, num210].nactive() && Main.tileSolid[(int)Main.tile[num209, num210].type] && Main.tile[num209, num210].slope() == 0) + { + if ((this.direction == 1 && !Collision.SolidTiles(num209 - 2, num209, num210 - 3, num210 - 1)) || (this.direction == -1 && !Collision.SolidTiles(num209, num209 + 2, num210 - 3, num210 - 1))) + { + this.velocity.Y = -4.4f; + this.netUpdate = true; + } + else + { + this.direction *= -1; + this.netUpdate = true; + } + } + } + } + try + { + if (Main.tile[num209, num210 + 1] == null) + { + Main.tile[num209, num210 + 1] = new Tile(); + } + if (Main.tile[num209 - this.direction, num210 + 1] == null) + { + Main.tile[num209 - this.direction, num210 + 1] = new Tile(); + } + if (Main.tile[num209, num210 + 2] == null) + { + Main.tile[num209, num210 + 2] = new Tile(); + } + if (Main.tile[num209 - this.direction, num210 + 2] == null) + { + Main.tile[num209 - this.direction, num210 + 2] = new Tile(); + } + if (Main.tile[num209, num210 + 3] == null) + { + Main.tile[num209, num210 + 3] = new Tile(); + } + if (Main.tile[num209 - this.direction, num210 + 3] == null) + { + Main.tile[num209 - this.direction, num210 + 3] = new Tile(); + } + if (Main.tile[num209, num210 + 4] == null) + { + Main.tile[num209, num210 + 4] = new Tile(); + } + if (Main.tile[num209 - this.direction, num210 + 4] == null) + { + Main.tile[num209 - this.direction, num210 + 4] = new Tile(); + } + else + { + if (num196 >= this.homeTileX - 35 && num196 <= this.homeTileX + 35 && (!Main.tile[num209, num210 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num209, num210 + 1].type]) && (!Main.tile[num209 - this.direction, num210 + 1].active() || !Main.tileSolid[(int)Main.tile[num209 - this.direction, num210 + 1].type]) && (!Main.tile[num209, num210 + 2].nactive() || !Main.tileSolid[(int)Main.tile[num209, num210 + 2].type]) && (!Main.tile[num209 - this.direction, num210 + 2].active() || !Main.tileSolid[(int)Main.tile[num209 - this.direction, num210 + 2].type]) && (!Main.tile[num209, num210 + 3].nactive() || !Main.tileSolid[(int)Main.tile[num209, num210 + 3].type]) && (!Main.tile[num209 - this.direction, num210 + 3].active() || !Main.tileSolid[(int)Main.tile[num209 - this.direction, num210 + 3].type]) && (!Main.tile[num209, num210 + 4].nactive() || !Main.tileSolid[(int)Main.tile[num209, num210 + 4].type]) && (!Main.tile[num209 - this.direction, num210 + 4].nactive() || !Main.tileSolid[(int)Main.tile[num209 - this.direction, num210 + 4].type]) && this.type != 46 && this.type != 148 && this.type != 149 && this.type != 230 && this.type != 299 && this.type != 300) + { + this.direction *= -1; + this.velocity.X = this.velocity.X * -1f; + this.netUpdate = true; + } + } + } + catch + { + } + if (this.velocity.Y < 0f) + { + this.ai[2] = this.position.X; + } + } + if (this.velocity.Y < 0f && this.wet) + { + this.velocity.Y = this.velocity.Y * 1.2f; + } + if (this.velocity.Y < 0f && (this.type == 46 || this.type == 299)) + { + this.velocity.Y = this.velocity.Y * 1.2f; + return; + } + } + } + } + } + } + else + { + if (this.aiStyle == 8) + { + this.TargetClosest(true); + this.velocity.X = this.velocity.X * 0.93f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if (this.ai[0] == 0f) + { + this.ai[0] = 500f; + } + if (this.type == 172) + { + if (this.alpha < 255) + { + this.alpha++; + } + if (this.justHit) + { + this.alpha = 0; + } + } + if (this.ai[2] != 0f && this.ai[3] != 0f) + { + if (this.type == 172) + { + this.alpha = 255; + } + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + for (int num211 = 0; num211 < 50; num211++) + { + if (this.type == 29 || this.type == 45) + { + int num212 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, 0f, 0f, 100, default(Color), (float)Main.rand.Next(1, 3)); + Main.dust[num212].velocity *= 3f; + if (Main.dust[num212].scale > 1f) + { + Main.dust[num212].noGravity = true; + } + } + else + { + if (this.type == 32) + { + int num213 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num213].velocity *= 3f; + Main.dust[num213].noGravity = true; + } + else + { + if (this.type == 283 || this.type == 284) + { + int num214 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 173, 0f, 0f, 0, default(Color), 1f); + Main.dust[num214].velocity *= 2f; + Main.dust[num214].scale = 1.4f; + } + else + { + if (this.type == 285 || this.type == 286) + { + int num215 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num215].velocity *= 3f; + Main.dust[num215].noGravity = true; + } + else + { + if (this.type == 281 || this.type == 282) + { + int num216 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num216].velocity *= 3f; + Main.dust[num216].noGravity = true; + } + else + { + if (this.type == 172) + { + int num217 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 106, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num217].velocity *= 3f; + Main.dust[num217].noGravity = true; + } + else + { + int num218 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num218].velocity *= 3f; + Main.dust[num218].noGravity = true; + } + } + } + } + } + } + } + this.position.X = this.ai[2] * 16f - (float)(this.width / 2) + 8f; + this.position.Y = this.ai[3] * 16f - (float)this.height; + this.velocity.X = 0f; + this.velocity.Y = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + for (int num219 = 0; num219 < 50; num219++) + { + if (this.type == 29 || this.type == 45) + { + int num220 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, 0f, 0f, 100, default(Color), (float)Main.rand.Next(1, 3)); + Main.dust[num220].velocity *= 3f; + if (Main.dust[num220].scale > 1f) + { + Main.dust[num220].noGravity = true; + } + } + else + { + if (this.type == 32) + { + int num221 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num221].velocity *= 3f; + Main.dust[num221].noGravity = true; + } + else + { + if (this.type == 172) + { + int num222 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 106, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num222].velocity *= 3f; + Main.dust[num222].noGravity = true; + } + else + { + if (this.type == 283 || this.type == 284) + { + int num223 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 173, 0f, 0f, 0, default(Color), 1f); + Main.dust[num223].velocity *= 2f; + Main.dust[num223].scale = 1.4f; + } + else + { + if (this.type == 285 || this.type == 286) + { + int num224 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num224].velocity *= 3f; + Main.dust[num224].noGravity = true; + } + else + { + if (this.type == 281 || this.type == 282) + { + int num225 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num225].velocity *= 3f; + Main.dust[num225].noGravity = true; + } + else + { + int num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num226].velocity *= 3f; + Main.dust[num226].noGravity = true; + } + } + } + } + } + } + } + } + this.ai[0] += 1f; + if (this.type == 283 || this.type == 284) + { + if (this.ai[0] == 50f || this.ai[0] == 100f || this.ai[0] == 150f || this.ai[0] == 200f || this.ai[0] == 250f) + { + this.ai[1] = 30f; + this.netUpdate = true; + } + if (this.ai[0] >= 400f) + { + this.ai[0] = 700f; + } + } + else + { + if (this.type == 172 && (this.ai[0] == 75f || this.ai[0] == 150f || this.ai[0] == 225f || this.ai[0] == 300f || this.ai[0] == 375f || this.ai[0] == 450f)) + { + this.ai[1] = 30f; + this.netUpdate = true; + } + } + if (this.type == 281 || this.type == 282) + { + if (this.ai[0] == 20f || this.ai[0] == 40f || this.ai[0] == 60f || this.ai[0] == 120f || this.ai[0] == 140f || this.ai[0] == 160f || this.ai[0] == 220f || this.ai[0] == 240f || this.ai[0] == 260f) + { + this.ai[1] = 30f; + this.netUpdate = true; + } + if (this.ai[0] >= 460f) + { + this.ai[0] = 700f; + } + } + else + { + if (this.ai[0] == 100f || this.ai[0] == 200f || this.ai[0] == 300f) + { + this.ai[1] = 30f; + this.netUpdate = true; + } + } + if ((this.type == 285 || this.type == 286) && this.ai[0] > 400f) + { + this.ai[0] = 650f; + } + if (this.ai[0] >= 650f && Main.netMode != 1) + { + this.ai[0] = 1f; + int num227 = (int)Main.player[this.target].position.X / 16; + int num228 = (int)Main.player[this.target].position.Y / 16; + int num229 = (int)this.position.X / 16; + int num230 = (int)this.position.Y / 16; + int num231 = 20; + int num232 = 0; + bool flag27 = false; + if (Math.Abs(this.position.X - Main.player[this.target].position.X) + Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 2000f) + { + num232 = 100; + flag27 = true; + } + while (!flag27 && num232 < 100) + { + num232++; + int num233 = Main.rand.Next(num227 - num231, num227 + num231); + int num234 = Main.rand.Next(num228 - num231, num228 + num231); + for (int num235 = num234; num235 < num228 + num231; num235++) + { + if ((num235 < num228 - 4 || num235 > num228 + 4 || num233 < num227 - 4 || num233 > num227 + 4) && (num235 < num230 - 1 || num235 > num230 + 1 || num233 < num229 - 1 || num233 > num229 + 1) && Main.tile[num233, num235].nactive()) + { + bool flag28 = true; + if ((this.type == 32 || (this.type >= 281 && this.type <= 286)) && !Main.wallDungeon[(int)Main.tile[num233, num235 - 1].wall]) + { + flag28 = false; + } + else + { + if (Main.tile[num233, num235 - 1].lava()) + { + flag28 = false; + } + } + if (flag28 && Main.tileSolid[(int)Main.tile[num233, num235].type] && !Collision.SolidTiles(num233 - 1, num233 + 1, num235 - 4, num235 - 1)) + { + this.ai[1] = 20f; + this.ai[2] = (float)num233; + this.ai[3] = (float)num235; + flag27 = true; + break; + } + } + } + } + this.netUpdate = true; + } + if (this.ai[1] > 0f) + { + this.ai[1] -= 1f; + if (this.ai[1] == 25f) + { + if (this.type >= 281 && this.type <= 286) + { + float num236 = 6f; + if (this.type == 285 || this.type == 286) + { + num236 = 8f; + } + if (this.type == 281 || this.type == 282) + { + num236 = 4f; + } + Vector2 vector22 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y); + float num237 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector22.X; + float num238 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector22.Y; + if (this.type == 283 || this.type == 284) + { + num237 += (float)Main.rand.Next(-30, 31); + num238 += (float)Main.rand.Next(-30, 31); + num237 -= Main.player[this.target].velocity.X * 10f; + num238 -= Main.player[this.target].velocity.Y * 10f; + } + float num239 = (float)Math.Sqrt((double)(num237 * num237 + num238 * num238)); + num239 = num236 / num239; + num237 *= num239; + num238 *= num239; + int num240 = 30; + int num241 = 290; + if (this.type == 285 || this.type == 286) + { + num241 = 291; + num240 = 40; + } + if (this.type == 281 || this.type == 282) + { + num241 = 293; + num240 = 40; + } + int num242 = Projectile.NewProjectile(vector22.X, vector22.Y, num237, num238, num241, num240, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num242].timeLeft = 300; + if (num241 == 291) + { + Main.projectile[num242].ai[0] = Main.player[this.target].center().X; + Main.projectile[num242].ai[1] = Main.player[this.target].center().Y; + Main.projectile[num242].netUpdate = true; + } + this.localAI[0] = 0f; + } + else + { + if (this.type != 172) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + if (Main.netMode != 1) + { + if (this.type == 29 || this.type == 45) + { + NPC.NewNPC((int)this.position.X + this.width / 2, (int)this.position.Y - 8, 30, 0); + } + else + { + if (this.type == 32) + { + NPC.NewNPC((int)this.position.X + this.width / 2, (int)this.position.Y - 8, 33, 0); + } + else + { + if (this.type == 172) + { + float num243 = 10f; + Vector2 vector23 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num244 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector23.X + (float)Main.rand.Next(-10, 11); + float num245 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector23.Y + (float)Main.rand.Next(-10, 11); + float num246 = (float)Math.Sqrt((double)(num244 * num244 + num245 * num245)); + num246 = num243 / num246; + num244 *= num246; + num245 *= num246; + int num247 = 40; + int num248 = 129; + int num249 = Projectile.NewProjectile(vector23.X, vector23.Y, num244, num245, num248, num247, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num249].timeLeft = 300; + this.localAI[0] = 0f; + } + else + { + NPC.NewNPC((int)this.position.X + this.width / 2 + this.direction * 8, (int)this.position.Y + 20, 25, 0); + } + } + } + } + } + } + } + if (this.type == 29 || this.type == 45) + { + if (Main.rand.Next(5) == 0) + { + int num250 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 27, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1.5f); + Main.dust[num250].noGravity = true; + Dust expr_FC8F_cp_0 = Main.dust[num250]; + expr_FC8F_cp_0.velocity.X = expr_FC8F_cp_0.velocity.X * 0.5f; + Main.dust[num250].velocity.Y = -2f; + return; + } + } + else + { + if (this.type == 32) + { + if (Main.rand.Next(3) != 0) + { + int num251 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 172, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 0.9f); + Main.dust[num251].noGravity = true; + Dust expr_FD68_cp_0 = Main.dust[num251]; + expr_FD68_cp_0.velocity.X = expr_FD68_cp_0.velocity.X * 0.3f; + Dust expr_FD88_cp_0 = Main.dust[num251]; + expr_FD88_cp_0.velocity.Y = expr_FD88_cp_0.velocity.Y * 0.2f; + Dust expr_FDA8_cp_0 = Main.dust[num251]; + expr_FDA8_cp_0.velocity.Y = expr_FDA8_cp_0.velocity.Y - 1f; + return; + } + } + else + { + if (this.type == 172) + { + int num252 = 1; + if (this.alpha == 255) + { + num252 = 2; + } + for (int num253 = 0; num253 < num252; num253++) + { + if (Main.rand.Next(255) > 255 - this.alpha) + { + int num254 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 106, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1.2f); + Main.dust[num254].noGravity = true; + Dust expr_FE99_cp_0 = Main.dust[num254]; + expr_FE99_cp_0.velocity.X = expr_FE99_cp_0.velocity.X * (0.1f + (float)Main.rand.Next(30) * 0.01f); + Dust expr_FECD_cp_0 = Main.dust[num254]; + expr_FECD_cp_0.velocity.Y = expr_FECD_cp_0.velocity.Y * (0.1f + (float)Main.rand.Next(30) * 0.01f); + Main.dust[num254].scale *= 1f + (float)Main.rand.Next(6) * 0.1f; + } + } + return; + } + if (this.type == 283 || this.type == 284) + { + if (Main.rand.Next(2) == 0) + { + int num255 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 173, 0f, 0f, 0, default(Color), 1f); + Dust expr_FFCD_cp_0 = Main.dust[num255]; + expr_FFCD_cp_0.velocity.X = expr_FFCD_cp_0.velocity.X * 0.5f; + Dust expr_FFED_cp_0 = Main.dust[num255]; + expr_FFED_cp_0.velocity.Y = expr_FFED_cp_0.velocity.Y * 0.5f; + return; + } + } + else + { + if (this.type == 285 || this.type == 286) + { + if (Main.rand.Next(2) == 0) + { + int num256 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 174, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num256].noGravity = true; + Main.dust[num256].velocity *= 0.4f; + Dust expr_100DC_cp_0 = Main.dust[num256]; + expr_100DC_cp_0.velocity.Y = expr_100DC_cp_0.velocity.Y - 0.7f; + return; + } + } + else + { + if (this.type == 281 || this.type == 282) + { + if (Main.rand.Next(2) == 0) + { + int num257 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 175, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 0.1f); + Main.dust[num257].noGravity = true; + Main.dust[num257].velocity *= 0.5f; + Main.dust[num257].fadeIn = 1.2f; + return; + } + } + else + { + if (Main.rand.Next(2) == 0) + { + int num258 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num258].noGravity = true; + Dust expr_1026E_cp_0 = Main.dust[num258]; + expr_1026E_cp_0.velocity.X = expr_1026E_cp_0.velocity.X * 1f; + Dust expr_1028E_cp_0 = Main.dust[num258]; + expr_1028E_cp_0.velocity.Y = expr_1028E_cp_0.velocity.Y * 1f; + return; + } + } + } + } + } + } + } + else + { + if (this.aiStyle == 9) + { + if (this.target == 255) + { + this.TargetClosest(true); + float num259 = 6f; + if (this.type == 25) + { + num259 = 5f; + } + if (this.type == 112) + { + num259 = 7f; + } + Vector2 vector24 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num260 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector24.X; + float num261 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector24.Y; + float num262 = (float)Math.Sqrt((double)(num260 * num260 + num261 * num261)); + num262 = num259 / num262; + this.velocity.X = num260 * num262; + this.velocity.Y = num261 * num262; + } + if (this.type == 112) + { + this.ai[0] += 1f; + if (this.ai[0] > 3f) + { + this.ai[0] = 3f; + } + if (this.ai[0] == 2f) + { + this.position += this.velocity; + Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 9); + for (int num263 = 0; num263 < 20; num263++) + { + int num264 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 18, 0f, 0f, 100, default(Color), 1.8f); + Main.dust[num264].velocity *= 1.3f; + Main.dust[num264].velocity += this.velocity; + Main.dust[num264].noGravity = true; + } + } + } + if (this.type == 112 && Collision.SolidCollision(this.position, this.width, this.height)) + { + int arg_1056F_0 = Main.netMode; + this.StrikeNPC(999, 0f, 0, false, false); + } + if (this.timeLeft > 100) + { + this.timeLeft = 100; + } + for (int num265 = 0; num265 < 2; num265++) + { + if (this.type == 30) + { + int num266 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 27, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num266].noGravity = true; + Main.dust[num266].velocity *= 0.3f; + Dust expr_1065A_cp_0 = Main.dust[num266]; + expr_1065A_cp_0.velocity.X = expr_1065A_cp_0.velocity.X - this.velocity.X * 0.2f; + Dust expr_10686_cp_0 = Main.dust[num266]; + expr_10686_cp_0.velocity.Y = expr_10686_cp_0.velocity.Y - this.velocity.Y * 0.2f; + } + else + { + if (this.type == 33) + { + for (int num267 = 0; num267 < 3; num267++) + { + float num268 = this.velocity.X / 3f * (float)num265; + float num269 = this.velocity.Y / 3f * (float)num265; + int num270 = 2; + int num271 = Dust.NewDust(new Vector2(this.position.X + (float)num270, this.position.Y + (float)num270), this.width - num270 * 2, this.height - num270 * 2, 172, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num271].noGravity = true; + Main.dust[num271].velocity *= 0.1f; + Main.dust[num271].velocity += this.velocity * 0.5f; + Dust expr_107D0_cp_0 = Main.dust[num271]; + expr_107D0_cp_0.position.X = expr_107D0_cp_0.position.X - num268; + Dust expr_107EF_cp_0 = Main.dust[num271]; + expr_107EF_cp_0.position.Y = expr_107EF_cp_0.position.Y - num269; + } + if (Main.rand.Next(5) == 0) + { + int num272 = 2; + int num273 = Dust.NewDust(new Vector2(this.position.X + (float)num272, this.position.Y + (float)num272), this.width - num272 * 2, this.height - num272 * 2, 172, 0f, 0f, 100, default(Color), 0.6f); + Main.dust[num273].velocity *= 0.25f; + Main.dust[num273].velocity += this.velocity * 0.5f; + } + } + else + { + if (this.type == 112) + { + int num274 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 18, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 80, default(Color), 1.3f); + Main.dust[num274].velocity *= 0.3f; + Main.dust[num274].noGravity = true; + } + else + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 1f, 0.3f, 0.1f); + int num275 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num275].noGravity = true; + Dust expr_10A6D_cp_0 = Main.dust[num275]; + expr_10A6D_cp_0.velocity.X = expr_10A6D_cp_0.velocity.X * 0.3f; + Dust expr_10A8D_cp_0 = Main.dust[num275]; + expr_10A8D_cp_0.velocity.Y = expr_10A8D_cp_0.velocity.Y * 0.3f; + } + } + } + } + this.rotation += 0.4f * (float)this.direction; + return; + } + if (this.aiStyle == 10) + { + float num276 = 1f; + float num277 = 0.011f; + this.TargetClosest(true); + Vector2 vector25 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num278 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector25.X; + float num279 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector25.Y; + float num280 = (float)Math.Sqrt((double)(num278 * num278 + num279 * num279)); + float num281 = num280; + this.ai[1] += 1f; + if (this.ai[1] > 600f) + { + num277 *= 8f; + num276 = 4f; + if (this.ai[1] > 650f) + { + this.ai[1] = 0f; + } + } + else + { + if (num281 < 250f) + { + this.ai[0] += 0.9f; + if (this.ai[0] > 0f) + { + this.velocity.Y = this.velocity.Y + 0.019f; + } + else + { + this.velocity.Y = this.velocity.Y - 0.019f; + } + if (this.ai[0] < -100f || this.ai[0] > 100f) + { + this.velocity.X = this.velocity.X + 0.019f; + } + else + { + this.velocity.X = this.velocity.X - 0.019f; + } + if (this.ai[0] > 200f) + { + this.ai[0] = -200f; + } + } + } + if (num281 > 350f) + { + num276 = 5f; + num277 = 0.3f; + } + else + { + if (num281 > 300f) + { + num276 = 3f; + num277 = 0.2f; + } + else + { + if (num281 > 250f) + { + num276 = 1.5f; + num277 = 0.1f; + } + } + } + num280 = num276 / num280; + num278 *= num280; + num279 *= num280; + if (Main.player[this.target].dead) + { + num278 = (float)this.direction * num276 / 2f; + num279 = -num276 / 2f; + } + if (this.velocity.X < num278) + { + this.velocity.X = this.velocity.X + num277; + } + else + { + if (this.velocity.X > num278) + { + this.velocity.X = this.velocity.X - num277; + } + } + if (this.velocity.Y < num279) + { + this.velocity.Y = this.velocity.Y + num277; + } + else + { + if (this.velocity.Y > num279) + { + this.velocity.Y = this.velocity.Y - num277; + } + } + if (num278 > 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)num279, (double)num278); + } + if (num278 < 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)num279, (double)num278) + 3.14f; + } + if (this.type == 289) + { + if (this.justHit) + { + this.ai[2] = 0f; + this.ai[3] = 0f; + } + vector25 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num278 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector25.X; + num279 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector25.Y; + num280 = (float)Math.Sqrt((double)(num278 * num278 + num279 * num279)); + if (num280 > 500f) + { + this.ai[2] = 0f; + this.ai[3] = 0f; + return; + } + this.ai[2] += 1f; + if (this.ai[3] == 0f) + { + if (this.ai[2] > 120f) + { + this.ai[2] = 0f; + this.ai[3] = 1f; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[2] > 40f) + { + this.ai[3] = 0f; + } + if (Main.netMode != 1 && this.ai[2] == 20f) + { + float num282 = 6f; + int num283 = 25; + int num284 = 299; + num280 = num282 / num280; + num278 *= num280; + num279 *= num280; + Projectile.NewProjectile(vector25.X, vector25.Y, num278, num279, num284, num283, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + } + else + { + if (this.aiStyle == 11) + { + if (this.ai[0] == 0f && Main.netMode != 1) + { + this.TargetClosest(true); + this.ai[0] = 1f; + if (this.type != 68) + { + int num285 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)this.position.Y + this.height / 2, 36, this.whoAmI); + Main.npc[num285].ai[0] = -1f; + Main.npc[num285].ai[1] = (float)this.whoAmI; + Main.npc[num285].target = this.target; + Main.npc[num285].netUpdate = true; + num285 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)this.position.Y + this.height / 2, 36, this.whoAmI); + Main.npc[num285].ai[0] = 1f; + Main.npc[num285].ai[1] = (float)this.whoAmI; + Main.npc[num285].ai[3] = 150f; + Main.npc[num285].target = this.target; + Main.npc[num285].netUpdate = true; + } + } + if (this.type == 68 && this.ai[1] != 3f && this.ai[1] != 2f) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + this.ai[1] = 2f; + } + if (Main.player[this.target].dead || Math.Abs(this.position.X - Main.player[this.target].position.X) > 2000f || Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 2000f) + { + this.TargetClosest(true); + if (Main.player[this.target].dead || Math.Abs(this.position.X - Main.player[this.target].position.X) > 2000f || Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 2000f) + { + this.ai[1] = 3f; + } + } + if (Main.dayTime && this.ai[1] != 3f && this.ai[1] != 2f) + { + this.ai[1] = 2f; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + if (this.ai[1] == 0f) + { + this.defense = 10; + this.ai[2] += 1f; + if (this.ai[2] >= 800f) + { + this.ai[2] = 0f; + this.ai[1] = 1f; + this.TargetClosest(true); + this.netUpdate = true; + } + this.rotation = this.velocity.X / 15f; + if (this.position.Y > Main.player[this.target].position.Y - 250f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.98f; + } + this.velocity.Y = this.velocity.Y - 0.02f; + if (this.velocity.Y > 2f) + { + this.velocity.Y = 2f; + } + } + else + { + if (this.position.Y < Main.player[this.target].position.Y - 250f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.98f; + } + this.velocity.Y = this.velocity.Y + 0.02f; + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.velocity.X = this.velocity.X - 0.05f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.velocity.X = this.velocity.X + 0.05f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + else + { + if (this.ai[1] == 1f) + { + this.defense = 0; + this.ai[2] += 1f; + if (this.ai[2] == 2f) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + if (this.ai[2] >= 400f) + { + this.ai[2] = 0f; + this.ai[1] = 0f; + } + this.rotation += (float)this.direction * 0.3f; + Vector2 vector26 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num286 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector26.X; + float num287 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector26.Y; + float num288 = (float)Math.Sqrt((double)(num286 * num286 + num287 * num287)); + num288 = 1.5f / num288; + this.velocity.X = num286 * num288; + this.velocity.Y = num287 * num288; + } + else + { + if (this.ai[1] == 2f) + { + this.damage = 9999; + this.defense = 9999; + this.rotation += (float)this.direction * 0.3f; + Vector2 vector27 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num289 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector27.X; + float num290 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector27.Y; + float num291 = (float)Math.Sqrt((double)(num289 * num289 + num290 * num290)); + num291 = 8f / num291; + this.velocity.X = num289 * num291; + this.velocity.Y = num290 * num291; + } + else + { + if (this.ai[1] == 3f) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.X = this.velocity.X * 0.95f; + if (this.timeLeft > 500) + { + this.timeLeft = 500; + } + } + } + } + } + if (this.ai[1] != 2f && this.ai[1] != 3f && this.type != 68) + { + int num292 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) - 15f - this.velocity.X * 5f, this.position.Y + (float)this.height - 2f), 30, 10, 5, -this.velocity.X * 0.2f, 3f, 0, default(Color), 2f); + Main.dust[num292].noGravity = true; + Dust expr_11B42_cp_0 = Main.dust[num292]; + expr_11B42_cp_0.velocity.X = expr_11B42_cp_0.velocity.X * 1.3f; + Dust expr_11B62_cp_0 = Main.dust[num292]; + expr_11B62_cp_0.velocity.X = expr_11B62_cp_0.velocity.X + this.velocity.X * 0.4f; + Dust expr_11B8E_cp_0 = Main.dust[num292]; + expr_11B8E_cp_0.velocity.Y = expr_11B8E_cp_0.velocity.Y + (2f + this.velocity.Y); + for (int num293 = 0; num293 < 2; num293++) + { + num292 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 120f), this.width, 60, 5, this.velocity.X, this.velocity.Y, 0, default(Color), 2f); + Main.dust[num292].noGravity = true; + Main.dust[num292].velocity -= this.velocity; + Dust expr_11C51_cp_0 = Main.dust[num292]; + expr_11C51_cp_0.velocity.Y = expr_11C51_cp_0.velocity.Y + 5f; + } + return; + } + } + else + { + if (this.aiStyle == 12) + { + this.spriteDirection = -(int)this.ai[0]; + if (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != 11) + { + this.ai[2] += 10f; + if (this.ai[2] > 50f || Main.netMode != 2) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + } + } + if (this.ai[2] == 0f || this.ai[2] == 3f) + { + if (Main.npc[(int)this.ai[1]].ai[1] == 3f && this.timeLeft > 10) + { + this.timeLeft = 10; + } + if (Main.npc[(int)this.ai[1]].ai[1] != 0f) + { + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.07f; + if (this.velocity.Y > 6f) + { + this.velocity.Y = 6f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.07f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 120f * this.ai[0]) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 120f * this.ai[0]) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + else + { + this.ai[3] += 1f; + if (this.ai[3] >= 300f) + { + this.ai[2] += 1f; + this.ai[3] = 0f; + this.netUpdate = true; + } + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y + 230f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y + 230f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.04f; + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0]) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0]) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + Vector2 vector28 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num294 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector28.X; + float num295 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector28.Y; + Math.Sqrt((double)(num294 * num294 + num295 * num295)); + this.rotation = (float)Math.Atan2((double)num295, (double)num294) + 1.57f; + return; + } + if (this.ai[2] == 1f) + { + Vector2 vector29 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num296 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector29.X; + float num297 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector29.Y; + float num298 = (float)Math.Sqrt((double)(num296 * num296 + num297 * num297)); + this.rotation = (float)Math.Atan2((double)num297, (double)num296) + 1.57f; + this.velocity.X = this.velocity.X * 0.95f; + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y < -8f) + { + this.velocity.Y = -8f; + } + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 200f) + { + this.TargetClosest(true); + this.ai[2] = 2f; + vector29 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num296 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector29.X; + num297 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector29.Y; + num298 = (float)Math.Sqrt((double)(num296 * num296 + num297 * num297)); + num298 = 18f / num298; + this.velocity.X = num296 * num298; + this.velocity.Y = num297 * num298; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[2] == 2f) + { + if (this.position.Y > Main.player[this.target].position.Y || this.velocity.Y < 0f) + { + this.ai[2] = 3f; + return; + } + } + else + { + if (this.ai[2] == 4f) + { + Vector2 vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num299 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector30.X; + float num300 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector30.Y; + float num301 = (float)Math.Sqrt((double)(num299 * num299 + num300 * num300)); + this.rotation = (float)Math.Atan2((double)num300, (double)num299) + 1.57f; + this.velocity.Y = this.velocity.Y * 0.95f; + this.velocity.X = this.velocity.X + 0.1f * -this.ai[0]; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 500f || this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) + 500f) + { + this.TargetClosest(true); + this.ai[2] = 5f; + vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num299 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector30.X; + num300 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector30.Y; + num301 = (float)Math.Sqrt((double)(num299 * num299 + num300 * num300)); + num301 = 17f / num301; + this.velocity.X = num299 * num301; + this.velocity.Y = num300 * num301; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[2] == 5f && ((this.velocity.X > 0f && this.position.X + (float)(this.width / 2) > Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)) || (this.velocity.X < 0f && this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)))) + { + this.ai[2] = 0f; + return; + } + } + } + } + } + else + { + if (this.aiStyle == 13) + { + if (this.ai[0] < 0f || this.ai[0] >= (float)Main.maxTilesX || this.ai[1] < 0f || this.ai[1] >= (float)Main.maxTilesX) + { + return; + } + if (Main.tile[(int)this.ai[0], (int)this.ai[1]] == null) + { + Main.tile[(int)this.ai[0], (int)this.ai[1]] = new Tile(); + } + if (!Main.tile[(int)this.ai[0], (int)this.ai[1]].active()) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + return; + } + this.TargetClosest(true); + float num302 = 0.035f; + float num303 = 150f; + if (this.type == 43) + { + num303 = 250f; + } + if (this.type == 101) + { + num303 = 175f; + } + if (this.type == 259) + { + num303 = 100f; + } + if (this.type == 175) + { + num303 = 500f; + num302 = 0.05f; + } + if (this.type == 260) + { + num303 = 350f; + num302 = 0.15f; + } + this.ai[2] += 1f; + if (this.ai[2] > 300f) + { + num303 = (float)((int)((double)num303 * 1.3)); + if (this.ai[2] > 450f) + { + this.ai[2] = 0f; + } + } + Vector2 vector31 = new Vector2(this.ai[0] * 16f + 8f, this.ai[1] * 16f + 8f); + float num304 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - (float)(this.width / 2) - vector31.X; + float num305 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - (float)(this.height / 2) - vector31.Y; + float num306 = (float)Math.Sqrt((double)(num304 * num304 + num305 * num305)); + if (num306 > num303) + { + num306 = num303 / num306; + num304 *= num306; + num305 *= num306; + } + if (this.position.X < this.ai[0] * 16f + 8f + num304) + { + this.velocity.X = this.velocity.X + num302; + if (this.velocity.X < 0f && num304 > 0f) + { + this.velocity.X = this.velocity.X + num302 * 1.5f; + } + } + else + { + if (this.position.X > this.ai[0] * 16f + 8f + num304) + { + this.velocity.X = this.velocity.X - num302; + if (this.velocity.X > 0f && num304 < 0f) + { + this.velocity.X = this.velocity.X - num302 * 1.5f; + } + } + } + if (this.position.Y < this.ai[1] * 16f + 8f + num305) + { + this.velocity.Y = this.velocity.Y + num302; + if (this.velocity.Y < 0f && num305 > 0f) + { + this.velocity.Y = this.velocity.Y + num302 * 1.5f; + } + } + else + { + if (this.position.Y > this.ai[1] * 16f + 8f + num305) + { + this.velocity.Y = this.velocity.Y - num302; + if (this.velocity.Y > 0f && num305 < 0f) + { + this.velocity.Y = this.velocity.Y - num302 * 1.5f; + } + } + } + if (this.type == 43) + { + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + else + { + if (this.type == 175) + { + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + if (this.velocity.Y > 4f) + { + this.velocity.Y = 4f; + } + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + else + { + if (this.velocity.X > 2f) + { + this.velocity.X = 2f; + } + if (this.velocity.X < -2f) + { + this.velocity.X = -2f; + } + if (this.velocity.Y > 2f) + { + this.velocity.Y = 2f; + } + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + } + if (this.type == 259 || this.type == 260) + { + this.rotation = (float)Math.Atan2((double)num305, (double)num304) + 1.57f; + } + else + { + if (num304 > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)num305, (double)num304); + } + if (num304 < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)num305, (double)num304) + 3.14f; + } + } + if (this.collideX) + { + this.netUpdate = true; + this.velocity.X = this.oldVelocity.X * -0.7f; + if (this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.netUpdate = true; + this.velocity.Y = this.oldVelocity.Y * -0.7f; + if (this.velocity.Y > 0f && this.velocity.Y < 2f) + { + this.velocity.Y = 2f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -2f) + { + this.velocity.Y = -2f; + } + } + if (Main.netMode != 1) + { + if (this.type == 101 && !Main.player[this.target].dead) + { + if (this.justHit) + { + this.localAI[0] = 0f; + } + this.localAI[0] += 1f; + if (this.localAI[0] >= 120f) + { + if (!Collision.SolidCollision(this.position, this.width, this.height) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num307 = 10f; + vector31 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num304 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector31.X + (float)Main.rand.Next(-10, 11); + num305 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector31.Y + (float)Main.rand.Next(-10, 11); + num306 = (float)Math.Sqrt((double)(num304 * num304 + num305 * num305)); + num306 = num307 / num306; + num304 *= num306; + num305 *= num306; + int num308 = 22; + int num309 = 96; + int num310 = Projectile.NewProjectile(vector31.X, vector31.Y, num304, num305, num309, num308, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num310].timeLeft = 300; + this.localAI[0] = 0f; + } + else + { + this.localAI[0] = 100f; + } + } + } + if (this.type == 260 && !Main.player[this.target].dead) + { + if (this.justHit) + { + this.localAI[0] = 0f; + } + this.localAI[0] += 1f; + if (this.localAI[0] >= 150f) + { + if (!Collision.SolidCollision(this.position, this.width, this.height)) + { + float num311 = 14f; + vector31 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num304 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector31.X + (float)Main.rand.Next(-10, 11); + float num312 = Math.Abs(num304 * 0.1f); + if (num305 > 0f) + { + num312 = 0f; + } + num305 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector31.Y + (float)Main.rand.Next(-10, 11) - num312; + num306 = (float)Math.Sqrt((double)(num304 * num304 + num305 * num305)); + num306 = num311 / num306; + num304 *= num306; + num305 *= num306; + int num313 = NPC.NewNPC((int)this.center().X, (int)this.center().Y, 261, 0); + Main.npc[num313].velocity.X = num304; + Main.npc[num313].velocity.Y = num305; + Main.npc[num313].netUpdate = true; + this.localAI[0] = 0f; + return; + } + this.localAI[0] = 250f; + return; + } + } + } + } + else + { + if (this.aiStyle == 14) + { + if (this.type == 60 || this.type == 151) + { + int num314 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num314].noGravity = true; + } + if (this.type == 150 && Main.rand.Next(10) == 0) + { + int num315 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 90, default(Color), 1.5f); + Main.dust[num315].noGravity = true; + Main.dust[num315].velocity *= 0.2f; + Main.dust[num315].noLight = true; + } + this.noGravity = true; + if (this.collideX) + { + this.velocity.X = this.oldVelocity.X * -0.5f; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.velocity.Y = this.oldVelocity.Y * -0.5f; + if (this.velocity.Y > 0f && this.velocity.Y < 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -1f) + { + this.velocity.Y = -1f; + } + } + if (this.type == 226) + { + int num316 = 1; + int num317 = 1; + if (this.velocity.X < 0f) + { + num316 = -1; + } + if (this.velocity.Y < 0f) + { + num317 = -1; + } + this.TargetClosest(true); + if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.direction = num316; + this.directionY = num317; + } + } + else + { + this.TargetClosest(true); + } + if (this.type == 158) + { + if ((double)this.position.Y < Main.worldSurface * 16.0 && Main.dayTime && !Main.eclipse) + { + this.directionY = -1; + this.direction *= -1; + } + if (this.direction == -1 && this.velocity.X > -7f) + { + this.velocity.X = this.velocity.X - 0.2f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -7f) + { + this.velocity.X = -7f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 7f) + { + this.velocity.X = this.velocity.X + 0.2f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > 7f) + { + this.velocity.X = 7f; + } + } + } + if (this.directionY == -1 && this.velocity.Y > -7f) + { + this.velocity.Y = this.velocity.Y - 0.2f; + if (this.velocity.Y > 4f) + { + this.velocity.Y = this.velocity.Y - 0.1f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + } + if (this.velocity.Y < -7f) + { + this.velocity.Y = -7f; + } + } + else + { + if (this.directionY == 1 && this.velocity.Y < 7f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + } + if (this.velocity.Y > 7f) + { + this.velocity.Y = 7f; + } + } + } + } + else + { + if (this.type == 226) + { + if (this.direction == -1 && this.velocity.X > -4f) + { + this.velocity.X = this.velocity.X - 0.2f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 4f) + { + this.velocity.X = this.velocity.X + 0.2f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -2.5) + { + this.velocity.Y = this.velocity.Y - 0.1f; + if ((double)this.velocity.Y > 2.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + } + if ((double)this.velocity.Y < -2.5) + { + this.velocity.Y = -2.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 2.5) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if ((double)this.velocity.Y < -2.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + } + if ((double)this.velocity.Y > 2.5) + { + this.velocity.Y = 2.5f; + } + } + } + } + else + { + if (this.direction == -1 && this.velocity.X > -4f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 4f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + } + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = -1.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + } + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = 1.5f; + } + } + } + } + } + if (this.type == 49 || this.type == 51 || this.type == 60 || this.type == 62 || this.type == 66 || this.type == 93 || this.type == 137 || this.type == 150 || this.type == 151 || this.type == 152) + { + if (this.wet) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + this.TargetClosest(true); + } + if (this.type == 60) + { + if (this.direction == -1 && this.velocity.X > -4f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.07f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.03f; + } + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 4f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.07f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.03f; + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.02f; + } + } + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = -1.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.02f; + } + } + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = 1.5f; + } + } + } + } + else + { + if (this.direction == -1 && this.velocity.X > -4f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 4f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 4f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -4f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + } + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = -1.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + } + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = 1.5f; + } + } + } + } + } + if (this.type == 158 && Main.netMode != 1) + { + Vector2 vector32 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num318 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector32.X; + float num319 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector32.Y; + float num320 = (float)Math.Sqrt((double)(num318 * num318 + num319 * num319)); + if (num320 < 200f && this.position.Y + (float)this.height < Main.player[this.target].position.Y + (float)Main.player[this.target].height && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.Transform(159); + } + } + this.ai[1] += 1f; + if (this.type == 158) + { + this.ai[1] += 1f; + } + if (this.ai[1] > 200f) + { + if (!Main.player[this.target].wet && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.ai[1] = 0f; + } + float num321 = 0.2f; + float num322 = 0.1f; + float num323 = 4f; + float num324 = 1.5f; + if (this.type == 48 || this.type == 62 || this.type == 66) + { + num321 = 0.12f; + num322 = 0.07f; + num323 = 3f; + num324 = 1.25f; + } + if (this.ai[1] > 1000f) + { + this.ai[1] = 0f; + } + this.ai[2] += 1f; + if (this.ai[2] > 0f) + { + if (this.velocity.Y < num324) + { + this.velocity.Y = this.velocity.Y + num322; + } + } + else + { + if (this.velocity.Y > -num324) + { + this.velocity.Y = this.velocity.Y - num322; + } + } + if (this.ai[2] < -150f || this.ai[2] > 150f) + { + if (this.velocity.X < num323) + { + this.velocity.X = this.velocity.X + num321; + } + } + else + { + if (this.velocity.X > -num323) + { + this.velocity.X = this.velocity.X - num321; + } + } + if (this.ai[2] > 300f) + { + this.ai[2] = -300f; + } + } + if (Main.netMode != 1) + { + if (this.type == 48) + { + this.ai[0] += 1f; + if (this.ai[0] == 30f || this.ai[0] == 60f || this.ai[0] == 90f) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num325 = 6f; + Vector2 vector33 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num326 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector33.X + (float)Main.rand.Next(-100, 101); + float num327 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector33.Y + (float)Main.rand.Next(-100, 101); + float num328 = (float)Math.Sqrt((double)(num326 * num326 + num327 * num327)); + num328 = num325 / num328; + num326 *= num328; + num327 *= num328; + int num329 = 15; + int num330 = 38; + int num331 = Projectile.NewProjectile(vector33.X, vector33.Y, num326, num327, num330, num329, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num331].timeLeft = 300; + } + } + else + { + if (this.ai[0] >= (float)(400 + Main.rand.Next(400))) + { + this.ai[0] = 0f; + } + } + } + if (this.type == 62 || this.type == 66) + { + this.ai[0] += 1f; + if (this.ai[0] == 20f || this.ai[0] == 40f || this.ai[0] == 60f || this.ai[0] == 80f) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num332 = 0.2f; + Vector2 vector34 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num333 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector34.X + (float)Main.rand.Next(-100, 101); + float num334 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector34.Y + (float)Main.rand.Next(-100, 101); + float num335 = (float)Math.Sqrt((double)(num333 * num333 + num334 * num334)); + num335 = num332 / num335; + num333 *= num335; + num334 *= num335; + int num336 = 21; + int num337 = 44; + int num338 = Projectile.NewProjectile(vector34.X, vector34.Y, num333, num334, num337, num336, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num338].timeLeft = 300; + } + } + else + { + if (this.ai[0] >= (float)(300 + Main.rand.Next(300))) + { + this.ai[0] = 0f; + } + } + } + if (this.type == 156) + { + this.ai[0] += 1f; + if (this.ai[0] == 20f || this.ai[0] == 40f || this.ai[0] == 60f || this.ai[0] == 80f || this.ai[0] == 100f) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num339 = 0.2f; + Vector2 value = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num340 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - value.X + (float)Main.rand.Next(-50, 51); + float num341 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - value.Y + (float)Main.rand.Next(-50, 51); + float num342 = (float)Math.Sqrt((double)(num340 * num340 + num341 * num341)); + num342 = num339 / num342; + num340 *= num342; + num341 *= num342; + int num343 = 80; + int num344 = 115; + value += this.velocity * 5f; + int num345 = Projectile.NewProjectile(value.X + num340 * 100f, value.Y + num341 * 100f, num340, num341, num344, num343, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num345].timeLeft = 300; + return; + } + } + else + { + if (this.ai[0] >= (float)(250 + Main.rand.Next(250))) + { + this.ai[0] = 0f; + return; + } + } + } + } + } + else + { + if (this.aiStyle == 15) + { + this.aiAction = 0; + if (this.ai[3] == 0f && this.life > 0) + { + this.ai[3] = (float)this.lifeMax; + } + if (this.ai[2] == 0f) + { + this.ai[0] = -100f; + this.ai[2] = 1f; + this.TargetClosest(true); + } + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.8f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + this.ai[0] += 2f; + if ((double)this.life < (double)this.lifeMax * 0.8) + { + this.ai[0] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.6) + { + this.ai[0] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.4) + { + this.ai[0] += 2f; + } + if ((double)this.life < (double)this.lifeMax * 0.2) + { + this.ai[0] += 3f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + this.ai[0] += 4f; + } + if (this.ai[0] >= 0f) + { + this.netUpdate = true; + this.TargetClosest(true); + if (this.ai[1] == 3f) + { + this.velocity.Y = -13f; + this.velocity.X = this.velocity.X + 3.5f * (float)this.direction; + this.ai[0] = -200f; + this.ai[1] = 0f; + } + else + { + if (this.ai[1] == 2f) + { + this.velocity.Y = -6f; + this.velocity.X = this.velocity.X + 4.5f * (float)this.direction; + this.ai[0] = -120f; + this.ai[1] += 1f; + } + else + { + this.velocity.Y = -8f; + this.velocity.X = this.velocity.X + 4f * (float)this.direction; + this.ai[0] = -120f; + this.ai[1] += 1f; + } + } + } + else + { + if (this.ai[0] >= -30f) + { + this.aiAction = 1; + } + } + } + else + { + if (this.target < 255 && ((this.direction == 1 && this.velocity.X < 3f) || (this.direction == -1 && this.velocity.X > -3f))) + { + if ((this.direction == -1 && (double)this.velocity.X < 0.1) || (this.direction == 1 && (double)this.velocity.X > -0.1)) + { + this.velocity.X = this.velocity.X + 0.2f * (float)this.direction; + } + else + { + this.velocity.X = this.velocity.X * 0.93f; + } + } + } + int num346 = Dust.NewDust(this.position, this.width, this.height, 4, this.velocity.X, this.velocity.Y, 255, new Color(0, 80, 255, 80), this.scale * 1.2f); + Main.dust[num346].noGravity = true; + Main.dust[num346].velocity *= 0.5f; + if (this.life > 0) + { + float num347 = (float)this.life / (float)this.lifeMax; + num347 = num347 * 0.5f + 0.75f; + if (num347 != this.scale) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)this.height; + this.scale = num347; + this.width = (int)(98f * this.scale); + this.height = (int)(92f * this.scale); + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)this.height; + } + if (Main.netMode != 1) + { + int num348 = (int)((double)this.lifeMax * 0.05); + if ((float)(this.life + num348) < this.ai[3]) + { + this.ai[3] = (float)this.life; + int num349 = Main.rand.Next(1, 4); + for (int num350 = 0; num350 < num349; num350++) + { + int x = (int)(this.position.X + (float)Main.rand.Next(this.width - 32)); + int y = (int)(this.position.Y + (float)Main.rand.Next(this.height - 32)); + int num351 = NPC.NewNPC(x, y, 1, 0); + Main.npc[num351].SetDefaults(1, -1f); + Main.npc[num351].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; + Main.npc[num351].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; + Main.npc[num351].ai[1] = (float)Main.rand.Next(3); + if (Main.netMode == 2 && num351 < 200) + { + NetMessage.SendData(23, -1, -1, "", num351, 0f, 0f, 0f, 0); + } + } + return; + } + } + } + } + else + { + if (this.aiStyle == 16) + { + if (this.direction == 0) + { + this.TargetClosest(true); + } + if (this.wet) + { + bool flag29 = false; + if (this.type != 55) + { + this.TargetClosest(false); + if (Main.player[this.target].wet && !Main.player[this.target].dead) + { + flag29 = true; + } + } + if (!flag29) + { + if (this.collideX) + { + this.velocity.X = this.velocity.X * -1f; + this.direction *= -1; + this.netUpdate = true; + } + if (this.collideY) + { + this.netUpdate = true; + if (this.velocity.Y > 0f) + { + this.velocity.Y = Math.Abs(this.velocity.Y) * -1f; + this.directionY = -1; + this.ai[0] = -1f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = Math.Abs(this.velocity.Y); + this.directionY = 1; + this.ai[0] = 1f; + } + } + } + } + if (this.type == 102) + { + Lighting.addLight((int)(this.position.X + (float)(this.width / 2) + (float)(this.direction * (this.width + 8))) / 16, (int)(this.position.Y + 2f) / 16, 0.07f, 0.04f, 0.025f); + } + if (flag29) + { + this.TargetClosest(true); + if (this.type == 157) + { + if (this.velocity.X > 0f && this.direction < 0) + { + this.velocity.X = this.velocity.X * 0.95f; + } + if (this.velocity.X < 0f && this.direction > 0) + { + this.velocity.X = this.velocity.X * 0.95f; + } + this.velocity.X = this.velocity.X + (float)this.direction * 0.25f; + this.velocity.Y = this.velocity.Y + (float)this.directionY * 0.2f; + if (this.velocity.X > 8f) + { + this.velocity.X = 7f; + } + if (this.velocity.X < -8f) + { + this.velocity.X = -7f; + } + if (this.velocity.Y > 5f) + { + this.velocity.Y = 4f; + } + if (this.velocity.Y < -5f) + { + this.velocity.Y = -4f; + } + } + else + { + if (this.type == 65 || this.type == 102) + { + this.velocity.X = this.velocity.X + (float)this.direction * 0.15f; + this.velocity.Y = this.velocity.Y + (float)this.directionY * 0.15f; + if (this.velocity.X > 5f) + { + this.velocity.X = 5f; + } + if (this.velocity.X < -5f) + { + this.velocity.X = -5f; + } + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + else + { + this.velocity.X = this.velocity.X + (float)this.direction * 0.1f; + this.velocity.Y = this.velocity.Y + (float)this.directionY * 0.1f; + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + if (this.velocity.Y > 2f) + { + this.velocity.Y = 2f; + } + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + } + } + else + { + if (this.type == 157) + { + if (Main.player[this.target].position.Y > this.position.Y) + { + this.directionY = 1; + } + else + { + this.directionY = -1; + } + this.velocity.X = this.velocity.X + (float)this.direction * 0.2f; + if (this.velocity.X < -2f || this.velocity.X > 2f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + if (this.ai[0] == -1f) + { + float num352 = -0.6f; + if (this.directionY < 0) + { + num352 = -1f; + } + if (this.directionY > 0) + { + num352 = -0.2f; + } + this.velocity.Y = this.velocity.Y - 0.02f; + if (this.velocity.Y < num352) + { + this.ai[0] = 1f; + } + } + else + { + float num353 = 0.6f; + if (this.directionY < 0) + { + num353 = 0.2f; + } + if (this.directionY > 0) + { + num353 = 1f; + } + this.velocity.Y = this.velocity.Y + 0.02f; + if (this.velocity.Y > num353) + { + this.ai[0] = -1f; + } + } + } + else + { + this.velocity.X = this.velocity.X + (float)this.direction * 0.1f; + if (this.velocity.X < -1f || this.velocity.X > 1f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + if (this.ai[0] == -1f) + { + this.velocity.Y = this.velocity.Y - 0.01f; + if ((double)this.velocity.Y < -0.3) + { + this.ai[0] = 1f; + } + } + else + { + this.velocity.Y = this.velocity.Y + 0.01f; + if ((double)this.velocity.Y > 0.3) + { + this.ai[0] = -1f; + } + } + } + int num354 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num355 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (Main.tile[num354, num355 - 1] == null) + { + Main.tile[num354, num355 - 1] = new Tile(); + } + if (Main.tile[num354, num355 + 1] == null) + { + Main.tile[num354, num355 + 1] = new Tile(); + } + if (Main.tile[num354, num355 + 2] == null) + { + Main.tile[num354, num355 + 2] = new Tile(); + } + if (Main.tile[num354, num355 - 1].liquid > 128) + { + if (Main.tile[num354, num355 + 1].active()) + { + this.ai[0] = -1f; + } + else + { + if (Main.tile[num354, num355 + 2].active()) + { + this.ai[0] = -1f; + } + } + } + if (this.type != 157 && ((double)this.velocity.Y > 0.4 || (double)this.velocity.Y < -0.4)) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + } + } + else + { + if (this.velocity.Y == 0f) + { + if (this.type == 65) + { + this.velocity.X = this.velocity.X * 0.94f; + if ((double)this.velocity.X > -0.2 && (double)this.velocity.X < 0.2) + { + this.velocity.X = 0f; + } + } + else + { + if (Main.netMode != 1) + { + this.velocity.Y = (float)Main.rand.Next(-50, -20) * 0.1f; + this.velocity.X = (float)Main.rand.Next(-20, 20) * 0.1f; + this.netUpdate = true; + } + } + } + this.velocity.Y = this.velocity.Y + 0.3f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + } + this.ai[0] = 1f; + } + this.rotation = this.velocity.Y * (float)this.direction * 0.1f; + if ((double)this.rotation < -0.2) + { + this.rotation = -0.2f; + } + if ((double)this.rotation > 0.2) + { + this.rotation = 0.2f; + return; + } + } + else + { + if (this.aiStyle == 17) + { + this.noGravity = true; + if (this.ai[0] == 0f) + { + this.noGravity = false; + this.TargetClosest(true); + if (Main.netMode != 1) + { + if (this.velocity.X != 0f || this.velocity.Y < 0f || (double)this.velocity.Y > 0.3) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + else + { + Rectangle rectangle5 = new Rectangle((int)Main.player[this.target].position.X, (int)Main.player[this.target].position.Y, Main.player[this.target].width, Main.player[this.target].height); + Rectangle rectangle6 = new Rectangle((int)this.position.X - 100, (int)this.position.Y - 100, this.width + 200, this.height + 200); + if (rectangle6.Intersects(rectangle5) || this.life < this.lifeMax) + { + this.ai[0] = 1f; + this.velocity.Y = this.velocity.Y - 6f; + this.netUpdate = true; + } + } + } + } + else + { + if (!Main.player[this.target].dead) + { + if (this.collideX) + { + this.velocity.X = this.oldVelocity.X * -0.5f; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.velocity.Y = this.oldVelocity.Y * -0.5f; + if (this.velocity.Y > 0f && this.velocity.Y < 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -1f) + { + this.velocity.Y = -1f; + } + } + this.TargetClosest(true); + if (this.direction == -1 && this.velocity.X > -3f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 3f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 3f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -3f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + } + } + float num356 = Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))); + float num357 = Main.player[this.target].position.Y - (float)(this.height / 2); + if (num356 > 50f) + { + num357 -= 100f; + } + if (this.position.Y < num357) + { + this.velocity.Y = this.velocity.Y + 0.05f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.01f; + } + } + else + { + this.velocity.Y = this.velocity.Y - 0.05f; + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.01f; + } + } + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + } + if (this.wet) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + this.TargetClosest(true); + return; + } + } + else + { + if (this.aiStyle == 18) + { + if (this.type == 63) + { + Lighting.addLight((int)(this.position.X + (float)(this.height / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.05f, 0.15f, 0.4f); + } + else + { + if (this.type == 103) + { + Lighting.addLight((int)(this.position.X + (float)(this.height / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.05f, 0.45f, 0.1f); + } + else + { + if (this.type != 221 && this.type != 242) + { + Lighting.addLight((int)(this.position.X + (float)(this.height / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.35f, 0.05f, 0.2f); + } + } + } + if (this.direction == 0) + { + this.TargetClosest(true); + } + if (!this.wet) + { + this.rotation += this.velocity.X * 0.1f; + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01) + { + this.velocity.X = 0f; + } + } + this.velocity.Y = this.velocity.Y + 0.2f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + } + this.ai[0] = 1f; + return; + } + if (this.collideX) + { + this.velocity.X = this.velocity.X * -1f; + this.direction *= -1; + } + if (this.collideY) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = Math.Abs(this.velocity.Y) * -1f; + this.directionY = -1; + this.ai[0] = -1f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = Math.Abs(this.velocity.Y); + this.directionY = 1; + this.ai[0] = 1f; + } + } + } + bool flag30 = false; + if (!this.friendly) + { + this.TargetClosest(false); + if (Main.player[this.target].wet && !Main.player[this.target].dead) + { + flag30 = true; + } + } + if (flag30) + { + this.localAI[2] = 1f; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + this.velocity *= 0.98f; + float num358 = 0.2f; + if (this.type == 103) + { + this.velocity *= 0.98f; + num358 = 0.6f; + } + if (this.type == 221) + { + this.velocity *= 0.99f; + num358 = 1f; + } + if (this.type == 242) + { + this.velocity *= 0.995f; + num358 = 3f; + } + if (this.velocity.X > -num358 && this.velocity.X < num358 && this.velocity.Y > -num358 && this.velocity.Y < num358) + { + if (this.type == 221) + { + this.localAI[0] = 1f; + } + this.TargetClosest(true); + float num359 = 7f; + if (this.type == 103) + { + num359 = 9f; + } + Vector2 vector35 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num360 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector35.X; + float num361 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector35.Y; + float num362 = (float)Math.Sqrt((double)(num360 * num360 + num361 * num361)); + num362 = num359 / num362; + num360 *= num362; + num361 *= num362; + this.velocity.X = num360; + this.velocity.Y = num361; + return; + } + } + else + { + this.localAI[2] = 0f; + this.velocity.X = this.velocity.X + (float)this.direction * 0.02f; + this.rotation = this.velocity.X * 0.4f; + if (this.velocity.X < -1f || this.velocity.X > 1f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + if (this.ai[0] == -1f) + { + this.velocity.Y = this.velocity.Y - 0.01f; + if (this.velocity.Y < -1f) + { + this.ai[0] = 1f; + } + } + else + { + this.velocity.Y = this.velocity.Y + 0.01f; + if (this.velocity.Y > 1f) + { + this.ai[0] = -1f; + } + } + int num363 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num364 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (Main.tile[num363, num364 - 1] == null) + { + Main.tile[num363, num364 - 1] = new Tile(); + } + if (Main.tile[num363, num364 + 1] == null) + { + Main.tile[num363, num364 + 1] = new Tile(); + } + if (Main.tile[num363, num364 + 2] == null) + { + Main.tile[num363, num364 + 2] = new Tile(); + } + if (Main.tile[num363, num364 - 1].liquid > 128) + { + if (Main.tile[num363, num364 + 1].active()) + { + this.ai[0] = -1f; + } + else + { + if (Main.tile[num363, num364 + 2].active()) + { + this.ai[0] = -1f; + } + } + } + else + { + this.ai[0] = 1f; + } + if ((double)this.velocity.Y > 1.2 || (double)this.velocity.Y < -1.2) + { + this.velocity.Y = this.velocity.Y * 0.99f; + return; + } + } + } + else + { + if (this.aiStyle == 19) + { + this.TargetClosest(true); + float num365 = 12f; + Vector2 vector36 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num366 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector36.X; + float num367 = Main.player[this.target].position.Y - vector36.Y; + float num368 = (float)Math.Sqrt((double)(num366 * num366 + num367 * num367)); + num368 = num365 / num368; + num366 *= num368; + num367 *= num368; + bool flag31 = false; + if (this.directionY < 0) + { + this.rotation = (float)(Math.Atan2((double)num367, (double)num366) + 1.57); + flag31 = ((double)this.rotation >= -1.2 && (double)this.rotation <= 1.2); + if ((double)this.rotation < -0.8) + { + this.rotation = -0.8f; + } + else + { + if ((double)this.rotation > 0.8) + { + this.rotation = 0.8f; + } + } + if (this.velocity.X != 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + if ((double)this.velocity.X > -0.1 || (double)this.velocity.X < 0.1) + { + this.netUpdate = true; + this.velocity.X = 0f; + } + } + } + if (this.ai[0] > 0f) + { + if (this.ai[0] == 200f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 5); + } + this.ai[0] -= 1f; + } + if (Main.netMode != 1 && flag31 && this.ai[0] == 0f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.ai[0] = 200f; + int num369 = 10; + int num370 = 31; + int num371 = Projectile.NewProjectile(vector36.X, vector36.Y, num366, num367, num370, num369, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num371].ai[0] = 2f; + Main.projectile[num371].timeLeft = 300; + Main.projectile[num371].friendly = false; + NetMessage.SendData(27, -1, -1, "", num371, 0f, 0f, 0f, 0); + this.netUpdate = true; + } + try + { + int num372 = (int)this.position.X / 16; + int num373 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num374 = (int)(this.position.X + (float)this.width) / 16; + int num375 = (int)(this.position.Y + (float)this.height) / 16; + bool flag32 = false; + if (Main.tile[num372, num375] == null) + { + Main.tile[num372, num375] = new Tile(); + } + if (Main.tile[num373, num375] == null) + { + Main.tile[num372, num375] = new Tile(); + } + if (Main.tile[num374, num375] == null) + { + Main.tile[num372, num375] = new Tile(); + } + if ((Main.tile[num372, num375].nactive() && Main.tileSolid[(int)Main.tile[num372, num375].type]) || (Main.tile[num373, num375].nactive() && Main.tileSolid[(int)Main.tile[num373, num375].type]) || (Main.tile[num374, num375].nactive() && Main.tileSolid[(int)Main.tile[num374, num375].type])) + { + flag32 = true; + } + if (flag32) + { + this.noGravity = true; + this.noTileCollide = true; + this.velocity.Y = -0.2f; + } + else + { + this.noGravity = false; + this.noTileCollide = false; + if (Main.rand.Next(2) == 0) + { + int num376 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height - 8f), this.width + 8, 24, 32, 0f, this.velocity.Y / 2f, 0, default(Color), 1f); + Dust expr_17B8A_cp_0 = Main.dust[num376]; + expr_17B8A_cp_0.velocity.X = expr_17B8A_cp_0.velocity.X * 0.4f; + Dust expr_17BAA_cp_0 = Main.dust[num376]; + expr_17BAA_cp_0.velocity.Y = expr_17BAA_cp_0.velocity.Y * -1f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num376].noGravity = true; + Main.dust[num376].scale += 0.2f; + } + } + } + return; + } + catch + { + return; + } + } + if (this.aiStyle == 20) + { + if (this.ai[0] == 0f) + { + if (Main.netMode != 1) + { + this.TargetClosest(true); + this.direction *= -1; + this.directionY *= -1; + this.position.Y = this.position.Y + (float)(this.height / 2 + 8); + this.ai[1] = this.position.X + (float)(this.width / 2); + this.ai[2] = this.position.Y + (float)(this.height / 2); + if (this.direction == 0) + { + this.direction = 1; + } + if (this.directionY == 0) + { + this.directionY = 1; + } + this.ai[3] = 1f + (float)Main.rand.Next(15) * 0.1f; + this.velocity.Y = (float)(this.directionY * 6) * this.ai[3]; + this.ai[0] += 1f; + this.netUpdate = true; + return; + } + this.ai[1] = this.position.X + (float)(this.width / 2); + this.ai[2] = this.position.Y + (float)(this.height / 2); + return; + } + else + { + float num377 = 6f * this.ai[3]; + float num378 = 0.2f * this.ai[3]; + float num379 = num377 / num378 / 2f; + if (this.ai[0] >= 1f && this.ai[0] < (float)((int)num379)) + { + this.velocity.Y = (float)this.directionY * num377; + this.ai[0] += 1f; + return; + } + if (this.ai[0] >= (float)((int)num379)) + { + this.velocity.Y = 0f; + this.directionY *= -1; + this.velocity.X = num377 * (float)this.direction; + this.ai[0] = -1f; + return; + } + if (this.directionY > 0) + { + if (this.velocity.Y >= num377) + { + this.directionY *= -1; + this.velocity.Y = num377; + } + } + else + { + if (this.directionY < 0 && this.velocity.Y <= -num377) + { + this.directionY *= -1; + this.velocity.Y = -num377; + } + } + if (this.direction > 0) + { + if (this.velocity.X >= num377) + { + this.direction *= -1; + this.velocity.X = num377; + } + } + else + { + if (this.direction < 0 && this.velocity.X <= -num377) + { + this.direction *= -1; + this.velocity.X = -num377; + } + } + this.velocity.X = this.velocity.X + num378 * (float)this.direction; + this.velocity.Y = this.velocity.Y + num378 * (float)this.directionY; + return; + } + } + else + { + if (this.aiStyle == 21) + { + if (this.ai[0] == 0f) + { + this.TargetClosest(true); + this.directionY = 1; + this.ai[0] = 1f; + } + int num380 = 6; + if (this.ai[1] == 0f) + { + this.rotation += (float)(this.direction * this.directionY) * 0.13f; + if (this.collideY) + { + this.ai[0] = 2f; + } + if (!this.collideY && this.ai[0] == 2f) + { + this.direction = -this.direction; + this.ai[1] = 1f; + this.ai[0] = 1f; + } + if (this.collideX) + { + this.directionY = -this.directionY; + this.ai[1] = 1f; + } + } + else + { + this.rotation -= (float)(this.direction * this.directionY) * 0.13f; + if (this.collideX) + { + this.ai[0] = 2f; + } + if (!this.collideX && this.ai[0] == 2f) + { + this.directionY = -this.directionY; + this.ai[1] = 0f; + this.ai[0] = 1f; + } + if (this.collideY) + { + this.direction = -this.direction; + this.ai[1] = 0f; + } + } + this.velocity.X = (float)(num380 * this.direction); + this.velocity.Y = (float)(num380 * this.directionY); + float num381 = (float)(270 - (int)Main.mouseTextColor) / 400f; + Lighting.addLight((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.9f, 0.3f + num381, 0.2f); + return; + } + if (this.aiStyle == 22) + { + bool flag33 = false; + if (this.justHit) + { + this.ai[2] = 0f; + } + if (this.ai[2] >= 0f) + { + int num382 = 16; + bool flag34 = false; + bool flag35 = false; + if (this.position.X > this.ai[0] - (float)num382 && this.position.X < this.ai[0] + (float)num382) + { + flag34 = true; + } + else + { + if ((this.velocity.X < 0f && this.direction > 0) || (this.velocity.X > 0f && this.direction < 0)) + { + flag34 = true; + } + } + num382 += 24; + if (this.position.Y > this.ai[1] - (float)num382 && this.position.Y < this.ai[1] + (float)num382) + { + flag35 = true; + } + if (flag34 && flag35) + { + this.ai[2] += 1f; + if (this.ai[2] >= 30f && num382 == 16) + { + flag33 = true; + } + if (this.ai[2] >= 60f) + { + this.ai[2] = -200f; + this.direction *= -1; + this.velocity.X = this.velocity.X * -1f; + this.collideX = false; + } + } + else + { + this.ai[0] = this.position.X; + this.ai[1] = this.position.Y; + this.ai[2] = 0f; + } + this.TargetClosest(true); + } + else + { + if (this.type == 253) + { + this.TargetClosest(true); + this.ai[2] += 2f; + } + else + { + this.ai[2] += 1f; + if (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) > this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + } + } + int num383 = (int)((this.position.X + (float)(this.width / 2)) / 16f) + this.direction * 2; + int num384 = (int)((this.position.Y + (float)this.height) / 16f); + bool flag36 = true; + bool flag37 = false; + int num385 = 3; + if (this.type == 122) + { + if (this.justHit) + { + this.ai[3] = 0f; + this.localAI[1] = 0f; + } + float num386 = 7f; + Vector2 vector37 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num387 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector37.X; + float num388 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector37.Y; + float num389 = (float)Math.Sqrt((double)(num387 * num387 + num388 * num388)); + num389 = num386 / num389; + num387 *= num389; + num388 *= num389; + if (Main.netMode != 1 && this.ai[3] == 32f) + { + int num390 = 25; + int num391 = 84; + Projectile.NewProjectile(vector37.X, vector37.Y, num387, num388, num391, num390, 0f, Main.myPlayer, 0f, 0f); + } + num385 = 8; + if (this.ai[3] > 0f) + { + this.ai[3] += 1f; + if (this.ai[3] >= 64f) + { + this.ai[3] = 0f; + } + } + if (Main.netMode != 1 && this.ai[3] == 0f) + { + this.localAI[1] += 1f; + if (this.localAI[1] > 120f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.localAI[1] = 0f; + this.ai[3] = 1f; + this.netUpdate = true; + } + } + } + else + { + if (this.type == 75) + { + num385 = 4; + if (Main.rand.Next(6) == 0) + { + int num392 = Dust.NewDust(this.position, this.width, this.height, 55, 0f, 0f, 200, this.color, 1f); + Main.dust[num392].velocity *= 0.3f; + } + if (Main.rand.Next(40) == 0) + { + Main.PlaySound(27, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + if (this.type == 169) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0f, 0.6f, 0.75f); + this.alpha = 30; + if (Main.rand.Next(3) == 0) + { + int num393 = Dust.NewDust(this.position, this.width, this.height, 92, 0f, 0f, 200, default(Color), 1f); + Main.dust[num393].velocity *= 0.3f; + Main.dust[num393].noGravity = true; + } + if (this.justHit) + { + this.ai[3] = 0f; + this.localAI[1] = 0f; + } + float num394 = 5f; + Vector2 vector38 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num395 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector38.X; + float num396 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector38.Y; + float num397 = (float)Math.Sqrt((double)(num395 * num395 + num396 * num396)); + num397 = num394 / num397; + num395 *= num397; + num396 *= num397; + if (num395 > 0f) + { + this.direction = 1; + } + else + { + this.direction = -1; + } + this.spriteDirection = this.direction; + if (this.direction < 0) + { + this.rotation = (float)Math.Atan2((double)(-(double)num396), (double)(-(double)num395)); + } + else + { + this.rotation = (float)Math.Atan2((double)num396, (double)num395); + } + if (Main.netMode != 1 && this.ai[3] == 16f) + { + int num398 = 45; + int num399 = 128; + Projectile.NewProjectile(vector38.X, vector38.Y, num395, num396, num399, num398, 0f, Main.myPlayer, 0f, 0f); + } + num385 = 10; + if (this.ai[3] > 0f) + { + this.ai[3] += 1f; + if (this.ai[3] >= 64f) + { + this.ai[3] = 0f; + } + } + if (Main.netMode != 1 && this.ai[3] == 0f) + { + this.localAI[1] += 1f; + if (this.localAI[1] > 120f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.localAI[1] = 0f; + this.ai[3] = 1f; + this.netUpdate = true; + } + } + } + else + { + if (this.type == 268) + { + this.rotation = this.velocity.X * 0.1f; + if (Main.player[this.target].center().Y < this.center().Y) + { + num385 = 12; + } + else + { + num385 = 6; + } + if (Main.netMode != 1 && !this.confused) + { + this.ai[3] += 1f; + if (this.justHit) + { + this.ai[3] = -45f; + this.localAI[1] = 0f; + } + if (Main.netMode != 1 && this.ai[3] >= (float)(60 + Main.rand.Next(60))) + { + this.ai[3] = 0f; + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].head)) + { + float num400 = 10f; + Vector2 vector39 = new Vector2(this.position.X + (float)this.width * 0.5f - 4f, this.position.Y + (float)this.height * 0.7f); + float num401 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector39.X; + float num402 = Math.Abs(num401) * 0.1f; + float num403 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector39.Y - num402; + num401 += (float)Main.rand.Next(-10, 11); + num403 += (float)Main.rand.Next(-30, 21); + float num404 = (float)Math.Sqrt((double)(num401 * num401 + num403 * num403)); + num404 = num400 / num404; + num401 *= num404; + num403 *= num404; + int num405 = 40; + int num406 = 288; + Projectile.NewProjectile(vector39.X, vector39.Y, num401, num403, num406, num405, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + } + } + } + for (int num407 = num384; num407 < num384 + num385; num407++) + { + if (Main.tile[num383, num407] == null) + { + Main.tile[num383, num407] = new Tile(); + } + if ((Main.tile[num383, num407].nactive() && Main.tileSolid[(int)Main.tile[num383, num407].type]) || Main.tile[num383, num407].liquid > 0) + { + if (num407 <= num384 + 1) + { + flag37 = true; + } + flag36 = false; + break; + } + } + if (this.type == 169 || this.type == 268) + { + for (int num408 = num384 - 3; num408 < num384; num408++) + { + if (Main.tile[num383, num408] == null) + { + Main.tile[num383, num408] = new Tile(); + } + if ((Main.tile[num383, num408].nactive() && Main.tileSolid[(int)Main.tile[num383, num408].type]) || Main.tile[num383, num408].liquid > 0) + { + flag37 = false; + flag33 = true; + break; + } + } + } + if (flag33) + { + flag37 = false; + flag36 = true; + if (this.type == 268) + { + this.velocity.Y = this.velocity.Y + 2f; + } + } + if (flag36) + { + if (this.type == 75 || this.type == 169) + { + this.velocity.Y = this.velocity.Y + 0.2f; + if (this.velocity.Y > 2f) + { + this.velocity.Y = 2f; + } + } + else + { + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + } + else + { + if (this.type == 75 || this.type == 169) + { + if ((this.directionY < 0 && this.velocity.Y > 0f) || flag37) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + } + else + { + if (this.directionY < 0 && this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.1f; + } + } + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + if (this.type == 75 && this.wet) + { + this.velocity.Y = this.velocity.Y - 0.2f; + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + if (this.collideX) + { + this.velocity.X = this.oldVelocity.X * -0.4f; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 1f) + { + this.velocity.X = 1f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -1f) + { + this.velocity.X = -1f; + } + } + if (this.collideY) + { + this.velocity.Y = this.oldVelocity.Y * -0.25f; + if (this.velocity.Y > 0f && this.velocity.Y < 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -1f) + { + this.velocity.Y = -1f; + } + } + float num409 = 2f; + if (this.type == 75) + { + num409 = 3f; + } + if (this.type == 253) + { + num409 = 4f; + } + if (this.direction == -1 && this.velocity.X > -num409) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > num409) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X < -num409) + { + this.velocity.X = -num409; + } + } + else + { + if (this.direction == 1 && this.velocity.X < num409) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -num409) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X > num409) + { + this.velocity.X = num409; + } + } + } + if (this.directionY == -1 && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = this.velocity.Y - 0.05f; + } + else + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + 0.03f; + } + } + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = -1.5f; + } + } + else + { + if (this.directionY == 1 && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = this.velocity.Y + 0.04f; + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = this.velocity.Y + 0.05f; + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y - 0.03f; + } + } + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = 1.5f; + } + } + } + if (this.type == 122) + { + Lighting.addLight((int)this.position.X / 16, (int)this.position.Y / 16, 0.4f, 0f, 0.25f); + return; + } + } + else + { + if (this.aiStyle == 23) + { + this.noGravity = true; + this.noTileCollide = true; + if (this.type == 83) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.2f, 0.05f, 0.3f); + } + else + { + if (this.type == 179) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.3f, 0.15f, 0.05f); + } + else + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.05f, 0.2f, 0.3f); + } + } + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead) + { + this.TargetClosest(true); + } + if (this.ai[0] == 0f) + { + float num410 = 9f; + Vector2 vector40 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num411 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector40.X; + float num412 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector40.Y; + float num413 = (float)Math.Sqrt((double)(num411 * num411 + num412 * num412)); + num413 = num410 / num413; + num411 *= num413; + num412 *= num413; + this.velocity.X = num411; + this.velocity.Y = num412; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 0.785f; + this.ai[0] = 1f; + this.ai[1] = 0f; + return; + } + if (this.ai[0] == 1f) + { + if (this.justHit) + { + this.ai[0] = 2f; + this.ai[1] = 0f; + } + this.velocity *= 0.99f; + this.ai[1] += 1f; + if (this.ai[1] >= 100f) + { + this.ai[0] = 2f; + this.ai[1] = 0f; + this.velocity.X = 0f; + this.velocity.Y = 0f; + return; + } + } + else + { + if (this.justHit) + { + this.ai[0] = 2f; + this.ai[1] = 0f; + } + this.velocity *= 0.96f; + this.ai[1] += 1f; + float num414 = this.ai[1] / 120f; + num414 = 0.1f + num414 * 0.4f; + this.rotation += num414 * (float)this.direction; + if (this.ai[1] >= 120f) + { + this.netUpdate = true; + this.ai[0] = 0f; + this.ai[1] = 0f; + return; + } + } + } + else + { + if (this.aiStyle == 24) + { + this.noGravity = true; + if (this.ai[0] == 0f) + { + this.noGravity = false; + this.TargetClosest(true); + if (Main.netMode != 1) + { + if (this.velocity.X != 0f || this.velocity.Y < 0f || (double)this.velocity.Y > 0.3) + { + this.ai[0] = 1f; + this.netUpdate = true; + this.direction = -this.direction; + } + else + { + Rectangle rectangle7 = new Rectangle((int)Main.player[this.target].position.X, (int)Main.player[this.target].position.Y, Main.player[this.target].width, Main.player[this.target].height); + Rectangle rectangle8 = new Rectangle((int)this.position.X - 100, (int)this.position.Y - 100, this.width + 200, this.height + 200); + if (rectangle8.Intersects(rectangle7) || this.life < this.lifeMax) + { + this.ai[0] = 1f; + this.velocity.Y = this.velocity.Y - 6f; + this.netUpdate = true; + this.direction = -this.direction; + } + } + } + } + else + { + if (!Main.player[this.target].dead) + { + if (this.collideX) + { + this.direction *= -1; + this.velocity.X = this.oldVelocity.X * -0.5f; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.velocity.Y = this.oldVelocity.Y * -0.5f; + if (this.velocity.Y > 0f && this.velocity.Y < 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -1f) + { + this.velocity.Y = -1f; + } + } + if (this.direction == -1 && this.velocity.X > -3f) + { + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 3f) + { + this.velocity.X = this.velocity.X - 0.1f; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + } + else + { + if (this.direction == 1 && this.velocity.X < 3f) + { + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -3f) + { + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + } + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + } + } + int num415 = (int)((this.position.X + (float)(this.width / 2)) / 16f) + this.direction; + int num416 = (int)((this.position.Y + (float)this.height) / 16f); + bool flag38 = true; + int num417 = 15; + bool flag39 = false; + for (int num418 = num416; num418 < num416 + num417; num418++) + { + if (Main.tile[num415, num418] == null) + { + Main.tile[num415, num418] = new Tile(); + } + if ((Main.tile[num415, num418].nactive() && Main.tileSolid[(int)Main.tile[num415, num418].type]) || Main.tile[num415, num418].liquid > 0) + { + if (num418 < num416 + 5) + { + flag39 = true; + } + flag38 = false; + break; + } + } + if (flag38) + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + else + { + this.velocity.Y = this.velocity.Y - 0.1f; + } + if (flag39) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + } + if (this.wet) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + this.TargetClosest(true); + return; + } + } + else + { + if (this.aiStyle == 25) + { + if (this.ai[3] == 0f) + { + this.position.X = this.position.X + 8f; + if (this.position.Y / 16f > (float)(Main.maxTilesY - 200)) + { + this.ai[3] = 3f; + } + else + { + if ((double)(this.position.Y / 16f) > Main.worldSurface) + { + this.TargetClosest(true); + if (Main.player[this.target].zoneSnow) + { + this.ai[3] = 4f; + } + else + { + this.ai[3] = 2f; + } + } + else + { + this.ai[3] = 1f; + } + } + } + if (this.ai[0] == 0f) + { + this.TargetClosest(true); + if (Main.netMode != 1) + { + if (this.velocity.X != 0f || this.velocity.Y < 0f || (double)this.velocity.Y > 0.3) + { + this.ai[0] = 1f; + this.netUpdate = true; + return; + } + Rectangle rectangle9 = new Rectangle((int)Main.player[this.target].position.X, (int)Main.player[this.target].position.Y, Main.player[this.target].width, Main.player[this.target].height); + Rectangle rectangle10 = new Rectangle((int)this.position.X - 100, (int)this.position.Y - 100, this.width + 200, this.height + 200); + if (rectangle10.Intersects(rectangle9) || this.life < this.lifeMax) + { + this.ai[0] = 1f; + this.netUpdate = true; + return; + } + } + } + else + { + if (this.velocity.Y == 0f) + { + this.ai[2] += 1f; + int num419 = 20; + if (this.ai[1] == 0f) + { + num419 = 12; + } + if (this.ai[2] < (float)num419) + { + this.velocity.X = this.velocity.X * 0.9f; + return; + } + this.ai[2] = 0f; + this.TargetClosest(true); + this.spriteDirection = this.direction; + this.ai[1] += 1f; + if (this.ai[1] == 2f) + { + this.velocity.X = (float)this.direction * 2.5f; + this.velocity.Y = -8f; + this.ai[1] = 0f; + } + else + { + this.velocity.X = (float)this.direction * 3.5f; + this.velocity.Y = -4f; + } + this.netUpdate = true; + return; + } + else + { + if (this.direction == 1 && this.velocity.X < 1f) + { + this.velocity.X = this.velocity.X + 0.1f; + return; + } + if (this.direction == -1 && this.velocity.X > -1f) + { + this.velocity.X = this.velocity.X - 0.1f; + return; + } + } + } + } + else + { + if (this.aiStyle == 26) + { + int num420 = 30; + bool flag40 = false; + if (this.velocity.Y == 0f && ((this.velocity.X > 0f && this.direction < 0) || (this.velocity.X < 0f && this.direction > 0))) + { + flag40 = true; + this.ai[3] += 1f; + } + if (this.position.X == this.oldPosition.X || this.ai[3] >= (float)num420 || flag40) + { + this.ai[3] += 1f; + } + else + { + if (this.ai[3] > 0f) + { + this.ai[3] -= 1f; + } + } + if (this.ai[3] > (float)(num420 * 10)) + { + this.ai[3] = 0f; + } + if (this.justHit) + { + this.ai[3] = 0f; + } + if (this.ai[3] == (float)num420) + { + this.netUpdate = true; + } + Vector2 vector41 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num421 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector41.X; + float num422 = Main.player[this.target].position.Y - vector41.Y; + float num423 = (float)Math.Sqrt((double)(num421 * num421 + num422 * num422)); + if (num423 < 200f) + { + this.ai[3] = 0f; + } + if (this.type == 155 && this.velocity.Y == 0f && num423 < 100f && Math.Abs(this.velocity.X) > 3f && ((this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) && this.velocity.X > 0f) || (this.position.X + (float)(this.width / 2) > Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) && this.velocity.X < 0f))) + { + this.velocity.Y = this.velocity.Y - 4f; + } + if (this.ai[3] < (float)num420) + { + this.TargetClosest(true); + } + else + { + if (this.velocity.X == 0f) + { + if (this.velocity.Y == 0f) + { + this.ai[0] += 1f; + if (this.ai[0] >= 2f) + { + this.direction *= -1; + this.spriteDirection = this.direction; + this.ai[0] = 0f; + } + } + } + else + { + this.ai[0] = 0f; + } + this.directionY = -1; + if (this.direction == 0) + { + this.direction = 1; + } + } + float num424 = 6f; + if (this.velocity.Y == 0f || this.wet || (this.velocity.X <= 0f && this.direction < 0) || (this.velocity.X >= 0f && this.direction > 0)) + { + if (this.type == 155) + { + if (this.velocity.X > 0f && this.direction < 0) + { + this.velocity.X = this.velocity.X * 0.95f; + } + if (this.velocity.X < 0f && this.direction > 0) + { + this.velocity.X = this.velocity.X * 0.95f; + } + } + if (this.velocity.X < -num424 || this.velocity.X > num424) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + } + } + else + { + if (this.velocity.X < num424 && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > num424) + { + this.velocity.X = num424; + } + } + else + { + if (this.velocity.X > -num424 && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -num424) + { + this.velocity.X = -num424; + } + } + } + } + } + if (this.velocity.Y >= 0f) + { + int num425 = 0; + if (this.velocity.X < 0f) + { + num425 = -1; + } + if (this.velocity.X > 0f) + { + num425 = 1; + } + Vector2 vector42 = this.position; + vector42.X += this.velocity.X; + int num426 = (int)((vector42.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num425)) / 16f); + int num427 = (int)((vector42.Y + (float)this.height - 1f) / 16f); + if (Main.tile[num426, num427] == null) + { + Main.tile[num426, num427] = new Tile(); + } + if (Main.tile[num426, num427 - 1] == null) + { + Main.tile[num426, num427 - 1] = new Tile(); + } + if (Main.tile[num426, num427 - 2] == null) + { + Main.tile[num426, num427 - 2] = new Tile(); + } + if (Main.tile[num426, num427 - 3] == null) + { + Main.tile[num426, num427 - 3] = new Tile(); + } + if (Main.tile[num426, num427 + 1] == null) + { + Main.tile[num426, num427 + 1] = new Tile(); + } + if ((float)(num426 * 16) < vector42.X + (float)this.width && (float)(num426 * 16 + 16) > vector42.X && ((Main.tile[num426, num427].nactive() && Main.tile[num426, num427].slope() == 0 && Main.tile[num426, num427 - 1].slope() == 0 && Main.tileSolid[(int)Main.tile[num426, num427].type] && !Main.tileSolidTop[(int)Main.tile[num426, num427].type]) || (Main.tile[num426, num427 - 1].halfBrick() && Main.tile[num426, num427 - 1].nactive())) && (!Main.tile[num426, num427 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num426, num427 - 1].type] || Main.tileSolidTop[(int)Main.tile[num426, num427 - 1].type] || (Main.tile[num426, num427 - 1].halfBrick() && (!Main.tile[num426, num427 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num426, num427 - 4].type] || Main.tileSolidTop[(int)Main.tile[num426, num427 - 4].type]))) && (!Main.tile[num426, num427 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num426, num427 - 2].type] || Main.tileSolidTop[(int)Main.tile[num426, num427 - 2].type]) && (!Main.tile[num426, num427 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num426, num427 - 3].type] || Main.tileSolidTop[(int)Main.tile[num426, num427 - 3].type]) && (!Main.tile[num426 - num425, num427 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num426 - num425, num427 - 3].type])) + { + float num428 = (float)(num427 * 16); + if (Main.tile[num426, num427].halfBrick()) + { + num428 += 8f; + } + if (Main.tile[num426, num427 - 1].halfBrick()) + { + num428 -= 8f; + } + if (num428 < vector42.Y + (float)this.height) + { + float num429 = vector42.Y + (float)this.height - num428; + if ((double)num429 <= 16.1) + { + this.gfxOffY += this.position.Y + (float)this.height - num428; + this.position.Y = num428 - (float)this.height; + if (num429 < 9f) + { + this.stepSpeed = 1f; + } + else + { + this.stepSpeed = 2f; + } + } + } + } + } + if (this.velocity.Y == 0f) + { + int num430 = (int)((this.position.X + (float)(this.width / 2) + (float)((this.width / 2 + 2) * this.direction) + this.velocity.X * 5f) / 16f); + int num431 = (int)((this.position.Y + (float)this.height - 15f) / 16f); + if (Main.tile[num430, num431] == null) + { + Main.tile[num430, num431] = new Tile(); + } + if (Main.tile[num430, num431 - 1] == null) + { + Main.tile[num430, num431 - 1] = new Tile(); + } + if (Main.tile[num430, num431 - 2] == null) + { + Main.tile[num430, num431 - 2] = new Tile(); + } + if (Main.tile[num430, num431 - 3] == null) + { + Main.tile[num430, num431 - 3] = new Tile(); + } + if (Main.tile[num430, num431 + 1] == null) + { + Main.tile[num430, num431 + 1] = new Tile(); + } + if (Main.tile[num430 + this.direction, num431 - 1] == null) + { + Main.tile[num430 + this.direction, num431 - 1] = new Tile(); + } + if (Main.tile[num430 + this.direction, num431 + 1] == null) + { + Main.tile[num430 + this.direction, num431 + 1] = new Tile(); + } + if (Main.tile[num430 - this.direction, num431 + 1] == null) + { + Main.tile[num430 - this.direction, num431 + 1] = new Tile(); + } + if ((this.velocity.X < 0f && this.spriteDirection == -1) || (this.velocity.X > 0f && this.spriteDirection == 1)) + { + if (Main.tile[num430, num431 - 2].nactive() && Main.tileSolid[(int)Main.tile[num430, num431 - 2].type]) + { + if (Main.tile[num430, num431 - 3].nactive() && Main.tileSolid[(int)Main.tile[num430, num431 - 3].type]) + { + this.velocity.Y = -8.5f; + this.netUpdate = true; + return; + } + this.velocity.Y = -7.5f; + this.netUpdate = true; + return; + } + else + { + if (Main.tile[num430, num431 - 1].nactive() && Main.tile[num430, num431 - 1].slope() == 0 && Main.tileSolid[(int)Main.tile[num430, num431 - 1].type]) + { + this.velocity.Y = -7f; + this.netUpdate = true; + return; + } + if (this.position.Y + (float)this.height - (float)(num431 * 16) > 20f && Main.tile[num430, num431].nactive() && Main.tile[num430, num431].slope() == 0 && Main.tileSolid[(int)Main.tile[num430, num431].type]) + { + this.velocity.Y = -6f; + this.netUpdate = true; + return; + } + if ((this.directionY < 0 || Math.Abs(this.velocity.X) > 3f) && (!Main.tile[num430, num431 + 2].nactive() || !Main.tileSolid[(int)Main.tile[num430, num431 + 2].type]) && (!Main.tile[num430 + this.direction, num431 + 3].nactive() || !Main.tileSolid[(int)Main.tile[num430 + this.direction, num431 + 3].type])) + { + this.velocity.Y = -8f; + this.netUpdate = true; + return; + } + } + } + } + } + else + { + if (this.aiStyle == 27) + { + if (this.position.X < 160f || this.position.X > (float)((Main.maxTilesX - 10) * 16)) + { + this.active = false; + } + if (this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + Main.wofB = -1; + Main.wofT = -1; + } + this.ai[1] += 1f; + if (this.ai[2] == 0f) + { + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.ai[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.2) + { + this.ai[1] += 1f; + } + if (this.ai[1] > 2700f) + { + this.ai[2] = 1f; + } + } + if (this.ai[2] > 0f && this.ai[1] > 60f) + { + int num432 = 3; + if ((double)this.life < (double)this.lifeMax * 0.3) + { + num432++; + } + this.ai[2] += 1f; + this.ai[1] = 0f; + if (this.ai[2] > (float)num432) + { + this.ai[2] = 0f; + } + if (Main.netMode != 1) + { + int num433 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)(this.height / 2) + 20f), 117, 1); + Main.npc[num433].velocity.X = (float)(this.direction * 8); + } + } + this.localAI[3] += 1f; + if (this.localAI[3] >= (float)(600 + Main.rand.Next(1000))) + { + this.localAI[3] = (float)(-(float)Main.rand.Next(200)); + Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 10); + } + Main.wof = this.whoAmI; + int num434 = (int)(this.position.X / 16f); + int num435 = (int)((this.position.X + (float)this.width) / 16f); + int num436 = (int)((this.position.Y + (float)(this.height / 2)) / 16f); + int num437 = 0; + int num438 = num436 + 7; + while (num437 < 15 && num438 > Main.maxTilesY - 200) + { + num438++; + for (int num439 = num434; num439 <= num435; num439++) + { + try + { + if (WorldGen.SolidTile(num439, num438) || Main.tile[num439, num438].liquid > 0) + { + num437++; + } + } + catch + { + num437 += 15; + } + } + } + num438 += 4; + if (Main.wofB == -1) + { + Main.wofB = num438 * 16; + } + else + { + if (Main.wofB > num438 * 16) + { + Main.wofB--; + if (Main.wofB < num438 * 16) + { + Main.wofB = num438 * 16; + } + } + else + { + if (Main.wofB < num438 * 16) + { + Main.wofB++; + if (Main.wofB > num438 * 16) + { + Main.wofB = num438 * 16; + } + } + } + } + num437 = 0; + num438 = num436 - 7; + while (num437 < 15 && num438 < Main.maxTilesY - 10) + { + num438--; + for (int num440 = num434; num440 <= num435; num440++) + { + try + { + if (WorldGen.SolidTile(num440, num438) || Main.tile[num440, num438].liquid > 0) + { + num437++; + } + } + catch + { + num437 += 15; + } + } + } + num438 -= 4; + if (Main.wofT == -1) + { + Main.wofT = num438 * 16; + } + else + { + if (Main.wofT > num438 * 16) + { + Main.wofT--; + if (Main.wofT < num438 * 16) + { + Main.wofT = num438 * 16; + } + } + else + { + if (Main.wofT < num438 * 16) + { + Main.wofT++; + if (Main.wofT > num438 * 16) + { + Main.wofT = num438 * 16; + } + } + } + } + float num441 = (float)((Main.wofB + Main.wofT) / 2 - this.height / 2); + if (this.position.Y > num441 + 1f) + { + this.velocity.Y = -1f; + } + else + { + if (this.position.Y < num441 - 1f) + { + this.velocity.Y = 1f; + } + } + this.velocity.Y = 0f; + this.position.Y = num441; + float num442 = 1.5f; + if ((double)this.life < (double)this.lifeMax * 0.75) + { + num442 += 0.25f; + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + num442 += 0.4f; + } + if ((double)this.life < (double)this.lifeMax * 0.25) + { + num442 += 0.5f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + num442 += 0.6f; + } + if (this.velocity.X == 0f) + { + this.TargetClosest(true); + this.velocity.X = (float)this.direction; + } + if (this.velocity.X < 0f) + { + this.velocity.X = -num442; + this.direction = -1; + } + else + { + this.velocity.X = num442; + this.direction = 1; + } + this.spriteDirection = this.direction; + Vector2 vector43 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num443 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector43.X; + float num444 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector43.Y; + float num445 = (float)Math.Sqrt((double)(num443 * num443 + num444 * num444)); + num443 *= num445; + num444 *= num445; + if (this.direction > 0) + { + if (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) > this.position.X + (float)(this.width / 2)) + { + this.rotation = (float)Math.Atan2((double)(-(double)num444), (double)(-(double)num443)) + 3.14f; + } + else + { + this.rotation = 0f; + } + } + else + { + if (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.rotation = (float)Math.Atan2((double)num444, (double)num443) + 3.14f; + } + else + { + this.rotation = 0f; + } + } + if (this.localAI[0] == 1f && Main.netMode != 1) + { + this.localAI[0] = 2f; + num441 = (float)((Main.wofB + Main.wofT) / 2); + num441 = (num441 + (float)Main.wofT) / 2f; + int num446 = NPC.NewNPC((int)this.position.X, (int)num441, 114, this.whoAmI); + Main.npc[num446].ai[0] = 1f; + num441 = (float)((Main.wofB + Main.wofT) / 2); + num441 = (num441 + (float)Main.wofB) / 2f; + num446 = NPC.NewNPC((int)this.position.X, (int)num441, 114, this.whoAmI); + Main.npc[num446].ai[0] = -1f; + num441 = (float)((Main.wofB + Main.wofT) / 2); + num441 = (num441 + (float)Main.wofB) / 2f; + for (int num447 = 0; num447 < 11; num447++) + { + num446 = NPC.NewNPC((int)this.position.X, (int)num441, 115, this.whoAmI); + Main.npc[num446].ai[0] = (float)num447 * 0.1f - 0.05f; + } + return; + } + } + else + { + if (this.aiStyle == 28) + { + if (Main.wof < 0) + { + this.active = false; + return; + } + this.realLife = Main.wof; + if (Main.npc[Main.wof].life > 0) + { + this.life = Main.npc[Main.wof].life; + } + this.TargetClosest(true); + this.position.X = Main.npc[Main.wof].position.X; + this.direction = Main.npc[Main.wof].direction; + this.spriteDirection = this.direction; + float num448 = (float)((Main.wofB + Main.wofT) / 2); + if (this.ai[0] > 0f) + { + num448 = (num448 + (float)Main.wofT) / 2f; + } + else + { + num448 = (num448 + (float)Main.wofB) / 2f; + } + num448 -= (float)(this.height / 2); + if (this.position.Y > num448 + 1f) + { + this.velocity.Y = -1f; + } + else + { + if (this.position.Y < num448 - 1f) + { + this.velocity.Y = 1f; + } + else + { + this.velocity.Y = 0f; + this.position.Y = num448; + } + } + if (this.velocity.Y > 5f) + { + this.velocity.Y = 5f; + } + if (this.velocity.Y < -5f) + { + this.velocity.Y = -5f; + } + Vector2 vector44 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num449 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector44.X; + float num450 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector44.Y; + float num451 = (float)Math.Sqrt((double)(num449 * num449 + num450 * num450)); + num449 *= num451; + num450 *= num451; + bool flag41 = true; + if (this.direction > 0) + { + if (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) > this.position.X + (float)(this.width / 2)) + { + this.rotation = (float)Math.Atan2((double)(-(double)num450), (double)(-(double)num449)) + 3.14f; + } + else + { + this.rotation = 0f; + flag41 = false; + } + } + else + { + if (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.rotation = (float)Math.Atan2((double)num450, (double)num449) + 3.14f; + } + else + { + this.rotation = 0f; + flag41 = false; + } + } + if (Main.netMode != 1) + { + int num452 = 4; + this.localAI[1] += 1f; + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.75) + { + this.localAI[1] += 1f; + num452++; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) + { + this.localAI[1] += 1f; + num452++; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) + { + this.localAI[1] += 1f; + num452 += 2; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.1) + { + this.localAI[1] += 2f; + num452 += 3; + } + if (this.localAI[2] == 0f) + { + if (this.localAI[1] > 600f) + { + this.localAI[2] = 1f; + this.localAI[1] = 0f; + return; + } + } + else + { + if (this.localAI[1] > 45f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.localAI[1] = 0f; + this.localAI[2] += 1f; + if (this.localAI[2] >= (float)num452) + { + this.localAI[2] = 0f; + } + if (flag41) + { + float num453 = 9f; + int num454 = 11; + int num455 = 83; + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) + { + num454++; + num453 += 1f; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) + { + num454++; + num453 += 1f; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.1) + { + num454 += 2; + num453 += 2f; + } + vector44 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num449 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector44.X; + num450 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector44.Y; + num451 = (float)Math.Sqrt((double)(num449 * num449 + num450 * num450)); + num451 = num453 / num451; + num449 *= num451; + num450 *= num451; + vector44.X += num449; + vector44.Y += num450; + Projectile.NewProjectile(vector44.X, vector44.Y, num449, num450, num455, num454, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + } + } + else + { + if (this.aiStyle == 29) + { + if (this.justHit) + { + this.ai[1] = 10f; + } + if (Main.wof < 0) + { + this.active = false; + return; + } + this.TargetClosest(true); + float num456 = 0.1f; + float num457 = 300f; + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) + { + this.damage = 75; + this.defense = 40; + num457 = 900f; + } + else + { + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) + { + this.damage = 60; + this.defense = 30; + num457 = 700f; + } + else + { + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.75) + { + this.damage = 45; + this.defense = 20; + num457 = 500f; + } + } + } + float num458 = Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2); + float num459 = Main.npc[Main.wof].position.Y; + float num460 = (float)(Main.wofB - Main.wofT); + num459 = (float)Main.wofT + num460 * this.ai[0]; + this.ai[2] += 1f; + if (this.ai[2] > 100f) + { + num457 = (float)((int)(num457 * 1.3f)); + if (this.ai[2] > 200f) + { + this.ai[2] = 0f; + } + } + Vector2 vector45 = new Vector2(num458, num459); + float num461 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - (float)(this.width / 2) - vector45.X; + float num462 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - (float)(this.height / 2) - vector45.Y; + float num463 = (float)Math.Sqrt((double)(num461 * num461 + num462 * num462)); + if (this.ai[1] == 0f) + { + if (num463 > num457) + { + num463 = num457 / num463; + num461 *= num463; + num462 *= num463; + } + if (this.position.X < num458 + num461) + { + this.velocity.X = this.velocity.X + num456; + if (this.velocity.X < 0f && num461 > 0f) + { + this.velocity.X = this.velocity.X + num456 * 2.5f; + } + } + else + { + if (this.position.X > num458 + num461) + { + this.velocity.X = this.velocity.X - num456; + if (this.velocity.X > 0f && num461 < 0f) + { + this.velocity.X = this.velocity.X - num456 * 2.5f; + } + } + } + if (this.position.Y < num459 + num462) + { + this.velocity.Y = this.velocity.Y + num456; + if (this.velocity.Y < 0f && num462 > 0f) + { + this.velocity.Y = this.velocity.Y + num456 * 2.5f; + } + } + else + { + if (this.position.Y > num459 + num462) + { + this.velocity.Y = this.velocity.Y - num456; + if (this.velocity.Y > 0f && num462 < 0f) + { + this.velocity.Y = this.velocity.Y - num456 * 2.5f; + } + } + } + if (this.velocity.X > 4f) + { + this.velocity.X = 4f; + } + if (this.velocity.X < -4f) + { + this.velocity.X = -4f; + } + if (this.velocity.Y > 4f) + { + this.velocity.Y = 4f; + } + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + else + { + if (this.ai[1] > 0f) + { + this.ai[1] -= 1f; + } + else + { + this.ai[1] = 0f; + } + } + if (num461 > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)num462, (double)num461); + } + if (num461 < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)num462, (double)num461) + 3.14f; + } + Lighting.addLight((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.3f, 0.2f, 0.1f); + return; + } + else + { + if (this.aiStyle == 30) + { + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead || !Main.player[this.target].active) + { + this.TargetClosest(true); + } + bool dead2 = Main.player[this.target].dead; + float num464 = this.position.X + (float)(this.width / 2) - Main.player[this.target].position.X - (float)(Main.player[this.target].width / 2); + float num465 = this.position.Y + (float)this.height - 59f - Main.player[this.target].position.Y - (float)(Main.player[this.target].height / 2); + float num466 = (float)Math.Atan2((double)num465, (double)num464) + 1.57f; + if (num466 < 0f) + { + num466 += 6.283f; + } + else + { + if ((double)num466 > 6.283) + { + num466 -= 6.283f; + } + } + float num467 = 0.1f; + if (this.rotation < num466) + { + if ((double)(num466 - this.rotation) > 3.1415) + { + this.rotation -= num467; + } + else + { + this.rotation += num467; + } + } + else + { + if (this.rotation > num466) + { + if ((double)(this.rotation - num466) > 3.1415) + { + this.rotation += num467; + } + else + { + this.rotation -= num467; + } + } + } + if (this.rotation > num466 - num467 && this.rotation < num466 + num467) + { + this.rotation = num466; + } + if (this.rotation < 0f) + { + this.rotation += 6.283f; + } + else + { + if ((double)this.rotation > 6.283) + { + this.rotation -= 6.283f; + } + } + if (this.rotation > num466 - num467 && this.rotation < num466 + num467) + { + this.rotation = num466; + } + if (Main.rand.Next(5) == 0) + { + int num468 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), 5, this.velocity.X, 2f, 0, default(Color), 1f); + Dust expr_1CF50_cp_0 = Main.dust[num468]; + expr_1CF50_cp_0.velocity.X = expr_1CF50_cp_0.velocity.X * 0.5f; + Dust expr_1CF70_cp_0 = Main.dust[num468]; + expr_1CF70_cp_0.velocity.Y = expr_1CF70_cp_0.velocity.Y * 0.1f; + } + if (Main.dayTime || dead2) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.timeLeft > 10) + { + this.timeLeft = 10; + return; + } + } + else + { + if (this.ai[0] == 0f) + { + if (this.ai[1] == 0f) + { + float num469 = 7f; + float num470 = 0.1f; + int num471 = 1; + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + num471 = -1; + } + Vector2 vector46 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num472 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) + (float)(num471 * 300) - vector46.X; + float num473 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 300f - vector46.Y; + float num474 = (float)Math.Sqrt((double)(num472 * num472 + num473 * num473)); + float num475 = num474; + num474 = num469 / num474; + num472 *= num474; + num473 *= num474; + if (this.velocity.X < num472) + { + this.velocity.X = this.velocity.X + num470; + if (this.velocity.X < 0f && num472 > 0f) + { + this.velocity.X = this.velocity.X + num470; + } + } + else + { + if (this.velocity.X > num472) + { + this.velocity.X = this.velocity.X - num470; + if (this.velocity.X > 0f && num472 < 0f) + { + this.velocity.X = this.velocity.X - num470; + } + } + } + if (this.velocity.Y < num473) + { + this.velocity.Y = this.velocity.Y + num470; + if (this.velocity.Y < 0f && num473 > 0f) + { + this.velocity.Y = this.velocity.Y + num470; + } + } + else + { + if (this.velocity.Y > num473) + { + this.velocity.Y = this.velocity.Y - num470; + if (this.velocity.Y > 0f && num473 < 0f) + { + this.velocity.Y = this.velocity.Y - num470; + } + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 600f) + { + this.ai[1] = 1f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.target = 255; + this.netUpdate = true; + } + else + { + if (this.position.Y + (float)this.height < Main.player[this.target].position.Y && num475 < 400f) + { + if (!Main.player[this.target].dead) + { + this.ai[3] += 1f; + } + if (this.ai[3] >= 60f) + { + this.ai[3] = 0f; + vector46 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num472 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector46.X; + num473 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector46.Y; + if (Main.netMode != 1) + { + float num476 = 9f; + int num477 = 20; + int num478 = 83; + num474 = (float)Math.Sqrt((double)(num472 * num472 + num473 * num473)); + num474 = num476 / num474; + num472 *= num474; + num473 *= num474; + num472 += (float)Main.rand.Next(-40, 41) * 0.08f; + num473 += (float)Main.rand.Next(-40, 41) * 0.08f; + vector46.X += num472 * 15f; + vector46.Y += num473 * 15f; + Projectile.NewProjectile(vector46.X, vector46.Y, num472, num473, num478, num477, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + } + else + { + if (this.ai[1] == 1f) + { + this.rotation = num466; + float num479 = 12f; + Vector2 vector47 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num480 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector47.X; + float num481 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector47.Y; + float num482 = (float)Math.Sqrt((double)(num480 * num480 + num481 * num481)); + num482 = num479 / num482; + this.velocity.X = num480 * num482; + this.velocity.Y = num481 * num482; + this.ai[1] = 2f; + } + else + { + if (this.ai[1] == 2f) + { + this.ai[2] += 1f; + if (this.ai[2] >= 25f) + { + this.velocity.X = this.velocity.X * 0.96f; + this.velocity.Y = this.velocity.Y * 0.96f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + if (this.ai[2] >= 70f) + { + this.ai[3] += 1f; + this.ai[2] = 0f; + this.target = 255; + this.rotation = num466; + if (this.ai[3] >= 4f) + { + this.ai[1] = 0f; + this.ai[3] = 0f; + } + else + { + this.ai[1] = 1f; + } + } + } + } + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[0] == 1f || this.ai[0] == 2f) + { + if (this.ai[0] == 1f) + { + this.ai[2] += 0.005f; + if ((double)this.ai[2] > 0.5) + { + this.ai[2] = 0.5f; + } + } + else + { + this.ai[2] -= 0.005f; + if (this.ai[2] < 0f) + { + this.ai[2] = 0f; + } + } + this.rotation += this.ai[2]; + this.ai[1] += 1f; + if (this.ai[1] == 100f) + { + this.ai[0] += 1f; + this.ai[1] = 0f; + if (this.ai[0] == 3f) + { + this.ai[2] = 0f; + } + else + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1); + for (int num483 = 0; num483 < 2; num483++) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 143, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6, 1f); + } + for (int num484 = 0; num484 < 20; num484++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + } + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + } + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + return; + } + } + else + { + this.damage = (int)((double)this.defDamage * 1.5); + this.defense = this.defDefense + 15; + this.soundHit = 4; + if (this.ai[1] == 0f) + { + float num485 = 8f; + float num486 = 0.15f; + Vector2 vector48 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num487 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector48.X; + float num488 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 300f - vector48.Y; + float num489 = (float)Math.Sqrt((double)(num487 * num487 + num488 * num488)); + num489 = num485 / num489; + num487 *= num489; + num488 *= num489; + if (this.velocity.X < num487) + { + this.velocity.X = this.velocity.X + num486; + if (this.velocity.X < 0f && num487 > 0f) + { + this.velocity.X = this.velocity.X + num486; + } + } + else + { + if (this.velocity.X > num487) + { + this.velocity.X = this.velocity.X - num486; + if (this.velocity.X > 0f && num487 < 0f) + { + this.velocity.X = this.velocity.X - num486; + } + } + } + if (this.velocity.Y < num488) + { + this.velocity.Y = this.velocity.Y + num486; + if (this.velocity.Y < 0f && num488 > 0f) + { + this.velocity.Y = this.velocity.Y + num486; + } + } + else + { + if (this.velocity.Y > num488) + { + this.velocity.Y = this.velocity.Y - num486; + if (this.velocity.Y > 0f && num488 < 0f) + { + this.velocity.Y = this.velocity.Y - num486; + } + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 300f) + { + this.ai[1] = 1f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.TargetClosest(true); + this.netUpdate = true; + } + vector48 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num487 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector48.X; + num488 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector48.Y; + this.rotation = (float)Math.Atan2((double)num488, (double)num487) - 1.57f; + if (Main.netMode != 1) + { + this.localAI[1] += 1f; + if ((double)this.life < (double)this.lifeMax * 0.75) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.25) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + this.localAI[1] += 2f; + } + if (this.localAI[1] > 140f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.localAI[1] = 0f; + float num490 = 9f; + int num491 = 25; + int num492 = 100; + num489 = (float)Math.Sqrt((double)(num487 * num487 + num488 * num488)); + num489 = num490 / num489; + num487 *= num489; + num488 *= num489; + vector48.X += num487 * 15f; + vector48.Y += num488 * 15f; + Projectile.NewProjectile(vector48.X, vector48.Y, num487, num488, num492, num491, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + else + { + int num493 = 1; + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + num493 = -1; + } + float num494 = 8f; + float num495 = 0.2f; + Vector2 vector49 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num496 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) + (float)(num493 * 340) - vector49.X; + float num497 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector49.Y; + float num498 = (float)Math.Sqrt((double)(num496 * num496 + num497 * num497)); + num498 = num494 / num498; + num496 *= num498; + num497 *= num498; + if (this.velocity.X < num496) + { + this.velocity.X = this.velocity.X + num495; + if (this.velocity.X < 0f && num496 > 0f) + { + this.velocity.X = this.velocity.X + num495; + } + } + else + { + if (this.velocity.X > num496) + { + this.velocity.X = this.velocity.X - num495; + if (this.velocity.X > 0f && num496 < 0f) + { + this.velocity.X = this.velocity.X - num495; + } + } + } + if (this.velocity.Y < num497) + { + this.velocity.Y = this.velocity.Y + num495; + if (this.velocity.Y < 0f && num497 > 0f) + { + this.velocity.Y = this.velocity.Y + num495; + } + } + else + { + if (this.velocity.Y > num497) + { + this.velocity.Y = this.velocity.Y - num495; + if (this.velocity.Y > 0f && num497 < 0f) + { + this.velocity.Y = this.velocity.Y - num495; + } + } + } + vector49 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num496 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector49.X; + num497 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector49.Y; + this.rotation = (float)Math.Atan2((double)num497, (double)num496) - 1.57f; + if (Main.netMode != 1) + { + this.localAI[1] += 1f; + if ((double)this.life < (double)this.lifeMax * 0.75) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.25) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + this.localAI[1] += 2f; + } + if (this.localAI[1] > 45f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.localAI[1] = 0f; + float num499 = 9f; + int num500 = 20; + int num501 = 100; + num498 = (float)Math.Sqrt((double)(num496 * num496 + num497 * num497)); + num498 = num499 / num498; + num496 *= num498; + num497 *= num498; + vector49.X += num496 * 15f; + vector49.Y += num497 * 15f; + Projectile.NewProjectile(vector49.X, vector49.Y, num496, num497, num501, num500, 0f, Main.myPlayer, 0f, 0f); + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 200f) + { + this.ai[1] = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.TargetClosest(true); + this.netUpdate = true; + return; + } + } + } + } + } + } + else + { + if (this.aiStyle == 31) + { + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead || !Main.player[this.target].active) + { + this.TargetClosest(true); + } + bool dead3 = Main.player[this.target].dead; + float num502 = this.position.X + (float)(this.width / 2) - Main.player[this.target].position.X - (float)(Main.player[this.target].width / 2); + float num503 = this.position.Y + (float)this.height - 59f - Main.player[this.target].position.Y - (float)(Main.player[this.target].height / 2); + float num504 = (float)Math.Atan2((double)num503, (double)num502) + 1.57f; + if (num504 < 0f) + { + num504 += 6.283f; + } + else + { + if ((double)num504 > 6.283) + { + num504 -= 6.283f; + } + } + float num505 = 0.15f; + if (this.rotation < num504) + { + if ((double)(num504 - this.rotation) > 3.1415) + { + this.rotation -= num505; + } + else + { + this.rotation += num505; + } + } + else + { + if (this.rotation > num504) + { + if ((double)(this.rotation - num504) > 3.1415) + { + this.rotation += num505; + } + else + { + this.rotation -= num505; + } + } + } + if (this.rotation > num504 - num505 && this.rotation < num504 + num505) + { + this.rotation = num504; + } + if (this.rotation < 0f) + { + this.rotation += 6.283f; + } + else + { + if ((double)this.rotation > 6.283) + { + this.rotation -= 6.283f; + } + } + if (this.rotation > num504 - num505 && this.rotation < num504 + num505) + { + this.rotation = num504; + } + if (Main.rand.Next(5) == 0) + { + int num506 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height * 0.25f), this.width, (int)((float)this.height * 0.5f), 5, this.velocity.X, 2f, 0, default(Color), 1f); + Dust expr_1EBBF_cp_0 = Main.dust[num506]; + expr_1EBBF_cp_0.velocity.X = expr_1EBBF_cp_0.velocity.X * 0.5f; + Dust expr_1EBDF_cp_0 = Main.dust[num506]; + expr_1EBDF_cp_0.velocity.Y = expr_1EBDF_cp_0.velocity.Y * 0.1f; + } + if (Main.dayTime || dead3) + { + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.timeLeft > 10) + { + this.timeLeft = 10; + return; + } + } + else + { + if (this.ai[0] == 0f) + { + if (this.ai[1] == 0f) + { + this.TargetClosest(true); + float num507 = 12f; + float num508 = 0.4f; + int num509 = 1; + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + num509 = -1; + } + Vector2 vector50 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num510 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) + (float)(num509 * 400) - vector50.X; + float num511 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector50.Y; + float num512 = (float)Math.Sqrt((double)(num510 * num510 + num511 * num511)); + num512 = num507 / num512; + num510 *= num512; + num511 *= num512; + if (this.velocity.X < num510) + { + this.velocity.X = this.velocity.X + num508; + if (this.velocity.X < 0f && num510 > 0f) + { + this.velocity.X = this.velocity.X + num508; + } + } + else + { + if (this.velocity.X > num510) + { + this.velocity.X = this.velocity.X - num508; + if (this.velocity.X > 0f && num510 < 0f) + { + this.velocity.X = this.velocity.X - num508; + } + } + } + if (this.velocity.Y < num511) + { + this.velocity.Y = this.velocity.Y + num508; + if (this.velocity.Y < 0f && num511 > 0f) + { + this.velocity.Y = this.velocity.Y + num508; + } + } + else + { + if (this.velocity.Y > num511) + { + this.velocity.Y = this.velocity.Y - num508; + if (this.velocity.Y > 0f && num511 < 0f) + { + this.velocity.Y = this.velocity.Y - num508; + } + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 600f) + { + this.ai[1] = 1f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.target = 255; + this.netUpdate = true; + } + else + { + if (!Main.player[this.target].dead) + { + this.ai[3] += 1f; + } + if (this.ai[3] >= 60f) + { + this.ai[3] = 0f; + vector50 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num510 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector50.X; + num511 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector50.Y; + if (Main.netMode != 1) + { + float num513 = 12f; + int num514 = 25; + int num515 = 96; + num512 = (float)Math.Sqrt((double)(num510 * num510 + num511 * num511)); + num512 = num513 / num512; + num510 *= num512; + num511 *= num512; + num510 += (float)Main.rand.Next(-40, 41) * 0.05f; + num511 += (float)Main.rand.Next(-40, 41) * 0.05f; + vector50.X += num510 * 4f; + vector50.Y += num511 * 4f; + Projectile.NewProjectile(vector50.X, vector50.Y, num510, num511, num515, num514, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + else + { + if (this.ai[1] == 1f) + { + this.rotation = num504; + float num516 = 13f; + Vector2 vector51 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num517 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector51.X; + float num518 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector51.Y; + float num519 = (float)Math.Sqrt((double)(num517 * num517 + num518 * num518)); + num519 = num516 / num519; + this.velocity.X = num517 * num519; + this.velocity.Y = num518 * num519; + this.ai[1] = 2f; + } + else + { + if (this.ai[1] == 2f) + { + this.ai[2] += 1f; + if (this.ai[2] >= 8f) + { + this.velocity.X = this.velocity.X * 0.9f; + this.velocity.Y = this.velocity.Y * 0.9f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + if (this.ai[2] >= 42f) + { + this.ai[3] += 1f; + this.ai[2] = 0f; + this.target = 255; + this.rotation = num504; + if (this.ai[3] >= 10f) + { + this.ai[1] = 0f; + this.ai[3] = 0f; + } + else + { + this.ai[1] = 1f; + } + } + } + } + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[0] == 1f || this.ai[0] == 2f) + { + if (this.ai[0] == 1f) + { + this.ai[2] += 0.005f; + if ((double)this.ai[2] > 0.5) + { + this.ai[2] = 0.5f; + } + } + else + { + this.ai[2] -= 0.005f; + if (this.ai[2] < 0f) + { + this.ai[2] = 0f; + } + } + this.rotation += this.ai[2]; + this.ai[1] += 1f; + if (this.ai[1] == 100f) + { + this.ai[0] += 1f; + this.ai[1] = 0f; + if (this.ai[0] == 3f) + { + this.ai[2] = 0f; + } + else + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1); + for (int num520 = 0; num520 < 2; num520++) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 144, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6, 1f); + } + for (int num521 = 0; num521 < 20; num521++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + } + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + } + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + return; + } + } + else + { + this.soundHit = 4; + this.damage = (int)((double)this.defDamage * 1.5); + this.defense = this.defDefense + 25; + if (this.ai[1] == 0f) + { + float num522 = 4f; + float num523 = 0.1f; + int num524 = 1; + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + num524 = -1; + } + Vector2 vector52 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num525 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) + (float)(num524 * 180) - vector52.X; + float num526 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector52.Y; + float num527 = (float)Math.Sqrt((double)(num525 * num525 + num526 * num526)); + num527 = num522 / num527; + num525 *= num527; + num526 *= num527; + if (this.velocity.X < num525) + { + this.velocity.X = this.velocity.X + num523; + if (this.velocity.X < 0f && num525 > 0f) + { + this.velocity.X = this.velocity.X + num523; + } + } + else + { + if (this.velocity.X > num525) + { + this.velocity.X = this.velocity.X - num523; + if (this.velocity.X > 0f && num525 < 0f) + { + this.velocity.X = this.velocity.X - num523; + } + } + } + if (this.velocity.Y < num526) + { + this.velocity.Y = this.velocity.Y + num523; + if (this.velocity.Y < 0f && num526 > 0f) + { + this.velocity.Y = this.velocity.Y + num523; + } + } + else + { + if (this.velocity.Y > num526) + { + this.velocity.Y = this.velocity.Y - num523; + if (this.velocity.Y > 0f && num526 < 0f) + { + this.velocity.Y = this.velocity.Y - num523; + } + } + } + this.ai[2] += 1f; + if (this.ai[2] >= 400f) + { + this.ai[1] = 1f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.target = 255; + this.netUpdate = true; + } + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.localAI[2] += 1f; + if (this.localAI[2] > 22f) + { + this.localAI[2] = 0f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 34); + } + if (Main.netMode != 1) + { + this.localAI[1] += 1f; + if ((double)this.life < (double)this.lifeMax * 0.75) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.25) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + this.localAI[1] += 2f; + } + if (this.localAI[1] > 8f) + { + this.localAI[1] = 0f; + float num528 = 6f; + int num529 = 30; + int num530 = 101; + vector52 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num525 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector52.X; + num526 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector52.Y; + num527 = (float)Math.Sqrt((double)(num525 * num525 + num526 * num526)); + num527 = num528 / num527; + num525 *= num527; + num526 *= num527; + num526 += (float)Main.rand.Next(-40, 41) * 0.01f; + num525 += (float)Main.rand.Next(-40, 41) * 0.01f; + num526 += this.velocity.Y * 0.5f; + num525 += this.velocity.X * 0.5f; + vector52.X -= num525 * 1f; + vector52.Y -= num526 * 1f; + Projectile.NewProjectile(vector52.X, vector52.Y, num525, num526, num530, num529, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + } + else + { + if (this.ai[1] == 1f) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + this.rotation = num504; + float num531 = 14f; + Vector2 vector53 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num532 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector53.X; + float num533 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector53.Y; + float num534 = (float)Math.Sqrt((double)(num532 * num532 + num533 * num533)); + num534 = num531 / num534; + this.velocity.X = num532 * num534; + this.velocity.Y = num533 * num534; + this.ai[1] = 2f; + return; + } + if (this.ai[1] == 2f) + { + this.ai[2] += 1f; + if (this.ai[2] >= 50f) + { + this.velocity.X = this.velocity.X * 0.93f; + this.velocity.Y = this.velocity.Y * 0.93f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + if (this.ai[2] >= 80f) + { + this.ai[3] += 1f; + this.ai[2] = 0f; + this.target = 255; + this.rotation = num504; + if (this.ai[3] >= 6f) + { + this.ai[1] = 0f; + this.ai[3] = 0f; + return; + } + this.ai[1] = 1f; + return; + } + } + } + } + } + } + } + else + { + if (this.aiStyle == 32) + { + this.damage = this.defDamage; + this.defense = this.defDefense; + if (this.ai[0] == 0f && Main.netMode != 1) + { + this.TargetClosest(true); + this.ai[0] = 1f; + if (this.type != 68) + { + int num535 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)this.position.Y + this.height / 2, 128, this.whoAmI); + Main.npc[num535].ai[0] = -1f; + Main.npc[num535].ai[1] = (float)this.whoAmI; + Main.npc[num535].target = this.target; + Main.npc[num535].netUpdate = true; + num535 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)this.position.Y + this.height / 2, 129, this.whoAmI); + Main.npc[num535].ai[0] = 1f; + Main.npc[num535].ai[1] = (float)this.whoAmI; + Main.npc[num535].target = this.target; + Main.npc[num535].netUpdate = true; + num535 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)this.position.Y + this.height / 2, 130, this.whoAmI); + Main.npc[num535].ai[0] = -1f; + Main.npc[num535].ai[1] = (float)this.whoAmI; + Main.npc[num535].target = this.target; + Main.npc[num535].ai[3] = 150f; + Main.npc[num535].netUpdate = true; + num535 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)this.position.Y + this.height / 2, 131, this.whoAmI); + Main.npc[num535].ai[0] = 1f; + Main.npc[num535].ai[1] = (float)this.whoAmI; + Main.npc[num535].target = this.target; + Main.npc[num535].netUpdate = true; + Main.npc[num535].ai[3] = 150f; + } + } + if (this.type == 68 && this.ai[1] != 3f && this.ai[1] != 2f) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + this.ai[1] = 2f; + } + if (Main.player[this.target].dead || Math.Abs(this.position.X - Main.player[this.target].position.X) > 6000f || Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 6000f) + { + this.TargetClosest(true); + if (Main.player[this.target].dead || Math.Abs(this.position.X - Main.player[this.target].position.X) > 6000f || Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 6000f) + { + this.ai[1] = 3f; + } + } + if (Main.dayTime && this.ai[1] != 3f && this.ai[1] != 2f) + { + this.ai[1] = 2f; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + if (this.ai[1] == 0f) + { + this.ai[2] += 1f; + if (this.ai[2] >= 600f) + { + this.ai[2] = 0f; + this.ai[1] = 1f; + this.TargetClosest(true); + this.netUpdate = true; + } + this.rotation = this.velocity.X / 15f; + if (this.position.Y > Main.player[this.target].position.Y - 200f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.98f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y > 2f) + { + this.velocity.Y = 2f; + } + } + else + { + if (this.position.Y < Main.player[this.target].position.Y - 500f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.98f; + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) + 100f) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - 100f) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + return; + } + } + } + else + { + if (this.ai[1] == 1f) + { + this.defense *= 2; + this.damage *= 2; + this.ai[2] += 1f; + if (this.ai[2] == 2f) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + if (this.ai[2] >= 400f) + { + this.ai[2] = 0f; + this.ai[1] = 0f; + } + this.rotation += (float)this.direction * 0.3f; + Vector2 vector54 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num536 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector54.X; + float num537 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector54.Y; + float num538 = (float)Math.Sqrt((double)(num536 * num536 + num537 * num537)); + num538 = 2f / num538; + this.velocity.X = num536 * num538; + this.velocity.Y = num537 * num538; + return; + } + if (this.ai[1] == 2f) + { + this.damage = 9999; + this.defense = 9999; + this.rotation += (float)this.direction * 0.3f; + Vector2 vector55 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num539 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector55.X; + float num540 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector55.Y; + float num541 = (float)Math.Sqrt((double)(num539 * num539 + num540 * num540)); + num541 = 8f / num541; + this.velocity.X = num539 * num541; + this.velocity.Y = num540 * num541; + return; + } + if (this.ai[1] == 3f) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.X = this.velocity.X * 0.95f; + if (this.timeLeft > 500) + { + this.timeLeft = 500; + return; + } + } + } + } + else + { + if (this.aiStyle == 33) + { + Vector2 vector56 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num542 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector56.X; + float num543 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector56.Y; + float num544 = (float)Math.Sqrt((double)(num542 * num542 + num543 * num543)); + if (this.ai[2] != 99f) + { + if (num544 > 800f) + { + this.ai[2] = 99f; + } + } + else + { + if (num544 < 400f) + { + this.ai[2] = 0f; + } + } + this.spriteDirection = -(int)this.ai[0]; + if (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != 32) + { + this.ai[2] += 10f; + if (this.ai[2] > 50f || Main.netMode != 2) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + } + } + if (this.ai[2] == 99f) + { + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y > 8f) + { + this.velocity.Y = 8f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < -8f) + { + this.velocity.Y = -8f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2)) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.5f; + if (this.velocity.X > 12f) + { + this.velocity.X = 12f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2)) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.5f; + if (this.velocity.X < -12f) + { + this.velocity.X = -12f; + return; + } + } + } + else + { + if (this.ai[2] == 0f || this.ai[2] == 3f) + { + if (Main.npc[(int)this.ai[1]].ai[1] == 3f && this.timeLeft > 10) + { + this.timeLeft = 10; + } + if (Main.npc[(int)this.ai[1]].ai[1] != 0f) + { + this.TargetClosest(true); + if (Main.player[this.target].dead) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + } + } + else + { + Vector2 vector57 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num545 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector57.X; + float num546 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector57.Y; + float num547 = (float)Math.Sqrt((double)(num545 * num545 + num546 * num546)); + num547 = 7f / num547; + num545 *= num547; + num546 *= num547; + this.rotation = (float)Math.Atan2((double)num546, (double)num545) - 1.57f; + if (this.velocity.X > num545) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + } + this.velocity.X = this.velocity.X - 0.05f; + } + if (this.velocity.X < num545) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + } + this.velocity.X = this.velocity.X + 0.05f; + } + if (this.velocity.Y > num546) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.97f; + } + this.velocity.Y = this.velocity.Y - 0.05f; + } + if (this.velocity.Y < num546) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.97f; + } + this.velocity.Y = this.velocity.Y + 0.05f; + } + } + this.ai[3] += 1f; + if (this.ai[3] >= 600f) + { + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + } + } + else + { + this.ai[3] += 1f; + if (this.ai[3] >= 300f) + { + this.ai[2] += 1f; + this.ai[3] = 0f; + this.netUpdate = true; + } + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y + 320f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y + 260f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.04f; + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2)) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.3f; + if (this.velocity.X > 12f) + { + this.velocity.X = 12f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 250f) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.3f; + if (this.velocity.X < -12f) + { + this.velocity.X = -12f; + } + } + } + Vector2 vector58 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num548 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector58.X; + float num549 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector58.Y; + Math.Sqrt((double)(num548 * num548 + num549 * num549)); + this.rotation = (float)Math.Atan2((double)num549, (double)num548) + 1.57f; + return; + } + if (this.ai[2] == 1f) + { + Vector2 vector59 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num550 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector59.X; + float num551 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector59.Y; + float num552 = (float)Math.Sqrt((double)(num550 * num550 + num551 * num551)); + this.rotation = (float)Math.Atan2((double)num551, (double)num550) + 1.57f; + this.velocity.X = this.velocity.X * 0.95f; + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y < -8f) + { + this.velocity.Y = -8f; + } + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 200f) + { + this.TargetClosest(true); + this.ai[2] = 2f; + vector59 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num550 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector59.X; + num551 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector59.Y; + num552 = (float)Math.Sqrt((double)(num550 * num550 + num551 * num551)); + num552 = 22f / num552; + this.velocity.X = num550 * num552; + this.velocity.Y = num551 * num552; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[2] == 2f) + { + if (this.position.Y > Main.player[this.target].position.Y || this.velocity.Y < 0f) + { + this.ai[2] = 3f; + return; + } + } + else + { + if (this.ai[2] == 4f) + { + this.TargetClosest(true); + Vector2 vector60 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num553 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector60.X; + float num554 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector60.Y; + float num555 = (float)Math.Sqrt((double)(num553 * num553 + num554 * num554)); + num555 = 7f / num555; + num553 *= num555; + num554 *= num555; + if (this.velocity.X > num553) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + } + this.velocity.X = this.velocity.X - 0.05f; + } + if (this.velocity.X < num553) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + } + this.velocity.X = this.velocity.X + 0.05f; + } + if (this.velocity.Y > num554) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.97f; + } + this.velocity.Y = this.velocity.Y - 0.05f; + } + if (this.velocity.Y < num554) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.97f; + } + this.velocity.Y = this.velocity.Y + 0.05f; + } + this.ai[3] += 1f; + if (this.ai[3] >= 600f) + { + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + } + vector60 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num553 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector60.X; + num554 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector60.Y; + num555 = (float)Math.Sqrt((double)(num553 * num553 + num554 * num554)); + this.rotation = (float)Math.Atan2((double)num554, (double)num553) + 1.57f; + return; + } + if (this.ai[2] == 5f && ((this.velocity.X > 0f && this.position.X + (float)(this.width / 2) > Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)) || (this.velocity.X < 0f && this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)))) + { + this.ai[2] = 0f; + return; + } + } + } + } + } + else + { + if (this.aiStyle == 34) + { + this.spriteDirection = -(int)this.ai[0]; + Vector2 vector61 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num556 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector61.X; + float num557 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector61.Y; + float num558 = (float)Math.Sqrt((double)(num556 * num556 + num557 * num557)); + if (this.ai[2] != 99f) + { + if (num558 > 800f) + { + this.ai[2] = 99f; + } + } + else + { + if (num558 < 400f) + { + this.ai[2] = 0f; + } + } + if (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != 32) + { + this.ai[2] += 10f; + if (this.ai[2] > 50f || Main.netMode != 2) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + } + } + if (this.ai[2] == 99f) + { + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y > 8f) + { + this.velocity.Y = 8f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < -8f) + { + this.velocity.Y = -8f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2)) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.5f; + if (this.velocity.X > 12f) + { + this.velocity.X = 12f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2)) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.5f; + if (this.velocity.X < -12f) + { + this.velocity.X = -12f; + return; + } + } + } + else + { + if (this.ai[2] == 0f || this.ai[2] == 3f) + { + if (Main.npc[(int)this.ai[1]].ai[1] == 3f && this.timeLeft > 10) + { + this.timeLeft = 10; + } + if (Main.npc[(int)this.ai[1]].ai[1] != 0f) + { + this.TargetClosest(true); + this.TargetClosest(true); + if (Main.player[this.target].dead) + { + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + } + } + else + { + Vector2 vector62 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num559 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector62.X; + float num560 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector62.Y; + float num561 = (float)Math.Sqrt((double)(num559 * num559 + num560 * num560)); + num561 = 12f / num561; + num559 *= num561; + num560 *= num561; + this.rotation = (float)Math.Atan2((double)num560, (double)num559) - 1.57f; + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 2f) + { + this.rotation = (float)Math.Atan2((double)num560, (double)num559) - 1.57f; + this.velocity.X = num559; + this.velocity.Y = num560; + this.netUpdate = true; + } + else + { + this.velocity *= 0.97f; + } + this.ai[3] += 1f; + if (this.ai[3] >= 600f) + { + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + } + } + } + else + { + this.ai[3] += 1f; + if (this.ai[3] >= 600f) + { + this.ai[2] += 1f; + this.ai[3] = 0f; + this.netUpdate = true; + } + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y + 300f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y + 230f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) + 250f) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.94f; + } + this.velocity.X = this.velocity.X - 0.3f; + if (this.velocity.X > 9f) + { + this.velocity.X = 9f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2)) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.94f; + } + this.velocity.X = this.velocity.X + 0.2f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + Vector2 vector63 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num562 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector63.X; + float num563 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector63.Y; + Math.Sqrt((double)(num562 * num562 + num563 * num563)); + this.rotation = (float)Math.Atan2((double)num563, (double)num562) + 1.57f; + return; + } + if (this.ai[2] == 1f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + Vector2 vector64 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num564 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 280f * this.ai[0] - vector64.X; + float num565 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector64.Y; + float num566 = (float)Math.Sqrt((double)(num564 * num564 + num565 * num565)); + this.rotation = (float)Math.Atan2((double)num565, (double)num564) + 1.57f; + this.velocity.X = (this.velocity.X * 5f + Main.npc[(int)this.ai[1]].velocity.X) / 6f; + this.velocity.X = this.velocity.X + 0.5f; + this.velocity.Y = this.velocity.Y - 0.5f; + if (this.velocity.Y < -9f) + { + this.velocity.Y = -9f; + } + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 280f) + { + this.TargetClosest(true); + this.ai[2] = 2f; + vector64 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num564 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector64.X; + num565 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector64.Y; + num566 = (float)Math.Sqrt((double)(num564 * num564 + num565 * num565)); + num566 = 20f / num566; + this.velocity.X = num564 * num566; + this.velocity.Y = num565 * num566; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[2] == 2f) + { + if (this.position.Y > Main.player[this.target].position.Y || this.velocity.Y < 0f) + { + if (this.ai[3] >= 4f) + { + this.ai[2] = 3f; + this.ai[3] = 0f; + return; + } + this.ai[2] = 1f; + this.ai[3] += 1f; + return; + } + } + else + { + if (this.ai[2] == 4f) + { + Vector2 vector65 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num567 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector65.X; + float num568 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector65.Y; + float num569 = (float)Math.Sqrt((double)(num567 * num567 + num568 * num568)); + this.rotation = (float)Math.Atan2((double)num568, (double)num567) + 1.57f; + this.velocity.Y = (this.velocity.Y * 5f + Main.npc[(int)this.ai[1]].velocity.Y) / 6f; + this.velocity.X = this.velocity.X + 0.5f; + if (this.velocity.X > 12f) + { + this.velocity.X = 12f; + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 500f || this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) + 500f) + { + this.TargetClosest(true); + this.ai[2] = 5f; + vector65 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num567 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector65.X; + num568 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector65.Y; + num569 = (float)Math.Sqrt((double)(num567 * num567 + num568 * num568)); + num569 = 17f / num569; + this.velocity.X = num567 * num569; + this.velocity.Y = num568 * num569; + this.netUpdate = true; + return; + } + } + else + { + if (this.ai[2] == 5f && this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - 100f) + { + if (this.ai[3] >= 4f) + { + this.ai[2] = 0f; + this.ai[3] = 0f; + return; + } + this.ai[2] = 4f; + this.ai[3] += 1f; + return; + } + } + } + } + } + } + else + { + if (this.aiStyle == 35) + { + this.spriteDirection = -(int)this.ai[0]; + if (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != 32) + { + this.ai[2] += 10f; + if (this.ai[2] > 50f || Main.netMode != 2) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + } + } + if (this.ai[2] == 0f) + { + if (Main.npc[(int)this.ai[1]].ai[1] == 3f && this.timeLeft > 10) + { + this.timeLeft = 10; + } + if (Main.npc[(int)this.ai[1]].ai[1] != 0f) + { + this.localAI[0] += 2f; + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.07f; + if (this.velocity.Y > 6f) + { + this.velocity.Y = 6f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.07f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 120f * this.ai[0]) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 120f * this.ai[0]) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + else + { + this.ai[3] += 1f; + if (this.ai[3] >= 1100f) + { + this.localAI[0] = 0f; + this.ai[2] = 1f; + this.ai[3] = 0f; + this.netUpdate = true; + } + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y - 150f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.04f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 150f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.04f; + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) + 200f) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.2f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) + 160f) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.2f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + Vector2 vector66 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num570 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 200f * this.ai[0] - vector66.X; + float num571 = Main.npc[(int)this.ai[1]].position.Y + 230f - vector66.Y; + float num572 = (float)Math.Sqrt((double)(num570 * num570 + num571 * num571)); + this.rotation = (float)Math.Atan2((double)num571, (double)num570) + 1.57f; + if (Main.netMode != 1) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 140f) + { + this.localAI[0] = 0f; + float num573 = 12f; + int num574 = 0; + int num575 = 102; + num572 = num573 / num572; + num570 = -num570 * num572; + num571 = -num571 * num572; + num570 += (float)Main.rand.Next(-40, 41) * 0.01f; + num571 += (float)Main.rand.Next(-40, 41) * 0.01f; + vector66.X += num570 * 4f; + vector66.Y += num571 * 4f; + Projectile.NewProjectile(vector66.X, vector66.Y, num570, num571, num575, num574, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + else + { + if (this.ai[2] == 1f) + { + this.ai[3] += 1f; + if (this.ai[3] >= 300f) + { + this.localAI[0] = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + } + Vector2 vector67 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num576 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - vector67.X; + float num577 = Main.npc[(int)this.ai[1]].position.Y - vector67.Y; + num577 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 80f - vector67.Y; + float num578 = (float)Math.Sqrt((double)(num576 * num576 + num577 * num577)); + num578 = 6f / num578; + num576 *= num578; + num577 *= num578; + if (this.velocity.X > num576) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + this.velocity.X = this.velocity.X - 0.04f; + } + if (this.velocity.X < num576) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + this.velocity.X = this.velocity.X + 0.04f; + } + if (this.velocity.Y > num577) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y - 0.08f; + } + if (this.velocity.Y < num577) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y + 0.08f; + } + this.TargetClosest(true); + vector67 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num576 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector67.X; + num577 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector67.Y; + num578 = (float)Math.Sqrt((double)(num576 * num576 + num577 * num577)); + this.rotation = (float)Math.Atan2((double)num577, (double)num576) - 1.57f; + if (Main.netMode != 1) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 40f) + { + this.localAI[0] = 0f; + float num579 = 10f; + int num580 = 0; + int num581 = 102; + num578 = num579 / num578; + num576 *= num578; + num577 *= num578; + num576 += (float)Main.rand.Next(-40, 41) * 0.01f; + num577 += (float)Main.rand.Next(-40, 41) * 0.01f; + vector67.X += num576 * 4f; + vector67.Y += num577 * 4f; + Projectile.NewProjectile(vector67.X, vector67.Y, num576, num577, num581, num580, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + } + } + else + { + if (this.aiStyle == 36) + { + this.spriteDirection = -(int)this.ai[0]; + if (!Main.npc[(int)this.ai[1]].active || Main.npc[(int)this.ai[1]].aiStyle != 32) + { + this.ai[2] += 10f; + if (this.ai[2] > 50f || Main.netMode != 2) + { + this.life = -1; + this.HitEffect(0, 10.0); + this.active = false; + } + } + if (this.ai[2] == 0f || this.ai[2] == 3f) + { + if (Main.npc[(int)this.ai[1]].ai[1] == 3f && this.timeLeft > 10) + { + this.timeLeft = 10; + } + if (Main.npc[(int)this.ai[1]].ai[1] != 0f) + { + this.localAI[0] += 3f; + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.07f; + if (this.velocity.Y > 6f) + { + this.velocity.Y = 6f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.07f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 120f * this.ai[0]) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 120f * this.ai[0]) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + else + { + this.ai[3] += 1f; + if (this.ai[3] >= 800f) + { + this.ai[2] += 1f; + this.ai[3] = 0f; + this.netUpdate = true; + } + if (this.position.Y > Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + else + { + if (this.position.Y < Main.npc[(int)this.ai[1]].position.Y - 100f) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + } + if (this.position.X + (float)(this.width / 2) > Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 180f * this.ai[0]) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X - 0.14f; + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + } + if (this.position.X + (float)(this.width / 2) < Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - 180f * this.ai[0]) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + this.velocity.X = this.velocity.X + 0.14f; + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + } + } + this.TargetClosest(true); + Vector2 vector68 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num582 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector68.X; + float num583 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector68.Y; + float num584 = (float)Math.Sqrt((double)(num582 * num582 + num583 * num583)); + this.rotation = (float)Math.Atan2((double)num583, (double)num582) - 1.57f; + if (Main.netMode != 1) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 200f) + { + this.localAI[0] = 0f; + float num585 = 8f; + int num586 = 25; + int num587 = 100; + num584 = num585 / num584; + num582 *= num584; + num583 *= num584; + num582 += (float)Main.rand.Next(-40, 41) * 0.05f; + num583 += (float)Main.rand.Next(-40, 41) * 0.05f; + vector68.X += num582 * 8f; + vector68.Y += num583 * 8f; + Projectile.NewProjectile(vector68.X, vector68.Y, num582, num583, num587, num586, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + else + { + if (this.ai[2] == 1f) + { + this.ai[3] += 1f; + if (this.ai[3] >= 200f) + { + this.localAI[0] = 0f; + this.ai[2] = 0f; + this.ai[3] = 0f; + this.netUpdate = true; + } + Vector2 vector69 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num588 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - 350f - vector69.X; + float num589 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 20f - vector69.Y; + float num590 = (float)Math.Sqrt((double)(num588 * num588 + num589 * num589)); + num590 = 7f / num590; + num588 *= num590; + num589 *= num590; + if (this.velocity.X > num588) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + this.velocity.X = this.velocity.X - 0.1f; + } + if (this.velocity.X < num588) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + this.velocity.X = this.velocity.X + 0.1f; + } + if (this.velocity.Y > num589) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y - 0.03f; + } + if (this.velocity.Y < num589) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y + 0.03f; + } + this.TargetClosest(true); + vector69 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num588 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector69.X; + num589 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector69.Y; + num590 = (float)Math.Sqrt((double)(num588 * num588 + num589 * num589)); + this.rotation = (float)Math.Atan2((double)num589, (double)num588) - 1.57f; + if (Main.netMode == 1) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 80f) + { + this.localAI[0] = 0f; + float num591 = 10f; + int num592 = 25; + int num593 = 100; + num590 = num591 / num590; + num588 *= num590; + num589 *= num590; + num588 += (float)Main.rand.Next(-40, 41) * 0.05f; + num589 += (float)Main.rand.Next(-40, 41) * 0.05f; + vector69.X += num588 * 8f; + vector69.Y += num589 * 8f; + Projectile.NewProjectile(vector69.X, vector69.Y, num588, num589, num593, num592, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + } + } + else + { + if (this.aiStyle == 37) + { + if (this.ai[3] > 0f) + { + this.realLife = (int)this.ai[3]; + } + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead) + { + this.TargetClosest(true); + } + if (this.type > 134) + { + bool flag42 = false; + if (this.ai[1] <= 0f) + { + flag42 = true; + } + else + { + if (Main.npc[(int)this.ai[1]].life <= 0) + { + flag42 = true; + } + } + if (flag42) + { + this.life = 0; + this.HitEffect(0, 10.0); + this.checkDead(); + } + } + if (Main.netMode != 1) + { + if (this.ai[0] == 0f && this.type == 134) + { + this.ai[3] = (float)this.whoAmI; + this.realLife = this.whoAmI; + int num594 = this.whoAmI; + int num595 = 80; + for (int num596 = 0; num596 <= num595; num596++) + { + int num597 = 135; + if (num596 == num595) + { + num597 = 136; + } + int num598 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), num597, this.whoAmI); + Main.npc[num598].ai[3] = (float)this.whoAmI; + Main.npc[num598].realLife = this.whoAmI; + Main.npc[num598].ai[1] = (float)num594; + Main.npc[num594].ai[0] = (float)num598; + NetMessage.SendData(23, -1, -1, "", num598, 0f, 0f, 0f, 0); + num594 = num598; + } + } + if (this.type == 135) + { + this.localAI[0] += (float)Main.rand.Next(4); + if (this.localAI[0] >= (float)Main.rand.Next(1400, 26000)) + { + this.localAI[0] = 0f; + this.TargetClosest(true); + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num599 = 8f; + Vector2 vector70 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)(this.height / 2)); + float num600 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector70.X + (float)Main.rand.Next(-20, 21); + float num601 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector70.Y + (float)Main.rand.Next(-20, 21); + float num602 = (float)Math.Sqrt((double)(num600 * num600 + num601 * num601)); + num602 = num599 / num602; + num600 *= num602; + num601 *= num602; + num600 += (float)Main.rand.Next(-20, 21) * 0.05f; + num601 += (float)Main.rand.Next(-20, 21) * 0.05f; + int num603 = 22; + int num604 = 100; + vector70.X += num600 * 5f; + vector70.Y += num601 * 5f; + int num605 = Projectile.NewProjectile(vector70.X, vector70.Y, num600, num601, num604, num603, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num605].timeLeft = 300; + this.netUpdate = true; + } + } + } + } + int num606 = (int)(this.position.X / 16f) - 1; + int num607 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num608 = (int)(this.position.Y / 16f) - 1; + int num609 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num606 < 0) + { + num606 = 0; + } + if (num607 > Main.maxTilesX) + { + num607 = Main.maxTilesX; + } + if (num608 < 0) + { + num608 = 0; + } + if (num609 > Main.maxTilesY) + { + num609 = Main.maxTilesY; + } + bool flag43 = false; + if (!flag43) + { + for (int num610 = num606; num610 < num607; num610++) + { + for (int num611 = num608; num611 < num609; num611++) + { + if (Main.tile[num610, num611] != null && ((Main.tile[num610, num611].nactive() && (Main.tileSolid[(int)Main.tile[num610, num611].type] || (Main.tileSolidTop[(int)Main.tile[num610, num611].type] && Main.tile[num610, num611].frameY == 0))) || Main.tile[num610, num611].liquid > 64)) + { + Vector2 vector71; + vector71.X = (float)(num610 * 16); + vector71.Y = (float)(num611 * 16); + if (this.position.X + (float)this.width > vector71.X && this.position.X < vector71.X + 16f && this.position.Y + (float)this.height > vector71.Y && this.position.Y < vector71.Y + 16f) + { + flag43 = true; + break; + } + } + } + } + } + if (!flag43) + { + if (this.type != 135 || this.ai[2] != 1f) + { + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), 0.3f, 0.1f, 0.05f); + } + this.localAI[1] = 1f; + if (this.type == 134) + { + Rectangle rectangle11 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + int num612 = 1000; + bool flag44 = true; + if (this.position.Y > Main.player[this.target].position.Y) + { + for (int num613 = 0; num613 < 255; num613++) + { + if (Main.player[num613].active) + { + Rectangle rectangle12 = new Rectangle((int)Main.player[num613].position.X - num612, (int)Main.player[num613].position.Y - num612, num612 * 2, num612 * 2); + if (rectangle11.Intersects(rectangle12)) + { + flag44 = false; + break; + } + } + } + if (flag44) + { + flag43 = true; + } + } + } + } + else + { + this.localAI[1] = 0f; + } + float num614 = 16f; + if (Main.dayTime || Main.player[this.target].dead) + { + flag43 = false; + this.velocity.Y = this.velocity.Y + 1f; + if ((double)this.position.Y > Main.worldSurface * 16.0) + { + this.velocity.Y = this.velocity.Y + 1f; + num614 = 32f; + } + if ((double)this.position.Y > Main.rockLayer * 16.0) + { + for (int num615 = 0; num615 < 200; num615++) + { + if (Main.npc[num615].aiStyle == this.aiStyle) + { + Main.npc[num615].active = false; + } + } + } + } + float num616 = 0.1f; + float num617 = 0.15f; + Vector2 vector72 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num618 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2); + float num619 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2); + num618 = (float)((int)(num618 / 16f) * 16); + num619 = (float)((int)(num619 / 16f) * 16); + vector72.X = (float)((int)(vector72.X / 16f) * 16); + vector72.Y = (float)((int)(vector72.Y / 16f) * 16); + num618 -= vector72.X; + num619 -= vector72.Y; + float num620 = (float)Math.Sqrt((double)(num618 * num618 + num619 * num619)); + if (this.ai[1] > 0f && this.ai[1] < (float)Main.npc.Length) + { + try + { + vector72 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num618 = Main.npc[(int)this.ai[1]].position.X + (float)(Main.npc[(int)this.ai[1]].width / 2) - vector72.X; + num619 = Main.npc[(int)this.ai[1]].position.Y + (float)(Main.npc[(int)this.ai[1]].height / 2) - vector72.Y; + } + catch + { + } + this.rotation = (float)Math.Atan2((double)num619, (double)num618) + 1.57f; + num620 = (float)Math.Sqrt((double)(num618 * num618 + num619 * num619)); + int num621 = (int)(44f * this.scale); + num620 = (num620 - (float)num621) / num620; + num618 *= num620; + num619 *= num620; + this.velocity = default(Vector2); + this.position.X = this.position.X + num618; + this.position.Y = this.position.Y + num619; + return; + } + if (!flag43) + { + this.TargetClosest(true); + this.velocity.Y = this.velocity.Y + 0.15f; + if (this.velocity.Y > num614) + { + this.velocity.Y = num614; + } + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < (double)num614 * 0.4) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X - num616 * 1.1f; + } + else + { + this.velocity.X = this.velocity.X + num616 * 1.1f; + } + } + else + { + if (this.velocity.Y == num614) + { + if (this.velocity.X < num618) + { + this.velocity.X = this.velocity.X + num616; + } + else + { + if (this.velocity.X > num618) + { + this.velocity.X = this.velocity.X - num616; + } + } + } + else + { + if (this.velocity.Y > 4f) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num616 * 0.9f; + } + else + { + this.velocity.X = this.velocity.X - num616 * 0.9f; + } + } + } + } + } + else + { + if (this.soundDelay == 0) + { + float num622 = num620 / 40f; + if (num622 < 10f) + { + num622 = 10f; + } + if (num622 > 20f) + { + num622 = 20f; + } + this.soundDelay = (int)num622; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 1); + } + num620 = (float)Math.Sqrt((double)(num618 * num618 + num619 * num619)); + float num623 = Math.Abs(num618); + float num624 = Math.Abs(num619); + float num625 = num614 / num620; + num618 *= num625; + num619 *= num625; + if (((this.velocity.X > 0f && num618 > 0f) || (this.velocity.X < 0f && num618 < 0f)) && ((this.velocity.Y > 0f && num619 > 0f) || (this.velocity.Y < 0f && num619 < 0f))) + { + if (this.velocity.X < num618) + { + this.velocity.X = this.velocity.X + num617; + } + else + { + if (this.velocity.X > num618) + { + this.velocity.X = this.velocity.X - num617; + } + } + if (this.velocity.Y < num619) + { + this.velocity.Y = this.velocity.Y + num617; + } + else + { + if (this.velocity.Y > num619) + { + this.velocity.Y = this.velocity.Y - num617; + } + } + } + if ((this.velocity.X > 0f && num618 > 0f) || (this.velocity.X < 0f && num618 < 0f) || (this.velocity.Y > 0f && num619 > 0f) || (this.velocity.Y < 0f && num619 < 0f)) + { + if (this.velocity.X < num618) + { + this.velocity.X = this.velocity.X + num616; + } + else + { + if (this.velocity.X > num618) + { + this.velocity.X = this.velocity.X - num616; + } + } + if (this.velocity.Y < num619) + { + this.velocity.Y = this.velocity.Y + num616; + } + else + { + if (this.velocity.Y > num619) + { + this.velocity.Y = this.velocity.Y - num616; + } + } + if ((double)Math.Abs(num619) < (double)num614 * 0.2 && ((this.velocity.X > 0f && num618 < 0f) || (this.velocity.X < 0f && num618 > 0f))) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + num616 * 2f; + } + else + { + this.velocity.Y = this.velocity.Y - num616 * 2f; + } + } + if ((double)Math.Abs(num618) < (double)num614 * 0.2 && ((this.velocity.Y > 0f && num619 < 0f) || (this.velocity.Y < 0f && num619 > 0f))) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + num616 * 2f; + } + else + { + this.velocity.X = this.velocity.X - num616 * 2f; + } + } + } + else + { + if (num623 > num624) + { + if (this.velocity.X < num618) + { + this.velocity.X = this.velocity.X + num616 * 1.1f; + } + else + { + if (this.velocity.X > num618) + { + this.velocity.X = this.velocity.X - num616 * 1.1f; + } + } + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < (double)num614 * 0.5) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y + num616; + } + else + { + this.velocity.Y = this.velocity.Y - num616; + } + } + } + else + { + if (this.velocity.Y < num619) + { + this.velocity.Y = this.velocity.Y + num616 * 1.1f; + } + else + { + if (this.velocity.Y > num619) + { + this.velocity.Y = this.velocity.Y - num616 * 1.1f; + } + } + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < (double)num614 * 0.5) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X + num616; + } + else + { + this.velocity.X = this.velocity.X - num616; + } + } + } + } + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + if (this.type == 134) + { + if (flag43) + { + if (this.localAI[0] != 1f) + { + this.netUpdate = true; + } + this.localAI[0] = 1f; + } + else + { + if (this.localAI[0] != 0f) + { + this.netUpdate = true; + } + this.localAI[0] = 0f; + } + if (((this.velocity.X > 0f && this.oldVelocity.X < 0f) || (this.velocity.X < 0f && this.oldVelocity.X > 0f) || (this.velocity.Y > 0f && this.oldVelocity.Y < 0f) || (this.velocity.Y < 0f && this.oldVelocity.Y > 0f)) && !this.justHit) + { + this.netUpdate = true; + return; + } + } + } + else + { + if (this.aiStyle == 38) + { + float num626 = 4f; + float num627 = 1f; + if (this.type == 143) + { + num626 = 3f; + num627 = 0.7f; + } + if (this.type == 145) + { + num626 = 3.5f; + num627 = 0.8f; + } + if (this.type == 143) + { + this.ai[2] += 1f; + if (this.ai[2] >= 120f) + { + this.ai[2] = 0f; + if (Main.netMode != 1) + { + Vector2 vector73 = new Vector2(this.position.X + (float)this.width * 0.5f - (float)(this.direction * 12), this.position.Y + (float)this.height * 0.5f); + float speedX = (float)(12 * this.spriteDirection); + float speedY = 0f; + if (Main.netMode != 1) + { + int num628 = 25; + int num629 = 110; + int num630 = Projectile.NewProjectile(vector73.X, vector73.Y, speedX, speedY, num629, num628, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num630].ai[0] = 2f; + Main.projectile[num630].timeLeft = 300; + Main.projectile[num630].friendly = false; + NetMessage.SendData(27, -1, -1, "", num630, 0f, 0f, 0f, 0); + this.netUpdate = true; + } + } + } + } + if (this.type == 144 && this.ai[1] >= 3f) + { + this.TargetClosest(true); + this.spriteDirection = this.direction; + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + this.ai[2] += 1f; + if ((double)this.velocity.X > -0.3 && (double)this.velocity.X < 0.3) + { + this.velocity.X = 0f; + } + if (this.ai[2] >= 200f) + { + this.ai[2] = 0f; + this.ai[1] = 0f; + } + } + } + else + { + if (this.type == 145 && this.ai[1] >= 3f) + { + this.TargetClosest(true); + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + this.ai[2] += 1f; + if ((double)this.velocity.X > -0.3 && (double)this.velocity.X < 0.3) + { + this.velocity.X = 0f; + } + if (this.ai[2] >= 16f) + { + this.ai[2] = 0f; + this.ai[1] = 0f; + } + } + if (this.velocity.X == 0f && this.velocity.Y == 0f && this.ai[2] == 8f) + { + float num631 = 10f; + Vector2 vector74 = new Vector2(this.position.X + (float)this.width * 0.5f - (float)(this.direction * 12), this.position.Y + (float)this.height * 0.25f); + float num632 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector74.X; + float num633 = Main.player[this.target].position.Y - vector74.Y; + float num634 = (float)Math.Sqrt((double)(num632 * num632 + num633 * num633)); + num634 = num631 / num634; + num632 *= num634; + num633 *= num634; + if (Main.netMode != 1) + { + int num635 = 35; + int num636 = 109; + int num637 = Projectile.NewProjectile(vector74.X, vector74.Y, num632, num633, num636, num635, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num637].ai[0] = 2f; + Main.projectile[num637].timeLeft = 300; + Main.projectile[num637].friendly = false; + NetMessage.SendData(27, -1, -1, "", num637, 0f, 0f, 0f, 0); + this.netUpdate = true; + } + } + } + else + { + if (this.velocity.Y == 0f) + { + if (this.localAI[2] == this.position.X) + { + this.direction *= -1; + this.ai[3] = 60f; + } + this.localAI[2] = this.position.X; + if (this.ai[3] == 0f) + { + this.TargetClosest(true); + } + this.ai[0] += 1f; + if (this.ai[0] > 2f) + { + this.ai[0] = 0f; + this.ai[1] += 1f; + this.velocity.Y = -8.2f; + this.velocity.X = this.velocity.X + (float)this.direction * num627 * 1.1f; + } + else + { + this.velocity.Y = -6f; + this.velocity.X = this.velocity.X + (float)this.direction * num627 * 0.9f; + } + this.spriteDirection = this.direction; + } + this.velocity.X = this.velocity.X + (float)this.direction * num627 * 0.01f; + } + } + if (this.ai[3] > 0f) + { + this.ai[3] -= 1f; + } + if (this.velocity.X > num626 && this.direction > 0) + { + this.velocity.X = 4f; + } + if (this.velocity.X < -num626 && this.direction < 0) + { + this.velocity.X = -4f; + return; + } + } + else + { + if (this.aiStyle == 39) + { + if (this.target < 0 || Main.player[this.target].dead || this.direction == 0) + { + this.TargetClosest(true); + } + bool flag45 = true; + int num638 = 0; + if (this.velocity.X < 0f) + { + num638 = -1; + } + if (this.velocity.X > 0f) + { + num638 = 1; + } + Vector2 vector75 = this.position; + vector75.X += this.velocity.X; + int num639 = (int)((vector75.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num638)) / 16f); + int num640 = (int)((vector75.Y + (float)this.height - 1f) / 16f); + if ((float)(num639 * 16) < vector75.X + (float)this.width && (float)(num639 * 16 + 16) > vector75.X && ((Main.tile[num639, num640].nactive() && Main.tile[num639, num640].slope() == 0 && Main.tile[num639, num640 - 1].slope() == 0 && ((Main.tileSolid[(int)Main.tile[num639, num640].type] && !Main.tileSolidTop[(int)Main.tile[num639, num640].type]) || (flag45 && Main.tileSolidTop[(int)Main.tile[num639, num640].type] && (!Main.tileSolid[(int)Main.tile[num639, num640 - 1].type] || !Main.tile[num639, num640 - 1].nactive()) && Main.tile[num639, num640].type != 16 && Main.tile[num639, num640].type != 18 && Main.tile[num639, num640].type != 134))) || (Main.tile[num639, num640 - 1].halfBrick() && Main.tile[num639, num640 - 1].nactive())) && (!Main.tile[num639, num640 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num639, num640 - 1].type] || Main.tileSolidTop[(int)Main.tile[num639, num640 - 1].type] || (Main.tile[num639, num640 - 1].halfBrick() && (!Main.tile[num639, num640 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num639, num640 - 4].type] || Main.tileSolidTop[(int)Main.tile[num639, num640 - 4].type]))) && (!Main.tile[num639, num640 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num639, num640 - 2].type] || Main.tileSolidTop[(int)Main.tile[num639, num640 - 2].type]) && (!Main.tile[num639, num640 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num639, num640 - 3].type] || Main.tileSolidTop[(int)Main.tile[num639, num640 - 3].type]) && (!Main.tile[num639 - num638, num640 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num639 - num638, num640 - 3].type] || Main.tileSolidTop[(int)Main.tile[num639 - num638, num640 - 3].type])) + { + float num641 = (float)(num640 * 16); + if (Main.tile[num639, num640].halfBrick()) + { + num641 += 8f; + } + if (Main.tile[num639, num640 - 1].halfBrick()) + { + num641 -= 8f; + } + if (num641 < vector75.Y + (float)this.height) + { + float num642 = vector75.Y + (float)this.height - num641; + if ((double)num642 <= 16.1) + { + this.gfxOffY += this.position.Y + (float)this.height - num641; + this.position.Y = num641 - (float)this.height; + if (num642 < 9f) + { + this.stepSpeed = 0.75f; + } + else + { + this.stepSpeed = 1.5f; + } + } + } + } + if (this.justHit) + { + this.ai[0] = 0f; + this.ai[1] = 0f; + this.TargetClosest(true); + } + if (this.type == 154 && Main.rand.Next(10) == 0) + { + int num643 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 90, default(Color), 1.5f); + Main.dust[num643].noGravity = true; + Main.dust[num643].velocity *= 0.2f; + } + if (this.ai[0] == 0f) + { + if (this.velocity.X < 0f) + { + this.direction = -1; + } + else + { + if (this.velocity.X > 0f) + { + this.direction = 1; + } + } + this.spriteDirection = this.direction; + Vector2 vector76 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num644 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector76.X; + float num645 = Main.player[this.target].position.Y - vector76.Y; + float num646 = (float)Math.Sqrt((double)(num644 * num644 + num645 * num645)); + bool flag46 = Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height); + if (num646 > 200f && flag46) + { + this.ai[1] += 4f; + } + if (num646 > 600f && (flag46 || this.position.Y + (float)this.height > Main.player[this.target].position.Y - 200f)) + { + this.ai[1] += 10f; + } + if (this.wet) + { + this.ai[1] = 1000f; + } + this.defense = 30; + this.damage = 80; + this.knockBackResist = 0.3f; + this.ai[1] += 1f; + if (this.ai[1] >= 400f) + { + this.ai[1] = 0f; + this.ai[0] = 1f; + } + if (!this.justHit && this.velocity.X != this.oldVelocity.X) + { + this.direction *= -1; + } + if (this.velocity.Y == 0f && Main.player[this.target].position.Y < this.position.Y + (float)this.height) + { + int num647; + int num648; + if (this.direction > 0) + { + num647 = (int)(((double)this.position.X + (double)this.width * 0.5) / 16.0); + num648 = num647 + 3; + } + else + { + num648 = (int)(((double)this.position.X + (double)this.width * 0.5) / 16.0); + num647 = num648 - 3; + } + int num649 = (int)((this.position.Y + (float)this.height + 2f) / 16f) - 1; + int num650 = num649 + 4; + bool flag47 = false; + for (int num651 = num647; num651 <= num648; num651++) + { + for (int num652 = num649; num652 <= num650; num652++) + { + if (Main.tile[num651, num652] != null && Main.tile[num651, num652].nactive() && Main.tileSolid[(int)Main.tile[num651, num652].type]) + { + flag47 = true; + } + } + } + if (!flag47) + { + this.direction *= -1; + this.velocity.X = 0.1f * (float)this.direction; + } + } + if (num646 < 400f) + { + if (this.velocity.X < -1f || this.velocity.X > 1f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + return; + } + } + else + { + if (this.velocity.X < 1f && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > 1f) + { + this.velocity.X = 1f; + return; + } + } + else + { + if (this.velocity.X > -1f && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -1f) + { + this.velocity.X = -1f; + return; + } + } + } + } + } + else + { + if (this.velocity.X < -1.5f || this.velocity.X > 1.5f) + { + if (this.velocity.Y == 0f) + { + this.velocity *= 0.8f; + return; + } + } + else + { + if (this.velocity.X < 1.5f && this.direction == 1) + { + this.velocity.X = this.velocity.X + 0.07f; + if (this.velocity.X > 1.5f) + { + this.velocity.X = 1.5f; + return; + } + } + else + { + if (this.velocity.X > -1.5f && this.direction == -1) + { + this.velocity.X = this.velocity.X - 0.07f; + if (this.velocity.X < -1.5f) + { + this.velocity.X = -1.5f; + return; + } + } + } + } + } + } + else + { + if (this.ai[0] == 1f) + { + this.velocity.X = this.velocity.X * 0.5f; + this.ai[1] += 1f; + if (this.ai[1] >= 30f) + { + this.netUpdate = true; + this.TargetClosest(true); + this.ai[1] = 0f; + this.ai[0] = 3f; + this.ai[2] = 0f; + return; + } + } + else + { + if (this.ai[0] == 3f) + { + if (this.type == 154 && Main.rand.Next(3) < 2) + { + int num653 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 90, default(Color), 1.5f); + Main.dust[num653].noGravity = true; + Main.dust[num653].velocity *= 0.2f; + } + this.damage = 120; + this.defense = 70; + this.ai[1] += 1f; + if (this.ai[1] == 1f) + { + this.netUpdate = true; + this.TargetClosest(true); + this.ai[2] += 0.3f; + this.rotation += this.ai[2] * (float)this.direction; + this.ai[1] += 1f; + bool flag48 = Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height); + float num654 = 10f; + if (!flag48) + { + num654 = 6f; + } + Vector2 vector77 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num655 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector77.X; + float num656 = Math.Abs(num655) * 0.2f; + if (this.directionY > 0) + { + num656 = 0f; + } + float num657 = Main.player[this.target].position.Y - vector77.Y - num656; + float num658 = (float)Math.Sqrt((double)(num655 * num655 + num657 * num657)); + this.netUpdate = true; + num658 = num654 / num658; + num655 *= num658; + num657 *= num658; + if (!flag48) + { + num657 = -10f; + } + this.velocity.X = num655; + this.velocity.Y = num657; + this.ai[3] = this.velocity.X; + } + else + { + if (this.position.X + (float)this.width > Main.player[this.target].position.X && this.position.X < Main.player[this.target].position.X + (float)Main.player[this.target].width && this.position.Y < Main.player[this.target].position.Y + (float)Main.player[this.target].height) + { + this.velocity.X = this.velocity.X * 0.8f; + this.ai[3] = 0f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + if (this.ai[3] != 0f) + { + this.velocity.X = this.ai[3]; + this.velocity.Y = this.velocity.Y - 0.22f; + } + if (this.ai[1] >= 90f) + { + this.noGravity = false; + this.ai[1] = 0f; + this.ai[0] = 4f; + } + } + if (this.wet && this.directionY < 0) + { + this.velocity.Y = this.velocity.Y - 0.3f; + } + this.rotation += this.ai[2] * (float)this.direction; + return; + } + if (this.ai[0] == 4f) + { + if (this.wet && this.directionY < 0) + { + this.velocity.Y = this.velocity.Y - 0.3f; + } + this.velocity.X = this.velocity.X * 0.96f; + if (this.ai[2] > 0f) + { + this.ai[2] -= 0.01f; + this.rotation += this.ai[2] * (float)this.direction; + } + else + { + if (this.velocity.Y >= 0f) + { + this.rotation = 0f; + } + } + if (this.ai[2] <= 0f && (this.velocity.Y == 0f || this.wet)) + { + this.netUpdate = true; + this.rotation = 0f; + this.ai[2] = 0f; + this.ai[1] = 0f; + this.ai[0] = 5f; + return; + } + } + else + { + if (this.ai[0] == 5f) + { + this.rotation = 0f; + this.velocity.X = 0f; + this.ai[1] += 1f; + if (this.ai[1] >= 30f) + { + this.TargetClosest(true); + this.netUpdate = true; + this.ai[1] = 0f; + this.ai[0] = 0f; + } + if (this.wet) + { + this.ai[0] = 3f; + this.ai[1] = 0f; + return; + } + } + } + } + } + } + else + { + if (this.aiStyle == 40) + { + if (this.target < 0 || this.target == 255 || Main.player[this.target].dead) + { + this.TargetClosest(true); + } + float num659 = 2f; + float num660 = 0.08f; + Vector2 vector78 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num661 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2); + float num662 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2); + num661 = (float)((int)(num661 / 8f) * 8); + num662 = (float)((int)(num662 / 8f) * 8); + vector78.X = (float)((int)(vector78.X / 8f) * 8); + vector78.Y = (float)((int)(vector78.Y / 8f) * 8); + num661 -= vector78.X; + num662 -= vector78.Y; + float num663 = (float)Math.Sqrt((double)(num661 * num661 + num662 * num662)); + if (num663 == 0f) + { + num661 = this.velocity.X; + num662 = this.velocity.Y; + } + else + { + num663 = num659 / num663; + num661 *= num663; + num662 *= num663; + } + if (Main.player[this.target].dead) + { + num661 = (float)this.direction * num659 / 2f; + num662 = -num659 / 2f; + } + this.spriteDirection = -1; + if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.ai[0] += 1f; + if (this.ai[0] > 0f) + { + this.velocity.Y = this.velocity.Y + 0.023f; + } + else + { + this.velocity.Y = this.velocity.Y - 0.023f; + } + if (this.ai[0] < -100f || this.ai[0] > 100f) + { + this.velocity.X = this.velocity.X + 0.023f; + } + else + { + this.velocity.X = this.velocity.X - 0.023f; + } + if (this.ai[0] > 200f) + { + this.ai[0] = -200f; + } + this.velocity.X = this.velocity.X + num661 * 0.007f; + this.velocity.Y = this.velocity.Y + num662 * 0.007f; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + if ((double)this.velocity.X > 1.5) + { + this.velocity.X = this.velocity.X * 0.9f; + } + if ((double)this.velocity.X < -1.5) + { + this.velocity.X = this.velocity.X * 0.9f; + } + if ((double)this.velocity.Y > 1.5) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + if ((double)this.velocity.Y < -1.5) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + else + { + if (this.velocity.X < num661) + { + this.velocity.X = this.velocity.X + num660; + if (this.velocity.X < 0f && num661 > 0f) + { + this.velocity.X = this.velocity.X + num660; + } + } + else + { + if (this.velocity.X > num661) + { + this.velocity.X = this.velocity.X - num660; + if (this.velocity.X > 0f && num661 < 0f) + { + this.velocity.X = this.velocity.X - num660; + } + } + } + if (this.velocity.Y < num662) + { + this.velocity.Y = this.velocity.Y + num660; + if (this.velocity.Y < 0f && num662 > 0f) + { + this.velocity.Y = this.velocity.Y + num660; + } + } + else + { + if (this.velocity.Y > num662) + { + this.velocity.Y = this.velocity.Y - num660; + if (this.velocity.Y > 0f && num662 < 0f) + { + this.velocity.Y = this.velocity.Y - num660; + } + } + } + this.rotation = (float)Math.Atan2((double)num662, (double)num661); + } + float num664 = 0.5f; + if (this.collideX) + { + this.netUpdate = true; + this.velocity.X = this.oldVelocity.X * -num664; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.netUpdate = true; + this.velocity.Y = this.oldVelocity.Y * -num664; + if (this.velocity.Y > 0f && (double)this.velocity.Y < 1.5) + { + this.velocity.Y = 2f; + } + if (this.velocity.Y < 0f && (double)this.velocity.Y > -1.5) + { + this.velocity.Y = -2f; + } + } + if (((this.velocity.X > 0f && this.oldVelocity.X < 0f) || (this.velocity.X < 0f && this.oldVelocity.X > 0f) || (this.velocity.Y > 0f && this.oldVelocity.Y < 0f) || (this.velocity.Y < 0f && this.oldVelocity.Y > 0f)) && !this.justHit) + { + this.netUpdate = true; + } + if (Main.netMode != 1) + { + int num665 = (int)this.center().X / 16; + int num666 = (int)this.center().Y / 16; + bool flag49 = false; + for (int num667 = num665 - 1; num667 <= num665 + 1; num667++) + { + for (int num668 = num666 - 1; num668 <= num666 + 1; num668++) + { + if (Main.tile[num667, num668].wall > 0) + { + flag49 = true; + } + } + } + if (!flag49) + { + if (this.type == 237) + { + this.Transform(236); + return; + } + if (this.type == 238) + { + this.Transform(163); + return; + } + if (this.type == 240) + { + this.Transform(239); + return; + } + this.Transform(164); + return; + } + } + } + else + { + if (this.aiStyle == 41) + { + if (this.ai[2] > 1f) + { + this.ai[2] -= 1f; + } + if (this.ai[2] == 0f) + { + this.ai[0] = -100f; + this.ai[2] = 1f; + this.TargetClosest(true); + this.spriteDirection = this.direction; + } + if (this.wet && this.type != 177) + { + if (this.collideX) + { + this.direction *= -this.direction; + this.spriteDirection = this.direction; + } + if (this.collideY) + { + this.TargetClosest(true); + if (this.oldVelocity.Y < 0f) + { + this.velocity.Y = 5f; + } + else + { + this.velocity.Y = this.velocity.Y - 2f; + } + this.spriteDirection = this.direction; + } + if (this.velocity.Y > 4f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.3f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + } + if (this.velocity.Y == 0f) + { + if (this.ai[3] == this.position.X) + { + this.direction *= -1; + this.ai[2] = 300f; + } + this.ai[3] = 0f; + this.velocity.X = this.velocity.X * 0.8f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if (this.type == 177) + { + this.ai[0] += 2f; + } + else + { + this.ai[0] += 5f; + } + Vector2 vector79 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num669 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector79.X; + float num670 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector79.Y; + float num671 = (float)Math.Sqrt((double)(num669 * num669 + num670 * num670)); + float num672 = 400f / num671; + if (this.type == 177) + { + num672 *= 5f; + } + else + { + num672 *= 10f; + } + if (num672 > 30f) + { + num672 = 30f; + } + this.ai[0] += (float)((int)num672); + if (this.ai[0] >= 0f) + { + this.netUpdate = true; + if (this.ai[2] == 1f) + { + this.TargetClosest(true); + } + if (this.type == 177) + { + if (this.ai[1] == 2f) + { + this.velocity.Y = -11.5f; + this.velocity.X = this.velocity.X + 2f * (float)this.direction; + if (num671 < 350f && num671 > 200f) + { + this.velocity.X = this.velocity.X + (float)this.direction; + } + this.ai[0] = -200f; + this.ai[1] = 0f; + this.ai[3] = this.position.X; + } + else + { + this.velocity.Y = -7.5f; + this.velocity.X = this.velocity.X + (float)(4 * this.direction); + if (num671 < 350f && num671 > 200f) + { + this.velocity.X = this.velocity.X + (float)this.direction; + } + this.ai[0] = -120f; + this.ai[1] += 1f; + } + } + else + { + if (this.ai[1] == 3f) + { + this.velocity.Y = -9f; + this.velocity.X = this.velocity.X + (float)(3 * this.direction); + if (num671 < 350f && num671 > 200f) + { + this.velocity.X = this.velocity.X + (float)this.direction; + } + this.ai[0] = -200f; + this.ai[1] = 0f; + this.ai[3] = this.position.X; + } + else + { + this.velocity.Y = -5f; + this.velocity.X = this.velocity.X + (float)(5 * this.direction); + if (num671 < 350f && num671 > 200f) + { + this.velocity.X = this.velocity.X + (float)this.direction; + } + this.ai[0] = -120f; + this.ai[1] += 1f; + } + } + } + else + { + if (this.ai[0] >= -30f) + { + this.aiAction = 1; + } + } + this.spriteDirection = this.direction; + return; + } + if (this.target < 255) + { + if (this.type == 177) + { + bool flag50 = false; + if (this.position.Y + (float)this.height < Main.player[this.target].position.Y && this.position.X + (float)this.width > Main.player[this.target].position.X && this.position.X < Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + flag50 = true; + this.velocity.X = this.velocity.X * 0.92f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + this.velocity.Y = this.velocity.Y + 0.1f; + } + } + if (!flag50 && ((this.direction == 1 && this.velocity.X < 4f) || (this.direction == -1 && this.velocity.X > -4f))) + { + if ((this.direction == -1 && (double)this.velocity.X < 0.1) || (this.direction == 1 && (double)this.velocity.X > -0.1)) + { + this.velocity.X = this.velocity.X + 0.2f * (float)this.direction; + return; + } + this.velocity.X = this.velocity.X * 0.93f; + return; + } + } + else + { + if ((this.direction == 1 && this.velocity.X < 3f) || (this.direction == -1 && this.velocity.X > -3f)) + { + if ((this.direction == -1 && (double)this.velocity.X < 0.1) || (this.direction == 1 && (double)this.velocity.X > -0.1)) + { + this.velocity.X = this.velocity.X + 0.2f * (float)this.direction; + return; + } + this.velocity.X = this.velocity.X * 0.93f; + return; + } + } + } + } + else + { + if (this.aiStyle == 42) + { + this.TargetClosest(true); + if (this.ai[0] == 0f) + { + if (this.target >= 0) + { + Vector2 vector80 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num673 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector80.X; + float num674 = Main.player[this.target].position.Y - vector80.Y; + float num675 = (float)Math.Sqrt((double)(num673 * num673 + num674 * num674)); + if (num675 < 200f && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.ai[0] = 1f; + } + } + if (this.velocity.X != 0f || this.velocity.Y < 0f || this.velocity.Y > 2f || this.life != this.lifeMax) + { + this.ai[0] = 1f; + return; + } + } + else + { + this.ai[0] += 1f; + if (this.ai[0] >= 21f) + { + this.ai[0] = 21f; + this.Transform(196); + return; + } + } + } + else + { + if (this.aiStyle == 43) + { + if (this.target == -1 || Main.player[this.target].dead || !Main.player[this.target].active) + { + this.TargetClosest(true); + } + if (this.ai[0] == -1f && Main.netMode != 1) + { + float num676 = this.ai[1]; + int num677; + do + { + num677 = Main.rand.Next(3); + if (num677 == 1) + { + num677 = 2; + } + else + { + if (num677 == 2) + { + num677 = 3; + } + } + } + while ((float)num677 == num676); + this.ai[0] = (float)num677; + this.ai[1] = 0f; + this.ai[2] = 0f; + } + if (this.ai[0] == 0f) + { + if (this.ai[1] > 4f && this.ai[1] % 2f == 0f) + { + this.ai[0] = -1f; + this.ai[1] = 0f; + this.ai[2] = 0f; + this.netUpdate = true; + } + else + { + if (this.ai[1] % 2f == 0f) + { + this.TargetClosest(true); + if (Math.Abs(this.position.Y + (float)(this.height / 2) - (Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2))) < 20f) + { + this.localAI[0] = 1f; + this.ai[1] += 1f; + this.ai[2] = 0f; + float num678 = 12f; + Vector2 vector81 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num679 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector81.X; + float num680 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector81.Y; + float num681 = (float)Math.Sqrt((double)(num679 * num679 + num680 * num680)); + num681 = num678 / num681; + this.velocity.X = num679 * num681; + this.velocity.Y = num680 * num681; + this.spriteDirection = this.direction; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + else + { + this.localAI[0] = 0f; + if (this.position.Y + (float)(this.height / 2) < Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2)) + { + this.velocity.Y = this.velocity.Y + 0.15f; + } + else + { + this.velocity.Y = this.velocity.Y - 0.15f; + } + if (this.velocity.Y < -12f) + { + this.velocity.Y = -12f; + } + if (this.velocity.Y > 12f) + { + this.velocity.Y = 12f; + } + if (Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))) > 600f) + { + this.velocity.X = this.velocity.X + 0.15f * (float)this.direction; + } + else + { + if (Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))) < 300f) + { + this.velocity.X = this.velocity.X - 0.15f * (float)this.direction; + } + else + { + this.velocity.X = this.velocity.X * 0.8f; + } + } + if (this.velocity.X < -16f) + { + this.velocity.X = -16f; + } + if (this.velocity.X > 16f) + { + this.velocity.X = 16f; + } + this.spriteDirection = this.direction; + } + } + else + { + if (this.velocity.X < 0f) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + this.spriteDirection = this.direction; + int num682 = 1; + if (this.position.X + (float)(this.width / 2) < Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2)) + { + num682 = -1; + } + if (this.direction == num682 && Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))) > 600f) + { + this.ai[2] = 1f; + } + if (this.ai[2] == 1f) + { + this.TargetClosest(true); + this.spriteDirection = this.direction; + this.localAI[0] = 0f; + this.velocity *= 0.9f; + if ((double)(Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) < 0.1) + { + this.ai[2] = 0f; + this.ai[1] += 1f; + } + } + else + { + this.localAI[0] = 1f; + } + } + } + } + if (this.ai[0] == 2f) + { + this.TargetClosest(true); + this.spriteDirection = this.direction; + float num683 = 12f; + float num684 = 0.07f; + Vector2 vector82 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num685 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector82.X; + float num686 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 200f - vector82.Y; + float num687 = (float)Math.Sqrt((double)(num685 * num685 + num686 * num686)); + if (num687 < 200f) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.netUpdate = true; + } + else + { + num687 = num683 / num687; + if (this.velocity.X < num685) + { + this.velocity.X = this.velocity.X + num684; + if (this.velocity.X < 0f && num685 > 0f) + { + this.velocity.X = this.velocity.X + num684; + } + } + else + { + if (this.velocity.X > num685) + { + this.velocity.X = this.velocity.X - num684; + if (this.velocity.X > 0f && num685 < 0f) + { + this.velocity.X = this.velocity.X - num684; + } + } + } + if (this.velocity.Y < num686) + { + this.velocity.Y = this.velocity.Y + num684; + if (this.velocity.Y < 0f && num686 > 0f) + { + this.velocity.Y = this.velocity.Y + num684; + } + } + else + { + if (this.velocity.Y > num686) + { + this.velocity.Y = this.velocity.Y - num684; + if (this.velocity.Y > 0f && num686 < 0f) + { + this.velocity.Y = this.velocity.Y - num684; + } + } + } + } + } + if (this.ai[0] == 1f) + { + this.localAI[0] = 0f; + this.TargetClosest(true); + Vector2 vector83 = new Vector2(this.position.X + (float)(this.width / 2) + (float)(Main.rand.Next(20) * this.direction), this.position.Y + (float)this.height * 0.8f); + Vector2 vector84 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num688 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector84.X; + float num689 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector84.Y; + float num690 = (float)Math.Sqrt((double)(num688 * num688 + num689 * num689)); + if (Collision.CanHit(vector83, 1, 1, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + this.ai[1] += 1f; + if (this.ai[1] > 40f) + { + this.ai[1] = 0f; + this.ai[2] += 1f; + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1); + if (Main.netMode != 1) + { + int num691 = Main.rand.Next(210, 212); + int num692 = NPC.NewNPC((int)vector83.X, (int)vector83.Y, num691, 0); + Main.npc[num692].velocity.X = (float)Main.rand.Next(-200, 201) * 0.002f; + Main.npc[num692].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.002f; + Main.npc[num692].localAI[0] = 60f; + Main.npc[num692].netUpdate = true; + } + } + } + if (num690 > 400f || !Collision.CanHit(new Vector2(vector83.X, vector83.Y - 30f), 1, 1, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + float num693 = 14f; + float num694 = 0.1f; + vector84 = vector83; + num688 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector84.X; + num689 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector84.Y; + num690 = (float)Math.Sqrt((double)(num688 * num688 + num689 * num689)); + num690 = num693 / num690; + if (this.velocity.X < num688) + { + this.velocity.X = this.velocity.X + num694; + if (this.velocity.X < 0f && num688 > 0f) + { + this.velocity.X = this.velocity.X + num694; + } + } + else + { + if (this.velocity.X > num688) + { + this.velocity.X = this.velocity.X - num694; + if (this.velocity.X > 0f && num688 < 0f) + { + this.velocity.X = this.velocity.X - num694; + } + } + } + if (this.velocity.Y < num689) + { + this.velocity.Y = this.velocity.Y + num694; + if (this.velocity.Y < 0f && num689 > 0f) + { + this.velocity.Y = this.velocity.Y + num694; + } + } + else + { + if (this.velocity.Y > num689) + { + this.velocity.Y = this.velocity.Y - num694; + if (this.velocity.Y > 0f && num689 < 0f) + { + this.velocity.Y = this.velocity.Y - num694; + } + } + } + } + else + { + this.velocity *= 0.9f; + } + this.spriteDirection = this.direction; + if (this.ai[2] > 5f) + { + this.ai[0] = -1f; + this.ai[1] = 1f; + this.netUpdate = true; + } + } + if (this.ai[0] == 3f) + { + float num695 = 4f; + float num696 = 0.05f; + Vector2 vector85 = new Vector2(this.position.X + (float)(this.width / 2) + (float)(Main.rand.Next(20) * this.direction), this.position.Y + (float)this.height * 0.8f); + Vector2 vector86 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num697 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector86.X; + float num698 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - 300f - vector86.Y; + float num699 = (float)Math.Sqrt((double)(num697 * num697 + num698 * num698)); + this.ai[1] += 1f; + if (this.ai[1] % 40f == 39f && this.position.Y + (float)this.height < Main.player[this.target].position.Y && Collision.CanHit(vector85, 1, 1, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + if (Main.netMode != 1) + { + float num700 = 8f; + float num701 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector85.X + (float)Main.rand.Next(-80, 81); + float num702 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector85.Y + (float)Main.rand.Next(-40, 41); + float num703 = (float)Math.Sqrt((double)(num701 * num701 + num702 * num702)); + num703 = num700 / num703; + num701 *= num703; + num702 *= num703; + int num704 = 11; + int num705 = 55; + int num706 = Projectile.NewProjectile(vector85.X, vector85.Y, num701, num702, num705, num704, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num706].timeLeft = 300; + } + } + if (!Collision.CanHit(new Vector2(vector85.X, vector85.Y - 30f), 1, 1, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + num695 = 14f; + num696 = 0.1f; + vector86 = vector85; + num697 = Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2) - vector86.X; + num698 = Main.player[this.target].position.Y + (float)(Main.player[this.target].height / 2) - vector86.Y; + num699 = (float)Math.Sqrt((double)(num697 * num697 + num698 * num698)); + num699 = num695 / num699; + if (this.velocity.X < num697) + { + this.velocity.X = this.velocity.X + num696; + if (this.velocity.X < 0f && num697 > 0f) + { + this.velocity.X = this.velocity.X + num696; + } + } + else + { + if (this.velocity.X > num697) + { + this.velocity.X = this.velocity.X - num696; + if (this.velocity.X > 0f && num697 < 0f) + { + this.velocity.X = this.velocity.X - num696; + } + } + } + if (this.velocity.Y < num698) + { + this.velocity.Y = this.velocity.Y + num696; + if (this.velocity.Y < 0f && num698 > 0f) + { + this.velocity.Y = this.velocity.Y + num696; + } + } + else + { + if (this.velocity.Y > num698) + { + this.velocity.Y = this.velocity.Y - num696; + if (this.velocity.Y > 0f && num698 < 0f) + { + this.velocity.Y = this.velocity.Y - num696; + } + } + } + } + else + { + if (num699 > 100f) + { + this.TargetClosest(true); + this.spriteDirection = this.direction; + num699 = num695 / num699; + if (this.velocity.X < num697) + { + this.velocity.X = this.velocity.X + num696; + if (this.velocity.X < 0f && num697 > 0f) + { + this.velocity.X = this.velocity.X + num696 * 2f; + } + } + else + { + if (this.velocity.X > num697) + { + this.velocity.X = this.velocity.X - num696; + if (this.velocity.X > 0f && num697 < 0f) + { + this.velocity.X = this.velocity.X - num696 * 2f; + } + } + } + if (this.velocity.Y < num698) + { + this.velocity.Y = this.velocity.Y + num696; + if (this.velocity.Y < 0f && num698 > 0f) + { + this.velocity.Y = this.velocity.Y + num696 * 2f; + } + } + else + { + if (this.velocity.Y > num698) + { + this.velocity.Y = this.velocity.Y - num696; + if (this.velocity.Y > 0f && num698 < 0f) + { + this.velocity.Y = this.velocity.Y - num696 * 2f; + } + } + } + } + } + if (this.ai[1] > 800f) + { + this.ai[0] = -1f; + this.ai[1] = 3f; + this.netUpdate = true; + return; + } + } + } + else + { + if (this.aiStyle == 44) + { + this.noGravity = true; + if (this.collideX) + { + this.velocity.X = this.oldVelocity.X * -0.5f; + if (this.direction == -1 && this.velocity.X > 0f && this.velocity.X < 2f) + { + this.velocity.X = 2f; + } + if (this.direction == 1 && this.velocity.X < 0f && this.velocity.X > -2f) + { + this.velocity.X = -2f; + } + } + if (this.collideY) + { + this.velocity.Y = this.oldVelocity.Y * -0.5f; + if (this.velocity.Y > 0f && this.velocity.Y < 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < 0f && this.velocity.Y > -1f) + { + this.velocity.Y = -1f; + } + } + this.TargetClosest(true); + float num707 = 0.05f; + float num708 = 3f; + float num709 = Math.Abs(this.position.X + (float)(this.width / 2) - (Main.player[this.target].position.X + (float)(Main.player[this.target].width / 2))); + float num710 = Main.player[this.target].position.Y - (float)(this.height / 2); + if (num709 > 30f) + { + if (this.direction == -1 && this.velocity.X > -num708) + { + this.velocity.X = this.velocity.X - num707; + if (this.velocity.X > num708) + { + this.velocity.X = this.velocity.X - num707; + } + else + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num707 / 2f; + } + } + if (this.velocity.X < -num708) + { + this.velocity.X = -num708; + } + } + else + { + if (this.direction == 1 && this.velocity.X < num708) + { + this.velocity.X = this.velocity.X + num707; + if (this.velocity.X < -num708) + { + this.velocity.X = this.velocity.X + num707; + } + else + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num707 / 2f; + } + } + if (this.velocity.X > num708) + { + this.velocity.X = num708; + } + } + } + } + if (num709 > 100f) + { + num710 -= 50f; + } + if (this.position.Y < num710) + { + this.velocity.Y = this.velocity.Y + 0.01f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.01f; + } + } + else + { + this.velocity.Y = this.velocity.Y - 0.01f; + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.01f; + } + } + if (this.velocity.Y < -1f) + { + this.velocity.Y = -1f; + } + if (this.velocity.Y > 1f) + { + this.velocity.Y = 1f; + return; + } + } + else + { + if (this.aiStyle == 45) + { + NPC.golemBoss = this.whoAmI; + if (this.localAI[0] == 0f && Main.netMode != 1) + { + this.localAI[0] = 1f; + NPC.NewNPC((int)this.center().X - 84, (int)this.center().Y - 9, 247, 0); + NPC.NewNPC((int)this.center().X + 78, (int)this.center().Y - 9, 248, 0); + NPC.NewNPC((int)this.center().X - 3, (int)this.center().Y - 57, 246, 0); + } + if (this.alpha > 0) + { + this.alpha -= 10; + if (this.alpha < 0) + { + this.alpha = 0; + } + this.ai[1] = 0f; + } + bool flag51 = false; + bool flag52 = false; + bool flag53 = false; + this.dontTakeDamage = false; + for (int num711 = 0; num711 < 200; num711++) + { + if (Main.npc[num711].active && Main.npc[num711].type == 246) + { + flag51 = true; + } + if (Main.npc[num711].active && Main.npc[num711].type == 247) + { + flag52 = true; + } + if (Main.npc[num711].active && Main.npc[num711].type == 248) + { + flag53 = true; + } + } + this.dontTakeDamage = flag51; + if (!flag52) + { + int num712 = Dust.NewDust(new Vector2(this.center().X - 80f, this.center().Y - 9f), 8, 8, 31, 0f, 0f, 100, default(Color), 1f); + Main.dust[num712].alpha += Main.rand.Next(100); + Main.dust[num712].velocity *= 0.2f; + Dust expr_2B011_cp_0 = Main.dust[num712]; + expr_2B011_cp_0.velocity.Y = expr_2B011_cp_0.velocity.Y - (0.5f + (float)Main.rand.Next(10) * 0.1f); + Main.dust[num712].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; + if (Main.rand.Next(10) == 0) + { + num712 = Dust.NewDust(new Vector2(this.center().X - 80f, this.center().Y - 9f), 8, 8, 6, 0f, 0f, 0, default(Color), 1f); + if (Main.rand.Next(20) != 0) + { + Main.dust[num712].noGravity = true; + Main.dust[num712].scale *= 1f + (float)Main.rand.Next(10) * 0.1f; + Dust expr_2B11C_cp_0 = Main.dust[num712]; + expr_2B11C_cp_0.velocity.Y = expr_2B11C_cp_0.velocity.Y - 1f; + } + } + } + if (!flag53) + { + int num713 = Dust.NewDust(new Vector2(this.center().X + 62f, this.center().Y - 9f), 8, 8, 31, 0f, 0f, 100, default(Color), 1f); + Main.dust[num713].alpha += Main.rand.Next(100); + Main.dust[num713].velocity *= 0.2f; + Dust expr_2B1D9_cp_0 = Main.dust[num713]; + expr_2B1D9_cp_0.velocity.Y = expr_2B1D9_cp_0.velocity.Y - (0.5f + (float)Main.rand.Next(10) * 0.1f); + Main.dust[num713].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; + if (Main.rand.Next(10) == 0) + { + num713 = Dust.NewDust(new Vector2(this.center().X + 62f, this.center().Y - 9f), 8, 8, 6, 0f, 0f, 0, default(Color), 1f); + if (Main.rand.Next(20) != 0) + { + Main.dust[num713].noGravity = true; + Main.dust[num713].scale *= 1f + (float)Main.rand.Next(10) * 0.1f; + Dust expr_2B2E4_cp_0 = Main.dust[num713]; + expr_2B2E4_cp_0.velocity.Y = expr_2B2E4_cp_0.velocity.Y - 1f; + } + } + } + if (this.ai[0] == 0f) + { + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.8f; + this.ai[1] += 1f; + if (this.ai[1] > 0f) + { + if (!flag52) + { + this.ai[1] += 2f; + } + if (!flag53) + { + this.ai[1] += 2f; + } + if (!flag51) + { + this.ai[1] += 4f; + } + if (this.life < this.lifeMax) + { + this.ai[1] += 2f; + } + if (this.life < this.lifeMax / 2) + { + this.ai[1] += 4f; + } + if (this.life < this.lifeMax / 3) + { + this.ai[1] += 8f; + } + } + if (this.ai[1] >= 300f) + { + this.ai[1] = -20f; + this.frameCounter = 0.0; + } + else + { + if (this.ai[1] == -1f) + { + this.TargetClosest(true); + this.velocity.X = (float)(4 * this.direction); + this.velocity.Y = -12.1f; + this.ai[0] = 1f; + this.ai[1] = 0f; + } + } + } + } + else + { + if (this.ai[0] == 1f) + { + if (this.velocity.Y == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + this.ai[0] = 0f; + for (int num714 = (int)this.position.X - 20; num714 < (int)this.position.X + this.width + 40; num714 += 20) + { + for (int num715 = 0; num715 < 4; num715++) + { + int num716 = Dust.NewDust(new Vector2(this.position.X - 20f, this.position.Y + (float)this.height), this.width + 20, 4, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num716].velocity *= 0.2f; + } + int num717 = Gore.NewGore(new Vector2((float)(num714 - 20), this.position.Y + (float)this.height - 8f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num717].velocity *= 0.4f; + } + } + else + { + this.TargetClosest(true); + if (this.position.X < Main.player[this.target].position.X && this.position.X + (float)this.width > Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + this.velocity.X = this.velocity.X * 0.9f; + this.velocity.Y = this.velocity.Y + 0.2f; + } + else + { + if (this.direction < 0) + { + this.velocity.X = this.velocity.X - 0.2f; + } + else + { + if (this.direction > 0) + { + this.velocity.X = this.velocity.X + 0.2f; + } + } + float num718 = 3f; + if (this.life < this.lifeMax) + { + num718 += 1f; + } + if (this.life < this.lifeMax / 2) + { + num718 += 1f; + } + if (this.life < this.lifeMax / 4) + { + num718 += 1f; + } + if (this.velocity.X < -num718) + { + this.velocity.X = -num718; + } + if (this.velocity.X > num718) + { + this.velocity.X = num718; + } + } + } + } + } + if (this.target <= 0 || this.target == 255 || Main.player[this.target].dead) + { + this.TargetClosest(true); + } + int num719 = 3000; + if (Math.Abs(this.center().X - Main.player[this.target].center().X) + Math.Abs(this.center().Y - Main.player[this.target].center().Y) > (float)num719) + { + this.TargetClosest(true); + if (Math.Abs(this.center().X - Main.player[this.target].center().X) + Math.Abs(this.center().Y - Main.player[this.target].center().Y) > (float)num719) + { + this.active = false; + return; + } + } + } + else + { + if (this.aiStyle == 46) + { + if (NPC.golemBoss < 0) + { + this.StrikeNPC(9999, 0f, 0, false, false); + return; + } + this.noTileCollide = false; + float num720 = 12f; + Vector2 vector87 = new Vector2(this.center().X, this.center().Y); + float num721 = Main.npc[NPC.golemBoss].center().X - vector87.X; + float num722 = Main.npc[NPC.golemBoss].center().Y - vector87.Y; + num722 -= 57f; + num721 -= 3f; + float num723 = (float)Math.Sqrt((double)(num721 * num721 + num722 * num722)); + if (num723 < 20f) + { + this.rotation = 0f; + this.velocity.X = num721; + this.velocity.Y = num722; + } + else + { + num723 = num720 / num723; + this.velocity.X = num721 * num723; + this.velocity.Y = num722 * num723; + this.rotation = this.velocity.X * 0.1f; + } + if (this.alpha > 0) + { + this.alpha -= 10; + if (this.alpha < 0) + { + this.alpha = 0; + } + this.ai[1] = 30f; + } + if (this.ai[0] == 0f) + { + this.ai[1] += 1f; + int num724 = 300; + if (this.ai[1] < 20f || this.ai[1] > (float)(num724 - 20)) + { + this.localAI[0] = 1f; + } + else + { + this.localAI[0] = 0f; + } + if (this.ai[1] >= (float)num724) + { + this.TargetClosest(true); + this.ai[1] = 0f; + Vector2 vector88 = new Vector2(this.center().X, this.center().Y + 10f); + float num725 = 8f; + float num726 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector88.X; + float num727 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector88.Y; + float num728 = (float)Math.Sqrt((double)(num726 * num726 + num727 * num727)); + num728 = num725 / num728; + num726 *= num728; + num727 *= num728; + int num729 = 18; + int num730 = 258; + if (Main.netMode != 1) + { + Projectile.NewProjectile(vector88.X, vector88.Y, num726, num727, num730, num729, 0f, Main.myPlayer, 0f, 0f); + } + } + } + else + { + if (this.ai[0] == 1f) + { + this.TargetClosest(true); + Vector2 vector89 = new Vector2(this.center().X, this.center().Y + 10f); + if (Main.player[this.target].center().X < this.center().X - (float)this.width) + { + this.localAI[1] = -1f; + vector89.X -= 40f; + } + else + { + if (Main.player[this.target].center().X > this.center().X + (float)this.width) + { + this.localAI[1] = 1f; + vector89.X += 40f; + } + else + { + this.localAI[1] = 0f; + } + } + this.ai[1] += 1f; + if ((double)this.life < (double)this.lifeMax * 0.4) + { + this.ai[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.3) + { + this.ai[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.2) + { + this.ai[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + this.ai[1] += 1f; + } + int num731 = 300; + if (this.ai[1] < 20f || this.ai[1] > (float)(num731 - 20)) + { + this.localAI[0] = 1f; + } + else + { + this.localAI[0] = 0f; + } + if (this.ai[1] >= (float)num731) + { + this.TargetClosest(true); + this.ai[1] = 0f; + float num732 = 8f; + float num733 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector89.X; + float num734 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector89.Y; + float num735 = (float)Math.Sqrt((double)(num733 * num733 + num734 * num734)); + num735 = num732 / num735; + num733 *= num735; + num734 *= num735; + int num736 = 24; + int num737 = 258; + if (Main.netMode != 1) + { + Projectile.NewProjectile(vector89.X, vector89.Y, num733, num734, num737, num736, 0f, Main.myPlayer, 0f, 0f); + } + } + this.ai[2] += 1f; + if (this.life < this.lifeMax / 3) + { + this.ai[2] += 1f; + } + if (this.life < this.lifeMax / 4) + { + this.ai[2] += 1f; + } + if (this.life < this.lifeMax / 5) + { + this.ai[2] += 1f; + } + if (this.ai[2] > (float)(60 + Main.rand.Next(600))) + { + this.ai[2] = 0f; + if (this.localAI[1] != 0f) + { + vector89 = new Vector2(this.center().X, this.center().Y - 22f); + if (this.localAI[1] == -1f) + { + vector89.X -= 30f; + } + else + { + if (this.localAI[1] == 1f) + { + vector89.X += 30f; + } + } + float num738 = 12f; + float num739 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector89.X; + float num740 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector89.Y; + float num741 = (float)Math.Sqrt((double)(num739 * num739 + num740 * num740)); + num741 = num738 / num741; + num739 *= num741; + num740 *= num741; + int num742 = 29; + int num743 = 259; + vector89.X += num739 * 3f; + vector89.Y += num740 * 3f; + if (Main.netMode != 1) + { + int num744 = Projectile.NewProjectile(vector89.X, vector89.Y, num739, num740, num743, num742, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num744].timeLeft = 300; + } + } + } + } + } + if (this.life < this.lifeMax / 2) + { + this.ai[0] = 1f; + return; + } + this.ai[0] = 0f; + return; + } + else + { + if (this.aiStyle == 47) + { + if (NPC.golemBoss < 0) + { + this.StrikeNPC(9999, 0f, 0, false, false); + return; + } + if (this.alpha > 0) + { + this.alpha -= 10; + if (this.alpha < 0) + { + this.alpha = 0; + } + this.ai[1] = 0f; + } + if (this.ai[0] == 0f) + { + this.noTileCollide = true; + float num745 = 8f; + if (this.life < this.lifeMax / 2) + { + num745 += 2f; + } + if (this.life < this.lifeMax / 4) + { + num745 += 2f; + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax) + { + num745 += 8f; + } + Vector2 vector90 = new Vector2(this.center().X, this.center().Y); + float num746 = Main.npc[NPC.golemBoss].center().X - vector90.X; + float num747 = Main.npc[NPC.golemBoss].center().Y - vector90.Y; + num747 -= 9f; + if (this.type == 247) + { + num746 -= 84f; + } + else + { + num746 += 78f; + } + float num748 = (float)Math.Sqrt((double)(num746 * num746 + num747 * num747)); + if (num748 < 12f + num745) + { + this.rotation = 0f; + this.velocity.X = num746; + this.velocity.Y = num747; + this.ai[1] += 1f; + if (this.life < this.lifeMax / 2) + { + this.ai[1] += 1f; + } + if (this.life < this.lifeMax / 4) + { + this.ai[1] += 1f; + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax) + { + this.ai[1] += 10f; + } + if (this.ai[1] >= 60f) + { + this.TargetClosest(true); + if ((this.type == 247 && this.center().X + 100f > Main.player[this.target].center().X) || (this.type == 248 && this.center().X - 100f < Main.player[this.target].center().X)) + { + this.ai[1] = 0f; + this.ai[0] = 1f; + return; + } + this.ai[1] = 0f; + return; + } + } + else + { + num748 = num745 / num748; + this.velocity.X = num746 * num748; + this.velocity.Y = num747 * num748; + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + if (this.type == 247) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + return; + } + } + } + else + { + if (this.ai[0] == 1f) + { + this.noTileCollide = false; + float num749 = 10f; + if (this.life < this.lifeMax / 2) + { + num749 += 4f; + } + if (this.life < this.lifeMax / 4) + { + num749 += 4f; + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax) + { + num749 += 10f; + } + Vector2 vector91 = new Vector2(this.center().X, this.center().Y); + float num750 = Main.player[this.target].center().X - vector91.X; + float num751 = Main.player[this.target].center().Y - vector91.Y; + float num752 = (float)Math.Sqrt((double)(num750 * num750 + num751 * num751)); + num752 = num749 / num752; + this.velocity.X = num750 * num752; + this.velocity.Y = num751 * num752; + this.ai[0] = 2f; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + if (this.type == 247) + { + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + return; + } + } + else + { + if (this.ai[0] == 2f) + { + Vector2 vector92 = new Vector2(this.center().X, this.center().Y); + float num753 = Main.npc[NPC.golemBoss].center().X - vector92.X; + float num754 = Main.npc[NPC.golemBoss].center().Y - vector92.Y; + num753 += Main.npc[NPC.golemBoss].velocity.X; + num754 += Main.npc[NPC.golemBoss].velocity.Y; + num754 -= 9f; + if (this.type == 247) + { + num753 -= 84f; + } + else + { + num753 += 78f; + } + float num755 = (float)Math.Sqrt((double)(num753 * num753 + num754 * num754)); + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax) + { + this.knockBackResist = 0f; + if (num755 > 700f || this.collideX || this.collideY) + { + this.noTileCollide = true; + this.ai[0] = 0f; + return; + } + } + else + { + if (num755 > 600f || this.collideX || this.collideY || this.justHit) + { + this.noTileCollide = true; + this.ai[0] = 0f; + return; + } + } + } + else + { + if (this.ai[0] == 3f) + { + this.noTileCollide = true; + float num756 = 12f; + float num757 = 0.4f; + Vector2 vector93 = new Vector2(this.center().X, this.center().Y); + float num758 = Main.player[this.target].center().X - vector93.X; + float num759 = Main.player[this.target].center().Y - vector93.Y; + float num760 = (float)Math.Sqrt((double)(num758 * num758 + num759 * num759)); + num760 = num756 / num760; + num758 *= num760; + num759 *= num760; + if (this.velocity.X < num758) + { + this.velocity.X = this.velocity.X + num757; + if (this.velocity.X < 0f && num758 > 0f) + { + this.velocity.X = this.velocity.X + num757 * 2f; + } + } + else + { + if (this.velocity.X > num758) + { + this.velocity.X = this.velocity.X - num757; + if (this.velocity.X > 0f && num758 < 0f) + { + this.velocity.X = this.velocity.X - num757 * 2f; + } + } + } + if (this.velocity.Y < num759) + { + this.velocity.Y = this.velocity.Y + num757; + if (this.velocity.Y < 0f && num759 > 0f) + { + this.velocity.Y = this.velocity.Y + num757 * 2f; + } + } + else + { + if (this.velocity.Y > num759) + { + this.velocity.Y = this.velocity.Y - num757; + if (this.velocity.Y > 0f && num759 < 0f) + { + this.velocity.Y = this.velocity.Y - num757 * 2f; + } + } + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + if (this.type == 247) + { + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + return; + } + } + } + } + } + } + else + { + if (this.aiStyle == 48) + { + if (NPC.golemBoss < 0) + { + this.StrikeNPC(9999, 0f, 0, false, false); + return; + } + this.TargetClosest(true); + float num761 = 7f; + float num762 = 0.05f; + Vector2 vector94 = new Vector2(this.center().X, this.center().Y); + float num763 = Main.player[this.target].center().X - vector94.X; + float num764 = Main.player[this.target].center().Y - vector94.Y - 300f; + float num765 = (float)Math.Sqrt((double)(num763 * num763 + num764 * num764)); + num765 = num761 / num765; + num763 *= num765; + num764 *= num765; + if (this.velocity.X < num763) + { + this.velocity.X = this.velocity.X + num762; + if (this.velocity.X < 0f && num763 > 0f) + { + this.velocity.X = this.velocity.X + num762; + } + } + else + { + if (this.velocity.X > num763) + { + this.velocity.X = this.velocity.X - num762; + if (this.velocity.X > 0f && num763 < 0f) + { + this.velocity.X = this.velocity.X - num762; + } + } + } + if (this.velocity.Y < num764) + { + this.velocity.Y = this.velocity.Y + num762; + if (this.velocity.Y < 0f && num764 > 0f) + { + this.velocity.Y = this.velocity.Y + num762; + } + } + else + { + if (this.velocity.Y > num764) + { + this.velocity.Y = this.velocity.Y - num762; + if (this.velocity.Y > 0f && num764 < 0f) + { + this.velocity.Y = this.velocity.Y - num762; + } + } + } + this.ai[1] += 1f; + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.8) + { + this.ai[1] += 1f; + } + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.6) + { + this.ai[1] += 1f; + } + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.4) + { + this.ai[1] += 1f; + } + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.2) + { + this.ai[1] += 1f; + } + int num766 = 300; + if (this.ai[1] < 20f || this.ai[1] > (float)(num766 - 20)) + { + this.localAI[0] = 1f; + } + else + { + this.localAI[0] = 0f; + } + if (this.ai[1] >= (float)num766) + { + this.TargetClosest(true); + this.ai[1] = 0f; + Vector2 vector95 = new Vector2(this.center().X, this.center().Y - 10f); + float num767 = 8f; + float num768 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector95.X; + float num769 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector95.Y; + float num770 = (float)Math.Sqrt((double)(num768 * num768 + num769 * num769)); + num770 = num767 / num770; + num768 *= num770; + num769 *= num770; + int num771 = 20; + int num772 = 258; + if (Main.netMode != 1) + { + Projectile.NewProjectile(vector95.X, vector95.Y, num768, num769, num772, num771, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 2) + { + this.ai[2] += 1f; + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 3) + { + this.ai[2] += 1f; + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 4) + { + this.ai[2] += 1f; + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 5) + { + this.ai[2] += 1f; + } + if (this.ai[2] > (float)(80 + Main.rand.Next(1200))) + { + this.ai[2] = 0f; + for (int num773 = 0; num773 < 2; num773++) + { + Vector2 vector96 = new Vector2(this.center().X, this.center().Y - 50f); + if (num773 == 0) + { + vector96.X -= 14f; + } + else + { + if (num773 == 1) + { + vector96.X += 14f; + } + } + float num774 = 12f; + float num775 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector96.X; + float num776 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector96.Y; + float num777 = (float)Math.Sqrt((double)(num775 * num775 + num776 * num776)); + num777 = num774 / num777; + num775 *= num777; + num776 *= num777; + int num778 = 25; + int num779 = 259; + vector96.X += num775 * 3f; + vector96.Y += num776 * 3f; + if (Main.netMode != 1) + { + int num780 = Projectile.NewProjectile(vector96.X, vector96.Y, num775, num776, num779, num778, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num780].timeLeft = 300; + } + } + return; + } + } + else + { + if (this.aiStyle == 49) + { + this.noGravity = true; + this.TargetClosest(true); + float num781 = 4f; + float num782 = 0.25f; + Vector2 vector97 = new Vector2(this.center().X, this.center().Y); + float num783 = Main.player[this.target].center().X - vector97.X; + float num784 = Main.player[this.target].center().Y - vector97.Y - 200f; + float num785 = (float)Math.Sqrt((double)(num783 * num783 + num784 * num784)); + if (num785 < 20f) + { + num783 = this.velocity.X; + num784 = this.velocity.Y; + } + else + { + num785 = num781 / num785; + num783 *= num785; + num784 *= num785; + } + if (this.velocity.X < num783) + { + this.velocity.X = this.velocity.X + num782; + if (this.velocity.X < 0f && num783 > 0f) + { + this.velocity.X = this.velocity.X + num782 * 2f; + } + } + else + { + if (this.velocity.X > num783) + { + this.velocity.X = this.velocity.X - num782; + if (this.velocity.X > 0f && num783 < 0f) + { + this.velocity.X = this.velocity.X - num782 * 2f; + } + } + } + if (this.velocity.Y < num784) + { + this.velocity.Y = this.velocity.Y + num782; + if (this.velocity.Y < 0f && num784 > 0f) + { + this.velocity.Y = this.velocity.Y + num782 * 2f; + } + } + else + { + if (this.velocity.Y > num784) + { + this.velocity.Y = this.velocity.Y - num782; + if (this.velocity.Y > 0f && num784 < 0f) + { + this.velocity.Y = this.velocity.Y - num782 * 2f; + } + } + } + if (this.position.X + (float)this.width > Main.player[this.target].position.X && this.position.X < Main.player[this.target].position.X + (float)Main.player[this.target].width && this.position.Y + (float)this.height < Main.player[this.target].position.Y && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && Main.netMode != 1) + { + this.ai[0] += 1f; + if (this.ai[0] > 8f) + { + this.ai[0] = 0f; + int num786 = (int)(this.position.X + 10f + (float)Main.rand.Next(this.width - 20)); + int num787 = (int)(this.position.Y + (float)this.height + 4f); + Projectile.NewProjectile((float)num786, (float)num787, 0f, 5f, 264, 20, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + else + { + if (this.aiStyle == 50) + { + if (this.timeLeft > 5) + { + this.timeLeft = 5; + } + this.noTileCollide = true; + this.velocity.Y = this.velocity.Y + 0.02f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.99f; + } + if (this.velocity.Y > 1f) + { + this.velocity.Y = 1f; + } + this.TargetClosest(true); + if (this.position.X + (float)this.width < Main.player[this.target].position.X) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.velocity.X = this.velocity.X + 0.1f; + } + else + { + if (this.position.X > Main.player[this.target].position.X + (float)Main.player[this.target].width) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.velocity.X = this.velocity.X - 0.1f; + } + } + if (this.velocity.X > 5f || this.velocity.X < -5f) + { + this.velocity.X = this.velocity.X * 0.97f; + } + this.rotation = this.velocity.X * 0.2f; + return; + } + if (this.aiStyle == 51) + { + this.TargetClosest(true); + if (Main.netMode != 1) + { + int num788 = 6000; + if (Math.Abs(this.center().X - Main.player[this.target].center().X) + Math.Abs(this.center().Y - Main.player[this.target].center().Y) > (float)num788) + { + this.active = false; + this.life = 0; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + } + } + NPC.plantBoss = this.whoAmI; + if (this.localAI[0] == 0f && Main.netMode != 1) + { + this.localAI[0] = 1f; + NPC.NewNPC((int)this.center().X, (int)this.center().Y, 263, this.whoAmI); + NPC.NewNPC((int)this.center().X, (int)this.center().Y, 263, this.whoAmI); + NPC.NewNPC((int)this.center().X, (int)this.center().Y, 263, this.whoAmI); + } + int[] array = new int[3]; + float num789 = 0f; + float num790 = 0f; + int num791 = 0; + for (int num792 = 0; num792 < 200; num792++) + { + if (Main.npc[num792].active && Main.npc[num792].aiStyle == 52) + { + num789 += Main.npc[num792].center().X; + num790 += Main.npc[num792].center().Y; + array[num791] = num792; + num791++; + if (num791 > 2) + { + break; + } + } + } + num789 /= (float)num791; + num790 /= (float)num791; + float num793 = 2.5f; + float num794 = 0.025f; + if (this.life < this.lifeMax / 2) + { + num793 = 5f; + num794 = 0.05f; + } + if (this.life < this.lifeMax / 4) + { + num793 = 7f; + } + if (!Main.player[this.target].zoneJungle || (double)Main.player[this.target].position.Y < Main.worldSurface / 16.0 || Main.player[this.target].position.Y > (float)(Main.maxTilesY / 16 - 300)) + { + num793 += 4f; + } + Vector2 vector98 = new Vector2(num789, num790); + float num795 = Main.player[this.target].center().X - vector98.X; + float num796 = Main.player[this.target].center().Y - vector98.Y; + float num797 = (float)Math.Sqrt((double)(num795 * num795 + num796 * num796)); + int num798 = 500; + if (num797 >= (float)num798) + { + num797 = (float)num798 / num797; + num795 *= num797; + num796 *= num797; + } + num789 += num795; + num790 += num796; + vector98 = new Vector2(this.center().X, this.center().Y); + num795 = num789 - vector98.X; + num796 = num790 - vector98.Y; + num797 = (float)Math.Sqrt((double)(num795 * num795 + num796 * num796)); + if (num797 < num793) + { + num795 = this.velocity.X; + num796 = this.velocity.Y; + } + else + { + num797 = num793 / num797; + num795 *= num797; + num796 *= num797; + } + if (this.velocity.X < num795) + { + this.velocity.X = this.velocity.X + num794; + if (this.velocity.X < 0f && num795 > 0f) + { + this.velocity.X = this.velocity.X + num794 * 2f; + } + } + else + { + if (this.velocity.X > num795) + { + this.velocity.X = this.velocity.X - num794; + if (this.velocity.X > 0f && num795 < 0f) + { + this.velocity.X = this.velocity.X - num794 * 2f; + } + } + } + if (this.velocity.Y < num796) + { + this.velocity.Y = this.velocity.Y + num794; + if (this.velocity.Y < 0f && num796 > 0f) + { + this.velocity.Y = this.velocity.Y + num794 * 2f; + } + } + else + { + if (this.velocity.Y > num796) + { + this.velocity.Y = this.velocity.Y - num794; + if (this.velocity.Y > 0f && num796 < 0f) + { + this.velocity.Y = this.velocity.Y - num794 * 2f; + } + } + } + Vector2 vector99 = new Vector2(this.center().X, this.center().Y); + float num799 = Main.player[this.target].center().X - vector99.X; + float num800 = Main.player[this.target].center().Y - vector99.Y; + this.rotation = (float)Math.Atan2((double)num800, (double)num799) + 1.57f; + if (this.life > this.lifeMax / 2) + { + this.defense = 36; + this.damage = 50; + if (Main.netMode != 1) + { + this.localAI[1] += 1f; + if ((double)this.life < (double)this.lifeMax * 0.9) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.8) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.7) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.6) + { + this.localAI[1] += 1f; + } + if (this.localAI[1] > 80f) + { + this.localAI[1] = 0f; + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + Vector2 vector100 = new Vector2(this.center().X, this.center().Y); + float num801 = 15f; + float num802 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector100.X; + float num803 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector100.Y; + float num804 = (float)Math.Sqrt((double)(num802 * num802 + num803 * num803)); + num804 = num801 / num804; + num802 *= num804; + num803 *= num804; + int num805 = 22; + int num806 = 275; + if ((double)this.life < (double)this.lifeMax * 0.8 && Main.rand.Next(4) == 0) + { + num805 = 27; + this.localAI[1] = -30f; + num806 = 276; + } + else + { + if ((double)this.life < (double)this.lifeMax * 0.8 && Main.rand.Next(8) == 0) + { + num805 = 31; + this.localAI[1] = -120f; + num806 = 277; + } + } + vector100.X += num802 * 3f; + vector100.Y += num803 * 3f; + int num807 = Projectile.NewProjectile(vector100.X, vector100.Y, num802, num803, num806, num805, 0f, Main.myPlayer, 0f, 0f); + if (num806 != 277) + { + Main.projectile[num807].timeLeft = 300; + return; + } + } + } + } + } + else + { + this.defense = 10; + this.damage = 70; + if (this.localAI[0] == 1f && Main.netMode != 1) + { + this.localAI[0] = 2f; + for (int num808 = 0; num808 < 8; num808++) + { + NPC.NewNPC((int)this.center().X, (int)this.center().Y, 264, this.whoAmI); + } + } + if (this.localAI[2] == 0f) + { + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 378, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 379, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 380, this.scale); + this.localAI[2] = 1f; + } + this.localAI[1] += 1f; + if ((double)this.life < (double)this.lifeMax * 0.4) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.3) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.2) + { + this.localAI[1] += 1f; + } + if ((double)this.life < (double)this.lifeMax * 0.1) + { + this.localAI[1] += 1f; + } + if (this.localAI[1] >= 350f) + { + float num809 = 8f; + Vector2 vector101 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num810 = Main.player[this.target].position.X + (float)Main.player[this.target].width * 0.5f - vector101.X + (float)Main.rand.Next(-10, 11); + float num811 = Math.Abs(num810 * 0.2f); + float num812 = Main.player[this.target].position.Y + (float)Main.player[this.target].height * 0.5f - vector101.Y + (float)Main.rand.Next(-10, 11); + if (num812 > 0f) + { + num811 = 0f; + } + num812 -= num811; + float num813 = (float)Math.Sqrt((double)(num810 * num810 + num812 * num812)); + num813 = num809 / num813; + num810 *= num813; + num812 *= num813; + int num814 = NPC.NewNPC((int)this.center().X, (int)this.center().Y, 265, 0); + Main.npc[num814].velocity.X = num810; + Main.npc[num814].velocity.Y = num812; + Main.npc[num814].netUpdate = true; + this.localAI[1] = 0f; + return; + } + } + } + else + { + if (this.aiStyle == 52) + { + if (NPC.plantBoss < 0) + { + this.StrikeNPC(9999, 0f, 0, false, false); + this.netUpdate = true; + return; + } + if (Main.netMode == 1) + { + if (this.ai[0] == 0f) + { + this.ai[0] = (float)((int)(this.center().X / 16f)); + } + if (this.ai[1] == 0f) + { + this.ai[1] = (float)((int)(this.center().X / 16f)); + } + } + if (Main.netMode != 1) + { + if (this.ai[0] == 0f || this.ai[1] == 0f) + { + this.localAI[0] = 0f; + } + this.localAI[0] -= 1f; + if (Main.npc[NPC.plantBoss].life < Main.npc[NPC.plantBoss].lifeMax / 2) + { + this.localAI[0] -= 2f; + } + if (Main.npc[NPC.plantBoss].life < Main.npc[NPC.plantBoss].lifeMax / 4) + { + this.localAI[0] -= 2f; + } + if (!Main.player[Main.npc[NPC.plantBoss].target].zoneJungle || (double)Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface / 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > (float)(Main.maxTilesY / 16 - 300)) + { + this.localAI[0] -= 4f; + } + if (this.localAI[0] <= 0f && this.ai[0] != 0f) + { + for (int num815 = 0; num815 < 200; num815++) + { + if (num815 != this.whoAmI && Main.npc[num815].active && Main.npc[num815].type == this.type && (Main.npc[num815].velocity.X != 0f || Main.npc[num815].velocity.Y != 0f)) + { + this.localAI[0] = (float)Main.rand.Next(60, 300); + } + } + } + if (this.localAI[0] <= 0f) + { + this.localAI[0] = (float)Main.rand.Next(300, 600); + bool flag54 = false; + int num816 = 0; + while (!flag54 && num816 <= 1000) + { + num816++; + int num817 = (int)(Main.player[Main.npc[NPC.plantBoss].target].center().X / 16f); + int num818 = (int)(Main.player[Main.npc[NPC.plantBoss].target].center().Y / 16f); + if (this.ai[0] == 0f) + { + num817 = (int)((Main.player[Main.npc[NPC.plantBoss].target].center().X + Main.npc[NPC.plantBoss].center().X) / 32f); + num818 = (int)((Main.player[Main.npc[NPC.plantBoss].target].center().Y + Main.npc[NPC.plantBoss].center().Y) / 32f); + } + int num819 = 20; + num819 += (int)(100f * ((float)num816 / 1000f)); + int num820 = num817 + Main.rand.Next(-num819, num819 + 1); + int num821 = num818 + Main.rand.Next(-num819, num819 + 1); + if (Main.npc[NPC.plantBoss].life < Main.npc[NPC.plantBoss].lifeMax / 2 && Main.rand.Next(6) == 0) + { + this.TargetClosest(true); + int num822 = (int)(Main.player[this.target].center().X / 16f); + int num823 = (int)(Main.player[this.target].center().Y / 16f); + if (Main.tile[num822, num823].wall > 0) + { + num820 = num822; + num821 = num823; + } + } + if (WorldGen.SolidTile(num820, num821) || (Main.tile[num820, num821].wall > 0 && (num816 > 500 || Main.npc[NPC.plantBoss].life < Main.npc[NPC.plantBoss].lifeMax / 2))) + { + flag54 = true; + this.ai[0] = (float)num820; + this.ai[1] = (float)num821; + this.netUpdate = true; + } + } + } + } + if (this.ai[0] > 0f && this.ai[1] > 0f) + { + float num824 = 6f; + if (Main.npc[NPC.plantBoss].life < Main.npc[NPC.plantBoss].lifeMax / 2) + { + num824 = 8f; + } + if (Main.npc[NPC.plantBoss].life < Main.npc[NPC.plantBoss].lifeMax / 4) + { + num824 = 10f; + } + if (!Main.player[Main.npc[NPC.plantBoss].target].zoneJungle || (double)Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface / 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > (float)(Main.maxTilesY / 16 - 300)) + { + num824 += 6f; + } + Vector2 vector102 = new Vector2(this.center().X, this.center().Y); + float num825 = this.ai[0] * 16f - 8f - vector102.X; + float num826 = this.ai[1] * 16f - 8f - vector102.Y; + float num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); + if (num827 < 12f + num824) + { + this.velocity.X = num825; + this.velocity.Y = num826; + } + else + { + num827 = num824 / num827; + this.velocity.X = num825 * num827; + this.velocity.Y = num826 * num827; + } + Vector2 vector103 = new Vector2(this.center().X, this.center().Y); + float num828 = Main.npc[NPC.plantBoss].center().X - vector103.X; + float num829 = Main.npc[NPC.plantBoss].center().Y - vector103.Y; + this.rotation = (float)Math.Atan2((double)num829, (double)num828) - 1.57f; + return; + } + } + else + { + if (this.aiStyle == 53) + { + if (NPC.plantBoss < 0) + { + this.StrikeNPC(9999, 0f, 0, false, false); + this.netUpdate = true; + return; + } + int num830 = NPC.plantBoss; + if (Main.netMode != 1) + { + this.localAI[0] -= 1f; + if (this.localAI[0] <= 0f) + { + this.localAI[0] = (float)Main.rand.Next(120, 480); + this.ai[0] = (float)Main.rand.Next(-100, 101); + this.ai[1] = (float)Main.rand.Next(-100, 101); + this.netUpdate = true; + } + } + this.TargetClosest(true); + float num831 = 0.2f; + float num832 = 200f; + if ((double)Main.npc[num830].life < (double)Main.npc[num830].lifeMax * 0.25) + { + num832 += 100f; + } + if ((double)Main.npc[num830].life < (double)Main.npc[num830].lifeMax * 0.1) + { + num832 += 100f; + } + if (!Main.npc[num830].active || NPC.plantBoss < 0) + { + this.active = false; + return; + } + float num833 = Main.npc[num830].position.X + (float)(Main.npc[num830].width / 2); + float num834 = Main.npc[num830].position.Y + (float)(Main.npc[num830].height / 2); + Vector2 vector104 = new Vector2(num833, num834); + float num835 = num833 + this.ai[0]; + float num836 = num834 + this.ai[1]; + float num837 = num835 - vector104.X; + float num838 = num836 - vector104.Y; + float num839 = (float)Math.Sqrt((double)(num837 * num837 + num838 * num838)); + num839 = num832 / num839; + num837 *= num839; + num838 *= num839; + if (this.position.X < num833 + num837) + { + this.velocity.X = this.velocity.X + num831; + if (this.velocity.X < 0f && num837 > 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + } + else + { + if (this.position.X > num833 + num837) + { + this.velocity.X = this.velocity.X - num831; + if (this.velocity.X > 0f && num837 < 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + } + } + if (this.position.Y < num834 + num838) + { + this.velocity.Y = this.velocity.Y + num831; + if (this.velocity.Y < 0f && num838 > 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + } + else + { + if (this.position.Y > num834 + num838) + { + this.velocity.Y = this.velocity.Y - num831; + if (this.velocity.Y > 0f && num838 < 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + } + } + if (this.velocity.X > 8f) + { + this.velocity.X = 8f; + } + if (this.velocity.X < -8f) + { + this.velocity.X = -8f; + } + if (this.velocity.Y > 8f) + { + this.velocity.Y = 8f; + } + if (this.velocity.Y < -8f) + { + this.velocity.Y = -8f; + } + if (num837 > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)num838, (double)num837); + } + if (num837 < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)num838, (double)num837) + 3.14f; + return; + } + } + else + { + if (this.aiStyle == 54) + { + NPC.crimsonBoss = this.whoAmI; + if (Main.netMode != 1 && this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + for (int num840 = 0; num840 < 20; num840++) + { + float num841 = this.center().X; + float num842 = this.center().Y; + num841 += (float)Main.rand.Next(-this.width, this.width); + num842 += (float)Main.rand.Next(-this.height, this.height); + int num843 = NPC.NewNPC((int)num841, (int)num842, 267, 0); + Main.npc[num843].velocity = new Vector2((float)Main.rand.Next(-30, 31) * 0.1f, (float)Main.rand.Next(-30, 31) * 0.1f); + Main.npc[num843].netUpdate = true; + } + } + if (Main.netMode != 1) + { + this.TargetClosest(true); + int num844 = 6000; + if (Math.Abs(this.center().X - Main.player[this.target].center().X) + Math.Abs(this.center().Y - Main.player[this.target].center().Y) > (float)num844) + { + this.active = false; + this.life = 0; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + } + } + if (this.ai[0] < 0f) + { + if (this.localAI[2] == 0f) + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1); + this.localAI[2] = 1f; + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 392, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 393, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 394, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 395, 1f); + for (int num845 = 0; num845 < 20; num845++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + } + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + this.dontTakeDamage = false; + this.knockBackResist = 0.5f; + this.TargetClosest(true); + Vector2 vector105 = new Vector2(this.center().X, this.center().Y); + float num846 = Main.player[this.target].center().X - vector105.X; + float num847 = Main.player[this.target].center().Y - vector105.Y; + float num848 = (float)Math.Sqrt((double)(num846 * num846 + num847 * num847)); + float num849 = 8f; + num848 = num849 / num848; + num846 *= num848; + num847 *= num848; + this.velocity.X = (this.velocity.X * 50f + num846) / 51f; + this.velocity.Y = (this.velocity.Y * 50f + num847) / 51f; + if (this.ai[0] == -1f) + { + if (Main.netMode != 1) + { + this.localAI[1] += 1f; + if (this.localAI[1] >= (float)(60 + Main.rand.Next(120))) + { + this.localAI[1] = 0f; + this.TargetClosest(true); + int num850 = 0; + int num851; + int num852; + while (true) + { + num850++; + num851 = (int)Main.player[this.target].center().X / 16; + num852 = (int)Main.player[this.target].center().Y / 16; + if (Main.rand.Next(2) == 0) + { + num851 += Main.rand.Next(7, 13); + } + else + { + num851 -= Main.rand.Next(7, 13); + } + if (Main.rand.Next(2) == 0) + { + num852 += Main.rand.Next(7, 13); + } + else + { + num852 -= Main.rand.Next(7, 13); + } + if (!WorldGen.SolidTile(num851, num852)) + { + break; + } + if (num850 > 100) + { + return; + } + } + this.ai[0] = -2f; + this.ai[1] = (float)num851; + this.ai[2] = (float)num852; + this.netUpdate = true; + return; + } + } + } + else + { + if (this.ai[0] == -2f) + { + this.velocity *= 0.9f; + this.alpha += 25; + if (this.alpha >= 255) + { + this.alpha = 255; + this.position.X = this.ai[1] * 16f - (float)(this.width / 2); + this.position.Y = this.ai[2] * 16f - (float)(this.height / 2); + Main.PlaySound(2, (int)this.center().X, (int)this.center().Y, 8); + this.ai[0] = -3f; + return; + } + } + else + { + if (this.ai[0] == -3f) + { + this.alpha -= 25; + if (this.alpha <= 0) + { + this.alpha = 0; + this.ai[0] = -1f; + return; + } + } + } + } + } + else + { + this.TargetClosest(true); + Vector2 vector106 = new Vector2(this.center().X, this.center().Y); + float num853 = Main.player[this.target].center().X - vector106.X; + float num854 = Main.player[this.target].center().Y - vector106.Y; + float num855 = (float)Math.Sqrt((double)(num853 * num853 + num854 * num854)); + float num856 = 1f; + if (num855 < num856) + { + this.velocity.X = num853; + this.velocity.Y = num854; + } + else + { + num855 = num856 / num855; + this.velocity.X = num853 * num855; + this.velocity.Y = num854 * num855; + } + if (this.ai[0] == 0f) + { + if (Main.netMode != 1) + { + int num857 = 0; + for (int num858 = 0; num858 < 200; num858++) + { + if (Main.npc[num858].active && Main.npc[num858].type == 267) + { + num857++; + } + } + if (num857 == 0) + { + this.ai[0] = -1f; + this.localAI[1] = 0f; + this.alpha = 0; + this.netUpdate = true; + } + this.localAI[1] += 1f; + if (this.localAI[1] >= (float)(120 + Main.rand.Next(300))) + { + this.localAI[1] = 0f; + this.TargetClosest(true); + int num859 = 0; + int num860; + int num861; + while (true) + { + num859++; + num860 = (int)Main.player[this.target].center().X / 16; + num861 = (int)Main.player[this.target].center().Y / 16; + num860 += Main.rand.Next(-50, 51); + num861 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num860, num861) && Collision.CanHit(new Vector2((float)(num860 * 16), (float)(num861 * 16)), 1, 1, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + { + break; + } + if (num859 > 100) + { + return; + } + } + this.ai[0] = 1f; + this.ai[1] = (float)num860; + this.ai[2] = (float)num861; + this.netUpdate = true; + return; + } + } + } + else + { + if (this.ai[0] == 1f) + { + this.alpha += 5; + if (this.alpha >= 255) + { + Main.PlaySound(2, (int)this.center().X, (int)this.center().Y, 8); + this.alpha = 255; + this.position.X = this.ai[1] * 16f - (float)(this.width / 2); + this.position.Y = this.ai[2] * 16f - (float)(this.height / 2); + this.ai[0] = 2f; + return; + } + } + else + { + if (this.ai[0] == 2f) + { + this.alpha -= 5; + if (this.alpha <= 0) + { + this.alpha = 0; + this.ai[0] = 0f; + return; + } + } + } + } + } + } + else + { + if (this.aiStyle == 55) + { + if (NPC.crimsonBoss < 0) + { + this.active = false; + this.netUpdate = true; + return; + } + if (this.ai[0] == 0f) + { + Vector2 vector107 = new Vector2(this.center().X, this.center().Y); + float num862 = Main.npc[NPC.crimsonBoss].center().X - vector107.X; + float num863 = Main.npc[NPC.crimsonBoss].center().Y - vector107.Y; + float num864 = (float)Math.Sqrt((double)(num862 * num862 + num863 * num863)); + if (num864 > 90f) + { + num864 = 8f / num864; + num862 *= num864; + num863 *= num864; + this.velocity.X = (this.velocity.X * 15f + num862) / 16f; + this.velocity.Y = (this.velocity.Y * 15f + num863) / 16f; + return; + } + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 8f) + { + this.velocity.Y = this.velocity.Y * 1.05f; + this.velocity.X = this.velocity.X * 1.05f; + } + if (Main.netMode != 1 && Main.rand.Next(200) == 0) + { + this.TargetClosest(true); + vector107 = new Vector2(this.center().X, this.center().Y); + num862 = Main.player[this.target].center().X - vector107.X; + num863 = Main.player[this.target].center().Y - vector107.Y; + num864 = (float)Math.Sqrt((double)(num862 * num862 + num863 * num863)); + num864 = 8f / num864; + this.velocity.X = num862 * num864; + this.velocity.Y = num863 * num864; + this.ai[0] = 1f; + this.netUpdate = true; + return; + } + } + else + { + Vector2 vector108 = new Vector2(this.center().X, this.center().Y); + float num865 = Main.npc[NPC.crimsonBoss].center().X - vector108.X; + float num866 = Main.npc[NPC.crimsonBoss].center().Y - vector108.Y; + float num867 = (float)Math.Sqrt((double)(num865 * num865 + num866 * num866)); + if (num867 > 700f || this.justHit) + { + this.ai[0] = 0f; + return; + } + } + } + else + { + if (this.aiStyle == 56) + { + this.TargetClosest(true); + Vector2 vector109 = new Vector2(this.center().X, this.center().Y); + float num868 = Main.player[this.target].center().X - vector109.X; + float num869 = Main.player[this.target].center().Y - vector109.Y; + float num870 = (float)Math.Sqrt((double)(num868 * num868 + num869 * num869)); + float num871 = 12f; + num870 = num871 / num870; + num868 *= num870; + num869 *= num870; + this.velocity.X = (this.velocity.X * 100f + num868) / 101f; + this.velocity.Y = (this.velocity.Y * 100f + num869) / 101f; + this.rotation = (float)Math.Atan2((double)num869, (double)num868) - 1.57f; + int num872 = Dust.NewDust(this.position, this.width, this.height, 180, 0f, 0f, 0, default(Color), 1f); + Main.dust[num872].velocity *= 0.1f; + Main.dust[num872].scale = 1.3f; + Main.dust[num872].noGravity = true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + public void FindFrame() + { + int num = 1; + if (!Main.dedServ) + { + if (!Main.NPCLoaded[this.type]) + { + return; + } + num = Main.npcTexture[this.type].Height / Main.npcFrameCount[this.type]; + } + int num2 = 0; + if (this.aiAction == 0) + { + if (this.velocity.Y < 0f) + { + num2 = 2; + } + else + { + if (this.velocity.Y > 0f) + { + num2 = 3; + } + else + { + if (this.velocity.X != 0f) + { + num2 = 1; + } + else + { + num2 = 0; + } + } + } + } + else + { + if (this.aiAction == 1) + { + num2 = 4; + } + } + if (this.type == 1 || this.type == 16 || this.type == 59 || this.type == 71 || this.type == 81 || this.type == 138 || this.type == 147 || this.type == 183 || this.type == 184 || this.type == 204 || this.type == 225) + { + this.frameCounter += 1.0; + if (num2 > 0) + { + this.frameCounter += 1.0; + } + if (num2 == 4) + { + this.frameCounter += 1.0; + } + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 266) + { + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + } + if (this.ai[0] >= 0f) + { + if (this.frame.Y > num * 3) + { + this.frame.Y = 0; + } + } + else + { + if (this.frame.Y < num * 4) + { + this.frame.Y = num * 4; + } + if (this.frame.Y > num * 7) + { + this.frame.Y = num * 4; + } + } + } + if (this.type == 262) + { + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + } + if (this.life > this.lifeMax / 2) + { + if (this.frame.Y > num * 3) + { + this.frame.Y = 0; + } + } + else + { + if (this.frame.Y < num * 4) + { + this.frame.Y = num * 4; + } + if (this.frame.Y > num * 7) + { + this.frame.Y = num * 4; + } + } + } + if (this.type == 263) + { + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + if (this.frame.Y > 0) + { + this.frameCounter += 1.0; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y - num; + } + } + } + else + { + if (this.frame.Y < 2) + { + this.frameCounter += 1.0; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + } + } + } + } + if (this.type == 244) + { + this.frameCounter += 1.0; + if (num2 > 0) + { + this.frameCounter += 1.0; + } + if (num2 == 4) + { + this.frameCounter += 1.0; + } + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 289) + { + this.frameCounter += 1.0; + if (this.frameCounter < 2.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 3.0) + { + this.frame.Y = num; + } + else + { + this.frame.Y = num * 2; + this.frameCounter = 0.0; + } + } + if (this.ai[3] == 1f) + { + this.frame.Y = this.frame.Y + num * 3; + } + } + if (this.type == 288) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 250 || this.type == 264 || this.type == 268) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 245) + { + if (this.ai[0] == 0f) + { + if (this.ai[1] < -16f) + { + this.frame.Y = 0; + } + else + { + if (this.ai[1] < -12f) + { + this.frame.Y = num; + } + else + { + if (this.ai[1] < -8f) + { + this.frame.Y = num * 2; + } + else + { + if (this.ai[1] < -4f) + { + this.frame.Y = num * 3; + } + else + { + if (this.ai[1] < 0f) + { + this.frame.Y = num * 4; + } + else + { + this.frame.Y = 0; + } + } + } + } + } + } + else + { + if (this.ai[0] == 1f) + { + this.frame.Y = 1; + } + } + } + if (this.type == 246) + { + if (this.ai[0] == 0f) + { + if (this.localAI[0] == 1f) + { + this.frame.Y = num; + } + else + { + this.frame.Y = 0; + } + } + else + { + if (this.ai[0] == 1f) + { + if (this.localAI[0] == 1f) + { + this.frame.Y = num; + } + else + { + this.frame.Y = 0; + } + if (this.localAI[1] == -1f) + { + this.frame.Y = this.frame.Y + num * 4; + } + if (this.localAI[1] == 1f) + { + this.frame.Y = this.frame.Y + num * 2; + } + } + } + } + if (this.type == 249) + { + if (this.localAI[0] == 1f) + { + this.frame.Y = num; + } + else + { + this.frame.Y = 0; + } + } + if (this.type == 141) + { + this.spriteDirection = this.direction; + if (this.velocity.Y != 0f) + { + this.frame.Y = num * 2; + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y > num) + { + this.frame.Y = 0; + } + } + } + if (this.type == 243) + { + if (this.frameCounter < 0.0) + { + if (this.velocity.Y == 0f) + { + this.frameCounter += 1.0; + if (this.frameCounter < -12.0) + { + if (this.frame.Y > num * 9) + { + this.frame.Y = num * 11; + } + } + else + { + if (this.frameCounter < -6.0) + { + if (this.frame.Y > num * 9) + { + this.frame.Y = num * 12; + } + } + else + { + if (this.frameCounter < 0.0) + { + this.frameCounter = 0.0; + if (this.frame.Y > num * 9) + { + this.frame.Y = num * 11; + } + } + } + } + } + else + { + this.frameCounter = -18.0; + if (this.velocity.Y < 0f) + { + this.frame.Y = num * 14; + } + else + { + this.frame.Y = num * 13; + } + } + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double)Math.Abs(this.velocity.X * 1.1f); + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y > num * 9) + { + this.frame.Y = 0; + } + } + if (this.velocity.Y < -2f || this.velocity.Y > 5f) + { + this.frameCounter = -18.0; + } + } + } + if (this.type == 222) + { + this.frameCounter += 1.0; + if (this.localAI[0] == 1f) + { + if (this.frameCounter > 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * 4) + { + this.frame.Y = 0; + } + } + else + { + if (this.frameCounter > 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y < num * 4) + { + this.frame.Y = num * 4; + } + if (this.frame.Y >= num * 12) + { + this.frame.Y = num * 4; + } + } + } + if (this.type == 164 || this.type == 239) + { + if (this.velocity.Y != 0f) + { + this.frameCounter = 0.0; + if (this.velocity.Y < 0f) + { + this.frame.Y = num * 4; + } + else + { + this.frame.Y = 0; + } + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 1.1f); + if (this.frameCounter < 6.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 3; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + if (this.type == 236) + { + if (this.velocity.Y == 0f) + { + this.spriteDirection = this.direction; + } + else + { + this.frame.Y = 0; + } + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y > num || this.velocity.Y != 0f) + { + this.frame.Y = 0; + } + } + if (this.type == 165 || this.type == 237 || this.type == 238 || this.type == 240) + { + this.frameCounter += (double)((Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.5f); + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 3; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + if (this.type == 195) + { + if (this.ai[0] < 3f) + { + this.frame.Y = 0; + } + else + { + if (this.ai[0] < 6f) + { + this.frame.Y = num; + } + else + { + if (this.ai[0] < 9f) + { + this.frame.Y = num * 2; + } + else + { + if (this.ai[0] < 12f) + { + this.frame.Y = num * 3; + } + else + { + if (this.ai[0] < 15f) + { + this.frame.Y = num * 4; + } + else + { + this.frame.Y = num * 5; + } + } + } + } + } + } + if (this.type == 174) + { + if (this.velocity.Y == 0f) + { + this.frame.Y = 0; + } + else + { + if ((double)this.velocity.Y < -1.5) + { + this.frame.Y = num; + } + else + { + if ((double)this.velocity.Y > 1.5) + { + this.frame.Y = num * 3; + } + else + { + this.frame.Y = num * 2; + } + } + } + } + if (this.type == 177) + { + if (this.velocity.Y == 0f) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 10.0) + { + this.frameCounter = 30.0; + this.frame.Y = 0; + } + else + { + this.frame.Y = num; + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frame.Y = num * 2; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num * 2; + } + } + } + if (this.type == 163) + { + if (this.velocity.Y != 0f) + { + this.frameCounter = -12.0; + if (this.velocity.Y < 0f) + { + this.frame.Y = num * 5; + } + else + { + this.frame.Y = num * 6; + } + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 1.1f); + if (this.frameCounter < -6.0) + { + this.frame.Y = num * 6; + } + else + { + if (this.frameCounter < 0.0) + { + this.frame.Y = num * 7; + } + else + { + if (this.frameCounter < 6.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 3; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + } + if (this.type == 143) + { + if (this.velocity.Y > 0f) + { + this.frameCounter += 1.0; + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter -= 1.0; + } + } + if (this.frameCounter < 6.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 3; + } + } + } + if (this.frameCounter < 0.0) + { + this.frameCounter = 0.0; + } + if (this.frameCounter > 17.0) + { + this.frameCounter = 17.0; + } + } + if (this.type == 144) + { + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.localAI[3] += 1f; + if (this.localAI[3] < 6f) + { + this.frame.Y = 0; + } + else + { + if (this.localAI[3] < 12f) + { + this.frame.Y = num; + } + } + if (this.localAI[3] >= 11f) + { + this.localAI[3] = 0f; + } + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter += 1.0; + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter -= 1.0; + } + } + if (this.frameCounter < 6.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 3; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 4; + } + } + } + if (this.frameCounter < 0.0) + { + this.frameCounter = 0.0; + } + if (this.frameCounter > 17.0) + { + this.frameCounter = 17.0; + } + } + } + if (this.type == 145) + { + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + if (this.ai[2] < 4f) + { + this.frame.Y = 0; + } + else + { + if (this.ai[2] < 8f) + { + this.frame.Y = num; + } + else + { + if (this.ai[2] < 12f) + { + this.frame.Y = num * 2; + } + else + { + if (this.ai[2] < 16f) + { + this.frame.Y = num * 3; + } + } + } + } + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter += 1.0; + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter -= 1.0; + } + } + if (this.frameCounter < 6.0) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 5; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 6; + } + } + } + if (this.frameCounter < 0.0) + { + this.frameCounter = 0.0; + } + if (this.frameCounter > 17.0) + { + this.frameCounter = 17.0; + } + } + } + if (this.aiStyle == 39) + { + if (this.ai[0] == 0f) + { + this.rotation = 0f; + if (this.velocity.Y == 0f) + { + this.spriteDirection = this.direction; + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0.0; + } + } + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 1.1f); + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 3; + } + else + { + if (this.frameCounter < 32.0) + { + this.frame.Y = num * 4; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + else + { + if (this.ai[0] == 1f) + { + this.frameCounter = 0.0; + if (this.ai[1] < 10f) + { + this.frame.Y = num * 5; + } + else + { + if (this.ai[1] < 20f) + { + this.frame.Y = num * 6; + } + else + { + this.frame.Y = num * 7; + } + } + } + else + { + if (this.ai[0] == 5f) + { + this.frameCounter = 0.0; + if (this.ai[1] < 10f) + { + this.frame.Y = num * 7; + } + else + { + if (this.ai[1] < 20f) + { + this.frame.Y = num * 6; + } + else + { + this.frame.Y = num * 5; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num * 7; + } + } + } + } + if (this.type == 50) + { + if (this.velocity.Y != 0f) + { + this.frame.Y = num * 4; + } + else + { + this.frameCounter += 1.0; + if (num2 > 0) + { + this.frameCounter += 1.0; + } + if (num2 == 4) + { + this.frameCounter += 1.0; + } + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * 4) + { + this.frame.Y = 0; + } + } + } + if (this.type == 170 || this.type == 171 || this.type == 180) + { + this.spriteDirection = this.direction; + this.frameCounter += 1.0; + if (this.frameCounter >= 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * 14) + { + this.frame.Y = 0; + } + } + if (this.type == 135) + { + if (this.ai[2] == 0f) + { + this.frame.Y = 0; + } + else + { + this.frame.Y = num; + } + } + if (this.type == 85) + { + if (this.ai[0] == 0f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + int num3 = 3; + if (this.velocity.Y == 0f) + { + this.frameCounter -= 1.0; + } + else + { + this.frameCounter += 1.0; + } + if (this.frameCounter < 0.0) + { + this.frameCounter = 0.0; + } + if (this.frameCounter > (double)(num3 * 4)) + { + this.frameCounter = (double)(num3 * 4); + } + if (this.frameCounter < (double)num3) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < (double)(num3 * 2)) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < (double)(num3 * 3)) + { + this.frame.Y = num * 3; + } + else + { + if (this.frameCounter < (double)(num3 * 4)) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter < (double)(num3 * 5)) + { + this.frame.Y = num * 5; + } + else + { + if (this.frameCounter < (double)(num3 * 6)) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter < (double)(num3 * 7)) + { + this.frame.Y = num * 3; + } + else + { + this.frame.Y = num * 2; + if (this.frameCounter >= (double)(num3 * 8)) + { + this.frameCounter = (double)num3; + } + } + } + } + } + } + } + } + } + if (this.ai[3] == 2f) + { + this.frame.Y = this.frame.Y + num * 6; + } + else + { + if (this.ai[3] == 3f) + { + this.frame.Y = this.frame.Y + num * 12; + } + else + { + if (this.ai[3] == 4f) + { + this.frame.Y = this.frame.Y + num * 18; + } + } + } + } + if (this.type == 113 || this.type == 114) + { + if (this.ai[2] == 0f) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 12.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + else + { + this.frame.Y = 0; + this.frameCounter = -60.0; + } + } + if (this.type == 61) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter < 4.0) + { + this.frame.Y = num; + } + else + { + this.frame.Y = num * 2; + if (this.frameCounter >= 7.0) + { + this.frameCounter = 0.0; + } + } + } + } + if (this.type == 252) + { + if ((double)this.velocity.X > 0.5) + { + this.spriteDirection = 1; + } + if ((double)this.velocity.X < -0.5) + { + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + } + if (this.frame.Y > num * 4 || this.frame.Y == 0) + { + this.frame.Y = num; + } + } + } + if (this.type == 122) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.05f; + if (this.ai[3] > 0f) + { + int num4 = (int)(this.ai[3] / 8f); + this.frameCounter = 0.0; + this.frame.Y = (num4 + 3) * num; + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * 3) + { + this.frame.Y = 0; + } + } + } + if (this.type == 74 || this.type == 297 || this.type == 298) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.frame.Y = num * 4; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter >= 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 62 || this.type == 66 || this.type == 156) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + this.frameCounter += 1.0; + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + this.frame.Y = num; + if (this.frameCounter >= 11.0) + { + this.frameCounter = 0.0; + } + } + } + if (this.type == 63 || this.type == 64 || this.type == 103 || this.type == 242 || this.type == 256) + { + this.frameCounter += 1.0; + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + this.frame.Y = num * 3; + if (this.frameCounter >= 23.0) + { + this.frameCounter = 0.0; + } + } + } + } + } + if (this.type == 221) + { + if (this.localAI[2] == 1f) + { + if (this.localAI[0] == 1f) + { + this.frame.Y = 0; + this.localAI[0] = 0f; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = num * Main.npcFrameCount[this.type] - num; + } + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter >= 13.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 2 || this.type == 23 || this.type == 121 || this.type == 169 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194) + { + if (this.type == 2 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f; + } + } + else + { + if (this.type == 2 || this.type == 121) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + } + } + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 133) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = num; + } + else + { + this.frame.Y = 0; + } + if (this.frameCounter >= 16.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + if ((double)this.life < (double)this.lifeMax * 0.5) + { + this.frame.Y = this.frame.Y + num * 2; + } + } + if (this.type == 116) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 5.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 75) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + else + { + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + this.frameCounter += 1.0; + if (this.frameCounter >= 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 157) + { + this.spriteDirection = this.direction; + this.frameCounter += 1.0; + if (!this.wet) + { + this.frameCounter += 1.0; + } + int num5 = 5; + if (this.frameCounter < (double)num5) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < (double)(num5 * 2)) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < (double)(num5 * 3)) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < (double)(num5 * 4)) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < (double)(num5 * 5)) + { + this.frame.Y = num * 3; + } + else + { + if (this.frameCounter < (double)(num5 * 6)) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter < (double)(num5 * 7)) + { + this.frame.Y = num * 5; + } + else + { + if (this.frameCounter < (double)(num5 * 8)) + { + this.frame.Y = num * 4; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + } + } + } + if (this.type == 55 || this.type == 57 || this.type == 58 || this.type == 102 || this.type == 241) + { + this.spriteDirection = this.direction; + this.frameCounter += 1.0; + if (this.wet) + { + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 3; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + else + { + if (this.frameCounter < 6.0) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 5; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + if (this.type == 69) + { + if (this.ai[0] < 190f) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type] - 1) + { + this.frame.Y = 0; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num * (Main.npcFrameCount[this.type] - 1); + } + } + if (this.type == 155) + { + if (this.velocity.Y > 0f) + { + this.frame.Y = num * 4; + this.frameCounter = 0.0; + } + else + { + if (this.velocity.Y < 0f) + { + this.frame.Y = num * 6; + this.frameCounter = 0.0; + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 0.4f); + if ((this.direction > 0 && this.velocity.X < 0f) || (this.direction < 0 && this.velocity.X > 0f)) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 8.0) + { + this.frame.Y = num * 3; + } + else + { + if (this.frameCounter < 16.0) + { + this.frame.Y = num * 6; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter < 32.0) + { + this.frame.Y = num * 5; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + } + } + if (this.type == 86) + { + if (this.velocity.Y == 0f || this.wet) + { + if (this.velocity.X < -2f) + { + this.spriteDirection = -1; + } + else + { + if (this.velocity.X > 2f) + { + this.spriteDirection = 1; + } + else + { + this.spriteDirection = this.direction; + } + } + } + if (this.velocity.Y != 0f) + { + this.frame.Y = num * 15; + this.frameCounter = 0.0; + } + else + { + if (this.velocity.X == 0f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + if (Math.Abs(this.velocity.X) < 3f) + { + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= 9) + { + this.frame.Y = num; + } + if (this.frame.Y / num <= 0) + { + this.frame.Y = num; + } + } + } + else + { + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter >= 10.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= 15) + { + this.frame.Y = num * 9; + } + if (this.frame.Y / num <= 8) + { + this.frame.Y = num * 9; + } + } + } + } + } + } + if (this.type == 127) + { + if (this.ai[1] == 0f) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 12.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= 2) + { + this.frame.Y = 0; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num * 2; + } + } + if (this.type == 129) + { + if (this.velocity.Y == 0f) + { + this.spriteDirection = this.direction; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 2.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 130) + { + if (this.velocity.Y == 0f) + { + this.spriteDirection = this.direction; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 67 || this.type == 217 || this.type == 218 || this.type == 219) + { + if (this.velocity.Y == 0f) + { + this.spriteDirection = this.direction; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 220) + { + if (this.velocity.Y == 0f) + { + this.spriteDirection = this.direction; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 10.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 109) + { + if (this.velocity.Y == 0f && ((this.velocity.X <= 0f && this.direction < 0) || (this.velocity.X >= 0f && this.direction > 0))) + { + this.spriteDirection = this.direction; + } + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter >= 7.0) + { + this.frameCounter -= 7.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 83 || this.type == 84 || this.type == 179) + { + if (this.ai[0] == 2f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter >= 4.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + } + if (this.type == 72) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 3.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + if (this.type == 65) + { + this.spriteDirection = this.direction; + this.frameCounter += 1.0; + if (this.wet) + { + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 3; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + if (this.type == 224) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + this.rotation = this.velocity.Y * 0.2f; + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = -this.velocity.Y * 0.2f; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * 4) + { + this.frame.Y = 0; + } + } + if (this.type == 150 || this.type == 151 || this.type == 152 || this.type == 158 || this.type == 226) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * 4) + { + this.frame.Y = 0; + } + } + if (this.type == 48 || this.type == 49 || this.type == 51 || this.type == 60 || this.type == 82 || this.type == 93 || this.type == 137 || this.type == 182 || this.type == 210 || this.type == 211 || this.type == 253) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + if (this.type == 210 || this.type == 211) + { + this.frameCounter += 1.0; + this.rotation = this.velocity.X * 0.2f; + } + this.frameCounter += 1.0; + if (this.frameCounter >= 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + if (this.type == 42 || (this.type >= 231 && this.type <= 235)) + { + this.frameCounter += 1.0; + if (this.frameCounter < 2.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 4.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 6.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 8.0) + { + this.frame.Y = num; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + if (this.type == 205) + { + this.frameCounter += 0.5; + if (this.frameCounter < 2.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 4.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 6.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 8.0) + { + this.frame.Y = num; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + if (this.type == 176) + { + this.frameCounter += 1.0; + if (this.frameCounter > 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y > num) + { + this.frame.Y = 0; + } + } + if (this.type == 43 || this.type == 56 || this.type == 175) + { + this.frameCounter += 1.0; + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num; + } + } + } + } + if (this.frameCounter == 23.0) + { + this.frameCounter = 0.0; + } + } + if (this.type == 115) + { + this.frameCounter += 1.0; + if (this.frameCounter < 3.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 6.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 15.0) + { + this.frame.Y = num; + } + } + } + } + if (this.frameCounter == 15.0) + { + this.frameCounter = 0.0; + } + } + if (this.type == 101) + { + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num * 2; + this.frameCounter = 0.0; + } + if (this.frame.Y > num * 2) + { + this.frame.Y = 0; + } + } + if (this.type == 199) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + } + if (this.frame.Y < num * 3) + { + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + } + } + else + { + if (this.velocity.Y == 0f) + { + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter > 12.0) + { + this.frameCounter = 0.0; + this.frame.Y = this.frame.Y + num; + if (this.frame.Y > num * 7) + { + this.frame.Y = num * 3; + } + } + } + } + } + if (this.type == 17 || this.type == 18 || this.type == 19 || this.type == 20 || this.type == 22 || this.type == 142 || this.type == 178 || this.type == 38 || this.type == 26 || this.type == 27 || this.type == 28 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 21 || this.type == 44 || this.type == 54 || this.type == 37 || this.type == 73 || this.type == 77 || this.type == 78 || this.type == 79 || this.type == 80 || this.type == 104 || this.type == 107 || this.type == 108 || this.type == 120 || this.type == 124 || this.type == 140 || this.type == 159 || this.type == 160 || this.type == 167 || this.type == 181 || this.type == 185 || this.type == 196 || this.type == 197 || this.type == 198 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 207 || this.type == 208 || this.type == 209 || this.type == 212 || this.type == 213 || this.type == 227 || this.type == 228 || this.type == 229 || this.type == 287) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + if (this.type == 140 || this.type == 287) + { + this.frame.Y = num; + this.frameCounter = 0.0; + } + else + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 2f); + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 2; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num; + if (this.type == 21 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 44 || this.type == 77 || this.type == 78 || this.type == 79 || this.type == 80 || this.type == 120 || this.type == 140 || this.type == 159 || this.type == 167 || this.type == 197 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 287) + { + this.frame.Y = 0; + } + if (this.type == 181) + { + this.frame.Y = num * 14; + } + } + } + if (this.type >= 269 && this.type <= 280) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + if (this.type == 140) + { + this.frame.Y = num; + this.frameCounter = 0.0; + } + else + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 2f); + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 2; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + if (this.type == 230) + { + if (this.velocity.Y == 0f) + { + this.rotation = 0f; + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 2f); + this.frameCounter += 1.0; + if (this.frameCounter > 10.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + if (this.velocity.Y > 4f) + { + this.rotation -= this.velocity.Y * 0.01f; + } + } + } + else + { + if (this.type == 290) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.ai[2] > 0f) + { + if (this.ai[1] < 10f) + { + this.frame.Y = num * 11; + } + else + { + if (this.ai[1] < 20f) + { + this.frame.Y = num * 10; + } + else + { + this.frame.Y = num * 9; + } + } + } + else + { + if (this.velocity.X == 0f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num * 2) + { + this.frame.Y = num * 2; + } + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 1f); + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y > num * 8) + { + this.frame.Y = num * 2; + } + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num; + } + } + else + { + if (this.type == 110 || this.type == 214 || this.type == 215 || this.type == 216 || this.type == 291 || this.type == 292 || this.type == 293) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.ai[2] > 0f) + { + this.spriteDirection = this.direction; + this.frame.Y = num * (int)this.ai[2]; + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num * 6) + { + this.frame.Y = num * 6; + } + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 2f); + this.frameCounter += (double)this.velocity.X; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 6; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + else + { + if (this.type == 206) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.ai[2] > 0f) + { + this.spriteDirection = this.direction; + this.frame.Y = num * (int)this.ai[2]; + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num * 6) + { + this.frame.Y = num * 6; + } + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 2f); + this.frameCounter += (double)this.velocity.X; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 6; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + } + } + } + if (this.type == 111) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.ai[2] > 0f) + { + this.spriteDirection = this.direction; + this.frame.Y = num * ((int)this.ai[2] - 1); + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num * 7) + { + this.frame.Y = num * 7; + } + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 2f); + this.frameCounter += (double)(this.velocity.X * 1.3f); + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 7; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num * 6; + } + } + else + { + if (this.type == 257) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + } + if (this.velocity.Y != 0f || (this.direction == -1 && this.velocity.X > 0f) || (this.direction == 1 && this.velocity.X < 0f)) + { + this.frameCounter = 0.0; + this.frame.Y = num * 4; + } + else + { + if (this.velocity.X == 0f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 16.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 32.0) + { + this.frame.Y = num * 3; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + } + else + { + if (this.type == 258) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + } + if (this.velocity.Y != 0f || (this.direction == -1 && this.velocity.X > 0f) || (this.direction == 1 && this.velocity.X < 0f)) + { + this.frameCounter += 1.0; + if (this.frameCounter > 1.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y > num * 5 || this.frame.Y < num * 3) + { + this.frame.Y = num * 3; + } + } + else + { + if (this.velocity.X == 0f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 16.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 2; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + else + { + if (this.type == 3 || this.type == 52 || this.type == 53 || this.type == 132 || this.type == 161 || this.type == 162 || this.type == 166 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 251 || this.type == 254 || this.type == 255) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + } + if (this.velocity.Y != 0f || (this.direction == -1 && this.velocity.X > 0f) || (this.direction == 1 && this.velocity.X < 0f)) + { + this.frameCounter = 0.0; + this.frame.Y = num * 2; + } + else + { + if (this.velocity.X == 0f) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double)Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 16.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 24.0) + { + this.frame.Y = num * 2; + } + else + { + if (this.frameCounter < 32.0) + { + this.frame.Y = num; + } + else + { + this.frameCounter = 0.0; + } + } + } + } + } + } + } + else + { + if (this.type == 148 || this.type == 149 || this.type == 168) + { + int num6 = 0; + if (this.localAI[0] == 2f) + { + num6 = 3; + } + if (this.localAI[0] == 3f) + { + num6 = 6; + } + if (this.localAI[0] == 4f) + { + num6 = 9; + } + num6 *= num; + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + this.frame.Y = num6; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 1f); + if (this.frameCounter < 6.0) + { + this.frame.Y = num6; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num + num6; + } + else + { + if (this.frameCounter < 15.0) + { + this.frame.Y = num * 2 + num6; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num * 2 + num6; + } + } + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0.0; + this.frame.Y = num * 2 + num6; + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter = 0.0; + this.frame.Y = num * 2 + num6; + } + } + } + } + else + { + if (this.type == 299) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 0.5f); + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type] - 1) + { + this.frame.Y = num; + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0.0; + this.frame.Y = num * 2; + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter = 0.0; + this.frame.Y = num * 4; + } + } + } + } + else + { + if (this.type == 300) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + this.frameCounter += 1.0; + if (this.frameCounter > 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num > 1) + { + this.frame.Y = 0; + } + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 0.5f); + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 2; + } + } + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 0.5f); + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = num * 2; + } + } + } + else + { + if (this.type == 46 || this.type == 47) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + if (this.velocity.X == 0f) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double)(Math.Abs(this.velocity.X) * 1f); + this.frameCounter += 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y / num >= Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0.0; + this.frame.Y = num * 4; + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter = 0.0; + this.frame.Y = num * 6; + } + } + } + } + else + { + if (this.type == 4 || this.type == 125 || this.type == 126) + { + this.frameCounter += 1.0; + if (this.frameCounter < 7.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 14.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 21.0) + { + this.frame.Y = num * 2; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + } + if (this.ai[0] > 1f) + { + this.frame.Y = this.frame.Y + num * 3; + } + } + else + { + if (this.type == 5) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + else + { + if (this.type == 94) + { + this.frameCounter += 1.0; + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter < 12.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter < 18.0) + { + this.frame.Y = num * 2; + } + else + { + this.frame.Y = num; + if (this.frameCounter >= 23.0) + { + this.frameCounter = 0.0; + } + } + } + } + } + else + { + if (this.type == 6 || this.type == 173) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + else + { + if (this.type == 24) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + } + if (this.ai[1] > 0f) + { + if (this.frame.Y < 4) + { + this.frameCounter = 0.0; + } + this.frameCounter += 1.0; + if (this.frameCounter <= 4.0) + { + this.frame.Y = num * 4; + } + else + { + if (this.frameCounter <= 8.0) + { + this.frame.Y = num * 5; + } + else + { + if (this.frameCounter <= 12.0) + { + this.frame.Y = num * 6; + } + else + { + if (this.frameCounter <= 16.0) + { + this.frame.Y = num * 7; + } + else + { + if (this.frameCounter <= 20.0) + { + this.frame.Y = num * 8; + } + else + { + this.frame.Y = num * 9; + this.frameCounter = 100.0; + } + } + } + } + } + } + else + { + this.frameCounter += 1.0; + if (this.frameCounter <= 4.0) + { + this.frame.Y = 0; + } + else + { + if (this.frameCounter <= 8.0) + { + this.frame.Y = num; + } + else + { + if (this.frameCounter <= 12.0) + { + this.frame.Y = num * 2; + } + else + { + this.frame.Y = num * 3; + if (this.frameCounter >= 16.0) + { + this.frameCounter = 0.0; + } + } + } + } + } + } + else + { + if (this.type == 29 || this.type == 32 || this.type == 45 || this.type == 172 || (this.type >= 281 && this.type <= 286)) + { + if (this.velocity.Y == 0f) + { + if (this.direction == 1) + { + this.spriteDirection = 1; + } + if (this.direction == -1) + { + this.spriteDirection = -1; + } + } + this.frame.Y = 0; + if (this.velocity.Y != 0f) + { + this.frame.Y = this.frame.Y + num; + } + else + { + if (this.ai[1] > 0f) + { + this.frame.Y = this.frame.Y + num * 2; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type == 34) + { + this.frameCounter += 1.0; + if (this.frameCounter >= 4.0) + { + this.frame.Y = this.frame.Y + num; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num * Main.npcFrameCount[this.type]) + { + this.frame.Y = 0; + } + } + } + public void TargetClosest(bool faceTarget = true) + { + float num = 0f; + bool flag = false; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead) + { + float num2 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - this.position.X + (float)(this.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - this.position.Y + (float)(this.height / 2)); + num2 -= (float)Main.player[i].aggro; + if (!flag || num2 < num) + { + flag = true; + num = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - this.position.X + (float)(this.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - this.position.Y + (float)(this.height / 2)); + this.target = i; + } + } + } + if (this.target < 0 || this.target >= 255) + { + this.target = 0; + } + this.targetRect = new Rectangle((int)Main.player[this.target].position.X, (int)Main.player[this.target].position.Y, Main.player[this.target].width, Main.player[this.target].height); + if (Main.player[this.target].dead) + { + faceTarget = false; + } + if (faceTarget) + { + this.direction = 1; + if ((float)(this.targetRect.X + this.targetRect.Width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + this.directionY = 1; + if ((float)(this.targetRect.Y + this.targetRect.Height / 2) < this.position.Y + (float)(this.height / 2)) + { + this.directionY = -1; + } + } + if (this.confused) + { + this.direction *= -1; + } + if ((this.direction != this.oldDirection || this.directionY != this.oldDirectionY || this.target != this.oldTarget) && !this.collideX && !this.collideY) + { + this.netUpdate = true; + } + } + public void CheckActive() + { + if (this.active) + { + if (this.type == 8 || this.type == 9 || this.type == 11 || this.type == 12 || this.type == 14 || this.type == 15 || this.type == 40 || this.type == 41 || this.type == 96 || this.type == 97 || this.type == 99 || this.type == 100 || (this.type > 87 && this.type <= 92) || this.type == 118 || this.type == 119 || this.type == 113 || this.type == 114 || this.type == 115 || this.type == 263 || this.type == 267) + { + return; + } + if (this.type >= 246 && this.type <= 249) + { + return; + } + if (this.type >= 134 && this.type <= 136) + { + return; + } + if (this.townNPC) + { + Rectangle rectangle = new Rectangle((int)(this.position.X + (float)(this.width / 2) - (float)NPC.townRangeX), (int)(this.position.Y + (float)(this.height / 2) - (float)NPC.townRangeY), NPC.townRangeX * 2, NPC.townRangeY * 2); + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && rectangle.Intersects(new Rectangle((int)Main.player[i].position.X, (int)Main.player[i].position.Y, Main.player[i].width, Main.player[i].height))) + { + Main.player[i].townNPCs += this.npcSlots; + } + } + return; + } + bool flag = false; + Rectangle rectangle2 = new Rectangle((int)(this.position.X + (float)(this.width / 2) - (float)NPC.activeRangeX), (int)(this.position.Y + (float)(this.height / 2) - (float)NPC.activeRangeY), NPC.activeRangeX * 2, NPC.activeRangeY * 2); + Rectangle rectangle3 = new Rectangle((int)((double)(this.position.X + (float)(this.width / 2)) - (double)NPC.sWidth * 0.5 - (double)this.width), (int)((double)(this.position.Y + (float)(this.height / 2)) - (double)NPC.sHeight * 0.5 - (double)this.height), NPC.sWidth + this.width * 2, NPC.sHeight + this.height * 2); + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active) + { + if (rectangle2.Intersects(new Rectangle((int)Main.player[j].position.X, (int)Main.player[j].position.Y, Main.player[j].width, Main.player[j].height))) + { + flag = true; + if (this.type != 25 && this.type != 30 && this.type != 33 && this.lifeMax > 0) + { + Main.player[j].activeNPCs += this.npcSlots; + } + } + if (rectangle3.Intersects(new Rectangle((int)Main.player[j].position.X, (int)Main.player[j].position.Y, Main.player[j].width, Main.player[j].height))) + { + this.timeLeft = NPC.activeTime; + } + if (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 87) + { + flag = true; + } + if (this.boss || this.type == 35 || this.type == 36 || this.type == 127 || this.type == 128 || this.type == 129 || this.type == 130 || this.type == 131) + { + flag = true; + } + } + } + this.timeLeft--; + if (this.timeLeft <= 0) + { + flag = false; + } + if (!flag && Main.netMode != 1) + { + NPC.noSpawnCycle = true; + this.active = false; + if (Main.netMode == 2) + { + this.netSkip = -1; + this.life = 0; + NetMessage.SendData(23, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + if (this.aiStyle == 6) + { + for (int k = (int)this.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) + { + if (Main.npc[k].active) + { + Main.npc[k].active = false; + if (Main.netMode == 2) + { + Main.npc[k].life = 0; + Main.npc[k].netSkip = -1; + NetMessage.SendData(23, -1, -1, "", k, 0f, 0f, 0f, 0); + } + } + } + } + } + } + } + public static void SpawnNPC() + { + if (NPC.noSpawnCycle) + { + NPC.noSpawnCycle = false; + return; + } + bool flag = false; + int num = 0; + int num2 = 0; + int num3 = 0; + int num4 = 0; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active) + { + num4++; + } + } + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && !Main.player[j].dead) + { + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + if (Main.player[j].active && Main.invasionType > 0 && Main.invasionDelay == 0 && Main.invasionSize > 0 && (double)Main.player[j].position.Y < Main.worldSurface * 16.0 + (double)NPC.sHeight) + { + int num5 = 3000; + if ((double)Main.player[j].position.X > Main.invasionX * 16.0 - (double)num5 && (double)Main.player[j].position.X < Main.invasionX * 16.0 + (double)num5) + { + flag4 = true; + } + } + bool flag7 = false; + NPC.spawnRate = NPC.defaultSpawnRate; + NPC.maxSpawns = NPC.defaultMaxSpawns; + if (Main.hardMode) + { + NPC.spawnRate = (int)((double)NPC.defaultSpawnRate * 0.9); + NPC.maxSpawns = NPC.defaultMaxSpawns + 1; + } + if (Main.player[j].position.Y > (float)((Main.maxTilesY - 200) * 16)) + { + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 2f); + } + else + { + if ((double)Main.player[j].position.Y > Main.rockLayer * 16.0 + (double)NPC.sHeight) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.4); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.9f); + } + else + { + if ((double)Main.player[j].position.Y > Main.worldSurface * 16.0 + (double)NPC.sHeight) + { + if (Main.hardMode) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.45); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.8f); + } + else + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.5); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.7f); + } + } + else + { + if (!Main.dayTime) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.6); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.3f); + if (Main.bloodMoon) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.3); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.8f); + } + } + else + { + if (Main.dayTime && Main.eclipse) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.2); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.9f); + } + } + } + } + } + if (Main.player[j].zoneSnow && (double)(Main.player[j].position.Y / 16f) < Main.worldSurface) + { + NPC.maxSpawns = (int)((float)NPC.maxSpawns + (float)NPC.maxSpawns * Main.cloudAlpha); + NPC.spawnRate = (int)((float)NPC.spawnRate * (1f - Main.cloudAlpha + 1f) / 2f); + } + if (Main.player[j].zoneDungeon) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.4); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.7f); + } + else + { + if (Main.player[j].zoneJungle) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.4); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.5f); + } + else + { + if (Main.player[j].zoneEvil || Main.player[j].zoneBlood) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.65); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.3f); + } + else + { + if (Main.player[j].zoneMeteor) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.4); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.1f); + } + } + } + } + if (Main.player[j].zoneHoly && (double)Main.player[j].position.Y > Main.rockLayer * 16.0 + (double)NPC.sHeight) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.65); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.3f); + } + if (Main.wof >= 0 && Main.player[j].position.Y > (float)((Main.maxTilesY - 200) * 16)) + { + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 0.3f); + NPC.spawnRate *= 3; + } + if ((double)Main.player[j].activeNPCs < (double)NPC.maxSpawns * 0.2) + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 0.6f); + } + else + { + if ((double)Main.player[j].activeNPCs < (double)NPC.maxSpawns * 0.4) + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 0.7f); + } + else + { + if ((double)Main.player[j].activeNPCs < (double)NPC.maxSpawns * 0.6) + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 0.8f); + } + else + { + if ((double)Main.player[j].activeNPCs < (double)NPC.maxSpawns * 0.8) + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 0.9f); + } + } + } + } + if ((double)(Main.player[j].position.Y * 16f) > (Main.worldSurface + Main.rockLayer) / 2.0 || Main.player[j].zoneEvil || Main.player[j].zoneBlood) + { + if ((double)Main.player[j].activeNPCs < (double)NPC.maxSpawns * 0.2) + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 0.7f); + } + else + { + if ((double)Main.player[j].activeNPCs < (double)NPC.maxSpawns * 0.4) + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 0.9f); + } + } + } + if (Main.player[j].inventory[Main.player[j].selectedItem].type == 148) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.75); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.5f); + } + if (Main.player[j].enemySpawns) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.5); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 2f); + } + if (Main.player[j].zoneCandle) + { + NPC.spawnRate = (int)((double)NPC.spawnRate * 0.75); + NPC.maxSpawns = (int)((float)NPC.maxSpawns * 1.5f); + } + if ((double)NPC.spawnRate < (double)NPC.defaultSpawnRate * 0.1) + { + NPC.spawnRate = (int)((double)NPC.defaultSpawnRate * 0.1); + } + if (NPC.maxSpawns > NPC.defaultMaxSpawns * 3) + { + NPC.maxSpawns = NPC.defaultMaxSpawns * 3; + } + if (flag4) + { + NPC.maxSpawns = (int)((double)NPC.defaultMaxSpawns * (2.0 + 0.3 * (double)num4)); + NPC.spawnRate = 20; + } + if (Main.player[j].zoneDungeon && !NPC.downedBoss3) + { + NPC.spawnRate = 10; + } + bool flag8 = false; + if (!flag4 && (!Main.bloodMoon || Main.dayTime) && (!Main.eclipse || !Main.dayTime) && !Main.player[j].zoneDungeon && !Main.player[j].zoneEvil && !Main.player[j].zoneBlood && !Main.player[j].zoneMeteor) + { + if (Main.player[j].townNPCs == 1f) + { + flag3 = true; + if (Main.rand.Next(3) <= 1) + { + flag8 = true; + NPC.maxSpawns = (int)((double)((float)NPC.maxSpawns) * 0.6); + } + else + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 2f); + } + } + else + { + if (Main.player[j].townNPCs == 2f) + { + flag3 = true; + if (Main.rand.Next(3) == 0) + { + flag8 = true; + NPC.maxSpawns = (int)((double)((float)NPC.maxSpawns) * 0.6); + } + else + { + NPC.spawnRate = (int)((float)NPC.spawnRate * 3f); + } + } + else + { + if (Main.player[j].townNPCs >= 3f) + { + flag3 = true; + flag8 = true; + NPC.maxSpawns = (int)((double)((float)NPC.maxSpawns) * 0.6); + } + } + } + } + int num6 = (int)(Main.player[j].position.X + (float)(Main.player[j].width / 2)) / 16; + int num7 = (int)(Main.player[j].position.Y + (float)(Main.player[j].height / 2)) / 16; + if (Main.wallHouse[(int)Main.tile[num6, num7].wall]) + { + flag3 = true; + } + if (Main.tile[num6, num7].wall == 87) + { + flag2 = true; + } + if (Main.player[j].active && !Main.player[j].dead && Main.player[j].activeNPCs < (float)NPC.maxSpawns && Main.rand.Next(NPC.spawnRate) == 0) + { + NPC.spawnRangeX = (int)((double)(NPC.sWidth / 16) * 0.7); + NPC.spawnRangeY = (int)((double)(NPC.sHeight / 16) * 0.7); + NPC.safeRangeX = (int)((double)(NPC.sWidth / 16) * 0.52); + NPC.safeRangeY = (int)((double)(NPC.sHeight / 16) * 0.52); + if (Main.player[j].inventory[Main.player[j].selectedItem].type == 1254 || Main.player[j].inventory[Main.player[j].selectedItem].type == 1299 || Main.player[j].scope) + { + float num8 = 1.5f; + if (Main.player[j].inventory[Main.player[j].selectedItem].type == 1254 && Main.player[j].scope) + { + num8 = 1.25f; + } + else + { + if (Main.player[j].inventory[Main.player[j].selectedItem].type == 1254) + { + num8 = 1.5f; + } + else + { + if (Main.player[j].inventory[Main.player[j].selectedItem].type == 1299) + { + num8 = 1.5f; + } + else + { + if (Main.player[j].scope) + { + num8 = 2f; + } + } + } + } + NPC.spawnRangeX += (int)((double)(NPC.sWidth / 16) * 0.5 / (double)num8); + NPC.spawnRangeY += (int)((double)(NPC.sHeight / 16) * 0.5 / (double)num8); + NPC.safeRangeX += (int)((double)(NPC.sWidth / 16) * 0.5 / (double)num8); + NPC.safeRangeY += (int)((double)(NPC.sHeight / 16) * 0.5 / (double)num8); + } + int num9 = (int)(Main.player[j].position.X / 16f) - NPC.spawnRangeX; + int num10 = (int)(Main.player[j].position.X / 16f) + NPC.spawnRangeX; + int num11 = (int)(Main.player[j].position.Y / 16f) - NPC.spawnRangeY; + int num12 = (int)(Main.player[j].position.Y / 16f) + NPC.spawnRangeY; + int num13 = (int)(Main.player[j].position.X / 16f) - NPC.safeRangeX; + int num14 = (int)(Main.player[j].position.X / 16f) + NPC.safeRangeX; + int num15 = (int)(Main.player[j].position.Y / 16f) - NPC.safeRangeY; + int num16 = (int)(Main.player[j].position.Y / 16f) + NPC.safeRangeY; + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesX) + { + num10 = Main.maxTilesX; + } + if (num11 < 0) + { + num11 = 0; + } + if (num12 > Main.maxTilesY) + { + num12 = Main.maxTilesY; + } + int k = 0; + while (k < 50) + { + int num17 = Main.rand.Next(num9, num10); + int num18 = Main.rand.Next(num11, num12); + if (Main.tile[num17, num18].nactive() && Main.tileSolid[(int)Main.tile[num17, num18].type]) + { + goto IL_FF5; + } + if (!Main.wallHouse[(int)Main.tile[num17, num18].wall]) + { + if (!flag4 && (double)num18 < Main.worldSurface * 0.34999999403953552 && !flag8 && ((double)num17 < (double)Main.maxTilesX * 0.45 || (double)num17 > (double)Main.maxTilesX * 0.55 || Main.hardMode)) + { + num3 = (int)Main.tile[num17, num18].type; + num = num17; + num2 = num18; + flag7 = true; + flag = true; + } + else + { + if (!flag4 && (double)num18 < Main.worldSurface * 0.44999998807907104 && !flag8 && Main.hardMode && Main.rand.Next(10) == 0) + { + num3 = (int)Main.tile[num17, num18].type; + num = num17; + num2 = num18; + flag7 = true; + flag = true; + } + else + { + int l = num18; + while (l < Main.maxTilesY) + { + if (Main.tile[num17, l].nactive() && Main.tileSolid[(int)Main.tile[num17, l].type]) + { + if (num17 < num13 || num17 > num14 || l < num15 || l > num16) + { + num3 = (int)Main.tile[num17, l].type; + num = num17; + num2 = l; + flag7 = true; + break; + } + break; + } + else + { + l++; + } + } + } + } + if (!flag7) + { + goto IL_FF5; + } + int num19 = num - NPC.spawnSpaceX / 2; + int num20 = num + NPC.spawnSpaceX / 2; + int num21 = num2 - NPC.spawnSpaceY; + int num22 = num2; + if (num19 < 0) + { + flag7 = false; + } + if (num20 > Main.maxTilesX) + { + flag7 = false; + } + if (num21 < 0) + { + flag7 = false; + } + if (num22 > Main.maxTilesY) + { + flag7 = false; + } + if (flag7) + { + for (int m = num19; m < num20; m++) + { + for (int n = num21; n < num22; n++) + { + if (Main.tile[m, n].nactive() && Main.tileSolid[(int)Main.tile[m, n].type]) + { + flag7 = false; + break; + } + if (Main.tile[m, n].lava()) + { + flag7 = false; + break; + } + } + } + goto IL_FF5; + } + goto IL_FF5; + } + IL_FFB: + k++; + continue; + IL_FF5: + if (!flag7 && !flag7) + { + goto IL_FFB; + } + break; + } + } + if (flag7) + { + Rectangle rectangle = new Rectangle(num * 16, num2 * 16, 16, 16); + for (int num23 = 0; num23 < 255; num23++) + { + if (Main.player[num23].active) + { + Rectangle rectangle2 = new Rectangle((int)(Main.player[num23].position.X + (float)(Main.player[num23].width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(Main.player[num23].position.Y + (float)(Main.player[num23].height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + if (rectangle.Intersects(rectangle2)) + { + flag7 = false; + } + } + } + } + if (flag7) + { + if (Main.player[j].zoneDungeon && (!Main.tileDungeon[(int)Main.tile[num, num2].type] || Main.tile[num, num2 - 1].wall == 0)) + { + flag7 = false; + } + if (Main.tile[num, num2 - 1].liquid > 0 && Main.tile[num, num2 - 2].liquid > 0 && !Main.tile[num, num2 - 1].lava()) + { + if (Main.tile[num, num2 - 1].honey()) + { + flag6 = true; + } + else + { + flag5 = true; + } + } + } + if (flag6) + { + flag7 = false; + } + if (flag7) + { + bool flag9 = false; + if ((double)num2 > Main.rockLayer && num2 < Main.maxTilesY - 200 && !Main.player[j].zoneDungeon && !flag4) + { + if (Main.rand.Next(3) == 0) + { + int num24 = Main.rand.Next(5, 15); + if (num - num24 >= 0 && num + num24 < Main.maxTilesX) + { + for (int num25 = num - num24; num25 < num + num24; num25++) + { + for (int num26 = num2 - num24; num26 < num2 + num24; num26++) + { + if (Main.tile[num25, num26].wall == 62) + { + flag9 = true; + } + } + } + } + } + else + { + int num27 = (int)Main.player[j].position.X / 16; + int num28 = (int)Main.player[j].position.Y / 16; + if (Main.tile[num27, num28].wall == 62) + { + flag9 = true; + } + } + } + bool flag10 = false; + if (NPC.downedPlantBoss && Main.hardMode) + { + flag10 = true; + } + int num29 = (int)Main.tile[num, num2].type; + int num30 = 200; + if (flag) + { + if (Main.hardMode && Main.rand.Next(10) == 0 && !NPC.AnyNPCs(87) && !flag3) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 87, 1); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 48, 0); + } + } + else + { + if (flag4) + { + if (Main.invasionType == 1) + { + if (Main.rand.Next(9) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 29, 0); + } + else + { + if (Main.rand.Next(5) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 26, 0); + } + else + { + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 111, 0); + } + else + { + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 27, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 28, 0); + } + } + } + } + } + else + { + if (Main.invasionType == 2) + { + if (Main.rand.Next(7) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 145, 0); + } + else + { + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 143, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 144, 0); + } + } + } + else + { + if (Main.invasionType == 3) + { + if (Main.rand.Next(30) == 0 && !NPC.AnyNPCs(216)) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 216, 0); + } + else + { + if (Main.rand.Next(11) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 215, 0); + } + else + { + if (Main.rand.Next(9) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 252, 0); + } + else + { + if (Main.rand.Next(7) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 214, 0); + } + else + { + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 213, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 212, 0); + } + } + } + } + } + } + } + } + } + else + { + if (Main.tile[num, num2].wall == 62 || flag9) + { + if (Main.hardMode) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 163, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 164, 0); + } + } + else + { + if (Main.hardMode && flag5 && Main.player[j].zoneJungle && Main.rand.Next(3) != 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 157, 0); + } + else + { + if (Main.hardMode && flag5 && Main.player[j].zoneBlood && Main.rand.Next(3) != 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 242, 0); + } + else + { + if (Main.hardMode && flag5 && Main.player[j].zoneBlood && Main.rand.Next(3) != 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 241, 0); + } + else + { + if (flag5 && (num < 250 || num > Main.maxTilesX - 250) && num29 == 53 && (double)num2 < Main.rockLayer) + { + if (Main.rand.Next(60) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 220, 0); + } + else + { + if (Main.rand.Next(25) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 221, 0); + } + else + { + if (Main.rand.Next(8) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 65, 0); + } + else + { + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 67, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 64, 0); + } + } + } + } + } + else + { + if (flag5 && (((double)num2 > Main.rockLayer && Main.rand.Next(2) == 0) || num29 == 60)) + { + if (Main.hardMode && Main.rand.Next(3) > 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 102, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 58, 0); + } + } + else + { + if (flag5 && (double)num2 > Main.worldSurface && Main.rand.Next(3) == 0) + { + if (Main.hardMode) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 103, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 63, 0); + } + } + else + { + if (flag5 && Main.rand.Next(4) == 0) + { + if (Main.player[j].zoneEvil) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 57, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 55, 0); + } + } + else + { + if (NPC.downedGoblins && Main.rand.Next(20) == 0 && !flag5 && (double)num2 >= Main.rockLayer && num2 < Main.maxTilesY - 210 && !NPC.savedGoblin && !NPC.AnyNPCs(105)) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 105, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(20) == 0 && !flag5 && (double)num2 >= Main.rockLayer && num2 < Main.maxTilesY - 210 && !NPC.savedWizard && !NPC.AnyNPCs(106)) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 106, 0); + } + else + { + if (flag8) + { + if (flag5) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 55, 0); + } + else + { + if (num29 == 147 || num29 == 161) + { + if (Main.rand.Next(2) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 148, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 149, 0); + } + } + else + { + if (num29 != 2 && num29 != 109 && (double)num2 <= Main.worldSurface) + { + return; + } + if (Main.raining) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 230, 0); + } + else + { + if (Main.rand.Next(2) == 0 && (double)num2 <= Main.worldSurface) + { + int num31 = Main.rand.Next(4); + if (num31 == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 297, 0); + } + else + { + if (num31 == 1) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 298, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 74, 0); + } + } + } + else + { + if (Main.rand.Next(3) == 0 && (double)num2 <= Main.worldSurface) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 299, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 46, 0); + } + } + } + } + } + } + else + { + if (Main.player[j].zoneDungeon) + { + int num32 = 0; + if (Main.tile[num, num2].wall == 94 || Main.tile[num, num2].wall == 96 || Main.tile[num, num2].wall == 98) + { + num32 = 1; + } + if (Main.tile[num, num2].wall == 95 || Main.tile[num, num2].wall == 97 || Main.tile[num, num2].wall == 99) + { + num32 = 2; + } + if (!NPC.downedBoss3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 68, 0); + } + else + { + if (!NPC.savedMech && Main.rand.Next(5) == 0 && !flag5 && !NPC.AnyNPCs(123) && (double)num2 > Main.rockLayer) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 123, 0); + } + else + { + if (flag10 && Main.rand.Next(75) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 287, 0); + } + else + { + if (flag10 && num32 == 0 && Main.rand.Next(25) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 293, 0); + } + else + { + if (flag10 && num32 == 1 && Main.rand.Next(25) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 291, 0); + } + else + { + if (flag10 && num32 == 2 && Main.rand.Next(25) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 292, 0); + } + else + { + if (flag10 && !NPC.AnyNPCs(290) && num32 == 0 && Main.rand.Next(45) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 290, 0); + } + else + { + if (flag10 && (num32 == 1 || num32 == 2) && Main.rand.Next(30) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 289, 0); + } + else + { + if (flag10 && Main.rand.Next(20) == 0) + { + int num33 = 281; + if (num32 == 0) + { + num33 += 2; + } + if (num32 == 2) + { + num33 += 4; + } + num33 += Main.rand.Next(2); + if (!NPC.AnyNPCs(num33)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, num33, 0); + } + } + else + { + if (flag10 && Main.rand.Next(3) != 0) + { + int num34 = 269; + if (num32 == 0) + { + num34 += 4; + } + if (num32 == 2) + { + num34 += 8; + } + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, num34 + Main.rand.Next(4), 0); + } + else + { + if (Main.rand.Next(37) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 71, 0); + } + else + { + if (num32 == 1 && Main.rand.Next(4) == 0 && !NPC.NearSpikeBall(num, num2)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 70, 0); + } + else + { + if (num32 == 2 && Main.rand.Next(15) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 72, 0); + } + else + { + if (num32 == 0 && Main.rand.Next(9) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 34, 0); + } + else + { + if (Main.rand.Next(7) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 32, 0); + } + else + { + int num35 = Main.rand.Next(5); + if (num35 == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 294, 0); + } + else + { + if (num35 == 1) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 295, 0); + } + else + { + if (num35 == 2) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 296, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 31, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Boned"); + } + else + { + if (Main.rand.Next(5) == 0) + { + Main.npc[num30].SetDefaults("Short Bones"); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (Main.player[j].zoneMeteor) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 23, 0); + } + else + { + if ((double)num2 <= Main.worldSurface && Main.dayTime && Main.eclipse) + { + if (Main.rand.Next(50) == 0 && !NPC.AnyNPCs(251)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 251, 0); + } + else + { + if (Main.rand.Next(10) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 253, 0); + } + else + { + if (Main.rand.Next(12) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 158, 0); + } + else + { + if (Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 162, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 166, 0); + } + } + } + } + } + else + { + if (Main.hardMode && num3 == 70 && flag5) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 256, 0); + } + else + { + if (num3 == 70 && (double)num2 <= Main.worldSurface && Main.rand.Next(3) != 0) + { + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(4) == 0) + { + if (Main.hardMode && Main.rand.Next(3) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 260, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 259, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + } + else + { + if (Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 257, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 258, 0); + } + } + } + else + { + if (Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 254, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 255, 0); + } + } + } + else + { + if (num3 == 70 && Main.hardMode && (double)num2 >= Main.worldSurface && Main.rand.Next(3) != 0) + { + if (Main.rand.Next(4) == 0) + { + if (Main.hardMode && Main.rand.Next(3) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 260, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 259, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + } + else + { + if (Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 257, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 258, 0); + } + } + } + else + { + if (Main.player[j].zoneEvil && Main.rand.Next(65) == 0 && !flag3) + { + if (Main.hardMode && Main.rand.Next(4) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 98, 1); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 7, 1); + } + } + else + { + if (Main.hardMode && (double)num2 > Main.worldSurface && Main.rand.Next(75) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 85, 0); + } + else + { + if (Main.hardMode && Main.tile[num, num2 - 1].wall == 2 && Main.rand.Next(20) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 85, 0); + } + else + { + if (Main.hardMode && (double)num2 <= Main.worldSurface && !Main.dayTime && (Main.rand.Next(20) == 0 || (Main.rand.Next(5) == 0 && Main.moonPhase == 4))) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 82, 0); + } + else + { + if (num29 == 60 && Main.rand.Next(500) == 0 && !Main.dayTime) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 52, 0); + } + else + { + if (num29 == 60 && (double)num2 > Main.worldSurface && Main.rand.Next(60) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 219, 0); + } + else + { + if ((double)num2 > Main.worldSurface && !Main.player[j].zoneSnow && !Main.player[j].zoneBlood && !Main.player[j].zoneEvil && !Main.player[j].zoneJungle && !Main.player[j].zoneHoly && Main.rand.Next(10) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 300, 0); + } + else + { + if (num29 == 60 && Main.hardMode && Main.rand.Next(3) != 0) + { + if ((double)num2 < Main.worldSurface && !Main.dayTime && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 152, 0); + } + else + { + if ((double)num2 < Main.worldSurface && Main.dayTime && Main.rand.Next(4) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 177, 0); + } + else + { + if ((double)num2 > Main.worldSurface && Main.rand.Next(100) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 205, 0); + } + else + { + if ((double)num2 > Main.worldSurface && Main.rand.Next(5) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 236, 0); + } + else + { + if ((double)num2 > Main.worldSurface && Main.rand.Next(4) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 176, 0); + if (Main.rand.Next(10) == 0) + { + Main.npc[num30].SetDefaults("Tiny Moss Hornet"); + } + if (Main.rand.Next(10) == 0) + { + Main.npc[num30].SetDefaults("Little Moss Hornet"); + } + if (Main.rand.Next(10) == 0) + { + Main.npc[num30].SetDefaults("Big Moss Hornet"); + } + if (Main.rand.Next(10) == 0) + { + Main.npc[num30].SetDefaults("Giant Moss Hornet"); + } + } + else + { + if (Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 175, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 153, 0); + } + } + } + } + } + } + } + else + { + if (num29 == 226 && flag2) + { + if (Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 226, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 198, 0); + } + } + else + { + if (num29 == 60 && (double)num2 > (Main.worldSurface + Main.rockLayer) / 2.0) + { + if (Main.rand.Next(4) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 204, 0); + } + else + { + if (Main.rand.Next(4) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 43, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + else + { + int num36 = Main.rand.Next(8); + if (num36 == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 231, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Little Hornet Fatty"); + } + else + { + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Hornet Fatty"); + } + } + } + else + { + if (num36 == 1) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 232, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Little Hornet Honey"); + } + else + { + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Hornet Honey"); + } + } + } + else + { + if (num36 == 2) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 233, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Little Hornet Leafy"); + } + else + { + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Hornet Leafy"); + } + } + } + else + { + if (num36 == 3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 234, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Little Hornet Spikey"); + } + else + { + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Hornet Spikey"); + } + } + } + else + { + if (num36 == 4) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 235, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Little Hornet Stingy"); + } + else + { + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Hornet Stingy"); + } + } + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 42, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Little Stinger"); + } + else + { + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Big Stinger"); + } + } + } + } + } + } + } + } + } + } + else + { + if (num29 == 60 && Main.rand.Next(4) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 51, 0); + } + else + { + if (num29 == 60 && Main.rand.Next(8) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 56, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + else + { + if (Main.hardMode && num29 == 53 && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 78, 0); + } + else + { + if (Main.hardMode && (num29 == 112 || num29 == 234) && Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 79, 0); + } + else + { + if (Main.hardMode && num29 == 116 && Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 80, 0); + } + else + { + if (Main.hardMode && !flag5 && (double)num2 < Main.rockLayer && (num29 == 116 || num29 == 117 || num29 == 109 || num29 == 164)) + { + if (!Main.dayTime && Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 122, 0); + } + else + { + if (Main.rand.Next(10) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 86, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 75, 0); + } + } + } + else + { + if (!flag3 && Main.hardMode && Main.rand.Next(50) == 0 && !flag5 && (double)num2 >= Main.rockLayer && (num29 == 116 || num29 == 117 || num29 == 109 || num29 == 164)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 84, 0); + } + else + { + if ((num29 == 204 && Main.player[j].zoneBlood) || num29 == 199 || num29 == 200 || num29 == 203) + { + if (Main.hardMode && (double)num2 >= Main.rockLayer && Main.rand.Next(5) == 0 && !flag3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 182, 0); + } + else + { + if (Main.hardMode && (double)num2 >= Main.rockLayer && Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 268, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 183, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Little Crimslime"); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Big Crimslime"); + } + } + } + else + { + if (Main.hardMode && (double)num2 >= Main.rockLayer && Main.rand.Next(40) == 0 && !flag3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 179, 0); + } + else + { + if (Main.hardMode && (Main.rand.Next(2) == 0 || (double)num2 > Main.worldSurface)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 174, 0); + } + else + { + if ((Main.tile[num, num2].wall > 0 && Main.rand.Next(4) != 0) || Main.rand.Next(8) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 239, 0); + } + else + { + if (Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 181, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 173, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Little Crimera"); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Big Crimera"); + } + } + } + } + } + } + } + } + } + } + else + { + if ((num29 == 22 && Main.player[j].zoneEvil) || num29 == 23 || num29 == 25 || num29 == 112 || num29 == 163) + { + if (Main.hardMode && (double)num2 >= Main.rockLayer && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 101, 0); + Main.npc[num30].ai[0] = (float)num; + Main.npc[num30].ai[1] = (float)num2; + Main.npc[num30].netUpdate = true; + } + else + { + if (Main.hardMode && Main.rand.Next(3) == 0) + { + if (Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 121, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 81, 0); + } + } + else + { + if (Main.hardMode && (double)num2 >= Main.rockLayer && Main.rand.Next(40) == 0 && !flag3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 83, 0); + } + else + { + if (Main.hardMode && (Main.rand.Next(2) == 0 || (double)num2 > Main.rockLayer)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 94, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 6, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Little Eater"); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Big Eater"); + } + } + } + } + } + } + } + else + { + if ((double)num2 <= Main.worldSurface) + { + if (Main.player[j].zoneSnow && Main.hardMode && Main.cloudAlpha > 0f && !NPC.AnyNPCs(243) && Main.rand.Next(20) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 243, 0); + } + else + { + if (Main.player[j].zoneHoly && Main.hardMode && Main.cloudAlpha > 0f && !NPC.AnyNPCs(244) && Main.rand.Next(20) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 244, 0); + } + else + { + if (!Main.player[j].zoneSnow && Main.hardMode && Main.cloudAlpha > 0f && !NPC.AnyNPCs(250) && Main.rand.Next(14) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 250, 0); + } + else + { + if (Main.dayTime) + { + int num37 = Math.Abs(num - Main.spawnTileX); + if (num37 < Main.maxTilesX / 3 && Main.rand.Next(15) == 0 && (num29 == 2 || num29 == 109 || num29 == 147 || num29 == 161)) + { + if (num29 == 147 || num29 == 161) + { + if (Main.rand.Next(2) == 0) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 148, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 149, 0); + } + } + else + { + if (Main.rand.Next(3) == 0 && (double)num2 <= Main.worldSurface) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 299, 0); + } + else + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 46, 0); + } + } + } + else + { + if (num37 < Main.maxTilesX / 3 && Main.rand.Next(15) == 0 && (num29 == 2 || num29 == 109 || num29 == 147)) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 74, 0); + } + else + { + if (num37 > Main.maxTilesX / 3 && num29 == 2 && Main.rand.Next(300) == 0 && !NPC.AnyNPCs(50)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 50, 0); + } + else + { + if (num29 == 53 && Main.rand.Next(5) == 0 && !flag5) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 69, 0); + } + else + { + if (num29 == 53 && !flag5) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 61, 0); + } + else + { + if (num37 > Main.maxTilesX / 3 && (Main.rand.Next(15) == 0 || (!NPC.downedGoblins && WorldGen.shadowOrbSmashed && Main.rand.Next(7) == 0))) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 73, 0); + } + else + { + if (Main.raining && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 224, 0); + } + else + { + if (Main.raining && Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 225, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 1, 0); + if (num29 == 60) + { + Main.npc[num30].SetDefaults("Jungle Slime"); + } + else + { + if (num29 == 161 || num29 == 147) + { + Main.npc[num30].SetDefaults("Ice Slime"); + } + else + { + if (Main.rand.Next(3) == 0 || num37 < 200) + { + Main.npc[num30].SetDefaults("Green Slime"); + } + else + { + if (Main.rand.Next(10) == 0 && num37 > 400) + { + Main.npc[num30].SetDefaults("Purple Slime"); + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (Main.rand.Next(6) == 0 || (Main.moonPhase == 4 && Main.rand.Next(2) == 0)) + { + if (Main.hardMode && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 133, 0); + } + else + { + if (Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 2, 0); + if (Main.rand.Next(4) == 0) + { + Main.npc[num30].SetDefaults("Demon Eye 2"); + } + } + else + { + int num38 = Main.rand.Next(5); + if (num38 == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 190, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Cataract Eye 2"); + } + } + else + { + if (num38 == 1) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 191, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Sleepy Eye 2"); + } + } + else + { + if (num38 == 2) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 192, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Dialated Eye 2"); + } + } + else + { + if (num38 == 3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 193, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Green Eye 2"); + } + } + else + { + if (num38 == 4) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 194, 0); + if (Main.rand.Next(3) == 0) + { + Main.npc[num30].SetDefaults("Purple Eye 2"); + } + } + } + } + } + } + } + } + } + else + { + if (Main.hardMode && Main.rand.Next(50) == 0 && Main.bloodMoon && !NPC.AnyNPCs(109)) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 109, 0); + } + else + { + if (Main.rand.Next(250) == 0 && Main.bloodMoon) + { + NPC.NewNPC(num * 16 + 8, num2 * 16, 53, 0); + } + else + { + if (Main.moonPhase == 0 && Main.hardMode && Main.rand.Next(3) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 104, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 140, 0); + } + else + { + if (num3 == 147 || num3 == 161 || num3 == 163 || num3 == 164 || num3 == 162) + { + if (Main.hardMode && Main.rand.Next(4) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 169, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 155, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 161, 0); + } + } + } + else + { + if (Main.raining && Main.rand.Next(2) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 223, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Rain Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Rain Zombie"); + } + } + } + else + { + int num39 = Main.rand.Next(7); + if (num39 == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 3, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Zombie"); + } + } + } + else + { + if (num39 == 1) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 132, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Bald Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Bald Zombie"); + } + } + } + else + { + if (num39 == 2) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 186, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Pincushion Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Pincushion Zombie"); + } + } + } + else + { + if (num39 == 3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 187, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Slimed Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Slimed Zombie"); + } + } + } + else + { + if (num39 == 4) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 188, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Swamp Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Swamp Zombie"); + } + } + } + else + { + if (num39 == 5) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 189, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Twiggy Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Twiggy Zombie"); + } + } + } + else + { + if (num39 == 6) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 200, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Small Female Zombie"); + } + else + { + Main.npc[num30].SetDefaults("Big Female Zombie"); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if ((double)num2 <= Main.rockLayer) + { + if (!flag3 && Main.rand.Next(50) == 0 && !Main.player[j].zoneSnow) + { + if (Main.hardMode) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 95, 1); + } + else + { + if (Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 185, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 10, 1); + } + } + } + else + { + if (Main.hardMode && Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 140, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(4) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 141, 0); + } + else + { + if (num29 == 147 || num29 == 161 || Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 147, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 1, 0); + if (Main.rand.Next(5) == 0) + { + Main.npc[num30].SetDefaults("Yellow Slime"); + } + else + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Blue Slime"); + } + else + { + Main.npc[num30].SetDefaults("Red Slime"); + } + } + } + } + } + } + } + else + { + if (num2 > Main.maxTilesY - 190) + { + if (Main.rand.Next(40) == 0 && !NPC.AnyNPCs(39)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 39, 1); + } + else + { + if (Main.rand.Next(14) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 24, 0); + } + else + { + if (Main.rand.Next(8) == 0) + { + if (Main.rand.Next(7) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 66, 0); + } + else + { + if (NPC.downedMechBossAny && Main.rand.Next(5) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 156, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 62, 0); + } + } + } + else + { + if (Main.rand.Next(3) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 59, 0); + } + else + { + if (NPC.downedMechBossAny && Main.rand.Next(5) != 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 151, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 60, 0); + } + } + } + } + } + } + else + { + if (Main.rand.Next(60) == 0) + { + if (Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 218, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 217, 0); + } + } + else + { + if ((num29 == 116 || num29 == 117 || num29 == 164) && !flag3 && Main.rand.Next(8) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 120, 0); + } + else + { + if ((num3 == 147 || num3 == 161 || num3 == 162 || num3 == 163 || num3 == 164) && !flag3 && Main.hardMode && Main.player[j].zoneEvil && Main.rand.Next(30) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 170, 0); + } + else + { + if ((num3 == 147 || num3 == 161 || num3 == 162 || num3 == 163 || num3 == 164) && !flag3 && Main.hardMode && Main.player[j].zoneHoly && Main.rand.Next(30) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 171, 0); + } + else + { + if ((num3 == 147 || num3 == 161 || num3 == 162 || num3 == 163 || num3 == 164) && !flag3 && Main.hardMode && Main.player[j].zoneBlood && Main.rand.Next(30) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 171, 0); + } + else + { + if (Main.hardMode && Main.player[j].zoneSnow && Main.rand.Next(10) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 154, 0); + } + else + { + if (!flag3 && Main.rand.Next(100) == 0 && !Main.player[j].zoneHoly) + { + if (Main.hardMode) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 95, 1); + } + else + { + if (Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 185, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 10, 1); + } + } + } + else + { + if (Main.player[j].zoneSnow && Main.rand.Next(20) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 185, 0); + } + else + { + if (!Main.hardMode && Main.rand.Next(10) == 0) + { + if (Main.player[j].zoneSnow) + { + Main.npc[num30].SetDefaults(184, -1f); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 16, 0); + } + } + else + { + if (!Main.hardMode && Main.rand.Next(4) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 1, 0); + if (Main.player[j].zoneJungle) + { + Main.npc[num30].SetDefaults("Jungle Slime"); + } + else + { + if (Main.player[j].zoneSnow) + { + Main.npc[num30].SetDefaults(184, -1f); + } + else + { + Main.npc[num30].SetDefaults("Black Slime"); + } + } + } + else + { + if (Main.rand.Next(2) == 0) + { + if ((!Main.hardMode && Main.rand.Next(100) == 0) || Main.rand.Next(500) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 195, 0); + } + else + { + if (Main.hardMode && (double)num2 > (Main.rockLayer + (double)Main.maxTilesY) / 2.0 && Main.rand.Next(400) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 172, 0); + } + else + { + if ((double)num2 > (Main.rockLayer + (double)Main.maxTilesY) / 2.0 && Main.rand.Next(350) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 45, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(10) != 0) + { + if (Main.rand.Next(2) == 0) + { + if (Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 197, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 77, 0); + if ((double)num2 > (Main.rockLayer + (double)Main.maxTilesY) / 2.0 && Main.rand.Next(5) == 0) + { + Main.npc[num30].SetDefaults("Heavy Skeleton"); + } + } + } + else + { + if (Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 206, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 110, 0); + } + } + } + else + { + if (Main.rand.Next(20) == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 44, 0); + } + else + { + if (num3 == 147 || num3 == 161 || num3 == 162) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 167, 0); + } + else + { + if (Main.player[j].zoneSnow) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 185, 0); + } + else + { + int num40 = Main.rand.Next(4); + if (num40 == 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 21, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Big Skeleton"); + } + else + { + Main.npc[num30].SetDefaults("Small Skeleton"); + } + } + } + else + { + if (num40 == 1) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 201, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Big Headache Skeleton"); + } + else + { + Main.npc[num30].SetDefaults("Small Headache Skeleton"); + } + } + } + else + { + if (num40 == 2) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 202, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Big Misassembled Skeleton"); + } + else + { + Main.npc[num30].SetDefaults("Small Misassembled Skeleton"); + } + } + } + else + { + if (num40 == 3) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 203, 0); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[num30].SetDefaults("Big Pantless Skeleton"); + } + else + { + Main.npc[num30].SetDefaults("Small Pantless Skeleton"); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (Main.hardMode && (Main.player[j].zoneHoly & Main.rand.Next(2) == 0)) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 138, 0); + } + else + { + if (Main.player[j].zoneJungle) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 51, 0); + } + else + { + if (Main.hardMode && Main.player[j].zoneHoly) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 137, 0); + } + else + { + if (Main.hardMode && Main.rand.Next(6) > 0) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 93, 0); + } + else + { + if (num3 == 147 || num3 == 161 || num3 == 162) + { + if (Main.hardMode) + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 169, 0); + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 150, 0); + } + } + else + { + num30 = NPC.NewNPC(num * 16 + 8, num2 * 16, 49, 0); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.npc[num30].type == 1 && Main.rand.Next(250) == 0) + { + Main.npc[num30].SetDefaults("Pinky"); + } + if (Main.netMode == 2 && num30 < 200) + { + NetMessage.SendData(23, -1, -1, "", num30, 0f, 0f, 0f, 0); + return; + } + break; + } + } + } + } + public static void SpawnWOF(Vector2 pos) + { + if (pos.Y / 16f < (float)(Main.maxTilesY - 205)) + { + return; + } + if (Main.wof >= 0) + { + return; + } + if (Main.netMode == 1) + { + return; + } + Player.FindClosest(pos, 16, 16); + int num = 1; + if (pos.X / 16f > (float)(Main.maxTilesX / 2)) + { + num = -1; + } + bool flag = false; + int num2 = (int)pos.X; + while (!flag) + { + flag = true; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && Main.player[i].position.X > (float)(num2 - 1200) && Main.player[i].position.X < (float)(num2 + 1200)) + { + num2 -= num * 16; + flag = false; + } + } + if (num2 / 16 < 20 || num2 / 16 > Main.maxTilesX - 20) + { + flag = true; + } + } + int num3 = (int)pos.Y; + int num4 = num2 / 16; + int num5 = num3 / 16; + int num6 = 0; + try + { + while (WorldGen.SolidTile(num4, num5 - num6) || Main.tile[num4, num5 - num6].liquid >= 100) + { + if (!WorldGen.SolidTile(num4, num5 + num6) && Main.tile[num4, num5 + num6].liquid < 100) + { + num5 += num6; + goto IL_162; + } + num6++; + } + num5 -= num6; + } + catch + { + } + IL_162: + num3 = num5 * 16; + int num7 = NPC.NewNPC(num2, num3, 113, 0); + if (Main.npc[num7].displayName == "") + { + Main.npc[num7].displayName = Main.npc[num7].name; + } + if (Main.netMode == 0) + { + Main.NewText(Main.npc[num7].displayName + " " + Lang.misc[16], 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Main.npc[num7].displayName + " " + Lang.misc[16], 255, 175f, 75f, 255f, 0); + } + } + public static void SpawnOnPlayer(int plr, int Type) + { + if (Main.netMode == 1) + { + return; + } + if (Type == 262 && NPC.AnyNPCs(262)) + { + return; + } + if (Type != 245) + { + bool flag = false; + int num = 0; + int num2 = 0; + int num3 = (int)(Main.player[plr].position.X / 16f) - NPC.spawnRangeX * 2; + int num4 = (int)(Main.player[plr].position.X / 16f) + NPC.spawnRangeX * 2; + int num5 = (int)(Main.player[plr].position.Y / 16f) - NPC.spawnRangeY * 2; + int num6 = (int)(Main.player[plr].position.Y / 16f) + NPC.spawnRangeY * 2; + int num7 = (int)(Main.player[plr].position.X / 16f) - NPC.safeRangeX; + int num8 = (int)(Main.player[plr].position.X / 16f) + NPC.safeRangeX; + int num9 = (int)(Main.player[plr].position.Y / 16f) - NPC.safeRangeY; + int num10 = (int)(Main.player[plr].position.Y / 16f) + NPC.safeRangeY; + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int i = 0; i < 1000; i++) + { + int j = 0; + while (j < 100) + { + int num11 = Main.rand.Next(num3, num4); + int num12 = Main.rand.Next(num5, num6); + if (Main.tile[num11, num12].nactive() && Main.tileSolid[(int)Main.tile[num11, num12].type]) + { + goto IL_518; + } + if (!Main.wallHouse[(int)Main.tile[num11, num12].wall] || i >= 999) + { + int k = num12; + while (k < Main.maxTilesY) + { + if (Main.tile[num11, k].nactive() && Main.tileSolid[(int)Main.tile[num11, k].type]) + { + if (num11 < num7 || num11 > num8 || k < num9 || k > num10 || i == 999) + { + byte arg_43A_0 = Main.tile[num11, k].type; + num = num11; + num2 = k; + flag = true; + break; + } + break; + } + else + { + k++; + } + } + if (!flag || i >= 999) + { + goto IL_518; + } + int num13 = num - NPC.spawnSpaceX / 2; + int num14 = num + NPC.spawnSpaceX / 2; + int num15 = num2 - NPC.spawnSpaceY; + int num16 = num2; + if (num13 < 0) + { + flag = false; + } + if (num14 > Main.maxTilesX) + { + flag = false; + } + if (num15 < 0) + { + flag = false; + } + if (num16 > Main.maxTilesY) + { + flag = false; + } + if (flag) + { + for (int l = num13; l < num14; l++) + { + for (int m = num15; m < num16; m++) + { + if (Main.tile[l, m].nactive() && Main.tileSolid[(int)Main.tile[l, m].type]) + { + flag = false; + break; + } + } + } + goto IL_518; + } + goto IL_518; + } + IL_520: + j++; + continue; + IL_518: + if (!flag && !flag) + { + goto IL_520; + } + break; + } + if (flag && i < 999) + { + Rectangle rectangle = new Rectangle(num * 16, num2 * 16, 16, 16); + for (int n = 0; n < 255; n++) + { + if (Main.player[n].active) + { + Rectangle rectangle2 = new Rectangle((int)(Main.player[n].position.X + (float)(Main.player[n].width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(Main.player[n].position.Y + (float)(Main.player[n].height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + if (rectangle.Intersects(rectangle2)) + { + flag = false; + } + } + } + } + if (flag) + { + break; + } + } + if (flag) + { + int num17 = NPC.NewNPC(num * 16 + 8, num2 * 16, Type, 1); + if (num17 == 200) + { + return; + } + Main.npc[num17].target = plr; + Main.npc[num17].timeLeft *= 20; + string str = Main.npc[num17].name; + if (Main.npc[num17].displayName != "") + { + str = Main.npc[num17].displayName; + } + if (Main.netMode == 2 && num17 < 200) + { + NetMessage.SendData(23, -1, -1, "", num17, 0f, 0f, 0f, 0); + } + if (Type == 125) + { + if (Main.netMode == 0) + { + Main.NewText("The Twins " + Lang.misc[16], 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, "The Twins " + Lang.misc[16], 255, 175f, 75f, 255f, 0); + return; + } + } + else + { + if (Type != 82 && Type != 126 && Type != 50) + { + if (Main.netMode == 0) + { + Main.NewText(str + " " + Lang.misc[16], 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, str + " " + Lang.misc[16], 255, 175f, 75f, 255f, 0); + } + } + } + } + return; + } + if (NPC.AnyNPCs(245)) + { + return; + } + try + { + int num18 = (int)Main.player[plr].center().X / 16; + int num19 = (int)Main.player[plr].center().Y / 16; + int num20 = 0; + int num21 = 0; + for (int num22 = num18 - 20; num22 < num18 + 20; num22++) + { + for (int num23 = num19 - 20; num23 < num19 + 20; num23++) + { + if (Main.tile[num22, num23].active() && Main.tile[num22, num23].type == 237 && Main.tile[num22, num23].frameX == 18 && Main.tile[num22, num23].frameY == 0) + { + num20 = num22; + num21 = num23; + } + } + } + if (num20 > 0 && num21 > 0) + { + int num24 = num21 - 15; + int num25 = num21 - 15; + for (int num26 = num21; num26 > num21 - 100; num26--) + { + if (WorldGen.SolidTile(num20, num26)) + { + num24 = num26; + break; + } + } + for (int num27 = num21; num27 < num21 + 100; num27++) + { + if (WorldGen.SolidTile(num20, num27)) + { + num25 = num27; + break; + } + } + num21 = (num24 + num24 + num25) / 3; + int num28 = NPC.NewNPC(num20 * 16 + 8, num21 * 16, 245, 100); + Main.npc[num28].target = plr; + string str2 = Main.npc[num28].name; + if (Main.netMode == 0) + { + Main.NewText(str2 + " " + Lang.misc[16], 175, 75, 255, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, str2 + " " + Lang.misc[16], 255, 175f, 75f, 255f, 0); + } + } + } + } + catch + { + } + } + public static int NewNPC(int X, int Y, int Type, int Start = 0) + { + int num = -1; + if (Type == 222) + { + for (int i = 199; i >= 0; i--) + { + if (!Main.npc[i].active) + { + num = i; + break; + } + } + } + else + { + for (int j = Start; j < 200; j++) + { + if (!Main.npc[j].active) + { + num = j; + break; + } + } + } + if (num >= 0) + { + Main.npc[num] = new NPC(); + Main.npc[num].SetDefaults(Type, -1f); + Main.npc[num].position.X = (float)(X - Main.npc[num].width / 2); + Main.npc[num].position.Y = (float)(Y - Main.npc[num].height); + Main.npc[num].active = true; + Main.npc[num].timeLeft = (int)((double)NPC.activeTime * 1.25); + Main.npc[num].wet = Collision.WetCollision(Main.npc[num].position, Main.npc[num].width, Main.npc[num].height); + if (Type == 50) + { + if (Main.netMode == 0) + { + Main.NewText(Main.npc[num].name + " " + Lang.misc[16], 175, 75, 255, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Main.npc[num].name + " " + Lang.misc[16], 255, 175f, 75f, 255f, 0); + } + } + } + return num; + } + return 200; + } + public void xForm(int oldType, int newType) + { + if ((oldType == 158 && newType == 159) || (oldType == 159 && newType == 158)) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + int num = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), this.velocity, 99, this.scale); + Main.gore[num].velocity *= 0.3f; + num = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), this.velocity, 99, this.scale); + Main.gore[num].velocity *= 0.3f; + num = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)this.height - 10f), this.velocity, 99, this.scale); + Main.gore[num].velocity *= 0.3f; + } + } + public void Teleport(Vector2 newPos, int Style = 0) + { + Main.TeleportEffect(this.getRect(), Style); + this.position = newPos; + Main.TeleportEffect(this.getRect(), Style); + this.teleportTime = 1f; + if (Main.netMode == 2) + { + NetMessage.SendData(65, -1, -1, "", 1, (float)this.whoAmI, newPos.X, newPos.Y, Style); + } + } + public void Transform(int newType) + { + if (Main.netMode != 1) + { + bool flag = false; + if (this.value == 0f) + { + flag = true; + } + int oldType = this.type; + int num = this.life; + int num2 = this.lifeMax; + Vector2 vector = this.velocity; + this.position.Y = this.position.Y + (float)this.height; + int num3 = this.spriteDirection; + this.SetDefaults(newType, -1f); + this.spriteDirection = num3; + this.TargetClosest(true); + this.velocity = vector; + this.position.Y = this.position.Y - (float)this.height; + if (flag) + { + this.value = 0f; + } + if (this.lifeMax == num2) + { + this.life = num; + } + if (newType == 107 || newType == 108) + { + this.homeTileX = (int)(this.position.X + (float)(this.width / 2)) / 16; + this.homeTileY = (int)(this.position.Y + (float)this.height) / 16; + this.homeless = true; + } + if (Main.netMode == 2) + { + this.netUpdate = true; + NetMessage.SendData(23, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + this.xForm(oldType, newType); + } + } + public double StrikeNPC(int Damage, float knockBack, int hitDirection, bool crit = false, bool noEffect = false) + { + if (!this.active || this.life <= 0) + { + return 0.0; + } + double num = (double)Damage; + if (this.ichor) + { + num = Main.CalculateDamage((int)num, this.defense - 20); + } + else + { + num = Main.CalculateDamage((int)num, this.defense); + } + if (crit) + { + num *= 2.0; + } + if (Damage != 9999 && this.lifeMax > 1) + { + if (this.friendly) + { + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 80, 90, 255), string.Concat((int)num), crit, false); + } + else + { + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 160, 80, 255), string.Concat((int)num), crit, false); + } + } + if (num >= 1.0) + { + this.justHit = true; + if (this.townNPC) + { + this.ai[0] = 1f; + this.ai[1] = (float)(300 + Main.rand.Next(300)); + this.ai[2] = 0f; + this.direction = hitDirection; + this.netUpdate = true; + } + if (this.aiStyle == 8 && Main.netMode != 1) + { + if (this.type == 172) + { + this.ai[0] = 450f; + } + else + { + this.ai[0] = 400f; + } + this.TargetClosest(true); + } + if (this.type == 184) + { + this.localAI[0] = 60f; + } + if (this.type == 185) + { + this.localAI[0] = 1f; + } + if (this.realLife >= 0) + { + Main.npc[this.realLife].life -= (int)num; + this.life = Main.npc[this.realLife].life; + this.lifeMax = Main.npc[this.realLife].lifeMax; + } + else + { + this.life -= (int)num; + } + if (knockBack > 0f && this.knockBackResist > 0f) + { + float num2 = knockBack * this.knockBackResist; + if (num2 > 8f) + { + num2 = 8f; + } + if (crit) + { + num2 *= 1.4f; + } + if (num * 10.0 > (double)this.lifeMax) + { + if (hitDirection < 0 && this.velocity.X > -num2) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num2; + } + this.velocity.X = this.velocity.X - num2; + if (this.velocity.X < -num2) + { + this.velocity.X = -num2; + } + } + else + { + if (hitDirection > 0 && this.velocity.X < num2) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num2; + } + this.velocity.X = this.velocity.X + num2; + if (this.velocity.X > num2) + { + this.velocity.X = num2; + } + } + } + if (this.type == 185) + { + num2 *= 1.5f; + } + if (!this.noGravity) + { + num2 *= -0.75f; + } + else + { + num2 *= -0.5f; + } + if (this.velocity.Y > num2) + { + this.velocity.Y = this.velocity.Y + num2; + if (this.velocity.Y < num2) + { + this.velocity.Y = num2; + } + } + } + else + { + if (!this.noGravity) + { + this.velocity.Y = -num2 * 0.75f * this.knockBackResist; + } + else + { + this.velocity.Y = -num2 * 0.5f * this.knockBackResist; + } + this.velocity.X = num2 * (float)hitDirection * this.knockBackResist; + } + } + if ((this.type == 113 || this.type == 114) && this.life <= 0) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && (Main.npc[i].type == 113 || Main.npc[i].type == 114)) + { + Main.npc[i].HitEffect(hitDirection, num); + } + } + } + else + { + this.HitEffect(hitDirection, num); + } + if (this.soundHit > 0) + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, this.soundHit); + } + if (this.realLife >= 0) + { + Main.npc[this.realLife].checkDead(); + } + else + { + this.checkDead(); + } + return num; + } + return 0.0; + } + public void checkDead() + { + if (!this.active) + { + return; + } + if (this.realLife >= 0 && this.realLife != this.whoAmI) + { + return; + } + if (this.life <= 0) + { + NPC.noSpawnCycle = true; + if (this.townNPC && this.type != 37) + { + string str = this.name; + if (this.displayName != "") + { + str = this.displayName; + } + if (Main.netMode == 0) + { + Main.NewText(str + Lang.misc[19], 255, 25, 25, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, str + Lang.misc[19], 255, 255f, 25f, 25f, 0); + } + } + } + if (Main.netMode != 1 && !Main.dayTime && this.type == 54 && !NPC.AnyNPCs(35)) + { + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && Main.player[i].killClothier) + { + NPC.SpawnOnPlayer(i, 35); + break; + } + } + } + if (this.townNPC && Main.netMode != 1 && this.homeless && WorldGen.spawnNPC == this.type) + { + WorldGen.spawnNPC = 0; + } + if (this.soundKilled > 0) + { + Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, this.soundKilled); + } + this.NPCLoot(); + if (this.townNPC && this.type != 37 && Main.netMode != 1) + { + Main.chrName[this.type] = ""; + NPC.setNames(); + NetMessage.SendData(56, -1, -1, "", this.type, 0f, 0f, 0f, 0); + } + this.active = false; + if (this.type == 26 || this.type == 27 || this.type == 28 || this.type == 29 || this.type == 111 || this.type == 143 || this.type == 144 || this.type == 145 || this.type == 212 || this.type == 213 || this.type == 214 || this.type == 215) + { + Main.invasionSize--; + } + if (this.type == 216) + { + Main.invasionSize -= 5; + } + } + } + public void NPCLoot() + { + if (Main.netMode == 1) + { + return; + } + if (Main.hardMode && this.lifeMax > 1 && this.damage > 0 && !this.friendly && (double)this.position.Y > Main.rockLayer * 16.0 && Main.rand.Next(5) == 0 && this.type != 121 && this.value > 0f) + { + if (Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneEvil || Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneBlood) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 521, 1, false, 0, false); + } + if (Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneHoly) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 520, 1, false, 0, false); + } + } + if (this.type == 22 && Main.chrName[22] == "Andrew") + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 867, 1, false, 0, false); + } + if (Main.rand.Next(200) == 0) + { + int num = Item.NPCtoBanner(this.type); + if (num > 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1615 + num - 1, 1, false, 0, false); + } + } + if (Main.hardMode && this.value > 0f) + { + if (!NPC.downedMechBoss1 && Main.rand.Next(1000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 556, 1, false, 0, false); + } + else + { + if (!NPC.downedMechBoss2 && Main.rand.Next(1000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 544, 1, false, 0, false); + } + else + { + if (!NPC.downedMechBoss3 && Main.rand.Next(1000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 557, 1, false, 0, false); + } + } + } + } + if (Main.hardMode && this.value > 0f) + { + if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneJungle) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1533, 1, false, 0, false); + } + if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneEvil) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1534, 1, false, 0, false); + } + if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneBlood) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1535, 1, false, 0, false); + } + if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneHoly) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1536, 1, false, 0, false); + } + if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneSnow) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1537, 1, false, 0, false); + } + } + if (this.type == 68) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1169, 1, false, 0, false); + } + if (this.type == 156 && Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1518, 1, false, 0, false); + } + if (this.type == 243 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1519, 1, false, 0, false); + } + if (this.type >= 269 && this.type <= 280 && Main.rand.Next(450) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1517, 1, false, 0, false); + } + if ((this.type == 158 || this.type == 159) && Main.rand.Next(40) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1520, 1, false, 0, false); + } + if (this.type == 176 && Main.rand.Next(150) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1521, 1, false, 0, false); + } + if (this.type == 48 && Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1516, 1, false, 0, false); + } + if (this.type == 205 && Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1611, 1, false, 0, false); + } + if (Main.xMas && this.lifeMax > 1 && this.damage > 0 && !this.friendly && this.type != 121 && this.value > 0f && Main.rand.Next(13) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.rand.Next(599, 602), 1, false, 0, false); + } + if ((this.type == 281 || this.type == 282) && Main.rand.Next(40) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1446, 1, false, -1, false); + } + if ((this.type == 283 || this.type == 284) && Main.rand.Next(40) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1444, 1, false, -1, false); + } + if ((this.type == 285 || this.type == 286) && Main.rand.Next(40) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1445, 1, false, -1, false); + } + if (this.lifeMax > 100 && this.type != 288 && this.target >= 0 && Main.hardMode && NPC.downedPlantBoss && Main.player[this.target].zoneDungeon && Main.rand.Next(13) == 0 && Main.wallDungeon[(int)Main.tile[(int)this.center().X / 16, (int)this.center().Y / 16].wall]) + { + NPC.NewNPC((int)this.center().X, (int)this.center().Y, 288, 0); + } + if (this.type == 288) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1508, Main.rand.Next(1, 3), false, -1, false); + } + if ((this.type == 162 || this.type == 166) && Main.rand.Next(250) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1570, 1, false, -1, false); + } + if ((this.type == 158 || this.type == 159) && Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 900, 1, false, -1, false); + } + if (this.type == 35) + { + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1281, 1, false, -1, false); + } + else + { + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1273, 1, false, -1, false); + } + else + { + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1313, 1, false, -1, false); + } + } + } + } + if (Main.bloodMoon && Main.hardMode && Main.rand.Next(1000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1314, 1, false, -1, false); + } + if (Main.rand.Next(100) == 0) + { + if (this.type == 104 || this.type == 102 || (this.type >= 269 && this.type <= 272)) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 885, 1, false, -1, false); + } + if (this.type == 77 || (this.type >= 273 && this.type <= 276)) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 886, 1, false, -1, false); + } + if (this.type == 141 || this.type == 178 || this.type == 42 || (this.type >= 231 && this.type <= 235)) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 887, 1, false, -1, false); + } + if (this.type == 79 || this.type == 81) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 888, 1, false, -1, false); + } + if (this.type == 75 || this.type == 78 || this.type == 82) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 889, 1, false, -1, false); + } + if (this.type == 75 || this.type == 79 || this.type == 103) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 890, 1, false, -1, false); + } + if (this.type == 34 || this.type == 83 || this.type == 84) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 891, 1, false, -1, false); + } + if (this.type == 94) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 892, 1, false, -1, false); + } + if (this.type == 93 || this.type == 109 || this.type == 80) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 893, 1, false, -1, false); + } + } + if (this.type == 290) + { + if (Main.rand.Next(35) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1513, 1, false, -1, false); + } + else + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 938, 1, false, -1, false); + } + } + } + if (this.type == 291) + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1300, 1, false, -1, false); + } + else + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1254, 1, false, -1, false); + } + } + } + if (this.type == 292) + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1514, 1, false, -1, false); + } + else + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 679, 1, false, -1, false); + } + } + } + if (this.type == 293 && Main.rand.Next(20) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 759, 1, false, -1, false); + } + if (this.type == 156 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 683, 1, false, -1, false); + } + if (this.type == 245) + { + int num2 = Main.rand.Next(8); + if (num2 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1258, 1, false, -1, false); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1261, Main.rand.Next(60, 100), false, 0, false); + } + else + { + if (num2 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1122, 1, false, -1, false); + } + else + { + if (num2 == 2) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 899, 1, false, -1, false); + } + else + { + if (num2 == 3) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1248, 1, false, -1, false); + } + else + { + if (num2 == 4) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1294, 1, false, -1, false); + } + else + { + if (num2 == 5) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1295, 1, false, -1, false); + } + else + { + if (num2 == 6) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1296, 1, false, -1, false); + } + else + { + if (num2 == 7) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1297, 1, false, -1, false); + } + } + } + } + } + } + } + } + NPC.downedGolemBoss = true; + } + if (this.type == 268) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1332, Main.rand.Next(1, 4), false, 0, false); + } + if (this.type == 109 && !NPC.downedClown) + { + NPC.downedClown = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + if (this.type == 153 && Main.rand.Next(17) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1328, 1, false, -1, false); + } + if (this.type == 253 && Main.rand.Next(250) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1327, 1, false, -1, false); + } + if (this.type == 120 && Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1326, 1, false, -1, false); + } + if (this.type == 49 && Main.rand.Next(250) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1325, 1, false, -1, false); + } + if (this.type == 185 && Main.rand.Next(150) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 951, 1, false, -1, false); + } + if (this.type == 44 && Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1320, 1, false, -1, false); + } + if (this.type == 110 && Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1321, 1, false, -1, false); + } + if (this.type == 260 && Main.rand.Next(150) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1322, 1, false, -1, false); + } + if (this.type == 151 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1322, 1, false, -1, false); + } + if (this.type == 24 && Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1323, 1, false, -1, false); + } + if (this.type == 109 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1324, Main.rand.Next(1, 5), false, -1, false); + } + if ((this.type == 163 || this.type == 238) && Main.rand.Next(40) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1308, 1, false, -1, false); + } + if (this.type == 287 && Main.rand.Next(7) == 0) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 963, 1, false, -1, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 977, 1, false, -1, false); + } + } + if (this.type == 77 && Main.rand.Next(150) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 723, 1, false, -1, false); + } + if (this.type == 251 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1311, 1, false, -1, false); + } + if (this.type == 197 && Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1306, 1, false, -1, false); + } + if (this.type == 244) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(1, 6), false, 0, false); + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(1, 6), false, 0, false); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(1, 6), false, 0, false); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(1, 6), false, 0, false); + } + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 662, Main.rand.Next(30, 60), false, 0, false); + } + if (this.type == 250 && Main.rand.Next(15) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1244, 1, false, -1, false); + } + if (this.type == 172) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 754, 1, false, -1, false); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 755, 1, false, -1, false); + } + if (this.type == 110 && Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 682, 1, false, -1, false); + } + if (this.type >= 269 && this.type <= 280) + { + if (Main.rand.Next(600) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1183, 1, false, -1, false); + } + else + { + if (Main.rand.Next(400) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1266, 1, false, -1, false); + } + else + { + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 671, 1, false, -1, false); + } + } + } + } + if (this.type == 154 && Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1253, 1, false, -1, false); + } + if ((this.type == 169 || this.type == 206) && Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 726, 1, false, -1, false); + } + if (this.type == 243) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.rand.Next(684, 687), 1, false, -1, false); + } + if (this.type == 198 || this.type == 199 || this.type == 226) + { + if (Main.rand.Next(3000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1172, 1, false, -1, false); + } + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1293, 1, false, -1, false); + } + } + if (this.type == 78 || this.type == 79 || this.type == 80) + { + if (Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 870, 1, false, -1, false); + } + if (Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 871, 1, false, -1, false); + } + if (Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 872, 1, false, -1, false); + } + } + if (this.type == 85 && this.value > 0f) + { + if (this.ai[3] == 4f) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1312, 1, false, -1, false); + } + else + { + int num3 = Main.rand.Next(3); + if (num3 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 676, 1, false, -1, false); + } + else + { + if (num3 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 725, 1, false, -1, false); + } + else + { + if (num3 == 2) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1264, 1, false, -1, false); + } + } + } + } + } + else + { + int num4 = Main.rand.Next(7); + if (num4 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 437, 1, false, -1, false); + } + if (num4 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 517, 1, false, -1, false); + } + if (num4 == 2) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 535, 1, false, -1, false); + } + if (num4 == 3) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 536, 1, false, -1, false); + } + if (num4 == 4) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 532, 1, false, -1, false); + } + if (num4 == 5) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 393, 1, false, -1, false); + } + if (num4 == 6) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 554, 1, false, -1, false); + } + } + } + if (this.type == 87) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 575, Main.rand.Next(5, 11), false, 0, false); + } + if (this.type >= 212 && this.type <= 215) + { + if (Main.rand.Next(8000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 905, 1, false, -1, false); + } + if (Main.rand.Next(4000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 855, 1, false, -1, false); + } + if (Main.rand.Next(2000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 854, 1, false, -1, false); + } + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 672, 1, false, -1, false); + } + if (Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1277, 1, false, 0, false); + } + if (Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1278, 1, false, 0, false); + } + if (Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1279, 1, false, 0, false); + } + if (Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1280, 1, false, 0, false); + } + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1704, 1, false, 0, false); + } + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1705, 1, false, 0, false); + } + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1710, 1, false, 0, false); + } + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1716, 1, false, 0, false); + } + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1720, 1, false, 0, false); + } + } + else + { + if (this.type == 216) + { + if (Main.rand.Next(4000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 905, 1, false, -1, false); + } + if (Main.rand.Next(2000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 855, 1, false, -1, false); + } + if (Main.rand.Next(1000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 854, 1, false, -1, false); + } + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 672, 1, false, -1, false); + } + } + } + if (this.type == 161 && Main.rand.Next(50) == 0) + { + int num5 = Main.rand.Next(3); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 803 + num5, 1, false, 0, false); + } + if (this.type == 217) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1115, 1, false, -1, false); + } + if (this.type == 218) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1116, 1, false, -1, false); + } + if (this.type == 219) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1117, 1, false, -1, false); + } + if (this.type == 220) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1118, 1, false, -1, false); + } + if (this.type == 221) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1119, 1, false, -1, false); + } + if (this.type == 167 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 879, 1, false, -1, false); + } + if (this.type == 143 || this.type == 144 || this.type == 145) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 593, Main.rand.Next(5, 11), false, 0, false); + } + if (this.type == 79) + { + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 527, 1, false, 0, false); + } + } + else + { + if (this.type == 80 && Main.rand.Next(10) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 528, 1, false, 0, false); + } + } + if (this.type == 49 && Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 18, 1, false, -1, false); + } + if (this.type == 21 || this.type == 201 || this.type == 202 || this.type == 203) + { + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 954, 1, false, -1, false); + } + else + { + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 955, 1, false, -1, false); + } + else + { + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1166, 1, false, -1, false); + } + else + { + if (Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1274, 1, false, -1, false); + } + } + } + } + } + else + { + if (this.type == 6) + { + if (Main.rand.Next(150) == 0) + { + int num6 = Main.rand.Next(3); + if (num6 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 956, 1, false, -1, false); + } + if (num6 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 957, 1, false, -1, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 958, 1, false, -1, false); + } + } + } + else + { + if (this.type == 42 || this.type == 43 || (this.type >= 231 && this.type <= 235)) + { + if (Main.rand.Next(100) == 0) + { + int num7 = Main.rand.Next(3); + if (num7 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 960, 1, false, -1, false); + } + if (num7 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 961, 1, false, -1, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 962, 1, false, -1, false); + } + } + } + else + { + if (this.type == 31 || this.type == 32 || this.type == 294 || this.type == 295 || this.type == 296) + { + if (Main.rand.Next(450) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 959, 1, false, -1, false); + } + if (Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1307, 1, false, -1, false); + } + } + } + } + } + if ((this.type == 174 || this.type == 179 || this.type == 182 || this.type == 183) && Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 996, 1, false, 0, false); + } + if (this.type == 101 || this.type == 98) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 522, Main.rand.Next(2, 6), false, 0, false); + } + if (this.type == 86) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 526, 1, false, 0, false); + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 856, 1, false, 0, false); + } + } + if (this.type == 113) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 367, 1, false, -1, false); + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.rand.Next(489, 492), 1, false, -1, false); + } + else + { + int num8 = Main.rand.Next(3); + if (num8 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 514, 1, false, -1, false); + } + else + { + if (num8 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 426, 1, false, -1, false); + } + else + { + if (num8 == 2) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 434, 1, false, -1, false); + } + } + } + } + if (Main.netMode != 1) + { + int num9 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num10 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + int num11 = this.width / 2 / 16 + 1; + for (int i = num9 - num11; i <= num9 + num11; i++) + { + for (int j = num10 - num11; j <= num10 + num11; j++) + { + if ((i == num9 - num11 || i == num9 + num11 || j == num10 - num11 || j == num10 + num11) && !Main.tile[i, j].active()) + { + Main.tile[i, j].type = 140; + Main.tile[i, j].active(true); + } + Main.tile[i, j].lava(false); + Main.tile[i, j].liquid = 0; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, j, 1); + } + else + { + WorldGen.SquareTileFrame(i, j, true); + } + } + } + } + } + if (this.type == 186) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, Main.rand.Next(1, 10), false, 0, false); + } + if (this.type == 225) + { + if (Main.rand.Next(45) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1243, 1, false, 0, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(2, 6), false, 0, false); + } + } + if (this.type == 1 || this.type == 16 || this.type == 138 || this.type == 141 || this.type == 147 || this.type == 184 || this.type == 187 || this.type == 204) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(1, 3), false, 0, false); + if (Main.rand.Next(10000) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1309, 1, false, -1, false); + } + } + if (this.type == 75) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 501, Main.rand.Next(1, 4), false, 0, false); + } + if (this.type == 81) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(2, 5), false, 0, false); + } + if (this.type == 122) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 23, Main.rand.Next(5, 11), false, 0, false); + } + if (this.type == 71) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 327, 1, false, 0, false); + } + if (this.type == 2) + { + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 38, 1, false, 0, false); + } + else + { + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 236, 1, false, 0, false); + } + } + } + if (this.type == 104 && Main.rand.Next(60) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 485, 1, false, -1, false); + } + if (this.type == 58) + { + if (Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 263, 1, false, 0, false); + } + else + { + if (Main.rand.Next(40) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 118, 1, false, 0, false); + } + } + } + if (this.type == 102 && Main.rand.Next(500) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 263, 1, false, 0, false); + } + if (this.type == 3 || this.type == 132 || this.type == 161 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223) + { + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 216, 1, false, -1, false); + } + if (Main.rand.Next(250) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1304, 1, false, -1, false); + } + } + if (this.type == 223 && Main.rand.Next(10) == 0) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1135, 1, false, -1, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1136, 1, false, -1, false); + } + } + if (this.type == 66) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 267, 1, false, 0, false); + } + if (this.type == 62 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 272, 1, false, -1, false); + } + if (this.value > 0f && Main.hardMode && (double)(this.position.Y / 16f) < Main.worldSurface + 10.0 && (this.center().X / 16f < 380f || this.center().X / 16f > (float)(Main.maxTilesX - 380)) && Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1315, 1, false, 0, false); + } + if (this.type == 52) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 251, 1, false, 0, false); + } + if (this.type == 53) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 239, 1, false, 0, false); + } + if (this.type == 54) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 260, 1, false, 0, false); + } + if (this.type == 55 || this.type == 230) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 261, 1, false, 0, false); + } + if (this.type == 69 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 323, 1, false, 0, false); + } + if (this.type == 73) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 362, Main.rand.Next(1, 3), false, 0, false); + } + if (this.type == 4) + { + if (Main.rand.Next(150) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1299, 1, false, 0, false); + } + if (WorldGen.crimson) + { + int stack = Main.rand.Next(20) + 10; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 880, stack, false, 0, false); + stack = Main.rand.Next(20) + 10; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 880, stack, false, 0, false); + stack = Main.rand.Next(20) + 10; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 880, stack, false, 0, false); + } + else + { + int stack2 = Main.rand.Next(30) + 20; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 47, stack2, false, 0, false); + stack2 = Main.rand.Next(20) + 10; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 56, stack2, false, 0, false); + stack2 = Main.rand.Next(20) + 10; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 56, stack2, false, 0, false); + stack2 = Main.rand.Next(20) + 10; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 56, stack2, false, 0, false); + stack2 = Main.rand.Next(3) + 1; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 59, stack2, false, 0, false); + } + } + if ((this.type == 6 || this.type == 94) && Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 68, 1, false, 0, false); + } + if ((this.type == 181 || this.type == 173 || this.type == 239 || this.type == 240) && Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1330, 1, false, 0, false); + } + if (this.type == 7 || this.type == 8 || this.type == 9) + { + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 68, Main.rand.Next(1, 3), false, 0, false); + } + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 69, Main.rand.Next(3, 9), false, 0, false); + } + if ((this.type == 10 || this.type == 11 || this.type == 12 || this.type == 95 || this.type == 96 || this.type == 97) && Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 215, 1, false, 0, false); + } + if (this.type == 47 && Main.rand.Next(75) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 243, 1, false, 0, false); + } + if (this.type == 222) + { + NPC.downedQueenBee = true; + int num12 = Main.rand.Next(3); + if (num12 == 0) + { + num12 = 1121; + } + else + { + if (num12 == 1) + { + num12 = 1123; + } + else + { + if (num12 == 2) + { + num12 = 1132; + } + } + } + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num12, 1, false, 0, false); + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1170, 1, false, 0, false); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1129, 1, false, 0, false); + } + else + { + if (Main.rand.Next(2) == 0) + { + num12 = Main.rand.Next(842, 845); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num12, 1, false, 0, false); + } + } + if (Main.rand.Next(4) != 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1130, Main.rand.Next(10, 30), false, 0, false); + } + } + if (this.type == 266) + { + int stack3 = Main.rand.Next(15, 41); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 880, stack3, false, 0, false); + stack3 = Main.rand.Next(15, 41); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 880, stack3, false, 0, false); + } + if (this.type == 267 && NPC.AnyNPCs(266)) + { + int stack4 = Main.rand.Next(2, 6); + if (Main.rand.Next(3) != 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1329, stack4, false, 0, false); + } + if (Main.rand.Next(3) != 0) + { + stack4 = Main.rand.Next(4, 11); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 880, stack4, false, 0, false); + } + if (Main.rand.Next(2) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statLife < Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statLifeMax) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 58, 1, false, 0, false); + } + } + if (this.type == 13 || this.type == 14 || this.type == 15) + { + int stack5 = Main.rand.Next(1, 3); + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 86, stack5, false, 0, false); + } + if (Main.rand.Next(2) == 0) + { + stack5 = Main.rand.Next(2, 6); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 56, stack5, false, 0, false); + } + if (this.boss) + { + stack5 = Main.rand.Next(10, 30); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 56, stack5, false, 0, false); + stack5 = Main.rand.Next(10, 31); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 56, stack5, false, 0, false); + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 995, 1, false, 0, false); + } + } + if (Main.rand.Next(4) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statLife < Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statLifeMax) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 58, 1, false, 0, false); + } + } + if (this.type == 116 || this.type == 117 || this.type == 118 || this.type == 119 || this.type == 139) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 58, 1, false, 0, false); + } + if (this.type == 63 || this.type == 64 || this.type == 103) + { + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1303, 1, false, -1, false); + } + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 282, Main.rand.Next(1, 5), false, 0, false); + } + if (this.type == 21 || this.type == 44 || this.type == 167 || this.type == 201 || this.type == 202 || this.type == 203) + { + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 118, 1, false, 0, false); + } + else + { + if (this.type == 44) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.rand.Next(410, 412), 1, false, 0, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 166, Main.rand.Next(1, 4), false, 0, false); + } + } + } + } + if (this.type == 45) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 238, 1, false, 0, false); + } + if (this.type == 50) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.rand.Next(256, 259), 1, false, 0, false); + } + if (this.type == 23 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 116, 1, false, 0, false); + } + if (this.type == 24 && Main.rand.Next(300) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 244, 1, false, 0, false); + } + if (this.type == 31 || this.type == 32 || this.type == 34) + { + if (Main.rand.Next(250) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 932, 1, false, 0, false); + } + else + { + if (Main.rand.Next(65) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 327, 1, false, 0, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 154, Main.rand.Next(1, 4), false, 0, false); + } + } + } + if (this.type == 26 || this.type == 27 || this.type == 28 || this.type == 29 || this.type == 111) + { + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 160, 1, false, 0, false); + } + else + { + if (Main.rand.Next(2) == 0) + { + int stack6 = Main.rand.Next(1, 6); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 161, stack6, false, 0, false); + } + } + } + if (this.type == 175 && Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1265, 1, false, -1, false); + } + if ((this.type == 42 || (this.type >= 231 && this.type <= 235)) && Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 209, 1, false, 0, false); + } + if (this.type == 204 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 209, 1, false, 0, false); + } + if (this.type == 43 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 210, 1, false, 0, false); + } + if (this.type == 65) + { + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 268, 1, false, 0, false); + } + else + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 319, 1, false, 0, false); + } + } + if (this.type == 48 && Main.rand.Next(2) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 320, 1, false, 0, false); + } + if (this.type == 125 || this.type == 126) + { + int num13 = 125; + if (this.type == 125) + { + num13 = 126; + } + if (!NPC.AnyNPCs(num13)) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 549, Main.rand.Next(25, 41), false, 0, false); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1225, Main.rand.Next(20, 36), false, 0, false); + } + else + { + this.value = 0f; + this.boss = false; + } + } + else + { + if (this.type == 127) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 547, Main.rand.Next(25, 41), false, 0, false); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1225, Main.rand.Next(20, 36), false, 0, false); + } + else + { + if (this.type == 134) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 548, Main.rand.Next(25, 41), false, 0, false); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1225, Main.rand.Next(20, 36), false, 0, false); + } + } + } + if (this.type == 262) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1141, 1, false, -1, false); + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1182, 1, false, -1, false); + } + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1305, 1, false, -1, false); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1157, 1, false, -1, false); + } + int num14 = Main.rand.Next(6); + if (!NPC.downedPlantBoss) + { + num14 = 0; + } + if (num14 == 0) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 758, 1, false, -1, false); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 771, Main.rand.Next(20, 50), false, 0, false); + } + else + { + if (num14 == 1) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1255, 1, false, -1, false); + } + else + { + if (num14 == 2) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 788, 1, false, -1, false); + } + else + { + if (num14 == 3) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1178, 1, false, -1, false); + } + else + { + if (num14 == 4) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1259, 1, false, -1, false); + } + else + { + if (num14 == 5) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1155, 1, false, -1, false); + } + } + } + } + } + } + NPC.downedPlantBoss = true; + } + if ((this.boss || this.type == 125 || this.type == 126) && Main.rand.Next(10) == 0) + { + if (this.type == 4) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1360, 1, false, 0, false); + } + if (this.type == 13 || this.type == 14 || this.type == 15) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1361, 1, false, 0, false); + } + if (this.type == 266) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1362, 1, false, 0, false); + } + if (this.type == 35) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1363, 1, false, 0, false); + } + if (this.type == 222) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1364, 1, false, 0, false); + } + if (this.type == 113) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1365, 1, false, 0, false); + } + if (this.type == 134) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1366, 1, false, 0, false); + } + if (this.type == 127) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1367, 1, false, 0, false); + } + if (this.type == 125) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1368, 1, false, 0, false); + } + if (this.type == 126) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1369, 1, false, 0, false); + } + if (this.type == 262) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1370, 1, false, 0, false); + } + if (this.type == 245) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1371, 1, false, 0, false); + } + } + if (this.boss) + { + if (this.type == 4) + { + NPC.downedBoss1 = true; + } + else + { + if (this.type == 13 || this.type == 14 || this.type == 15) + { + NPC.downedBoss2 = true; + this.name = "Eater of Worlds"; + } + else + { + if (this.type == 35) + { + NPC.downedBoss3 = true; + this.name = "Skeletron"; + } + else + { + this.name = this.displayName; + } + } + } + if (this.type == 127) + { + NPC.downedMechBoss3 = true; + NPC.downedMechBossAny = true; + } + if (this.type == 134) + { + NPC.downedMechBoss1 = true; + NPC.downedMechBossAny = true; + } + string str = this.name; + if (this.displayName != "") + { + str = this.displayName; + } + int stack7 = Main.rand.Next(5, 16); + int num15 = 28; + if (this.type == 113) + { + num15 = 188; + } + else + { + if (this.type == 222) + { + num15 = 1134; + } + else + { + if (this.type > 113 && this.type < 222) + { + num15 = 499; + } + else + { + if (this.type == 245 || this.type == 262) + { + num15 = 499; + } + } + } + } + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num15, stack7, false, 0, false); + int num16 = Main.rand.Next(5) + 5; + for (int k = 0; k < num16; k++) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 58, 1, false, 0, false); + } + if (this.type == 125 || this.type == 126) + { + NPC.downedMechBoss2 = true; + NPC.downedMechBossAny = true; + if (Main.netMode == 0) + { + Main.NewText("The Twins " + Lang.misc[17], 175, 75, 255, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, "The Twins " + Lang.misc[17], 255, 175f, 75f, 255f, 0); + } + } + } + else + { + if (Main.netMode == 0) + { + Main.NewText(str + " " + Lang.misc[17], 175, 75, 255, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, str + " " + Lang.misc[17], 255, 175f, 75f, 255f, 0); + } + } + } + if (this.type == 113 && Main.netMode != 1) + { + WorldGen.StartHardmode(); + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + } + if (Main.rand.Next(6) == 0 && this.lifeMax > 1 && this.damage > 0) + { + if (Main.rand.Next(2) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statMana < Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statManaMax) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 184, 1, false, 0, false); + } + else + { + if (Main.rand.Next(2) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statLife < Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statLifeMax) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 58, 1, false, 0, false); + } + } + } + if (Main.rand.Next(2) == 0 && this.lifeMax > 1 && this.damage > 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statMana < Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].statManaMax) + { + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 184, 1, false, 0, false); + } + float num17 = this.value; + if (this.midas) + { + num17 *= 1f + (float)Main.rand.Next(10, 50) * 0.01f; + } + num17 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + if (Main.rand.Next(5) == 0) + { + num17 *= 1f + (float)Main.rand.Next(5, 11) * 0.01f; + } + if (Main.rand.Next(10) == 0) + { + num17 *= 1f + (float)Main.rand.Next(10, 21) * 0.01f; + } + if (Main.rand.Next(15) == 0) + { + num17 *= 1f + (float)Main.rand.Next(15, 31) * 0.01f; + } + if (Main.rand.Next(20) == 0) + { + num17 *= 1f + (float)Main.rand.Next(20, 41) * 0.01f; + } + while ((int)num17 > 0) + { + if (num17 > 1000000f) + { + int num18 = (int)(num17 / 1000000f); + if (num18 > 50 && Main.rand.Next(5) == 0) + { + num18 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(5) == 0) + { + num18 /= Main.rand.Next(3) + 1; + } + num17 -= (float)(1000000 * num18); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 74, num18, false, 0, false); + } + else + { + if (num17 > 10000f) + { + int num19 = (int)(num17 / 10000f); + if (num19 > 50 && Main.rand.Next(5) == 0) + { + num19 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(5) == 0) + { + num19 /= Main.rand.Next(3) + 1; + } + num17 -= (float)(10000 * num19); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 73, num19, false, 0, false); + } + else + { + if (num17 > 100f) + { + int num20 = (int)(num17 / 100f); + if (num20 > 50 && Main.rand.Next(5) == 0) + { + num20 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(5) == 0) + { + num20 /= Main.rand.Next(3) + 1; + } + num17 -= (float)(100 * num20); + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 72, num20, false, 0, false); + } + else + { + int num21 = (int)num17; + if (num21 > 50 && Main.rand.Next(5) == 0) + { + num21 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(5) == 0) + { + num21 /= Main.rand.Next(4) + 1; + } + if (num21 < 1) + { + num21 = 1; + } + num17 -= (float)num21; + Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 71, num21, false, 0, false); + } + } + } + } + } + public void HitEffect(int hitDirection = 0, double dmg = 10.0) + { + if (!this.active) + { + return; + } + if (this.type == 1 || this.type == 16 || this.type == 71 || this.type == 244) + { + if (this.life > 0) + { + int num = 0; + while ((double)num < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, this.alpha, this.color, 1f); + num++; + } + } + else + { + for (int i = 0; i < 50; i++) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)(2 * hitDirection), -2f, this.alpha, this.color, 1f); + } + if (Main.netMode != 1 && this.type == 16) + { + int num2 = Main.rand.Next(2) + 2; + for (int j = 0; j < num2; j++) + { + int num3 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), 1, 0); + Main.npc[num3].SetDefaults("Baby Slime"); + Main.npc[num3].velocity.X = this.velocity.X * 2f; + Main.npc[num3].velocity.Y = this.velocity.Y; + NPC expr_193_cp_0 = Main.npc[num3]; + expr_193_cp_0.velocity.X = expr_193_cp_0.velocity.X + ((float)Main.rand.Next(-20, 20) * 0.1f + (float)(j * this.direction) * 0.3f); + NPC expr_1D1_cp_0 = Main.npc[num3]; + expr_1D1_cp_0.velocity.Y = expr_1D1_cp_0.velocity.Y - ((float)Main.rand.Next(0, 10) * 0.1f + (float)j); + Main.npc[num3].ai[1] = (float)j; + if (Main.netMode == 2 && num3 < 200) + { + NetMessage.SendData(23, -1, -1, "", num3, 0f, 0f, 0f, 0); + } + } + } + } + } + if (this.type >= 245 && this.type <= 249) + { + if (this.life > 0) + { + int num4 = 0; + while ((double)num4 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 148, (float)hitDirection, -1f, 0, default(Color), 1f); + num4++; + } + } + else + { + if (this.type == 246) + { + if (Main.netMode != 1) + { + NPC.NewNPC((int)this.center().X, (int)this.position.Y + this.height, 249, this.whoAmI); + } + } + else + { + for (int k = 0; k < 50; k++) + { + Dust.NewDust(this.position, this.width, this.height, 148, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + if (this.type == 245) + { + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 368, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 370, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 368, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 370, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 368, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 370, this.scale); + Gore.NewGore(this.position, this.velocity, 360, this.scale); + Gore.NewGore(this.position, this.velocity, 361, this.scale); + Gore.NewGore(this.position, this.velocity, 362, this.scale); + Gore.NewGore(this.position, this.velocity, 363, this.scale); + Gore.NewGore(this.position, this.velocity, 364, this.scale); + Gore.NewGore(this.position, this.velocity, 367, this.scale); + Gore.NewGore(this.position, this.velocity, 366, this.scale); + } + else + { + if (this.type == 249) + { + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 368, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 370, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 368, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 370, this.scale); + Gore.NewGore(this.position, this.velocity, 365, this.scale); + Gore.NewGore(this.position, this.velocity, 363, this.scale); + Gore.NewGore(this.position, this.velocity, 362, this.scale); + } + else + { + Gore.NewGore(this.position, this.velocity, 369, this.scale); + Gore.NewGore(this.position, this.velocity, 371, this.scale); + Gore.NewGore(this.position, this.velocity, 370, this.scale); + } + } + } + } + } + if (this.type == 288 && this.life <= 0) + { + for (int l = 0; l < 50; l++) + { + int num5 = Dust.NewDust(this.position, this.width, this.height, 180, this.velocity.X, this.velocity.Y, 0, default(Color), 1f); + Main.dust[num5].velocity *= 2f; + Main.dust[num5].noGravity = true; + Main.dust[num5].scale = 1.4f; + } + } + if (this.type == 204) + { + if (this.life > 0) + { + int num6 = 0; + while ((double)num6 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, 100, new Color(149, 208, 104), 1f); + num6++; + } + } + else + { + for (int m = 0; m < 50; m++) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)(2 * hitDirection), -2f, 100, new Color(149, 208, 104), 1f); + } + } + } + if (this.type == 225) + { + if (this.life > 0) + { + int num7 = 0; + while ((double)num7 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, 100, new Color(0, 80, 255, 100), 1f); + num7++; + } + } + else + { + for (int n = 0; n < 50; n++) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)(2 * hitDirection), -2f, 100, new Color(0, 80, 255, 100), 1f); + } + Gore.NewGore(this.position, this.velocity, 314, this.scale); + } + } + if (this.type == 243) + { + if (this.life > 0) + { + int num8 = 0; + while ((double)num8 < dmg / (double)this.lifeMax * 150.0) + { + Dust.NewDust(this.position, this.width, this.height, 161, (float)hitDirection, -1f, 0, default(Color), 1f); + num8++; + } + } + else + { + for (int num9 = 0; num9 < 200; num9++) + { + Dust.NewDust(this.position, this.width, this.height, 161, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 359, this.scale); + } + } + if ((this.type == 210 || this.type == 211) && this.life <= 0) + { + for (int num10 = 0; num10 < 6; num10++) + { + int num11 = Dust.NewDust(this.position, this.width, this.height, 150, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num11].noGravity = true; + Main.dust[num11].scale = 1.5f; + } + else + { + Main.dust[num11].scale = 0.8f; + } + } + } + if (this.type == 154) + { + if (this.life > 0) + { + int num12 = 0; + while ((double)num12 < dmg / (double)this.lifeMax * 50.0) + { + int num13 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 90, default(Color), 1.5f); + Main.dust[num13].noGravity = true; + Main.dust[num13].velocity *= 0.2f; + num12++; + } + } + else + { + for (int num14 = 0; num14 < 50; num14++) + { + int num15 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 90, default(Color), 1.5f); + Main.dust[num15].noGravity = true; + Main.dust[num15].velocity *= 0.2f; + } + Gore.NewGore(this.position, this.velocity, 180, this.scale); + } + } + if (this.type == 147 || this.type == 184) + { + if (this.life > 0) + { + int num16 = 0; + while ((double)num16 < dmg / (double)this.lifeMax * 50.0) + { + int num17 = Dust.NewDust(this.position, this.width, this.height, 76, (float)hitDirection, -1f, 0, default(Color), 1f); + Main.dust[num17].noGravity = true; + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, 100, new Color(97, 200, 255, 100), 1f); + num16++; + } + } + else + { + for (int num18 = 0; num18 < 30; num18++) + { + int num19 = Dust.NewDust(this.position, this.width, this.height, 76, (float)hitDirection, -2f, 0, default(Color), 1f); + Main.dust[num19].noGravity = true; + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -2f, 100, new Color(97, 200, 255, 100), 1f); + } + } + } + if (this.type == 143 || this.type == 144 || this.type == 145) + { + if (this.life > 0) + { + int num20 = 0; + while ((double)num20 < dmg / (double)this.lifeMax * 100.0) + { + int num21 = Dust.NewDust(this.position, this.width, this.height, 76, (float)hitDirection, -1f, 0, default(Color), 1f); + Main.dust[num21].noGravity = true; + num20++; + } + } + else + { + for (int num22 = 0; num22 < 50; num22++) + { + int num23 = Dust.NewDust(this.position, this.width, this.height, 76, (float)hitDirection, -1f, 0, default(Color), 1f); + Main.dust[num23].noGravity = true; + Main.dust[num23].scale *= 1.2f; + } + } + } + if (this.type == 141) + { + if (this.life > 0) + { + int num24 = 0; + while ((double)num24 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, this.alpha, new Color(210, 230, 140), 1f); + num24++; + } + } + else + { + for (int num25 = 0; num25 < 50; num25++) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)(2 * hitDirection), -2f, this.alpha, new Color(210, 230, 140), 1f); + } + } + } + if (this.type == 112) + { + for (int num26 = 0; num26 < 20; num26++) + { + int num27 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 2f), this.width, this.height, 18, 0f, 0f, 100, default(Color), 2f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num27].scale *= 0.6f; + } + else + { + Main.dust[num27].velocity *= 1.4f; + Main.dust[num27].noGravity = true; + } + } + } + if (this.type == 183) + { + if (this.life > 0) + { + int num28 = 0; + while ((double)num28 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 136, 0f, 0f, this.alpha, this.color, 1f); + num28++; + } + } + else + { + for (int num29 = 0; num29 < 50; num29++) + { + int num30 = Dust.NewDust(this.position, this.width, this.height, 136, (float)hitDirection, 0f, this.alpha, this.color, 1f); + Main.dust[num30].velocity *= 2f; + } + } + } + if (this.type == 81 || this.type == 121) + { + if (this.life > 0) + { + int num31 = 0; + while ((double)num31 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, this.alpha, this.color, 1f); + num31++; + } + } + else + { + for (int num32 = 0; num32 < 50; num32++) + { + int num33 = Dust.NewDust(this.position, this.width, this.height, 14, (float)hitDirection, 0f, this.alpha, this.color, 1f); + Main.dust[num33].velocity *= 2f; + } + if (Main.netMode != 1) + { + if (this.type == 121) + { + int num34 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), 81, 0); + Main.npc[num34].SetDefaults("Slimer2"); + Main.npc[num34].velocity.X = this.velocity.X; + Main.npc[num34].velocity.Y = this.velocity.Y; + Gore.NewGore(this.position, this.velocity, 94, this.scale); + if (Main.netMode == 2 && num34 < 200) + { + NetMessage.SendData(23, -1, -1, "", num34, 0f, 0f, 0f, 0); + } + } + else + { + if (this.scale >= 1f) + { + int num35 = Main.rand.Next(2) + 2; + for (int num36 = 0; num36 < num35; num36++) + { + int num37 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), 1, 0); + Main.npc[num37].SetDefaults("Slimeling"); + Main.npc[num37].velocity.X = this.velocity.X * 3f; + Main.npc[num37].velocity.Y = this.velocity.Y; + NPC expr_1545_cp_0 = Main.npc[num37]; + expr_1545_cp_0.velocity.X = expr_1545_cp_0.velocity.X + ((float)Main.rand.Next(-10, 10) * 0.1f + (float)(num36 * this.direction) * 0.3f); + NPC expr_1584_cp_0 = Main.npc[num37]; + expr_1584_cp_0.velocity.Y = expr_1584_cp_0.velocity.Y - ((float)Main.rand.Next(0, 10) * 0.1f + (float)num36); + Main.npc[num37].ai[1] = (float)num36; + if (Main.netMode == 2 && num37 < 200) + { + NetMessage.SendData(23, -1, -1, "", num37, 0f, 0f, 0f, 0); + } + } + } + } + } + } + } + if (this.type == 120 || this.type == 137 || this.type == 138) + { + if (this.life > 0) + { + int num38 = 0; + while ((double)num38 < dmg / (double)this.lifeMax * 50.0) + { + int num39 = Dust.NewDust(this.position, this.width, this.height, 71, 0f, 0f, 200, default(Color), 1f); + Main.dust[num39].velocity *= 1.5f; + num38++; + } + } + else + { + for (int num40 = 0; num40 < 50; num40++) + { + int num41 = Dust.NewDust(this.position, this.width, this.height, 71, (float)hitDirection, 0f, 200, default(Color), 1f); + Main.dust[num41].velocity *= 1.5f; + } + } + } + if (this.type == 122) + { + if (this.life > 0) + { + int num42 = 0; + while ((double)num42 < dmg / (double)this.lifeMax * 50.0) + { + int num43 = Dust.NewDust(this.position, this.width, this.height, 72, 0f, 0f, 200, default(Color), 1f); + Main.dust[num43].velocity *= 1.5f; + num42++; + } + } + else + { + for (int num44 = 0; num44 < 50; num44++) + { + int num45 = Dust.NewDust(this.position, this.width, this.height, 72, (float)hitDirection, 0f, 200, default(Color), 1f); + Main.dust[num45].velocity *= 1.5f; + } + } + } + if (this.type == 75) + { + if (this.life > 0) + { + int num46 = 0; + while ((double)num46 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 55, 0f, 0f, 200, this.color, 1f); + num46++; + } + } + else + { + for (int num47 = 0; num47 < 50; num47++) + { + int num48 = Dust.NewDust(this.position, this.width, this.height, 55, (float)hitDirection, 0f, 200, this.color, 1f); + Main.dust[num48].velocity *= 2f; + } + } + } + if (this.type == 63 || this.type == 64 || this.type == 103) + { + Color newColor = new Color(50, 120, 255, 100); + if (this.type == 64) + { + newColor = new Color(225, 70, 140, 100); + } + if (this.type == 103) + { + newColor = new Color(70, 225, 140, 100); + } + if (this.life > 0) + { + int num49 = 0; + while ((double)num49 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, 0, newColor, 1f); + num49++; + } + return; + } + for (int num50 = 0; num50 < 25; num50++) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)(2 * hitDirection), -2f, 0, newColor, 1f); + } + return; + } + else + { + if (this.type != 59 && this.type != 60 && this.type != 151) + { + if (this.type == 50) + { + if (this.life > 0) + { + int num51 = 0; + while ((double)num51 < dmg / (double)this.lifeMax * 300.0) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)hitDirection, -1f, 175, new Color(0, 80, 255, 100), 1f); + num51++; + } + return; + } + for (int num52 = 0; num52 < 200; num52++) + { + Dust.NewDust(this.position, this.width, this.height, 4, (float)(2 * hitDirection), -2f, 175, new Color(0, 80, 255, 100), 1f); + } + if (Main.netMode != 1) + { + int num53 = Main.rand.Next(4) + 4; + for (int num54 = 0; num54 < num53; num54++) + { + int x = (int)(this.position.X + (float)Main.rand.Next(this.width - 32)); + int y = (int)(this.position.Y + (float)Main.rand.Next(this.height - 32)); + int num55 = NPC.NewNPC(x, y, 1, 0); + Main.npc[num55].SetDefaults(1, -1f); + Main.npc[num55].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; + Main.npc[num55].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; + Main.npc[num55].ai[1] = (float)Main.rand.Next(3); + if (Main.netMode == 2 && num55 < 200) + { + NetMessage.SendData(23, -1, -1, "", num55, 0f, 0f, 0f, 0); + } + } + return; + } + } + else + { + if (this.type == 153) + { + if (this.life > 0) + { + int num56 = 0; + while ((double)num56 < dmg / (double)this.lifeMax * 30.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num56++; + } + return; + } + for (int num57 = 0; num57 < 15; num57++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 177, 1f); + Gore.NewGore(this.position, this.velocity, 178, 1f); + Gore.NewGore(this.position, this.velocity, 179, 1f); + Gore.NewGore(this.position, this.velocity, 179, 1f); + return; + } + else + { + if (this.type == 177) + { + if (this.life > 0) + { + int num58 = 0; + while ((double)num58 < dmg / (double)this.lifeMax * 30.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num58++; + } + return; + } + for (int num59 = 0; num59 < 15; num59++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 234, 1f); + Gore.NewGore(this.position, this.velocity, 235, 1f); + Gore.NewGore(this.position, this.velocity, 236, 1f); + Gore.NewGore(this.position, this.velocity, 236, 1f); + return; + } + else + { + if (this.type == 49 || this.type == 51 || this.type == 93 || this.type == 150 || this.type == 152 || this.type == 226) + { + if (this.life > 0) + { + int num60 = 0; + while ((double)num60 < dmg / (double)this.lifeMax * 30.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num60++; + } + return; + } + for (int num61 = 0; num61 < 15; num61++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + if (this.type == 51) + { + Gore.NewGore(this.position, this.velocity, 83, 1f); + return; + } + if (this.type == 93) + { + Gore.NewGore(this.position, this.velocity, 107, 1f); + return; + } + if (this.type == 150) + { + Gore.NewGore(this.position, this.velocity, 164, 1f); + Gore.NewGore(this.position, this.velocity, 165, 1f); + return; + } + if (this.type == 152) + { + Gore.NewGore(this.position, this.velocity, 175, 1f); + Gore.NewGore(this.position, this.velocity, 176, 1f); + Gore.NewGore(this.position, this.velocity, 176, 1f); + return; + } + if (this.type == 226) + { + Gore.NewGore(this.position, this.velocity, 317, 1f); + Gore.NewGore(this.position, this.velocity, 318, 1f); + Gore.NewGore(this.position, this.velocity, 318, 1f); + Gore.NewGore(this.position, this.velocity, 319, 1f); + return; + } + Gore.NewGore(this.position, this.velocity, 82, 1f); + return; + } + else + { + if (this.type == 46 || this.type == 55 || this.type == 67 || this.type == 74 || this.type == 102 || this.type == 224 || this.type == 230 || this.type == 297 || this.type == 298 || this.type == 299 || this.type == 300) + { + if (this.life > 0) + { + int num62 = 0; + while ((double)num62 < dmg / (double)this.lifeMax * 20.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num62++; + } + return; + } + for (int num63 = 0; num63 < 10; num63++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + if (this.type == 46) + { + Gore.NewGore(this.position, this.velocity, 76, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 77, 1f); + return; + } + if (this.type == 67) + { + Gore.NewGore(this.position, this.velocity, 95, 1f); + Gore.NewGore(this.position, this.velocity, 95, 1f); + Gore.NewGore(this.position, this.velocity, 96, 1f); + return; + } + if (this.type == 74) + { + Gore.NewGore(this.position, this.velocity, 100, 1f); + return; + } + if (this.type == 297) + { + Gore.NewGore(this.position, this.velocity, 431, 1f); + return; + } + if (this.type == 298) + { + Gore.NewGore(this.position, this.velocity, 432, 1f); + return; + } + if (this.type == 299) + { + Gore.NewGore(this.position, this.velocity, 433, 1f); + return; + } + if (this.type == 300) + { + Gore.NewGore(this.position, this.velocity, 434, 1f); + return; + } + if (this.type == 102) + { + Gore.NewGore(this.position, this.velocity, 116, 1f); + return; + } + if (this.type == 224) + { + Gore.NewGore(this.position, this.velocity, 312, 1f); + Gore.NewGore(this.position, this.velocity, 313, 1f); + return; + } + } + else + { + if (this.type == 148 || this.type == 149 || this.type == 168) + { + if (this.life > 0) + { + int num64 = 0; + while ((double)num64 < dmg / (double)this.lifeMax * 20.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num64++; + } + return; + } + for (int num65 = 0; num65 < 10; num65++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + if (this.type == 148) + { + Gore.NewGore(this.position, this.velocity, 160, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 161, 1f); + return; + } + if (this.type == 149) + { + Gore.NewGore(this.position, this.velocity, 162, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 163, 1f); + return; + } + if (this.type == 168) + { + Gore.NewGore(this.position, this.velocity, 215, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 216, 1f); + return; + } + } + else + { + if (this.type == 47 || this.type == 57 || this.type == 58) + { + if (this.life > 0) + { + int num66 = 0; + while ((double)num66 < dmg / (double)this.lifeMax * 20.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num66++; + } + return; + } + for (int num67 = 0; num67 < 10; num67++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + if (this.type == 57) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 84, 1f); + return; + } + if (this.type == 58) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 85, 1f); + return; + } + Gore.NewGore(this.position, this.velocity, 78, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 79, 1f); + return; + } + else + { + if (this.type == 173 || this.type == 174 || this.type == 181 || this.type == 182 || this.type == 268) + { + if (this.life > 0) + { + int num68 = 0; + while ((double)num68 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, this.alpha, default(Color), 1f); + num68++; + } + return; + } + for (int num69 = 0; num69 < 50; num69++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, this.alpha, default(Color), 1f); + } + if (this.type == 173) + { + Gore.NewGore(this.position, this.velocity, 223, 1f); + Gore.NewGore(this.position, this.velocity, 224, 1f); + return; + } + if (this.type == 174) + { + Gore.NewGore(this.position, this.velocity, 225, 1f); + Gore.NewGore(this.position, this.velocity, 226, 1f); + return; + } + if (this.type == 181) + { + Gore.NewGore(this.position, this.velocity, 237, 1f); + return; + } + if (this.type == 182) + { + Gore.NewGore(this.position, this.velocity, 238, 1f); + Gore.NewGore(this.position, this.velocity, 239, 1f); + return; + } + if (this.type == 268) + { + Gore.NewGore(this.position, this.velocity, 403, 1f); + Gore.NewGore(this.position, this.velocity, 404, 1f); + Gore.NewGore(this.position, this.velocity, 405, 1f); + return; + } + } + else + { + if (this.type == 2 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194) + { + if (this.life > 0) + { + int num70 = 0; + while ((double)num70 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num70++; + } + return; + } + for (int num71 = 0; num71 < 50; num71++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + if (this.type == 190) + { + Gore.NewGore(this.position, this.velocity, 249, this.scale); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 2, this.scale); + return; + } + if (this.type == 191) + { + Gore.NewGore(this.position, this.velocity, 248, this.scale); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 2, this.scale); + return; + } + if (this.type == 192) + { + Gore.NewGore(this.position, this.velocity, 247, this.scale); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 2, this.scale); + return; + } + if (this.type == 193) + { + Gore.NewGore(this.position, this.velocity, 252, this.scale); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 253, this.scale); + return; + } + if (this.type == 194) + { + Gore.NewGore(this.position, this.velocity, 250, this.scale); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 251, this.scale); + return; + } + Gore.NewGore(this.position, this.velocity, 1, this.scale); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 2, this.scale); + return; + } + else + { + if (this.type == 157) + { + if (this.life > 0) + { + int num72 = 0; + while ((double)num72 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num72++; + } + return; + } + for (int num73 = 0; num73 < 50; num73++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 186, 1f); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 187, 1f); + return; + } + else + { + if (this.type == 133) + { + if (this.life <= 0) + { + for (int num74 = 0; num74 < 50; num74++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 155, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 14f), this.velocity, 155, 1f); + return; + } + int num75 = 0; + while ((double)num75 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num75++; + } + if ((float)this.life < (float)this.lifeMax * 0.5f && this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + Gore.NewGore(this.position, this.velocity, 1, 1f); + return; + } + } + else + { + if (this.type == 69) + { + if (this.life > 0) + { + int num76 = 0; + while ((double)num76 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num76++; + } + return; + } + for (int num77 = 0; num77 < 50; num77++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 97, 1f); + Gore.NewGore(this.position, this.velocity, 98, 1f); + return; + } + else + { + if (this.type == 61) + { + if (this.life > 0) + { + int num78 = 0; + while ((double)num78 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num78++; + } + return; + } + for (int num79 = 0; num79 < 50; num79++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 86, 1f); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 87, 1f); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity, 88, 1f); + return; + } + else + { + if (this.type == 252) + { + if (this.life > 0) + { + int num80 = 0; + while ((double)num80 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num80++; + } + return; + } + for (int num81 = 0; num81 < 50; num81++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 373, 1f); + Gore.NewGore(this.position, this.velocity, 374, 1f); + return; + } + else + { + if (this.type == 65) + { + if (this.life > 0) + { + int num82 = 0; + while ((double)num82 < dmg / (double)this.lifeMax * 150.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num82++; + } + return; + } + for (int num83 = 0; num83 < 75; num83++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity * 0.8f, 89, 1f); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity * 0.8f, 90, 1f); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity * 0.8f, 91, 1f); + Gore.NewGore(new Vector2(this.position.X + 14f, this.position.Y), this.velocity * 0.8f, 92, 1f); + return; + } + else + { + if (this.type == 195 || this.type == 196) + { + if (this.life > 0) + { + int num84 = 0; + while ((double)num84 < dmg / (double)this.lifeMax * 150.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num84++; + } + return; + } + for (int num85 = 0; num85 < 75; num85++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 254, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 255, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 255, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 256, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 256, this.scale); + return; + } + else + { + if (this.type == 198 || this.type == 199) + { + if (this.life > 0) + { + int num86 = 0; + while ((double)num86 < dmg / (double)this.lifeMax * 150.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num86++; + } + return; + } + for (int num87 = 0; num87 < 75; num87++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 258, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 259, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 259, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 260, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 260, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 261, this.scale); + return; + } + else + { + if (this.type == 206) + { + if (this.life > 0) + { + int num88 = 0; + while ((double)num88 < dmg / (double)this.lifeMax * 150.0) + { + Dust.NewDust(this.position, this.width, this.height, 137, (float)hitDirection, -1f, 0, default(Color), 1f); + num88++; + } + return; + } + for (int num89 = 0; num89 < 75; num89++) + { + Dust.NewDust(this.position, this.width, this.height, 137, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 273, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 274, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 274, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 275, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 275, this.scale); + return; + } + else + { + if (this.type == 3 || this.type == 52 || this.type == 53 || this.type == 104 || this.type == 109 || this.type == 132 || this.type == 161 || this.type == 162 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 251) + { + if (this.life > 0) + { + int num90 = 0; + while ((double)num90 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num90++; + } + if (this.type == 186 && Main.rand.Next(5) == 0) + { + Gore.NewGore(this.position, this.velocity, 242, 1f); + } + if (this.type == 187) + { + int num91 = 0; + while ((double)num91 < dmg / (double)this.lifeMax * 200.0) + { + Dust.NewDust(this.position, this.width, 24, 4, (float)hitDirection, -1f, 125, new Color(0, 80, 255, 100), 1f); + num91++; + } + return; + } + } + else + { + for (int num92 = 0; num92 < 50; num92++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + if (this.type == 187) + { + for (int num93 = 0; num93 < 25; num93++) + { + Dust.NewDust(this.position, this.width, 24, 4, (float)hitDirection, -1f, 125, new Color(0, 80, 255, 100), 1f); + } + } + if (this.type == 104) + { + Gore.NewGore(this.position, this.velocity, 117, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 118, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 118, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 119, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 119, this.scale); + return; + } + if (this.type == 109) + { + Gore.NewGore(this.position, this.velocity, 121, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 122, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 122, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 123, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 123, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 46f), this.velocity, 120, this.scale); + return; + } + if (this.type == 161) + { + Gore.NewGore(this.position, this.velocity, 191, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 192, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 192, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 193, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 193, this.scale); + return; + } + if (this.type == 162) + { + Gore.NewGore(this.position, this.velocity, 194, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 195, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 195, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 196, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 196, this.scale); + return; + } + if (this.type == 188) + { + Gore.NewGore(this.position, this.velocity, 243, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 244, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 244, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 245, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 245, this.scale); + return; + } + if (this.type == 200) + { + Gore.NewGore(this.position, this.velocity, 262, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 263, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 263, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 264, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 264, this.scale); + return; + } + if (this.type == 223) + { + Gore.NewGore(this.position, this.velocity, 309, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 310, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 310, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 311, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 311, this.scale); + return; + } + if (this.type == 132) + { + Gore.NewGore(this.position, this.velocity, 154, 1f); + } + else + { + if (this.type == 186) + { + Gore.NewGore(this.position, this.velocity, 241, 1f); + } + else + { + if (this.type == 189) + { + Gore.NewGore(this.position, this.velocity, 246, 1f); + } + else + { + if (this.type == 251) + { + Gore.NewGore(this.position, this.velocity, 372, 1f); + } + else + { + if (this.type != 187) + { + Gore.NewGore(this.position, this.velocity, 3, 1f); + } + } + } + } + } + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 4, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 4, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 5, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 5, 1f); + if (this.type == 186) + { + Gore.NewGore(this.position, this.velocity, 242, 1f); + } + if (this.type == 186 && Main.rand.Next(2) == 0) + { + Gore.NewGore(this.position, this.velocity, 242, 1f); + return; + } + } + } + else + { + if (this.type == 83 || this.type == 84 || this.type == 179) + { + if (this.life > 0) + { + int num94 = 0; + while ((double)num94 < dmg / (double)this.lifeMax * 50.0) + { + int num95 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num95].noGravity = true; + num94++; + } + return; + } + for (int num96 = 0; num96 < 20; num96++) + { + int num97 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num97].velocity *= 2f; + Main.dust[num97].noGravity = true; + } + int num98 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)Main.rand.Next(-2, 3), (float)Main.rand.Next(-2, 3)), 61, this.scale); + Main.gore[num98].velocity *= 0.5f; + num98 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)Main.rand.Next(-2, 3), (float)Main.rand.Next(-2, 3)), 61, this.scale); + Main.gore[num98].velocity *= 0.5f; + num98 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)Main.rand.Next(-2, 3), (float)Main.rand.Next(-2, 3)), 61, this.scale); + Main.gore[num98].velocity *= 0.5f; + return; + } + else + { + if (this.type == 262 || this.type == 263 || this.type == 264) + { + if (this.life > 0) + { + int num99 = 0; + while ((double)num99 < dmg / (double)this.lifeMax * 100.0) + { + if (this.type == 262 && this.life > this.lifeMax / 2 && Main.rand.Next(3) != 0) + { + Dust.NewDust(this.position, this.width, this.height, 166, (float)hitDirection, -1f, 0, default(Color), 1f); + } + else + { + if (this.type == 265 && Main.rand.Next(3) != 0) + { + Dust.NewDust(this.position, this.width, this.height, 166, (float)hitDirection, -1f, 0, default(Color), 1f); + } + else + { + Dust.NewDust(this.position, this.width, this.height, 167, (float)hitDirection, -1f, 0, default(Color), 1f); + } + } + num99++; + } + return; + } + for (int num100 = 0; num100 < 150; num100++) + { + if (this.type == 265 && Main.rand.Next(3) != 0) + { + Dust.NewDust(this.position, this.width, this.height, 166, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + else + { + Dust.NewDust(this.position, this.width, this.height, 167, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + } + if (this.type == 262) + { + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 381, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 382, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 383, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 384, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 385, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 386, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 386, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 387, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 387, this.scale); + } + if (this.type == 263) + { + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 390, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 391, this.scale); + } + if (this.type == 264) + { + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 388, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)Main.rand.Next(this.width), this.position.Y + (float)Main.rand.Next(this.height)), this.velocity, 389, this.scale); + return; + } + } + else + { + if (this.type == 265) + { + if (this.life < 0) + { + for (int num101 = 0; num101 < 15; num101++) + { + if (Main.rand.Next(3) != 0) + { + Dust.NewDust(this.position, this.width, this.height, 166, (float)hitDirection, -1f, 0, default(Color), 1f); + } + else + { + Dust.NewDust(this.position, this.width, this.height, 167, (float)hitDirection, -1f, 0, default(Color), 1f); + } + } + return; + } + } + else + { + if (this.type == 266) + { + if (this.life > 0) + { + int num102 = 0; + while ((double)num102 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num102++; + } + return; + } + for (int num103 = 0; num103 < 150; num103++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 396, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 397, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 398, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 399, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 400, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 401, 1f); + return; + } + else + { + if (this.type == 267) + { + if (this.life > 0) + { + int num104 = 0; + while ((double)num104 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num104++; + } + return; + } + for (int num105 = 0; num105 < 20; num105++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 402, 1f); + return; + } + else + { + if (this.type == 4 || this.type == 126 || this.type == 125) + { + if (this.life > 0) + { + int num106 = 0; + while ((double)num106 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num106++; + } + return; + } + for (int num107 = 0; num107 < 150; num107++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + for (int num108 = 0; num108 < 2; num108++) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 2, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, 1f); + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 9, 1f); + if (this.type == 4) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 10, 1f); + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + } + else + { + if (this.type == 125) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 146, 1f); + } + else + { + if (this.type == 126) + { + Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 145, 1f); + } + } + } + } + if (this.type == 125 || this.type == 126) + { + for (int num109 = 0; num109 < 10; num109++) + { + int num110 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num110].velocity *= 1.4f; + } + for (int num111 = 0; num111 < 5; num111++) + { + int num112 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num112].noGravity = true; + Main.dust[num112].velocity *= 5f; + num112 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num112].velocity *= 3f; + } + int num113 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num113].velocity *= 0.4f; + Gore expr_575D_cp_0 = Main.gore[num113]; + expr_575D_cp_0.velocity.X = expr_575D_cp_0.velocity.X + 1f; + Gore expr_577B_cp_0 = Main.gore[num113]; + expr_577B_cp_0.velocity.Y = expr_577B_cp_0.velocity.Y + 1f; + num113 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num113].velocity *= 0.4f; + Gore expr_57F9_cp_0 = Main.gore[num113]; + expr_57F9_cp_0.velocity.X = expr_57F9_cp_0.velocity.X - 1f; + Gore expr_5817_cp_0 = Main.gore[num113]; + expr_5817_cp_0.velocity.Y = expr_5817_cp_0.velocity.Y + 1f; + num113 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num113].velocity *= 0.4f; + Gore expr_5895_cp_0 = Main.gore[num113]; + expr_5895_cp_0.velocity.X = expr_5895_cp_0.velocity.X + 1f; + Gore expr_58B3_cp_0 = Main.gore[num113]; + expr_58B3_cp_0.velocity.Y = expr_58B3_cp_0.velocity.Y - 1f; + num113 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num113].velocity *= 0.4f; + Gore expr_5931_cp_0 = Main.gore[num113]; + expr_5931_cp_0.velocity.X = expr_5931_cp_0.velocity.X - 1f; + Gore expr_594F_cp_0 = Main.gore[num113]; + expr_594F_cp_0.velocity.Y = expr_594F_cp_0.velocity.Y - 1f; + return; + } + } + else + { + if (this.type == 5) + { + if (this.life > 0) + { + int num114 = 0; + while ((double)num114 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num114++; + } + return; + } + for (int num115 = 0; num115 < 20; num115++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 6, 1f); + Gore.NewGore(this.position, this.velocity, 7, 1f); + return; + } + else + { + if (this.type == 113 || this.type == 114) + { + if (this.life > 0) + { + for (int num116 = 0; num116 < 20; num116++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + } + return; + } + for (int num117 = 0; num117 < 50; num117++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -1f, 0, default(Color), 1f); + } + if (this.type == 114) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 137, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2)), this.velocity, 139, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y), this.velocity, 139, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), this.velocity, 137, this.scale); + return; + } + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 137, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2)), this.velocity, 138, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y), this.velocity, 138, this.scale); + Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), this.velocity, 137, this.scale); + if (Main.player[Main.myPlayer].position.Y / 16f > (float)(Main.maxTilesY - 250)) + { + int num118 = (int)Main.screenPosition.Y; + int num119 = num118 + Main.screenWidth; + int num120 = (int)this.position.X; + if (this.direction > 0) + { + num120 -= 80; + } + int num121 = num120 + 140; + int num122 = num120; + for (int num123 = num118; num123 < num119; num123 += 50) + { + while (num122 < num121) + { + for (int num124 = 0; num124 < 5; num124++) + { + Dust.NewDust(new Vector2((float)num122, (float)num123), 32, 32, 5, (float)Main.rand.Next(-60, 61) * 0.1f, (float)Main.rand.Next(-60, 61) * 0.1f, 0, default(Color), 1f); + } + Vector2 vector = new Vector2((float)Main.rand.Next(-80, 81) * 0.1f, (float)Main.rand.Next(-60, 21) * 0.1f); + Gore.NewGore(new Vector2((float)num122, (float)num123), vector, Main.rand.Next(140, 143), 1f); + num122 += 46; + } + num122 = num120; + } + return; + } + } + else + { + if (this.type == 115 || this.type == 116) + { + if (this.life > 0) + { + for (int num125 = 0; num125 < 5; num125++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + } + return; + } + if (this.type == 115 && Main.netMode != 1) + { + NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), 116, 0); + for (int num126 = 0; num126 < 10; num126++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + } + return; + } + for (int num127 = 0; num127 < 20; num127++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 132, this.scale); + Gore.NewGore(this.position, this.velocity, 133, this.scale); + return; + } + else + { + if (this.type >= 117 && this.type <= 119) + { + if (this.life > 0) + { + for (int num128 = 0; num128 < 5; num128++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + } + return; + } + for (int num129 = 0; num129 < 10; num129++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 134 + this.type - 117, this.scale); + return; + } + else + { + if (this.type == 217 || this.type == 218 || this.type == 219) + { + if (this.life > 0) + { + int num130 = 0; + while ((double)num130 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num130++; + } + return; + } + for (int num131 = 0; num131 < 50; num131++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + if (this.type == 217) + { + Gore.NewGore(this.position, this.velocity, 292, this.scale); + Gore.NewGore(this.position, this.velocity, 293, this.scale); + } + if (this.type == 218) + { + Gore.NewGore(this.position, this.velocity, 295, this.scale); + Gore.NewGore(this.position, this.velocity, 296, this.scale); + } + if (this.type == 219) + { + Gore.NewGore(this.position, this.velocity, 294, this.scale); + return; + } + } + else + { + if (this.type == 222) + { + if (this.life > 0) + { + int num132 = 0; + while ((double)num132 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num132++; + } + return; + } + for (int num133 = 0; num133 < 50; num133++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + Gore.NewGore(new Vector2(this.position.X, this.position.Y - 35f), this.velocity, 303, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y - 45f), this.velocity, 304, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y), this.velocity, 305, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 306, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 10f), this.velocity, 307, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), this.velocity, 308, this.scale); + return; + } + else + { + if (this.type == 6 || this.type == 94 || this.type == 166) + { + if (this.life > 0) + { + int num134 = 0; + while ((double)num134 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num134++; + } + return; + } + for (int num135 = 0; num135 < 50; num135++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + int num136; + if (this.type == 94) + { + num136 = Gore.NewGore(this.position, this.velocity, 108, this.scale); + num136 = Gore.NewGore(this.position, this.velocity, 108, this.scale); + num136 = Gore.NewGore(this.position, this.velocity, 109, this.scale); + num136 = Gore.NewGore(this.position, this.velocity, 110, this.scale); + return; + } + if (this.type == 166) + { + num136 = Gore.NewGore(this.position, this.velocity, 209, this.scale); + num136 = Gore.NewGore(this.position, this.velocity, 210, this.scale); + num136 = Gore.NewGore(this.position, this.velocity, 211, this.scale); + return; + } + num136 = Gore.NewGore(this.position, this.velocity, 14, this.scale); + Main.gore[num136].alpha = this.alpha; + num136 = Gore.NewGore(this.position, this.velocity, 15, this.scale); + Main.gore[num136].alpha = this.alpha; + return; + } + else + { + if (this.type == 101) + { + if (this.life > 0) + { + int num137 = 0; + while ((double)num137 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num137++; + } + return; + } + for (int num138 = 0; num138 < 50; num138++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + Gore.NewGore(this.position, this.velocity, 110, this.scale); + Gore.NewGore(this.position, this.velocity, 114, this.scale); + Gore.NewGore(this.position, this.velocity, 114, this.scale); + Gore.NewGore(this.position, this.velocity, 115, this.scale); + return; + } + else + { + if (this.type == 7 || this.type == 8 || this.type == 9) + { + if (this.life > 0) + { + int num139 = 0; + while ((double)num139 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num139++; + } + return; + } + for (int num140 = 0; num140 < 50; num140++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + int num141 = Gore.NewGore(this.position, this.velocity, this.type - 7 + 18, 1f); + Main.gore[num141].alpha = this.alpha; + return; + } + else + { + if (this.type == 98 || this.type == 99 || this.type == 100) + { + if (this.life > 0) + { + int num142 = 0; + while ((double)num142 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num142++; + } + return; + } + for (int num143 = 0; num143 < 50; num143++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + int num144 = Gore.NewGore(this.position, this.velocity, 110, 1f); + Main.gore[num144].alpha = this.alpha; + return; + } + else + { + if (this.type == 10 || this.type == 11 || this.type == 12) + { + if (this.life > 0) + { + int num145 = 0; + while ((double)num145 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num145++; + } + return; + } + for (int num146 = 0; num146 < 10; num146++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, this.type - 7 + 18, 1f); + return; + } + else + { + if (this.type == 95 || this.type == 96 || this.type == 97) + { + if (this.life > 0) + { + int num147 = 0; + while ((double)num147 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num147++; + } + return; + } + for (int num148 = 0; num148 < 10; num148++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, this.type - 95 + 111, 1f); + return; + } + else + { + if (this.type == 13 || this.type == 14 || this.type == 15) + { + if (this.life > 0) + { + int num149 = 0; + while ((double)num149 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num149++; + } + return; + } + for (int num150 = 0; num150 < 50; num150++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + if (this.type == 13) + { + Gore.NewGore(this.position, this.velocity, 24, 1f); + Gore.NewGore(this.position, this.velocity, 25, 1f); + return; + } + if (this.type == 14) + { + Gore.NewGore(this.position, this.velocity, 26, 1f); + Gore.NewGore(this.position, this.velocity, 27, 1f); + return; + } + Gore.NewGore(this.position, this.velocity, 28, 1f); + Gore.NewGore(this.position, this.velocity, 29, 1f); + return; + } + else + { + if (this.type == 17) + { + if (this.life > 0) + { + int num151 = 0; + while ((double)num151 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num151++; + } + return; + } + for (int num152 = 0; num152 < 50; num152++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 30, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 31, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 31, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 32, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 32, 1f); + return; + } + else + { + if (this.type == 86) + { + if (this.life > 0) + { + int num153 = 0; + while ((double)num153 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num153++; + } + return; + } + for (int num154 = 0; num154 < 50; num154++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 101, 1f); + Gore.NewGore(this.position, this.velocity, 102, 1f); + Gore.NewGore(this.position, this.velocity, 103, 1f); + Gore.NewGore(this.position, this.velocity, 103, 1f); + Gore.NewGore(this.position, this.velocity, 104, 1f); + Gore.NewGore(this.position, this.velocity, 104, 1f); + Gore.NewGore(this.position, this.velocity, 105, 1f); + return; + } + else + { + if (this.type == 155) + { + if (this.life > 0) + { + int num155 = 0; + while ((double)num155 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num155++; + } + return; + } + for (int num156 = 0; num156 < 50; num156++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 181, 1f); + Gore.NewGore(this.position, this.velocity, 182, 1f); + Gore.NewGore(this.position, this.velocity, 183, 1f); + Gore.NewGore(this.position, this.velocity, 183, 1f); + return; + } + else + { + if (this.type == 163 || this.type == 238) + { + if (this.life > 0) + { + int num157 = 0; + while ((double)num157 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, 0, default(Color), 1f); + num157++; + } + return; + } + for (int num158 = 0; num158 < 50; num158++) + { + Dust.NewDust(this.position, this.width, this.height, 18, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 205, 1f); + Gore.NewGore(this.position, this.velocity, 206, 1f); + Gore.NewGore(this.position, this.velocity, 206, 1f); + Gore.NewGore(this.position, this.velocity, 206, 1f); + Gore.NewGore(this.position, this.velocity, 206, 1f); + return; + } + else + { + if (this.type == 164 || this.type == 165) + { + if (this.life > 0) + { + int num159 = 0; + while ((double)num159 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, 0, default(Color), 1f); + num159++; + } + return; + } + for (int num160 = 0; num160 < 50; num160++) + { + Dust.NewDust(this.position, this.width, this.height, 18, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 207, 1f); + Gore.NewGore(this.position, this.velocity, 208, 1f); + Gore.NewGore(this.position, this.velocity, 208, 1f); + Gore.NewGore(this.position, this.velocity, 208, 1f); + Gore.NewGore(this.position, this.velocity, 208, 1f); + return; + } + else + { + if (this.type == 239 || this.type == 240) + { + if (this.life > 0) + { + int num161 = 0; + while ((double)num161 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num161++; + } + return; + } + for (int num162 = 0; num162 < 50; num162++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 351, 1f); + Gore.NewGore(this.position, this.velocity, 352, 1f); + Gore.NewGore(this.position, this.velocity, 352, 1f); + Gore.NewGore(this.position, this.velocity, 353, 1f); + Gore.NewGore(this.position, this.velocity, 353, 1f); + return; + } + else + { + if (this.type == 236 || this.type == 237) + { + if (this.life > 0) + { + int num163 = 0; + while ((double)num163 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, 0, default(Color), 1f); + num163++; + } + return; + } + for (int num164 = 0; num164 < 50; num164++) + { + Dust.NewDust(this.position, this.width, this.height, 18, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 332, 1f); + Gore.NewGore(this.position, this.velocity, 333, 1f); + Gore.NewGore(this.position, this.velocity, 334, 1f); + Gore.NewGore(this.position, this.velocity, 335, 1f); + Gore.NewGore(this.position, this.velocity, 335, 1f); + return; + } + else + { + if (this.type == 241) + { + if (this.life > 0) + { + int num165 = 0; + while ((double)num165 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num165++; + } + return; + } + for (int num166 = 0; num166 < 50; num166++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 354, 1f); + Gore.NewGore(this.position, this.velocity, 355, 1f); + return; + } + else + { + if (this.type == 242) + { + if (this.life > 0) + { + int num167 = 0; + while ((double)num167 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num167++; + } + return; + } + for (int num168 = 0; num168 < 50; num168++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 356, 1f); + Gore.NewGore(this.position, this.velocity, 357, 1f); + Gore.NewGore(this.position, this.velocity, 357, 1f); + Gore.NewGore(this.position, this.velocity, 358, 1f); + Gore.NewGore(this.position, this.velocity, 358, 1f); + return; + } + else + { + if (this.type >= 105 && this.type <= 108) + { + if (this.life > 0) + { + int num169 = 0; + while ((double)num169 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num169++; + } + return; + } + for (int num170 = 0; num170 < 50; num170++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + if (this.type == 105 || this.type == 107) + { + Gore.NewGore(this.position, this.velocity, 124, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 125, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 125, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 126, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 126, 1f); + return; + } + Gore.NewGore(this.position, this.velocity, 127, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 128, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 128, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 129, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 129, 1f); + return; + } + else + { + if (this.type == 123 || this.type == 124) + { + if (this.life > 0) + { + int num171 = 0; + while ((double)num171 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num171++; + } + return; + } + for (int num172 = 0; num172 < 50; num172++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 151, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 152, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 152, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 153, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 153, 1f); + return; + } + else + { + if (this.type == 22) + { + if (this.life > 0) + { + int num173 = 0; + while ((double)num173 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num173++; + } + return; + } + for (int num174 = 0; num174 < 50; num174++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 73, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 74, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 74, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 75, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 75, 1f); + return; + } + else + { + if (this.type == 227) + { + if (this.life > 0) + { + int num175 = 0; + while ((double)num175 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num175++; + } + return; + } + for (int num176 = 0; num176 < 50; num176++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 320, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 321, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 322, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 323, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 323, 1f); + return; + } + else + { + if (this.type == 228) + { + if (this.life > 0) + { + int num177 = 0; + while ((double)num177 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num177++; + } + return; + } + for (int num178 = 0; num178 < 50; num178++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 324, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 325, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 326, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 327, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 327, 1f); + return; + } + else + { + if (this.type == 229) + { + if (this.life > 0) + { + int num179 = 0; + while ((double)num179 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num179++; + } + return; + } + for (int num180 = 0; num180 < 50; num180++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 328, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 329, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 329, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 330, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 330, 1f); + return; + } + else + { + if (this.type == 142) + { + if (this.life > 0) + { + int num181 = 0; + while ((double)num181 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num181++; + } + return; + } + for (int num182 = 0; num182 < 50; num182++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 157, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 158, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 158, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 159, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 159, 1f); + return; + } + else + { + if (this.type == 178) + { + if (this.life > 0) + { + int num183 = 0; + while ((double)num183 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num183++; + } + return; + } + for (int num184 = 0; num184 < 50; num184++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 231, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 232, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 232, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 233, 1f); + return; + } + else + { + if (this.type == 37 || this.type == 54) + { + if (this.life > 0) + { + int num185 = 0; + while ((double)num185 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num185++; + } + return; + } + for (int num186 = 0; num186 < 50; num186++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 58, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 59, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 59, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 60, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 60, 1f); + return; + } + else + { + if (this.type == 160) + { + if (this.life > 0) + { + int num187 = 0; + while ((double)num187 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)hitDirection, -1f, 0, default(Color), 1f); + num187++; + } + return; + } + for (int num188 = 0; num188 < 50; num188++) + { + Dust.NewDust(this.position, this.width, this.height, 26, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 188, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 189, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 189, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 190, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 190, 1f); + return; + } + else + { + if (this.type == 18) + { + if (this.life > 0) + { + int num189 = 0; + while ((double)num189 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num189++; + } + return; + } + for (int num190 = 0; num190 < 50; num190++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 33, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 34, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 34, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 35, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 35, 1f); + return; + } + else + { + if (this.type == 19) + { + if (this.life > 0) + { + int num191 = 0; + while ((double)num191 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num191++; + } + return; + } + for (int num192 = 0; num192 < 50; num192++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 36, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 37, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 37, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 38, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 38, 1f); + return; + } + else + { + if (this.type == 38) + { + if (this.life > 0) + { + int num193 = 0; + while ((double)num193 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num193++; + } + return; + } + for (int num194 = 0; num194 < 50; num194++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 64, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 65, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 65, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 66, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 66, 1f); + return; + } + else + { + if (this.type == 20) + { + if (this.life > 0) + { + int num195 = 0; + while ((double)num195 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num195++; + } + return; + } + for (int num196 = 0; num196 < 50; num196++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 39, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 40, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 40, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 41, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 41, 1f); + return; + } + else + { + if (this.type == 207) + { + if (this.life > 0) + { + int num197 = 0; + while ((double)num197 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num197++; + } + return; + } + for (int num198 = 0; num198 < 50; num198++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 283, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 284, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 284, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 285, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 285, 1f); + return; + } + else + { + if (this.type == 208) + { + if (this.life > 0) + { + int num199 = 0; + while ((double)num199 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num199++; + } + return; + } + for (int num200 = 0; num200 < 50; num200++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 286, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 287, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 287, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 288, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 288, 1f); + return; + } + else + { + if (this.type == 209) + { + if (this.life > 0) + { + int num201 = 0; + while ((double)num201 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num201++; + } + return; + } + for (int num202 = 0; num202 < 50; num202++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 289, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 290, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 290, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 291, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 291, 1f); + return; + } + else + { + if (this.type >= 212 && this.type <= 216) + { + if (this.life > 0) + { + int num203 = 0; + while ((double)num203 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num203++; + } + return; + } + for (int num204 = 0; num204 < 50; num204++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + if (this.type == 212) + { + Gore.NewGore(this.position, this.velocity, 336, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 337, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 337, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 338, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 338, 1f); + return; + } + if (this.type == 213) + { + Gore.NewGore(this.position, this.velocity, 339, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 340, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 340, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 341, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 341, 1f); + return; + } + if (this.type == 214) + { + Gore.NewGore(this.position, this.velocity, 342, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 343, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 343, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 344, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 344, 1f); + return; + } + if (this.type == 215) + { + Gore.NewGore(this.position, this.velocity, 345, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 346, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 346, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 347, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 347, 1f); + return; + } + if (this.type == 216) + { + Gore.NewGore(this.position, this.velocity, 348, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 348, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 348, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 348, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 348, 1f); + return; + } + } + else + { + if (this.type == 220 || this.type == 221) + { + if (this.life > 0) + { + int num205 = 0; + while ((double)num205 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 151, (float)hitDirection, -1f, 0, default(Color), 0.7f); + num205++; + } + return; + } + for (int num206 = 0; num206 < 20; num206++) + { + Dust.NewDust(this.position, this.width, this.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + if (this.type == 221) + { + Gore.NewGore(this.position, this.velocity, 298, this.scale); + Gore.NewGore(this.position, this.velocity, 299, this.scale); + return; + } + Gore.NewGore(this.position, this.velocity, 297, this.scale); + return; + } + else + { + if (this.type == 21 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 32 || this.type == 44 || this.type == 45 || this.type == 77 || this.type == 110 || this.type == 167 || this.type == 197 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 287 || this.type == 291 || this.type == 292 || this.type == 293) + { + if (this.life > 0) + { + int num207 = 0; + while ((double)num207 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)hitDirection, -1f, 0, default(Color), 1f); + num207++; + } + return; + } + for (int num208 = 0; num208 < 20; num208++) + { + Dust.NewDust(this.position, this.width, this.height, 26, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + if (this.type == 167) + { + Gore.NewGore(this.position, this.velocity, 213, this.scale); + Gore.NewGore(this.position, this.velocity, 214, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 212, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 212, this.scale); + return; + } + if (this.type == 197) + { + Gore.NewGore(this.position, this.velocity, 257, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 212, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 212, this.scale); + return; + } + if (this.type == 201) + { + Gore.NewGore(this.position, this.velocity, 265, this.scale); + Gore.NewGore(this.position, this.velocity, 267, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + return; + } + if (this.type == 202) + { + Gore.NewGore(this.position, this.velocity, 268, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + return; + } + if (this.type == 203) + { + Gore.NewGore(this.position, this.velocity, 269, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 266, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 266, this.scale); + return; + } + Gore.NewGore(this.position, this.velocity, 42, this.scale); + if (this.type == 77) + { + Gore.NewGore(this.position, this.velocity, 106, this.scale); + } + if (this.type == 110) + { + Gore.NewGore(this.position, this.velocity, 130, this.scale); + } + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + if (this.type == 110) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 131, this.scale); + } + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + return; + } + else + { + if ((this.type >= 269 && this.type <= 276) || (this.type >= 281 && this.type <= 286)) + { + if (this.life > 0) + { + int num209 = 0; + while ((double)num209 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)hitDirection, -1f, 0, default(Color), 1f); + num209++; + } + return; + } + for (int num210 = 0; num210 < 20; num210++) + { + Dust.NewDust(this.position, this.width, this.height, 26, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 42, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 43, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 44, this.scale); + if (this.type == 269) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 406, this.scale); + } + if (this.type == 270) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 407, this.scale); + } + if (this.type == 271 || this.type == 272) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 408, this.scale); + } + if (this.type == 274) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 409, this.scale); + } + if (this.type == 276) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 410, this.scale); + return; + } + } + else + { + if (this.type >= 277 && this.type <= 280) + { + if (this.life > 0) + { + int num211 = 0; + while ((double)num211 < dmg / (double)this.lifeMax * 100.0) + { + int num212 = Dust.NewDust(this.position, this.width, this.height, 174, (float)hitDirection, -1f, 0, default(Color), 1f); + Main.dust[num212].scale = 1.1f; + Main.dust[num212].noGravity = true; + num211++; + } + return; + } + for (int num213 = 0; num213 < 75; num213++) + { + int num214 = Dust.NewDust(this.position, this.width, this.height, 174, 1.5f * (float)hitDirection, -0.5f, 0, default(Color), 1f); + Main.dust[num214].velocity *= 2f; + Main.dust[num214].scale = 1.4f; + Main.dust[num214].noGravity = true; + } + return; + } + else + { + if (this.type == 85) + { + int num215 = 7; + if (this.ai[3] == 2f) + { + num215 = 10; + } + if (this.ai[3] == 3f) + { + num215 = 37; + } + if (this.life > 0) + { + int num216 = 0; + while ((double)num216 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, num215, 0f, 0f, 0, default(Color), 1f); + num216++; + } + return; + } + for (int num217 = 0; num217 < 20; num217++) + { + Dust.NewDust(this.position, this.width, this.height, num215, 0f, 0f, 0, default(Color), 1f); + } + int num218 = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), new Vector2((float)hitDirection, 0f), 61, this.scale); + Main.gore[num218].velocity *= 0.3f; + num218 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)hitDirection, 0f), 62, this.scale); + Main.gore[num218].velocity *= 0.3f; + num218 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)this.height - 10f), new Vector2((float)hitDirection, 0f), 63, this.scale); + Main.gore[num218].velocity *= 0.3f; + return; + } + else + { + if (this.type == 169) + { + if (this.life > 0) + { + int num219 = 0; + while ((double)num219 < dmg / (double)this.lifeMax * 50.0) + { + int num220 = Dust.NewDust(this.position, this.width, this.height, 92, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num220].velocity *= 1.5f; + Main.dust[num220].noGravity = true; + num219++; + } + return; + } + for (int num221 = 0; num221 < 100; num221++) + { + int num222 = Dust.NewDust(this.position, this.width, this.height, 92, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num222].scale = 1.5f; + Main.dust[num222].velocity *= 2f; + Main.dust[num222].noGravity = true; + } + return; + } + else + { + if (this.type == 170 || this.type == 180) + { + if (this.life > 0) + { + int num223 = 0; + while ((double)num223 < dmg / (double)this.lifeMax * 50.0) + { + int num224 = Dust.NewDust(this.position, this.width, this.height, 54, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num224].velocity *= 1.5f; + Main.dust[num224].noGravity = true; + num223++; + } + return; + } + for (int num225 = 0; num225 < 10; num225++) + { + int num226 = Dust.NewDust(this.position, this.width, this.height, 54, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num226].velocity *= 2f; + Main.dust[num226].noGravity = true; + } + for (int num227 = 0; num227 < 4; num227++) + { + int num228 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num228].velocity *= 0.3f; + } + return; + } + else + { + if (this.type == 171) + { + if (this.life > 0) + { + int num229 = 0; + while ((double)num229 < dmg / (double)this.lifeMax * 50.0) + { + int num230 = Dust.NewDust(this.position, this.width, this.height, 16, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num230].velocity *= 1.5f; + Main.dust[num230].noGravity = true; + num229++; + } + return; + } + for (int num231 = 0; num231 < 10; num231++) + { + int num232 = Dust.NewDust(this.position, this.width, this.height, 16, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num232].velocity *= 2f; + Main.dust[num232].noGravity = true; + } + for (int num233 = 0; num233 < 4; num233++) + { + int num234 = 11 + num233; + if (num234 > 13) + { + num234 = Main.rand.Next(11, 14); + } + int num235 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)hitDirection, 0f), num234, this.scale); + Main.gore[num235].velocity *= 0.3f; + } + return; + } + else + { + if (this.type == 290) + { + if (this.life <= 0) + { + for (int num236 = 0; num236 < 10; num236++) + { + int num237 = Dust.NewDust(this.position, this.width, this.height, 16, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num237].velocity *= 2f; + Main.dust[num237].noGravity = true; + } + int num238 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(11, 14), this.scale); + Main.gore[num238].velocity *= 0.5f; + num238 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), default(Vector2), Main.rand.Next(11, 14), this.scale); + Main.gore[num238].velocity *= 0.5f; + num238 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + 40f), default(Vector2), Main.rand.Next(11, 14), this.scale); + Main.gore[num238].velocity *= 0.5f; + return; + } + } + else + { + if (this.type >= 87 && this.type <= 92) + { + if (this.life > 0) + { + int num239 = 0; + while ((double)num239 < dmg / (double)this.lifeMax * 50.0) + { + int num240 = Dust.NewDust(this.position, this.width, this.height, 16, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num240].velocity *= 1.5f; + Main.dust[num240].noGravity = true; + num239++; + } + return; + } + for (int num241 = 0; num241 < 10; num241++) + { + int num242 = Dust.NewDust(this.position, this.width, this.height, 16, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num242].velocity *= 2f; + Main.dust[num242].noGravity = true; + } + int num243 = Main.rand.Next(1, 4); + for (int num244 = 0; num244 < num243; num244++) + { + int num245 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)hitDirection, 0f), Main.rand.Next(11, 14), this.scale); + Main.gore[num245].velocity *= 0.8f; + } + return; + } + else + { + if (this.type == 78 || this.type == 79 || this.type == 80) + { + if (this.life > 0) + { + int num246 = 0; + while ((double)num246 < dmg / (double)this.lifeMax * 50.0) + { + int num247 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num247].velocity *= 2f; + Main.dust[num247].noGravity = true; + num246++; + } + return; + } + for (int num248 = 0; num248 < 20; num248++) + { + int num249 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num249].velocity *= 2f; + Main.dust[num249].noGravity = true; + } + int num250 = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), new Vector2((float)hitDirection, 0f), 61, this.scale); + Main.gore[num250].velocity *= 0.3f; + num250 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 10f), new Vector2((float)hitDirection, 0f), 62, this.scale); + Main.gore[num250].velocity *= 0.3f; + num250 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)this.height - 10f), new Vector2((float)hitDirection, 0f), 63, this.scale); + Main.gore[num250].velocity *= 0.3f; + return; + } + else + { + if (this.type == 82 || this.type == 158 || this.type == 159 || this.type == 250 || this.type == 253) + { + if (this.life > 0) + { + int num251 = 0; + while ((double)num251 < dmg / (double)this.lifeMax * 50.0) + { + int num252 = Dust.NewDust(this.position, this.width, this.height, 54, 0f, 0f, 50, default(Color), 1.5f); + Main.dust[num252].velocity *= 2f; + Main.dust[num252].noGravity = true; + num251++; + } + return; + } + for (int num253 = 0; num253 < 20; num253++) + { + int num254 = Dust.NewDust(this.position, this.width, this.height, 54, 0f, 0f, 50, default(Color), 1.5f); + Main.dust[num254].velocity *= 2f; + Main.dust[num254].noGravity = true; + } + int num255 = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num255].velocity *= 0.3f; + num255 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 15f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num255].velocity *= 0.3f; + num255 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)this.height - 20f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num255].velocity *= 0.3f; + return; + } + else + { + if (this.type == 254 || this.type == 255 || this.type == 256 || this.type == 257 || this.type == 258 || this.type == 259 || this.type == 260 || this.type == 261) + { + if (this.life > 0) + { + int num256 = 0; + while ((double)num256 < dmg / (double)this.lifeMax * 50.0) + { + int num257 = Dust.NewDust(this.position, this.width, this.height, 165, 0f, 0f, 50, default(Color), 1.5f); + Main.dust[num257].velocity *= 2f; + Main.dust[num257].noGravity = true; + num256++; + } + return; + } + for (int num258 = 0; num258 < 20; num258++) + { + int num259 = Dust.NewDust(this.position, this.width, this.height, 165, 0f, 0f, 50, default(Color), 1.5f); + Main.dust[num259].velocity *= 2f; + Main.dust[num259].noGravity = true; + } + if (this.type != 261) + { + int num260 = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), new Vector2((float)hitDirection, 0f), 375, this.scale); + Main.gore[num260].velocity *= 0.3f; + num260 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 15f), new Vector2((float)hitDirection, 0f), 376, this.scale); + Main.gore[num260].velocity *= 0.3f; + num260 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)this.height - 20f), new Vector2((float)hitDirection, 0f), 377, this.scale); + Main.gore[num260].velocity *= 0.3f; + return; + } + } + else + { + if (this.type == 140) + { + if (this.life <= 0) + { + for (int num261 = 0; num261 < 20; num261++) + { + int num262 = Dust.NewDust(this.position, this.width, this.height, 54, 0f, 0f, 50, default(Color), 1.5f); + Main.dust[num262].velocity *= 2f; + Main.dust[num262].noGravity = true; + } + int num263 = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num263].velocity *= 0.3f; + num263 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 15f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num263].velocity *= 0.3f; + num263 = Gore.NewGore(new Vector2(this.position.X, this.position.Y + (float)this.height - 20f), new Vector2((float)hitDirection, 0f), 99, this.scale); + Main.gore[num263].velocity *= 0.3f; + return; + } + } + else + { + if (this.type == 39 || this.type == 40 || this.type == 41) + { + if (this.life > 0) + { + int num264 = 0; + while ((double)num264 < dmg / (double)this.lifeMax * 50.0) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)hitDirection, -1f, 0, default(Color), 1f); + num264++; + } + return; + } + for (int num265 = 0; num265 < 20; num265++) + { + Dust.NewDust(this.position, this.width, this.height, 26, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, this.type - 39 + 67, 1f); + return; + } + else + { + if (this.type == 34) + { + if (this.life > 0) + { + int num266 = 0; + while ((double)num266 < dmg / (double)this.lifeMax * 30.0) + { + int num267 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 15, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1.8f); + Main.dust[num267].noLight = true; + Main.dust[num267].noGravity = true; + Main.dust[num267].velocity *= 1.3f; + num267 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 0, default(Color), 0.9f); + Main.dust[num267].noLight = true; + Main.dust[num267].velocity *= 1.3f; + num266++; + } + return; + } + for (int num268 = 0; num268 < 15; num268++) + { + int num269 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 15, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1.8f); + Main.dust[num269].noLight = true; + Main.dust[num269].noGravity = true; + Main.dust[num269].velocity *= 1.3f; + num269 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 0, default(Color), 0.9f); + Main.dust[num269].noLight = true; + Main.dust[num269].velocity *= 1.3f; + } + return; + } + else + { + if (this.type == 289) + { + if (this.life > 0) + { + int num270 = 0; + while ((double)num270 < dmg / (double)this.lifeMax * 30.0) + { + int num271 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1.8f); + Main.dust[num271].noLight = true; + Main.dust[num271].noGravity = true; + Main.dust[num271].velocity *= 1.3f; + num270++; + } + return; + } + for (int num272 = 0; num272 < 50; num272++) + { + int num273 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1.8f); + Main.dust[num273].noLight = true; + Main.dust[num273].noGravity = true; + Main.dust[num273].velocity *= 1.3f; + } + return; + } + else + { + if (this.type == 35 || this.type == 36) + { + if (this.life > 0) + { + int num274 = 0; + while ((double)num274 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)hitDirection, -1f, 0, default(Color), 1f); + num274++; + } + return; + } + for (int num275 = 0; num275 < 150; num275++) + { + Dust.NewDust(this.position, this.width, this.height, 26, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + if (this.type == 35) + { + Gore.NewGore(this.position, this.velocity, 54, 1f); + Gore.NewGore(this.position, this.velocity, 55, 1f); + return; + } + Gore.NewGore(this.position, this.velocity, 56, 1f); + Gore.NewGore(this.position, this.velocity, 57, 1f); + Gore.NewGore(this.position, this.velocity, 57, 1f); + Gore.NewGore(this.position, this.velocity, 57, 1f); + return; + } + else + { + if (this.type == 139) + { + if (this.life <= 0) + { + for (int num276 = 0; num276 < 10; num276++) + { + int num277 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num277].velocity *= 1.4f; + } + for (int num278 = 0; num278 < 5; num278++) + { + int num279 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num279].noGravity = true; + Main.dust[num279].velocity *= 5f; + num279 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num279].velocity *= 3f; + } + int num280 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num280].velocity *= 0.4f; + Gore expr_C6F1_cp_0 = Main.gore[num280]; + expr_C6F1_cp_0.velocity.X = expr_C6F1_cp_0.velocity.X + 1f; + Gore expr_C711_cp_0 = Main.gore[num280]; + expr_C711_cp_0.velocity.Y = expr_C711_cp_0.velocity.Y + 1f; + num280 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num280].velocity *= 0.4f; + Gore expr_C795_cp_0 = Main.gore[num280]; + expr_C795_cp_0.velocity.X = expr_C795_cp_0.velocity.X - 1f; + Gore expr_C7B5_cp_0 = Main.gore[num280]; + expr_C7B5_cp_0.velocity.Y = expr_C7B5_cp_0.velocity.Y + 1f; + num280 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num280].velocity *= 0.4f; + Gore expr_C839_cp_0 = Main.gore[num280]; + expr_C839_cp_0.velocity.X = expr_C839_cp_0.velocity.X + 1f; + Gore expr_C859_cp_0 = Main.gore[num280]; + expr_C859_cp_0.velocity.Y = expr_C859_cp_0.velocity.Y - 1f; + num280 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num280].velocity *= 0.4f; + Gore expr_C8DD_cp_0 = Main.gore[num280]; + expr_C8DD_cp_0.velocity.X = expr_C8DD_cp_0.velocity.X - 1f; + Gore expr_C8FD_cp_0 = Main.gore[num280]; + expr_C8FD_cp_0.velocity.Y = expr_C8FD_cp_0.velocity.Y - 1f; + return; + } + } + else + { + if (this.type >= 134 && this.type <= 136) + { + if (this.type == 135 && this.life > 0 && Main.netMode != 1 && this.ai[2] == 0f && Main.rand.Next(25) == 0) + { + this.ai[2] = 1f; + int num281 = NPC.NewNPC((int)(this.position.X + (float)(this.width / 2)), (int)(this.position.Y + (float)this.height), 139, 0); + if (Main.netMode == 2 && num281 < 200) + { + NetMessage.SendData(23, -1, -1, "", num281, 0f, 0f, 0f, 0); + } + this.netUpdate = true; + } + if (this.life <= 0) + { + Gore.NewGore(this.position, this.velocity, 156, 1f); + if (Main.rand.Next(2) == 0) + { + for (int num282 = 0; num282 < 10; num282++) + { + int num283 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num283].velocity *= 1.4f; + } + for (int num284 = 0; num284 < 5; num284++) + { + int num285 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num285].noGravity = true; + Main.dust[num285].velocity *= 5f; + num285 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num285].velocity *= 3f; + } + int num286 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num286].velocity *= 0.4f; + Gore expr_CC3E_cp_0 = Main.gore[num286]; + expr_CC3E_cp_0.velocity.X = expr_CC3E_cp_0.velocity.X + 1f; + Gore expr_CC5E_cp_0 = Main.gore[num286]; + expr_CC5E_cp_0.velocity.Y = expr_CC5E_cp_0.velocity.Y + 1f; + num286 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num286].velocity *= 0.4f; + Gore expr_CCE2_cp_0 = Main.gore[num286]; + expr_CCE2_cp_0.velocity.X = expr_CCE2_cp_0.velocity.X - 1f; + Gore expr_CD02_cp_0 = Main.gore[num286]; + expr_CD02_cp_0.velocity.Y = expr_CD02_cp_0.velocity.Y + 1f; + num286 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num286].velocity *= 0.4f; + Gore expr_CD86_cp_0 = Main.gore[num286]; + expr_CD86_cp_0.velocity.X = expr_CD86_cp_0.velocity.X + 1f; + Gore expr_CDA6_cp_0 = Main.gore[num286]; + expr_CDA6_cp_0.velocity.Y = expr_CDA6_cp_0.velocity.Y - 1f; + num286 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num286].velocity *= 0.4f; + Gore expr_CE2A_cp_0 = Main.gore[num286]; + expr_CE2A_cp_0.velocity.X = expr_CE2A_cp_0.velocity.X - 1f; + Gore expr_CE4A_cp_0 = Main.gore[num286]; + expr_CE4A_cp_0.velocity.Y = expr_CE4A_cp_0.velocity.Y - 1f; + return; + } + } + } + else + { + if (this.type == 127) + { + if (this.life <= 0) + { + Gore.NewGore(this.position, this.velocity, 149, 1f); + Gore.NewGore(this.position, this.velocity, 150, 1f); + for (int num287 = 0; num287 < 10; num287++) + { + int num288 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num288].velocity *= 1.4f; + } + for (int num289 = 0; num289 < 5; num289++) + { + int num290 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num290].noGravity = true; + Main.dust[num290].velocity *= 5f; + num290 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num290].velocity *= 3f; + } + int num291 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num291].velocity *= 0.4f; + Gore expr_D0B8_cp_0 = Main.gore[num291]; + expr_D0B8_cp_0.velocity.X = expr_D0B8_cp_0.velocity.X + 1f; + Gore expr_D0D8_cp_0 = Main.gore[num291]; + expr_D0D8_cp_0.velocity.Y = expr_D0D8_cp_0.velocity.Y + 1f; + num291 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num291].velocity *= 0.4f; + Gore expr_D15C_cp_0 = Main.gore[num291]; + expr_D15C_cp_0.velocity.X = expr_D15C_cp_0.velocity.X - 1f; + Gore expr_D17C_cp_0 = Main.gore[num291]; + expr_D17C_cp_0.velocity.Y = expr_D17C_cp_0.velocity.Y + 1f; + num291 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num291].velocity *= 0.4f; + Gore expr_D200_cp_0 = Main.gore[num291]; + expr_D200_cp_0.velocity.X = expr_D200_cp_0.velocity.X + 1f; + Gore expr_D220_cp_0 = Main.gore[num291]; + expr_D220_cp_0.velocity.Y = expr_D220_cp_0.velocity.Y - 1f; + num291 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num291].velocity *= 0.4f; + Gore expr_D2A4_cp_0 = Main.gore[num291]; + expr_D2A4_cp_0.velocity.X = expr_D2A4_cp_0.velocity.X - 1f; + Gore expr_D2C4_cp_0 = Main.gore[num291]; + expr_D2C4_cp_0.velocity.Y = expr_D2C4_cp_0.velocity.Y - 1f; + return; + } + } + else + { + if (this.type >= 128 && this.type <= 131) + { + if (this.life <= 0) + { + Gore.NewGore(this.position, this.velocity, 147, 1f); + Gore.NewGore(this.position, this.velocity, 148, 1f); + for (int num292 = 0; num292 < 10; num292++) + { + int num293 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num293].velocity *= 1.4f; + } + for (int num294 = 0; num294 < 5; num294++) + { + int num295 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num295].noGravity = true; + Main.dust[num295].velocity *= 5f; + num295 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num295].velocity *= 3f; + } + int num296 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num296].velocity *= 0.4f; + Gore expr_D545_cp_0 = Main.gore[num296]; + expr_D545_cp_0.velocity.X = expr_D545_cp_0.velocity.X + 1f; + Gore expr_D565_cp_0 = Main.gore[num296]; + expr_D565_cp_0.velocity.Y = expr_D565_cp_0.velocity.Y + 1f; + num296 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num296].velocity *= 0.4f; + Gore expr_D5E9_cp_0 = Main.gore[num296]; + expr_D5E9_cp_0.velocity.X = expr_D5E9_cp_0.velocity.X - 1f; + Gore expr_D609_cp_0 = Main.gore[num296]; + expr_D609_cp_0.velocity.Y = expr_D609_cp_0.velocity.Y + 1f; + num296 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num296].velocity *= 0.4f; + Gore expr_D68D_cp_0 = Main.gore[num296]; + expr_D68D_cp_0.velocity.X = expr_D68D_cp_0.velocity.X + 1f; + Gore expr_D6AD_cp_0 = Main.gore[num296]; + expr_D6AD_cp_0.velocity.Y = expr_D6AD_cp_0.velocity.Y - 1f; + num296 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num296].velocity *= 0.4f; + Gore expr_D731_cp_0 = Main.gore[num296]; + expr_D731_cp_0.velocity.X = expr_D731_cp_0.velocity.X - 1f; + Gore expr_D751_cp_0 = Main.gore[num296]; + expr_D751_cp_0.velocity.Y = expr_D751_cp_0.velocity.Y - 1f; + return; + } + } + else + { + if (this.type == 23) + { + if (this.life > 0) + { + int num297 = 0; + while ((double)num297 < dmg / (double)this.lifeMax * 100.0) + { + int num298 = 25; + if (Main.rand.Next(2) == 0) + { + num298 = 6; + } + Dust.NewDust(this.position, this.width, this.height, num298, (float)hitDirection, -1f, 0, default(Color), 1f); + int num299 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num299].noGravity = true; + num297++; + } + return; + } + for (int num300 = 0; num300 < 50; num300++) + { + int num301 = 25; + if (Main.rand.Next(2) == 0) + { + num301 = 6; + } + Dust.NewDust(this.position, this.width, this.height, num301, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + for (int num302 = 0; num302 < 50; num302++) + { + int num303 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num303].velocity *= 6f; + Main.dust[num303].noGravity = true; + } + return; + } + else + { + if (this.type == 24) + { + if (this.life > 0) + { + int num304 = 0; + while ((double)num304 < dmg / (double)this.lifeMax * 100.0) + { + int num305 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 2.5f); + Main.dust[num305].noGravity = true; + num304++; + } + return; + } + for (int num306 = 0; num306 < 50; num306++) + { + int num307 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 2.5f); + Main.dust[num307].noGravity = true; + Main.dust[num307].velocity *= 2f; + } + Gore.NewGore(this.position, this.velocity, 45, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 46, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 46, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 47, 1f); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 47, 1f); + return; + } + else + { + if (this.type == 25) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num308 = 0; num308 < 20; num308++) + { + int num309 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num309].noGravity = true; + Main.dust[num309].velocity *= 2f; + num309 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num309].velocity *= 2f; + } + return; + } + if (this.type == 33) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num310 = 0; num310 < 20; num310++) + { + int num311 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1.2f); + Main.dust[num311].noGravity = true; + Main.dust[num311].velocity *= 2f; + num311 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 0.6f); + Main.dust[num311].velocity *= 2f; + } + return; + } + if (this.type == 26 || this.type == 27 || this.type == 28 || this.type == 29 || this.type == 73 || this.type == 111) + { + if (this.life > 0) + { + int num312 = 0; + while ((double)num312 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num312++; + } + return; + } + for (int num313 = 0; num313 < 50; num313++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 48, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 49, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 20f), this.velocity, 49, this.scale); + if (this.type == 111) + { + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 131, this.scale); + } + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 50, this.scale); + Gore.NewGore(new Vector2(this.position.X, this.position.Y + 34f), this.velocity, 50, this.scale); + return; + } + else + { + if (this.type == 185) + { + if (this.life > 0) + { + int num314 = 0; + while ((double)num314 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num314++; + } + return; + } + for (int num315 = 0; num315 < 50; num315++) + { + Dust.NewDust(this.position, this.width, this.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 240, this.scale); + return; + } + else + { + if (this.type == 30) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num316 = 0; num316 < 20; num316++) + { + int num317 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num317].noGravity = true; + Main.dust[num317].velocity *= 2f; + num317 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num317].velocity *= 2f; + } + return; + } + if (this.type == 42 || this.type == 176 || this.type == 205 || (this.type >= 231 && this.type <= 235)) + { + if (this.life > 0) + { + int num318 = 0; + while ((double)num318 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -1f, this.alpha, this.color, this.scale); + num318++; + } + return; + } + for (int num319 = 0; num319 < 50; num319++) + { + Dust.NewDust(this.position, this.width, this.height, 18, (float)hitDirection, -2f, this.alpha, this.color, this.scale); + } + if (this.type == 205) + { + Gore.NewGore(this.position, this.velocity, 270, this.scale); + Gore.NewGore(this.position, this.velocity, 271, this.scale); + Gore.NewGore(this.position, this.velocity, 271, this.scale); + Gore.NewGore(this.position, this.velocity, 272, this.scale); + return; + } + if (this.type == 176) + { + Gore.NewGore(this.position, this.velocity, 229, this.scale); + Gore.NewGore(this.position, this.velocity, 230, this.scale); + return; + } + Gore.NewGore(this.position, this.velocity, 70, this.scale); + Gore.NewGore(this.position, this.velocity, 71, this.scale); + return; + } + else + { + if (this.type == 43 || this.type == 56) + { + if (this.life > 0) + { + int num320 = 0; + while ((double)num320 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 40, (float)hitDirection, -1f, this.alpha, this.color, 1.2f); + num320++; + } + return; + } + for (int num321 = 0; num321 < 50; num321++) + { + Dust.NewDust(this.position, this.width, this.height, 40, (float)hitDirection, -2f, this.alpha, this.color, 1.2f); + } + Gore.NewGore(this.position, this.velocity, 72, 1f); + Gore.NewGore(this.position, this.velocity, 72, 1f); + return; + } + else + { + if (this.type == 175) + { + if (this.life > 0) + { + int num322 = 0; + while ((double)num322 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 40, (float)hitDirection, -1f, this.alpha, this.color, 1.2f); + num322++; + } + return; + } + for (int num323 = 0; num323 < 50; num323++) + { + Dust.NewDust(this.position, this.width, this.height, 40, (float)hitDirection, -2f, this.alpha, this.color, 1.2f); + } + Gore.NewGore(this.position, this.velocity, 227, 1f); + Gore.NewGore(this.position, this.velocity, 228, 1f); + return; + } + else + { + if (this.type == 48) + { + if (this.life > 0) + { + int num324 = 0; + while ((double)num324 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num324++; + } + return; + } + for (int num325 = 0; num325 < 50; num325++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 80, 1f); + Gore.NewGore(this.position, this.velocity, 81, 1f); + return; + } + else + { + if (this.type == 62 || this.type == 66) + { + if (this.life > 0) + { + int num326 = 0; + while ((double)num326 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num326++; + } + return; + } + for (int num327 = 0; num327 < 50; num327++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 93, 1f); + Gore.NewGore(this.position, this.velocity, 94, 1f); + Gore.NewGore(this.position, this.velocity, 94, 1f); + return; + } + else + { + if (this.type == 156) + { + if (this.life > 0) + { + int num328 = 0; + while ((double)num328 < dmg / (double)this.lifeMax * 100.0) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + num328++; + } + return; + } + for (int num329 = 0; num329 < 50; num329++) + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + Gore.NewGore(this.position, this.velocity, 184, 1f); + Gore.NewGore(this.position, this.velocity, 185, 1f); + Gore.NewGore(this.position, this.velocity, 185, 1f); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return; + } + if (this.life > 0) + { + int num330 = 0; + while ((double)num330 < dmg / (double)this.lifeMax * 80.0) + { + Dust.NewDust(this.position, this.width, this.height, 6, (float)(hitDirection * 2), -1f, this.alpha, default(Color), 1.5f); + num330++; + } + return; + } + for (int num331 = 0; num331 < 40; num331++) + { + Dust.NewDust(this.position, this.width, this.height, 6, (float)(hitDirection * 2), -1f, this.alpha, default(Color), 1.5f); + } + return; + } + } + public static bool AnyNPCs(int Type) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].type == Type) + { + return true; + } + } + return false; + } + public static void SpawnSkeletron() + { + bool flag = true; + bool flag2 = false; + Vector2 vector = default(Vector2); + int num = 0; + int num2 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].type == 35) + { + flag = false; + break; + } + } + for (int j = 0; j < 200; j++) + { + if (Main.npc[j].active && Main.npc[j].type == 37) + { + flag2 = true; + Main.npc[j].ai[3] = 1f; + vector = Main.npc[j].position; + num = Main.npc[j].width; + num2 = Main.npc[j].height; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, "", j, 0f, 0f, 0f, 0); + } + } + } + if (flag && flag2) + { + int num3 = NPC.NewNPC((int)vector.X + num / 2, (int)vector.Y + num2 / 2, 35, 0); + Main.npc[num3].netUpdate = true; + string str = "Skeletron"; + if (Main.netMode == 0) + { + Main.NewText(str + " " + Lang.misc[16], 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, str + " " + Lang.misc[16], 255, 175f, 75f, 255f, 0); + } + } + } + public static bool NearSpikeBall(int x, int y) + { + Rectangle rectangle = new Rectangle(x * 16 - 300, y * 16 - 300, 600, 600); + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].aiStyle == 20) + { + Rectangle rectangle2 = new Rectangle((int)Main.npc[i].ai[1], (int)Main.npc[i].ai[2], 20, 20); + if (rectangle.Intersects(rectangle2)) + { + return true; + } + } + } + return false; + } + public void AddBuff(int type, int time, bool quiet = false) + { + if (this.buffImmune[type]) + { + return; + } + if (!quiet) + { + if (Main.netMode == 1) + { + NetMessage.SendData(53, -1, -1, "", this.whoAmI, (float)type, (float)time, 0f, 0); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(54, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + } + } + int num = -1; + for (int i = 0; i < 5; i++) + { + if (this.buffType[i] == type) + { + if (this.buffTime[i] < time) + { + this.buffTime[i] = time; + } + return; + } + } + while (num == -1) + { + int num2 = -1; + for (int j = 0; j < 5; j++) + { + if (!Main.debuff[this.buffType[j]]) + { + num2 = j; + break; + } + } + if (num2 == -1) + { + return; + } + for (int k = num2; k < 5; k++) + { + if (this.buffType[k] == 0) + { + num = k; + break; + } + } + if (num == -1) + { + this.DelBuff(num2); + } + } + this.buffType[num] = type; + this.buffTime[num] = time; + } + public void DelBuff(int b) + { + this.buffTime[b] = 0; + this.buffType[b] = 0; + for (int i = 0; i < 4; i++) + { + if (this.buffTime[i] == 0 || this.buffType[i] == 0) + { + for (int j = i + 1; j < 5; j++) + { + this.buffTime[j - 1] = this.buffTime[j]; + this.buffType[j - 1] = this.buffType[j]; + this.buffTime[j] = 0; + this.buffType[j] = 0; + } + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(54, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + } + public Vector2 center() + { + return new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)); + } + public Rectangle getRect() + { + return new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + } + public void UpdateNPC(int i) + { + this.whoAmI = i; + if (this.active) + { + if (this.realLife >= 0) + { + this.life = Main.npc[this.realLife].life; + } + if (Main.netMode == 1) + { + bool flag = false; + int num = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num2 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + try + { + if (num >= 4 && num <= Main.maxTilesX - 4 && num2 >= 4 && num2 <= Main.maxTilesY - 4) + { + if (Main.tile[num, num2] == null) + { + flag = true; + } + else + { + if (Main.tile[num - 3, num2] == null) + { + flag = true; + } + else + { + if (Main.tile[num + 3, num2] == null) + { + flag = true; + } + else + { + if (Main.tile[num, num2 - 3] == null) + { + flag = true; + } + else + { + if (Main.tile[num, num2 + 3] == null) + { + flag = true; + } + } + } + } + } + } + } + catch + { + flag = true; + } + if (flag) + { + return; + } + } + if (this.displayName == "") + { + this.displayName = this.name; + } + if (this.townNPC && Main.chrName[this.type] != "") + { + this.displayName = Main.chrName[this.type]; + } + this.lifeRegen = 0; + this.poisoned = false; + this.venom = false; + this.onFire = false; + this.midas = false; + this.ichor = false; + this.onFrostBurn = false; + this.onFire2 = false; + this.confused = false; + for (int j = 0; j < 5; j++) + { + if (this.buffType[j] > 0 && this.buffTime[j] > 0) + { + this.buffTime[j]--; + if (this.buffType[j] == 20) + { + this.poisoned = true; + } + if (this.buffType[j] == 70) + { + this.venom = true; + } + if (this.buffType[j] == 24) + { + this.onFire = true; + } + if (this.buffType[j] == 72) + { + this.midas = true; + } + if (this.buffType[j] == 69) + { + this.ichor = true; + } + if (this.buffType[j] == 31) + { + this.confused = true; + } + if (this.buffType[j] == 39) + { + this.onFire2 = true; + } + if (this.buffType[j] == 44) + { + this.onFrostBurn = true; + } + } + } + if (Main.netMode != 1) + { + for (int k = 0; k < 5; k++) + { + if (this.buffType[k] > 0 && this.buffTime[k] <= 0) + { + this.DelBuff(k); + if (Main.netMode == 2) + { + NetMessage.SendData(54, -1, -1, "", this.whoAmI, 0f, 0f, 0f, 0); + } + } + } + } + if (this.teleportTime > 0f) + { + if ((float)Main.rand.Next(100) <= 100f * this.teleportTime * 2f) + { + int num3 = Dust.NewDust(new Vector2((float)this.getRect().X, (float)this.getRect().Y), this.getRect().Width, this.getRect().Height, 159, 0f, 0f, 0, default(Color), 1f); + Main.dust[num3].scale = this.teleportTime * 1.5f; + Main.dust[num3].noGravity = true; + Main.dust[num3].velocity *= 1.1f; + } + this.teleportTime -= 0.005f; + } + if (this.type >= 254 && this.type <= 261) + { + float num4 = (float)Main.rand.Next(28, 42) * 0.005f; + num4 += (float)(270 - (int)Main.mouseTextColor) / 500f; + float num5 = 0.1f; + float num6 = 0.3f + num4 / 2f; + float num7 = 0.6f + num4; + float num8 = 0.35f; + num5 *= num8; + num6 *= num8; + num7 *= num8; + Lighting.addLight((int)this.center().X / 16, (int)this.center().Y / 16, num5, num6, num7); + } + if (!this.dontTakeDamage) + { + if (this.poisoned) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegen -= 4; + } + if (this.onFire) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegen -= 8; + } + if (this.onFrostBurn) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegen -= 12; + } + if (this.onFire2) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegen -= 12; + } + if (this.venom) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegen -= 12; + } + this.lifeRegenCount += this.lifeRegen; + while (this.lifeRegenCount >= 120) + { + this.lifeRegenCount -= 120; + if (this.life < this.lifeMax) + { + this.life++; + } + if (this.life > this.lifeMax) + { + this.life = this.lifeMax; + } + } + while (this.lifeRegenCount <= -120) + { + this.lifeRegenCount += 120; + int num9 = this.whoAmI; + if (this.realLife >= 0) + { + num9 = this.realLife; + } + Main.npc[num9].life--; + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 140, 40, 255), string.Concat(1), false, true); + if (Main.npc[num9].life <= 0) + { + Main.npc[num9].life = 1; + if (Main.netMode != 1) + { + Main.npc[num9].StrikeNPC(9999, 0f, 0, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(28, -1, -1, "", num9, 9999f, 0f, 0f, 0); + } + } + } + } + } + if (Main.netMode != 1 && Main.bloodMoon) + { + bool flag2 = false; + if (this.value == 0f) + { + flag2 = true; + } + if (this.type == 46) + { + this.Transform(47); + } + else + { + if (this.type == 55) + { + this.Transform(57); + } + else + { + if (this.type == 148 || this.type == 149) + { + this.Transform(168); + } + } + } + if (flag2) + { + this.value = 0f; + } + } + float num10 = 10f; + NPC.gravity = 0.3f; + if (this.type == 258) + { + NPC.gravity = 0.1f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + float num11 = (float)(Main.maxTilesX / 4200); + num11 *= num11; + float num12 = (float)((double)(this.position.Y / 16f - (60f + 10f * num11)) / (Main.worldSurface / 6.0)); + if ((double)num12 < 0.25) + { + num12 = 0.25f; + } + if (num12 > 1f) + { + num12 = 1f; + } + NPC.gravity *= num12; + if (this.wet) + { + if (this.honeyWet) + { + NPC.gravity = 0.1f; + num10 = 4f; + } + else + { + NPC.gravity = 0.2f; + num10 = 7f; + } + } + if (this.soundDelay > 0) + { + this.soundDelay--; + } + if (this.life <= 0) + { + this.active = false; + } + this.oldTarget = this.target; + this.oldDirection = this.direction; + this.oldDirectionY = this.directionY; + float num13 = 1f + Math.Abs(this.velocity.X) / 3f; + if (this.gfxOffY > 0f) + { + this.gfxOffY -= num13 * this.stepSpeed; + if (this.gfxOffY < 0f) + { + this.gfxOffY = 0f; + } + } + else + { + if (this.gfxOffY < 0f) + { + this.gfxOffY += num13 * this.stepSpeed; + if (this.gfxOffY > 0f) + { + this.gfxOffY = 0f; + } + } + } + if (this.gfxOffY > 16f) + { + this.gfxOffY = 16f; + } + if (this.gfxOffY < -16f) + { + this.gfxOffY = -16f; + } + this.AI(); + if (this.type == 44) + { + Lighting.addLight((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + 4f) / 16, 0.9f, 0.75f, 0.5f); + } + for (int l = 0; l < 256; l++) + { + if (this.immune[l] > 0) + { + this.immune[l]--; + } + } + if (!this.noGravity && !this.noTileCollide) + { + int num14 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num15 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (Main.tile[num14, num15] == null) + { + NPC.gravity = 0f; + this.velocity.X = 0f; + this.velocity.Y = 0f; + } + } + if (!this.noGravity) + { + this.velocity.Y = this.velocity.Y + NPC.gravity; + if (this.velocity.Y > num10) + { + this.velocity.Y = num10; + } + } + if ((double)this.velocity.X < 0.005 && (double)this.velocity.X > -0.005) + { + this.velocity.X = 0f; + } + if (Main.netMode != 1 && this.type != 37 && (this.friendly || this.type == 46 || this.type == 55 || this.type == 74 || this.type == 148 || this.type == 149 || this.type == 230 || this.type == 297 || this.type == 298 || this.type == 299 || this.type == 300)) + { + if (this.life < this.lifeMax) + { + this.friendlyRegen++; + if (this.friendlyRegen > 300) + { + this.friendlyRegen = 0; + this.life++; + this.netUpdate = true; + } + } + if (this.immune[255] == 0) + { + Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && !Main.npc[m].friendly && Main.npc[m].damage > 0) + { + Rectangle rectangle2 = new Rectangle((int)Main.npc[m].position.X, (int)Main.npc[m].position.Y, Main.npc[m].width, Main.npc[m].height); + if (rectangle.Intersects(rectangle2)) + { + int num16 = Main.npc[m].damage; + int num17 = 6; + int num18 = 1; + if (Main.npc[m].position.X + (float)(Main.npc[m].width / 2) > this.position.X + (float)(this.width / 2)) + { + num18 = -1; + } + Main.npc[i].StrikeNPC(num16, (float)num17, num18, false, false); + if (Main.netMode != 0) + { + NetMessage.SendData(28, -1, -1, "", i, (float)num16, (float)num17, (float)num18, 0); + } + this.netUpdate = true; + this.immune[255] = 30; + } + } + } + } + } + if (!this.noTileCollide) + { + Vector4 vector = Collision.WalkDownSlope(this.position, this.velocity, this.width, this.height, NPC.gravity); + this.position.X = vector.X; + this.position.Y = vector.Y; + this.velocity.X = vector.Z; + this.velocity.Y = vector.W; + bool flag3 = Collision.LavaCollision(this.position, this.width, this.height); + if (flag3) + { + this.lavaWet = true; + if (!this.lavaImmune && !this.dontTakeDamage && Main.netMode != 1 && this.immune[255] == 0) + { + this.AddBuff(24, 420, false); + this.immune[255] = 30; + this.StrikeNPC(50, 0f, 0, false, false); + if (Main.netMode == 2 && Main.netMode != 0) + { + NetMessage.SendData(28, -1, -1, "", this.whoAmI, 50f, 0f, 0f, 0); + } + } + } + bool flag4; + if (this.type == 72 || this.aiStyle == 21) + { + flag4 = false; + this.wetCount = 0; + flag3 = false; + } + else + { + flag4 = Collision.WetCollision(this.position, this.width, this.height); + if (Collision.honey) + { + this.honeyWet = true; + } + } + if (flag4) + { + if (this.onFire && !this.lavaWet && Main.netMode != 1) + { + for (int n = 0; n < 5; n++) + { + if (this.buffType[n] == 24) + { + this.DelBuff(n); + } + } + } + if (!this.wet && this.wetCount == 0) + { + this.wetCount = 10; + if (!flag3) + { + if (this.honeyWet) + { + for (int num19 = 0; num19 < 10; num19++) + { + int num20 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_F65_cp_0 = Main.dust[num20]; + expr_F65_cp_0.velocity.Y = expr_F65_cp_0.velocity.Y - 1f; + Dust expr_F83_cp_0 = Main.dust[num20]; + expr_F83_cp_0.velocity.X = expr_F83_cp_0.velocity.X * 2.5f; + Main.dust[num20].scale = 1.3f; + Main.dust[num20].alpha = 100; + Main.dust[num20].noGravity = true; + } + if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + for (int num21 = 0; num21 < 30; num21++) + { + int num22 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_10C8_cp_0 = Main.dust[num22]; + expr_10C8_cp_0.velocity.Y = expr_10C8_cp_0.velocity.Y - 4f; + Dust expr_10E6_cp_0 = Main.dust[num22]; + expr_10E6_cp_0.velocity.X = expr_10E6_cp_0.velocity.X * 2.5f; + Main.dust[num22].scale *= 0.8f; + Main.dust[num22].alpha = 100; + Main.dust[num22].noGravity = true; + } + if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 0); + } + } + } + else + { + for (int num23 = 0; num23 < 10; num23++) + { + int num24 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_122F_cp_0 = Main.dust[num24]; + expr_122F_cp_0.velocity.Y = expr_122F_cp_0.velocity.Y - 1.5f; + Dust expr_124D_cp_0 = Main.dust[num24]; + expr_124D_cp_0.velocity.X = expr_124D_cp_0.velocity.X * 2.5f; + Main.dust[num24].scale = 1.3f; + Main.dust[num24].alpha = 100; + Main.dust[num24].noGravity = true; + } + if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + } + this.wet = true; + } + else + { + if (this.wet) + { + this.velocity.X = this.velocity.X * 0.5f; + this.wet = false; + if (this.wetCount == 0) + { + this.wetCount = 10; + if (!this.lavaWet) + { + if (this.honeyWet) + { + for (int num25 = 0; num25 < 10; num25++) + { + int num26 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_13D6_cp_0 = Main.dust[num26]; + expr_13D6_cp_0.velocity.Y = expr_13D6_cp_0.velocity.Y - 1f; + Dust expr_13F4_cp_0 = Main.dust[num26]; + expr_13F4_cp_0.velocity.X = expr_13F4_cp_0.velocity.X * 2.5f; + Main.dust[num26].scale = 1.3f; + Main.dust[num26].alpha = 100; + Main.dust[num26].noGravity = true; + } + if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + for (int num27 = 0; num27 < 30; num27++) + { + int num28 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_1539_cp_0 = Main.dust[num28]; + expr_1539_cp_0.velocity.Y = expr_1539_cp_0.velocity.Y - 4f; + Dust expr_1557_cp_0 = Main.dust[num28]; + expr_1557_cp_0.velocity.X = expr_1557_cp_0.velocity.X * 2.5f; + Main.dust[num28].scale *= 0.8f; + Main.dust[num28].alpha = 100; + Main.dust[num28].noGravity = true; + } + if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 0); + } + } + } + else + { + for (int num29 = 0; num29 < 10; num29++) + { + int num30 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_1690_cp_0 = Main.dust[num30]; + expr_1690_cp_0.velocity.Y = expr_1690_cp_0.velocity.Y - 1.5f; + Dust expr_16AE_cp_0 = Main.dust[num30]; + expr_16AE_cp_0.velocity.X = expr_16AE_cp_0.velocity.X * 2.5f; + Main.dust[num30].scale = 1.3f; + Main.dust[num30].alpha = 100; + Main.dust[num30].noGravity = true; + } + if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + } + } + } + if (!this.wet) + { + this.lavaWet = false; + this.honeyWet = false; + } + if (this.wetCount > 0) + { + this.wetCount -= 1; + } + bool flag5 = false; + if (this.aiStyle == 10) + { + flag5 = true; + } + if (this.aiStyle == 14) + { + flag5 = true; + } + if (this.aiStyle == 3 && this.directionY == 1) + { + flag5 = true; + } + this.oldVelocity = this.velocity; + this.collideX = false; + this.collideY = false; + if (Main.netMode != 1) + { + if (this.type == 230 && this.wet) + { + int num31 = this.direction; + Vector2 vector2 = this.velocity; + this.Transform(55); + this.direction = num31; + this.velocity = vector2; + this.wet = true; + if (this.velocity.Y < 0f) + { + this.velocity.Y = 0f; + } + } + else + { + if (this.type == 55 && !this.wet && Main.raining) + { + int num32 = this.direction; + Vector2 vector3 = this.velocity; + this.Transform(230); + this.direction = num32; + this.velocity = vector3; + this.homeTileX = (int)(this.position.X / 16f) + 10 * this.direction; + } + } + } + Vector2 vector4 = this.position; + int num33 = this.width; + int num34 = this.height; + if (this.type == 243) + { + num34 = 90; + } + if (this.type == 290) + { + num34 = 40; + } + if (num34 != this.height) + { + vector4.Y += (float)(this.height - num34); + } + if (this.wet) + { + if (this.honeyWet) + { + Vector2 vector5 = this.velocity; + this.velocity = Collision.TileCollision(vector4, this.velocity, num33, num34, flag5, flag5); + if (Collision.up) + { + this.velocity.Y = 0.01f; + } + Vector2 value = this.velocity * 0.25f; + if (this.velocity.X != vector5.X) + { + value.X = this.velocity.X; + this.collideX = true; + } + if (this.velocity.Y != vector5.Y) + { + value.Y = this.velocity.Y; + this.collideY = true; + } + this.oldPosition = this.position; + this.position += value; + } + else + { + Vector2 vector6 = this.velocity; + this.velocity = Collision.TileCollision(vector4, this.velocity, num33, num34, flag5, flag5); + if (Collision.up) + { + this.velocity.Y = 0.01f; + } + Vector2 value2 = this.velocity * 0.5f; + if (this.velocity.X != vector6.X) + { + value2.X = this.velocity.X; + this.collideX = true; + } + if (this.velocity.Y != vector6.Y) + { + value2.Y = this.velocity.Y; + this.collideY = true; + } + this.oldPosition = this.position; + this.position += value2; + } + } + else + { + if (this.type == 72) + { + Vector2 vector7 = new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)); + int num35 = 12; + int num36 = 12; + vector7.X -= (float)(num35 / 2); + vector7.Y -= (float)(num36 / 2); + this.velocity = Collision.noSlopeCollision(vector4, this.velocity, num33, num34, true, true); + } + else + { + this.velocity = Collision.TileCollision(vector4, this.velocity, num33, num34, flag5, flag5); + } + if (Collision.up) + { + this.velocity.Y = 0.01f; + } + if (this.oldVelocity.X != this.velocity.X) + { + this.collideX = true; + } + if (this.oldVelocity.Y != this.velocity.Y) + { + this.collideY = true; + } + this.oldPosition = this.position; + this.position += this.velocity; + } + Vector4 vector8 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, NPC.gravity); + this.position.X = vector8.X; + this.position.Y = vector8.Y; + this.velocity.X = vector8.Z; + this.velocity.Y = vector8.W; + } + else + { + this.oldPosition = this.position; + this.position += this.velocity; + } + if (Main.netMode != 1 && !this.noTileCollide && this.lifeMax > 1 && Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 2) && (this.type == 46 || this.type == 148 || this.type == 149)) + { + this.ai[0] = 1f; + this.ai[1] = 400f; + this.ai[2] = 0f; + } + this.FindFrame(); + if (this.type == 120 || this.type == 137 || this.type == 138) + { + for (int num37 = this.oldPos.Length - 1; num37 > 0; num37--) + { + this.oldPos[num37] = this.oldPos[num37 - 1]; + Lighting.addLight((int)this.position.X / 16, (int)this.position.Y / 16, 0.3f, 0f, 0.2f); + } + this.oldPos[0] = this.position; + } + else + { + if (this.type == 94) + { + for (int num38 = this.oldPos.Length - 1; num38 > 0; num38--) + { + this.oldPos[num38] = this.oldPos[num38 - 1]; + } + this.oldPos[0] = this.position; + } + else + { + if (this.type == 125 || this.type == 126 || this.type == 127 || this.type == 128 || this.type == 129 || this.type == 130 || this.type == 131 || this.type == 139 || this.type == 140) + { + for (int num39 = this.oldPos.Length - 1; num39 > 0; num39--) + { + this.oldPos[num39] = this.oldPos[num39 - 1]; + } + this.oldPos[0] = this.position; + } + } + } + if (!this.active) + { + this.netUpdate = true; + } + if (Main.netMode == 2) + { + if (Main.npcStreamSpeed > 0 && !this.townNPC && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 1f) + { + this.netStream += 1; + if ((int)this.netStream > Main.npcStreamSpeed) + { + for (int num40 = 0; num40 < 255; num40++) + { + if (Main.player[num40].active) + { + float num41 = Math.Abs(this.center().X - Main.player[num40].center().X) + Math.Abs(this.center().Y - Main.player[num40].center().Y); + if (num41 < 250f) + { + byte[] expr_1FAE_cp_0 = this.streamPlayer; + int expr_1FAE_cp_1 = num40; + expr_1FAE_cp_0[expr_1FAE_cp_1] -= 8; + } + else + { + if (num41 < 500f) + { + byte[] expr_1FD4_cp_0 = this.streamPlayer; + int expr_1FD4_cp_1 = num40; + expr_1FD4_cp_0[expr_1FD4_cp_1] -= 4; + } + else + { + if (num41 < 1000f) + { + byte[] expr_1FFA_cp_0 = this.streamPlayer; + int expr_1FFA_cp_1 = num40; + expr_1FFA_cp_0[expr_1FFA_cp_1] -= 2; + } + else + { + if (num41 < 1500f) + { + byte[] expr_2020_cp_0 = this.streamPlayer; + int expr_2020_cp_1 = num40; + expr_2020_cp_0[expr_2020_cp_1] -= 1; + } + } + } + } + if (this.streamPlayer[num40] <= 0) + { + this.streamPlayer[num40] = 8; + NetMessage.SendData(23, num40, -1, "", i, 0f, 0f, 0f, 0); + } + } + } + } + } + if (this.townNPC) + { + this.netSpam = 0; + } + if (this.netUpdate2) + { + this.netUpdate = true; + } + if (!this.active) + { + this.netSpam = 0; + } + if (this.netUpdate) + { + if (this.netSpam <= 90) + { + this.netSpam += 30; + NetMessage.SendData(23, -1, -1, "", i, 0f, 0f, 0f, 0); + this.netUpdate2 = false; + } + else + { + this.netUpdate2 = true; + } + } + if (this.netSpam > 0) + { + this.netSpam--; + } + if (this.active && this.townNPC && NPC.TypeToNum(this.type) != -1) + { + if (this.homeless != this.oldHomeless || this.homeTileX != this.oldHomeTileX || this.homeTileY != this.oldHomeTileY) + { + int num42 = 0; + if (this.homeless) + { + num42 = 1; + } + NetMessage.SendData(60, -1, -1, "", i, (float)Main.npc[i].homeTileX, (float)Main.npc[i].homeTileY, (float)num42, 0); + } + this.oldHomeless = this.homeless; + this.oldHomeTileX = this.homeTileX; + this.oldHomeTileY = this.homeTileY; + } + } + this.CheckActive(); + this.netUpdate = false; + this.justHit = false; + } + } + public Color GetAlpha(Color newColor) + { + float num = (float)(255 - this.alpha) / 255f; + int num2 = (int)((float)newColor.R * num); + int num3 = (int)((float)newColor.G * num); + int num4 = (int)((float)newColor.B * num); + int num5 = (int)newColor.A - this.alpha; + if (this.type == 25 || this.type == 30 || this.type == 59 || this.type == 60) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 72) + { + num2 = (int)newColor.R; + num3 = (int)newColor.G; + num4 = (int)newColor.B; + } + else + { + if (this.type == 288) + { + return new Color(200, 200, 200, 0); + } + if (this.type == 289) + { + return new Color(250, 250, 250, 50); + } + if (this.type >= 254 && this.type <= 261) + { + num4 = 255; + if (num2 < 100) + { + num2 = 100; + } + if (num3 < 150) + { + num3 = 150; + } + } + else + { + if (this.type == 64 || this.type == 63 || this.type == 75 || this.type == 103) + { + num2 = (int)((double)newColor.R * 1.5); + num3 = (int)((double)newColor.G * 1.5); + num4 = (int)((double)newColor.B * 1.5); + if (num2 > 255) + { + num2 = 255; + } + if (num3 > 255) + { + num3 = 255; + } + if (num4 > 255) + { + num4 = 255; + } + } + } + } + if (num5 < 0) + { + num5 = 0; + } + if (num5 > 255) + { + num5 = 255; + } + return new Color(num2, num3, num4, num5); + } + public Color GetColor(Color newColor) + { + int num = (int)(this.color.R - (255 - newColor.R)); + int num2 = (int)(this.color.G - (255 - newColor.G)); + int num3 = (int)(this.color.B - (255 - newColor.B)); + int num4 = (int)(this.color.A - (255 - newColor.A)); + if (num < 0) + { + num = 0; + } + if (num > 255) + { + num = 255; + } + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + if (num3 < 0) + { + num3 = 0; + } + if (num3 > 255) + { + num3 = 255; + } + if (num4 < 0) + { + num4 = 0; + } + if (num4 > 255) + { + num4 = 255; + } + return new Color(num, num2, num3, num4); + } + public string GetChat() + { + Recipe.FindRecipes(); + bool flag = false; + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + bool flag7 = false; + bool flag8 = false; + bool flag9 = false; + bool flag10 = false; + bool flag11 = false; + bool flag12 = false; + bool flag13 = false; + bool flag14 = false; + bool flag15 = false; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active) + { + if (Main.npc[i].type == 17) + { + flag = true; + } + else + { + if (Main.npc[i].type == 18) + { + flag2 = true; + } + else + { + if (Main.npc[i].type == 19) + { + flag3 = true; + } + else + { + if (Main.npc[i].type == 20) + { + flag4 = true; + } + else + { + if (Main.npc[i].type == 37) + { + flag5 = true; + } + else + { + if (Main.npc[i].type == 38) + { + flag6 = true; + } + else + { + if (Main.npc[i].type == 124) + { + flag7 = true; + } + else + { + if (Main.npc[i].type == 107) + { + flag8 = true; + } + else + { + if (Main.npc[i].type == 54) + { + flag9 = true; + } + else + { + if (Main.npc[i].type == 160) + { + flag10 = true; + } + else + { + if (Main.npc[i].type == 178) + { + flag11 = true; + } + else + { + if (Main.npc[i].type == 229) + { + flag12 = true; + } + else + { + if (Main.npc[i].type == 209) + { + flag13 = true; + } + else + { + if (Main.npc[i].type == 208) + { + flag14 = true; + } + else + { + if (Main.npc[i].type == 2) + { + flag15 = true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + string result = ""; + if (this.type == 17) + { + if (!NPC.downedBoss1 && Main.rand.Next(3) == 0) + { + if (Main.player[Main.myPlayer].statLifeMax < 200) + { + result = Lang.dialog(1, false); + } + else + { + if (Main.player[Main.myPlayer].statDefense <= 10) + { + result = Lang.dialog(2, false); + } + else + { + result = Lang.dialog(3, false); + } + } + } + else + { + if (Main.dayTime) + { + if (Main.time < 16200.0) + { + int num = Main.rand.Next(3); + if (num == 0) + { + result = Lang.dialog(4, false); + } + else + { + if (num == 1) + { + result = Lang.dialog(5, false); + } + else + { + result = Lang.dialog(6, false); + } + } + } + else + { + if (Main.time > 37800.0) + { + int num2 = Main.rand.Next(3); + if (num2 == 0) + { + result = Lang.dialog(7, false); + } + else + { + if (num2 == 1) + { + result = Lang.dialog(8, false); + } + else + { + result = Lang.dialog(9, false); + } + } + } + else + { + int num3 = Main.rand.Next(3); + if (num3 == 0) + { + result = Lang.dialog(10, false); + } + else + { + if (num3 == 1) + { + result = Lang.dialog(11, false); + } + else + { + result = Lang.dialog(12, false); + } + } + } + } + } + else + { + if (Main.bloodMoon) + { + if (flag2 && flag7 && Main.rand.Next(3) == 0) + { + result = Lang.dialog(13, false); + } + else + { + int num4 = Main.rand.Next(4); + if (num4 == 0) + { + result = Lang.dialog(14, false); + } + else + { + if (num4 == 1) + { + result = Lang.dialog(15, false); + } + else + { + if (num4 == 2) + { + result = Lang.dialog(16, false); + } + else + { + result = Lang.dialog(17, false); + } + } + } + } + } + else + { + if (Main.time < 9720.0) + { + if (Main.rand.Next(2) == 0) + { + result = Lang.dialog(18, false); + } + else + { + result = Lang.dialog(19, false); + } + } + else + { + if (Main.time > 22680.0) + { + if (Main.rand.Next(2) == 0) + { + result = Lang.dialog(20, false); + } + else + { + result = Lang.dialog(21, false); + } + } + else + { + int num5 = Main.rand.Next(3); + if (num5 == 0) + { + result = Lang.dialog(22, false); + } + else + { + if (num5 == 1) + { + result = Lang.dialog(23, false); + } + else + { + result = Lang.dialog(24, false); + } + } + } + } + } + } + } + } + else + { + if (this.type == 18) + { + if (Main.bloodMoon) + { + if ((double)Main.player[Main.myPlayer].statLife < (double)Main.player[Main.myPlayer].statLifeMax * 0.66) + { + int num6 = Main.rand.Next(3); + if (num6 == 0) + { + result = Lang.dialog(25, false); + } + else + { + if (num6 == 1) + { + result = Lang.dialog(26, false); + } + else + { + result = Lang.dialog(27, false); + } + } + } + else + { + int num7 = Main.rand.Next(4); + if (num7 == 0) + { + result = Lang.dialog(28, false); + } + else + { + if (num7 == 1) + { + result = Lang.dialog(29, false); + } + else + { + if (num7 == 2) + { + result = Lang.dialog(30, false); + } + else + { + result = Lang.dialog(31, false); + } + } + } + } + } + else + { + if (Main.rand.Next(3) == 0 && !NPC.downedBoss3) + { + result = Lang.dialog(32, false); + } + else + { + if (flag6 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(33, false); + } + else + { + if (flag3 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(34, false); + } + else + { + if (flag15 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(35, false); + } + else + { + if ((double)Main.player[Main.myPlayer].statLife < (double)Main.player[Main.myPlayer].statLifeMax * 0.33) + { + int num8 = Main.rand.Next(5); + if (num8 == 0) + { + result = Lang.dialog(36, false); + } + else + { + if (num8 == 1) + { + result = Lang.dialog(37, false); + } + else + { + if (num8 == 2) + { + result = Lang.dialog(38, false); + } + else + { + if (num8 == 3) + { + result = Lang.dialog(39, false); + } + else + { + result = Lang.dialog(40, false); + } + } + } + } + } + else + { + if ((double)Main.player[Main.myPlayer].statLife < (double)Main.player[Main.myPlayer].statLifeMax * 0.66) + { + int num9 = Main.rand.Next(7); + if (num9 == 0) + { + result = Lang.dialog(41, false); + } + else + { + if (num9 == 1) + { + result = Lang.dialog(42, false); + } + else + { + if (num9 == 2) + { + result = Lang.dialog(43, false); + } + else + { + if (num9 == 3) + { + result = Lang.dialog(44, false); + } + else + { + if (num9 == 4) + { + result = Lang.dialog(45, false); + } + else + { + if (num9 == 5) + { + result = Lang.dialog(46, false); + } + else + { + result = Lang.dialog(47, false); + } + } + } + } + } + } + } + else + { + int num10 = Main.rand.Next(4); + if (num10 == 0) + { + result = Lang.dialog(48, false); + } + else + { + if (num10 == 1) + { + result = Lang.dialog(49, false); + } + else + { + if (num10 == 2) + { + result = Lang.dialog(50, false); + } + else + { + result = Lang.dialog(51, false); + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 19) + { + if (NPC.downedBoss3 && !Main.hardMode) + { + result = Lang.dialog(58, false); + } + else + { + if (flag2 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(59, false); + } + else + { + if (flag2 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(60, false); + } + else + { + if (flag4 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(61, false); + } + else + { + if (flag6 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(62, false); + } + else + { + if (flag6 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(63, false); + } + else + { + if (Main.bloodMoon) + { + if (Main.rand.Next(2) == 0) + { + result = Lang.dialog(64, false); + } + else + { + result = Lang.dialog(65, false); + } + } + else + { + int num11 = Main.rand.Next(3); + if (num11 == 0) + { + result = Lang.dialog(66, false); + } + else + { + if (num11 == 1) + { + result = Lang.dialog(67, false); + } + else + { + result = Lang.dialog(68, false); + } + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 20) + { + if (!NPC.downedBoss2 && Main.rand.Next(3) == 0) + { + result = Lang.dialog(69, false); + } + else + { + if (flag3 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(70, false); + } + else + { + if (flag && Main.rand.Next(6) == 0) + { + result = Lang.dialog(71, false); + } + else + { + if (flag5 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(72, false); + } + else + { + if (flag10 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(238, false); + } + else + { + if (Main.bloodMoon) + { + int num12 = Main.rand.Next(4); + if (num12 == 0) + { + result = Lang.dialog(73, false); + } + else + { + if (num12 == 1) + { + result = Lang.dialog(74, false); + } + else + { + if (num12 == 2) + { + result = Lang.dialog(75, false); + } + else + { + result = Lang.dialog(76, false); + } + } + } + } + else + { + int num13 = Main.rand.Next(5); + if (num13 == 0) + { + result = Lang.dialog(77, false); + } + else + { + if (num13 == 1) + { + result = Lang.dialog(78, false); + } + else + { + if (num13 == 2) + { + result = Lang.dialog(79, false); + } + else + { + if (num13 == 3) + { + result = Lang.dialog(80, false); + } + else + { + result = Lang.dialog(81, false); + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 37) + { + if (Main.dayTime) + { + int num14 = Main.rand.Next(3); + if (num14 == 0) + { + result = Lang.dialog(82, false); + } + else + { + if (num14 == 1) + { + result = Lang.dialog(83, false); + } + else + { + result = Lang.dialog(84, false); + } + } + } + else + { + if (Main.player[Main.myPlayer].statLifeMax < 300 || Main.player[Main.myPlayer].statDefense < 10) + { + int num15 = Main.rand.Next(4); + if (num15 == 0) + { + result = Lang.dialog(85, false); + } + else + { + if (num15 == 1) + { + result = Lang.dialog(86, false); + } + else + { + if (num15 == 2) + { + result = Lang.dialog(87, false); + } + else + { + result = Lang.dialog(88, false); + } + } + } + } + else + { + int num16 = Main.rand.Next(4); + if (num16 == 0) + { + result = Lang.dialog(89, false); + } + else + { + if (num16 == 1) + { + result = Lang.dialog(90, false); + } + else + { + if (num16 == 2) + { + result = Lang.dialog(91, false); + } + else + { + result = Lang.dialog(92, false); + } + } + } + } + } + } + else + { + if (this.type == 38) + { + if (!NPC.downedBoss2 && Main.rand.Next(3) == 0) + { + result = Lang.dialog(93, false); + } + if (Main.bloodMoon) + { + int num17 = Main.rand.Next(3); + if (num17 == 0) + { + result = Lang.dialog(94, false); + } + else + { + if (num17 == 1) + { + result = Lang.dialog(95, false); + } + else + { + result = Lang.dialog(96, false); + } + } + } + else + { + if (flag3 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(97, false); + } + else + { + if (flag3 && Main.rand.Next(5) == 0) + { + result = Lang.dialog(98, false); + } + else + { + if (flag2 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(99, false); + } + else + { + if (flag4 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(100, false); + } + else + { + if (!Main.dayTime) + { + int num18 = Main.rand.Next(4); + if (num18 == 0) + { + result = Lang.dialog(101, false); + } + else + { + if (num18 == 1) + { + result = Lang.dialog(102, false); + } + else + { + if (num18 == 2) + { + result = Lang.dialog(103, false); + } + else + { + result = Lang.dialog(104, false); + } + } + } + } + else + { + int num19 = Main.rand.Next(5); + if (num19 == 0) + { + result = Lang.dialog(105, false); + } + else + { + if (num19 == 1) + { + result = Lang.dialog(106, false); + } + else + { + if (num19 == 2) + { + result = Lang.dialog(107, false); + } + else + { + if (num19 == 3) + { + result = Lang.dialog(108, false); + } + else + { + result = Lang.dialog(109, false); + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 54) + { + if (!flag7 && Main.rand.Next(2) == 0) + { + result = Lang.dialog(110, false); + } + else + { + if (flag10 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(237, false); + } + else + { + if (Main.bloodMoon) + { + result = Lang.dialog(111, false); + } + else + { + if (flag2 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(112, false); + } + else + { + if (Main.player[Main.myPlayer].head == 24) + { + result = Lang.dialog(113, false); + } + else + { + int num20 = Main.rand.Next(6); + if (num20 == 0) + { + result = Lang.dialog(114, false); + } + else + { + if (num20 == 1) + { + result = Lang.dialog(115, false); + } + else + { + if (num20 == 2) + { + result = Lang.dialog(116, false); + } + else + { + if (num20 == 3) + { + result = Lang.dialog(117, false); + } + else + { + if (num20 == 4) + { + result = Lang.dialog(118, false); + } + else + { + result = Lang.dialog(119, false); + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 105) + { + result = Lang.dialog(120, false); + } + else + { + if (this.type == 107) + { + if (this.homeless) + { + int num21 = Main.rand.Next(5); + if (num21 == 0) + { + result = Lang.dialog(121, false); + } + else + { + if (num21 == 1) + { + result = Lang.dialog(122, false); + } + else + { + if (num21 == 2) + { + result = Lang.dialog(123, false); + } + else + { + if (num21 == 3) + { + result = Lang.dialog(124, false); + } + else + { + result = Lang.dialog(125, false); + } + } + } + } + } + else + { + if (flag7 && Main.rand.Next(4) == 0) + { + result = Lang.dialog(126, false); + } + else + { + if (!Main.dayTime) + { + int num22 = Main.rand.Next(5); + if (num22 == 0) + { + result = Lang.dialog(127, false); + } + else + { + if (num22 == 1) + { + result = Lang.dialog(128, false); + } + else + { + if (num22 == 2) + { + result = Lang.dialog(129, false); + } + else + { + if (num22 == 3) + { + result = Lang.dialog(130, false); + } + else + { + result = Lang.dialog(131, false); + } + } + } + } + } + else + { + int num23 = Main.rand.Next(5); + if (num23 == 0) + { + result = Lang.dialog(132, false); + } + else + { + if (num23 == 1) + { + result = Lang.dialog(133, false); + } + else + { + if (num23 == 2) + { + result = Lang.dialog(134, false); + } + else + { + if (num23 == 3) + { + result = Lang.dialog(135, false); + } + else + { + result = Lang.dialog(136, false); + } + } + } + } + } + } + } + } + else + { + if (this.type == 106) + { + result = Lang.dialog(137, false); + } + else + { + if (this.type == 108) + { + if (this.homeless) + { + int num24 = Main.rand.Next(3); + if (num24 == 0) + { + result = Lang.dialog(138, false); + } + else + { + if (num24 == 1 && !Main.player[Main.myPlayer].male) + { + result = Lang.dialog(139, false); + } + else + { + if (num24 == 1) + { + result = Lang.dialog(140, false); + } + else + { + if (num24 == 2) + { + result = Lang.dialog(141, false); + } + } + } + } + } + else + { + if (Main.player[Main.myPlayer].male && flag15 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(142, false); + } + else + { + if (Main.player[Main.myPlayer].male && flag6 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(143, false); + } + else + { + if (Main.player[Main.myPlayer].male && flag8 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(144, false); + } + else + { + if (!Main.player[Main.myPlayer].male && flag2 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(145, false); + } + else + { + if (!Main.player[Main.myPlayer].male && flag7 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(146, false); + } + else + { + if (!Main.player[Main.myPlayer].male && flag4 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(147, false); + } + else + { + if (!Main.dayTime) + { + int num25 = Main.rand.Next(3); + if (num25 == 0) + { + result = Lang.dialog(148, false); + } + else + { + if (num25 == 1) + { + result = Lang.dialog(149, false); + } + else + { + if (num25 == 2) + { + result = Lang.dialog(150, false); + } + } + } + } + else + { + int num26 = Main.rand.Next(5); + if (num26 == 0) + { + result = Lang.dialog(151, false); + } + else + { + if (num26 == 1) + { + result = Lang.dialog(152, false); + } + else + { + if (num26 == 2) + { + result = Lang.dialog(153, false); + } + else + { + if (num26 == 3) + { + result = Lang.dialog(154, false); + } + else + { + result = Lang.dialog(155, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 123) + { + result = Lang.dialog(156, false); + } + else + { + if (this.type == 124) + { + if (this.homeless) + { + int num27 = Main.rand.Next(4); + if (num27 == 0) + { + result = Lang.dialog(157, false); + } + else + { + if (num27 == 1) + { + result = Lang.dialog(158, false); + } + else + { + if (num27 == 2) + { + result = Lang.dialog(159, false); + } + else + { + result = Lang.dialog(160, false); + } + } + } + } + else + { + if (Main.bloodMoon) + { + int num28 = Main.rand.Next(4); + if (num28 == 0) + { + result = Lang.dialog(161, false); + } + else + { + if (num28 == 1) + { + result = Lang.dialog(162, false); + } + else + { + if (num28 == 2) + { + result = Lang.dialog(163, false); + } + else + { + result = Lang.dialog(164, false); + } + } + } + } + else + { + if (flag8 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(165, false); + } + else + { + if (flag3 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(166, false); + } + else + { + int num29 = Main.rand.Next(3); + if (num29 == 0) + { + result = Lang.dialog(167, false); + } + else + { + if (num29 == 1) + { + result = Lang.dialog(168, false); + } + else + { + result = Lang.dialog(169, false); + } + } + } + } + } + } + } + else + { + if (this.type == 22) + { + if (Main.bloodMoon) + { + int num30 = Main.rand.Next(3); + if (num30 == 0) + { + result = Lang.dialog(170, false); + } + else + { + if (num30 == 1) + { + result = Lang.dialog(171, false); + } + else + { + result = Lang.dialog(172, false); + } + } + } + else + { + if (!Main.dayTime) + { + result = Lang.dialog(173, false); + } + else + { + int num31 = Main.rand.Next(3); + if (num31 == 0) + { + result = Lang.dialog(174, false); + } + else + { + if (num31 == 1) + { + result = Lang.dialog(175, false); + } + else + { + result = Lang.dialog(176, false); + } + } + } + } + } + else + { + if (this.type == 142) + { + int num32 = Main.rand.Next(3); + if (num32 == 0) + { + result = Lang.dialog(224, false); + } + else + { + if (num32 == 1) + { + result = Lang.dialog(225, false); + } + else + { + if (num32 == 2) + { + result = Lang.dialog(226, false); + } + } + } + } + else + { + if (this.type == 160) + { + int num33 = Main.rand.Next(6); + if (flag4 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(232, false); + } + else + { + if (flag9 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(236, false); + } + else + { + if (num33 == 0) + { + result = Lang.dialog(231, false); + } + else + { + if (num33 == 1) + { + result = Lang.dialog(233, false); + } + else + { + if (num33 == 2) + { + result = Lang.dialog(234, false); + } + else + { + if (num33 == 3) + { + result = Lang.dialog(235, false); + } + else + { + if (num33 == 4) + { + result = Lang.dialog(240, false); + } + else + { + if (num33 == 5) + { + result = Lang.dialog(241, false); + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 178) + { + int num34 = Main.rand.Next(5); + if (Main.bloodMoon && Main.rand.Next(3) == 0) + { + result = Lang.dialog(245, false); + } + else + { + if (flag13 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(246, false); + } + else + { + if (flag12 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(247, false); + } + else + { + if (num34 == 0) + { + result = Lang.dialog(242, false); + } + else + { + if (num34 == 1) + { + result = Lang.dialog(243, false); + } + else + { + if (num34 == 2) + { + result = Lang.dialog(244, false); + } + else + { + if (num34 == 3) + { + result = Lang.dialog(248, false); + } + else + { + if (num34 == 4) + { + result = Lang.dialog(249, false); + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 207) + { + int num35 = Main.rand.Next(3); + if (flag12 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(260, false); + } + else + { + if (num35 == 0) + { + result = Lang.dialog(257, false); + } + else + { + if (num35 == 1) + { + result = Lang.dialog(258, false); + } + else + { + if (num35 == 2) + { + result = Lang.dialog(259, false); + } + } + } + } + } + else + { + if (this.type == 208) + { + int num36 = Main.rand.Next(7); + if (Main.player[Main.myPlayer].male && Main.rand.Next(5) == 0) + { + result = Lang.dialog(268, false); + } + else + { + if (num36 == 0) + { + result = Lang.dialog(265, false); + } + else + { + if (num36 == 1) + { + result = Lang.dialog(266, false); + } + else + { + if (num36 == 2) + { + result = Lang.dialog(267, false); + } + else + { + if (num36 == 3) + { + result = Lang.dialog(269, false); + } + else + { + if (num36 == 4) + { + result = Lang.dialog(270, false); + } + else + { + if (num36 == 5) + { + result = Lang.dialog(271, false); + } + else + { + if (num36 == 6) + { + result = Lang.dialog(272, false); + } + } + } + } + } + } + } + } + } + else + { + if (this.type == 209) + { + int num37 = Main.rand.Next(5); + if (flag12 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(284, false); + } + else + { + if (flag11 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(283, false); + } + else + { + if (num37 == 0) + { + result = Lang.dialog(280, false); + } + else + { + if (num37 == 1) + { + result = Lang.dialog(281, false); + } + else + { + if (num37 == 2) + { + result = Lang.dialog(282, false); + } + else + { + if (num37 == 3) + { + result = Lang.dialog(285, false); + } + else + { + if (num37 == 4) + { + result = Lang.dialog(286, false); + } + } + } + } + } + } + } + } + else + { + if (this.type == 227) + { + int num38 = Main.rand.Next(5); + if (Main.hardMode && Main.rand.Next(7) == 0) + { + result = Lang.dialog(250, false); + } + else + { + if (flag14 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(251, false); + } + else + { + if (num38 == 0) + { + result = Lang.dialog(252, false); + } + else + { + if (num38 == 1) + { + result = Lang.dialog(253, false); + } + else + { + if (num38 == 2) + { + result = Lang.dialog(254, false); + } + else + { + if (num38 == 3) + { + result = Lang.dialog(255, false); + } + else + { + if (num38 == 4) + { + result = Lang.dialog(256, false); + } + } + } + } + } + } + } + } + else + { + if (this.type == 228) + { + int num39 = Main.rand.Next(3); + if (flag2 && Main.rand.Next(6) == 0) + { + result = Lang.dialog(263, false); + } + else + { + if (num39 == 0) + { + result = Lang.dialog(261, false); + } + else + { + if (num39 == 1) + { + result = Lang.dialog(262, false); + } + else + { + if (num39 == 2) + { + result = Lang.dialog(264, false); + } + } + } + } + } + else + { + if (this.type == 229) + { + int num40 = Main.rand.Next(6); + if (!Main.player[Main.myPlayer].male && Main.rand.Next(5) == 0) + { + result = Lang.dialog(276, false); + } + else + { + if (num40 == 0) + { + result = Lang.dialog(273, false); + } + else + { + if (num40 == 1) + { + result = Lang.dialog(274, false); + } + else + { + if (num40 == 2) + { + result = Lang.dialog(275, false); + } + else + { + if (num40 == 3) + { + result = Lang.dialog(277, false); + } + else + { + if (num40 == 4) + { + result = Lang.dialog(278, false); + } + else + { + if (num40 == 5) + { + result = Lang.dialog(279, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return result; + } + public object Clone() + { + return base.MemberwiseClone(); + } + } +} diff --git a/Terraria/NetMessage.cs b/Terraria/NetMessage.cs new file mode 100644 index 0000000..167c30d --- /dev/null +++ b/Terraria/NetMessage.cs @@ -0,0 +1,2531 @@ +using Microsoft.Xna.Framework; +using System; +using System.Text; +namespace Terraria +{ + public class NetMessage + { + public static messageBuffer[] buffer = new messageBuffer[257]; + public static void SendData(int msgType, int remoteClient = -1, int ignoreClient = -1, string text = "", int number = 0, float number2 = 0f, float number3 = 0f, float number4 = 0f, int number5 = 0) + { + if (Main.netMode == 0) + { + return; + } + int num = 256; + if (Main.netMode == 2 && remoteClient >= 0) + { + num = remoteClient; + } + lock (NetMessage.buffer[num]) + { + int num2 = 5; + int num3 = num2; + if (msgType == 1) + { + byte[] bytes = BitConverter.GetBytes(msgType); + byte[] bytes2 = Encoding.UTF8.GetBytes("Terraria" + Main.curRelease); + num2 += bytes2.Length; + byte[] bytes3 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes3, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes2, 0, NetMessage.buffer[num].writeBuffer, 5, bytes2.Length); + } + else + { + if (msgType == 2) + { + byte[] bytes4 = BitConverter.GetBytes(msgType); + byte[] bytes5 = Encoding.UTF8.GetBytes(text); + num2 += bytes5.Length; + byte[] bytes6 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes6, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes4, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes5, 0, NetMessage.buffer[num].writeBuffer, 5, bytes5.Length); + if (Main.dedServ) + { + Console.WriteLine(Netplay.serverSock[num].tcpClient.Client.RemoteEndPoint.ToString() + " was booted: " + text); + } + } + else + { + if (msgType == 3) + { + byte[] bytes7 = BitConverter.GetBytes(msgType); + byte[] bytes8 = BitConverter.GetBytes(remoteClient); + num2 += bytes8.Length; + byte[] bytes9 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes9, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes7, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes8, 0, NetMessage.buffer[num].writeBuffer, 5, bytes8.Length); + } + else + { + if (msgType == 4) + { + byte[] bytes10 = BitConverter.GetBytes(msgType); + byte b = (byte)number; + byte b2 = (byte)Main.player[(int)b].hair; + byte b3 = 0; + if (Main.player[(int)b].male) + { + b3 = 1; + } + byte[] bytes11 = Encoding.UTF8.GetBytes(text); + num2 += 24 + bytes11.Length + 1; + byte[] bytes12 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes12, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes10, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b; + num3++; + NetMessage.buffer[num].writeBuffer[6] = b2; + num3++; + NetMessage.buffer[num].writeBuffer[7] = b3; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].hairColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].hairColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].hairColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].skinColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].skinColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].skinColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].eyeColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].eyeColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].eyeColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].shirtColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].shirtColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].shirtColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].underShirtColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].underShirtColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].underShirtColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].pantsColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].pantsColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].pantsColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].shoeColor.R; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].shoeColor.G; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].shoeColor.B; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = Main.player[(int)b].difficulty; + num3++; + Buffer.BlockCopy(bytes11, 0, NetMessage.buffer[num].writeBuffer, num3, bytes11.Length); + } + else + { + if (msgType == 5) + { + byte[] bytes13 = BitConverter.GetBytes(msgType); + byte b4 = (byte)number; + byte b5 = (byte)number2; + short num4; + byte[] bytes14; + if (number2 < 59f) + { + if (Main.player[number].inventory[(int)number2].name == "" || Main.player[number].inventory[(int)number2].stack == 0 || Main.player[number].inventory[(int)number2].type == 0) + { + Main.player[number].inventory[(int)number2].netID = 0; + } + num4 = (short)Main.player[number].inventory[(int)number2].stack; + bytes14 = BitConverter.GetBytes((short)Main.player[number].inventory[(int)number2].netID); + } + else + { + if (number2 >= 70f && number2 <= 72f) + { + int num5 = (int)number2 - 58 - 12; + if (Main.player[number].dye[num5].name == "" || Main.player[number].dye[num5].stack == 0 || Main.player[number].dye[num5].type == 0) + { + Main.player[number].dye[num5].SetDefaults(0, false); + } + num4 = (short)Main.player[number].dye[num5].stack; + bytes14 = BitConverter.GetBytes((short)Main.player[number].dye[num5].netID); + } + else + { + if (Main.player[number].armor[(int)number2 - 58 - 1].name == "" || Main.player[number].armor[(int)number2 - 58 - 1].stack == 0 || Main.player[number].armor[(int)number2 - 58 - 1].type == 0) + { + Main.player[number].armor[(int)number2 - 58 - 1].SetDefaults(0, false); + } + num4 = (short)Main.player[number].armor[(int)number2 - 58 - 1].stack; + bytes14 = BitConverter.GetBytes((short)Main.player[number].armor[(int)number2 - 58 - 1].netID); + } + } + if (num4 < 0) + { + num4 = 0; + } + byte[] bytes15 = BitConverter.GetBytes(num4); + byte b6 = (byte)number3; + num2 += 4 + bytes14.Length + 1; + byte[] bytes16 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes16, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes13, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b4; + num3++; + NetMessage.buffer[num].writeBuffer[6] = b5; + num3++; + Buffer.BlockCopy(bytes15, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + NetMessage.buffer[num].writeBuffer[9] = b6; + num3++; + Buffer.BlockCopy(bytes14, 0, NetMessage.buffer[num].writeBuffer, num3, bytes14.Length); + } + else + { + if (msgType == 6) + { + byte[] bytes17 = BitConverter.GetBytes(msgType); + byte[] bytes18 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes18, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes17, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + } + else + { + if (msgType == 7) + { + byte[] bytes19 = BitConverter.GetBytes(msgType); + byte[] bytes20 = BitConverter.GetBytes((int)Main.time); + byte b7 = 0; + if (Main.dayTime) + { + b7 = 1; + } + byte b8 = (byte)Main.moonPhase; + byte b9 = 0; + if (Main.bloodMoon) + { + b9 = 1; + } + byte b10 = 0; + if (Main.eclipse) + { + b10 = 1; + } + byte[] bytes21 = BitConverter.GetBytes(Main.maxTilesX); + byte[] bytes22 = BitConverter.GetBytes(Main.maxTilesY); + byte[] bytes23 = BitConverter.GetBytes(Main.spawnTileX); + byte[] bytes24 = BitConverter.GetBytes(Main.spawnTileY); + byte[] bytes25 = BitConverter.GetBytes((int)Main.worldSurface); + byte[] bytes26 = BitConverter.GetBytes((int)Main.rockLayer); + byte[] bytes27 = BitConverter.GetBytes(Main.worldID); + byte[] bytes28 = Encoding.UTF8.GetBytes(Main.worldName); + byte b11 = 0; + byte b12 = 0; + byte b13 = (byte)WorldGen.treeBG; + byte b14 = (byte)WorldGen.corruptBG; + byte b15 = (byte)WorldGen.jungleBG; + byte b16 = (byte)WorldGen.snowBG; + byte b17 = (byte)WorldGen.hallowBG; + byte b18 = (byte)WorldGen.crimsonBG; + byte b19 = (byte)WorldGen.desertBG; + byte b20 = (byte)WorldGen.oceanBG; + byte[] bytes29 = BitConverter.GetBytes(Main.windSpeedSet); + byte b21 = (byte)Main.numClouds; + byte[] bytes30 = BitConverter.GetBytes(Main.treeX[0]); + byte[] bytes31 = BitConverter.GetBytes(Main.treeX[1]); + byte[] bytes32 = BitConverter.GetBytes(Main.treeX[2]); + byte b22 = (byte)Main.treeStyle[0]; + byte b23 = (byte)Main.treeStyle[1]; + byte b24 = (byte)Main.treeStyle[2]; + byte b25 = (byte)Main.treeStyle[3]; + byte[] bytes33 = BitConverter.GetBytes(Main.caveBackX[0]); + byte[] bytes34 = BitConverter.GetBytes(Main.caveBackX[1]); + byte[] bytes35 = BitConverter.GetBytes(Main.caveBackX[2]); + byte b26 = (byte)Main.caveBackStyle[0]; + byte b27 = (byte)Main.caveBackStyle[1]; + byte b28 = (byte)Main.caveBackStyle[2]; + byte b29 = (byte)Main.caveBackStyle[3]; + if (!Main.raining) + { + Main.maxRaining = 0f; + } + byte[] bytes36 = BitConverter.GetBytes(Main.maxRaining); + if (WorldGen.shadowOrbSmashed) + { + b11 += 1; + } + if (NPC.downedBoss1) + { + b11 += 2; + } + if (NPC.downedBoss2) + { + b11 += 4; + } + if (NPC.downedBoss3) + { + b11 += 8; + } + if (Main.hardMode) + { + b11 += 16; + } + if (NPC.downedClown) + { + b11 += 32; + } + if (NPC.downedPlantBoss) + { + b11 += 128; + } + if (NPC.downedMechBoss1) + { + b12 += 1; + } + if (NPC.downedMechBoss2) + { + b12 += 2; + } + if (NPC.downedMechBoss3) + { + b12 += 4; + } + if (NPC.downedMechBossAny) + { + b12 += 8; + } + if (Main.cloudBGActive >= 1f) + { + b12 += 16; + } + if (WorldGen.crimson) + { + b12 += 32; + } + num2 += bytes20.Length + 1 + 1 + 1 + 1 + 1 + bytes21.Length + bytes22.Length + bytes23.Length + bytes24.Length + bytes25.Length + bytes26.Length + bytes27.Length + 1 + bytes28.Length + 12 + 4 + 1 + 3 + 5 + 12 + 4 + 3 + 4 + 1 + 1; + num2 += 3; + byte[] bytes37 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes37, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes19, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes20, 0, NetMessage.buffer[num].writeBuffer, 5, bytes20.Length); + num3 += bytes20.Length; + NetMessage.buffer[num].writeBuffer[num3] = b7; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b8; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b9; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b10; + num3++; + Buffer.BlockCopy(bytes21, 0, NetMessage.buffer[num].writeBuffer, num3, bytes21.Length); + num3 += bytes21.Length; + Buffer.BlockCopy(bytes22, 0, NetMessage.buffer[num].writeBuffer, num3, bytes22.Length); + num3 += bytes22.Length; + Buffer.BlockCopy(bytes23, 0, NetMessage.buffer[num].writeBuffer, num3, bytes23.Length); + num3 += bytes23.Length; + Buffer.BlockCopy(bytes24, 0, NetMessage.buffer[num].writeBuffer, num3, bytes24.Length); + num3 += bytes24.Length; + Buffer.BlockCopy(bytes25, 0, NetMessage.buffer[num].writeBuffer, num3, bytes25.Length); + num3 += bytes25.Length; + Buffer.BlockCopy(bytes26, 0, NetMessage.buffer[num].writeBuffer, num3, bytes26.Length); + num3 += bytes26.Length; + Buffer.BlockCopy(bytes27, 0, NetMessage.buffer[num].writeBuffer, num3, bytes27.Length); + num3 += bytes27.Length; + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.moonType; + num3++; + Buffer.BlockCopy(bytes30, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes31, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes32, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b22; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b23; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b24; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b25; + num3++; + Buffer.BlockCopy(bytes33, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes34, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes35, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b26; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b27; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b28; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b29; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b13; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b14; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b15; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b16; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b17; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b18; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b19; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b20; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.iceBackStyle; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.jungleBackStyle; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.hellBackStyle; + num3++; + Buffer.BlockCopy(bytes29, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b21; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b11; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b12; + num3++; + Buffer.BlockCopy(bytes36, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes28, 0, NetMessage.buffer[num].writeBuffer, num3, bytes28.Length); + num3 += bytes28.Length; + } + else + { + if (msgType == 8) + { + byte[] bytes38 = BitConverter.GetBytes(msgType); + byte[] bytes39 = BitConverter.GetBytes(number); + byte[] bytes40 = BitConverter.GetBytes((int)number2); + num2 += bytes39.Length + bytes40.Length; + byte[] bytes41 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes41, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes38, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes39, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes40, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + } + else + { + if (msgType == 9) + { + byte[] bytes42 = BitConverter.GetBytes(msgType); + byte[] bytes43 = BitConverter.GetBytes(number); + byte[] bytes44 = Encoding.UTF8.GetBytes(text); + num2 += bytes43.Length + bytes44.Length; + byte[] bytes45 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes45, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes42, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes43, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes44, 0, NetMessage.buffer[num].writeBuffer, num3, bytes44.Length); + } + else + { + if (msgType == 10) + { + short num6 = (short)number; + int num7 = (int)number2; + int num8 = (int)number3; + byte[] bytes46 = BitConverter.GetBytes(msgType); + Buffer.BlockCopy(bytes46, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + byte[] bytes47 = BitConverter.GetBytes(num6); + Buffer.BlockCopy(bytes47, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + byte[] bytes48 = BitConverter.GetBytes(num7); + Buffer.BlockCopy(bytes48, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + byte[] bytes49 = BitConverter.GetBytes(num8); + Buffer.BlockCopy(bytes49, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + for (int i = num7; i < num7 + (int)num6; i++) + { + byte b30 = 0; + byte b31 = 0; + byte b32 = 0; + byte b33 = 0; + if (Main.tile[i, num8].active()) + { + b30 += 1; + } + if (Main.tile[i, num8].wall > 0) + { + b30 += 4; + } + if (Main.tile[i, num8].liquid > 0) + { + b30 += 8; + } + if (Main.tile[i, num8].wire()) + { + b30 += 16; + } + if (Main.tile[i, num8].halfBrick()) + { + b30 += 32; + } + if (Main.tile[i, num8].actuator()) + { + b30 += 64; + } + if (Main.tile[i, num8].inActive()) + { + b30 += 128; + } + if (Main.tile[i, num8].wire2()) + { + b31 += 1; + } + if (Main.tile[i, num8].wire3()) + { + b31 += 2; + } + if ((Main.tile[i, num8].tileHeader3 & 16) == 16) + { + b31 += 16; + } + if ((Main.tile[i, num8].tileHeader3 & 32) == 32) + { + b31 += 32; + } + if (Main.tile[i, num8].active() && Main.tile[i, num8].color() > 0) + { + b31 += 4; + b32 = Main.tile[i, num8].color(); + } + if (Main.tile[i, num8].wall > 0 && Main.tile[i, num8].wallColor() > 0) + { + b31 += 8; + b33 = Main.tile[i, num8].wallColor(); + } + NetMessage.buffer[num].writeBuffer[num3] = b30; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b31; + num3++; + if (b32 > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = b32; + num3++; + } + if (b33 > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = b33; + num3++; + } + byte[] bytes50 = BitConverter.GetBytes(Main.tile[i, num8].frameX); + byte[] bytes51 = BitConverter.GetBytes(Main.tile[i, num8].frameY); + byte wall = Main.tile[i, num8].wall; + if (Main.tile[i, num8].active()) + { + NetMessage.buffer[num].writeBuffer[num3] = Main.tile[i, num8].type; + num3++; + if (Main.tileFrameImportant[(int)Main.tile[i, num8].type]) + { + Buffer.BlockCopy(bytes50, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + Buffer.BlockCopy(bytes51, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + } + } + if (wall > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = wall; + num3++; + } + if (Main.tile[i, num8].liquid > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = Main.tile[i, num8].liquid; + num3++; + byte b34 = Main.tile[i, num8].liquidType(); + NetMessage.buffer[num].writeBuffer[num3] = b34; + num3++; + } + short num9 = 1; + while (i + (int)num9 < num7 + (int)num6 && Main.tile[i, num8].isTheSameAs(Main.tile[i + (int)num9, num8])) + { + num9 += 1; + } + num9 -= 1; + byte[] bytes52 = BitConverter.GetBytes(num9); + Buffer.BlockCopy(bytes52, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + i += (int)num9; + } + byte[] bytes53 = BitConverter.GetBytes(num3 - 4); + Buffer.BlockCopy(bytes53, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + num2 = num3; + } + else + { + if (msgType == 11) + { + byte[] bytes54 = BitConverter.GetBytes(msgType); + byte[] bytes55 = BitConverter.GetBytes(number); + byte[] bytes56 = BitConverter.GetBytes((int)number2); + byte[] bytes57 = BitConverter.GetBytes((int)number3); + byte[] bytes58 = BitConverter.GetBytes((int)number4); + num2 += bytes55.Length + bytes56.Length + bytes57.Length + bytes58.Length; + byte[] bytes59 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes59, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes54, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes55, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes56, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes57, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes58, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + } + else + { + if (msgType == 12) + { + byte[] bytes60 = BitConverter.GetBytes(msgType); + byte b35 = (byte)number; + byte[] bytes61 = BitConverter.GetBytes(Main.player[(int)b35].SpawnX); + byte[] bytes62 = BitConverter.GetBytes(Main.player[(int)b35].SpawnY); + num2 += 1 + bytes61.Length + bytes62.Length; + byte[] bytes63 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes63, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes60, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b35; + num3++; + Buffer.BlockCopy(bytes61, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes62, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + } + else + { + if (msgType == 13) + { + byte[] bytes64 = BitConverter.GetBytes(msgType); + byte b36 = (byte)number; + byte b37 = 0; + if (Main.player[(int)b36].controlUp) + { + b37 += 1; + } + if (Main.player[(int)b36].controlDown) + { + b37 += 2; + } + if (Main.player[(int)b36].controlLeft) + { + b37 += 4; + } + if (Main.player[(int)b36].controlRight) + { + b37 += 8; + } + if (Main.player[(int)b36].controlJump) + { + b37 += 16; + } + if (Main.player[(int)b36].controlUseItem) + { + b37 += 32; + } + if (Main.player[(int)b36].direction == 1) + { + b37 += 64; + } + byte b38 = (byte)Main.player[(int)b36].selectedItem; + byte[] bytes65 = BitConverter.GetBytes(Main.player[number].position.X); + byte[] bytes66 = BitConverter.GetBytes(Main.player[number].position.Y); + byte[] bytes67 = BitConverter.GetBytes(Main.player[number].velocity.X); + byte[] bytes68 = BitConverter.GetBytes(Main.player[number].velocity.Y); + byte b39 = 0; + if (Main.player[(int)b36].pulley) + { + b39 += 1; + if (Main.player[(int)b36].pulleyDir == 2) + { + b39 += 2; + } + } + num2 += 3 + bytes65.Length + bytes66.Length + bytes67.Length + bytes68.Length + 1; + byte[] bytes69 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes69, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes64, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b36; + num3++; + NetMessage.buffer[num].writeBuffer[6] = b37; + num3++; + NetMessage.buffer[num].writeBuffer[7] = b38; + num3++; + Buffer.BlockCopy(bytes65, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes66, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes67, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes68, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b39; + num3++; + } + else + { + if (msgType == 14) + { + byte[] bytes70 = BitConverter.GetBytes(msgType); + byte b40 = (byte)number; + byte b41 = (byte)number2; + num2 += 2; + byte[] bytes71 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes71, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes70, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b40; + NetMessage.buffer[num].writeBuffer[6] = b41; + } + else + { + if (msgType == 15) + { + byte[] bytes72 = BitConverter.GetBytes(msgType); + byte[] bytes73 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes73, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes72, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + } + else + { + if (msgType == 16) + { + byte[] bytes74 = BitConverter.GetBytes(msgType); + byte b42 = (byte)number; + byte[] bytes75 = BitConverter.GetBytes((short)Main.player[(int)b42].statLife); + byte[] bytes76 = BitConverter.GetBytes((short)Main.player[(int)b42].statLifeMax); + num2 += 1 + bytes75.Length + bytes76.Length; + byte[] bytes77 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes77, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes74, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b42; + num3++; + Buffer.BlockCopy(bytes75, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + Buffer.BlockCopy(bytes76, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + } + else + { + if (msgType == 17) + { + byte[] bytes78 = BitConverter.GetBytes(msgType); + byte b43 = (byte)number; + byte[] bytes79 = BitConverter.GetBytes((int)number2); + byte[] bytes80 = BitConverter.GetBytes((int)number3); + byte b44 = (byte)number4; + num2 += 1 + bytes79.Length + bytes80.Length + 1 + 1; + byte[] bytes81 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes81, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes78, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b43; + num3++; + Buffer.BlockCopy(bytes79, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes80, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b44; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = (byte)number5; + } + else + { + if (msgType == 18) + { + byte[] bytes82 = BitConverter.GetBytes(msgType); + BitConverter.GetBytes((int)Main.time); + byte b45 = 0; + if (Main.dayTime) + { + b45 = 1; + } + byte[] bytes83 = BitConverter.GetBytes((int)Main.time); + byte[] bytes84 = BitConverter.GetBytes(Main.sunModY); + byte[] bytes85 = BitConverter.GetBytes(Main.moonModY); + num2 += 1 + bytes83.Length + bytes84.Length + bytes85.Length; + byte[] bytes86 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes86, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes82, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b45; + num3++; + Buffer.BlockCopy(bytes83, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes84, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + Buffer.BlockCopy(bytes85, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + } + else + { + if (msgType == 19) + { + byte[] bytes87 = BitConverter.GetBytes(msgType); + byte b46 = (byte)number; + byte[] bytes88 = BitConverter.GetBytes((int)number2); + byte[] bytes89 = BitConverter.GetBytes((int)number3); + byte b47 = 0; + if (number4 == 1f) + { + b47 = 1; + } + num2 += 1 + bytes88.Length + bytes89.Length + 1; + byte[] bytes90 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes90, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes87, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b46; + num3++; + Buffer.BlockCopy(bytes88, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes89, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b47; + } + else + { + if (msgType == 20) + { + short num10 = (short)number; + int num11 = (int)number2; + int num12 = (int)number3; + byte[] bytes91 = BitConverter.GetBytes(msgType); + Buffer.BlockCopy(bytes91, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + byte[] bytes92 = BitConverter.GetBytes(num10); + Buffer.BlockCopy(bytes92, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + byte[] bytes93 = BitConverter.GetBytes(num11); + Buffer.BlockCopy(bytes93, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + byte[] bytes94 = BitConverter.GetBytes(num12); + Buffer.BlockCopy(bytes94, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + for (int j = num11; j < num11 + (int)num10; j++) + { + for (int k = num12; k < num12 + (int)num10; k++) + { + byte b48 = 0; + byte b49 = 0; + byte b50 = 0; + byte b51 = 0; + if (Main.tile[j, k].active()) + { + b48 += 1; + } + if (Main.tile[j, k].wall > 0) + { + b48 += 4; + } + if (Main.tile[j, k].liquid > 0 && Main.netMode == 2) + { + b48 += 8; + } + if (Main.tile[j, k].wire()) + { + b48 += 16; + } + if (Main.tile[j, k].halfBrick()) + { + b48 += 32; + } + if (Main.tile[j, k].actuator()) + { + b48 += 64; + } + if (Main.tile[j, k].inActive()) + { + b48 += 128; + } + if (Main.tile[j, k].wire2()) + { + b49 += 1; + } + if (Main.tile[j, k].wire3()) + { + b49 += 2; + } + if ((Main.tile[j, k].tileHeader3 & 16) == 16) + { + b49 += 16; + } + if ((Main.tile[j, k].tileHeader3 & 32) == 32) + { + b49 += 32; + } + if (Main.tile[j, k].active() && Main.tile[j, k].color() > 0) + { + b49 += 4; + b50 = Main.tile[j, k].color(); + } + if (Main.tile[j, k].wall > 0 && Main.tile[j, k].wallColor() > 0) + { + b49 += 8; + b51 = Main.tile[j, k].wallColor(); + } + NetMessage.buffer[num].writeBuffer[num3] = b48; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b49; + num3++; + if (b50 > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = b50; + num3++; + } + if (b51 > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = b51; + num3++; + } + byte[] bytes95 = BitConverter.GetBytes(Main.tile[j, k].frameX); + byte[] bytes96 = BitConverter.GetBytes(Main.tile[j, k].frameY); + byte wall2 = Main.tile[j, k].wall; + if (Main.tile[j, k].active()) + { + NetMessage.buffer[num].writeBuffer[num3] = Main.tile[j, k].type; + num3++; + if (Main.tileFrameImportant[(int)Main.tile[j, k].type]) + { + Buffer.BlockCopy(bytes95, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + Buffer.BlockCopy(bytes96, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + } + } + if (wall2 > 0) + { + NetMessage.buffer[num].writeBuffer[num3] = wall2; + num3++; + } + if (Main.tile[j, k].liquid > 0 && Main.netMode == 2) + { + NetMessage.buffer[num].writeBuffer[num3] = Main.tile[j, k].liquid; + num3++; + byte b52 = Main.tile[j, k].liquidType(); + NetMessage.buffer[num].writeBuffer[num3] = b52; + num3++; + } + } + } + byte[] bytes97 = BitConverter.GetBytes(num3 - 4); + Buffer.BlockCopy(bytes97, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + num2 = num3; + } + else + { + if (msgType == 21) + { + byte[] bytes98 = BitConverter.GetBytes(msgType); + byte[] bytes99 = BitConverter.GetBytes((short)number); + byte[] bytes100 = BitConverter.GetBytes(Main.item[number].position.X); + byte[] bytes101 = BitConverter.GetBytes(Main.item[number].position.Y); + byte[] bytes102 = BitConverter.GetBytes(Main.item[number].velocity.X); + byte[] bytes103 = BitConverter.GetBytes(Main.item[number].velocity.Y); + byte[] bytes104 = BitConverter.GetBytes((short)Main.item[number].stack); + byte prefix = Main.item[number].prefix; + byte b53 = (byte)number2; + short value = 0; + if (Main.item[number].active && Main.item[number].stack > 0) + { + value = (short)Main.item[number].netID; + } + byte[] bytes105 = BitConverter.GetBytes(value); + num2 += bytes99.Length + bytes100.Length + bytes101.Length + bytes102.Length + bytes103.Length + 1 + bytes105.Length + 1 + 1 + 1; + byte[] bytes106 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes106, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes98, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes99, 0, NetMessage.buffer[num].writeBuffer, num3, bytes99.Length); + num3 += 2; + Buffer.BlockCopy(bytes100, 0, NetMessage.buffer[num].writeBuffer, num3, bytes100.Length); + num3 += 4; + Buffer.BlockCopy(bytes101, 0, NetMessage.buffer[num].writeBuffer, num3, bytes101.Length); + num3 += 4; + Buffer.BlockCopy(bytes102, 0, NetMessage.buffer[num].writeBuffer, num3, bytes102.Length); + num3 += 4; + Buffer.BlockCopy(bytes103, 0, NetMessage.buffer[num].writeBuffer, num3, bytes103.Length); + num3 += 4; + Buffer.BlockCopy(bytes104, 0, NetMessage.buffer[num].writeBuffer, num3, bytes104.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = prefix; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b53; + num3++; + Buffer.BlockCopy(bytes105, 0, NetMessage.buffer[num].writeBuffer, num3, bytes105.Length); + } + else + { + if (msgType == 22) + { + byte[] bytes107 = BitConverter.GetBytes(msgType); + byte[] bytes108 = BitConverter.GetBytes((short)number); + byte b54 = (byte)Main.item[number].owner; + num2 += bytes108.Length + 1; + byte[] bytes109 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes109, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes107, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes108, 0, NetMessage.buffer[num].writeBuffer, num3, bytes108.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b54; + } + else + { + if (msgType == 23) + { + byte[] bytes110 = BitConverter.GetBytes(msgType); + byte[] bytes111 = BitConverter.GetBytes((short)number); + byte[] bytes112 = BitConverter.GetBytes(Main.npc[number].position.X); + byte[] bytes113 = BitConverter.GetBytes(Main.npc[number].position.Y); + byte[] bytes114 = BitConverter.GetBytes(Main.npc[number].velocity.X); + byte[] bytes115 = BitConverter.GetBytes(Main.npc[number].velocity.Y); + byte b55 = (byte)Main.npc[number].target; + byte[] bytes116 = BitConverter.GetBytes(Main.npc[number].life); + if (!Main.npc[number].active) + { + bytes116 = BitConverter.GetBytes(0); + } + if (!Main.npc[number].active || Main.npc[number].life <= 0) + { + Main.npc[number].netSkip = 0; + } + if (Main.npc[number].name == null) + { + Main.npc[number].name = ""; + } + byte[] bytes117 = BitConverter.GetBytes((short)Main.npc[number].netID); + num2 += bytes111.Length + bytes112.Length + bytes113.Length + bytes114.Length + bytes115.Length + 1 + bytes116.Length + NPC.maxAI * 4 + bytes117.Length + 1 + 1; + byte[] bytes118 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes118, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes110, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes111, 0, NetMessage.buffer[num].writeBuffer, num3, bytes111.Length); + num3 += 2; + Buffer.BlockCopy(bytes112, 0, NetMessage.buffer[num].writeBuffer, num3, bytes112.Length); + num3 += 4; + Buffer.BlockCopy(bytes113, 0, NetMessage.buffer[num].writeBuffer, num3, bytes113.Length); + num3 += 4; + Buffer.BlockCopy(bytes114, 0, NetMessage.buffer[num].writeBuffer, num3, bytes114.Length); + num3 += 4; + Buffer.BlockCopy(bytes115, 0, NetMessage.buffer[num].writeBuffer, num3, bytes115.Length); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b55; + num3++; + byte b56 = 0; + if (Main.npc[number].direction > 0) + { + b56 += 1; + } + if (Main.npc[number].directionY > 0) + { + b56 += 2; + } + bool[] array = new bool[4]; + if (Main.npc[number].ai[3] != 0f) + { + b56 += 4; + array[3] = true; + } + if (Main.npc[number].ai[2] != 0f) + { + b56 += 8; + array[2] = true; + } + if (Main.npc[number].ai[1] != 0f) + { + b56 += 16; + array[1] = true; + } + if (Main.npc[number].ai[0] != 0f) + { + b56 += 32; + array[0] = true; + } + if (Main.npc[number].spriteDirection > 0) + { + b56 += 64; + } + NetMessage.buffer[num].writeBuffer[num3] = b56; + num3++; + Buffer.BlockCopy(bytes116, 0, NetMessage.buffer[num].writeBuffer, num3, bytes116.Length); + num3 += 4; + for (int l = 0; l < NPC.maxAI; l++) + { + if (array[l]) + { + byte[] bytes119 = BitConverter.GetBytes(Main.npc[number].ai[l]); + Buffer.BlockCopy(bytes119, 0, NetMessage.buffer[num].writeBuffer, num3, bytes119.Length); + num3 += 4; + } + } + Buffer.BlockCopy(bytes117, 0, NetMessage.buffer[num].writeBuffer, num3, bytes117.Length); + } + else + { + if (msgType == 24) + { + byte[] bytes120 = BitConverter.GetBytes(msgType); + byte[] bytes121 = BitConverter.GetBytes((short)number); + byte b57 = (byte)number2; + num2 += bytes121.Length + 1; + byte[] bytes122 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes122, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes120, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes121, 0, NetMessage.buffer[num].writeBuffer, num3, bytes121.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b57; + } + else + { + if (msgType == 25) + { + byte[] bytes123 = BitConverter.GetBytes(msgType); + byte b58 = (byte)number; + byte[] bytes124 = Encoding.UTF8.GetBytes(text); + byte b59 = (byte)number2; + byte b60 = (byte)number3; + byte b61 = (byte)number4; + num2 += 1 + bytes124.Length + 3; + byte[] bytes125 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes125, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes123, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b58; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b59; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b60; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b61; + num3++; + Buffer.BlockCopy(bytes124, 0, NetMessage.buffer[num].writeBuffer, num3, bytes124.Length); + } + else + { + if (msgType == 26) + { + byte[] bytes126 = BitConverter.GetBytes(msgType); + byte b62 = (byte)number; + byte b63 = (byte)(number2 + 1f); + byte[] bytes127 = BitConverter.GetBytes((short)number3); + byte[] bytes128 = Encoding.UTF8.GetBytes(text); + byte b64 = (byte)number4; + byte b65 = (byte)number5; + num2 += 2 + bytes127.Length + 1 + bytes128.Length + 1; + byte[] bytes129 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes129, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes126, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b62; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b63; + num3++; + Buffer.BlockCopy(bytes127, 0, NetMessage.buffer[num].writeBuffer, num3, bytes127.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b64; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b65; + num3++; + Buffer.BlockCopy(bytes128, 0, NetMessage.buffer[num].writeBuffer, num3, bytes128.Length); + } + else + { + if (msgType == 27) + { + byte[] bytes130 = BitConverter.GetBytes(msgType); + byte[] bytes131 = BitConverter.GetBytes((short)Main.projectile[number].identity); + byte[] bytes132 = BitConverter.GetBytes(Main.projectile[number].position.X); + byte[] bytes133 = BitConverter.GetBytes(Main.projectile[number].position.Y); + byte[] bytes134 = BitConverter.GetBytes(Main.projectile[number].velocity.X); + byte[] bytes135 = BitConverter.GetBytes(Main.projectile[number].velocity.Y); + byte[] bytes136 = BitConverter.GetBytes(Main.projectile[number].knockBack); + byte[] bytes137 = BitConverter.GetBytes((short)Main.projectile[number].damage); + byte[] bytes138 = BitConverter.GetBytes((short)Main.projectile[number].type); + Buffer.BlockCopy(bytes130, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes131, 0, NetMessage.buffer[num].writeBuffer, num3, bytes131.Length); + num3 += 2; + Buffer.BlockCopy(bytes132, 0, NetMessage.buffer[num].writeBuffer, num3, bytes132.Length); + num3 += 4; + Buffer.BlockCopy(bytes133, 0, NetMessage.buffer[num].writeBuffer, num3, bytes133.Length); + num3 += 4; + Buffer.BlockCopy(bytes134, 0, NetMessage.buffer[num].writeBuffer, num3, bytes134.Length); + num3 += 4; + Buffer.BlockCopy(bytes135, 0, NetMessage.buffer[num].writeBuffer, num3, bytes135.Length); + num3 += 4; + Buffer.BlockCopy(bytes136, 0, NetMessage.buffer[num].writeBuffer, num3, bytes136.Length); + num3 += 4; + Buffer.BlockCopy(bytes137, 0, NetMessage.buffer[num].writeBuffer, num3, bytes137.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.projectile[number].owner; + num3++; + Buffer.BlockCopy(bytes138, 0, NetMessage.buffer[num].writeBuffer, num3, bytes138.Length); + num3 += 2; + for (int m = 0; m < Projectile.maxAI; m++) + { + byte[] bytes139 = BitConverter.GetBytes(Main.projectile[number].ai[m]); + Buffer.BlockCopy(bytes139, 0, NetMessage.buffer[num].writeBuffer, num3, bytes139.Length); + num3 += 4; + } + num2 += num3; + byte[] bytes140 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes140, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + } + else + { + if (msgType == 28) + { + byte[] bytes141 = BitConverter.GetBytes(msgType); + byte[] bytes142 = BitConverter.GetBytes((short)number); + byte[] bytes143 = BitConverter.GetBytes((short)number2); + byte[] bytes144 = BitConverter.GetBytes(number3); + byte b66 = (byte)(number4 + 1f); + byte b67 = (byte)number5; + num2 += bytes142.Length + bytes143.Length + bytes144.Length + 1 + 1; + byte[] bytes145 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes145, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes141, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes142, 0, NetMessage.buffer[num].writeBuffer, num3, bytes142.Length); + num3 += 2; + Buffer.BlockCopy(bytes143, 0, NetMessage.buffer[num].writeBuffer, num3, bytes143.Length); + num3 += 2; + Buffer.BlockCopy(bytes144, 0, NetMessage.buffer[num].writeBuffer, num3, bytes144.Length); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = b66; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b67; + } + else + { + if (msgType == 29) + { + byte[] bytes146 = BitConverter.GetBytes(msgType); + byte[] bytes147 = BitConverter.GetBytes((short)number); + byte b68 = (byte)number2; + num2 += bytes147.Length + 1; + byte[] bytes148 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes148, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes146, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes147, 0, NetMessage.buffer[num].writeBuffer, num3, bytes147.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b68; + } + else + { + if (msgType == 30) + { + byte[] bytes149 = BitConverter.GetBytes(msgType); + byte b69 = (byte)number; + byte b70 = 0; + if (Main.player[(int)b69].hostile) + { + b70 = 1; + } + num2 += 2; + byte[] bytes150 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes150, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes149, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b69; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b70; + } + else + { + if (msgType == 31) + { + byte[] bytes151 = BitConverter.GetBytes(msgType); + byte[] bytes152 = BitConverter.GetBytes(number); + byte[] bytes153 = BitConverter.GetBytes((int)number2); + num2 += bytes152.Length + bytes153.Length; + byte[] bytes154 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes154, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes151, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes152, 0, NetMessage.buffer[num].writeBuffer, num3, bytes152.Length); + num3 += 4; + Buffer.BlockCopy(bytes153, 0, NetMessage.buffer[num].writeBuffer, num3, bytes153.Length); + } + else + { + if (msgType == 32) + { + byte[] bytes155 = BitConverter.GetBytes(msgType); + byte[] bytes156 = BitConverter.GetBytes((short)number); + byte b71 = (byte)number2; + byte[] bytes157 = BitConverter.GetBytes(Main.chest[number].item[(int)number2].stack); + byte prefix2 = Main.chest[number].item[(int)number2].prefix; + byte[] bytes158; + if (Main.chest[number].item[(int)number2].name == null) + { + bytes158 = BitConverter.GetBytes(0); + } + else + { + bytes158 = BitConverter.GetBytes((short)Main.chest[number].item[(int)number2].netID); + } + num2 += bytes156.Length + 1 + 1 + bytes157.Length + bytes158.Length; + byte[] bytes159 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes159, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes155, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes156, 0, NetMessage.buffer[num].writeBuffer, num3, bytes156.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b71; + num3++; + Buffer.BlockCopy(bytes157, 0, NetMessage.buffer[num].writeBuffer, num3, bytes157.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = prefix2; + num3++; + Buffer.BlockCopy(bytes158, 0, NetMessage.buffer[num].writeBuffer, num3, bytes158.Length); + } + else + { + if (msgType == 33) + { + byte[] bytes160 = BitConverter.GetBytes(msgType); + byte[] bytes161 = BitConverter.GetBytes((short)number); + byte[] bytes162; + byte[] bytes163; + if (number > -1) + { + bytes162 = BitConverter.GetBytes(Main.chest[number].x); + bytes163 = BitConverter.GetBytes(Main.chest[number].y); + } + else + { + bytes162 = BitConverter.GetBytes(0); + bytes163 = BitConverter.GetBytes(0); + } + num2 += bytes161.Length + bytes162.Length + bytes163.Length; + byte[] bytes164 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes164, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes160, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes161, 0, NetMessage.buffer[num].writeBuffer, num3, bytes161.Length); + num3 += 2; + Buffer.BlockCopy(bytes162, 0, NetMessage.buffer[num].writeBuffer, num3, bytes162.Length); + num3 += 4; + Buffer.BlockCopy(bytes163, 0, NetMessage.buffer[num].writeBuffer, num3, bytes163.Length); + } + else + { + if (msgType == 34) + { + byte[] bytes165 = BitConverter.GetBytes(msgType); + byte[] bytes166 = BitConverter.GetBytes(number); + byte[] bytes167 = BitConverter.GetBytes((int)number2); + num2 += bytes166.Length + bytes167.Length; + byte[] bytes168 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes168, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes165, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes166, 0, NetMessage.buffer[num].writeBuffer, num3, bytes166.Length); + num3 += 4; + Buffer.BlockCopy(bytes167, 0, NetMessage.buffer[num].writeBuffer, num3, bytes167.Length); + } + else + { + if (msgType == 35 || msgType == 66) + { + byte[] bytes169 = BitConverter.GetBytes(msgType); + byte b72 = (byte)number; + byte[] bytes170 = BitConverter.GetBytes((short)number2); + num2 += 1 + bytes170.Length; + byte[] bytes171 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes171, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes169, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b72; + num3++; + Buffer.BlockCopy(bytes170, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + } + else + { + if (msgType == 36) + { + byte[] bytes172 = BitConverter.GetBytes(msgType); + byte b73 = (byte)number; + byte b74 = 0; + if (Main.player[(int)b73].zoneEvil) + { + b74 += 1; + } + if (Main.player[(int)b73].zoneMeteor) + { + b74 += 2; + } + if (Main.player[(int)b73].zoneDungeon) + { + b74 += 4; + } + if (Main.player[(int)b73].zoneJungle) + { + b74 += 8; + } + if (Main.player[(int)b73].zoneHoly) + { + b74 += 16; + } + if (Main.player[(int)b73].zoneSnow) + { + b74 += 32; + } + if (Main.player[(int)b73].zoneBlood) + { + b74 += 64; + } + if (Main.player[(int)b73].zoneCandle) + { + b74 += 128; + } + num2 += 2; + byte[] bytes173 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes173, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes172, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b73; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b74; + num3++; + } + else + { + if (msgType == 37) + { + byte[] bytes174 = BitConverter.GetBytes(msgType); + byte[] bytes175 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes175, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes174, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + } + else + { + if (msgType == 38) + { + byte[] bytes176 = BitConverter.GetBytes(msgType); + byte[] bytes177 = Encoding.UTF8.GetBytes(text); + num2 += bytes177.Length; + byte[] bytes178 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes178, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes176, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes177, 0, NetMessage.buffer[num].writeBuffer, num3, bytes177.Length); + } + else + { + if (msgType == 39) + { + byte[] bytes179 = BitConverter.GetBytes(msgType); + byte[] bytes180 = BitConverter.GetBytes((short)number); + num2 += bytes180.Length; + byte[] bytes181 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes181, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes179, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes180, 0, NetMessage.buffer[num].writeBuffer, num3, bytes180.Length); + } + else + { + if (msgType == 40) + { + byte[] bytes182 = BitConverter.GetBytes(msgType); + byte b75 = (byte)number; + byte[] bytes183 = BitConverter.GetBytes((short)Main.player[(int)b75].talkNPC); + num2 += 1 + bytes183.Length; + byte[] bytes184 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes184, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes182, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b75; + num3++; + Buffer.BlockCopy(bytes183, 0, NetMessage.buffer[num].writeBuffer, num3, bytes183.Length); + num3 += 2; + } + else + { + if (msgType == 41) + { + byte[] bytes185 = BitConverter.GetBytes(msgType); + byte b76 = (byte)number; + byte[] bytes186 = BitConverter.GetBytes(Main.player[(int)b76].itemRotation); + byte[] bytes187 = BitConverter.GetBytes((short)Main.player[(int)b76].itemAnimation); + num2 += 1 + bytes186.Length + bytes187.Length; + byte[] bytes188 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes188, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes185, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b76; + num3++; + Buffer.BlockCopy(bytes186, 0, NetMessage.buffer[num].writeBuffer, num3, bytes186.Length); + num3 += 4; + Buffer.BlockCopy(bytes187, 0, NetMessage.buffer[num].writeBuffer, num3, bytes187.Length); + } + else + { + if (msgType == 42) + { + byte[] bytes189 = BitConverter.GetBytes(msgType); + byte b77 = (byte)number; + byte[] bytes190 = BitConverter.GetBytes((short)Main.player[(int)b77].statMana); + byte[] bytes191 = BitConverter.GetBytes((short)Main.player[(int)b77].statManaMax); + num2 += 1 + bytes190.Length + bytes191.Length; + byte[] bytes192 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes192, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes189, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b77; + num3++; + Buffer.BlockCopy(bytes190, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + num3 += 2; + Buffer.BlockCopy(bytes191, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + } + else + { + if (msgType == 43) + { + byte[] bytes193 = BitConverter.GetBytes(msgType); + byte b78 = (byte)number; + byte[] bytes194 = BitConverter.GetBytes((short)number2); + num2 += 1 + bytes194.Length; + byte[] bytes195 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes195, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes193, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b78; + num3++; + Buffer.BlockCopy(bytes194, 0, NetMessage.buffer[num].writeBuffer, num3, 2); + } + else + { + if (msgType == 44) + { + byte[] bytes196 = BitConverter.GetBytes(msgType); + byte b79 = (byte)number; + byte b80 = (byte)(number2 + 1f); + byte[] bytes197 = BitConverter.GetBytes((short)number3); + byte b81 = (byte)number4; + byte[] bytes198 = Encoding.UTF8.GetBytes(text); + num2 += 2 + bytes197.Length + 1 + bytes198.Length; + byte[] bytes199 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes199, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes196, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b79; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b80; + num3++; + Buffer.BlockCopy(bytes197, 0, NetMessage.buffer[num].writeBuffer, num3, bytes197.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b81; + num3++; + Buffer.BlockCopy(bytes198, 0, NetMessage.buffer[num].writeBuffer, num3, bytes198.Length); + num3 += bytes198.Length; + } + else + { + if (msgType == 45) + { + byte[] bytes200 = BitConverter.GetBytes(msgType); + byte b82 = (byte)number; + byte b83 = (byte)Main.player[(int)b82].team; + num2 += 2; + byte[] bytes201 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes201, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes200, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[5] = b82; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b83; + } + else + { + if (msgType == 46) + { + byte[] bytes202 = BitConverter.GetBytes(msgType); + byte[] bytes203 = BitConverter.GetBytes(number); + byte[] bytes204 = BitConverter.GetBytes((int)number2); + num2 += bytes203.Length + bytes204.Length; + byte[] bytes205 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes205, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes202, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes203, 0, NetMessage.buffer[num].writeBuffer, num3, bytes203.Length); + num3 += 4; + Buffer.BlockCopy(bytes204, 0, NetMessage.buffer[num].writeBuffer, num3, bytes204.Length); + } + else + { + if (msgType == 47) + { + byte[] bytes206 = BitConverter.GetBytes(msgType); + byte[] bytes207 = BitConverter.GetBytes((short)number); + byte[] bytes208 = BitConverter.GetBytes(Main.sign[number].x); + byte[] bytes209 = BitConverter.GetBytes(Main.sign[number].y); + byte[] bytes210 = Encoding.UTF8.GetBytes(Main.sign[number].text); + num2 += bytes207.Length + bytes208.Length + bytes209.Length + bytes210.Length; + byte[] bytes211 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes211, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes206, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes207, 0, NetMessage.buffer[num].writeBuffer, num3, bytes207.Length); + num3 += bytes207.Length; + Buffer.BlockCopy(bytes208, 0, NetMessage.buffer[num].writeBuffer, num3, bytes208.Length); + num3 += bytes208.Length; + Buffer.BlockCopy(bytes209, 0, NetMessage.buffer[num].writeBuffer, num3, bytes209.Length); + num3 += bytes209.Length; + Buffer.BlockCopy(bytes210, 0, NetMessage.buffer[num].writeBuffer, num3, bytes210.Length); + num3 += bytes210.Length; + } + else + { + if (msgType == 48) + { + byte[] bytes212 = BitConverter.GetBytes(msgType); + byte[] bytes213 = BitConverter.GetBytes(number); + byte[] bytes214 = BitConverter.GetBytes((int)number2); + byte liquid = Main.tile[number, (int)number2].liquid; + byte b84 = Main.tile[number, (int)number2].liquidType(); + num2 += bytes213.Length + bytes214.Length + 1 + 1; + byte[] bytes215 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes215, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes212, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes213, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes214, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + NetMessage.buffer[num].writeBuffer[num3] = liquid; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b84; + num3++; + } + else + { + if (msgType == 49) + { + byte[] bytes216 = BitConverter.GetBytes(msgType); + byte[] bytes217 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes217, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes216, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + } + else + { + if (msgType == 50) + { + byte[] bytes218 = BitConverter.GetBytes(msgType); + byte b85 = (byte)number; + num2 += 11; + byte[] bytes219 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes219, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes218, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b85; + num3++; + for (int n = 0; n < 10; n++) + { + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.player[(int)b85].buffType[n]; + num3++; + } + } + else + { + if (msgType == 51) + { + byte[] bytes220 = BitConverter.GetBytes(msgType); + num2 += 2; + byte b86 = (byte)number; + byte b87 = (byte)number2; + byte[] bytes221 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes221, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes220, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b86; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b87; + } + else + { + if (msgType == 52) + { + byte[] bytes222 = BitConverter.GetBytes(msgType); + byte b88 = (byte)number; + byte b89 = (byte)number2; + byte[] bytes223 = BitConverter.GetBytes((int)number3); + byte[] bytes224 = BitConverter.GetBytes((int)number4); + num2 += 2 + bytes223.Length + bytes224.Length; + byte[] bytes225 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes225, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes222, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b88; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b89; + num3++; + Buffer.BlockCopy(bytes223, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + Buffer.BlockCopy(bytes224, 0, NetMessage.buffer[num].writeBuffer, num3, 4); + num3 += 4; + } + else + { + if (msgType == 53) + { + byte[] bytes226 = BitConverter.GetBytes(msgType); + byte[] bytes227 = BitConverter.GetBytes((short)number); + byte b90 = (byte)number2; + byte[] bytes228 = BitConverter.GetBytes((short)number3); + num2 += bytes227.Length + 1 + bytes228.Length; + byte[] bytes229 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes229, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes226, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes227, 0, NetMessage.buffer[num].writeBuffer, num3, bytes227.Length); + num3 += bytes227.Length; + NetMessage.buffer[num].writeBuffer[num3] = b90; + num3++; + Buffer.BlockCopy(bytes228, 0, NetMessage.buffer[num].writeBuffer, num3, bytes228.Length); + num3 += bytes228.Length; + } + else + { + if (msgType == 54) + { + byte[] bytes230 = BitConverter.GetBytes(msgType); + byte[] bytes231 = BitConverter.GetBytes((short)number); + num2 += bytes231.Length + 15; + byte[] bytes232 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes232, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes230, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes231, 0, NetMessage.buffer[num].writeBuffer, num3, bytes231.Length); + num3 += bytes231.Length; + for (int num13 = 0; num13 < 5; num13++) + { + NetMessage.buffer[num].writeBuffer[num3] = (byte)Main.npc[(int)((short)number)].buffType[num13]; + num3++; + byte[] bytes233 = BitConverter.GetBytes(Main.npc[(int)((short)number)].buffTime[num13]); + Buffer.BlockCopy(bytes233, 0, NetMessage.buffer[num].writeBuffer, num3, bytes233.Length); + num3 += bytes233.Length; + } + } + else + { + if (msgType == 55) + { + byte[] bytes234 = BitConverter.GetBytes(msgType); + byte b91 = (byte)number; + byte b92 = (byte)number2; + byte[] bytes235 = BitConverter.GetBytes((short)number3); + num2 += 2 + bytes235.Length; + byte[] bytes236 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes236, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes234, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b91; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = b92; + num3++; + Buffer.BlockCopy(bytes235, 0, NetMessage.buffer[num].writeBuffer, num3, bytes235.Length); + num3 += bytes235.Length; + } + else + { + if (msgType == 56) + { + byte[] bytes237 = BitConverter.GetBytes(msgType); + byte[] bytes238 = BitConverter.GetBytes((short)number); + byte[] bytes239 = Encoding.UTF8.GetBytes(Main.chrName[number]); + num2 += bytes238.Length + bytes239.Length; + byte[] bytes240 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes240, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes237, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes238, 0, NetMessage.buffer[num].writeBuffer, num3, bytes238.Length); + num3 += bytes238.Length; + Buffer.BlockCopy(bytes239, 0, NetMessage.buffer[num].writeBuffer, num3, bytes239.Length); + } + else + { + if (msgType == 57) + { + byte[] bytes241 = BitConverter.GetBytes(msgType); + num2 += 2; + byte[] bytes242 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes242, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes241, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = WorldGen.tGood; + num3++; + NetMessage.buffer[num].writeBuffer[num3] = WorldGen.tEvil; + } + else + { + if (msgType == 58) + { + byte[] bytes243 = BitConverter.GetBytes(msgType); + byte b93 = (byte)number; + byte[] bytes244 = BitConverter.GetBytes(number2); + num2 += 1 + bytes244.Length; + byte[] bytes245 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes245, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes243, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b93; + num3++; + Buffer.BlockCopy(bytes244, 0, NetMessage.buffer[num].writeBuffer, num3, bytes244.Length); + } + else + { + if (msgType == 59) + { + byte[] bytes246 = BitConverter.GetBytes(msgType); + byte[] bytes247 = BitConverter.GetBytes(number); + byte[] bytes248 = BitConverter.GetBytes((int)number2); + num2 += bytes247.Length + bytes248.Length; + byte[] bytes249 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes249, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes246, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes247, 0, NetMessage.buffer[num].writeBuffer, num3, bytes247.Length); + num3 += 4; + Buffer.BlockCopy(bytes248, 0, NetMessage.buffer[num].writeBuffer, num3, bytes248.Length); + } + else + { + if (msgType == 60) + { + byte[] bytes250 = BitConverter.GetBytes(msgType); + byte[] bytes251 = BitConverter.GetBytes((short)number); + byte[] bytes252 = BitConverter.GetBytes((short)number2); + byte[] bytes253 = BitConverter.GetBytes((short)number3); + byte b94 = (byte)number4; + num2 += bytes251.Length + bytes252.Length + bytes253.Length + 1; + byte[] bytes254 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes254, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes250, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes251, 0, NetMessage.buffer[num].writeBuffer, num3, bytes251.Length); + num3 += 2; + Buffer.BlockCopy(bytes252, 0, NetMessage.buffer[num].writeBuffer, num3, bytes252.Length); + num3 += 2; + Buffer.BlockCopy(bytes253, 0, NetMessage.buffer[num].writeBuffer, num3, bytes253.Length); + num3 += 2; + NetMessage.buffer[num].writeBuffer[num3] = b94; + num3++; + } + else + { + if (msgType == 61) + { + byte[] bytes255 = BitConverter.GetBytes(msgType); + byte[] bytes256 = BitConverter.GetBytes(number); + byte[] bytes257 = BitConverter.GetBytes((int)number2); + num2 += bytes256.Length + bytes257.Length; + byte[] bytes258 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes258, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes255, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes256, 0, NetMessage.buffer[num].writeBuffer, num3, bytes256.Length); + num3 += bytes256.Length; + Buffer.BlockCopy(bytes257, 0, NetMessage.buffer[num].writeBuffer, num3, bytes257.Length); + } + else + { + if (msgType == 62) + { + byte[] bytes259 = BitConverter.GetBytes(msgType); + byte[] bytes260 = BitConverter.GetBytes(number); + byte[] bytes261 = BitConverter.GetBytes((int)number2); + num2 += bytes260.Length + bytes261.Length; + byte[] bytes262 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes262, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes259, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes260, 0, NetMessage.buffer[num].writeBuffer, num3, bytes260.Length); + num3 += bytes260.Length; + Buffer.BlockCopy(bytes261, 0, NetMessage.buffer[num].writeBuffer, num3, bytes261.Length); + } + else + { + if (msgType == 63) + { + byte[] bytes263 = BitConverter.GetBytes(msgType); + byte[] bytes264 = BitConverter.GetBytes(number); + byte[] bytes265 = BitConverter.GetBytes((int)number2); + byte b95 = (byte)number3; + num2 += bytes264.Length + bytes265.Length + 1; + byte[] bytes266 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes266, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes263, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes264, 0, NetMessage.buffer[num].writeBuffer, num3, bytes264.Length); + num3 += bytes264.Length; + Buffer.BlockCopy(bytes265, 0, NetMessage.buffer[num].writeBuffer, num3, bytes265.Length); + num3 += bytes265.Length; + NetMessage.buffer[num].writeBuffer[num3] = b95; + num3++; + } + else + { + if (msgType == 64) + { + byte[] bytes267 = BitConverter.GetBytes(msgType); + byte[] bytes268 = BitConverter.GetBytes(number); + byte[] bytes269 = BitConverter.GetBytes((int)number2); + byte b96 = (byte)number3; + num2 += bytes268.Length + bytes269.Length + 1; + byte[] bytes270 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes270, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes267, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes268, 0, NetMessage.buffer[num].writeBuffer, num3, bytes268.Length); + num3 += bytes268.Length; + Buffer.BlockCopy(bytes269, 0, NetMessage.buffer[num].writeBuffer, num3, bytes269.Length); + num3 += bytes269.Length; + NetMessage.buffer[num].writeBuffer[num3] = b96; + num3++; + } + else + { + if (msgType == 65) + { + byte[] bytes271 = BitConverter.GetBytes(msgType); + byte b97 = 0; + byte[] bytes272 = BitConverter.GetBytes((short)number2); + byte[] bytes273 = BitConverter.GetBytes(number3); + byte[] bytes274 = BitConverter.GetBytes(number4); + if ((number & 1) == 1) + { + b97 += 1; + } + if ((number & 2) == 2) + { + b97 += 2; + } + if ((number5 & 1) == 1) + { + b97 += 4; + } + if ((number5 & 2) == 2) + { + b97 += 8; + } + num2 += 1 + bytes272.Length + bytes273.Length + bytes274.Length; + byte[] bytes275 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes275, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes271, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + NetMessage.buffer[num].writeBuffer[num3] = b97; + num3++; + Buffer.BlockCopy(bytes272, 0, NetMessage.buffer[num].writeBuffer, num3, bytes272.Length); + num3 += bytes272.Length; + Buffer.BlockCopy(bytes273, 0, NetMessage.buffer[num].writeBuffer, num3, bytes273.Length); + num3 += bytes273.Length; + Buffer.BlockCopy(bytes274, 0, NetMessage.buffer[num].writeBuffer, num3, bytes274.Length); + num3 += bytes274.Length; + } + else + { + if (msgType != 67 && msgType == 68) + { + byte[] bytes276 = BitConverter.GetBytes(msgType); + byte[] bytes277 = Encoding.UTF8.GetBytes(Main.clientUUID); + num2 += bytes277.Length; + byte[] bytes278 = BitConverter.GetBytes(num2 - 4); + Buffer.BlockCopy(bytes278, 0, NetMessage.buffer[num].writeBuffer, 0, 4); + Buffer.BlockCopy(bytes276, 0, NetMessage.buffer[num].writeBuffer, 4, 1); + Buffer.BlockCopy(bytes277, 0, NetMessage.buffer[num].writeBuffer, 5, bytes277.Length); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.netMode == 1) + { + if (!Netplay.clientSock.tcpClient.Connected) + { + goto IL_5BF9; + } + try + { + NetMessage.buffer[num].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.clientSock.networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.clientSock.ClientWriteCallBack), Netplay.clientSock.networkStream); + goto IL_5BF9; + } + catch + { + goto IL_5BF9; + } + } + if (remoteClient == -1) + { + if (msgType == 20) + { + for (int num14 = 0; num14 < 256; num14++) + { + if (num14 != ignoreClient && (NetMessage.buffer[num14].broadcast || (Netplay.serverSock[num14].state >= 3 && msgType == 10)) && Netplay.serverSock[num14].tcpClient.Connected && Netplay.serverSock[num14].SectionRange(number, (int)number2, (int)number3)) + { + try + { + NetMessage.buffer[num14].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[num14].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num14].ServerWriteCallBack), Netplay.serverSock[num14].networkStream); + } + catch + { + } + } + } + } + else + { + if (msgType == 23) + { + for (int num15 = 0; num15 < 256; num15++) + { + if (num15 != ignoreClient && (NetMessage.buffer[num15].broadcast || (Netplay.serverSock[num15].state >= 3 && msgType == 10)) && Netplay.serverSock[num15].tcpClient.Connected) + { + bool flag2 = false; + if (Main.npc[number].boss || Main.npc[number].netAlways || Main.npc[number].townNPC || !Main.npc[number].active) + { + flag2 = true; + } + else + { + if (Main.npc[number].netSkip <= 0) + { + Rectangle rectangle = new Rectangle((int)Main.player[num15].position.X, (int)Main.player[num15].position.Y, Main.player[num15].width, Main.player[num15].height); + Rectangle value2 = new Rectangle((int)Main.npc[number].position.X, (int)Main.npc[number].position.Y, Main.npc[number].width, Main.npc[number].height); + value2.X -= 2500; + value2.Y -= 2500; + value2.Width += 5000; + value2.Height += 5000; + if (rectangle.Intersects(value2)) + { + flag2 = true; + } + } + else + { + flag2 = true; + } + } + if (flag2) + { + try + { + NetMessage.buffer[num15].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[num15].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num15].ServerWriteCallBack), Netplay.serverSock[num15].networkStream); + } + catch + { + } + } + } + } + Main.npc[number].netSkip++; + if (Main.npc[number].netSkip > 4) + { + Main.npc[number].netSkip = 0; + } + } + else + { + if (msgType == 28) + { + for (int num16 = 0; num16 < 256; num16++) + { + if (num16 != ignoreClient && (NetMessage.buffer[num16].broadcast || (Netplay.serverSock[num16].state >= 3 && msgType == 10)) && Netplay.serverSock[num16].tcpClient.Connected) + { + bool flag3 = false; + if (Main.npc[number].life <= 0) + { + flag3 = true; + } + else + { + Rectangle rectangle2 = new Rectangle((int)Main.player[num16].position.X, (int)Main.player[num16].position.Y, Main.player[num16].width, Main.player[num16].height); + Rectangle value3 = new Rectangle((int)Main.npc[number].position.X, (int)Main.npc[number].position.Y, Main.npc[number].width, Main.npc[number].height); + value3.X -= 3000; + value3.Y -= 3000; + value3.Width += 6000; + value3.Height += 6000; + if (rectangle2.Intersects(value3)) + { + flag3 = true; + } + } + if (flag3) + { + try + { + NetMessage.buffer[num16].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[num16].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num16].ServerWriteCallBack), Netplay.serverSock[num16].networkStream); + } + catch + { + } + } + } + } + } + else + { + if (msgType == 13) + { + for (int num17 = 0; num17 < 256; num17++) + { + if (num17 != ignoreClient && (NetMessage.buffer[num17].broadcast || (Netplay.serverSock[num17].state >= 3 && msgType == 10)) && Netplay.serverSock[num17].tcpClient.Connected) + { + bool flag4 = true; + if (flag4) + { + try + { + NetMessage.buffer[num17].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[num17].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num17].ServerWriteCallBack), Netplay.serverSock[num17].networkStream); + } + catch + { + } + } + } + } + Main.player[number].netSkip++; + if (Main.player[number].netSkip > 2) + { + Main.player[number].netSkip = 0; + } + } + else + { + if (msgType == 27) + { + for (int num18 = 0; num18 < 256; num18++) + { + if (num18 != ignoreClient && (NetMessage.buffer[num18].broadcast || (Netplay.serverSock[num18].state >= 3 && msgType == 10)) && Netplay.serverSock[num18].tcpClient.Connected) + { + bool flag5 = false; + if (Main.projectile[number].type == 12 || Main.projPet[Main.projectile[number].type] || Main.projectile[number].aiStyle == 11 || Main.projPet[Main.projectile[number].type] || Main.projectile[number].netImportant) + { + flag5 = true; + } + else + { + Rectangle rectangle3 = new Rectangle((int)Main.player[num18].position.X, (int)Main.player[num18].position.Y, Main.player[num18].width, Main.player[num18].height); + Rectangle value4 = new Rectangle((int)Main.projectile[number].position.X, (int)Main.projectile[number].position.Y, Main.projectile[number].width, Main.projectile[number].height); + value4.X -= 5000; + value4.Y -= 5000; + value4.Width += 10000; + value4.Height += 10000; + if (rectangle3.Intersects(value4)) + { + flag5 = true; + } + } + if (flag5) + { + try + { + NetMessage.buffer[num18].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[num18].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num18].ServerWriteCallBack), Netplay.serverSock[num18].networkStream); + } + catch + { + } + } + } + } + } + else + { + for (int num19 = 0; num19 < 256; num19++) + { + if (num19 != ignoreClient && (NetMessage.buffer[num19].broadcast || (Netplay.serverSock[num19].state >= 3 && msgType == 10)) && Netplay.serverSock[num19].tcpClient.Connected) + { + try + { + NetMessage.buffer[num19].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[num19].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num19].ServerWriteCallBack), Netplay.serverSock[num19].networkStream); + } + catch + { + } + } + } + } + } + } + } + } + } + else + { + if (Netplay.serverSock[remoteClient].tcpClient.Connected) + { + try + { + NetMessage.buffer[remoteClient].spamCount++; + Main.txMsg++; + Main.txData += num2; + Main.txMsgType[msgType]++; + Main.txDataType[msgType] += num2; + Netplay.serverSock[remoteClient].networkStream.BeginWrite(NetMessage.buffer[num].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[remoteClient].ServerWriteCallBack), Netplay.serverSock[remoteClient].networkStream); + } + catch + { + } + } + } + IL_5BF9: + if (Main.verboseNetplay) + { + for (int num20 = 0; num20 < num2; num20++) + { + } + for (int num21 = 0; num21 < num2; num21++) + { + byte arg_5C30_0 = NetMessage.buffer[num].writeBuffer[num21]; + } + } + NetMessage.buffer[num].writeLocked = false; + if (msgType == 19 && Main.netMode == 1) + { + int size = 5; + NetMessage.SendTileSquare(num, (int)number2, (int)number3, size); + } + if (msgType == 2 && Main.netMode == 2) + { + Netplay.serverSock[num].kill = true; + } + } + } + public static void RecieveBytes(byte[] bytes, int streamLength, int i = 256) + { + lock (NetMessage.buffer[i]) + { + try + { + Buffer.BlockCopy(bytes, 0, NetMessage.buffer[i].readBuffer, NetMessage.buffer[i].totalData, streamLength); + NetMessage.buffer[i].totalData += streamLength; + NetMessage.buffer[i].checkBytes = true; + } + catch + { + if (Main.netMode == 1) + { + Main.menuMode = 15; + Main.statusText = "Bad header lead to a read buffer overflow."; + Netplay.disconnect = true; + } + else + { + Netplay.serverSock[i].kill = true; + } + } + } + } + public static void CheckBytes(int i = 256) + { + lock (NetMessage.buffer[i]) + { + int num = 0; + if (NetMessage.buffer[i].totalData >= 4) + { + if (NetMessage.buffer[i].messageLength == 0) + { + NetMessage.buffer[i].messageLength = BitConverter.ToInt32(NetMessage.buffer[i].readBuffer, 0) + 4; + } + while (NetMessage.buffer[i].totalData >= NetMessage.buffer[i].messageLength + num && NetMessage.buffer[i].messageLength > 0) + { + if (!Main.ignoreErrors) + { + NetMessage.buffer[i].GetData(num + 4, NetMessage.buffer[i].messageLength - 4); + } + else + { + try + { + NetMessage.buffer[i].GetData(num + 4, NetMessage.buffer[i].messageLength - 4); + } + catch + { + } + } + num += NetMessage.buffer[i].messageLength; + if (NetMessage.buffer[i].totalData - num >= 4) + { + NetMessage.buffer[i].messageLength = BitConverter.ToInt32(NetMessage.buffer[i].readBuffer, num) + 4; + } + else + { + NetMessage.buffer[i].messageLength = 0; + } + } + if (num == NetMessage.buffer[i].totalData) + { + NetMessage.buffer[i].totalData = 0; + } + else + { + if (num > 0) + { + Buffer.BlockCopy(NetMessage.buffer[i].readBuffer, num, NetMessage.buffer[i].readBuffer, 0, NetMessage.buffer[i].totalData - num); + NetMessage.buffer[i].totalData -= num; + } + } + NetMessage.buffer[i].checkBytes = false; + } + } + } + public static void BootPlayer(int plr, string msg) + { + NetMessage.SendData(2, plr, -1, msg, 0, 0f, 0f, 0f, 0); + } + public static void SendTileSquare(int whoAmi, int tileX, int tileY, int size) + { + int num = (size - 1) / 2; + NetMessage.SendData(20, whoAmi, -1, "", size, (float)(tileX - num), (float)(tileY - num), 0f, 0); + } + public static void SendSection(int whoAmi, int sectionX, int sectionY) + { + if (Main.netMode != 2) + { + return; + } + try + { + if (sectionX >= 0 && sectionY >= 0 && sectionX < Main.maxSectionsX && sectionY < Main.maxSectionsY) + { + Netplay.serverSock[whoAmi].tileSection[sectionX, sectionY] = true; + int num = sectionX * 200; + int num2 = sectionY * 150; + for (int i = num2; i < num2 + 150; i++) + { + NetMessage.SendData(10, whoAmi, -1, "", 200, (float)num, (float)i, 0f, 0); + } + for (int j = 0; j < 200; j++) + { + if (Main.npc[j].active && Main.npc[j].townNPC) + { + int sectionX2 = Netplay.GetSectionX((int)(Main.npc[j].position.X / 16f)); + int sectionY2 = Netplay.GetSectionY((int)(Main.npc[j].position.Y / 16f)); + if (sectionX2 == sectionX && sectionY2 == sectionY) + { + NetMessage.SendData(23, whoAmi, -1, "", j, 0f, 0f, 0f, 0); + } + } + } + } + } + catch + { + } + } + public static void greetPlayer(int plr) + { + if (Main.motd == "") + { + NetMessage.SendData(25, plr, -1, Lang.mp[18] + " " + Main.worldName + "!", 255, 255f, 240f, 20f, 0); + } + else + { + NetMessage.SendData(25, plr, -1, Main.motd, 255, 255f, 240f, 20f, 0); + } + string text = ""; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active) + { + if (text == "") + { + text += Main.player[i].name; + } + else + { + text = text + ", " + Main.player[i].name; + } + } + } + NetMessage.SendData(25, plr, -1, "Current players: " + text + ".", 255, 255f, 240f, 20f, 0); + } + public static void sendWater(int x, int y) + { + if (Main.netMode == 1) + { + NetMessage.SendData(48, -1, -1, "", x, (float)y, 0f, 0f, 0); + return; + } + for (int i = 0; i < 256; i++) + { + if ((NetMessage.buffer[i].broadcast || Netplay.serverSock[i].state >= 3) && Netplay.serverSock[i].tcpClient.Connected) + { + int num = x / 200; + int num2 = y / 150; + if (Netplay.serverSock[i].tileSection[num, num2]) + { + NetMessage.SendData(48, i, -1, "", x, (float)y, 0f, 0f, 0); + } + } + } + } + public static void syncPlayers() + { + bool flag = false; + for (int i = 0; i < 255; i++) + { + int num = 0; + if (Main.player[i].active) + { + num = 1; + } + if (Netplay.serverSock[i].state == 10) + { + if (Main.autoShutdown && !flag) + { + string text = Netplay.serverSock[i].tcpClient.Client.RemoteEndPoint.ToString(); + string a = text; + for (int j = 0; j < text.Length; j++) + { + if (text.Substring(j, 1) == ":") + { + a = text.Substring(0, j); + } + } + if (a == "127.0.0.1") + { + flag = true; + } + } + NetMessage.SendData(14, -1, i, "", i, (float)num, 0f, 0f, 0); + NetMessage.SendData(4, -1, i, Main.player[i].name, i, 0f, 0f, 0f, 0); + NetMessage.SendData(13, -1, i, "", i, 0f, 0f, 0f, 0); + NetMessage.SendData(16, -1, i, "", i, 0f, 0f, 0f, 0); + NetMessage.SendData(30, -1, i, "", i, 0f, 0f, 0f, 0); + NetMessage.SendData(45, -1, i, "", i, 0f, 0f, 0f, 0); + NetMessage.SendData(42, -1, i, "", i, 0f, 0f, 0f, 0); + NetMessage.SendData(50, -1, i, "", i, 0f, 0f, 0f, 0); + for (int k = 0; k < 59; k++) + { + NetMessage.SendData(5, -1, i, Main.player[i].inventory[k].name, i, (float)k, (float)Main.player[i].inventory[k].prefix, 0f, 0); + } + NetMessage.SendData(5, -1, i, Main.player[i].armor[0].name, i, 59f, (float)Main.player[i].armor[0].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[1].name, i, 60f, (float)Main.player[i].armor[1].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[2].name, i, 61f, (float)Main.player[i].armor[2].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[3].name, i, 62f, (float)Main.player[i].armor[3].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[4].name, i, 63f, (float)Main.player[i].armor[4].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[5].name, i, 64f, (float)Main.player[i].armor[5].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[6].name, i, 65f, (float)Main.player[i].armor[6].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[7].name, i, 66f, (float)Main.player[i].armor[7].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[8].name, i, 67f, (float)Main.player[i].armor[8].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[9].name, i, 68f, (float)Main.player[i].armor[9].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].armor[10].name, i, 69f, (float)Main.player[i].armor[10].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].dye[0].name, i, 70f, (float)Main.player[i].dye[0].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].dye[1].name, i, 71f, (float)Main.player[i].dye[1].prefix, 0f, 0); + NetMessage.SendData(5, -1, i, Main.player[i].dye[2].name, i, 72f, (float)Main.player[i].dye[2].prefix, 0f, 0); + if (!Netplay.serverSock[i].announced) + { + Netplay.serverSock[i].announced = true; + NetMessage.SendData(25, -1, i, Main.player[i].name + " " + Lang.mp[19], 255, 255f, 240f, 20f, 0); + if (Main.dedServ) + { + Console.WriteLine(Main.player[i].name + " " + Lang.mp[19]); + } + } + } + else + { + num = 0; + NetMessage.SendData(14, -1, i, "", i, (float)num, 0f, 0f, 0); + if (Netplay.serverSock[i].announced) + { + Netplay.serverSock[i].announced = false; + NetMessage.SendData(25, -1, i, Netplay.serverSock[i].oldName + " " + Lang.mp[20], 255, 255f, 240f, 20f, 0); + if (Main.dedServ) + { + Console.WriteLine(Netplay.serverSock[i].oldName + " " + Lang.mp[20]); + } + } + } + } + for (int l = 0; l < 200; l++) + { + if (Main.npc[l].active && Main.npc[l].townNPC && NPC.TypeToNum(Main.npc[l].type) != -1) + { + int num2 = 0; + if (Main.npc[l].homeless) + { + num2 = 1; + } + NetMessage.SendData(60, -1, -1, "", l, (float)Main.npc[l].homeTileX, (float)Main.npc[l].homeTileY, (float)num2, 0); + } + } + if (Main.autoShutdown && !flag) + { + WorldGen.saveWorld(false); + Netplay.disconnect = true; + } + } + } +} diff --git a/Terraria/Netplay.cs b/Terraria/Netplay.cs new file mode 100644 index 0000000..ac5687b --- /dev/null +++ b/Terraria/Netplay.cs @@ -0,0 +1,740 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Threading; +namespace Terraria +{ + public class Netplay + { + public const int bufferSize = 1024; + public const int maxConnections = 256; + public static bool stopListen = false; + public static ServerSock[] serverSock = new ServerSock[256]; + public static ClientSock clientSock = new ClientSock(); + public static TcpListener tcpListener; + public static IPAddress serverListenIP; + public static IPAddress serverIP; + public static int serverPort = 7777; + public static bool disconnect = false; + public static string password = ""; + public static string banFile = "banlist.txt"; + public static bool spamCheck = false; + public static bool anyClients = false; + public static string portForwardIP; + public static int portForwardPort; + public static bool portForwardOpen; + public static bool uPNP = true; + public static bool ServerUp = false; + public static void openPort() + { + Netplay.portForwardIP = Netplay.LocalIPAddress(); + Netplay.portForwardPort = Netplay.serverPort; + } + public static void closePort() + { + } + public static string LocalIPAddress() + { + string result = ""; + IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName()); + IPAddress[] addressList = hostEntry.AddressList; + for (int i = 0; i < addressList.Length; i++) + { + IPAddress iPAddress = addressList[i]; + if (iPAddress.AddressFamily == AddressFamily.InterNetwork) + { + result = iPAddress.ToString(); + break; + } + } + return result; + } + public static void ResetNetDiag() + { + Main.rxMsg = 0; + Main.rxData = 0; + Main.txMsg = 0; + Main.txData = 0; + for (int i = 0; i < Main.maxMsg; i++) + { + Main.rxMsgType[i] = 0; + Main.rxDataType[i] = 0; + Main.txMsgType[i] = 0; + Main.txDataType[i] = 0; + } + } + public static void ResetSections() + { + for (int i = 0; i < 256; i++) + { + for (int j = 0; j < Main.maxSectionsX; j++) + { + for (int k = 0; k < Main.maxSectionsY; k++) + { + Netplay.serverSock[i].tileSection[j, k] = false; + } + } + } + } + public static void AddBan(int plr) + { + string text = Netplay.serverSock[plr].tcpClient.Client.RemoteEndPoint.ToString(); + string value = text; + for (int i = 0; i < text.Length; i++) + { + if (text.Substring(i, 1) == ":") + { + value = text.Substring(0, i); + } + } + using (StreamWriter streamWriter = new StreamWriter(Netplay.banFile, true)) + { + streamWriter.WriteLine("//" + Main.player[plr].name); + streamWriter.WriteLine(value); + } + } + public static bool CheckBan(string ip) + { + try + { + string b = ip; + for (int i = 0; i < ip.Length; i++) + { + if (ip.Substring(i, 1) == ":") + { + b = ip.Substring(0, i); + } + } + if (File.Exists(Netplay.banFile)) + { + using (StreamReader streamReader = new StreamReader(Netplay.banFile)) + { + string a; + while ((a = streamReader.ReadLine()) != null) + { + if (a == b) + { + return true; + } + } + } + } + } + catch + { + } + return false; + } + public static void newRecent() + { + for (int i = 0; i < Main.maxMP; i++) + { + if (Main.recentIP[i] == Netplay.serverIP.ToString() && Main.recentPort[i] == Netplay.serverPort) + { + for (int j = i; j < Main.maxMP - 1; j++) + { + Main.recentIP[j] = Main.recentIP[j + 1]; + Main.recentPort[j] = Main.recentPort[j + 1]; + Main.recentWorld[j] = Main.recentWorld[j + 1]; + } + } + } + for (int k = Main.maxMP - 1; k > 0; k--) + { + Main.recentIP[k] = Main.recentIP[k - 1]; + Main.recentPort[k] = Main.recentPort[k - 1]; + Main.recentWorld[k] = Main.recentWorld[k - 1]; + } + Main.recentIP[0] = Netplay.serverIP.ToString(); + Main.recentPort[0] = Netplay.serverPort; + Main.recentWorld[0] = Main.worldName; + Main.SaveRecent(); + } + public static void ClientLoop(object threadContext) + { + Netplay.ResetNetDiag(); + Main.ServerSideCharacter = false; + if (Main.rand == null) + { + Main.rand = new Random((int)DateTime.Now.Ticks); + } + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + Main.player[Main.myPlayer].hostile = false; + Main.clientPlayer = (Player)Main.player[Main.myPlayer].clientClone(); + for (int i = 0; i < 255; i++) + { + if (i != Main.myPlayer) + { + Main.player[i] = new Player(); + } + } + Main.menuMode = 10; + Main.menuMode = 14; + if (!Main.autoPass) + { + Main.statusText = "Connecting to " + Netplay.serverIP; + } + Main.netMode = 1; + Netplay.disconnect = false; + Netplay.clientSock = new ClientSock(); + Netplay.clientSock.tcpClient.NoDelay = true; + Netplay.clientSock.readBuffer = new byte[1024]; + Netplay.clientSock.writeBuffer = new byte[1024]; + bool flag = true; + while (flag) + { + flag = false; + try + { + Netplay.clientSock.tcpClient.Connect(Netplay.serverIP, Netplay.serverPort); + Netplay.clientSock.networkStream = Netplay.clientSock.tcpClient.GetStream(); + flag = false; + } + catch + { + if (!Netplay.disconnect && Main.gameMenu) + { + flag = true; + } + } + } + NetMessage.buffer[256].Reset(); + int num = -1; + while (!Netplay.disconnect) + { + if (Netplay.clientSock.tcpClient.Connected) + { + if (NetMessage.buffer[256].checkBytes) + { + NetMessage.CheckBytes(256); + } + Netplay.clientSock.active = true; + if (Netplay.clientSock.state == 0) + { + Main.statusText = "Found server"; + Netplay.clientSock.state = 1; + NetMessage.SendData(1, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + if (Netplay.clientSock.state == 2 && num != Netplay.clientSock.state) + { + Main.statusText = "Sending player data..."; + } + if (Netplay.clientSock.state == 3 && num != Netplay.clientSock.state) + { + Main.statusText = "Requesting world information"; + } + if (Netplay.clientSock.state == 4) + { + WorldGen.worldCleared = false; + Netplay.clientSock.state = 5; + if (Main.cloudBGActive >= 1f) + { + Main.cloudBGAlpha = 1f; + } + else + { + Main.cloudBGAlpha = 0f; + } + Main.windSpeed = Main.windSpeedSet; + Cloud.resetClouds(); + Main.cloudAlpha = Main.maxRaining; + WorldGen.clearWorld(); + if (Main.mapEnabled) + { + Map.loadMap(); + } + } + if (Netplay.clientSock.state == 5 && Main.loadMapLock) + { + float num2 = (float)Main.loadMapLastX / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[68], + " ", + (int)(num2 * 100f + 1f), + "%" + }); + } + else + { + if (Netplay.clientSock.state == 5 && WorldGen.worldCleared) + { + Netplay.clientSock.state = 6; + Main.player[Main.myPlayer].FindSpawn(); + NetMessage.SendData(8, -1, -1, "", Main.player[Main.myPlayer].SpawnX, (float)Main.player[Main.myPlayer].SpawnY, 0f, 0f, 0); + } + } + if (Netplay.clientSock.state == 6 && num != Netplay.clientSock.state) + { + Main.statusText = "Requesting tile data"; + } + if (!Netplay.clientSock.locked && !Netplay.disconnect && Netplay.clientSock.networkStream.DataAvailable) + { + Netplay.clientSock.locked = true; + Netplay.clientSock.networkStream.BeginRead(Netplay.clientSock.readBuffer, 0, Netplay.clientSock.readBuffer.Length, new AsyncCallback(Netplay.clientSock.ClientReadCallBack), Netplay.clientSock.networkStream); + } + if (Netplay.clientSock.statusMax > 0 && Netplay.clientSock.statusText != "") + { + if (Netplay.clientSock.statusCount >= Netplay.clientSock.statusMax) + { + Main.statusText = Netplay.clientSock.statusText + ": Complete!"; + Netplay.clientSock.statusText = ""; + Netplay.clientSock.statusMax = 0; + Netplay.clientSock.statusCount = 0; + } + else + { + Main.statusText = string.Concat(new object[] + { + Netplay.clientSock.statusText, + ": ", + (int)((float)Netplay.clientSock.statusCount / (float)Netplay.clientSock.statusMax * 100f), + "%" + }); + } + } + Thread.Sleep(1); + } + else + { + if (Netplay.clientSock.active) + { + Main.statusText = "Lost connection"; + Netplay.disconnect = true; + } + } + num = Netplay.clientSock.state; + } + try + { + Netplay.clientSock.networkStream.Close(); + Netplay.clientSock.networkStream = Netplay.clientSock.tcpClient.GetStream(); + } + catch + { + } + if (!Main.gameMenu) + { + Main.netMode = 0; + Player.SavePlayer(Main.player[Main.myPlayer], Main.playerPathName); + Main.gameMenu = true; + Main.menuMode = 14; + } + NetMessage.buffer[256].Reset(); + if (Main.menuMode == 15 && Main.statusText == "Lost connection") + { + Main.menuMode = 14; + } + if (Netplay.clientSock.statusText != "" && Netplay.clientSock.statusText != null) + { + Main.statusText = "Lost connection"; + } + Netplay.clientSock.statusCount = 0; + Netplay.clientSock.statusMax = 0; + Netplay.clientSock.statusText = ""; + Main.netMode = 0; + } + public static void ServerLoop(object threadContext) + { + Netplay.ResetNetDiag(); + if (Main.rand == null) + { + Main.rand = new Random((int)DateTime.Now.Ticks); + } + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + Main.myPlayer = 255; + Netplay.serverIP = IPAddress.Any; + Netplay.serverListenIP = Netplay.serverIP; + Main.menuMode = 14; + Main.statusText = "Starting server..."; + Main.netMode = 2; + Netplay.disconnect = false; + for (int i = 0; i < 256; i++) + { + Netplay.serverSock[i] = new ServerSock(); + Netplay.serverSock[i].Reset(); + Netplay.serverSock[i].whoAmI = i; + Netplay.serverSock[i].tcpClient = new TcpClient(); + Netplay.serverSock[i].tcpClient.NoDelay = true; + Netplay.serverSock[i].readBuffer = new byte[1024]; + Netplay.serverSock[i].writeBuffer = new byte[1024]; + } + Netplay.tcpListener = new TcpListener(Netplay.serverListenIP, Netplay.serverPort); + try + { + Netplay.tcpListener.Start(); + } + catch (Exception ex) + { + Main.menuMode = 15; + Main.statusText = ex.ToString(); + Netplay.disconnect = true; + } + if (!Netplay.disconnect) + { + ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.ListenForClients), 1); + Main.statusText = "Server started"; + } + if (Netplay.uPNP) + { + try + { + Netplay.openPort(); + } + catch + { + } + } + int num = 0; + while (!Netplay.disconnect) + { + if (Netplay.stopListen) + { + int num2 = -1; + for (int j = 0; j < Main.maxNetPlayers; j++) + { + if (!Netplay.serverSock[j].tcpClient.Connected) + { + num2 = j; + break; + } + } + if (num2 >= 0) + { + if (Main.ignoreErrors) + { + try + { + Netplay.tcpListener.Start(); + Netplay.stopListen = false; + ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.ListenForClients), 1); + goto IL_219; + } + catch + { + goto IL_219; + } + } + Netplay.tcpListener.Start(); + Netplay.stopListen = false; + ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.ListenForClients), 1); + } + } + IL_219: + int num3 = 0; + for (int k = 0; k < 256; k++) + { + if (NetMessage.buffer[k].checkBytes) + { + NetMessage.CheckBytes(k); + } + if (Netplay.serverSock[k].kill) + { + Netplay.serverSock[k].Reset(); + NetMessage.syncPlayers(); + } + else + { + if (Netplay.serverSock[k].tcpClient.Connected) + { + if (!Netplay.serverSock[k].active) + { + Netplay.serverSock[k].state = 0; + } + Netplay.serverSock[k].active = true; + num3++; + if (!Netplay.serverSock[k].locked) + { + try + { + Netplay.serverSock[k].networkStream = Netplay.serverSock[k].tcpClient.GetStream(); + if (Netplay.serverSock[k].networkStream.DataAvailable) + { + Netplay.serverSock[k].locked = true; + Netplay.serverSock[k].networkStream.BeginRead(Netplay.serverSock[k].readBuffer, 0, Netplay.serverSock[k].readBuffer.Length, new AsyncCallback(Netplay.serverSock[k].ServerReadCallBack), Netplay.serverSock[k].networkStream); + } + } + catch + { + Netplay.serverSock[k].kill = true; + } + } + if (Netplay.serverSock[k].statusMax > 0 && Netplay.serverSock[k].statusText2 != "") + { + if (Netplay.serverSock[k].statusCount >= Netplay.serverSock[k].statusMax) + { + Netplay.serverSock[k].statusText = string.Concat(new object[] + { + "(", + Netplay.serverSock[k].tcpClient.Client.RemoteEndPoint, + ") ", + Netplay.serverSock[k].name, + " ", + Netplay.serverSock[k].statusText2, + ": Complete!" + }); + Netplay.serverSock[k].statusText2 = ""; + Netplay.serverSock[k].statusMax = 0; + Netplay.serverSock[k].statusCount = 0; + } + else + { + Netplay.serverSock[k].statusText = string.Concat(new object[] + { + "(", + Netplay.serverSock[k].tcpClient.Client.RemoteEndPoint, + ") ", + Netplay.serverSock[k].name, + " ", + Netplay.serverSock[k].statusText2, + ": ", + (int)((float)Netplay.serverSock[k].statusCount / (float)Netplay.serverSock[k].statusMax * 100f), + "%" + }); + } + } + else + { + if (Netplay.serverSock[k].state == 0) + { + Netplay.serverSock[k].statusText = string.Concat(new object[] + { + "(", + Netplay.serverSock[k].tcpClient.Client.RemoteEndPoint, + ") ", + Netplay.serverSock[k].name, + " is connecting..." + }); + } + else + { + if (Netplay.serverSock[k].state == 1) + { + Netplay.serverSock[k].statusText = string.Concat(new object[] + { + "(", + Netplay.serverSock[k].tcpClient.Client.RemoteEndPoint, + ") ", + Netplay.serverSock[k].name, + " is sending player data..." + }); + } + else + { + if (Netplay.serverSock[k].state == 2) + { + Netplay.serverSock[k].statusText = string.Concat(new object[] + { + "(", + Netplay.serverSock[k].tcpClient.Client.RemoteEndPoint, + ") ", + Netplay.serverSock[k].name, + " requested world information" + }); + } + else + { + if (Netplay.serverSock[k].state != 3 && Netplay.serverSock[k].state == 10) + { + Netplay.serverSock[k].statusText = string.Concat(new object[] + { + "(", + Netplay.serverSock[k].tcpClient.Client.RemoteEndPoint, + ") ", + Netplay.serverSock[k].name, + " is playing" + }); + } + } + } + } + } + } + else + { + if (Netplay.serverSock[k].active) + { + Netplay.serverSock[k].kill = true; + } + else + { + Netplay.serverSock[k].statusText2 = ""; + if (k < 255) + { + Main.player[k].active = false; + } + } + } + } + } + num++; + if (num > 10) + { + Thread.Sleep(1); + num = 0; + } + else + { + Thread.Sleep(0); + } + if (!WorldGen.saveLock && !Main.dedServ) + { + if (num3 == 0) + { + Main.statusText = "Waiting for clients..."; + } + else + { + Main.statusText = num3 + " clients connected"; + } + } + if (num3 == 0) + { + Netplay.anyClients = false; + } + else + { + Netplay.anyClients = true; + } + Netplay.ServerUp = true; + } + Netplay.tcpListener.Stop(); + try + { + Netplay.closePort(); + } + catch + { + } + for (int l = 0; l < 256; l++) + { + Netplay.serverSock[l].Reset(); + } + if (Main.menuMode != 15) + { + Main.netMode = 0; + Main.menuMode = 10; + WorldGen.saveWorld(false); + while (WorldGen.saveLock) + { + } + Main.menuMode = 0; + } + else + { + Main.netMode = 0; + } + Main.myPlayer = 0; + } + public static void ListenForClients(object threadContext) + { + while (!Netplay.disconnect && !Netplay.stopListen) + { + int num = -1; + for (int i = 0; i < Main.maxNetPlayers; i++) + { + if (!Netplay.serverSock[i].tcpClient.Connected) + { + num = i; + break; + } + } + if (num >= 0) + { + try + { + Netplay.serverSock[num].tcpClient = Netplay.tcpListener.AcceptTcpClient(); + Netplay.serverSock[num].tcpClient.NoDelay = true; + Console.WriteLine(Netplay.serverSock[num].tcpClient.Client.RemoteEndPoint + " is connecting..."); + continue; + } + catch (Exception ex) + { + if (!Netplay.disconnect) + { + Main.menuMode = 15; + Main.statusText = ex.ToString(); + Netplay.disconnect = true; + } + continue; + } + } + Netplay.stopListen = true; + Netplay.tcpListener.Stop(); + } + } + public static void StartClient() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.ClientLoop), 1); + } + public static void StartServer() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.ServerLoop), 1); + } + public static bool SetIP(string newIP) + { + try + { + Netplay.serverIP = IPAddress.Parse(newIP); + } + catch + { + return false; + } + return true; + } + public static bool SetIP2(string newIP) + { + bool result; + try + { + IPHostEntry hostEntry = Dns.GetHostEntry(newIP); + IPAddress[] addressList = hostEntry.AddressList; + for (int i = 0; i < addressList.Length; i++) + { + if (addressList[i].AddressFamily == AddressFamily.InterNetwork) + { + Netplay.serverIP = addressList[i]; + result = true; + return result; + } + } + result = false; + } + catch + { + result = false; + } + return result; + } + public static void Init() + { + for (int i = 0; i < 257; i++) + { + if (i < 256) + { + Netplay.serverSock[i] = new ServerSock(); + Netplay.serverSock[i].tcpClient.NoDelay = true; + } + NetMessage.buffer[i] = new messageBuffer(); + NetMessage.buffer[i].whoAmI = i; + } + Netplay.clientSock.tcpClient.NoDelay = true; + } + public static int GetSectionX(int x) + { + return x / 200; + } + public static int GetSectionY(int y) + { + return y / 150; + } + } +} diff --git a/Terraria/Player.cs b/Terraria/Player.cs new file mode 100644 index 0000000..ec506e7 --- /dev/null +++ b/Terraria/Player.cs @@ -0,0 +1,18178 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input; +using System; +using System.IO; +using System.Security.Cryptography; +using System.Text; +namespace Terraria +{ + public class Player + { + public const int maxBuffs = 10; + public Vector2[] itemFlamePos = new Vector2[7]; + public int itemFlameCount; + public bool outOfRange; + public bool teleporting; + public float teleportTime; + public int teleportStyle; + public bool sloping; + public bool chilled; + public bool frozen; + public bool ichor; + public int ropeCount; + public int manaRegenBonus; + public int manaRegenDelayBonus; + public int dash; + public int dashTime; + public int dashDelay; + public int gem = -1; + public int gemCount; + public byte meleeEnchant; + public byte pulleyDir; + public bool pulley; + public int pulleyFrame; + public float pulleyFrameCounter; + public bool blackBelt; + public bool sliding; + public int slideDir; + public int launcherWait; + public bool iceSkate; + public bool carpet; + public int spikedBoots; + public int carpetFrame = -1; + public float carpetFrameCounter; + public bool canCarpet; + public int carpetTime; + public int miscCounter; + public bool sandStorm; + public bool crimsonRegen; + public bool ghostHeal; + public bool sticky; + public bool slippy; + public bool slippy2; + public bool powerrun; + public bool flapSound; + public bool iceBarrier; + public bool panic; + public byte iceBarrierFrame; + public byte iceBarrierFrameCounter; + public bool shadowDodge; + public float shadowDodgeCount; + public bool palladiumRegen; + public bool onHitDodge; + public bool onHitRegen; + public bool onHitPetal; + public int petalTimer; + public int shadowDodgeTimer; + public int maxMinions = 1; + public int numMinions; + public bool pygmy; + public bool slime; + public int wingTime; + public int wings; + public int wingFrame; + public int wingFrameCounter; + public bool male = true; + public bool ghost; + public int ghostFrame; + public int ghostFrameCounter; + public int miscTimer; + public bool pvpDeath; + public bool zoneDungeon; + public bool zoneEvil; + public bool zoneHoly; + public bool zoneMeteor; + public bool zoneJungle; + public bool zoneSnow; + public bool zoneBlood; + public bool zoneCandle; + public bool boneArmor; + public bool frostArmor; + public bool honey; + public bool crystalLeaf; + public bool paladinBuff; + public bool paladinGive; + public float townNPCs; + public Vector2 position; + public Vector2 oldPosition; + public Vector2 velocity; + public Vector2 oldVelocity; + public double headFrameCounter; + public double bodyFrameCounter; + public double legFrameCounter; + public int netSkip; + public int oldSelectItem; + public bool immune; + public int immuneTime; + public int immuneAlphaDirection; + public int immuneAlpha; + public int team; + public bool hbLocked; + public static int nameLen = 20; + private float maxRegenDelay; + public string chatText = ""; + public int sign = -1; + public int chatShowTime; + public int reuseDelay; + public int aggro; + public float activeNPCs; + public bool mouseInterface; + public int noThrow; + public int changeItem = -1; + public int selectedItem; + public Item[] armor = new Item[11]; + public Item[] dye = new Item[3]; + public int itemAnimation; + public int itemAnimationMax; + public int itemTime; + public int toolTime; + public float itemRotation; + public int itemWidth; + public int itemHeight; + public Vector2 itemLocation; + public bool poundRelease; + public float ghostFade; + public float ghostDir = 1f; + public int[] buffType = new int[10]; + public int[] buffTime = new int[10]; + public bool[] buffImmune = new bool[81]; + public int heldProj = -1; + public int breathCD; + public int breathMax = 200; + public int breath = 200; + public int lavaCD; + public int lavaMax; + public int lavaTime; + public bool socialShadow; + public bool socialGhost; + public bool armorSteath; + public int stealthTimer; + public float stealth = 1f; + public string setBonus = ""; + public Item[] inventory = new Item[59]; + public Item[] bank = new Item[Chest.maxItems]; + public Item[] bank2 = new Item[Chest.maxItems]; + public float headRotation; + public float bodyRotation; + public float legRotation; + public Vector2 headPosition; + public Vector2 bodyPosition; + public Vector2 legPosition; + public Vector2 headVelocity; + public Vector2 bodyVelocity; + public Vector2 legVelocity; + public int nonTorch = -1; + public float gfxOffY; + public float stepSpeed = 1f; + public static bool deadForGood = false; + public bool dead; + public int respawnTimer; + public string name = ""; + public int attackCD; + public int potionDelay; + public byte difficulty; + public bool wet; + public byte wetCount; + public bool lavaWet; + public bool honeyWet; + public int hitTile; + public int hitTileX; + public int hitTileY; + public int jump; + public int head = -1; + public int body = -1; + public int legs = -1; + public Rectangle headFrame; + public Rectangle bodyFrame; + public Rectangle legFrame; + public Rectangle hairFrame; + public bool controlLeft; + public bool controlRight; + public bool controlUp; + public bool controlDown; + public bool controlJump; + public bool controlUseItem; + public bool controlUseTile; + public bool controlThrow; + public bool controlInv; + public bool controlHook; + public bool controlTorch; + public bool controlMap; + public bool releaseJump; + public bool releaseUp; + public bool releaseUseItem; + public bool releaseUseTile; + public bool releaseInventory; + public bool releaseHook; + public bool releaseThrow; + public bool releaseQuickMana; + public bool releaseQuickHeal; + public bool releaseLeft; + public bool releaseRight; + public bool mapZoomIn; + public bool mapZoomOut; + public bool mapAlphaUp; + public bool mapAlphaDown; + public bool mapFullScreen; + public bool mapStyle; + public bool releaseMapFullscreen; + public bool releaseMapStyle; + public int leftTimer; + public int rightTimer; + public bool delayUseItem; + public bool active; + public int width = 20; + public int height = 42; + public int direction = 1; + public bool showItemIcon; + public bool showItemIconR; + public int showItemIcon2; + public int whoAmi; + public int runSoundDelay; + public float shadow; + public float manaCost = 1f; + public bool fireWalk; + public Vector2[] shadowPos = new Vector2[3]; + public int shadowCount; + public bool channel; + public int step = -1; + public int statDefense; + public int statAttack; + public int statLifeMax = 100; + public int statLife = 100; + public int statMana; + public int statManaMax; + public int statManaMax2; + public int lifeRegen; + public int lifeRegenCount; + public int lifeRegenTime; + public int manaRegen; + public int manaRegenCount; + public int manaRegenDelay; + public bool manaRegenBuff; + public bool noKnockback; + public bool spaceGun; + public float gravDir = 1f; + public bool ammoCost80; + public bool ammoCost75; + public int stickyBreak; + public bool magicQuiver; + public bool magmaStone; + public bool lavaRose; + public bool lightOrb; + public bool fairy; + public bool bunny; + public bool turtle; + public bool eater; + public bool penguin; + public bool magicCuffs; + public bool coldDash; + public bool eyeSpring; + public bool snowman; + public bool scope; + public bool dino; + public bool skeletron; + public bool hornet; + public bool tiki; + public bool parrot; + public bool truffle; + public bool sapling; + public bool wisp; + public bool lizard; + public bool archery; + public bool poisoned; + public bool venom; + public bool blind; + public bool blackout; + public bool frostBurn; + public bool onFrostBurn; + public bool burned; + public bool suffocating; + public bool onFire; + public bool onFire2; + public bool noItems; + public bool wereWolf; + public bool wolfAcc; + public bool rulerAcc; + public bool bleed; + public bool confused; + public bool accMerman; + public bool merman; + public bool brokenArmor; + public bool silence; + public bool slow; + public bool gross; + public bool tongued; + public bool kbGlove; + public bool starCloak; + public bool longInvince; + public bool pStone; + public bool manaFlower; + public int meleeCrit = 4; + public int rangedCrit = 4; + public int magicCrit = 4; + public float meleeDamage = 1f; + public float rangedDamage = 1f; + public float bulletDamage = 1f; + public float arrowDamage = 1f; + public float rocketDamage = 1f; + public float magicDamage = 1f; + public float minionDamage = 1f; + public float minionKB; + public float meleeSpeed = 1f; + public float moveSpeed = 1f; + public float pickSpeed = 1f; + public int SpawnX = -1; + public int SpawnY = -1; + public int[] spX = new int[200]; + public int[] spY = new int[200]; + public string[] spN = new string[200]; + public int[] spI = new int[200]; + public static int tileRangeX = 5; + public static int tileRangeY = 4; + private static int tileTargetX; + private static int tileTargetY; + private static int jumpHeight = 15; + private static float jumpSpeed = 5.01f; + public bool adjWater; + public bool adjHoney; + public bool oldAdjWater; + public bool oldAdjHoney; + public bool[] adjTile = new bool[251]; + public bool[] oldAdjTile = new bool[251]; + private static int itemGrabRange = 38; + private static float itemGrabSpeed = 0.45f; + private static float itemGrabSpeedMax = 4f; + public Color hairColor = new Color(215, 90, 55); + public Color skinColor = new Color(255, 125, 90); + public Color eyeColor = new Color(105, 90, 75); + public Color shirtColor = new Color(175, 165, 140); + public Color underShirtColor = new Color(160, 180, 215); + public Color pantsColor = new Color(255, 230, 175); + public Color shoeColor = new Color(160, 105, 60); + public int hair; + public bool hostile; + public int accCompass; + public int accWatch; + public int accDepthMeter; + public bool discount; + public bool coins; + public bool accDivingHelm; + public bool accFlipper; + public bool doubleJump; + public bool jumpAgain; + public bool dJumpEffect; + public bool doubleJump2; + public bool jumpAgain2; + public bool dJumpEffect2; + public bool doubleJump3; + public bool jumpAgain3; + public bool dJumpEffect3; + public bool doubleJump4; + public bool jumpAgain4; + public bool dJumpEffect4; + public bool spawnMax; + public int blockRange; + public int[] grappling = new int[20]; + public int grapCount; + public int rocketTime; + public int rocketTimeMax = 7; + public int rocketDelay; + public int rocketDelay2; + public bool rocketRelease; + public bool rocketFrame; + public int rocketBoots; + public bool canRocket; + public bool jumpBoost; + public bool noFallDmg; + public int swimTime; + public bool killGuide; + public bool killClothier; + public bool lavaImmune; + public bool gills; + public bool slowFall; + public bool findTreasure; + public bool invis; + public bool detectCreature; + public bool nightVision; + public bool enemySpawns; + public bool thorns; + public bool turtleArmor; + public bool turtleThorns; + public bool waterWalk; + public bool waterWalk2; + public bool gravControl; + public bool gravControl2; + public bool bee; + public int chest = -1; + public int chestX; + public int chestY; + public int talkNPC = -1; + public int fallStart; + public int slowCount; + public int potionDelayTime = Item.potionDelay; + public void HealEffect(int healAmount, bool broadcast = true) + { + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(100, 255, 100, 255), string.Concat(healAmount), false, false); + if (broadcast && Main.netMode == 1 && this.whoAmi == Main.myPlayer) + { + NetMessage.SendData(35, -1, -1, "", this.whoAmi, (float)healAmount, 0f, 0f, 0); + } + } + public void ManaEffect(int manaAmount) + { + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(100, 100, 255, 255), string.Concat(manaAmount), false, false); + if (Main.netMode == 1 && this.whoAmi == Main.myPlayer) + { + NetMessage.SendData(43, -1, -1, "", this.whoAmi, (float)manaAmount, 0f, 0f, 0); + } + } + public static byte FindClosest(Vector2 Position, int Width, int Height) + { + byte result = 0; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active) + { + result = (byte)i; + break; + } + } + float num = -1f; + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && !Main.player[j].dead && (num == -1f || Math.Abs(Main.player[j].position.X + (float)(Main.player[j].width / 2) - Position.X + (float)(Width / 2)) + Math.Abs(Main.player[j].position.Y + (float)(Main.player[j].height / 2) - Position.Y + (float)(Height / 2)) < num)) + { + num = Math.Abs(Main.player[j].position.X + (float)(Main.player[j].width / 2) - Position.X + (float)(Width / 2)) + Math.Abs(Main.player[j].position.Y + (float)(Main.player[j].height / 2) - Position.Y + (float)(Height / 2)); + result = (byte)j; + } + } + return result; + } + public void checkArmor() + { + } + public void toggleInv() + { + if (this.talkNPC >= 0) + { + this.talkNPC = -1; + Main.npcChatText = ""; + Main.PlaySound(11, -1, -1, 1); + return; + } + if (this.sign >= 0) + { + this.sign = -1; + Main.editSign = false; + Main.npcChatText = ""; + Main.PlaySound(11, -1, -1, 1); + return; + } + if (!Main.playerInventory) + { + Recipe.FindRecipes(); + Main.playerInventory = true; + Main.PlaySound(10, -1, -1, 1); + return; + } + Main.playerInventory = false; + Main.PlaySound(11, -1, -1, 1); + } + public void dropItemCheck() + { + if (!Main.playerInventory) + { + this.noThrow = 0; + } + if (this.noThrow > 0) + { + this.noThrow--; + } + if (!Main.craftGuide && Main.guideItem.type > 0) + { + int num = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.guideItem.type, 1, false, 0, false); + Main.guideItem.position = Main.item[num].position; + Main.item[num] = Main.guideItem; + Main.guideItem = new Item(); + if (Main.netMode == 0) + { + Main.item[num].noGrabDelay = 100; + } + Main.item[num].velocity.Y = -2f; + Main.item[num].velocity.X = (float)(4 * this.direction) + this.velocity.X; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num, 0f, 0f, 0f, 0); + } + } + if (!Main.reforge && Main.reforgeItem.type > 0) + { + int num2 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, Main.reforgeItem.type, 1, false, 0, false); + Main.reforgeItem.position = Main.item[num2].position; + Main.item[num2] = Main.reforgeItem; + Main.reforgeItem = new Item(); + if (Main.netMode == 0) + { + Main.item[num2].noGrabDelay = 100; + } + Main.item[num2].velocity.Y = -2f; + Main.item[num2].velocity.X = (float)(4 * this.direction) + this.velocity.X; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num2, 0f, 0f, 0f, 0); + } + } + if (Main.myPlayer == this.whoAmi) + { + this.inventory[58] = (Item)Main.mouseItem.Clone(); + } + bool flag = true; + if (Main.mouseItem.type > 0 && Main.mouseItem.stack > 0) + { + Player.tileTargetX = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f); + Player.tileTargetY = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f); + if (this.gravDir == -1f) + { + Player.tileTargetY = (int)((Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY) / 16f); + } + if (this.selectedItem != 58) + { + this.oldSelectItem = this.selectedItem; + } + this.selectedItem = 58; + flag = false; + } + if (flag && this.selectedItem == 58) + { + this.selectedItem = this.oldSelectItem; + } + if (((this.controlThrow && this.releaseThrow && this.inventory[this.selectedItem].type > 0 && !Main.chatMode) || (((Main.mouseRight && !this.mouseInterface && Main.mouseRightRelease) || !Main.playerInventory) && Main.mouseItem.type > 0 && Main.mouseItem.stack > 0)) && this.noThrow <= 0) + { + Item item = new Item(); + bool flag2 = false; + if (((Main.mouseRight && !this.mouseInterface && Main.mouseRightRelease) || !Main.playerInventory) && Main.mouseItem.type > 0 && Main.mouseItem.stack > 0) + { + item = this.inventory[this.selectedItem]; + this.inventory[this.selectedItem] = Main.mouseItem; + this.delayUseItem = true; + this.controlUseItem = false; + flag2 = true; + } + int num3 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, this.inventory[this.selectedItem].type, 1, false, 0, false); + if (!flag2 && this.inventory[this.selectedItem].type == 8 && this.inventory[this.selectedItem].stack > 1) + { + this.inventory[this.selectedItem].stack--; + } + else + { + this.inventory[this.selectedItem].position = Main.item[num3].position; + Main.item[num3] = this.inventory[this.selectedItem]; + this.inventory[this.selectedItem] = new Item(); + } + if (Main.netMode == 0) + { + Main.item[num3].noGrabDelay = 100; + } + Main.item[num3].velocity.Y = -2f; + Main.item[num3].velocity.X = (float)(4 * this.direction) + this.velocity.X; + if (((Main.mouseRight && !this.mouseInterface) || !Main.playerInventory) && Main.mouseItem.type > 0) + { + this.inventory[this.selectedItem] = item; + Main.mouseItem = new Item(); + } + else + { + this.itemAnimation = 10; + this.itemAnimationMax = 10; + } + Recipe.FindRecipes(); + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num3, 0f, 0f, 0f, 0); + } + } + } + public void AddBuff(int type, int time, bool quiet = true) + { + if (this.buffImmune[type]) + { + return; + } + if (!quiet && Main.netMode == 1) + { + bool flag = true; + for (int i = 0; i < 10; i++) + { + if (this.buffType[i] == type) + { + flag = false; + } + } + if (flag) + { + NetMessage.SendData(55, -1, -1, "", this.whoAmi, (float)type, (float)time, 0f, 0); + } + } + int num = -1; + for (int j = 0; j < 10; j++) + { + if (this.buffType[j] == type) + { + if (this.buffTime[j] < time) + { + this.buffTime[j] = time; + } + return; + } + } + if (Main.vanityPet[type] || Main.lightPet[type]) + { + for (int k = 0; k < 10; k++) + { + if (Main.vanityPet[type] && Main.vanityPet[this.buffType[k]]) + { + this.DelBuff(k); + } + if (Main.lightPet[type] && Main.lightPet[this.buffType[k]]) + { + this.DelBuff(k); + } + } + } + while (num == -1) + { + int num2 = -1; + for (int l = 0; l < 10; l++) + { + if (!Main.debuff[this.buffType[l]]) + { + num2 = l; + break; + } + } + if (num2 == -1) + { + return; + } + for (int m = num2; m < 10; m++) + { + if (this.buffType[m] == 0) + { + num = m; + break; + } + } + if (num == -1) + { + this.DelBuff(num2); + } + } + this.buffType[num] = type; + this.buffTime[num] = time; + if (Main.meleeBuff[type]) + { + for (int n = 0; n < 10; n++) + { + if (n != num && Main.meleeBuff[this.buffType[n]]) + { + this.DelBuff(n); + } + } + } + } + public void DelBuff(int b) + { + this.buffTime[b] = 0; + this.buffType[b] = 0; + for (int i = 0; i < 9; i++) + { + if (this.buffTime[i] == 0 || this.buffType[i] == 0) + { + for (int j = i + 1; j < 10; j++) + { + this.buffTime[j - 1] = this.buffTime[j]; + this.buffType[j - 1] = this.buffType[j]; + this.buffTime[j] = 0; + this.buffType[j] = 0; + } + } + } + } + public void QuickHeal() + { + if (this.noItems) + { + return; + } + if (this.statLife == this.statLifeMax || this.potionDelay > 0) + { + return; + } + for (int i = 0; i < 58; i++) + { + if (this.inventory[i].stack > 0 && this.inventory[i].type > 0 && this.inventory[i].potion && this.inventory[i].healLife > 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, this.inventory[i].useSound); + if (this.inventory[i].potion) + { + this.potionDelay = this.potionDelayTime; + this.AddBuff(21, this.potionDelay, true); + } + this.statLife += this.inventory[i].healLife; + this.statMana += this.inventory[i].healMana; + if (this.statLife > this.statLifeMax) + { + this.statLife = this.statLifeMax; + } + if (this.statMana > this.statManaMax2) + { + this.statMana = this.statManaMax2; + } + if (this.inventory[i].healLife > 0 && Main.myPlayer == this.whoAmi) + { + this.HealEffect(this.inventory[i].healLife, true); + } + if (this.inventory[i].healMana > 0 && Main.myPlayer == this.whoAmi) + { + this.ManaEffect(this.inventory[i].healMana); + } + this.inventory[i].stack--; + if (this.inventory[i].stack <= 0) + { + this.inventory[i].type = 0; + this.inventory[i].name = ""; + } + Recipe.FindRecipes(); + return; + } + } + } + public void QuickMana() + { + if (this.noItems) + { + return; + } + if (this.statMana == this.statManaMax2) + { + return; + } + for (int i = 0; i < 58; i++) + { + if (this.inventory[i].stack > 0 && this.inventory[i].type > 0 && this.inventory[i].healMana > 0 && (this.potionDelay == 0 || !this.inventory[i].potion)) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, this.inventory[i].useSound); + if (this.inventory[i].potion) + { + this.potionDelay = this.potionDelayTime; + this.AddBuff(21, this.potionDelay, true); + } + this.statLife += this.inventory[i].healLife; + this.statMana += this.inventory[i].healMana; + if (this.statLife > this.statLifeMax) + { + this.statLife = this.statLifeMax; + } + if (this.statMana > this.statManaMax2) + { + this.statMana = this.statManaMax2; + } + if (this.inventory[i].healLife > 0 && Main.myPlayer == this.whoAmi) + { + this.HealEffect(this.inventory[i].healLife, true); + } + if (this.inventory[i].healMana > 0 && Main.myPlayer == this.whoAmi) + { + this.ManaEffect(this.inventory[i].healMana); + } + this.inventory[i].stack--; + if (this.inventory[i].stack <= 0) + { + this.inventory[i].type = 0; + this.inventory[i].name = ""; + } + Recipe.FindRecipes(); + return; + } + } + } + public int countBuffs() + { + int num = 0; + for (int i = 0; i < 10; i++) + { + if (this.buffType[num] > 0) + { + num++; + } + } + return num; + } + public void QuickBuff() + { + if (this.noItems) + { + return; + } + int num = 0; + for (int i = 0; i < 58; i++) + { + if (this.countBuffs() == 10) + { + return; + } + if (this.inventory[i].stack > 0 && this.inventory[i].type > 0 && this.inventory[i].buffType > 0 && !this.inventory[i].summon) + { + bool flag = true; + for (int j = 0; j < 10; j++) + { + if (this.buffType[j] == this.inventory[i].buffType) + { + flag = false; + break; + } + if (Main.meleeBuff[this.inventory[i].buffType] && Main.meleeBuff[this.buffType[j]]) + { + flag = false; + break; + } + } + if (Main.lightPet[this.inventory[i].buffType] || Main.vanityPet[this.inventory[i].buffType]) + { + for (int k = 0; k < 10; k++) + { + if (Main.lightPet[this.buffType[k]] && Main.lightPet[this.inventory[i].buffType]) + { + flag = false; + } + if (Main.vanityPet[this.buffType[k]] && Main.vanityPet[this.inventory[i].buffType]) + { + flag = false; + } + } + } + if (this.inventory[i].mana > 0 && flag) + { + if (this.statMana >= (int)((float)this.inventory[i].mana * this.manaCost)) + { + this.manaRegenDelay = (int)this.maxRegenDelay; + this.statMana -= (int)((float)this.inventory[i].mana * this.manaCost); + } + else + { + flag = false; + } + } + if (this.whoAmi == Main.myPlayer && this.inventory[i].type == 603 && !Main.cEd) + { + flag = false; + } + if (flag) + { + num = this.inventory[i].useSound; + int num2 = this.inventory[i].buffTime; + if (num2 == 0) + { + num2 = 3600; + } + this.AddBuff(this.inventory[i].buffType, num2, true); + if (this.inventory[i].consumable) + { + this.inventory[i].stack--; + if (this.inventory[i].stack <= 0) + { + this.inventory[i].type = 0; + this.inventory[i].name = ""; + } + } + } + } + } + if (num > 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, num); + Recipe.FindRecipes(); + } + } + public void StatusNPC(int type, int i) + { + if (this.meleeEnchant > 0) + { + if (this.meleeEnchant == 1) + { + Main.npc[i].AddBuff(70, 60 * Main.rand.Next(5, 10), false); + } + if (this.meleeEnchant == 2) + { + Main.npc[i].AddBuff(39, 60 * Main.rand.Next(3, 7), false); + } + if (this.meleeEnchant == 3) + { + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false); + } + if (this.meleeEnchant == 5) + { + Main.npc[i].AddBuff(69, 60 * Main.rand.Next(10, 20), false); + } + if (this.meleeEnchant == 6) + { + Main.npc[i].AddBuff(31, 60 * Main.rand.Next(1, 4), false); + } + if (this.meleeEnchant == 8) + { + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(5, 10), false); + } + if (this.meleeEnchant == 4) + { + Main.npc[i].AddBuff(69, 120, false); + } + } + if (this.frostBurn) + { + Main.npc[i].AddBuff(44, 60 * Main.rand.Next(5, 15), false); + } + if (this.magmaStone) + { + if (Main.rand.Next(7) == 0) + { + Main.npc[i].AddBuff(24, 360, false); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(24, 120, false); + } + else + { + Main.npc[i].AddBuff(24, 60, false); + } + } + } + if (type == 121) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[i].AddBuff(24, 180, false); + return; + } + } + else + { + if (type == 122) + { + if (Main.rand.Next(10) == 0) + { + Main.npc[i].AddBuff(24, 180, false); + return; + } + } + else + { + if (type == 190) + { + if (Main.rand.Next(4) == 0) + { + Main.npc[i].AddBuff(20, 420, false); + return; + } + } + else + { + if (type == 217) + { + if (Main.rand.Next(5) == 0) + { + Main.npc[i].AddBuff(24, 180, false); + return; + } + } + else + { + if (type == 1123 && Main.rand.Next(10) != 0) + { + Main.npc[i].AddBuff(31, 120, false); + } + } + } + } + } + } + public void StatusPvP(int type, int i) + { + if (this.meleeEnchant > 0) + { + if (this.meleeEnchant == 1) + { + Main.player[i].AddBuff(70, 60 * Main.rand.Next(5, 10), true); + } + if (this.meleeEnchant == 2) + { + Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7), true); + } + if (this.meleeEnchant == 3) + { + Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7), true); + } + if (this.meleeEnchant == 5) + { + Main.player[i].AddBuff(69, 60 * Main.rand.Next(10, 20), true); + } + if (this.meleeEnchant == 6) + { + Main.player[i].AddBuff(31, 60 * Main.rand.Next(1, 4), true); + } + if (this.meleeEnchant == 8) + { + Main.player[i].AddBuff(20, 60 * Main.rand.Next(5, 10), true); + } + } + if (this.frostBurn) + { + Main.player[i].AddBuff(44, 60 * Main.rand.Next(1, 8), true); + } + if (this.magmaStone) + { + if (Main.rand.Next(7) == 0) + { + Main.player[i].AddBuff(24, 360, true); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(24, 120, true); + } + else + { + Main.player[i].AddBuff(24, 60, true); + } + } + } + if (type == 121) + { + if (Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(24, 180, false); + return; + } + } + else + { + if (type == 122) + { + if (Main.rand.Next(10) == 0) + { + Main.player[i].AddBuff(24, 180, false); + return; + } + } + else + { + if (type == 190) + { + if (Main.rand.Next(4) == 0) + { + Main.player[i].AddBuff(20, 420, false); + return; + } + } + else + { + if (type == 217) + { + if (Main.rand.Next(5) == 0) + { + Main.player[i].AddBuff(24, 180, false); + return; + } + } + else + { + if (type == 1123 && Main.rand.Next(9) != 0) + { + Main.player[i].AddBuff(31, 120, false); + } + } + } + } + } + } + public void Ghost() + { + this.immune = false; + this.immuneAlpha = 0; + this.controlUp = false; + this.controlLeft = false; + this.controlDown = false; + this.controlRight = false; + this.controlJump = false; + if (Main.hasFocus && !Main.chatMode && !Main.editSign) + { + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + for (int i = 0; i < pressedKeys.Length; i++) + { + string a = string.Concat(pressedKeys[i]); + if (a == Main.cUp) + { + this.controlUp = true; + } + if (a == Main.cLeft) + { + this.controlLeft = true; + } + if (a == Main.cDown) + { + this.controlDown = true; + } + if (a == Main.cRight) + { + this.controlRight = true; + } + if (a == Main.cJump) + { + this.controlJump = true; + } + } + } + if (this.controlUp || this.controlJump) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y < -3f) + { + this.velocity.Y = -3f; + } + } + else + { + if (this.controlDown) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y > 3f) + { + this.velocity.Y = 3f; + } + } + else + { + if ((double)this.velocity.Y < -0.1 || (double)this.velocity.Y > 0.1) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + else + { + this.velocity.Y = 0f; + } + } + } + if (this.controlLeft && !this.controlRight) + { + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + this.velocity.X = this.velocity.X - 0.1f; + if (this.velocity.X < -3f) + { + this.velocity.X = -3f; + } + } + else + { + if (this.controlRight && !this.controlLeft) + { + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.9f; + } + this.velocity.X = this.velocity.X + 0.1f; + if (this.velocity.X > 3f) + { + this.velocity.X = 3f; + } + } + else + { + if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1) + { + this.velocity.X = this.velocity.X * 0.9f; + } + else + { + this.velocity.X = 0f; + } + } + } + this.position += this.velocity; + this.ghostFrameCounter++; + if (this.velocity.X < 0f) + { + this.direction = -1; + } + else + { + if (this.velocity.X > 0f) + { + this.direction = 1; + } + } + if (this.ghostFrameCounter >= 8) + { + this.ghostFrameCounter = 0; + this.ghostFrame++; + if (this.ghostFrame >= 4) + { + this.ghostFrame = 0; + } + } + if (this.position.X < Main.leftWorld + (float)(Lighting.offScreenTiles * 16) + 16f) + { + this.position.X = Main.leftWorld + (float)(Lighting.offScreenTiles * 16) + 16f; + this.velocity.X = 0f; + } + if (this.position.X + (float)this.width > Main.rightWorld - (float)(Lighting.offScreenTiles * 16) - 32f) + { + this.position.X = Main.rightWorld - (float)(Lighting.offScreenTiles * 16) - 32f - (float)this.width; + this.velocity.X = 0f; + } + if (this.position.Y < Main.topWorld + (float)(Lighting.offScreenTiles * 16) + 16f) + { + this.position.Y = Main.topWorld + (float)(Lighting.offScreenTiles * 16) + 16f; + if ((double)this.velocity.Y < -0.1) + { + this.velocity.Y = -0.1f; + } + } + if (this.position.Y > Main.bottomWorld - (float)(Lighting.offScreenTiles * 16) - 32f - (float)this.height) + { + this.position.Y = Main.bottomWorld - (float)(Lighting.offScreenTiles * 16) - 32f - (float)this.height; + this.velocity.Y = 0f; + } + } + public Vector2 Center() + { + return new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)); + } + public int GetWingTime() + { + if (this.wings == 1 || this.wings == 2) + { + return 100; + } + if (this.wings == 4) + { + return 115; + } + if (this.wings == 5 || this.wings == 6 || this.wings == 15) + { + return 130; + } + if (this.wings == 7 || this.wings == 8 || this.wings == 14) + { + return 140; + } + if (this.wings == 9 || this.wings == 10 || this.wings == 11 || this.wings == 13) + { + return 160; + } + if (this.wings == 12) + { + return 180; + } + if (this.wings == 16 || this.wings == 17 || this.wings == 18 || this.wings == 19) + { + return 190; + } + if (this.wings == 3) + { + return 220; + } + return 90; + } + public void onHit(float x, float y) + { + if (Main.myPlayer != this.whoAmi) + { + return; + } + if (this.onHitDodge && this.shadowDodgeTimer == 0 && Main.rand.Next(4) == 0) + { + if (!this.shadowDodge) + { + this.shadowDodgeTimer = 1200; + } + this.AddBuff(59, 1200, true); + } + if (this.onHitRegen) + { + this.AddBuff(58, 300, true); + } + if (this.onHitPetal && this.petalTimer == 0) + { + this.petalTimer = 20; + if (x < this.position.X + (float)(this.width / 2)) + { + } + int num = this.direction; + float num2 = Main.screenPosition.X; + if (num < 0) + { + num2 += (float)Main.screenWidth; + } + float num3 = Main.screenPosition.Y; + num3 += (float)Main.rand.Next(Main.screenHeight); + Vector2 vector = new Vector2(num2, num3); + float num4 = x - vector.X; + float num5 = y - vector.Y; + num4 += (float)Main.rand.Next(-50, 51) * 0.1f; + num5 += (float)Main.rand.Next(-50, 51) * 0.1f; + int num6 = 24; + float num7 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); + num7 = (float)num6 / num7; + num4 *= num7; + num5 *= num7; + Projectile.NewProjectile(num2, num3, num4, num5, 221, 36, 0f, this.whoAmi, 0f, 0f); + } + if (this.crystalLeaf && this.petalTimer == 0) + { + int arg_1AA_0 = this.inventory[this.selectedItem].type; + for (int i = 0; i < 1000; i++) + { + if (Main.projectile[i].owner == this.whoAmi && Main.projectile[i].type == 226) + { + this.petalTimer = 60; + float num8 = 12f; + Vector2 vector2 = new Vector2(Main.projectile[i].position.X + (float)this.width * 0.5f, Main.projectile[i].position.Y + (float)this.height * 0.5f); + float num9 = x - vector2.X; + float num10 = y - vector2.Y; + float num11 = (float)Math.Sqrt((double)(num9 * num9 + num10 * num10)); + num11 = num8 / num11; + num9 *= num11; + num10 *= num11; + Projectile.NewProjectile(Main.projectile[i].center().X - 4f, Main.projectile[i].center().Y, num9, num10, 227, 40, 5f, this.whoAmi, 0f, 0f); + return; + } + } + } + } + public void UpdatePlayer(int i) + { + if (this.launcherWait > 0) + { + this.launcherWait--; + } + float num = 10f; + float num2 = 0.4f; + Player.jumpHeight = 15; + Player.jumpSpeed = 5.01f; + if (this.wet) + { + if (this.honeyWet) + { + num2 = 0.1f; + num = 3f; + } + else + { + if (this.merman) + { + num2 = 0.3f; + num = 7f; + } + else + { + num2 = 0.2f; + num = 5f; + Player.jumpHeight = 30; + Player.jumpSpeed = 6.01f; + } + } + } + float num3 = 3f; + float num4 = 0.08f; + float num5 = 0.2f; + float num6 = num3; + this.heldProj = -1; + bool flag = false; + if (this.active) + { + Main.numPlayers++; + this.outOfRange = false; + if (this.whoAmi != Main.myPlayer) + { + int num7 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num8 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (Main.tile[num7, num8] == null) + { + flag = true; + } + else + { + if (Main.tile[num7 - 3, num8] == null) + { + flag = true; + } + else + { + if (Main.tile[num7 + 3, num8] == null) + { + flag = true; + } + else + { + if (Main.tile[num7, num8 - 3] == null) + { + flag = true; + } + else + { + if (Main.tile[num7, num8 + 3] == null) + { + flag = true; + } + } + } + } + } + if (flag) + { + this.outOfRange = true; + this.numMinions = 0; + this.itemAnimation = 0; + this.PlayerFrame(); + } + } + } + if (this.active && !flag) + { + this.miscCounter++; + if (this.miscCounter >= 300) + { + this.miscCounter = 0; + } + float num9 = (float)(Main.maxTilesX / 4200); + num9 *= num9; + float num10 = (float)((double)(this.position.Y / 16f - (60f + 10f * num9)) / (Main.worldSurface / 6.0)); + if ((double)num10 < 0.25) + { + num10 = 0.25f; + } + if (num10 > 1f) + { + num10 = 1f; + } + num2 *= num10; + this.maxRegenDelay = (1f - (float)this.statMana / (float)this.statManaMax2) * 60f * 4f + 45f; + this.shadowCount++; + if (this.shadowCount == 1) + { + this.shadowPos[2] = this.shadowPos[1]; + } + else + { + if (this.shadowCount == 2) + { + this.shadowPos[1] = this.shadowPos[0]; + } + else + { + if (this.shadowCount >= 3) + { + this.shadowCount = 0; + this.shadowPos[0] = this.position; + Vector2[] expr_306_cp_0 = this.shadowPos; + int expr_306_cp_1 = 0; + expr_306_cp_0[expr_306_cp_1].Y = expr_306_cp_0[expr_306_cp_1].Y + this.gfxOffY; + } + } + } + if (this.teleportTime > 0f) + { + if (this.teleportStyle == 1) + { + if ((float)Main.rand.Next(100) <= 100f * this.teleportTime) + { + int num11 = Dust.NewDust(new Vector2((float)this.getRect().X, (float)this.getRect().Y), this.getRect().Width, this.getRect().Height, 164, 0f, 0f, 0, default(Color), 1f); + Main.dust[num11].scale = this.teleportTime * 1.5f; + Main.dust[num11].noGravity = true; + Main.dust[num11].velocity *= 1.1f; + } + } + else + { + if ((float)Main.rand.Next(100) <= 100f * this.teleportTime * 2f) + { + int num12 = Dust.NewDust(new Vector2((float)this.getRect().X, (float)this.getRect().Y), this.getRect().Width, this.getRect().Height, 159, 0f, 0f, 0, default(Color), 1f); + Main.dust[num12].scale = this.teleportTime * 1.5f; + Main.dust[num12].noGravity = true; + Main.dust[num12].velocity *= 1.1f; + } + } + this.teleportTime -= 0.005f; + } + this.whoAmi = i; + if (this.runSoundDelay > 0) + { + this.runSoundDelay--; + } + if (this.attackCD > 0) + { + this.attackCD--; + } + if (this.itemAnimation == 0) + { + this.attackCD = 0; + } + if (this.chatShowTime > 0) + { + this.chatShowTime--; + } + if (this.potionDelay > 0) + { + this.potionDelay--; + } + if (i == Main.myPlayer) + { + if (Main.trashItem.type >= 1522 && Main.trashItem.type <= 1527) + { + Main.trashItem.SetDefaults(0, false); + } + this.zoneEvil = false; + if (Main.evilTiles >= 200) + { + this.zoneEvil = true; + } + this.zoneHoly = false; + if (Main.holyTiles >= 100) + { + this.zoneHoly = true; + } + this.zoneMeteor = false; + if (Main.meteorTiles >= 50) + { + this.zoneMeteor = true; + } + this.zoneDungeon = false; + if (Main.dungeonTiles >= 250 && (double)this.position.Y > Main.worldSurface * 16.0) + { + int num13 = (int)this.position.X / 16; + int num14 = (int)this.position.Y / 16; + if (Main.wallDungeon[(int)Main.tile[num13, num14].wall]) + { + this.zoneDungeon = true; + } + } + this.zoneJungle = false; + if (Main.jungleTiles >= 80) + { + this.zoneJungle = true; + } + this.zoneSnow = false; + if (Main.snowTiles >= 300) + { + this.zoneSnow = true; + } + this.zoneBlood = false; + if (Main.bloodTiles >= 200) + { + this.zoneBlood = true; + } + if (Main.waterCandles > 0) + { + this.zoneCandle = true; + } + else + { + this.zoneCandle = false; + } + } + if (this.ghost) + { + this.Ghost(); + return; + } + if (this.dead) + { + this.gem = -1; + this.slippy = false; + this.slippy2 = false; + this.powerrun = false; + this.wings = 0; + this.poisoned = false; + this.venom = false; + this.onFire = false; + this.burned = false; + this.suffocating = false; + this.onFire2 = false; + this.onFrostBurn = false; + this.blind = false; + this.blackout = false; + this.gravDir = 1f; + for (int j = 0; j < 10; j++) + { + this.buffTime[j] = 0; + this.buffType[j] = 0; + } + if (i == Main.myPlayer) + { + Main.npcChatText = ""; + Main.editSign = false; + } + this.grappling[0] = -1; + this.grappling[1] = -1; + this.grappling[2] = -1; + this.sign = -1; + this.talkNPC = -1; + this.statLife = 0; + this.channel = false; + this.potionDelay = 0; + this.chest = -1; + this.changeItem = -1; + this.itemAnimation = 0; + this.immuneAlpha += 2; + if (this.immuneAlpha > 255) + { + this.immuneAlpha = 255; + } + this.headPosition += this.headVelocity; + this.bodyPosition += this.bodyVelocity; + this.legPosition += this.legVelocity; + this.headRotation += this.headVelocity.X * 0.1f; + this.bodyRotation += this.bodyVelocity.X * 0.1f; + this.legRotation += this.legVelocity.X * 0.1f; + this.headVelocity.Y = this.headVelocity.Y + 0.1f; + this.bodyVelocity.Y = this.bodyVelocity.Y + 0.1f; + this.legVelocity.Y = this.legVelocity.Y + 0.1f; + this.headVelocity.X = this.headVelocity.X * 0.99f; + this.bodyVelocity.X = this.bodyVelocity.X * 0.99f; + this.legVelocity.X = this.legVelocity.X * 0.99f; + if (this.difficulty == 2) + { + if (this.respawnTimer > 0) + { + this.respawnTimer--; + return; + } + if (this.whoAmi == Main.myPlayer || Main.netMode == 2) + { + this.ghost = true; + return; + } + } + else + { + this.respawnTimer--; + if (this.respawnTimer <= 0 && Main.myPlayer == this.whoAmi) + { + if (Main.mouseItem.type > 0) + { + Main.playerInventory = true; + } + this.Spawn(); + return; + } + } + } + else + { + if (i == Main.myPlayer) + { + this.controlUp = false; + this.controlLeft = false; + this.controlDown = false; + this.controlRight = false; + this.controlJump = false; + this.controlUseItem = false; + this.controlUseTile = false; + this.controlThrow = false; + this.controlInv = false; + this.controlHook = false; + this.controlTorch = false; + this.mapStyle = false; + this.mapAlphaDown = false; + this.mapAlphaUp = false; + this.mapFullScreen = false; + this.mapZoomIn = false; + this.mapZoomOut = false; + if (Main.hasFocus) + { + if (!Main.chatMode && !Main.editSign) + { + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + bool flag2 = false; + bool flag3 = false; + for (int k = 0; k < pressedKeys.Length; k++) + { + string a = string.Concat(pressedKeys[k]); + if (a == Main.cUp) + { + this.controlUp = true; + } + if (a == Main.cLeft) + { + this.controlLeft = true; + } + if (a == Main.cDown) + { + this.controlDown = true; + } + if (a == Main.cRight) + { + this.controlRight = true; + } + if (a == Main.cJump) + { + this.controlJump = true; + } + if (a == Main.cThrowItem) + { + this.controlThrow = true; + } + if (a == Main.cInv) + { + this.controlInv = true; + } + if (a == Main.cBuff) + { + this.QuickBuff(); + } + if (a == Main.cHeal) + { + flag3 = true; + } + if (a == Main.cMana) + { + flag2 = true; + } + if (a == Main.cHook) + { + this.controlHook = true; + } + if (a == Main.cTorch) + { + this.controlTorch = true; + } + if (Main.mapEnabled) + { + if (a == Main.cMapZoomIn) + { + this.mapZoomIn = true; + } + if (a == Main.cMapZoomOut) + { + this.mapZoomOut = true; + } + if (a == Main.cMapAlphaUp) + { + this.mapAlphaUp = true; + } + if (a == Main.cMapAlphaDown) + { + this.mapAlphaDown = true; + } + if (a == Main.cMapFull) + { + this.mapFullScreen = true; + } + if (a == Main.cMapStyle) + { + this.mapStyle = true; + } + } + } + if (Main.gamePad) + { + GamePadState state = GamePad.GetState(PlayerIndex.One); + if (state.DPad.Up == ButtonState.Pressed) + { + this.controlUp = true; + } + if (state.DPad.Down == ButtonState.Pressed) + { + this.controlDown = true; + } + if (state.DPad.Left == ButtonState.Pressed) + { + this.controlLeft = true; + } + if (state.DPad.Right == ButtonState.Pressed) + { + this.controlRight = true; + } + if (state.Triggers.Left > 0f) + { + this.controlJump = true; + } + if (state.Triggers.Right > 0f) + { + this.controlUseItem = true; + } + Main.mouseX = (int)((float)(Main.screenWidth / 2) + state.ThumbSticks.Right.X * (float)Player.tileRangeX * 16f); + Main.mouseY = (int)((float)(Main.screenHeight / 2) - state.ThumbSticks.Right.Y * (float)Player.tileRangeX * 16f); + if (state.ThumbSticks.Right.X == 0f) + { + Main.mouseX = Main.screenWidth / 2 + this.direction * 2; + } + } + if (Main.mapFullscreen) + { + if (this.controlUp) + { + Main.mapFullscreenPos.Y = Main.mapFullscreenPos.Y - 1f * (16f / Main.mapFullscreenScale); + } + if (this.controlDown) + { + Main.mapFullscreenPos.Y = Main.mapFullscreenPos.Y + 1f * (16f / Main.mapFullscreenScale); + } + if (this.controlLeft) + { + Main.mapFullscreenPos.X = Main.mapFullscreenPos.X - 1f * (16f / Main.mapFullscreenScale); + } + if (this.controlRight) + { + Main.mapFullscreenPos.X = Main.mapFullscreenPos.X + 1f * (16f / Main.mapFullscreenScale); + } + this.controlUp = false; + this.controlLeft = false; + this.controlDown = false; + this.controlRight = false; + this.controlJump = false; + this.controlUseItem = false; + this.controlUseTile = false; + this.controlThrow = false; + this.controlHook = false; + this.controlTorch = false; + } + if (flag3) + { + if (this.releaseQuickHeal) + { + this.QuickHeal(); + } + this.releaseQuickHeal = false; + } + else + { + this.releaseQuickHeal = true; + } + if (flag2) + { + if (this.releaseQuickMana) + { + this.QuickMana(); + } + this.releaseQuickMana = false; + } + else + { + this.releaseQuickMana = true; + } + if (this.controlLeft && this.controlRight) + { + this.controlLeft = false; + this.controlRight = false; + } + if (Main.mapFullscreen) + { + if (this.mapZoomIn) + { + Main.mapFullscreenScale *= 1.05f; + } + if (this.mapZoomOut) + { + Main.mapFullscreenScale *= 0.95f; + } + } + else + { + if (Main.mapStyle == 1) + { + if (this.mapZoomIn) + { + Main.mapMinimapScale *= 1.025f; + } + if (this.mapZoomOut) + { + Main.mapMinimapScale *= 0.975f; + } + if (this.mapAlphaUp) + { + Main.mapMinimapAlpha += 0.015f; + } + if (this.mapAlphaDown) + { + Main.mapMinimapAlpha -= 0.015f; + } + } + else + { + if (Main.mapStyle == 2) + { + if (this.mapZoomIn) + { + Main.mapOverlayScale *= 1.05f; + } + if (this.mapZoomOut) + { + Main.mapOverlayScale *= 0.95f; + } + if (this.mapAlphaUp) + { + Main.mapOverlayAlpha += 0.015f; + } + if (this.mapAlphaDown) + { + Main.mapOverlayAlpha -= 0.015f; + } + } + } + if (this.mapStyle) + { + if (this.releaseMapStyle) + { + Main.PlaySound(12, -1, -1, 1); + Main.mapStyle++; + if (Main.mapStyle > 2) + { + Main.mapStyle = 0; + } + } + this.releaseMapStyle = false; + } + else + { + this.releaseMapStyle = true; + } + } + if (this.mapFullScreen) + { + if (this.releaseMapFullscreen) + { + if (Main.mapFullscreen) + { + Main.PlaySound(11, -1, -1, 1); + Main.mapFullscreen = false; + } + else + { + Main.playerInventory = false; + this.talkNPC = -1; + Main.PlaySound(10, -1, -1, 1); + float mapFullscreenScale = 2.5f; + Main.mapFullscreenScale = mapFullscreenScale; + Main.mapFullscreen = true; + Main.resetMapFull = true; + } + } + this.releaseMapFullscreen = false; + } + else + { + this.releaseMapFullscreen = true; + } + } + if (this.confused) + { + bool flag4 = this.controlLeft; + bool flag5 = this.controlUp; + this.controlLeft = this.controlRight; + this.controlRight = flag4; + this.controlUp = this.controlRight; + this.controlDown = flag5; + } + if (Main.mouseLeft && !this.mouseInterface) + { + this.controlUseItem = true; + } + if (Main.mouseRight && !this.mouseInterface) + { + this.controlUseTile = true; + } + if (this.controlInv) + { + if (this.releaseInventory) + { + if (Main.mapFullscreen) + { + Main.mapFullscreen = false; + this.releaseInventory = false; + Main.PlaySound(11, -1, -1, 1); + } + else + { + this.toggleInv(); + } + } + this.releaseInventory = false; + } + else + { + this.releaseInventory = true; + } + if (this.delayUseItem) + { + if (!this.controlUseItem) + { + this.delayUseItem = false; + } + this.controlUseItem = false; + } + if (this.itemAnimation == 0 && this.itemTime == 0) + { + this.dropItemCheck(); + int num15 = this.selectedItem; + if (!Main.chatMode && this.selectedItem != 58) + { + if (Main.keyState.IsKeyDown(Keys.D1)) + { + this.selectedItem = 0; + } + if (Main.keyState.IsKeyDown(Keys.D2)) + { + this.selectedItem = 1; + } + if (Main.keyState.IsKeyDown(Keys.D3)) + { + this.selectedItem = 2; + } + if (Main.keyState.IsKeyDown(Keys.D4)) + { + this.selectedItem = 3; + } + if (Main.keyState.IsKeyDown(Keys.D5)) + { + this.selectedItem = 4; + } + if (Main.keyState.IsKeyDown(Keys.D6)) + { + this.selectedItem = 5; + } + if (Main.keyState.IsKeyDown(Keys.D7)) + { + this.selectedItem = 6; + } + if (Main.keyState.IsKeyDown(Keys.D8)) + { + this.selectedItem = 7; + } + if (Main.keyState.IsKeyDown(Keys.D9)) + { + this.selectedItem = 8; + } + if (Main.keyState.IsKeyDown(Keys.D0)) + { + this.selectedItem = 9; + } + } + if (num15 != this.selectedItem) + { + Main.PlaySound(12, -1, -1, 1); + } + if (Main.mapFullscreen) + { + int num16 = (Main.mouseState.ScrollWheelValue - Main.oldMouseState.ScrollWheelValue) / 120; + Main.mapFullscreenScale *= 1f + (float)num16 * 0.3f; + } + else + { + if (!Main.playerInventory) + { + int l; + for (l = (Main.mouseState.ScrollWheelValue - Main.oldMouseState.ScrollWheelValue) / 120; l > 9; l -= 10) + { + } + while (l < 0) + { + l += 10; + } + this.selectedItem -= l; + if (l != 0) + { + Main.PlaySound(12, -1, -1, 1); + } + if (this.changeItem >= 0) + { + if (this.selectedItem != this.changeItem) + { + Main.PlaySound(12, -1, -1, 1); + } + this.selectedItem = this.changeItem; + this.changeItem = -1; + } + while (this.selectedItem > 9) + { + this.selectedItem -= 10; + } + while (this.selectedItem < 0) + { + this.selectedItem += 10; + } + } + else + { + int num17 = (Main.mouseState.ScrollWheelValue - Main.oldMouseState.ScrollWheelValue) / 120; + Main.focusRecipe += num17; + if (Main.focusRecipe > Main.numAvailableRecipes - 1) + { + Main.focusRecipe = Main.numAvailableRecipes - 1; + } + if (Main.focusRecipe < 0) + { + Main.focusRecipe = 0; + } + } + } + } + } + if (this.selectedItem == 58) + { + this.nonTorch = -1; + } + else + { + if (this.controlTorch && this.itemAnimation == 0) + { + int num18 = 0; + int num19 = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f); + int num20 = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f); + if (this.gravDir == -1f) + { + num20 = (int)((Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY) / 16f); + } + if (this.position.X / 16f - (float)Player.tileRangeX <= (float)num19 && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX - 1f >= (float)num19 && this.position.Y / 16f - (float)Player.tileRangeY <= (float)num20 && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY - 2f >= (float)num20) + { + try + { + if (Main.tile[num19, num20].active()) + { + int type = (int)Main.tile[num19, num20].type; + if (type == 209) + { + num18 = 6; + } + else + { + if (Main.tileHammer[type]) + { + num18 = 1; + } + else + { + if (Main.tileAxe[type]) + { + num18 = 2; + } + else + { + num18 = 3; + } + } + } + } + else + { + if (Main.tile[num19, num20].liquid > 0 && this.wet) + { + num18 = 4; + } + } + goto IL_1561; + } + catch + { + goto IL_1561; + } + } + if (this.wet) + { + num18 = 4; + } + IL_1561: + if (num18 == 0) + { + float num21 = Math.Abs((float)Main.mouseX + Main.screenPosition.X - (this.position.X + (float)(this.width / 2))); + float num22 = Math.Abs((float)Main.mouseY + Main.screenPosition.Y - (this.position.Y + (float)(this.height / 2))) * 1.3f; + float num23 = (float)Math.Sqrt((double)(num21 * num21 + num22 * num22)); + if (num23 > 200f) + { + num18 = 5; + } + } + for (int m = 0; m < 50; m++) + { + int type2 = this.inventory[m].type; + if (num18 == 0) + { + if (type2 == 8 || type2 == 427 || type2 == 428 || type2 == 429 || type2 == 430 || type2 == 431 || type2 == 432 || type2 == 433 || type2 == 523 || type2 == 974 || type2 == 1245 || type2 == 1333) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + if (type2 == 282 || type2 == 286) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + } + } + else + { + if (num18 == 1) + { + if (this.inventory[m].hammer > 0) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + else + { + if (num18 == 2) + { + if (this.inventory[m].axe > 0) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + else + { + if (num18 == 3) + { + if (this.inventory[m].pick > 0) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + else + { + if (num18 == 4) + { + if (type2 == 8 || type2 == 427 || type2 == 428 || type2 == 429 || type2 == 430 || type2 == 431 || type2 == 432 || type2 == 433 || type2 == 523 || type2 == 974 || type2 == 1245 || type2 == 1333) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + if (this.inventory[this.selectedItem].createTile != 4) + { + this.selectedItem = m; + } + } + else + { + if (type2 == 930) + { + bool flag6 = false; + for (int n = 57; n >= 0; n--) + { + if (this.inventory[n].ammo == this.inventory[m].useAmmo) + { + flag6 = true; + break; + } + } + if (flag6) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + else + { + if (type2 == 282 || type2 == 286 || type2 == 523 || type2 == 1333) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + } + } + else + { + if (num18 == 5) + { + if (type2 == 8 || type2 == 427 || type2 == 428 || type2 == 429 || type2 == 430 || type2 == 431 || type2 == 432 || type2 == 433 || type2 == 523 || type2 == 974 || type2 == 1245 || type2 == 1333) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + if (this.inventory[this.selectedItem].createTile != 4) + { + this.selectedItem = m; + } + } + else + { + if (type2 == 930) + { + bool flag7 = false; + for (int num24 = 57; num24 >= 0; num24--) + { + if (this.inventory[num24].ammo == this.inventory[m].useAmmo) + { + flag7 = true; + break; + } + } + if (flag7) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + else + { + if (type2 == 282 || type2 == 286) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + } + } + else + { + if (num18 == 6) + { + int num25 = 929; + if (Main.tile[num19, num20].frameX >= 72) + { + num25 = 1338; + } + if (type2 == num25) + { + if (this.nonTorch == -1) + { + this.nonTorch = this.selectedItem; + } + this.selectedItem = m; + break; + } + } + } + } + } + } + } + } + } + } + else + { + if (this.nonTorch > -1 && this.itemAnimation == 0) + { + this.selectedItem = this.nonTorch; + this.nonTorch = -1; + } + } + } + if (this.frozen) + { + this.controlJump = false; + this.controlDown = false; + this.controlLeft = false; + this.controlRight = false; + this.controlUp = false; + this.controlUseItem = false; + this.controlUseTile = false; + this.controlThrow = false; + } + if (!this.controlThrow) + { + this.releaseThrow = true; + } + else + { + this.releaseThrow = false; + } + if (Main.netMode == 1) + { + bool flag8 = false; + if (this.statLife != Main.clientPlayer.statLife || this.statLifeMax != Main.clientPlayer.statLifeMax) + { + NetMessage.SendData(16, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + flag8 = true; + } + if (this.statMana != Main.clientPlayer.statMana || this.statManaMax != Main.clientPlayer.statManaMax) + { + NetMessage.SendData(42, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + flag8 = true; + } + if (this.controlUp != Main.clientPlayer.controlUp) + { + flag8 = true; + } + if (this.controlDown != Main.clientPlayer.controlDown) + { + flag8 = true; + } + if (this.controlLeft != Main.clientPlayer.controlLeft) + { + flag8 = true; + } + if (this.controlRight != Main.clientPlayer.controlRight) + { + flag8 = true; + } + if (this.controlJump != Main.clientPlayer.controlJump) + { + flag8 = true; + } + if (this.controlUseItem != Main.clientPlayer.controlUseItem) + { + flag8 = true; + } + if (this.selectedItem != Main.clientPlayer.selectedItem) + { + flag8 = true; + } + if (flag8) + { + NetMessage.SendData(13, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + } + } + if (Main.playerInventory) + { + this.AdjTiles(); + } + if (this.chest != -1) + { + int num26 = (int)(((double)this.position.X + (double)this.width * 0.5) / 16.0); + int num27 = (int)(((double)this.position.Y + (double)this.height * 0.5) / 16.0); + if (num26 < this.chestX - 5 || num26 > this.chestX + 6 || num27 < this.chestY - 4 || num27 > this.chestY + 5) + { + if (this.chest != -1) + { + Main.PlaySound(11, -1, -1, 1); + } + this.chest = -1; + } + if (!Main.tile[this.chestX, this.chestY].active()) + { + Main.PlaySound(11, -1, -1, 1); + this.chest = -1; + } + } + if (this.velocity.Y == 0f) + { + int num28 = (int)(this.position.Y / 16f) - this.fallStart; + if (((this.gravDir == 1f && num28 > 25) || (this.gravDir == -1f && num28 < -25)) && !this.noFallDmg && this.wings == 0) + { + int damage = (int)((float)num28 * this.gravDir - 25f) * 10; + this.immune = false; + this.Hurt(damage, 0, false, false, Lang.deathMsg(-1, -1, -1, 0), false); + } + this.fallStart = (int)(this.position.Y / 16f); + } + if (this.jump > 0 || this.rocketDelay > 0 || this.wet || this.slowFall || (double)num10 < 0.8 || this.tongued) + { + this.fallStart = (int)(this.position.Y / 16f); + } + } + if (this.mouseInterface) + { + this.delayUseItem = true; + } + Player.tileTargetX = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f); + Player.tileTargetY = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f); + if (this.gravDir == -1f) + { + Player.tileTargetY = (int)((Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY) / 16f); + } + if (this.immune) + { + this.immuneTime--; + if (this.immuneTime <= 0) + { + this.immune = false; + } + this.immuneAlpha += this.immuneAlphaDirection * 50; + if (this.immuneAlpha <= 50) + { + this.immuneAlphaDirection = 1; + } + else + { + if (this.immuneAlpha >= 205) + { + this.immuneAlphaDirection = -1; + } + } + } + else + { + this.immuneAlpha = 0; + } + if (this.petalTimer > 0) + { + this.petalTimer--; + } + if (this.shadowDodgeTimer > 0) + { + this.shadowDodgeTimer--; + } + if (this.jump > 0 || this.velocity.Y != 0f) + { + this.slippy = false; + this.slippy2 = false; + this.powerrun = false; + this.sticky = false; + } + this.potionDelayTime = Item.potionDelay; + if (this.pStone) + { + this.potionDelayTime -= 900; + } + this.armorSteath = false; + this.statDefense = 0; + this.accWatch = 0; + this.accCompass = 0; + this.accDepthMeter = 0; + this.accDivingHelm = false; + this.lifeRegen = 0; + this.manaCost = 1f; + this.meleeSpeed = 1f; + this.meleeDamage = 1f; + this.rangedDamage = 1f; + this.magicDamage = 1f; + this.minionDamage = 1f; + this.minionKB = 0f; + this.moveSpeed = 1f; + this.boneArmor = false; + this.honey = false; + this.frostArmor = false; + this.rocketBoots = 0; + this.fireWalk = false; + this.noKnockback = false; + this.jumpBoost = false; + this.noFallDmg = false; + this.accFlipper = false; + this.spawnMax = false; + this.spaceGun = false; + this.killGuide = false; + this.killClothier = false; + this.lavaImmune = false; + this.gills = false; + this.slowFall = false; + this.findTreasure = false; + this.invis = false; + this.nightVision = false; + this.enemySpawns = false; + this.thorns = false; + this.aggro = 0; + this.waterWalk = false; + this.waterWalk2 = false; + this.detectCreature = false; + this.gravControl = false; + this.bee = false; + this.gravControl2 = false; + this.statManaMax2 = this.statManaMax; + this.ammoCost80 = false; + this.ammoCost75 = false; + this.manaRegenBuff = false; + this.meleeCrit = 4; + this.rangedCrit = 4; + this.magicCrit = 4; + this.arrowDamage = 1f; + this.bulletDamage = 1f; + this.rocketDamage = 1f; + this.lightOrb = false; + this.fairy = false; + this.wisp = false; + this.bunny = false; + this.turtle = false; + this.eater = false; + this.skeletron = false; + this.hornet = false; + this.tiki = false; + this.lizard = false; + this.parrot = false; + this.sapling = false; + this.truffle = false; + this.shadowDodge = false; + this.palladiumRegen = false; + this.onHitDodge = false; + this.onHitRegen = false; + this.onHitPetal = false; + this.iceBarrier = false; + this.maxMinions = 1; + this.penguin = false; + this.magicCuffs = false; + this.coldDash = false; + this.magicQuiver = false; + this.magmaStone = false; + this.lavaRose = false; + this.eyeSpring = false; + this.snowman = false; + this.scope = false; + this.panic = false; + this.dino = false; + this.crystalLeaf = false; + this.pygmy = false; + this.slime = false; + this.chilled = false; + this.frozen = false; + this.ichor = false; + this.manaRegenBonus = 0; + this.manaRegenDelayBonus = 0; + this.carpet = false; + this.iceSkate = false; + this.dash = 0; + this.spikedBoots = 0; + this.blackBelt = false; + this.lavaMax = 0; + this.archery = false; + this.poisoned = false; + this.venom = false; + this.blind = false; + this.blackout = false; + this.onFire = false; + this.burned = false; + this.suffocating = false; + this.onFire2 = false; + this.onFrostBurn = false; + this.frostBurn = false; + this.noItems = false; + this.blockRange = 0; + this.pickSpeed = 1f; + this.wereWolf = false; + this.rulerAcc = false; + this.bleed = false; + this.confused = false; + this.wings = 0; + this.brokenArmor = false; + this.silence = false; + this.slow = false; + this.gross = false; + this.tongued = false; + this.kbGlove = false; + this.starCloak = false; + this.longInvince = false; + this.pStone = false; + this.manaFlower = false; + this.crimsonRegen = false; + this.ghostHeal = false; + this.turtleArmor = false; + this.turtleThorns = false; + this.meleeEnchant = 0; + this.discount = false; + this.coins = false; + this.doubleJump2 = false; + this.doubleJump3 = false; + this.doubleJump4 = false; + this.paladinBuff = false; + this.paladinGive = false; + this.meleeCrit += this.inventory[this.selectedItem].crit; + this.magicCrit += this.inventory[this.selectedItem].crit; + this.rangedCrit += this.inventory[this.selectedItem].crit; + if (this.whoAmi == Main.myPlayer) + { + Main.musicBox2 = -1; + } + for (int num29 = 0; num29 < 81; num29++) + { + this.buffImmune[num29] = false; + } + for (int num30 = 0; num30 < 10; num30++) + { + if (this.buffType[num30] > 0 && this.buffTime[num30] > 0) + { + if (this.whoAmi == Main.myPlayer && this.buffType[num30] != 28) + { + this.buffTime[num30]--; + } + if (this.buffType[num30] == 1) + { + this.lavaImmune = true; + this.fireWalk = true; + } + else + { + if (this.buffType[num30] == 2) + { + this.lifeRegen += 2; + } + else + { + if (this.buffType[num30] == 3) + { + this.moveSpeed += 0.25f; + } + else + { + if (this.buffType[num30] == 4) + { + this.gills = true; + } + else + { + if (this.buffType[num30] == 5) + { + this.statDefense += 8; + } + else + { + if (this.buffType[num30] == 6) + { + this.manaRegenBuff = true; + } + else + { + if (this.buffType[num30] == 7) + { + this.magicDamage += 0.2f; + } + else + { + if (this.buffType[num30] == 8) + { + this.slowFall = true; + } + else + { + if (this.buffType[num30] == 9) + { + this.findTreasure = true; + } + else + { + if (this.buffType[num30] == 10) + { + this.invis = true; + } + else + { + if (this.buffType[num30] == 11) + { + Lighting.addLight((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, 0.8f, 0.95f, 1f); + } + else + { + if (this.buffType[num30] == 12) + { + this.nightVision = true; + } + else + { + if (this.buffType[num30] == 13) + { + this.enemySpawns = true; + } + else + { + if (this.buffType[num30] == 14) + { + this.thorns = true; + } + else + { + if (this.buffType[num30] == 15) + { + this.waterWalk = true; + } + else + { + if (this.buffType[num30] == 16) + { + this.archery = true; + } + else + { + if (this.buffType[num30] == 17) + { + this.detectCreature = true; + } + else + { + if (this.buffType[num30] == 18) + { + this.gravControl = true; + } + else + { + if (this.buffType[num30] == 30) + { + this.bleed = true; + } + else + { + if (this.buffType[num30] == 31) + { + this.confused = true; + } + else + { + if (this.buffType[num30] == 32) + { + this.slow = true; + } + else + { + if (this.buffType[num30] == 35) + { + this.silence = true; + } + else + { + if (this.buffType[num30] == 46) + { + this.chilled = true; + } + else + { + if (this.buffType[num30] == 47) + { + this.frozen = true; + } + else + { + if (this.buffType[num30] == 69) + { + this.ichor = true; + this.statDefense -= 20; + } + else + { + if (this.buffType[num30] == 36) + { + this.brokenArmor = true; + } + else + { + if (this.buffType[num30] == 48) + { + this.honey = true; + } + else + { + if (this.buffType[num30] == 59) + { + this.shadowDodge = true; + } + else + { + if (this.buffType[num30] == 58) + { + this.palladiumRegen = true; + } + else + { + if (this.buffType[num30] == 63) + { + this.moveSpeed += 1f; + } + else + { + if (this.buffType[num30] == 62) + { + if ((double)this.statLife <= (double)this.statLifeMax * 0.25) + { + Lighting.addLight((int)(this.Center().X / 16f), (int)(this.Center().Y / 16f), 0.1f, 0.2f, 0.45f); + this.iceBarrier = true; + this.statDefense += 30; + this.iceBarrierFrameCounter += 1; + if (this.iceBarrierFrameCounter > 2) + { + this.iceBarrierFrameCounter = 0; + this.iceBarrierFrame += 1; + if (this.iceBarrierFrame >= 12) + { + this.iceBarrierFrame = 0; + } + } + } + else + { + this.DelBuff(num30); + } + } + else + { + if (this.buffType[num30] == 49) + { + if (Main.myPlayer == i) + { + for (int num31 = 0; num31 < 1000; num31++) + { + if (Main.projectile[num31].active && Main.projectile[num31].owner == i && Main.projectile[num31].type >= 191 && Main.projectile[num31].type <= 194) + { + this.pygmy = true; + break; + } + } + if (!this.pygmy) + { + this.DelBuff(num30); + } + else + { + this.buffTime[num30] = 18000; + } + } + } + else + { + if (this.buffType[num30] == 64) + { + if (Main.myPlayer == i) + { + for (int num32 = 0; num32 < 1000; num32++) + { + if (Main.projectile[num32].active && Main.projectile[num32].owner == i && Main.projectile[num32].type == 266) + { + this.slime = true; + break; + } + } + if (!this.slime) + { + this.DelBuff(num30); + } + else + { + this.buffTime[num30] = 18000; + } + } + } + else + { + if (this.buffType[num30] == 37) + { + if (Main.wof >= 0 && Main.npc[Main.wof].type == 113) + { + this.gross = true; + this.buffTime[num30] = 10; + } + else + { + this.DelBuff(num30); + } + } + else + { + if (this.buffType[num30] == 38) + { + this.buffTime[num30] = 10; + this.tongued = true; + } + else + { + if (this.buffType[num30] == 19) + { + this.buffTime[num30] = 18000; + this.lightOrb = true; + bool flag9 = true; + for (int num33 = 0; num33 < 1000; num33++) + { + if (Main.projectile[num33].active && Main.projectile[num33].owner == this.whoAmi && Main.projectile[num33].type == 18) + { + flag9 = false; + } + } + if (flag9) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 18, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 27) + { + this.buffTime[num30] = 18000; + this.fairy = true; + bool flag10 = true; + for (int num34 = 0; num34 < 1000; num34++) + { + if (Main.projectile[num34].active && Main.projectile[num34].owner == this.whoAmi && (Main.projectile[num34].type == 72 || Main.projectile[num34].type == 86 || Main.projectile[num34].type == 87)) + { + flag10 = false; + break; + } + } + if (flag10) + { + int num35 = Main.rand.Next(3); + if (num35 == 0) + { + num35 = 72; + } + else + { + if (num35 == 1) + { + num35 = 86; + } + else + { + if (num35 == 2) + { + num35 = 87; + } + } + } + if (this.head == 45 && this.body == 26 && this.legs == 25) + { + num35 = 72; + } + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, num35, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 40) + { + this.buffTime[num30] = 18000; + this.bunny = true; + bool flag11 = true; + for (int num36 = 0; num36 < 1000; num36++) + { + if (Main.projectile[num36].active && Main.projectile[num36].owner == this.whoAmi && Main.projectile[num36].type == 111) + { + flag11 = false; + break; + } + } + if (flag11) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 111, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 41) + { + this.buffTime[num30] = 18000; + this.penguin = true; + bool flag12 = true; + for (int num37 = 0; num37 < 1000; num37++) + { + if (Main.projectile[num37].active && Main.projectile[num37].owner == this.whoAmi && Main.projectile[num37].type == 112) + { + flag12 = false; + break; + } + } + if (flag12) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 112, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 61) + { + this.buffTime[num30] = 18000; + this.dino = true; + bool flag13 = true; + for (int num38 = 0; num38 < 1000; num38++) + { + if (Main.projectile[num38].active && Main.projectile[num38].owner == this.whoAmi && Main.projectile[num38].type == 236) + { + flag13 = false; + break; + } + } + if (flag13) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 236, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 65) + { + this.buffTime[num30] = 18000; + this.eyeSpring = true; + bool flag14 = true; + for (int num39 = 0; num39 < 1000; num39++) + { + if (Main.projectile[num39].active && Main.projectile[num39].owner == this.whoAmi && Main.projectile[num39].type == 268) + { + flag14 = false; + break; + } + } + if (flag14) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 268, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 66) + { + this.buffTime[num30] = 18000; + this.snowman = true; + bool flag15 = true; + for (int num40 = 0; num40 < 1000; num40++) + { + if (Main.projectile[num40].active && Main.projectile[num40].owner == this.whoAmi && Main.projectile[num40].type == 269) + { + flag15 = false; + break; + } + } + if (flag15) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 269, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 42) + { + this.buffTime[num30] = 18000; + this.turtle = true; + bool flag16 = true; + for (int num41 = 0; num41 < 1000; num41++) + { + if (Main.projectile[num41].active && Main.projectile[num41].owner == this.whoAmi && Main.projectile[num41].type == 127) + { + flag16 = false; + break; + } + } + if (flag16) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 127, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 45) + { + this.buffTime[num30] = 18000; + this.eater = true; + bool flag17 = true; + for (int num42 = 0; num42 < 1000; num42++) + { + if (Main.projectile[num42].active && Main.projectile[num42].owner == this.whoAmi && Main.projectile[num42].type == 175) + { + flag17 = false; + break; + } + } + if (flag17) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 175, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 50) + { + this.buffTime[num30] = 18000; + this.skeletron = true; + bool flag18 = true; + for (int num43 = 0; num43 < 1000; num43++) + { + if (Main.projectile[num43].active && Main.projectile[num43].owner == this.whoAmi && Main.projectile[num43].type == 197) + { + flag18 = false; + break; + } + } + if (flag18) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 197, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 51) + { + this.buffTime[num30] = 18000; + this.hornet = true; + bool flag19 = true; + for (int num44 = 0; num44 < 1000; num44++) + { + if (Main.projectile[num44].active && Main.projectile[num44].owner == this.whoAmi && Main.projectile[num44].type == 198) + { + flag19 = false; + break; + } + } + if (flag19) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 198, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 52) + { + this.buffTime[num30] = 18000; + this.tiki = true; + bool flag20 = true; + for (int num45 = 0; num45 < 1000; num45++) + { + if (Main.projectile[num45].active && Main.projectile[num45].owner == this.whoAmi && Main.projectile[num45].type == 199) + { + flag20 = false; + break; + } + } + if (flag20) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 199, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 53) + { + this.buffTime[num30] = 18000; + this.lizard = true; + bool flag21 = true; + for (int num46 = 0; num46 < 1000; num46++) + { + if (Main.projectile[num46].active && Main.projectile[num46].owner == this.whoAmi && Main.projectile[num46].type == 200) + { + flag21 = false; + break; + } + } + if (flag21) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 200, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 54) + { + this.buffTime[num30] = 18000; + this.parrot = true; + bool flag22 = true; + for (int num47 = 0; num47 < 1000; num47++) + { + if (Main.projectile[num47].active && Main.projectile[num47].owner == this.whoAmi && Main.projectile[num47].type == 208) + { + flag22 = false; + break; + } + } + if (flag22) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 208, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 55) + { + this.buffTime[num30] = 18000; + this.truffle = true; + bool flag23 = true; + for (int num48 = 0; num48 < 1000; num48++) + { + if (Main.projectile[num48].active && Main.projectile[num48].owner == this.whoAmi && Main.projectile[num48].type == 209) + { + flag23 = false; + break; + } + } + if (flag23) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 209, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 56) + { + this.buffTime[num30] = 18000; + this.sapling = true; + bool flag24 = true; + for (int num49 = 0; num49 < 1000; num49++) + { + if (Main.projectile[num49].active && Main.projectile[num49].owner == this.whoAmi && Main.projectile[num49].type == 210) + { + flag24 = false; + break; + } + } + if (flag24) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 210, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 57) + { + this.buffTime[num30] = 18000; + this.wisp = true; + bool flag25 = true; + for (int num50 = 0; num50 < 1000; num50++) + { + if (Main.projectile[num50].active && Main.projectile[num50].owner == this.whoAmi && Main.projectile[num50].type == 211) + { + flag25 = false; + break; + } + } + if (flag25) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 211, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 60) + { + this.buffTime[num30] = 18000; + this.crystalLeaf = true; + bool flag26 = true; + for (int num51 = 0; num51 < 1000; num51++) + { + if (Main.projectile[num51].active && Main.projectile[num51].owner == this.whoAmi && Main.projectile[num51].type == 226) + { + if (!flag26) + { + Main.projectile[num51].Kill(); + } + flag26 = false; + } + } + if (flag26) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), 0f, 0f, 226, 0, 0f, this.whoAmi, 0f, 0f); + } + } + else + { + if (this.buffType[num30] == 70) + { + this.venom = true; + } + else + { + if (this.buffType[num30] == 20) + { + this.poisoned = true; + } + else + { + if (this.buffType[num30] == 21) + { + this.potionDelay = this.buffTime[num30]; + } + else + { + if (this.buffType[num30] == 22) + { + this.blind = true; + } + else + { + if (this.buffType[num30] == 80) + { + this.blackout = true; + } + else + { + if (this.buffType[num30] == 23) + { + this.noItems = true; + } + else + { + if (this.buffType[num30] == 24) + { + this.onFire = true; + } + else + { + if (this.buffType[num30] == 67) + { + this.burned = true; + } + else + { + if (this.buffType[num30] == 68) + { + this.suffocating = true; + } + else + { + if (this.buffType[num30] == 39) + { + this.onFire2 = true; + } + else + { + if (this.buffType[num30] == 44) + { + this.onFrostBurn = true; + } + else + { + if (this.buffType[num30] == 43) + { + this.paladinBuff = true; + } + else + { + if (this.buffType[num30] == 29) + { + this.magicCrit += 2; + this.magicDamage += 0.05f; + this.statManaMax2 += 20; + this.manaCost -= 0.02f; + } + else + { + if (this.buffType[num30] == 28) + { + if (!Main.dayTime && this.wolfAcc && !this.merman) + { + this.lifeRegen++; + this.wereWolf = true; + this.meleeCrit += 2; + this.meleeDamage += 0.051f; + this.meleeSpeed += 0.051f; + this.statDefense += 3; + this.moveSpeed += 0.05f; + } + else + { + this.DelBuff(num30); + } + } + else + { + if (this.buffType[num30] == 33) + { + this.meleeDamage -= 0.051f; + this.meleeSpeed -= 0.051f; + this.statDefense -= 4; + this.moveSpeed -= 0.1f; + } + else + { + if (this.buffType[num30] == 25) + { + this.statDefense -= 4; + this.meleeCrit += 2; + this.meleeDamage += 0.1f; + this.meleeSpeed += 0.1f; + } + else + { + if (this.buffType[num30] == 26) + { + this.statDefense += 2; + this.meleeCrit += 2; + this.meleeDamage += 0.05f; + this.meleeSpeed += 0.05f; + this.magicCrit += 2; + this.magicDamage += 0.05f; + this.rangedCrit += 2; + this.magicDamage += 0.05f; + this.minionDamage += 0.05f; + this.minionKB += 0.5f; + this.moveSpeed += 0.2f; + } + else + { + if (this.buffType[num30] == 71) + { + this.meleeEnchant = 1; + } + else + { + if (this.buffType[num30] == 73) + { + this.meleeEnchant = 2; + } + else + { + if (this.buffType[num30] == 74) + { + this.meleeEnchant = 3; + } + else + { + if (this.buffType[num30] == 75) + { + this.meleeEnchant = 4; + } + else + { + if (this.buffType[num30] == 76) + { + this.meleeEnchant = 5; + } + else + { + if (this.buffType[num30] == 77) + { + this.meleeEnchant = 6; + } + else + { + if (this.buffType[num30] == 78) + { + this.meleeEnchant = 7; + } + else + { + if (this.buffType[num30] == 79) + { + this.meleeEnchant = 8; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.accMerman && this.wet && !this.lavaWet) + { + this.releaseJump = true; + this.wings = 0; + this.merman = true; + this.accFlipper = true; + this.AddBuff(34, 2, true); + } + else + { + this.merman = false; + } + this.accMerman = false; + if (this.wolfAcc && !this.merman && !Main.dayTime && !this.wereWolf) + { + this.AddBuff(28, 60, true); + } + this.wolfAcc = false; + if (this.whoAmi == Main.myPlayer) + { + for (int num52 = 0; num52 < 10; num52++) + { + if (this.buffType[num52] > 0 && this.buffTime[num52] <= 0) + { + this.DelBuff(num52); + } + } + } + this.doubleJump = false; + for (int num53 = 0; num53 < 8; num53++) + { + this.statDefense += this.armor[num53].defense; + this.lifeRegen += this.armor[num53].lifeRegen; + if (this.armor[num53].type == 268) + { + this.accDivingHelm = true; + } + if (this.armor[num53].type == 238) + { + this.magicDamage += 0.15f; + } + if (this.armor[num53].type == 123 || this.armor[num53].type == 124 || this.armor[num53].type == 125) + { + this.magicDamage += 0.07f; + } + if (this.armor[num53].type == 151 || this.armor[num53].type == 152 || this.armor[num53].type == 153 || this.armor[num53].type == 959) + { + this.rangedDamage += 0.05f; + } + if (this.armor[num53].type == 111 || this.armor[num53].type == 228 || this.armor[num53].type == 229 || this.armor[num53].type == 230 || this.armor[num53].type == 960 || this.armor[num53].type == 961 || this.armor[num53].type == 962) + { + this.statManaMax2 += 20; + } + if (this.armor[num53].type == 982) + { + this.statManaMax2 += 20; + this.manaRegenDelayBonus++; + this.manaRegenBonus += 25; + } + if (this.armor[num53].type == 1595) + { + this.statManaMax2 += 20; + this.magicCuffs = true; + } + if (this.armor[num53].type == 228 || this.armor[num53].type == 229 || this.armor[num53].type == 230) + { + this.magicCrit += 3; + } + if (this.armor[num53].type == 100 || this.armor[num53].type == 101 || this.armor[num53].type == 102) + { + this.meleeSpeed += 0.07f; + } + if (this.armor[num53].type == 956 || this.armor[num53].type == 957 || this.armor[num53].type == 958) + { + this.meleeSpeed += 0.07f; + } + if (this.armor[num53].type == 791 || this.armor[num53].type == 792 || this.armor[num53].type == 793) + { + this.meleeDamage += 0.02f; + this.rangedDamage += 0.02f; + this.magicDamage += 0.02f; + } + if (this.armor[num53].type == 371) + { + this.magicCrit += 9; + this.statManaMax2 += 40; + } + if (this.armor[num53].type == 372) + { + this.moveSpeed += 0.07f; + this.meleeSpeed += 0.12f; + } + if (this.armor[num53].type == 373) + { + this.rangedDamage += 0.1f; + this.rangedCrit += 6; + } + if (this.armor[num53].type == 374) + { + this.magicCrit += 3; + this.meleeCrit += 3; + this.rangedCrit += 3; + } + if (this.armor[num53].type == 375) + { + this.moveSpeed += 0.1f; + } + if (this.armor[num53].type == 376) + { + this.magicDamage += 0.15f; + this.statManaMax2 += 60; + } + if (this.armor[num53].type == 377) + { + this.meleeCrit += 5; + this.meleeDamage += 0.1f; + } + if (this.armor[num53].type == 378) + { + this.rangedDamage += 0.12f; + this.rangedCrit += 7; + } + if (this.armor[num53].type == 379) + { + this.rangedDamage += 0.05f; + this.meleeDamage += 0.05f; + this.magicDamage += 0.05f; + } + if (this.armor[num53].type == 380) + { + this.magicCrit += 3; + this.meleeCrit += 3; + this.rangedCrit += 3; + } + if (this.armor[num53].type == 400) + { + this.magicDamage += 0.11f; + this.magicCrit += 11; + this.statManaMax2 += 80; + } + if (this.armor[num53].type == 401) + { + this.meleeCrit += 7; + this.meleeDamage += 0.14f; + } + if (this.armor[num53].type == 402) + { + this.rangedDamage += 0.14f; + this.rangedCrit += 8; + } + if (this.armor[num53].type == 403) + { + this.rangedDamage += 0.06f; + this.meleeDamage += 0.06f; + this.magicDamage += 0.06f; + } + if (this.armor[num53].type == 404) + { + this.magicCrit += 4; + this.meleeCrit += 4; + this.rangedCrit += 4; + this.moveSpeed += 0.05f; + } + if (this.armor[num53].type == 1205) + { + this.meleeDamage += 0.08f; + this.meleeSpeed += 0.12f; + } + if (this.armor[num53].type == 1206) + { + this.rangedDamage += 0.09f; + this.rangedCrit += 9; + } + if (this.armor[num53].type == 1207) + { + this.magicDamage += 0.07f; + this.magicCrit += 7; + this.statManaMax2 += 60; + } + if (this.armor[num53].type == 1208) + { + this.meleeDamage += 0.03f; + this.rangedDamage += 0.03f; + this.magicDamage += 0.03f; + this.magicCrit += 2; + this.meleeCrit += 2; + this.rangedCrit += 2; + } + if (this.armor[num53].type == 1209) + { + this.meleeDamage += 0.02f; + this.rangedDamage += 0.02f; + this.magicDamage += 0.02f; + this.magicCrit++; + this.meleeCrit++; + this.rangedCrit++; + } + if (this.armor[num53].type == 1210) + { + this.meleeDamage += 0.07f; + this.meleeSpeed += 0.07f; + this.moveSpeed += 0.07f; + } + if (this.armor[num53].type == 1211) + { + this.rangedCrit += 15; + this.moveSpeed += 0.08f; + } + if (this.armor[num53].type == 1212) + { + this.magicCrit += 18; + this.statManaMax2 += 80; + } + if (this.armor[num53].type == 1213) + { + this.magicCrit += 6; + this.meleeCrit += 6; + this.rangedCrit += 6; + } + if (this.armor[num53].type == 1214) + { + this.moveSpeed += 0.11f; + } + if (this.armor[num53].type == 1215) + { + this.meleeDamage += 0.08f; + this.meleeCrit += 8; + this.meleeSpeed += 0.08f; + } + if (this.armor[num53].type == 1216) + { + this.rangedDamage += 0.16f; + this.rangedCrit += 7; + } + if (this.armor[num53].type == 1217) + { + this.magicDamage += 0.16f; + this.magicCrit += 7; + this.statManaMax2 += 100; + } + if (this.armor[num53].type == 1218) + { + this.meleeDamage += 0.04f; + this.rangedDamage += 0.04f; + this.magicDamage += 0.04f; + this.magicCrit += 3; + this.meleeCrit += 3; + this.rangedCrit += 3; + } + if (this.armor[num53].type == 1219) + { + this.meleeDamage += 0.03f; + this.rangedDamage += 0.03f; + this.magicDamage += 0.03f; + this.magicCrit += 3; + this.meleeCrit += 3; + this.rangedCrit += 3; + this.moveSpeed += 0.06f; + } + if (this.armor[num53].type == 558) + { + this.magicDamage += 0.12f; + this.magicCrit += 12; + this.statManaMax2 += 100; + } + if (this.armor[num53].type == 559) + { + this.meleeCrit += 10; + this.meleeDamage += 0.1f; + this.meleeSpeed += 0.1f; + } + if (this.armor[num53].type == 553) + { + this.rangedDamage += 0.15f; + this.rangedCrit += 8; + } + if (this.armor[num53].type == 551) + { + this.magicCrit += 7; + this.meleeCrit += 7; + this.rangedCrit += 7; + } + if (this.armor[num53].type == 552) + { + this.rangedDamage += 0.07f; + this.meleeDamage += 0.07f; + this.magicDamage += 0.07f; + this.moveSpeed += 0.08f; + } + if (this.armor[num53].type == 1001) + { + this.meleeDamage += 0.16f; + this.meleeCrit += 6; + } + if (this.armor[num53].type == 1002) + { + this.rangedDamage += 0.16f; + this.ammoCost80 = true; + } + if (this.armor[num53].type == 1003) + { + this.statManaMax2 += 80; + this.manaCost -= 0.17f; + this.magicDamage += 0.16f; + } + if (this.armor[num53].type == 1004) + { + this.meleeDamage += 0.05f; + this.magicDamage += 0.05f; + this.rangedDamage += 0.05f; + this.magicCrit += 7; + this.meleeCrit += 7; + this.rangedCrit += 7; + } + if (this.armor[num53].type == 1005) + { + this.magicCrit += 8; + this.meleeCrit += 8; + this.rangedCrit += 8; + this.moveSpeed += 0.05f; + } + if (this.armor[num53].type == 1503) + { + this.statManaMax2 += 80; + this.manaCost -= 0.17f; + this.magicDamage += 0.1f; + this.magicCrit += 10; + } + if (this.armor[num53].type == 1504) + { + this.magicDamage += 0.07f; + this.magicCrit += 7; + } + if (this.armor[num53].type == 1505) + { + this.magicDamage += 0.08f; + this.moveSpeed += 0.08f; + } + if (this.armor[num53].type == 1546) + { + this.rangedCrit += 5; + this.arrowDamage += 0.15f; + } + if (this.armor[num53].type == 1547) + { + this.rangedCrit += 5; + this.bulletDamage += 0.15f; + } + if (this.armor[num53].type == 1548) + { + this.rangedCrit += 5; + this.rocketDamage += 0.15f; + } + if (this.armor[num53].type == 1549) + { + this.rangedCrit += 13; + this.rangedDamage += 0.13f; + this.ammoCost80 = true; + } + if (this.armor[num53].type == 1550) + { + this.rangedCrit += 7; + this.moveSpeed += 0.12f; + } + if (this.armor[num53].type == 1282) + { + this.statManaMax2 += 20; + this.manaCost -= 0.05f; + } + if (this.armor[num53].type == 1283) + { + this.statManaMax2 += 40; + this.manaCost -= 0.07f; + } + if (this.armor[num53].type == 1284) + { + this.statManaMax2 += 40; + this.manaCost -= 0.09f; + } + if (this.armor[num53].type == 1285) + { + this.statManaMax2 += 60; + this.manaCost -= 0.11f; + } + if (this.armor[num53].type == 1286) + { + this.statManaMax2 += 60; + this.manaCost -= 0.13f; + } + if (this.armor[num53].type == 1287) + { + this.statManaMax2 += 80; + this.manaCost -= 0.15f; + } + if (this.armor[num53].type == 1316 || this.armor[num53].type == 1317 || this.armor[num53].type == 1318) + { + this.aggro += 200; + } + if (this.armor[num53].type == 1316) + { + this.meleeDamage += 0.06f; + } + if (this.armor[num53].type == 1317) + { + this.meleeDamage += 0.08f; + this.meleeCrit += 8; + } + if (this.armor[num53].type == 1318) + { + this.meleeCrit += 4; + } + if (this.armor[num53].type == 684) + { + this.rangedDamage += 0.16f; + this.meleeDamage += 0.16f; + } + if (this.armor[num53].type == 685) + { + this.meleeCrit += 11; + this.rangedCrit += 11; + } + if (this.armor[num53].type == 686) + { + this.moveSpeed += 0.08f; + this.meleeSpeed += 0.07f; + } + if (this.armor[num53].type >= 1158 && this.armor[num53].type <= 1161) + { + this.maxMinions++; + } + if (this.armor[num53].type >= 1158 && this.armor[num53].type <= 1161) + { + this.minionDamage += 0.1f; + } + if (this.armor[num53].prefix == 62) + { + this.statDefense++; + } + if (this.armor[num53].prefix == 63) + { + this.statDefense += 2; + } + if (this.armor[num53].prefix == 64) + { + this.statDefense += 3; + } + if (this.armor[num53].prefix == 65) + { + this.statDefense += 4; + } + if (this.armor[num53].prefix == 66) + { + this.statManaMax2 += 20; + } + if (this.armor[num53].prefix == 67) + { + this.meleeCrit++; + this.rangedCrit++; + this.magicCrit++; + } + if (this.armor[num53].prefix == 68) + { + this.meleeCrit += 2; + this.rangedCrit += 2; + this.magicCrit += 2; + } + if (this.armor[num53].prefix == 69) + { + this.meleeDamage += 0.01f; + this.rangedDamage += 0.01f; + this.magicDamage += 0.01f; + this.minionDamage += 0.01f; + } + if (this.armor[num53].prefix == 70) + { + this.meleeDamage += 0.02f; + this.rangedDamage += 0.02f; + this.magicDamage += 0.02f; + this.minionDamage += 0.02f; + } + if (this.armor[num53].prefix == 71) + { + this.meleeDamage += 0.03f; + this.rangedDamage += 0.03f; + this.magicDamage += 0.03f; + this.minionDamage += 0.03f; + } + if (this.armor[num53].prefix == 72) + { + this.meleeDamage += 0.04f; + this.rangedDamage += 0.04f; + this.magicDamage += 0.04f; + this.minionDamage += 0.04f; + } + if (this.armor[num53].prefix == 73) + { + this.moveSpeed += 0.01f; + } + if (this.armor[num53].prefix == 74) + { + this.moveSpeed += 0.02f; + } + if (this.armor[num53].prefix == 75) + { + this.moveSpeed += 0.03f; + } + if (this.armor[num53].prefix == 76) + { + this.moveSpeed += 0.04f; + } + if (this.armor[num53].prefix == 77) + { + this.meleeSpeed += 0.01f; + } + if (this.armor[num53].prefix == 78) + { + this.meleeSpeed += 0.02f; + } + if (this.armor[num53].prefix == 79) + { + this.meleeSpeed += 0.03f; + } + if (this.armor[num53].prefix == 80) + { + this.meleeSpeed += 0.04f; + } + } + this.head = this.armor[0].headSlot; + this.body = this.armor[1].bodySlot; + this.legs = this.armor[2].legSlot; + for (int num54 = 3; num54 < 8; num54++) + { + if (this.armor[num54].type == 15 && this.accWatch < 1) + { + this.accWatch = 1; + } + if (this.armor[num54].type == 16 && this.accWatch < 2) + { + this.accWatch = 2; + } + if (this.armor[num54].type == 17 && this.accWatch < 3) + { + this.accWatch = 3; + } + if (this.armor[num54].type == 707 && this.accWatch < 1) + { + this.accWatch = 1; + } + if (this.armor[num54].type == 708 && this.accWatch < 2) + { + this.accWatch = 2; + } + if (this.armor[num54].type == 709 && this.accWatch < 3) + { + this.accWatch = 3; + } + if (this.armor[num54].type == 18 && this.accDepthMeter < 1) + { + this.accDepthMeter = 1; + } + if (this.armor[num54].type == 857) + { + this.doubleJump2 = true; + } + if (this.armor[num54].type == 983) + { + this.doubleJump2 = true; + this.jumpBoost = true; + } + if (this.armor[num54].type == 987) + { + this.doubleJump3 = true; + } + if (this.armor[num54].type == 1163) + { + this.doubleJump3 = true; + this.jumpBoost = true; + } + if (this.armor[num54].type == 1724) + { + this.doubleJump4 = true; + } + if (this.armor[num54].type == 1164) + { + this.doubleJump = true; + this.doubleJump2 = true; + this.doubleJump3 = true; + this.jumpBoost = true; + } + if (this.armor[num54].type == 1250) + { + this.jumpBoost = true; + this.doubleJump = true; + this.noFallDmg = true; + } + if (this.armor[num54].type == 1252) + { + this.doubleJump2 = true; + this.jumpBoost = true; + this.noFallDmg = true; + } + if (this.armor[num54].type == 1251) + { + this.doubleJump3 = true; + this.jumpBoost = true; + this.noFallDmg = true; + } + if (this.armor[num54].type == 1249) + { + this.jumpBoost = true; + this.bee = true; + } + if (this.armor[num54].type == 1253 && (double)this.statLife <= (double)this.statLifeMax * 0.25) + { + this.AddBuff(62, 5, true); + } + if (this.armor[num54].type == 1290) + { + this.panic = true; + } + if (this.armor[num54].type == 1300 && this.inventory[this.selectedItem].useAmmo == 14) + { + this.scope = true; + } + if (this.armor[num54].type == 1303 && this.wet) + { + Lighting.addLight((int)this.center().X / 16, (int)this.center().Y / 16, 0.9f, 0.2f, 0.6f); + } + if (this.armor[num54].type == 1301) + { + this.meleeCrit += 8; + this.rangedCrit += 8; + this.magicCrit += 8; + this.meleeDamage += 0.1f; + this.rangedDamage += 0.1f; + this.magicDamage += 0.1f; + this.minionDamage += 0.1f; + } + if (this.armor[num54].type == 1247) + { + this.starCloak = true; + this.bee = true; + } + if (this.armor[num54].type == 1248) + { + this.meleeCrit += 10; + this.rangedCrit += 10; + this.magicCrit += 10; + } + if (this.armor[num54].type == 854) + { + this.discount = true; + } + if (this.armor[num54].type == 855) + { + this.coins = true; + } + if (this.armor[num54].type == 53) + { + this.doubleJump = true; + } + if (this.armor[num54].type == 54) + { + num6 = 6f; + } + if (this.armor[num54].type == 1579) + { + num6 = 6f; + this.coldDash = true; + } + if (this.armor[num54].type == 128) + { + this.rocketBoots = 1; + } + if (this.armor[num54].type == 156) + { + this.noKnockback = true; + } + if (this.armor[num54].type == 158) + { + this.noFallDmg = true; + } + if (this.armor[num54].type == 934) + { + this.carpet = true; + } + if (this.armor[num54].type == 953) + { + this.spikedBoots++; + } + if (this.armor[num54].type == 975) + { + this.spikedBoots++; + } + if (this.armor[num54].type == 976) + { + this.spikedBoots += 2; + } + if (this.armor[num54].type == 977) + { + this.dash = 1; + } + if (this.armor[num54].type == 963) + { + this.blackBelt = true; + } + if (this.armor[num54].type == 984) + { + this.blackBelt = true; + this.dash = 1; + this.spikedBoots = 2; + } + if (this.armor[num54].type == 1131) + { + this.gravControl2 = true; + } + if (this.armor[num54].type == 1132) + { + this.bee = true; + } + if (this.armor[num54].type == 1578) + { + this.bee = true; + this.panic = true; + } + if (this.armor[num54].type == 950) + { + this.iceSkate = true; + } + if (this.armor[num54].type == 159) + { + this.jumpBoost = true; + } + if (this.armor[num54].type == 187) + { + this.accFlipper = true; + } + if (this.armor[num54].type == 211) + { + this.meleeSpeed += 0.12f; + } + if (this.armor[num54].type == 223) + { + this.manaCost -= 0.06f; + } + if (this.armor[num54].type == 285) + { + this.moveSpeed += 0.05f; + } + if (this.armor[num54].type == 212) + { + this.moveSpeed += 0.1f; + } + if (this.armor[num54].type == 267) + { + this.killGuide = true; + } + if (this.armor[num54].type == 1307) + { + this.killClothier = true; + } + if (this.armor[num54].type == 193) + { + this.fireWalk = true; + } + if (this.armor[num54].type == 861) + { + this.accMerman = true; + this.wolfAcc = true; + } + if (this.armor[num54].type == 862) + { + this.starCloak = true; + this.longInvince = true; + } + if (this.armor[num54].type == 860) + { + this.pStone = true; + } + if (this.armor[num54].type == 863) + { + this.waterWalk2 = true; + } + if (this.armor[num54].type == 907) + { + this.waterWalk2 = true; + this.fireWalk = true; + } + if (this.armor[num54].type == 908) + { + this.waterWalk = true; + this.fireWalk = true; + this.lavaMax += 420; + } + if (this.armor[num54].type == 906) + { + this.lavaMax += 420; + } + if (this.armor[num54].type == 485) + { + this.wolfAcc = true; + } + if (this.armor[num54].type == 486) + { + this.rulerAcc = true; + } + if (this.armor[num54].type == 393) + { + this.accCompass = 1; + } + if (this.armor[num54].type == 394) + { + this.accFlipper = true; + this.accDivingHelm = true; + } + if (this.armor[num54].type == 395) + { + this.accWatch = 3; + this.accDepthMeter = 1; + this.accCompass = 1; + } + if (this.armor[num54].type == 396) + { + this.noFallDmg = true; + this.fireWalk = true; + } + if (this.armor[num54].type == 397) + { + this.noKnockback = true; + this.fireWalk = true; + } + if (this.armor[num54].type == 399) + { + this.jumpBoost = true; + this.doubleJump = true; + } + if (this.armor[num54].type == 405) + { + num6 = 6f; + this.rocketBoots = 2; + } + if (this.armor[num54].type == 897) + { + this.kbGlove = true; + this.meleeSpeed += 0.12f; + } + if (this.armor[num54].type == 1343) + { + this.kbGlove = true; + this.meleeSpeed += 0.09f; + this.meleeDamage += 0.09f; + this.magmaStone = true; + } + if (this.armor[num54].type == 1167) + { + this.minionKB += 2f; + this.minionDamage += 0.15f; + } + if (this.armor[num54].type == 1321) + { + this.magicQuiver = true; + } + if (this.armor[num54].type == 1322) + { + this.magmaStone = true; + } + if (this.armor[num54].type == 1323) + { + this.lavaRose = true; + } + if (this.armor[num54].type == 938) + { + this.noKnockback = true; + if ((double)this.statLife > (double)this.statLifeMax * 0.25) + { + if (i == Main.myPlayer) + { + this.paladinGive = true; + } + else + { + if (this.miscCounter % 5 == 0) + { + int myPlayer = Main.myPlayer; + if (Main.player[myPlayer].team == this.team && this.team != 0) + { + float num55 = this.position.X - Main.player[myPlayer].position.X; + float num56 = this.position.Y - Main.player[myPlayer].position.Y; + float num57 = (float)Math.Sqrt((double)(num55 * num55 + num56 * num56)); + if (num57 < 800f) + { + Main.player[myPlayer].AddBuff(43, 10, true); + } + } + } + } + } + } + if (this.armor[num54].type == 936) + { + this.kbGlove = true; + this.meleeSpeed += 0.12f; + this.magicDamage += 0.12f; + this.meleeDamage += 0.12f; + this.rangedDamage += 0.12f; + } + if (this.armor[num54].type == 898) + { + num6 = 6.75f; + this.rocketBoots = 2; + this.moveSpeed += 0.08f; + } + if (this.armor[num54].type == 899 && Main.dayTime) + { + this.lifeRegen += 2; + this.statDefense += 4; + this.meleeSpeed += 0.1f; + this.meleeDamage += 0.1f; + this.meleeCrit += 2; + this.rangedDamage += 0.1f; + this.rangedCrit += 2; + this.magicDamage += 0.1f; + this.magicCrit += 2; + this.pickSpeed -= 0.15f; + this.minionDamage += 0.1f; + this.minionKB += 0.5f; + } + if (this.armor[num54].type == 900 && !Main.dayTime) + { + this.lifeRegen += 2; + this.statDefense += 4; + this.meleeSpeed += 0.1f; + this.meleeDamage += 0.1f; + this.meleeCrit += 2; + this.rangedDamage += 0.1f; + this.rangedCrit += 2; + this.magicDamage += 0.1f; + this.magicCrit += 2; + this.pickSpeed -= 0.15f; + this.minionDamage += 0.1f; + this.minionKB += 0.5f; + } + if (this.armor[num54].type == 407) + { + this.blockRange = 1; + } + if (this.armor[num54].type == 489) + { + this.magicDamage += 0.15f; + } + if (this.armor[num54].type == 490) + { + this.meleeDamage += 0.15f; + } + if (this.armor[num54].type == 491) + { + this.rangedDamage += 0.15f; + } + if (this.armor[num54].type == 935) + { + this.magicDamage += 0.12f; + this.meleeDamage += 0.12f; + this.rangedDamage += 0.12f; + this.minionDamage += 0.12f; + } + if (this.armor[num54].type == 492) + { + this.wings = 1; + } + if (this.armor[num54].type == 493) + { + this.wings = 2; + } + if (this.armor[num54].type == 665) + { + this.wings = 3; + } + if (this.armor[num54].type == 748) + { + this.wings = 4; + } + if (this.armor[num54].type == 749) + { + this.wings = 5; + } + if (this.armor[num54].type == 761) + { + this.wings = 6; + } + if (this.armor[num54].type == 785) + { + this.wings = 7; + } + if (this.armor[num54].type == 786) + { + this.wings = 8; + } + if (this.armor[num54].type == 821) + { + this.wings = 9; + } + if (this.armor[num54].type == 822) + { + this.wings = 10; + } + if (this.armor[num54].type == 823) + { + this.wings = 11; + } + if (this.armor[num54].type == 948) + { + this.wings = 12; + } + if (this.armor[num54].type == 1162) + { + this.wings = 13; + } + if (this.armor[num54].type == 1165) + { + this.wings = 14; + } + if (this.armor[num54].type == 1515) + { + this.wings = 15; + } + if (this.armor[num54].type == 1583) + { + this.wings = 16; + } + if (this.armor[num54].type == 1584) + { + this.wings = 17; + } + if (this.armor[num54].type == 1585) + { + this.wings = 18; + } + if (this.armor[num54].type == 1586) + { + this.wings = 19; + } + if (this.armor[num54].type == 885) + { + this.buffImmune[30] = true; + } + if (this.armor[num54].type == 886) + { + this.buffImmune[36] = true; + } + if (this.armor[num54].type == 887) + { + this.buffImmune[20] = true; + } + if (this.armor[num54].type == 888) + { + this.buffImmune[22] = true; + } + if (this.armor[num54].type == 889) + { + this.buffImmune[32] = true; + } + if (this.armor[num54].type == 890) + { + this.buffImmune[35] = true; + } + if (this.armor[num54].type == 891) + { + this.buffImmune[23] = true; + } + if (this.armor[num54].type == 892) + { + this.buffImmune[33] = true; + } + if (this.armor[num54].type == 893) + { + this.buffImmune[31] = true; + } + if (this.armor[num54].type == 901) + { + this.buffImmune[33] = true; + this.buffImmune[36] = true; + } + if (this.armor[num54].type == 902) + { + this.buffImmune[30] = true; + this.buffImmune[20] = true; + } + if (this.armor[num54].type == 903) + { + this.buffImmune[32] = true; + this.buffImmune[31] = true; + } + if (this.armor[num54].type == 904) + { + this.buffImmune[35] = true; + this.buffImmune[23] = true; + } + if (this.armor[num54].type == 1612) + { + this.buffImmune[33] = true; + this.buffImmune[36] = true; + this.buffImmune[30] = true; + this.buffImmune[20] = true; + this.buffImmune[32] = true; + this.buffImmune[31] = true; + this.buffImmune[35] = true; + this.buffImmune[23] = true; + this.buffImmune[22] = true; + } + if (this.armor[num54].type == 1613) + { + this.noKnockback = true; + this.fireWalk = true; + this.buffImmune[33] = true; + this.buffImmune[36] = true; + this.buffImmune[30] = true; + this.buffImmune[20] = true; + this.buffImmune[32] = true; + this.buffImmune[31] = true; + this.buffImmune[35] = true; + this.buffImmune[23] = true; + this.buffImmune[22] = true; + } + if (this.armor[num54].type == 497) + { + this.accMerman = true; + } + if (this.armor[num54].type == 535) + { + this.pStone = true; + } + if (this.armor[num54].type == 536) + { + this.kbGlove = true; + } + if (this.armor[num54].type == 532) + { + this.starCloak = true; + } + if (this.armor[num54].type == 554) + { + this.longInvince = true; + } + if (this.armor[num54].type == 555) + { + this.manaFlower = true; + this.manaCost -= 0.08f; + } + if (Main.myPlayer == this.whoAmi) + { + if (this.armor[num54].type == 576 && Main.rand.Next(18000) == 0 && Main.curMusic > 0) + { + int num58 = 0; + if (Main.curMusic == 1) + { + num58 = 0; + } + if (Main.curMusic == 2) + { + num58 = 1; + } + if (Main.curMusic == 3) + { + num58 = 2; + } + if (Main.curMusic == 4) + { + num58 = 4; + } + if (Main.curMusic == 5) + { + num58 = 5; + } + if (Main.curMusic == 7) + { + num58 = 6; + } + if (Main.curMusic == 8) + { + num58 = 7; + } + if (Main.curMusic == 9) + { + num58 = 9; + } + if (Main.curMusic == 10) + { + num58 = 8; + } + if (Main.curMusic == 11) + { + num58 = 11; + } + if (Main.curMusic == 12) + { + num58 = 10; + } + if (Main.curMusic == 13) + { + num58 = 12; + } + if (Main.curMusic == 29) + { + this.armor[num54].SetDefaults(1610, false); + } + else + { + if (Main.curMusic > 13) + { + this.armor[num54].SetDefaults(1596 + Main.curMusic - 14, false); + } + else + { + this.armor[num54].SetDefaults(num58 + 562, false); + } + } + } + if (this.armor[num54].type >= 562 && this.armor[num54].type <= 574) + { + Main.musicBox2 = this.armor[num54].type - 562; + } + if (this.armor[num54].type >= 1596 && this.armor[num54].type <= 1609) + { + Main.musicBox2 = this.armor[num54].type - 1596 + 13; + } + if (this.armor[num54].type == 1610) + { + Main.musicBox2 = 27; + } + } + } + this.gemCount++; + if (this.gemCount >= 10) + { + this.gem = -1; + this.gemCount = 0; + for (int num59 = 0; num59 <= 58; num59++) + { + if (this.inventory[num59].type == 0 || this.inventory[num59].stack == 0) + { + this.inventory[num59].type = 0; + this.inventory[num59].stack = 0; + this.inventory[num59].name = ""; + this.inventory[num59].netID = 0; + } + if (this.inventory[num59].type >= 1522 && this.inventory[num59].type <= 1527) + { + this.gem = this.inventory[num59].type - 1522; + } + } + } + if (this.head == 11) + { + int i2 = (int)(this.position.X + (float)(this.width / 2) + (float)(8 * this.direction)) / 16; + int j2 = (int)(this.position.Y + 2f) / 16; + Lighting.addLight(i2, j2, 0.92f, 0.8f, 0.65f); + } + this.setBonus = ""; + if (this.body == 67 && this.legs == 56 && this.head >= 103 && this.head <= 105) + { + this.setBonus = Lang.setBonus(31, false); + this.armorSteath = true; + } + if ((this.head == 52 && this.body == 32 && this.legs == 31) || (this.head == 53 && this.body == 33 && this.legs == 32) || (this.head == 54 && this.body == 34 && this.legs == 33) || (this.head == 55 && this.body == 35 && this.legs == 34) || (this.head == 70 && this.body == 46 && this.legs == 42) || (this.head == 71 && this.body == 47 && this.legs == 43)) + { + this.setBonus = Lang.setBonus(20, false); + this.statDefense++; + } + if ((this.head == 1 && this.body == 1 && this.legs == 1) || ((this.head == 72 || this.head == 2) && this.body == 2 && this.legs == 2) || (this.head == 47 && this.body == 28 && this.legs == 27)) + { + this.setBonus = Lang.setBonus(0, false); + this.statDefense += 2; + } + if ((this.head == 3 && this.body == 3 && this.legs == 3) || ((this.head == 73 || this.head == 4) && this.body == 4 && this.legs == 4) || (this.head == 48 && this.body == 29 && this.legs == 28) || (this.head == 49 && this.body == 30 && this.legs == 29)) + { + this.setBonus = Lang.setBonus(1, false); + this.statDefense += 3; + } + if (this.head == 50 && this.body == 31 && this.legs == 30) + { + this.setBonus = Lang.setBonus(32, false); + this.statDefense += 4; + } + if (this.head == 14 && this.body >= 58 && this.body <= 63) + { + this.setBonus = Lang.setBonus(28, false); + this.magicCrit += 10; + } + if ((this.head == 5 || this.head == 74) && (this.body == 5 || this.body == 48) && (this.legs == 5 || this.legs == 44)) + { + this.setBonus = Lang.setBonus(2, false); + this.moveSpeed += 0.15f; + } + if (this.head == 57 && this.body == 37 && this.legs == 35) + { + this.setBonus = Lang.setBonus(21, false); + this.crimsonRegen = true; + } + if (this.head == 101 && this.body == 66 && this.legs == 55) + { + this.setBonus = Lang.setBonus(30, false); + this.ghostHeal = true; + } + if (this.head == 6 && this.body == 6 && this.legs == 6) + { + this.setBonus = Lang.setBonus(3, false); + this.spaceGun = true; + } + if (this.head == 46 && this.body == 27 && this.legs == 26) + { + this.setBonus = Lang.setBonus(22, false); + this.frostBurn = true; + } + if ((this.head == 75 || this.head == 7) && this.body == 7 && this.legs == 7) + { + this.boneArmor = true; + this.setBonus = Lang.setBonus(4, false); + this.ammoCost80 = true; + } + if (this.head == 8 && this.body == 8 && this.legs == 8) + { + this.setBonus = Lang.setBonus(5, false); + this.manaCost -= 0.16f; + } + if (this.head == 76 && this.body == 49 && this.legs == 45) + { + this.setBonus = Lang.setBonus(5, false); + this.manaCost -= 0.16f; + } + if (this.head == 9 && this.body == 9 && this.legs == 9) + { + this.setBonus = Lang.setBonus(6, false); + this.meleeDamage += 0.17f; + } + if (this.head == 11 && this.body == 20 && this.legs == 19) + { + this.setBonus = Lang.setBonus(7, false); + this.pickSpeed -= 0.3f; + } + if ((this.head == 78 || this.head == 79 || this.head == 80) && this.body == 51 && this.legs == 47) + { + this.setBonus = Lang.setBonus(27, false); + this.AddBuff(60, 18000, true); + } + else + { + if (this.crystalLeaf) + { + for (int num60 = 0; num60 < 10; num60++) + { + if (this.buffType[num60] == 60) + { + this.DelBuff(num60); + } + } + } + } + if (this.head == 99 && this.body == 65 && this.legs == 54) + { + this.setBonus = Lang.setBonus(29, false); + this.thorns = true; + this.turtleThorns = true; + } + if (this.body == 17 && this.legs == 16) + { + if (this.head == 29) + { + this.setBonus = Lang.setBonus(8, false); + this.manaCost -= 0.14f; + } + else + { + if (this.head == 30) + { + this.setBonus = Lang.setBonus(9, false); + this.meleeSpeed += 0.15f; + } + else + { + if (this.head == 31) + { + this.setBonus = Lang.setBonus(10, false); + this.ammoCost80 = true; + } + } + } + } + if (this.body == 18 && this.legs == 17) + { + if (this.head == 32) + { + this.setBonus = Lang.setBonus(11, false); + this.manaCost -= 0.17f; + } + else + { + if (this.head == 33) + { + this.setBonus = Lang.setBonus(12, false); + this.meleeCrit += 5; + } + else + { + if (this.head == 34) + { + this.setBonus = Lang.setBonus(13, false); + this.ammoCost80 = true; + } + } + } + } + if (this.body == 19 && this.legs == 18) + { + if (this.head == 35) + { + this.setBonus = Lang.setBonus(14, false); + this.manaCost -= 0.19f; + } + else + { + if (this.head == 36) + { + this.setBonus = Lang.setBonus(15, false); + this.meleeSpeed += 0.18f; + this.moveSpeed += 0.18f; + } + else + { + if (this.head == 37) + { + this.setBonus = Lang.setBonus(16, false); + this.ammoCost75 = true; + } + } + } + } + if (this.body == 54 && this.legs == 49 && (this.head == 83 || this.head == 84 || this.head == 85)) + { + this.setBonus = Lang.setBonus(24, false); + this.onHitRegen = true; + } + if (this.body == 55 && this.legs == 50 && (this.head == 86 || this.head == 87 || this.head == 88)) + { + this.setBonus = Lang.setBonus(25, false); + this.onHitPetal = true; + } + if (this.body == 56 && this.legs == 51 && (this.head == 89 || this.head == 90 || this.head == 91)) + { + this.setBonus = Lang.setBonus(26, false); + this.onHitDodge = true; + } + if (this.body == 24 && this.legs == 23) + { + if (this.head == 42) + { + this.setBonus = Lang.setBonus(17, false); + this.manaCost -= 0.2f; + } + else + { + if (this.head == 43) + { + this.setBonus = Lang.setBonus(18, false); + this.meleeSpeed += 0.19f; + this.moveSpeed += 0.19f; + } + else + { + if (this.head == 41) + { + this.setBonus = Lang.setBonus(19, false); + this.ammoCost75 = true; + } + } + } + } + if (this.head == 82 && this.body == 53 && this.legs == 48) + { + this.setBonus = Lang.setBonus(23, false); + this.maxMinions++; + } + if (this.merman) + { + this.wings = 0; + } + if (this.armorSteath) + { + if (this.itemAnimation > 0) + { + this.stealthTimer = 5; + this.stealth += 0.0015f; + if (this.stealth > 1f) + { + this.stealth = 1f; + } + } + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1 && (double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + if (this.stealthTimer == 0) + { + this.stealth -= 0.015f; + if ((double)this.stealth < 0.0) + { + this.stealth = 0f; + } + } + } + else + { + float num61 = Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y); + this.stealth += num61 * 0.0075f; + if (this.stealth > 1f) + { + this.stealth = 1f; + } + } + this.rangedDamage += (1f - this.stealth) * 0.5f; + this.rangedCrit += (int)((1f - this.stealth) * 10f); + this.aggro -= (int)((1f - this.stealth) * 600f); + if (this.stealthTimer > 0) + { + this.stealthTimer--; + } + } + else + { + this.stealth = 1f; + } + if ((double)this.pickSpeed < 0.3) + { + this.pickSpeed = 0.3f; + } + if (this.meleeSpeed > 4f) + { + this.meleeSpeed = 4f; + } + if ((double)this.moveSpeed > 1.6) + { + this.moveSpeed = 1.6f; + } + if (this.slow) + { + this.moveSpeed *= 0.5f; + } + if (this.chilled) + { + this.moveSpeed *= 0.75f; + } + if (this.statManaMax2 > 400) + { + this.statManaMax2 = 400; + } + if (this.statDefense < 0) + { + this.statDefense = 0; + } + this.meleeSpeed = 1f / this.meleeSpeed; + if (this.poisoned) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 4; + } + else + { + if (this.venom) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 12; + } + } + if (this.onFire) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 8; + } + if (this.onFrostBurn) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 12; + } + if (this.onFire2) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 12; + } + if (this.burned) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 60; + this.moveSpeed *= 0.5f; + } + if (this.suffocating) + { + if (this.lifeRegen > 0) + { + this.lifeRegen = 0; + } + this.lifeRegenTime = 0; + this.lifeRegen -= 40; + } + this.lifeRegenTime++; + if (this.crimsonRegen) + { + this.lifeRegenTime++; + } + if (this.honey) + { + this.lifeRegenTime += 2; + this.lifeRegen += 2; + } + if (this.whoAmi == Main.myPlayer && Main.campfire) + { + this.lifeRegen += 2; + } + if (this.bleed) + { + this.lifeRegenTime = 0; + } + float num62 = 0f; + if (this.lifeRegenTime >= 300) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 600) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 900) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 1200) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 1500) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 1800) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 2400) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 3000) + { + num62 += 1f; + } + if (this.lifeRegenTime >= 3600) + { + num62 += 1f; + this.lifeRegenTime = 3600; + } + if (this.velocity.X == 0f || this.grappling[0] > 0) + { + num62 *= 1.25f; + } + else + { + num62 *= 0.5f; + } + if (this.crimsonRegen) + { + num62 *= 1.5f; + } + if (this.whoAmi == Main.myPlayer && Main.campfire) + { + num62 *= 1.1f; + } + float num63 = (float)this.statLifeMax / 400f * 0.85f + 0.15f; + num62 *= num63; + this.lifeRegen += (int)Math.Round((double)num62); + this.lifeRegenCount += this.lifeRegen; + if (this.palladiumRegen) + { + this.lifeRegenCount += 6; + } + while (this.lifeRegenCount >= 120) + { + this.lifeRegenCount -= 120; + if (this.statLife < this.statLifeMax) + { + this.statLife++; + if (this.crimsonRegen) + { + for (int num64 = 0; num64 < 10; num64++) + { + int num65 = Dust.NewDust(this.position, this.width, this.height, 5, 0f, 0f, 175, default(Color), 1.75f); + Main.dust[num65].noGravity = true; + Main.dust[num65].velocity *= 0.75f; + int num66 = Main.rand.Next(-40, 41); + int num67 = Main.rand.Next(-40, 41); + Dust expr_7E1D_cp_0 = Main.dust[num65]; + expr_7E1D_cp_0.position.X = expr_7E1D_cp_0.position.X + (float)num66; + Dust expr_7E39_cp_0 = Main.dust[num65]; + expr_7E39_cp_0.position.Y = expr_7E39_cp_0.position.Y + (float)num67; + Main.dust[num65].velocity.X = (float)(-(float)num66) * 0.075f; + Main.dust[num65].velocity.Y = (float)(-(float)num67) * 0.075f; + } + } + } + if (this.statLife > this.statLifeMax) + { + this.statLife = this.statLifeMax; + } + } + if (!this.burned) + { + if (!this.suffocating) + { + while (this.lifeRegenCount <= -120) + { + if (this.lifeRegenCount <= -480) + { + this.lifeRegenCount += 480; + this.statLife -= 4; + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 60, 70, 255), string.Concat(4), false, true); + } + else + { + if (this.lifeRegenCount <= -360) + { + this.lifeRegenCount += 360; + this.statLife -= 3; + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 60, 70, 255), string.Concat(3), false, true); + } + else + { + if (this.lifeRegenCount <= -240) + { + this.lifeRegenCount += 240; + this.statLife -= 2; + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 60, 70, 255), string.Concat(2), false, true); + } + else + { + this.lifeRegenCount += 120; + this.statLife--; + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 60, 70, 255), string.Concat(1), false, true); + } + } + } + if (this.statLife <= 0 && this.whoAmi == Main.myPlayer) + { + if (this.poisoned || this.venom) + { + this.KillMe(10.0, 0, false, " " + Lang.dt[0]); + } + else + { + this.KillMe(10.0, 0, false, " " + Lang.dt[1]); + } + } + } + goto IL_8219; + } + } + while (this.lifeRegenCount <= -600) + { + this.lifeRegenCount += 600; + this.statLife -= 5; + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 60, 70, 255), string.Concat(5), false, true); + if (this.statLife <= 0 && this.whoAmi == Main.myPlayer) + { + if (this.suffocating) + { + this.KillMe(10.0, 0, false, " " + Lang.dt[2]); + } + else + { + this.KillMe(10.0, 0, false, " " + Lang.dt[1]); + } + } + } + IL_8219: + if (this.manaRegenDelay > 0) + { + this.manaRegenDelay--; + this.manaRegenDelay -= this.manaRegenDelayBonus; + if ((this.velocity.X == 0f && this.velocity.Y == 0f) || this.grappling[0] >= 0 || this.manaRegenBuff) + { + this.manaRegenDelay--; + } + } + if (this.manaRegenBuff && this.manaRegenDelay > 20) + { + this.manaRegenDelay = 20; + } + if (this.manaRegenDelay <= 0) + { + this.manaRegenDelay = 0; + this.manaRegen = this.statManaMax2 / 7 + 1 + this.manaRegenBonus; + if ((this.velocity.X == 0f && this.velocity.Y == 0f) || this.grappling[0] >= 0 || this.manaRegenBuff) + { + this.manaRegen += this.statManaMax2 / 2; + } + float num68 = (float)this.statMana / (float)this.statManaMax2 * 0.8f + 0.2f; + if (this.manaRegenBuff) + { + num68 = 1f; + } + this.manaRegen = (int)((float)this.manaRegen * num68); + } + else + { + this.manaRegen = 0; + } + this.manaRegenCount += this.manaRegen; + while (this.manaRegenCount >= 120) + { + bool flag27 = false; + this.manaRegenCount -= 120; + if (this.statMana < this.statManaMax2) + { + this.statMana++; + flag27 = true; + } + if (this.statMana >= this.statManaMax2) + { + if (this.whoAmi == Main.myPlayer && flag27) + { + Main.PlaySound(25, -1, -1, 1); + for (int num69 = 0; num69 < 5; num69++) + { + int num70 = Dust.NewDust(this.position, this.width, this.height, 45, 0f, 0f, 255, default(Color), (float)Main.rand.Next(20, 26) * 0.1f); + Main.dust[num70].noLight = true; + Main.dust[num70].noGravity = true; + Main.dust[num70].velocity *= 0.5f; + } + } + this.statMana = this.statManaMax2; + } + } + if (this.manaRegenCount < 0) + { + this.manaRegenCount = 0; + } + if (this.statMana > this.statManaMax2) + { + this.statMana = this.statManaMax2; + } + num4 *= this.moveSpeed; + num3 *= this.moveSpeed; + if (this.jumpBoost) + { + Player.jumpHeight = 20; + Player.jumpSpeed = 6.51f; + } + if (this.wereWolf) + { + Player.jumpHeight += 2; + Player.jumpSpeed += 0.2f; + } + if (this.sticky) + { + Player.jumpHeight /= 10; + Player.jumpSpeed /= 5f; + } + for (int num71 = 0; num71 < 10; num71++) + { + if (this.buffType[num71] > 0 && this.buffTime[num71] > 0 && this.buffImmune[this.buffType[num71]]) + { + this.DelBuff(num71); + } + } + if (this.brokenArmor) + { + this.statDefense /= 2; + } + if (!this.doubleJump) + { + this.jumpAgain = false; + } + else + { + if (this.velocity.Y == 0f || this.sliding) + { + this.jumpAgain = true; + } + } + if (!this.doubleJump2) + { + this.jumpAgain2 = false; + } + else + { + if (this.velocity.Y == 0f || this.sliding) + { + this.jumpAgain2 = true; + } + } + if (!this.doubleJump3) + { + this.jumpAgain3 = false; + } + else + { + if (this.velocity.Y == 0f || this.sliding) + { + this.jumpAgain3 = true; + } + } + if (!this.doubleJump4) + { + this.jumpAgain4 = false; + } + else + { + if (this.velocity.Y == 0f || this.sliding) + { + this.jumpAgain4 = true; + } + } + if (!this.carpet) + { + this.canCarpet = false; + this.carpetFrame = -1; + } + else + { + if (this.velocity.Y == 0f || this.sliding) + { + this.canCarpet = true; + this.carpetTime = 0; + this.carpetFrame = -1; + this.carpetFrameCounter = 0f; + } + } + if (this.gravDir == -1f) + { + this.canCarpet = false; + } + if (this.ropeCount > 0) + { + this.ropeCount--; + } + if (!this.pulley && !this.frozen && !this.controlJump && this.gravDir == 1f && this.ropeCount == 0 && this.grappling[0] == -1 && !this.tongued && (this.controlUp || this.controlDown)) + { + int num72 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num73 = (int)(this.position.Y - 8f) / 16; + if (Main.tile[num72, num73].active() && Main.tileRope[(int)Main.tile[num72, num73].type]) + { + float num74 = this.position.Y; + if (Main.tile[num72, num73 - 1] == null) + { + Main.tile[num72, num73 - 1] = new Tile(); + } + if (Main.tile[num72, num73 + 1] == null) + { + Main.tile[num72, num73 + 1] = new Tile(); + } + if ((!Main.tile[num72, num73 - 1].active() || !Main.tileRope[(int)Main.tile[num72, num73 - 1].type]) && (!Main.tile[num72, num73 + 1].active() || !Main.tileRope[(int)Main.tile[num72, num73 + 1].type])) + { + num74 = (float)(num73 * 16 + 22); + } + float num75 = (float)(num72 * 16 + 8 - this.width / 2 + 6 * this.direction); + int num76 = num72 * 16 + 8 - this.width / 2 + 6; + int num77 = num72 * 16 + 8 - this.width / 2; + int num78 = num72 * 16 + 8 - this.width / 2 + -6; + int num79 = 1; + float num80 = Math.Abs(this.position.X - (float)num76); + if (Math.Abs(this.position.X - (float)num77) < num80) + { + num79 = 2; + num80 = Math.Abs(this.position.X - (float)num77); + } + if (Math.Abs(this.position.X - (float)num78) < num80) + { + num79 = 3; + num80 = Math.Abs(this.position.X - (float)num78); + } + if (num79 == 1) + { + num75 = (float)num76; + this.pulleyDir = 2; + this.direction = 1; + } + if (num79 == 2) + { + num75 = (float)num77; + this.pulleyDir = 1; + } + if (num79 == 3) + { + num75 = (float)num78; + this.pulleyDir = 2; + this.direction = -1; + } + if (!Collision.SolidCollision(new Vector2(num75, this.position.Y), this.width, this.height)) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num75; + } + this.pulley = true; + this.position.X = num75; + this.gfxOffY = this.position.Y - num74; + this.stepSpeed = 2.5f; + this.position.Y = num74; + this.velocity.X = 0f; + } + else + { + num75 = (float)num76; + this.pulleyDir = 2; + this.direction = 1; + if (!Collision.SolidCollision(new Vector2(num75, this.position.Y), this.width, this.height)) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num75; + } + this.pulley = true; + this.position.X = num75; + this.gfxOffY = this.position.Y - num74; + this.stepSpeed = 2.5f; + this.position.Y = num74; + this.velocity.X = 0f; + } + else + { + num75 = (float)num78; + this.pulleyDir = 2; + this.direction = -1; + if (!Collision.SolidCollision(new Vector2(num75, this.position.Y), this.width, this.height)) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num75; + } + this.pulley = true; + this.position.X = num75; + this.gfxOffY = this.position.Y - num74; + this.stepSpeed = 2.5f; + this.position.Y = num74; + this.velocity.X = 0f; + } + } + } + } + } + if (this.pulley) + { + this.sandStorm = false; + this.dJumpEffect = false; + this.dJumpEffect2 = false; + this.dJumpEffect3 = false; + this.dJumpEffect4 = false; + int num81 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num82 = (int)(this.position.Y - 8f) / 16; + bool flag28 = false; + if (this.pulleyDir == 0) + { + this.pulleyDir = 1; + } + if (this.pulleyDir == 1) + { + if (this.direction == -1 && this.controlLeft && (this.releaseLeft || this.leftTimer == 0)) + { + this.pulleyDir = 2; + flag28 = true; + } + else + { + if ((this.direction == 1 && this.controlRight && this.releaseRight) || this.rightTimer == 0) + { + this.pulleyDir = 2; + flag28 = true; + } + else + { + if (this.direction == 1 && this.controlLeft) + { + this.direction = -1; + flag28 = true; + } + if (this.direction == -1 && this.controlRight) + { + this.direction = 1; + flag28 = true; + } + } + } + } + else + { + if (this.pulleyDir == 2) + { + if (this.direction == 1 && this.controlLeft) + { + flag28 = true; + int num83 = num81 * 16 + 8 - this.width / 2; + if (!Collision.SolidCollision(new Vector2((float)num83, this.position.Y), this.width, this.height)) + { + this.pulleyDir = 1; + this.direction = -1; + flag28 = true; + } + } + if (this.direction == -1 && this.controlRight) + { + flag28 = true; + int num84 = num81 * 16 + 8 - this.width / 2; + if (!Collision.SolidCollision(new Vector2((float)num84, this.position.Y), this.width, this.height)) + { + this.pulleyDir = 1; + this.direction = 1; + flag28 = true; + } + } + } + } + bool flag29 = false; + if (!flag28 && ((this.controlLeft && (this.releaseLeft || this.leftTimer == 0)) || (this.controlRight && (this.releaseRight || this.rightTimer == 0)))) + { + int num85 = 1; + if (this.controlLeft) + { + num85 = -1; + } + int num86 = num81 + num85; + if (Main.tile[num86, num82].active() && Main.tileRope[(int)Main.tile[num86, num82].type]) + { + this.pulleyDir = 1; + this.direction = num85; + int num87 = num86 * 16 + 8 - this.width / 2; + float num88 = this.position.Y; + num88 = (float)(num82 * 16 + 22); + if ((!Main.tile[num86, num82 - 1].active() || !Main.tileRope[(int)Main.tile[num86, num82 - 1].type]) && (!Main.tile[num86, num82 + 1].active() || !Main.tileRope[(int)Main.tile[num86, num82 + 1].type])) + { + num88 = (float)(num82 * 16 + 22); + } + if (Collision.SolidCollision(new Vector2((float)num87, num88), this.width, this.height)) + { + this.pulleyDir = 2; + this.direction = -num85; + if (this.direction == 1) + { + num87 = num86 * 16 + 8 - this.width / 2 + 6; + } + else + { + num87 = num86 * 16 + 8 - this.width / 2 + -6; + } + } + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - (float)num87; + } + this.position.X = (float)num87; + this.gfxOffY = this.position.Y - num88; + this.position.Y = num88; + flag29 = true; + } + } + if (!flag29 && !flag28 && !this.controlUp && ((this.controlLeft && this.releaseLeft) || (this.controlRight && this.releaseRight))) + { + this.pulley = false; + if (this.controlLeft && this.velocity.X == 0f) + { + this.velocity.X = -1f; + } + if (this.controlRight && this.velocity.X == 0f) + { + this.velocity.X = 1f; + } + } + if (this.velocity.X != 0f) + { + this.pulley = false; + } + if (Main.tile[num81, num82] == null) + { + Main.tile[num81, num82] = new Tile(); + } + if (!Main.tile[num81, num82].active() || !Main.tileRope[(int)Main.tile[num81, num82].type]) + { + this.pulley = false; + } + if (this.gravDir != 1f) + { + this.pulley = false; + } + if (this.frozen) + { + this.pulley = false; + } + if (!this.pulley) + { + this.velocity.Y = this.velocity.Y - num2; + } + if (this.controlJump) + { + this.pulley = false; + this.jump = Player.jumpHeight; + this.velocity.Y = -Player.jumpSpeed; + } + } + if (this.pulley) + { + this.fallStart = (int)this.position.Y / 16; + this.wingFrame = 0; + if (this.wings == 4) + { + this.wingFrame = 3; + } + int num89 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num90 = (int)(this.position.Y - 16f) / 16; + int num91 = (int)(this.position.Y - 8f) / 16; + bool flag30 = true; + bool flag31 = false; + if ((Main.tile[num89, num91 - 1].active() && Main.tileRope[(int)Main.tile[num89, num91 - 1].type]) || (Main.tile[num89, num91 + 1].active() && Main.tileRope[(int)Main.tile[num89, num91 + 1].type])) + { + flag31 = true; + } + if (Main.tile[num89, num90] == null) + { + Main.tile[num89, num90] = new Tile(); + } + if (!Main.tile[num89, num90].active() || !Main.tileRope[(int)Main.tile[num89, num90].type]) + { + flag30 = false; + if (this.velocity.Y < 0f) + { + this.velocity.Y = 0f; + } + } + if (flag31) + { + if (this.controlUp && flag30) + { + float num92 = this.position.X; + float y = this.position.Y - Math.Abs(this.velocity.Y) - 2f; + if (Collision.SolidCollision(new Vector2(num92, y), this.width, this.height)) + { + num92 = (float)(num89 * 16 + 8 - this.width / 2 + 6); + if (!Collision.SolidCollision(new Vector2(num92, y), this.width, (int)((float)this.height + Math.Abs(this.velocity.Y) + 2f))) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num92; + } + this.pulleyDir = 2; + this.direction = 1; + this.position.X = num92; + this.velocity.X = 0f; + } + else + { + num92 = (float)(num89 * 16 + 8 - this.width / 2 + -6); + if (!Collision.SolidCollision(new Vector2(num92, y), this.width, (int)((float)this.height + Math.Abs(this.velocity.Y) + 2f))) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num92; + } + this.pulleyDir = 2; + this.direction = -1; + this.position.X = num92; + this.velocity.X = 0f; + } + } + } + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.7f; + } + if (this.velocity.Y > -3f) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + else + { + this.velocity.Y = this.velocity.Y - 0.02f; + } + if (this.velocity.Y < -8f) + { + this.velocity.Y = -8f; + } + } + else + { + if (this.controlDown) + { + float num93 = this.position.X; + float y2 = this.position.Y; + if (Collision.SolidCollision(new Vector2(num93, y2), this.width, (int)((float)this.height + Math.Abs(this.velocity.Y) + 2f))) + { + num93 = (float)(num89 * 16 + 8 - this.width / 2 + 6); + if (!Collision.SolidCollision(new Vector2(num93, y2), this.width, (int)((float)this.height + Math.Abs(this.velocity.Y) + 2f))) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num93; + } + this.pulleyDir = 2; + this.direction = 1; + this.position.X = num93; + this.velocity.X = 0f; + } + else + { + num93 = (float)(num89 * 16 + 8 - this.width / 2 + -6); + if (!Collision.SolidCollision(new Vector2(num93, y2), this.width, (int)((float)this.height + Math.Abs(this.velocity.Y) + 2f))) + { + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num93; + } + this.pulleyDir = 2; + this.direction = -1; + this.position.X = num93; + this.velocity.X = 0f; + } + } + } + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.7f; + } + if (this.velocity.Y < 3f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + else + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + if (this.velocity.Y > num) + { + this.velocity.Y = num; + } + } + else + { + this.velocity.Y = this.velocity.Y * 0.7f; + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + } + } + else + { + if (this.controlDown) + { + this.ropeCount = 10; + this.pulley = false; + this.velocity.Y = 1f; + } + else + { + this.velocity.Y = 0f; + this.position.Y = (float)(num90 * 16 + 22); + } + } + float num94 = (float)(num89 * 16 + 8 - this.width / 2); + if (this.pulleyDir == 1) + { + num94 = (float)(num89 * 16 + 8 - this.width / 2); + } + if (this.pulleyDir == 2) + { + num94 = (float)(num89 * 16 + 8 - this.width / 2 + 6 * this.direction); + } + if (i == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - num94; + } + this.position.X = num94; + this.pulleyFrameCounter += Math.Abs(this.velocity.Y * 0.75f); + if (this.velocity.Y != 0f) + { + this.pulleyFrameCounter += 0.75f; + } + if (this.pulleyFrameCounter > 10f) + { + this.pulleyFrame++; + this.pulleyFrameCounter = 0f; + } + if (this.pulleyFrame > 1) + { + this.pulleyFrame = 0; + } + this.canCarpet = true; + this.carpetFrame = -1; + this.wingTime = this.GetWingTime(); + this.rocketTime = this.rocketTimeMax; + this.rocketDelay = 0; + this.rocketFrame = false; + this.canRocket = false; + this.rocketRelease = false; + } + else + { + if (this.grappling[0] == -1 && !this.tongued) + { + if (this.wings == 3 && this.velocity.Y == 0f) + { + num6 = 8.5f; + } + if (this.wings == 3 && Main.myPlayer == this.whoAmi) + { + num6 = 0f; + } + if (this.wings > 0 && this.velocity.Y != 0f) + { + if (this.wings == 1 || this.wings == 2) + { + num6 = 6.25f; + } + if (this.wings == 4) + { + num6 = 6.5f; + } + if (this.wings == 5 || this.wings == 6 || this.wings == 13 || this.wings == 15) + { + num6 = 6.75f; + } + if (this.wings == 7 || this.wings == 8) + { + num6 = 7f; + } + if (this.wings == 9 || this.wings == 10 || this.wings == 11) + { + num6 = 7.5f; + } + if (this.wings == 12) + { + num6 = 7.75f; + } + if (this.wings == 16 || this.wings == 17 || this.wings == 18 || this.wings == 19) + { + num6 = 7.9f; + } + if (this.wings == 3) + { + num6 = 11f; + num4 *= 3f; + } + } + if (Main.myPlayer == this.whoAmi && (this.wings == 3 || this.wings == 16 || this.wings == 17 || this.wings == 18 || this.wings == 19)) + { + num6 = 0f; + num3 *= 0.2f; + num4 *= 0.2f; + } + if (this.sticky) + { + num3 *= 0.25f; + num4 *= 0.25f; + num5 *= 2f; + if (this.velocity.X > num3) + { + this.velocity.X = num3; + } + if (this.velocity.X < -num3) + { + this.velocity.X = -num3; + } + } + else + { + if (this.powerrun) + { + num3 *= 3.5f; + num4 *= 1f; + num5 *= 2f; + } + else + { + if (this.slippy2) + { + num4 *= 0.6f; + num5 = 0f; + if (this.iceSkate) + { + num4 *= 3.5f; + num3 *= 1.25f; + } + } + else + { + if (this.slippy) + { + num4 *= 0.7f; + if (this.iceSkate) + { + num4 *= 3.5f; + num3 *= 1.25f; + } + else + { + num5 *= 0.1f; + } + } + } + } + } + if (this.sandStorm) + { + num4 *= 1.5f; + num3 *= 2f; + } + if (this.dJumpEffect3 && this.doubleJump3) + { + num4 *= 3f; + num3 *= 1.5f; + } + if (this.dJumpEffect4 && this.doubleJump4) + { + num4 *= 3f; + num3 *= 1.75f; + } + if (this.carpetFrame != -1) + { + num4 *= 1.25f; + num3 *= 1.5f; + } + if (this.controlLeft && this.velocity.X > -num3) + { + if (this.velocity.X > num5) + { + this.velocity.X = this.velocity.X - num5; + } + this.velocity.X = this.velocity.X - num4; + if (!this.sandStorm && (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn)) + { + this.direction = -1; + } + } + else + { + if (this.controlRight && this.velocity.X < num3) + { + if (this.velocity.X < -num5) + { + this.velocity.X = this.velocity.X + num5; + } + this.velocity.X = this.velocity.X + num4; + if (!this.sandStorm && (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn)) + { + this.direction = 1; + } + } + else + { + if (this.controlLeft && this.velocity.X > -num6 && this.dashDelay == 0) + { + if (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) + { + this.direction = -1; + } + if (this.velocity.Y == 0f || this.wings > 0) + { + if (this.velocity.X > num5) + { + this.velocity.X = this.velocity.X - num5; + } + this.velocity.X = this.velocity.X - num4 * 0.2f; + if (this.wings > 0) + { + this.velocity.X = this.velocity.X - num4 * 0.2f; + } + } + if (this.velocity.X < -(num6 + num3) / 2f && this.velocity.Y == 0f) + { + int num95 = 0; + if (this.gravDir == -1f) + { + num95 -= this.height; + } + if (this.runSoundDelay == 0 && this.velocity.Y == 0f) + { + Main.PlaySound(17, (int)this.position.X, (int)this.position.Y, 1); + this.runSoundDelay = 9; + } + if (this.wings == 3) + { + int num96 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height + (float)num95), this.width + 8, 4, 186, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.5f); + Main.dust[num96].velocity *= 0.025f; + num96 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height + (float)num95), this.width + 8, 4, 186, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.5f); + Main.dust[num96].velocity *= 0.2f; + } + else + { + if (this.coldDash) + { + for (int num97 = 0; num97 < 2; num97++) + { + int num98; + if (num97 == 0) + { + num98 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height + this.gfxOffY), this.width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f); + } + else + { + num98 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)this.height + this.gfxOffY), this.width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f); + } + Main.dust[num98].scale *= 1f + (float)Main.rand.Next(20, 40) * 0.01f; + Main.dust[num98].noGravity = true; + Main.dust[num98].noLight = true; + Main.dust[num98].velocity *= 0.001f; + Dust expr_A041_cp_0 = Main.dust[num98]; + expr_A041_cp_0.velocity.Y = expr_A041_cp_0.velocity.Y - 0.003f; + } + } + else + { + int num99 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height + (float)num95), this.width + 8, 4, 16, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.5f); + Main.dust[num99].velocity.X = Main.dust[num99].velocity.X * 0.2f; + Main.dust[num99].velocity.Y = Main.dust[num99].velocity.Y * 0.2f; + } + } + } + } + else + { + if (this.controlRight && this.velocity.X < num6 && this.dashDelay == 0) + { + if (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) + { + this.direction = 1; + } + if (this.velocity.Y == 0f || this.wings > 0) + { + if (this.velocity.X < -num5) + { + this.velocity.X = this.velocity.X + num5; + } + this.velocity.X = this.velocity.X + num4 * 0.2f; + if (this.wings > 0) + { + this.velocity.X = this.velocity.X + num4 * 0.2f; + } + } + if (this.velocity.X > (num6 + num3) / 2f && this.velocity.Y == 0f) + { + int num100 = 0; + if (this.gravDir == -1f) + { + num100 -= this.height; + } + if (this.runSoundDelay == 0 && this.velocity.Y == 0f) + { + Main.PlaySound(17, (int)this.position.X, (int)this.position.Y, 1); + this.runSoundDelay = 9; + } + if (this.wings == 3) + { + int num101 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height + (float)num100), this.width + 8, 4, 186, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.5f); + Main.dust[num101].velocity *= 0.025f; + num101 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height + (float)num100), this.width + 8, 4, 186, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.5f); + Main.dust[num101].velocity *= 0.2f; + } + else + { + if (this.coldDash) + { + for (int num102 = 0; num102 < 2; num102++) + { + int num103; + if (num102 == 0) + { + num103 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height + this.gfxOffY), this.width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f); + } + else + { + num103 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)this.height + this.gfxOffY), this.width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f); + } + Main.dust[num103].scale *= 1f + (float)Main.rand.Next(20, 40) * 0.01f; + Main.dust[num103].noGravity = true; + Main.dust[num103].noLight = true; + Main.dust[num103].velocity *= 0.001f; + Dust expr_A511_cp_0 = Main.dust[num103]; + expr_A511_cp_0.velocity.Y = expr_A511_cp_0.velocity.Y - 0.003f; + } + } + else + { + int num104 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)this.height + (float)num100), this.width + 8, 4, 16, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.5f); + Main.dust[num104].velocity.X = Main.dust[num104].velocity.X * 0.2f; + Main.dust[num104].velocity.Y = Main.dust[num104].velocity.Y * 0.2f; + } + } + } + } + else + { + if (this.velocity.Y == 0f) + { + if (this.velocity.X > num5) + { + this.velocity.X = this.velocity.X - num5; + } + else + { + if (this.velocity.X < -num5) + { + this.velocity.X = this.velocity.X + num5; + } + else + { + this.velocity.X = 0f; + } + } + } + else + { + if ((double)this.velocity.X > (double)num5 * 0.5) + { + this.velocity.X = this.velocity.X - num5 * 0.5f; + } + else + { + if ((double)this.velocity.X < (double)(-(double)num5) * 0.5) + { + this.velocity.X = this.velocity.X + num5 * 0.5f; + } + else + { + this.velocity.X = 0f; + } + } + } + } + } + } + } + if (this.gravControl) + { + if (this.controlUp && this.releaseUp) + { + if (this.gravDir == 1f) + { + this.gravDir = -1f; + this.fallStart = (int)(this.position.Y / 16f); + this.jump = 0; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + else + { + this.gravDir = 1f; + this.fallStart = (int)(this.position.Y / 16f); + this.jump = 0; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + } + } + else + { + if (this.gravControl2) + { + if (this.controlUp && this.releaseUp && this.velocity.Y == 0f) + { + if (this.gravDir == 1f) + { + this.gravDir = -1f; + this.fallStart = (int)(this.position.Y / 16f); + this.jump = 0; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + else + { + this.gravDir = 1f; + this.fallStart = (int)(this.position.Y / 16f); + this.jump = 0; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + } + } + else + { + this.gravDir = 1f; + } + } + if (this.controlUp) + { + this.releaseUp = false; + } + else + { + this.releaseUp = true; + } + this.sandStorm = false; + if (this.controlJump) + { + if (this.jump > 0) + { + if (this.velocity.Y == 0f) + { + if (this.merman) + { + this.jump = 10; + } + this.jump = 0; + } + else + { + this.velocity.Y = -Player.jumpSpeed * this.gravDir; + if (this.merman) + { + if (this.swimTime <= 10) + { + this.swimTime = 30; + } + } + else + { + this.jump--; + } + } + } + else + { + if ((this.sliding || this.velocity.Y == 0f || this.jumpAgain || this.jumpAgain2 || this.jumpAgain3 || this.jumpAgain4 || (this.wet && this.accFlipper)) && this.releaseJump) + { + bool flag32 = false; + if (this.wet && this.accFlipper) + { + if (this.swimTime == 0) + { + this.swimTime = 30; + } + flag32 = true; + } + bool flag33 = false; + bool flag34 = false; + bool flag35 = false; + if (this.jumpAgain2) + { + flag33 = true; + this.jumpAgain2 = false; + } + else + { + if (this.jumpAgain3) + { + flag34 = true; + this.jumpAgain3 = false; + } + else + { + if (this.jumpAgain4) + { + this.jumpAgain4 = false; + flag35 = true; + } + else + { + this.jumpAgain = false; + } + } + } + this.canRocket = false; + this.rocketRelease = false; + if ((this.velocity.Y == 0f || this.sliding) && this.doubleJump) + { + this.jumpAgain = true; + } + if ((this.velocity.Y == 0f || this.sliding) && this.doubleJump2) + { + this.jumpAgain2 = true; + } + if ((this.velocity.Y == 0f || this.sliding) && this.doubleJump3) + { + this.jumpAgain3 = true; + } + if ((this.velocity.Y == 0f || this.sliding) && this.doubleJump4) + { + this.jumpAgain4 = true; + } + if (this.velocity.Y == 0f || flag32 || this.sliding) + { + this.velocity.Y = -Player.jumpSpeed * this.gravDir; + this.jump = Player.jumpHeight; + if (this.sliding) + { + this.velocity.X = (float)(3 * -(float)this.slideDir); + } + } + else + { + if (flag33) + { + this.dJumpEffect2 = true; + float arg_AB51_0 = this.gravDir; + Main.PlaySound(16, (int)this.position.X, (int)this.position.Y, 1); + this.velocity.Y = -Player.jumpSpeed * this.gravDir; + this.jump = Player.jumpHeight * 3; + } + else + { + if (flag34) + { + this.dJumpEffect3 = true; + float arg_ABB3_0 = this.gravDir; + Main.PlaySound(16, (int)this.position.X, (int)this.position.Y, 1); + this.velocity.Y = -Player.jumpSpeed * this.gravDir; + this.jump = (int)((double)Player.jumpHeight * 1.5); + } + else + { + if (flag35) + { + this.dJumpEffect4 = true; + int num105 = this.height; + if (this.gravDir == -1f) + { + num105 = 0; + } + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 16); + this.velocity.Y = -Player.jumpSpeed * this.gravDir; + this.jump = Player.jumpHeight * 2; + for (int num106 = 0; num106 < 10; num106++) + { + int num107 = Dust.NewDust(new Vector2(this.position.X - 34f, this.position.Y + (float)num105 - 16f), 102, 32, 188, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 100, default(Color), 1.5f); + Main.dust[num107].velocity.X = Main.dust[num107].velocity.X * 0.5f - this.velocity.X * 0.1f; + Main.dust[num107].velocity.Y = Main.dust[num107].velocity.Y * 0.5f - this.velocity.Y * 0.3f; + } + int num108 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 16f, this.position.Y + (float)num105 - 16f), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(435, 438), 1f); + Main.gore[num108].velocity.X = Main.gore[num108].velocity.X * 0.1f - this.velocity.X * 0.1f; + Main.gore[num108].velocity.Y = Main.gore[num108].velocity.Y * 0.1f - this.velocity.Y * 0.05f; + num108 = Gore.NewGore(new Vector2(this.position.X - 36f, this.position.Y + (float)num105 - 16f), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(435, 438), 1f); + Main.gore[num108].velocity.X = Main.gore[num108].velocity.X * 0.1f - this.velocity.X * 0.1f; + Main.gore[num108].velocity.Y = Main.gore[num108].velocity.Y * 0.1f - this.velocity.Y * 0.05f; + num108 = Gore.NewGore(new Vector2(this.position.X + (float)this.width + 4f, this.position.Y + (float)num105 - 16f), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(435, 438), 1f); + Main.gore[num108].velocity.X = Main.gore[num108].velocity.X * 0.1f - this.velocity.X * 0.1f; + Main.gore[num108].velocity.Y = Main.gore[num108].velocity.Y * 0.1f - this.velocity.Y * 0.05f; + } + else + { + this.dJumpEffect = true; + int num109 = this.height; + if (this.gravDir == -1f) + { + num109 = 0; + } + Main.PlaySound(16, (int)this.position.X, (int)this.position.Y, 1); + this.velocity.Y = -Player.jumpSpeed * this.gravDir; + this.jump = (int)((double)Player.jumpHeight * 0.75); + for (int num110 = 0; num110 < 10; num110++) + { + int num111 = Dust.NewDust(new Vector2(this.position.X - 34f, this.position.Y + (float)num109 - 16f), 102, 32, 16, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 100, default(Color), 1.5f); + Main.dust[num111].velocity.X = Main.dust[num111].velocity.X * 0.5f - this.velocity.X * 0.1f; + Main.dust[num111].velocity.Y = Main.dust[num111].velocity.Y * 0.5f - this.velocity.Y * 0.3f; + } + int num112 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 16f, this.position.Y + (float)num109 - 16f), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14), 1f); + Main.gore[num112].velocity.X = Main.gore[num112].velocity.X * 0.1f - this.velocity.X * 0.1f; + Main.gore[num112].velocity.Y = Main.gore[num112].velocity.Y * 0.1f - this.velocity.Y * 0.05f; + num112 = Gore.NewGore(new Vector2(this.position.X - 36f, this.position.Y + (float)num109 - 16f), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14), 1f); + Main.gore[num112].velocity.X = Main.gore[num112].velocity.X * 0.1f - this.velocity.X * 0.1f; + Main.gore[num112].velocity.Y = Main.gore[num112].velocity.Y * 0.1f - this.velocity.Y * 0.05f; + num112 = Gore.NewGore(new Vector2(this.position.X + (float)this.width + 4f, this.position.Y + (float)num109 - 16f), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14), 1f); + Main.gore[num112].velocity.X = Main.gore[num112].velocity.X * 0.1f - this.velocity.X * 0.1f; + Main.gore[num112].velocity.Y = Main.gore[num112].velocity.Y * 0.1f - this.velocity.Y * 0.05f; + } + } + } + } + } + } + this.releaseJump = false; + } + else + { + this.jump = 0; + this.releaseJump = true; + this.rocketRelease = true; + } + if (this.wings == 0) + { + this.wingTime = 0; + } + if (this.wings == 3) + { + this.wingTime = 1000; + } + if (Main.myPlayer == this.whoAmi && (this.wings == 3 || this.wings == 16 || this.wings == 17 || this.wings == 18 || this.wings == 19)) + { + this.wingTime = 0; + this.jump = 0; + } + if (this.rocketBoots == 0) + { + this.rocketTime = 0; + } + if (this.jump == 0) + { + this.dJumpEffect = false; + this.dJumpEffect2 = false; + this.dJumpEffect3 = false; + this.dJumpEffect4 = false; + } + if (this.dashDelay > 0) + { + this.dashDelay--; + } + else + { + if (this.dashDelay < 0) + { + for (int num113 = 0; num113 < 2; num113++) + { + int num114; + if (this.velocity.Y == 0f) + { + num114 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 4f), this.width, 8, 31, 0f, 0f, 100, default(Color), 1.4f); + } + else + { + num114 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)(this.height / 2) - 8f), this.width, 16, 31, 0f, 0f, 100, default(Color), 1.4f); + } + Main.dust[num114].velocity *= 0.1f; + Main.dust[num114].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + } + if (this.velocity.X > 13f || this.velocity.X < -13f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + else + { + if (this.velocity.X > num3 || this.velocity.X < -num3) + { + this.velocity.X = this.velocity.X * 0.8f; + } + else + { + this.dashDelay = 30; + } + } + } + else + { + if (this.dash > 0) + { + int num115 = 0; + bool flag36 = false; + if (this.dashTime > 0) + { + this.dashTime--; + } + if (this.dashTime < 0) + { + this.dashTime++; + } + if (this.controlRight && this.releaseRight) + { + if (this.dashTime > 0) + { + num115 = 1; + flag36 = true; + this.dashTime = 0; + } + else + { + this.dashTime = 15; + } + } + else + { + if (this.controlLeft && this.releaseLeft) + { + if (this.dashTime < 0) + { + num115 = -1; + flag36 = true; + this.dashTime = 0; + } + else + { + this.dashTime = -15; + } + } + } + if (flag36) + { + this.velocity.X = 15.9f * (float)num115; + this.dashDelay = -1; + for (int num116 = 0; num116 < 20; num116++) + { + int num117 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 2f); + Dust expr_B7F6_cp_0 = Main.dust[num117]; + expr_B7F6_cp_0.position.X = expr_B7F6_cp_0.position.X + (float)Main.rand.Next(-5, 6); + Dust expr_B81D_cp_0 = Main.dust[num117]; + expr_B81D_cp_0.position.Y = expr_B81D_cp_0.position.Y + (float)Main.rand.Next(-5, 6); + Main.dust[num117].velocity *= 0.2f; + Main.dust[num117].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + } + int num118 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 34f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num118].velocity.X = (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num118].velocity.Y = (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num118].velocity *= 0.4f; + num118 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 14f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num118].velocity.X = (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num118].velocity.Y = (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num118].velocity *= 0.4f; + } + } + } + } + this.sliding = false; + if (this.slideDir != 0 && this.spikedBoots > 0 && ((this.controlLeft && this.slideDir == -1) || (this.controlRight && this.slideDir == 1))) + { + bool flag37 = false; + float num119 = this.position.X; + if (this.slideDir == 1) + { + num119 += (float)this.width; + } + num119 += (float)this.slideDir; + float num120 = this.position.Y + (float)this.height + 1f; + if (this.gravDir < 0f) + { + num120 = this.position.Y - 1f; + } + num119 /= 16f; + num120 /= 16f; + if (WorldGen.SolidTile((int)num119, (int)num120) && WorldGen.SolidTile((int)num119, (int)num120 - 1)) + { + flag37 = true; + } + if (this.spikedBoots >= 2) + { + if (flag37 && ((this.velocity.Y > 0f && this.gravDir == 1f) || (this.velocity.Y < num2 && this.gravDir == -1f))) + { + float num121 = num2; + if (this.slowFall) + { + if (this.controlUp) + { + num121 = num2 / 10f * this.gravDir; + } + else + { + num121 = num2 / 3f * this.gravDir; + } + } + this.fallStart = (int)(this.position.Y / 16f); + if ((this.controlDown && this.gravDir == 1f) || (this.controlUp && this.gravDir == -1f)) + { + this.velocity.Y = 4f * this.gravDir; + int num122 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)((this.width / 2 - 4) * this.slideDir), this.position.Y + (float)(this.height / 2) + (float)(this.height / 2 - 4) * this.gravDir), 8, 8, 31, 0f, 0f, 0, default(Color), 1f); + if (this.slideDir < 0) + { + Dust expr_BC8C_cp_0 = Main.dust[num122]; + expr_BC8C_cp_0.position.X = expr_BC8C_cp_0.position.X - 10f; + } + if (this.gravDir < 0f) + { + Dust expr_BCB7_cp_0 = Main.dust[num122]; + expr_BCB7_cp_0.position.Y = expr_BCB7_cp_0.position.Y - 12f; + } + Main.dust[num122].velocity *= 0.1f; + Main.dust[num122].scale *= 1.2f; + Main.dust[num122].noGravity = true; + } + else + { + if (this.gravDir == -1f) + { + this.velocity.Y = (-num121 + 1E-05f) * this.gravDir; + } + else + { + this.velocity.Y = (-num121 + 1E-05f) * this.gravDir; + } + } + this.sliding = true; + } + } + else + { + if ((flag37 && (double)this.velocity.Y > 0.5 && this.gravDir == 1f) || ((double)this.velocity.Y < -0.5 && this.gravDir == -1f)) + { + this.fallStart = (int)(this.position.Y / 16f); + if (this.controlDown) + { + this.velocity.Y = 4f * this.gravDir; + } + else + { + this.velocity.Y = 0.5f * this.gravDir; + } + this.sliding = true; + int num123 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)((this.width / 2 - 4) * this.slideDir), this.position.Y + (float)(this.height / 2) + (float)(this.height / 2 - 4) * this.gravDir), 8, 8, 31, 0f, 0f, 0, default(Color), 1f); + if (this.slideDir < 0) + { + Dust expr_BE9C_cp_0 = Main.dust[num123]; + expr_BE9C_cp_0.position.X = expr_BE9C_cp_0.position.X - 10f; + } + if (this.gravDir < 0f) + { + Dust expr_BEC7_cp_0 = Main.dust[num123]; + expr_BEC7_cp_0.position.Y = expr_BEC7_cp_0.position.Y - 12f; + } + Main.dust[num123].velocity *= 0.1f; + Main.dust[num123].scale *= 1.2f; + Main.dust[num123].noGravity = true; + } + } + } + bool flag38 = false; + if (this.grappling[0] == -1 && this.carpet && !this.jumpAgain && !this.jumpAgain2 && !this.jumpAgain3 && !this.jumpAgain4 && this.jump == 0 && this.velocity.Y != 0f && this.rocketTime == 0 && this.wingTime == 0) + { + if (this.controlJump && this.canCarpet) + { + this.canCarpet = false; + this.carpetTime = 300; + } + if (this.carpetTime > 0 && this.controlJump) + { + this.fallStart = (int)(this.position.Y / 16f); + flag38 = true; + this.carpetTime--; + if (this.gravDir == 1f && this.velocity.Y > -num2) + { + this.velocity.Y = -(num2 + 1E-06f); + } + else + { + if (this.gravDir == -1f && this.velocity.Y < num2) + { + this.velocity.Y = num2 + 1E-06f; + } + } + this.carpetFrameCounter += 1f + Math.Abs(this.velocity.X * 0.5f); + if (this.carpetFrameCounter > 8f) + { + this.carpetFrameCounter = 0f; + this.carpetFrame++; + } + if (this.carpetFrame < 0) + { + this.carpetFrame = 0; + } + if (this.carpetFrame > 5) + { + this.carpetFrame = 0; + } + } + } + if (!flag38) + { + this.carpetFrame = -1; + } + if (this.dJumpEffect && this.doubleJump && !this.jumpAgain && (this.jumpAgain2 || !this.doubleJump2) && ((this.gravDir == 1f && this.velocity.Y < 0f) || (this.gravDir == -1f && this.velocity.Y > 0f))) + { + int num124 = this.height; + if (this.gravDir == -1f) + { + num124 = -6; + } + int num125 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)num124), this.width + 8, 4, 16, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 100, default(Color), 1.5f); + Main.dust[num125].velocity.X = Main.dust[num125].velocity.X * 0.5f - this.velocity.X * 0.1f; + Main.dust[num125].velocity.Y = Main.dust[num125].velocity.Y * 0.5f - this.velocity.Y * 0.3f; + } + if (this.dJumpEffect2 && this.doubleJump2 && !this.jumpAgain2 && ((this.gravDir == 1f && this.velocity.Y < 0f) || (this.gravDir == -1f && this.velocity.Y > 0f))) + { + int num126 = this.height; + if (this.gravDir == -1f) + { + num126 = -6; + } + float num127 = ((float)this.jump / 75f + 1f) / 2f; + for (int num128 = 0; num128 < 3; num128++) + { + int num129 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)(num126 / 2)), this.width, 32, 124, this.velocity.X * 0.3f, this.velocity.Y * 0.3f, 150, default(Color), 1f * num127); + Main.dust[num129].velocity *= 0.5f * num127; + Main.dust[num129].fadeIn = 1.5f * num127; + } + this.sandStorm = true; + if (this.miscCounter % 3 == 0) + { + int num130 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 18f, this.position.Y + (float)(num126 / 2)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(220, 223), num127); + Main.gore[num130].velocity = this.velocity * 0.3f * num127; + Main.gore[num130].alpha = 100; + } + } + if (this.dJumpEffect4 && this.doubleJump4 && !this.jumpAgain4 && ((this.gravDir == 1f && this.velocity.Y < 0f) || (this.gravDir == -1f && this.velocity.Y > 0f))) + { + int num131 = this.height; + if (this.gravDir == -1f) + { + num131 = -6; + } + int num132 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)num131), this.width + 8, 4, 188, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 100, default(Color), 1.5f); + Main.dust[num132].velocity.X = Main.dust[num132].velocity.X * 0.5f - this.velocity.X * 0.1f; + Main.dust[num132].velocity.Y = Main.dust[num132].velocity.Y * 0.5f - this.velocity.Y * 0.3f; + Main.dust[num132].velocity *= 0.5f; + } + if (this.dJumpEffect3 && this.doubleJump3 && !this.jumpAgain3 && ((this.gravDir == 1f && this.velocity.Y < 0f) || (this.gravDir == -1f && this.velocity.Y > 0f))) + { + int num133 = this.height - 6; + if (this.gravDir == -1f) + { + num133 = 6; + } + for (int num134 = 0; num134 < 2; num134++) + { + int num135 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)num133), this.width, 12, 76, this.velocity.X * 0.3f, this.velocity.Y * 0.3f, 0, default(Color), 1f); + Main.dust[num135].velocity *= 0.1f; + if (num134 == 0) + { + Main.dust[num135].velocity += this.velocity * 0.03f; + } + else + { + Main.dust[num135].velocity -= this.velocity * 0.03f; + } + Main.dust[num135].noLight = true; + } + for (int num136 = 0; num136 < 3; num136++) + { + int num137 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)num133), this.width, 12, 76, this.velocity.X * 0.3f, this.velocity.Y * 0.3f, 0, default(Color), 1f); + Main.dust[num137].fadeIn = 1.5f; + Main.dust[num137].velocity *= 0.6f; + Main.dust[num137].velocity += this.velocity * 0.8f; + Main.dust[num137].noGravity = true; + Main.dust[num137].noLight = true; + } + for (int num138 = 0; num138 < 3; num138++) + { + int num139 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)num133), this.width, 12, 76, this.velocity.X * 0.3f, this.velocity.Y * 0.3f, 0, default(Color), 1f); + Main.dust[num139].fadeIn = 1.5f; + Main.dust[num139].velocity *= 0.6f; + Main.dust[num139].velocity -= this.velocity * 0.8f; + Main.dust[num139].noGravity = true; + Main.dust[num139].noLight = true; + } + } + if (this.wings > 0) + { + this.sandStorm = false; + } + if (((this.gravDir == 1f && this.velocity.Y > -Player.jumpSpeed) || (this.gravDir == -1f && this.velocity.Y < Player.jumpSpeed)) && this.velocity.Y != 0f) + { + this.canRocket = true; + } + bool flag39 = false; + if (this.velocity.Y == 0f || this.sliding) + { + this.wingTime = this.GetWingTime(); + } + if (this.wings > 0 && this.controlJump && this.wingTime > 0 && !this.jumpAgain && this.jump == 0 && this.velocity.Y != 0f) + { + flag39 = true; + } + if (this.frozen) + { + this.velocity.Y = this.velocity.Y + num2; + if (this.velocity.Y > num) + { + this.velocity.Y = num; + } + this.sandStorm = false; + this.dJumpEffect = false; + this.dJumpEffect2 = false; + this.dJumpEffect3 = false; + } + else + { + if (flag39) + { + if (this.wings == 10 && Main.rand.Next(2) == 0) + { + int num140 = 4; + if (this.direction == 1) + { + num140 = -40; + } + int num141 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num140, this.position.Y + (float)(this.height / 2) - 15f), 30, 30, 76, 0f, 0f, 50, default(Color), 0.6f); + Main.dust[num141].fadeIn = 1.1f; + Main.dust[num141].noGravity = true; + Main.dust[num141].noLight = true; + Main.dust[num141].velocity *= 0.3f; + } + if (this.wings == 9 && Main.rand.Next(2) == 0) + { + int num142 = 4; + if (this.direction == 1) + { + num142 = -40; + } + int num143 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num142, this.position.Y + (float)(this.height / 2) - 15f), 30, 30, 6, 0f, 0f, 200, default(Color), 2f); + Main.dust[num143].noGravity = true; + Main.dust[num143].velocity *= 0.3f; + } + if (this.wings == 6 && Main.rand.Next(4) == 0) + { + int num144 = 4; + if (this.direction == 1) + { + num144 = -40; + } + int num145 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num144, this.position.Y + (float)(this.height / 2) - 15f), 30, 30, 55, 0f, 0f, 200, default(Color), 1f); + Main.dust[num145].velocity *= 0.3f; + } + if (this.wings == 5 && Main.rand.Next(3) == 0) + { + int num146 = 6; + if (this.direction == 1) + { + num146 = -30; + } + int num147 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num146, this.position.Y), 18, this.height, 58, 0f, 0f, 255, default(Color), 1.2f); + Main.dust[num147].velocity *= 0.3f; + } + if (this.wings == 4 && this.controlUp) + { + this.velocity.Y = this.velocity.Y - 0.2f * this.gravDir; + if (this.gravDir == 1f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 1f; + } + else + { + if (this.velocity.Y > -Player.jumpSpeed) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + } + if (this.velocity.Y < -Player.jumpSpeed * 3f) + { + this.velocity.Y = -Player.jumpSpeed * 3f; + } + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 1f; + } + else + { + if (this.velocity.Y < Player.jumpSpeed) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + if (this.velocity.Y > Player.jumpSpeed * 3f) + { + this.velocity.Y = Player.jumpSpeed * 3f; + } + } + this.wingTime -= 2; + } + else + { + if (this.wings == 3 && this.controlUp) + { + this.velocity.Y = this.velocity.Y - 0.3f * this.gravDir; + if (this.gravDir == 1f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 1f; + } + else + { + if (this.velocity.Y > -Player.jumpSpeed) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + } + if (this.velocity.Y < -Player.jumpSpeed * 3f) + { + this.velocity.Y = -Player.jumpSpeed * 3f; + } + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 1f; + } + else + { + if (this.velocity.Y < Player.jumpSpeed) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + if (this.velocity.Y > Player.jumpSpeed * 3f) + { + this.velocity.Y = Player.jumpSpeed * 3f; + } + } + this.wingTime -= 2; + } + else + { + this.velocity.Y = this.velocity.Y - 0.1f * this.gravDir; + if (this.gravDir == 1f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.5f; + } + else + { + if ((double)this.velocity.Y > (double)(-(double)Player.jumpSpeed) * 0.5) + { + this.velocity.Y = this.velocity.Y - 0.1f; + } + } + if (this.velocity.Y < -Player.jumpSpeed * 1.5f) + { + this.velocity.Y = -Player.jumpSpeed * 1.5f; + } + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.5f; + } + else + { + if ((double)this.velocity.Y < (double)Player.jumpSpeed * 0.5) + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + } + if (this.velocity.Y > Player.jumpSpeed * 1.5f) + { + this.velocity.Y = Player.jumpSpeed * 1.5f; + } + } + this.wingTime--; + } + } + } + if (this.wings == 4) + { + if (flag39 || this.jump > 0) + { + this.rocketDelay2--; + if (this.rocketDelay2 <= 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 13); + this.rocketDelay2 = 60; + } + int num148 = 2; + if (this.controlUp) + { + num148 = 4; + } + for (int num149 = 0; num149 < num148; num149++) + { + int type3 = 6; + if (this.head == 41) + { + int arg_D207_0 = this.body; + } + float scale = 1.75f; + int alpha = 100; + float x = this.position.X + (float)(this.width / 2) + 16f; + if (this.direction > 0) + { + x = this.position.X + (float)(this.width / 2) - 26f; + } + float num150 = this.position.Y + (float)this.height - 18f; + if (num149 == 1 || num149 == 3) + { + x = this.position.X + (float)(this.width / 2) + 8f; + if (this.direction > 0) + { + x = this.position.X + (float)(this.width / 2) - 20f; + } + num150 += 6f; + } + if (num149 > 1) + { + num150 += this.velocity.Y; + } + int num151 = Dust.NewDust(new Vector2(x, num150), 8, 8, type3, 0f, 0f, alpha, default(Color), scale); + Dust expr_D31A_cp_0 = Main.dust[num151]; + expr_D31A_cp_0.velocity.X = expr_D31A_cp_0.velocity.X * 0.1f; + Main.dust[num151].velocity.Y = Main.dust[num151].velocity.Y * 1f + 2f * this.gravDir - this.velocity.Y * 0.3f; + Main.dust[num151].noGravity = true; + if (num148 == 4) + { + Dust expr_D394_cp_0 = Main.dust[num151]; + expr_D394_cp_0.velocity.Y = expr_D394_cp_0.velocity.Y + 6f; + } + } + this.wingFrameCounter++; + if (this.wingFrameCounter > 4) + { + this.wingFrame++; + this.wingFrameCounter = 0; + if (this.wingFrame >= 3) + { + this.wingFrame = 0; + } + } + } + else + { + if (!this.controlJump || this.velocity.Y == 0f) + { + this.wingFrame = 3; + } + } + } + else + { + if (this.wings == 12) + { + if (flag39 || this.jump > 0) + { + this.wingFrameCounter++; + int num152 = 5; + if (this.wingFrameCounter < num152) + { + this.wingFrame = 1; + } + else + { + if (this.wingFrameCounter < num152 * 2) + { + this.wingFrame = 2; + } + else + { + if (this.wingFrameCounter < num152 * 3) + { + this.wingFrame = 3; + } + else + { + if (this.wingFrameCounter < num152 * 4 - 1) + { + this.wingFrame = 2; + } + else + { + this.wingFrame = 2; + this.wingFrameCounter = 0; + } + } + } + } + } + else + { + if (this.velocity.Y != 0f) + { + this.wingFrame = 2; + } + else + { + this.wingFrame = 0; + } + } + } + else + { + if (flag39 || this.jump > 0) + { + this.wingFrameCounter++; + if (this.wingFrameCounter > 4) + { + this.wingFrame++; + this.wingFrameCounter = 0; + if (this.wingFrame >= 4) + { + this.wingFrame = 0; + } + } + } + else + { + if (this.velocity.Y != 0f) + { + this.wingFrame = 1; + } + else + { + this.wingFrame = 0; + } + } + } + } + if (this.wings > 0 && this.rocketBoots > 0) + { + this.wingTime += this.rocketTime * 3; + this.rocketTime = 0; + } + if (flag39 && this.wings != 4) + { + if (this.wingFrame == 3) + { + if (!this.flapSound) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 32); + } + this.flapSound = true; + } + else + { + this.flapSound = false; + } + } + if (this.velocity.Y == 0f || this.sliding) + { + this.rocketTime = this.rocketTimeMax; + } + if ((this.wingTime == 0 || this.wings == 0) && this.rocketBoots > 0 && this.controlJump && this.rocketDelay == 0 && this.canRocket && this.rocketRelease && !this.jumpAgain) + { + if (this.rocketTime > 0) + { + this.rocketTime--; + this.rocketDelay = 10; + if (this.rocketDelay2 <= 0) + { + if (this.rocketBoots == 1) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 13); + this.rocketDelay2 = 30; + } + else + { + if (this.rocketBoots == 2) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 24); + this.rocketDelay2 = 15; + } + } + } + } + else + { + this.canRocket = false; + } + } + if (this.rocketDelay2 > 0) + { + this.rocketDelay2--; + } + if (this.rocketDelay == 0) + { + this.rocketFrame = false; + } + if (this.rocketDelay > 0) + { + int num153 = this.height; + if (this.gravDir == -1f) + { + num153 = 4; + } + this.rocketFrame = true; + for (int num154 = 0; num154 < 2; num154++) + { + int type4 = 6; + float scale2 = 2.5f; + int alpha2 = 100; + if (this.rocketBoots == 2) + { + type4 = 16; + scale2 = 1.5f; + alpha2 = 20; + } + else + { + if (this.socialShadow) + { + type4 = 27; + scale2 = 1.5f; + } + } + if (num154 == 0) + { + int num155 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float)num153 - 10f), 8, 8, type4, 0f, 0f, alpha2, default(Color), scale2); + if (this.rocketBoots == 1) + { + Main.dust[num155].noGravity = true; + } + Main.dust[num155].velocity.X = Main.dust[num155].velocity.X * 1f - 2f - this.velocity.X * 0.3f; + Main.dust[num155].velocity.Y = Main.dust[num155].velocity.Y * 1f + 2f * this.gravDir - this.velocity.Y * 0.3f; + if (this.rocketBoots == 2) + { + Main.dust[num155].velocity *= 0.1f; + } + } + else + { + int num156 = Dust.NewDust(new Vector2(this.position.X + (float)this.width - 4f, this.position.Y + (float)num153 - 10f), 8, 8, type4, 0f, 0f, alpha2, default(Color), scale2); + if (this.rocketBoots == 1) + { + Main.dust[num156].noGravity = true; + } + Main.dust[num156].velocity.X = Main.dust[num156].velocity.X * 1f + 2f - this.velocity.X * 0.3f; + Main.dust[num156].velocity.Y = Main.dust[num156].velocity.Y * 1f + 2f * this.gravDir - this.velocity.Y * 0.3f; + if (this.rocketBoots == 2) + { + Main.dust[num156].velocity *= 0.1f; + } + } + } + if (this.rocketDelay == 0) + { + this.releaseJump = true; + } + this.rocketDelay--; + this.velocity.Y = this.velocity.Y - 0.1f * this.gravDir; + if (this.gravDir == 1f) + { + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - 0.5f; + } + else + { + if ((double)this.velocity.Y > (double)(-(double)Player.jumpSpeed) * 0.5) + { + this.velocity.Y = this.velocity.Y - 0.1f; + } + } + if (this.velocity.Y < -Player.jumpSpeed * 1.5f) + { + this.velocity.Y = -Player.jumpSpeed * 1.5f; + } + } + else + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.5f; + } + else + { + if ((double)this.velocity.Y < (double)Player.jumpSpeed * 0.5) + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + } + if (this.velocity.Y > Player.jumpSpeed * 1.5f) + { + this.velocity.Y = Player.jumpSpeed * 1.5f; + } + } + } + else + { + if (!flag39) + { + if (this.slowFall && ((!this.controlDown && this.gravDir == 1f) || (!this.controlUp && this.gravDir == -1f))) + { + if ((this.controlUp && this.gravDir == 1f) || (this.controlDown && this.gravDir == -1f)) + { + num2 = num2 / 10f * this.gravDir; + } + else + { + num2 = num2 / 3f * this.gravDir; + } + this.velocity.Y = this.velocity.Y + num2; + } + else + { + if (this.wings > 0 && this.controlJump && this.velocity.Y > 0f) + { + this.fallStart = (int)(this.position.Y / 16f); + if (this.velocity.Y > 0f) + { + if (this.wings == 10 && Main.rand.Next(3) == 0) + { + int num157 = 4; + if (this.direction == 1) + { + num157 = -40; + } + int num158 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num157, this.position.Y + (float)(this.height / 2) - 15f), 30, 30, 76, 0f, 0f, 50, default(Color), 0.6f); + Main.dust[num158].fadeIn = 1.1f; + Main.dust[num158].noGravity = true; + Main.dust[num158].noLight = true; + Main.dust[num158].velocity *= 0.3f; + } + if (this.wings == 9 && Main.rand.Next(3) == 0) + { + int num159 = 8; + if (this.direction == 1) + { + num159 = -40; + } + int num160 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num159, this.position.Y + (float)(this.height / 2) - 15f), 30, 30, 6, 0f, 0f, 200, default(Color), 2f); + Main.dust[num160].noGravity = true; + Main.dust[num160].velocity *= 0.3f; + } + if (this.wings == 6) + { + if (Main.rand.Next(10) == 0) + { + int num161 = 4; + if (this.direction == 1) + { + num161 = -40; + } + int num162 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num161, this.position.Y + (float)(this.height / 2) - 12f), 30, 20, 55, 0f, 0f, 200, default(Color), 1f); + Main.dust[num162].velocity *= 0.3f; + } + } + else + { + if (this.wings == 5 && Main.rand.Next(6) == 0) + { + int num163 = 6; + if (this.direction == 1) + { + num163 = -30; + } + int num164 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) + (float)num163, this.position.Y), 18, this.height, 58, 0f, 0f, 255, default(Color), 1.2f); + Main.dust[num164].velocity *= 0.3f; + } + } + if (this.wings == 4) + { + this.rocketDelay2--; + if (this.rocketDelay2 <= 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 13); + this.rocketDelay2 = 60; + } + int type5 = 6; + float scale3 = 1.5f; + int alpha3 = 100; + float x2 = this.position.X + (float)(this.width / 2) + 16f; + if (this.direction > 0) + { + x2 = this.position.X + (float)(this.width / 2) - 26f; + } + float num165 = this.position.Y + (float)this.height - 18f; + if (Main.rand.Next(2) == 1) + { + x2 = this.position.X + (float)(this.width / 2) + 8f; + if (this.direction > 0) + { + x2 = this.position.X + (float)(this.width / 2) - 20f; + } + num165 += 6f; + } + int num166 = Dust.NewDust(new Vector2(x2, num165), 8, 8, type5, 0f, 0f, alpha3, default(Color), scale3); + Dust expr_E08B_cp_0 = Main.dust[num166]; + expr_E08B_cp_0.velocity.X = expr_E08B_cp_0.velocity.X * 0.3f; + Dust expr_E0A9_cp_0 = Main.dust[num166]; + expr_E0A9_cp_0.velocity.Y = expr_E0A9_cp_0.velocity.Y + 10f; + Main.dust[num166].noGravity = true; + this.wingFrameCounter++; + if (this.wingFrameCounter > 4) + { + this.wingFrame++; + this.wingFrameCounter = 0; + if (this.wingFrame >= 3) + { + this.wingFrame = 0; + } + } + } + else + { + if (this.wings == 12) + { + this.wingFrame = 3; + } + else + { + this.wingFrame = 2; + } + } + } + this.velocity.Y = this.velocity.Y + num2 / 3f * this.gravDir; + if (this.gravDir == 1f) + { + if (this.velocity.Y > num / 3f && !this.controlDown) + { + this.velocity.Y = num / 3f; + } + } + else + { + if (this.velocity.Y < -num / 3f && !this.controlUp) + { + this.velocity.Y = -num / 3f; + } + } + } + else + { + this.velocity.Y = this.velocity.Y + num2 * this.gravDir; + } + } + } + } + if (this.gravDir == 1f) + { + if (this.velocity.Y > num) + { + this.velocity.Y = num; + } + if (this.slowFall && this.velocity.Y > num / 3f && !this.controlDown) + { + this.velocity.Y = num / 3f; + } + if (this.slowFall && this.velocity.Y > num / 5f && this.controlUp) + { + this.velocity.Y = num / 10f; + } + } + else + { + if (this.velocity.Y < -num) + { + this.velocity.Y = -num; + } + if (this.slowFall && this.velocity.Y < -num / 3f && !this.controlUp) + { + this.velocity.Y = -num / 3f; + } + if (this.slowFall && this.velocity.Y < -num / 5f && this.controlDown) + { + this.velocity.Y = -num / 10f; + } + } + } + } + } + if (this.wings == 3) + { + if (this.controlUp && this.controlDown) + { + this.velocity.Y = 0f; + } + else + { + if (this.controlDown && this.controlJump) + { + this.velocity.Y = this.velocity.Y * 0.9f; + if (this.velocity.Y > -2f && this.velocity.Y < 1f) + { + this.velocity.Y = 1E-05f; + } + } + else + { + if (this.controlDown && this.velocity.Y != 0f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + } + } + for (int num167 = 0; num167 < 400; num167++) + { + if (Main.item[num167].active && Main.item[num167].noGrabDelay == 0 && Main.item[num167].owner == i) + { + if (new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height).Intersects(new Rectangle((int)Main.item[num167].position.X, (int)Main.item[num167].position.Y, Main.item[num167].width, Main.item[num167].height))) + { + if (i == Main.myPlayer && (this.inventory[this.selectedItem].type != 0 || this.itemAnimation <= 0)) + { + if (Main.item[num167].type == 58) + { + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + this.statLife += 20; + if (Main.myPlayer == this.whoAmi) + { + this.HealEffect(20, true); + } + if (this.statLife > this.statLifeMax) + { + this.statLife = this.statLifeMax; + } + Main.item[num167] = new Item(); + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num167, 0f, 0f, 0f, 0); + } + } + else + { + if (Main.item[num167].type == 184) + { + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + this.statMana += 100; + if (Main.myPlayer == this.whoAmi) + { + this.ManaEffect(100); + } + if (this.statMana > this.statManaMax2) + { + this.statMana = this.statManaMax2; + } + Main.item[num167] = new Item(); + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num167, 0f, 0f, 0f, 0); + } + } + else + { + Main.item[num167] = this.GetItem(i, Main.item[num167]); + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num167, 0f, 0f, 0f, 0); + } + } + } + } + } + else + { + if (new Rectangle((int)this.position.X - Player.itemGrabRange, (int)this.position.Y - Player.itemGrabRange, this.width + Player.itemGrabRange * 2, this.height + Player.itemGrabRange * 2).Intersects(new Rectangle((int)Main.item[num167].position.X, (int)Main.item[num167].position.Y, Main.item[num167].width, Main.item[num167].height)) && this.ItemSpace(Main.item[num167])) + { + Main.item[num167].beingGrabbed = true; + if ((double)this.position.X + (double)this.width * 0.5 > (double)Main.item[num167].position.X + (double)Main.item[num167].width * 0.5) + { + if (Main.item[num167].velocity.X < Player.itemGrabSpeedMax + this.velocity.X) + { + Item expr_E787_cp_0 = Main.item[num167]; + expr_E787_cp_0.velocity.X = expr_E787_cp_0.velocity.X + Player.itemGrabSpeed; + } + if (Main.item[num167].velocity.X < 0f) + { + Item expr_E7C1_cp_0 = Main.item[num167]; + expr_E7C1_cp_0.velocity.X = expr_E7C1_cp_0.velocity.X + Player.itemGrabSpeed * 0.75f; + } + } + else + { + if (Main.item[num167].velocity.X > -Player.itemGrabSpeedMax + this.velocity.X) + { + Item expr_E810_cp_0 = Main.item[num167]; + expr_E810_cp_0.velocity.X = expr_E810_cp_0.velocity.X - Player.itemGrabSpeed; + } + if (Main.item[num167].velocity.X > 0f) + { + Item expr_E847_cp_0 = Main.item[num167]; + expr_E847_cp_0.velocity.X = expr_E847_cp_0.velocity.X - Player.itemGrabSpeed * 0.75f; + } + } + if ((double)this.position.Y + (double)this.height * 0.5 > (double)Main.item[num167].position.Y + (double)Main.item[num167].height * 0.5) + { + if (Main.item[num167].velocity.Y < Player.itemGrabSpeedMax) + { + Item expr_E8D0_cp_0 = Main.item[num167]; + expr_E8D0_cp_0.velocity.Y = expr_E8D0_cp_0.velocity.Y + Player.itemGrabSpeed; + } + if (Main.item[num167].velocity.Y < 0f) + { + Item expr_E90A_cp_0 = Main.item[num167]; + expr_E90A_cp_0.velocity.Y = expr_E90A_cp_0.velocity.Y + Player.itemGrabSpeed * 0.75f; + } + } + else + { + if (Main.item[num167].velocity.Y > -Player.itemGrabSpeedMax) + { + Item expr_E94A_cp_0 = Main.item[num167]; + expr_E94A_cp_0.velocity.Y = expr_E94A_cp_0.velocity.Y - Player.itemGrabSpeed; + } + if (Main.item[num167].velocity.Y > 0f) + { + Item expr_E981_cp_0 = Main.item[num167]; + expr_E981_cp_0.velocity.Y = expr_E981_cp_0.velocity.Y - Player.itemGrabSpeed * 0.75f; + } + } + } + } + } + } + if (this.position.X / 16f - (float)Player.tileRangeX <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX - 1f >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY - 2f >= (float)Player.tileTargetY) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY] == null) + { + Main.tile[Player.tileTargetX, Player.tileTargetY] = new Tile(); + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].active()) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 104) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 359; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 79) + { + this.noThrow = 2; + this.showItemIcon = true; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 36) + { + this.showItemIcon2 = 224; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 72) + { + this.showItemIcon2 = 644; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 108) + { + this.showItemIcon2 = 645; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 144) + { + this.showItemIcon2 = 646; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 180) + { + this.showItemIcon2 = 920; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 216) + { + this.showItemIcon2 = 1470; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 252) + { + this.showItemIcon2 = 1471; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 288) + { + this.showItemIcon2 = 1472; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 324) + { + this.showItemIcon2 = 1473; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 358) + { + this.showItemIcon2 = 1719; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 396) + { + this.showItemIcon2 = 1720; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 432) + { + this.showItemIcon2 = 1721; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameY < 468) + { + this.showItemIcon2 = 1722; + } + else + { + this.showItemIcon2 = 646; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 209) + { + this.noThrow = 2; + this.showItemIcon = true; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < 72) + { + this.showItemIcon2 = 928; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < 144) + { + this.showItemIcon2 = 1337; + } + } + int num168; + for (num168 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); num168 >= 4; num168 -= 4) + { + } + if (num168 < 2) + { + this.showItemIconR = true; + } + else + { + this.showItemIconR = false; + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 216) + { + this.noThrow = 2; + this.showItemIcon = true; + int num169 = (int)Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; + int num170 = 0; + while (num169 >= 40) + { + num169 -= 40; + num170++; + } + this.showItemIcon2 = 970 + num170; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 212) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 949; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 21) + { + this.noThrow = 2; + this.showItemIcon = true; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 972) + { + this.showItemIcon2 = 1537; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 936) + { + this.showItemIcon2 = 1536; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 900) + { + this.showItemIcon2 = 1535; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 864) + { + this.showItemIcon2 = 1534; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 828) + { + this.showItemIcon2 = 1533; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 792) + { + this.showItemIcon2 = 1532; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 756) + { + this.showItemIcon2 = 1531; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 720) + { + this.showItemIcon2 = 1530; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 684) + { + this.showItemIcon2 = 1529; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 648) + { + this.showItemIcon2 = 1528; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 612) + { + this.showItemIcon2 = 1298; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 576) + { + this.showItemIcon2 = 1142; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 540) + { + this.showItemIcon2 = 952; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 504) + { + this.showItemIcon2 = 914; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 468) + { + this.showItemIcon2 = 838; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 432) + { + this.showItemIcon2 = 831; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 396) + { + this.showItemIcon2 = 681; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 360) + { + this.showItemIcon2 = 680; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 324) + { + this.showItemIcon2 = 627; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 288) + { + this.showItemIcon2 = 626; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 252) + { + this.showItemIcon2 = 625; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 216) + { + this.showItemIcon2 = 348; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 180) + { + this.showItemIcon2 = 343; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 144) + { + this.showItemIcon2 = 329; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 108) + { + this.showItemIcon2 = 328; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 72) + { + this.showItemIcon2 = 327; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 36) + { + this.showItemIcon2 = 306; + } + else + { + this.showItemIcon2 = 48; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 4) + { + this.noThrow = 2; + this.showItemIcon = true; + int num171 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 22); + if (num171 == 0) + { + this.showItemIcon2 = 8; + } + else + { + if (num171 == 8) + { + this.showItemIcon2 = 523; + } + else + { + if (num171 == 9) + { + this.showItemIcon2 = 974; + } + else + { + if (num171 == 10) + { + this.showItemIcon2 = 1245; + } + else + { + if (num171 == 11) + { + this.showItemIcon2 = 1333; + } + else + { + this.showItemIcon2 = 426 + num171; + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 13) + { + this.noThrow = 2; + this.showItemIcon = true; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 72) + { + this.showItemIcon2 = 351; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 54) + { + this.showItemIcon2 = 350; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 18) + { + this.showItemIcon2 = 28; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 36) + { + this.showItemIcon2 = 110; + } + else + { + this.showItemIcon2 = 31; + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 29) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 87; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 97) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 346; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 33) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 105; + int num172 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 22); + if (num172 == 1) + { + this.showItemIcon2 = 1405; + } + if (num172 == 2) + { + this.showItemIcon2 = 1406; + } + if (num172 == 3) + { + this.showItemIcon2 = 1407; + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 49) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 148; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 50) + { + this.noThrow = 2; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 90) + { + this.showItemIcon = true; + this.showItemIcon2 = 165; + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 139) + { + this.noThrow = 2; + int num173 = Player.tileTargetX; + int num174 = Player.tileTargetY; + int num175 = 0; + for (int num176 = (int)(Main.tile[num173, num174].frameY / 18); num176 >= 2; num176 -= 2) + { + num175++; + } + this.showItemIcon = true; + if (num175 >= 13) + { + this.showItemIcon2 = 1596 + num175 - 13; + } + else + { + this.showItemIcon2 = 562 + num175; + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 207) + { + this.noThrow = 2; + int num177 = Player.tileTargetX; + int num178 = Player.tileTargetY; + int num179 = 0; + for (int num180 = (int)(Main.tile[num177, num178].frameX / 18); num180 >= 2; num180 -= 2) + { + num179++; + } + this.showItemIcon = true; + if (num179 == 0) + { + this.showItemIcon2 = 909; + } + else + { + if (num179 == 1) + { + this.showItemIcon2 = 910; + } + else + { + if (num179 == 2) + { + this.showItemIcon2 = 940; + } + else + { + if (num179 == 3) + { + this.showItemIcon2 = 941; + } + else + { + if (num179 == 4) + { + this.showItemIcon2 = 942; + } + else + { + if (num179 == 5) + { + this.showItemIcon2 = 943; + } + else + { + if (num179 == 6) + { + this.showItemIcon2 = 944; + } + else + { + if (num179 == 7) + { + this.showItemIcon2 = 945; + } + } + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 55 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 85) + { + this.noThrow = 2; + int num181 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int num182 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + while (num181 > 1) + { + num181 -= 2; + } + int num183 = Player.tileTargetX - num181; + int num184 = Player.tileTargetY - num182; + Main.signBubble = true; + Main.signX = num183 * 16 + 16; + Main.signY = num184 * 16; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 237) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 1293; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 10 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 11) + { + this.noThrow = 2; + this.showItemIcon = true; + int num185 = (int)Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; + int num186 = 0; + while (num185 >= 54) + { + num185 -= 54; + num186++; + } + if (num186 == 0) + { + this.showItemIcon2 = 25; + } + else + { + if (num186 == 9) + { + this.showItemIcon2 = 837; + } + else + { + if (num186 == 10) + { + this.showItemIcon2 = 912; + } + else + { + if (num186 == 11) + { + this.showItemIcon2 = 1141; + } + else + { + if (num186 == 12) + { + this.showItemIcon2 = 1137; + } + else + { + if (num186 == 13) + { + this.showItemIcon2 = 1138; + } + else + { + if (num186 == 14) + { + this.showItemIcon2 = 1139; + } + else + { + if (num186 == 15) + { + this.showItemIcon2 = 1140; + } + else + { + if (num186 == 16) + { + this.showItemIcon2 = 1411; + } + else + { + if (num186 == 17) + { + this.showItemIcon2 = 1412; + } + else + { + if (num186 == 18) + { + this.showItemIcon2 = 1413; + } + else + { + if (num186 == 19) + { + this.showItemIcon2 = 1458; + } + else + { + if (num186 >= 20 && num186 <= 23) + { + this.showItemIcon2 = 1709 + num186 - 20; + } + else + { + if (num186 >= 4 && num186 <= 8) + { + this.showItemIcon2 = 812 + num186; + } + else + { + this.showItemIcon2 = 649 + num186; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 125) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 487; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 132) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 513; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 136) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = 538; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 144) + { + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = (int)(583 + Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + } + if (this.controlUseTile) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 212 && this.launcherWait <= 0) + { + int num187 = Player.tileTargetX; + int num188 = Player.tileTargetY; + bool flag40 = false; + for (int num189 = 0; num189 < 58; num189++) + { + if (this.inventory[num189].type == 949 && this.inventory[num189].stack > 0) + { + this.inventory[num189].stack--; + if (this.inventory[num189].stack <= 0) + { + this.inventory[num189].SetDefaults(0, false); + } + flag40 = true; + break; + } + } + if (flag40) + { + this.launcherWait = 10; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11); + int num190 = (int)(Main.tile[num187, num188].frameX / 18); + int num191 = 0; + while (num190 >= 3) + { + num191++; + num190 -= 3; + } + num190 = num187 - num190; + int num192; + for (num192 = (int)(Main.tile[num187, num188].frameY / 18); num192 >= 3; num192 -= 3) + { + } + num192 = num188 - num192; + float num193 = 12f + (float)Main.rand.Next(450) * 0.01f; + float num194 = (float)Main.rand.Next(85, 105); + float num195 = (float)Main.rand.Next(-35, 11); + int type6 = 166; + int damage2 = 17; + float knockBack = 3.5f; + Vector2 vector = new Vector2((float)((num190 + 2) * 16 - 8), (float)((num192 + 2) * 16 - 8)); + if (num191 == 0) + { + num194 *= -1f; + vector.X -= 12f; + } + else + { + vector.X += 12f; + } + float num196 = num194; + float num197 = num195; + float num198 = (float)Math.Sqrt((double)(num196 * num196 + num197 * num197)); + num198 = num193 / num198; + num196 *= num198; + num197 *= num198; + Projectile.NewProjectile(vector.X, vector.Y, num196, num197, type6, damage2, knockBack, Main.myPlayer, 0f, 0f); + } + } + if (this.releaseUseTile) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 132 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 136 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 144) + { + WorldGen.hitSwitch(Player.tileTargetX, Player.tileTargetY); + NetMessage.SendData(59, -1, -1, "", Player.tileTargetX, (float)Player.tileTargetY, 0f, 0f, 0); + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 139) + { + Main.PlaySound(28, Player.tileTargetX * 16, Player.tileTargetY * 16, 0); + WorldGen.SwitchMB(Player.tileTargetX, Player.tileTargetY); + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 207) + { + Main.PlaySound(28, Player.tileTargetX * 16, Player.tileTargetY * 16, 0); + WorldGen.SwitchFountain(Player.tileTargetX, Player.tileTargetY); + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 216) + { + WorldGen.LaunchRocket(Player.tileTargetX, Player.tileTargetY); + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 4 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 13 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 33 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 49 || (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 50 && Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 90)) + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 125) + { + this.AddBuff(29, 36000, true); + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 4); + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 79) + { + int num199 = Player.tileTargetX; + int num200 = Player.tileTargetY; + num199 += (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18 * -1); + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 72) + { + num199 += 4; + num199++; + } + else + { + num199 += 2; + } + int num201 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int num202 = 0; + while (num201 > 1) + { + num201 -= 2; + num202++; + } + num200 -= num201; + num200 += 2; + if (Player.CheckSpawn(num199, num200)) + { + this.ChangeSpawn(num199, num200); + Main.NewText("Spawn point set!", 255, 240, 20, false); + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 55 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 85) + { + bool flag41 = true; + if (this.sign >= 0) + { + int num203 = Sign.ReadSign(Player.tileTargetX, Player.tileTargetY); + if (num203 == this.sign) + { + this.sign = -1; + Main.npcChatText = ""; + Main.editSign = false; + Main.PlaySound(11, -1, -1, 1); + flag41 = false; + } + } + if (flag41) + { + if (Main.netMode == 0) + { + this.talkNPC = -1; + Main.playerInventory = false; + Main.editSign = false; + Main.PlaySound(10, -1, -1, 1); + int num204 = Sign.ReadSign(Player.tileTargetX, Player.tileTargetY); + this.sign = num204; + Main.npcChatText = Main.sign[num204].text; + } + else + { + int num205 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int num206 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + while (num205 > 1) + { + num205 -= 2; + } + int num207 = Player.tileTargetX - num205; + int num208 = Player.tileTargetY - num206; + if (Main.tile[num207, num208].type == 55 || Main.tile[num207, num208].type == 85) + { + NetMessage.SendData(46, -1, -1, "", num207, (float)num208, 0f, 0f, 0); + } + } + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 104) + { + string text = "AM"; + double num209 = Main.time; + if (!Main.dayTime) + { + num209 += 54000.0; + } + num209 = num209 / 86400.0 * 24.0; + double num210 = 7.5; + num209 = num209 - num210 - 12.0; + if (num209 < 0.0) + { + num209 += 24.0; + } + if (num209 >= 12.0) + { + text = "PM"; + } + int num211 = (int)num209; + double num212 = num209 - (double)num211; + num212 = (double)((int)(num212 * 60.0)); + string text2 = string.Concat(num212); + if (num212 < 10.0) + { + text2 = "0" + text2; + } + if (num211 > 12) + { + num211 -= 12; + } + if (num211 == 0) + { + num211 = 12; + } + string newText = string.Concat(new object[] + { + "Time: ", + num211, + ":", + text2, + " ", + text + }); + Main.NewText(newText, 255, 240, 20, false); + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 237) + { + bool flag42 = false; + if (!NPC.AnyNPCs(245)) + { + for (int num213 = 0; num213 < 58; num213++) + { + if (this.inventory[num213].type == 1293) + { + this.inventory[num213].stack--; + if (this.inventory[num213].stack <= 0) + { + this.inventory[num213].SetDefaults(0, false); + } + flag42 = true; + } + } + } + if (flag42) + { + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 245); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 245f, 0f, 0f, 0); + } + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 10) + { + int num214 = Player.tileTargetX; + int num215 = Player.tileTargetY; + if (Main.tile[num214, num215].frameY >= 594 && Main.tile[num214, num215].frameY <= 646) + { + int num216 = 1141; + for (int num217 = 0; num217 < 58; num217++) + { + if (this.inventory[num217].type == num216 && this.inventory[num217].stack > 0) + { + this.inventory[num217].stack--; + if (this.inventory[num217].stack <= 0) + { + this.inventory[num217] = new Item(); + } + WorldGen.UnlockDoor(num214, num215); + if (Main.netMode == 1) + { + NetMessage.SendData(52, -1, -1, "", this.whoAmi, 2f, (float)num214, (float)num215, 0); + } + } + } + } + else + { + WorldGen.OpenDoor(Player.tileTargetX, Player.tileTargetY, this.direction); + NetMessage.SendData(19, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, (float)this.direction, 0); + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 11 && WorldGen.CloseDoor(Player.tileTargetX, Player.tileTargetY, false)) + { + NetMessage.SendData(19, -1, -1, "", 1, (float)Player.tileTargetX, (float)Player.tileTargetY, (float)this.direction, 0); + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 209) + { + WorldGen.SwitchCannon(Player.tileTargetX, Player.tileTargetY); + } + else + { + if ((Main.tile[Player.tileTargetX, Player.tileTargetY].type == 21 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 29 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 97) && this.talkNPC == -1) + { + Main.mouseRightRelease = false; + int num218 = 0; + int num219; + for (num219 = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); num219 > 1; num219 -= 2) + { + } + num219 = Player.tileTargetX - num219; + int num220 = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 29) + { + num218 = 1; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 97) + { + num218 = 2; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 252) + { + Main.chestText = "Chest"; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 216) + { + Main.chestText = "Trash Can"; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 180) + { + Main.chestText = "Barrel"; + } + else + { + Main.chestText = "Chest"; + } + } + } + } + } + if (Main.netMode == 1 && num218 == 0 && (Main.tile[num219, num220].frameX < 72 || Main.tile[num219, num220].frameX > 106) && (Main.tile[num219, num220].frameX < 144 || Main.tile[num219, num220].frameX > 178) && (Main.tile[num219, num220].frameX < 828 || Main.tile[num219, num220].frameX > 1006)) + { + if (num219 == this.chestX && num220 == this.chestY && this.chest != -1) + { + this.chest = -1; + Main.PlaySound(11, -1, -1, 1); + } + else + { + NetMessage.SendData(31, -1, -1, "", num219, (float)num220, 0f, 0f, 0); + } + } + else + { + int num221 = -1; + if (num218 == 1) + { + num221 = -2; + } + else + { + if (num218 == 2) + { + num221 = -3; + } + else + { + bool flag43 = false; + if ((Main.tile[num219, num220].frameX >= 72 && Main.tile[num219, num220].frameX <= 106) || (Main.tile[num219, num220].frameX >= 144 && Main.tile[num219, num220].frameX <= 178) || (Main.tile[num219, num220].frameX >= 828 && Main.tile[num219, num220].frameX <= 1006)) + { + int num222 = 327; + if (Main.tile[num219, num220].frameX >= 144 && Main.tile[num219, num220].frameX <= 178) + { + num222 = 329; + } + if (Main.tile[num219, num220].frameX >= 828 && Main.tile[num219, num220].frameX <= 1006) + { + int num223 = (int)(Main.tile[num219, num220].frameX / 18); + int num224 = 0; + while (num223 >= 2) + { + num223 -= 2; + num224++; + } + num224 -= 23; + num222 = 1533 + num224; + } + flag43 = true; + for (int num225 = 0; num225 < 58; num225++) + { + if (this.inventory[num225].type == num222 && this.inventory[num225].stack > 0) + { + if (num222 != 329) + { + this.inventory[num225].stack--; + if (this.inventory[num225].stack <= 0) + { + this.inventory[num225] = new Item(); + } + } + Chest.Unlock(num219, num220); + if (Main.netMode == 1) + { + NetMessage.SendData(52, -1, -1, "", this.whoAmi, 1f, (float)num219, (float)num220, 0); + } + } + } + } + if (!flag43) + { + num221 = Chest.FindChest(num219, num220); + } + } + } + if (num221 != -1) + { + if (num221 == this.chest) + { + this.chest = -1; + Main.PlaySound(11, -1, -1, 1); + } + else + { + if (num221 != this.chest && this.chest == -1) + { + this.chest = num221; + Main.playerInventory = true; + Main.PlaySound(10, -1, -1, 1); + this.chestX = num219; + this.chestY = num220; + } + else + { + this.chest = num221; + Main.playerInventory = true; + Main.PlaySound(12, -1, -1, 1); + this.chestX = num219; + this.chestY = num220; + } + } + } + } + } + } + } + this.releaseUseTile = false; + } + else + { + this.releaseUseTile = true; + } + } + } + if (this.tongued) + { + bool flag44 = false; + if (Main.wof >= 0) + { + float num226 = Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2); + num226 += (float)(Main.npc[Main.wof].direction * 200); + float num227 = Main.npc[Main.wof].position.Y + (float)(Main.npc[Main.wof].height / 2); + Vector2 vector2 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num228 = num226 - vector2.X; + float num229 = num227 - vector2.Y; + float num230 = (float)Math.Sqrt((double)(num228 * num228 + num229 * num229)); + float num231 = 11f; + float num232; + if (num230 > num231) + { + num232 = num231 / num230; + } + else + { + num232 = 1f; + flag44 = true; + } + num228 *= num232; + num229 *= num232; + this.velocity.X = num228; + this.velocity.Y = num229; + } + else + { + flag44 = true; + } + if (flag44 && Main.myPlayer == this.whoAmi) + { + for (int num233 = 0; num233 < 10; num233++) + { + if (this.buffType[num233] == 38) + { + this.DelBuff(num233); + } + } + } + } + if (Main.myPlayer == this.whoAmi) + { + if (Main.wof >= 0 && Main.npc[Main.wof].active) + { + float num234 = Main.npc[Main.wof].position.X + 40f; + if (Main.npc[Main.wof].direction > 0) + { + num234 -= 96f; + } + if (this.position.X + (float)this.width > num234 && this.position.X < num234 + 140f && this.gross) + { + this.noKnockback = false; + this.Hurt(50, Main.npc[Main.wof].direction, false, false, " was slain...", false); + } + if (!this.gross && this.position.Y > (float)((Main.maxTilesY - 250) * 16) && this.position.X > num234 - 1920f && this.position.X < num234 + 1920f) + { + this.AddBuff(37, 10, true); + Main.PlaySound(4, (int)Main.npc[Main.wof].position.X, (int)Main.npc[Main.wof].position.Y, 10); + } + if (this.gross) + { + if (this.position.Y < (float)((Main.maxTilesY - 200) * 16)) + { + this.AddBuff(38, 10, true); + } + if (Main.npc[Main.wof].direction < 0) + { + if (this.position.X + (float)(this.width / 2) > Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2) + 40f) + { + this.AddBuff(38, 10, true); + } + } + else + { + if (this.position.X + (float)(this.width / 2) < Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2) - 40f) + { + this.AddBuff(38, 10, true); + } + } + } + if (this.tongued) + { + this.controlHook = false; + this.controlUseItem = false; + for (int num235 = 0; num235 < 1000; num235++) + { + if (Main.projectile[num235].active && Main.projectile[num235].owner == Main.myPlayer && Main.projectile[num235].aiStyle == 7) + { + Main.projectile[num235].Kill(); + } + } + Vector2 vector3 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num236 = Main.npc[Main.wof].position.X + (float)(Main.npc[Main.wof].width / 2) - vector3.X; + float num237 = Main.npc[Main.wof].position.Y + (float)(Main.npc[Main.wof].height / 2) - vector3.Y; + float num238 = (float)Math.Sqrt((double)(num236 * num236 + num237 * num237)); + if (num238 > 3000f) + { + this.KillMe(1000.0, 0, false, " tried to escape."); + } + else + { + if (Main.npc[Main.wof].position.X < 608f || Main.npc[Main.wof].position.X > (float)((Main.maxTilesX - 38) * 16)) + { + this.KillMe(1000.0, 0, false, " was licked."); + } + } + } + } + if (this.controlHook) + { + if (this.releaseHook) + { + this.QuickGrapple(); + } + this.releaseHook = false; + } + else + { + this.releaseHook = true; + } + if (this.talkNPC >= 0) + { + Rectangle rectangle = new Rectangle((int)(this.position.X + (float)(this.width / 2) - (float)(Player.tileRangeX * 16)), (int)(this.position.Y + (float)(this.height / 2) - (float)(Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2); + Rectangle value = new Rectangle((int)Main.npc[this.talkNPC].position.X, (int)Main.npc[this.talkNPC].position.Y, Main.npc[this.talkNPC].width, Main.npc[this.talkNPC].height); + if (!rectangle.Intersects(value) || this.chest != -1 || !Main.npc[this.talkNPC].active) + { + if (this.chest == -1) + { + Main.PlaySound(11, -1, -1, 1); + } + this.talkNPC = -1; + Main.npcChatText = ""; + } + } + if (this.sign >= 0) + { + Rectangle rectangle2 = new Rectangle((int)(this.position.X + (float)(this.width / 2) - (float)(Player.tileRangeX * 16)), (int)(this.position.Y + (float)(this.height / 2) - (float)(Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2); + try + { + Rectangle value2 = new Rectangle(Main.sign[this.sign].x * 16, Main.sign[this.sign].y * 16, 32, 32); + if (!rectangle2.Intersects(value2)) + { + Main.PlaySound(11, -1, -1, 1); + this.sign = -1; + Main.editSign = false; + Main.npcChatText = ""; + } + } + catch + { + Main.PlaySound(11, -1, -1, 1); + this.sign = -1; + Main.editSign = false; + Main.npcChatText = ""; + } + } + if (Main.editSign) + { + if (this.sign == -1) + { + Main.editSign = false; + } + else + { + Main.npcChatText = Main.GetInputText(Main.npcChatText); + if (Main.inputTextEnter) + { + byte[] bytes = new byte[] + { + 10 + }; + Main.npcChatText += Encoding.ASCII.GetString(bytes); + } + } + } + if (!this.immune) + { + Rectangle rectangle3 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + for (int num239 = 0; num239 < 200; num239++) + { + if (Main.npc[num239].active && !Main.npc[num239].friendly && Main.npc[num239].damage > 0 && rectangle3.Intersects(new Rectangle((int)Main.npc[num239].position.X, (int)Main.npc[num239].position.Y, Main.npc[num239].width, Main.npc[num239].height))) + { + int num240 = -1; + if (Main.npc[num239].position.X + (float)(Main.npc[num239].width / 2) < this.position.X + (float)(this.width / 2)) + { + num240 = 1; + } + int num241 = Main.DamageVar((float)Main.npc[num239].damage); + if (this.whoAmi == Main.myPlayer && this.thorns && !this.immune && !Main.npc[num239].dontTakeDamage) + { + int num242 = num241 / 3; + int num243 = 10; + if (this.turtleThorns) + { + num242 = num241; + } + Main.npc[num239].StrikeNPC(num242, (float)num243, -num240, false, false); + if (Main.netMode != 0) + { + NetMessage.SendData(28, -1, -1, "", num239, (float)num242, (float)num243, (float)(-(float)num240), 0); + } + } + if (!this.immune) + { + if (Main.npc[num239].type >= 269 && Main.npc[num239].type <= 272) + { + if (Main.rand.Next(3) == 0) + { + this.AddBuff(30, 600, true); + } + else + { + if (Main.rand.Next(3) == 0) + { + this.AddBuff(32, 300, true); + } + } + } + if (Main.npc[num239].type >= 273 && Main.npc[num239].type <= 276 && Main.rand.Next(2) == 0) + { + this.AddBuff(36, 600, true); + } + if (Main.npc[num239].type >= 277 && Main.npc[num239].type <= 280) + { + this.AddBuff(24, 600, true); + } + if (((Main.npc[num239].type == 1 && Main.npc[num239].name == "Black Slime") || Main.npc[num239].type == 81 || Main.npc[num239].type == 79) && Main.rand.Next(4) == 0) + { + this.AddBuff(22, 900, true); + } + if ((Main.npc[num239].type == 23 || Main.npc[num239].type == 25) && Main.rand.Next(3) == 0) + { + this.AddBuff(24, 420, true); + } + if ((Main.npc[num239].type == 34 || Main.npc[num239].type == 83 || Main.npc[num239].type == 84) && Main.rand.Next(3) == 0) + { + this.AddBuff(23, 240, true); + } + if ((Main.npc[num239].type == 104 || Main.npc[num239].type == 102) && Main.rand.Next(8) == 0) + { + this.AddBuff(30, 2700, true); + } + if (Main.npc[num239].type == 75 && Main.rand.Next(10) == 0) + { + this.AddBuff(35, 420, true); + } + if ((Main.npc[num239].type == 163 || Main.npc[num239].type == 238) && Main.rand.Next(10) == 0) + { + this.AddBuff(70, 480, true); + } + if ((Main.npc[num239].type == 79 || Main.npc[num239].type == 103) && Main.rand.Next(5) == 0) + { + this.AddBuff(35, 420, true); + } + if ((Main.npc[num239].type == 75 || Main.npc[num239].type == 78 || Main.npc[num239].type == 82) && Main.rand.Next(8) == 0) + { + this.AddBuff(32, 900, true); + } + if ((Main.npc[num239].type == 93 || Main.npc[num239].type == 109 || Main.npc[num239].type == 80) && Main.rand.Next(14) == 0) + { + this.AddBuff(31, 300, true); + } + if (Main.npc[num239].type == 77 && Main.rand.Next(6) == 0) + { + this.AddBuff(36, 18000, true); + } + if (Main.npc[num239].type == 112 && Main.rand.Next(20) == 0) + { + this.AddBuff(33, 18000, true); + } + if (Main.npc[num239].type == 141 && Main.rand.Next(2) == 0) + { + this.AddBuff(20, 600, true); + } + if (Main.npc[num239].type == 147 && !Main.player[i].frozen && Main.rand.Next(12) == 0) + { + Main.player[i].AddBuff(46, 600, true); + } + if (Main.npc[num239].type == 150) + { + if (Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(46, 900, true); + } + if (!Main.player[i].frozen && Main.rand.Next(35) == 0) + { + Main.player[i].AddBuff(47, 60, true); + } + } + if (Main.npc[num239].type == 184) + { + Main.player[i].AddBuff(46, 1200, true); + if (!Main.player[i].frozen && Main.rand.Next(15) == 0) + { + Main.player[i].AddBuff(47, 60, true); + } + } + } + this.Hurt(num241, num240, false, false, Lang.deathMsg(-1, num239, -1, -1), false); + } + } + } + Vector2 vector4 = Collision.HurtTiles(this.position, this.velocity, this.width, this.height, this.fireWalk); + if (vector4.Y == 20f) + { + this.AddBuff(67, 20, true); + } + else + { + if (vector4.Y == 15f) + { + this.AddBuff(68, 1, true); + } + else + { + if (vector4.Y != 0f) + { + int damage3 = Main.DamageVar(vector4.Y); + this.Hurt(damage3, 0, false, false, Lang.deathMsg(-1, -1, -1, 3), false); + } + } + } + } + if (this.controlRight) + { + this.releaseRight = false; + } + else + { + this.releaseRight = true; + this.rightTimer = 7; + } + if (this.controlLeft) + { + this.releaseLeft = false; + } + else + { + this.releaseLeft = true; + this.leftTimer = 7; + } + if (this.rightTimer > 0) + { + this.rightTimer--; + } + else + { + if (this.controlRight) + { + this.rightTimer = 7; + } + } + if (this.leftTimer > 0) + { + this.leftTimer--; + } + else + { + if (this.controlLeft) + { + this.leftTimer = 7; + } + } + if (this.grappling[0] >= 0) + { + this.canCarpet = true; + this.carpetFrame = -1; + this.wingFrame = 1; + if (this.velocity.Y == 0f || (this.wet && (double)this.velocity.Y > -0.02 && (double)this.velocity.Y < 0.02)) + { + this.wingFrame = 0; + } + if (this.wings == 4) + { + this.wingFrame = 3; + } + this.wingTime = this.GetWingTime(); + this.rocketTime = this.rocketTimeMax; + this.rocketDelay = 0; + this.rocketFrame = false; + this.canRocket = false; + this.rocketRelease = false; + this.fallStart = (int)(this.position.Y / 16f); + float num244 = 0f; + float num245 = 0f; + for (int num246 = 0; num246 < this.grapCount; num246++) + { + num244 += Main.projectile[this.grappling[num246]].position.X + (float)(Main.projectile[this.grappling[num246]].width / 2); + num245 += Main.projectile[this.grappling[num246]].position.Y + (float)(Main.projectile[this.grappling[num246]].height / 2); + } + num244 /= (float)this.grapCount; + num245 /= (float)this.grapCount; + Vector2 vector5 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num247 = num244 - vector5.X; + float num248 = num245 - vector5.Y; + float num249 = (float)Math.Sqrt((double)(num247 * num247 + num248 * num248)); + float num250 = 11f; + float num251; + if (num249 > num250) + { + num251 = num250 / num249; + } + else + { + num251 = 1f; + } + num247 *= num251; + num248 *= num251; + this.velocity.X = num247; + this.velocity.Y = num248; + if (this.itemAnimation == 0) + { + if (this.velocity.X > 0f) + { + this.ChangeDir(1); + } + if (this.velocity.X < 0f) + { + this.ChangeDir(-1); + } + } + if (this.controlJump) + { + if (this.releaseJump) + { + if ((this.velocity.Y == 0f || (this.wet && (double)this.velocity.Y > -0.02 && (double)this.velocity.Y < 0.02)) && !this.controlDown) + { + this.velocity.Y = -Player.jumpSpeed; + this.jump = Player.jumpHeight / 2; + this.releaseJump = false; + } + else + { + this.velocity.Y = this.velocity.Y + 0.01f; + this.releaseJump = false; + } + if (this.doubleJump) + { + this.jumpAgain = true; + } + if (this.doubleJump2) + { + this.jumpAgain2 = true; + } + if (this.doubleJump3) + { + this.jumpAgain3 = true; + } + if (this.doubleJump4) + { + this.jumpAgain4 = true; + } + this.grappling[0] = 0; + this.grapCount = 0; + for (int num252 = 0; num252 < 1000; num252++) + { + if (Main.projectile[num252].active && Main.projectile[num252].owner == i && Main.projectile[num252].aiStyle == 7) + { + Main.projectile[num252].Kill(); + } + } + } + } + else + { + this.releaseJump = true; + } + } + int num253 = this.width / 2; + int num254 = this.height / 2; + new Vector2(this.position.X + (float)(this.width / 2) - (float)(num253 / 2), this.position.Y + (float)(this.height / 2) - (float)(num254 / 2)); + Vector2 vector6 = Collision.StickyTiles(this.position, this.velocity, this.width, this.height); + if (vector6.Y != -1f && vector6.X != -1f) + { + int num255 = (int)vector6.X; + int num256 = (int)vector6.Y; + int type7 = (int)Main.tile[num255, num256].type; + if (this.whoAmi == Main.myPlayer && type7 == 51 && (this.velocity.X != 0f || this.velocity.Y != 0f)) + { + this.stickyBreak++; + if (this.stickyBreak > Main.rand.Next(20, 100)) + { + this.stickyBreak = 0; + WorldGen.KillTile(num255, num256, false, false, false); + if (Main.netMode == 1 && !Main.tile[num255, num256].active() && Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num255, (float)num256, 0f, 0); + } + } + } + this.fallStart = (int)(this.position.Y / 16f); + if (type7 != 229) + { + this.jump = 0; + } + if (this.velocity.X > 1f) + { + this.velocity.X = 1f; + } + if (this.velocity.X < -1f) + { + this.velocity.X = -1f; + } + if (this.velocity.Y > 1f) + { + this.velocity.Y = 1f; + } + if (this.velocity.Y < -5f) + { + this.velocity.Y = -5f; + } + if ((double)this.velocity.X > 0.75 || (double)this.velocity.X < -0.75) + { + this.velocity.X = this.velocity.X * 0.85f; + } + else + { + this.velocity.X = this.velocity.X * 0.6f; + } + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.96f; + } + else + { + this.velocity.Y = this.velocity.Y * 0.3f; + } + if (type7 == 229 && Main.rand.Next(5) == 0 && ((double)this.velocity.Y > 0.15 || this.velocity.Y < 0f)) + { + if ((float)(num255 * 16) < this.position.X + (float)(this.width / 2)) + { + int num257 = Dust.NewDust(new Vector2(this.position.X - 4f, (float)(num256 * 16)), 4, 16, 153, 0f, 0f, 50, default(Color), 1f); + Main.dust[num257].scale += (float)Main.rand.Next(0, 6) * 0.1f; + Main.dust[num257].velocity *= 0.1f; + Main.dust[num257].noGravity = true; + } + else + { + int num258 = Dust.NewDust(new Vector2(this.position.X + (float)this.width - 2f, (float)(num256 * 16)), 4, 16, 153, 0f, 0f, 50, default(Color), 1f); + Main.dust[num258].scale += (float)Main.rand.Next(0, 6) * 0.1f; + Main.dust[num258].velocity *= 0.1f; + Main.dust[num258].noGravity = true; + } + if (Main.tile[num255, num256 + 1] != null && Main.tile[num255, num256 + 1].type == 229 && this.position.Y + (float)this.height > (float)((num256 + 1) * 16)) + { + if ((float)(num255 * 16) < this.position.X + (float)(this.width / 2)) + { + int num259 = Dust.NewDust(new Vector2(this.position.X - 4f, (float)(num256 * 16 + 16)), 4, 16, 153, 0f, 0f, 50, default(Color), 1f); + Main.dust[num259].scale += (float)Main.rand.Next(0, 6) * 0.1f; + Main.dust[num259].velocity *= 0.1f; + Main.dust[num259].noGravity = true; + } + else + { + int num260 = Dust.NewDust(new Vector2(this.position.X + (float)this.width - 2f, (float)(num256 * 16 + 16)), 4, 16, 153, 0f, 0f, 50, default(Color), 1f); + Main.dust[num260].scale += (float)Main.rand.Next(0, 6) * 0.1f; + Main.dust[num260].velocity *= 0.1f; + Main.dust[num260].noGravity = true; + } + } + if (Main.tile[num255, num256 + 2] != null && Main.tile[num255, num256 + 2].type == 229 && this.position.Y + (float)this.height > (float)((num256 + 2) * 16)) + { + if ((float)(num255 * 16) < this.position.X + (float)(this.width / 2)) + { + int num261 = Dust.NewDust(new Vector2(this.position.X - 4f, (float)(num256 * 16 + 32)), 4, 16, 153, 0f, 0f, 50, default(Color), 1f); + Main.dust[num261].scale += (float)Main.rand.Next(0, 6) * 0.1f; + Main.dust[num261].velocity *= 0.1f; + Main.dust[num261].noGravity = true; + } + else + { + int num262 = Dust.NewDust(new Vector2(this.position.X + (float)this.width - 2f, (float)(num256 * 16 + 32)), 4, 16, 153, 0f, 0f, 50, default(Color), 1f); + Main.dust[num262].scale += (float)Main.rand.Next(0, 6) * 0.1f; + Main.dust[num262].velocity *= 0.1f; + Main.dust[num262].noGravity = true; + } + } + } + } + else + { + this.stickyBreak = 0; + } + bool flag45 = Collision.DrownCollision(this.position, this.width, this.height, this.gravDir); + if (this.armor[0].type == 250) + { + flag45 = true; + } + if (this.inventory[this.selectedItem].type == 186) + { + try + { + int num263 = (int)((this.position.X + (float)(this.width / 2) + (float)(6 * this.direction)) / 16f); + int num264 = 0; + if (this.gravDir == -1f) + { + num264 = this.height; + } + int num265 = (int)((this.position.Y + (float)num264 - 44f * this.gravDir) / 16f); + if (Main.tile[num263, num265].liquid < 128) + { + if (Main.tile[num263, num265] == null) + { + Main.tile[num263, num265] = new Tile(); + } + if (!Main.tile[num263, num265].active() || !Main.tileSolid[(int)Main.tile[num263, num265].type] || Main.tileSolidTop[(int)Main.tile[num263, num265].type]) + { + flag45 = false; + } + } + } + catch + { + } + } + if (this.gills) + { + flag45 = false; + } + if (Main.myPlayer == i) + { + if (this.merman) + { + flag45 = false; + } + if (flag45) + { + this.breathCD++; + int num266 = 7; + if (this.inventory[this.selectedItem].type == 186) + { + num266 *= 2; + } + if (this.accDivingHelm) + { + num266 *= 4; + } + if (this.breathCD >= num266) + { + this.breathCD = 0; + this.breath--; + if (this.breath == 0) + { + Main.PlaySound(23, -1, -1, 1); + } + if (this.breath <= 0) + { + this.lifeRegenTime = 0; + this.breath = 0; + this.statLife -= 2; + if (this.statLife <= 0) + { + this.statLife = 0; + this.KillMe(10.0, 0, false, Lang.deathMsg(-1, -1, -1, 1)); + } + } + } + } + else + { + this.breath += 3; + if (this.breath > this.breathMax) + { + this.breath = this.breathMax; + } + this.breathCD = 0; + } + } + if (flag45 && Main.rand.Next(20) == 0 && !this.lavaWet && !this.honeyWet) + { + int num267 = 0; + if (this.gravDir == -1f) + { + num267 += this.height - 12; + } + if (this.inventory[this.selectedItem].type == 186) + { + Dust.NewDust(new Vector2(this.position.X + (float)(10 * this.direction) + 4f, this.position.Y + (float)num267 - 54f * this.gravDir), this.width - 8, 8, 34, 0f, 0f, 0, default(Color), 1.2f); + } + else + { + Dust.NewDust(new Vector2(this.position.X + (float)(12 * this.direction), this.position.Y + (float)num267 + 4f * this.gravDir), this.width - 8, 8, 34, 0f, 0f, 0, default(Color), 1.2f); + } + } + if (this.gravDir == -1f) + { + this.waterWalk = false; + this.waterWalk2 = false; + } + int num268 = this.height; + if (this.waterWalk) + { + num268 -= 6; + } + bool flag46 = Collision.LavaCollision(this.position, this.width, num268); + if (flag46) + { + if (!this.lavaImmune && Main.myPlayer == i && !this.immune) + { + if (this.lavaTime > 0) + { + this.lavaTime--; + } + else + { + if (this.lavaRose) + { + this.Hurt(50, 0, false, false, Lang.deathMsg(-1, -1, -1, 2), false); + this.AddBuff(24, 210, true); + } + else + { + this.Hurt(80, 0, false, false, Lang.deathMsg(-1, -1, -1, 2), false); + this.AddBuff(24, 420, true); + } + } + } + this.lavaWet = true; + } + else + { + if (this.lavaTime < this.lavaMax) + { + this.lavaTime++; + } + } + if (this.lavaTime > this.lavaMax) + { + this.lavaTime = this.lavaMax; + } + if (this.waterWalk2 && !this.waterWalk) + { + num268 -= 6; + } + bool flag47 = Collision.WetCollision(this.position, this.width, this.height); + if (Collision.honey) + { + this.AddBuff(48, 1800, true); + this.honeyWet = true; + } + if (flag47) + { + if (this.onFire && !this.lavaWet) + { + for (int num269 = 0; num269 < 10; num269++) + { + if (this.buffType[num269] == 24) + { + this.DelBuff(num269); + } + } + } + if (!this.wet) + { + if (this.wetCount == 0) + { + this.wetCount = 10; + if (!flag46) + { + if (this.honeyWet) + { + for (int num270 = 0; num270 < 20; num270++) + { + int num271 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_1335A_cp_0 = Main.dust[num271]; + expr_1335A_cp_0.velocity.Y = expr_1335A_cp_0.velocity.Y - 1f; + Dust expr_1337A_cp_0 = Main.dust[num271]; + expr_1337A_cp_0.velocity.X = expr_1337A_cp_0.velocity.X * 2.5f; + Main.dust[num271].scale = 1.3f; + Main.dust[num271].alpha = 100; + Main.dust[num271].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + for (int num272 = 0; num272 < 50; num272++) + { + int num273 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_1347B_cp_0 = Main.dust[num273]; + expr_1347B_cp_0.velocity.Y = expr_1347B_cp_0.velocity.Y - 3f; + Dust expr_1349B_cp_0 = Main.dust[num273]; + expr_1349B_cp_0.velocity.X = expr_1349B_cp_0.velocity.X * 2.5f; + Main.dust[num273].scale = 0.8f; + Main.dust[num273].alpha = 100; + Main.dust[num273].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 0); + } + } + else + { + for (int num274 = 0; num274 < 20; num274++) + { + int num275 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_13599_cp_0 = Main.dust[num275]; + expr_13599_cp_0.velocity.Y = expr_13599_cp_0.velocity.Y - 1.5f; + Dust expr_135B9_cp_0 = Main.dust[num275]; + expr_135B9_cp_0.velocity.X = expr_135B9_cp_0.velocity.X * 2.5f; + Main.dust[num275].scale = 1.3f; + Main.dust[num275].alpha = 100; + Main.dust[num275].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + this.wet = true; + } + } + else + { + if (this.wet) + { + this.wet = false; + if (this.jump > Player.jumpHeight / 5) + { + this.jump = Player.jumpHeight / 5; + } + if (this.wetCount == 0) + { + this.wetCount = 10; + if (!this.lavaWet) + { + if (this.honeyWet) + { + for (int num276 = 0; num276 < 20; num276++) + { + int num277 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_13718_cp_0 = Main.dust[num277]; + expr_13718_cp_0.velocity.Y = expr_13718_cp_0.velocity.Y - 1f; + Dust expr_13738_cp_0 = Main.dust[num277]; + expr_13738_cp_0.velocity.X = expr_13738_cp_0.velocity.X * 2.5f; + Main.dust[num277].scale = 1.3f; + Main.dust[num277].alpha = 100; + Main.dust[num277].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + for (int num278 = 0; num278 < 50; num278++) + { + int num279 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2)), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_13833_cp_0 = Main.dust[num279]; + expr_13833_cp_0.velocity.Y = expr_13833_cp_0.velocity.Y - 4f; + Dust expr_13853_cp_0 = Main.dust[num279]; + expr_13853_cp_0.velocity.X = expr_13853_cp_0.velocity.X * 2.5f; + Main.dust[num279].scale = 0.8f; + Main.dust[num279].alpha = 100; + Main.dust[num279].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 0); + } + } + else + { + for (int num280 = 0; num280 < 20; num280++) + { + int num281 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_13951_cp_0 = Main.dust[num281]; + expr_13951_cp_0.velocity.Y = expr_13951_cp_0.velocity.Y - 1.5f; + Dust expr_13971_cp_0 = Main.dust[num281]; + expr_13971_cp_0.velocity.X = expr_13971_cp_0.velocity.X * 2.5f; + Main.dust[num281].scale = 1.3f; + Main.dust[num281].alpha = 100; + Main.dust[num281].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + } + } + if (!this.wet) + { + this.lavaWet = false; + this.honeyWet = false; + } + if (this.wetCount > 0) + { + this.wetCount -= 1; + } + float num282 = 1f + Math.Abs(this.velocity.X) / 3f; + if (this.gfxOffY > 0f) + { + this.gfxOffY -= num282 * this.stepSpeed; + if (this.gfxOffY < 0f) + { + this.gfxOffY = 0f; + } + } + else + { + if (this.gfxOffY < 0f) + { + this.gfxOffY += num282 * this.stepSpeed; + if (this.gfxOffY > 0f) + { + this.gfxOffY = 0f; + } + } + } + if (this.gfxOffY > 16f) + { + this.gfxOffY = 16f; + } + if (this.gfxOffY < -16f) + { + this.gfxOffY = -16f; + } + if (Main.myPlayer == i && !this.iceSkate && this.velocity.Y > 7f) + { + Vector2 vector7 = this.position + this.velocity; + int num283 = (int)(vector7.X / 16f); + int num284 = (int)((vector7.X + (float)this.width) / 16f); + int num285 = (int)((this.position.Y + (float)this.height + 1f) / 16f); + for (int num286 = num283; num286 <= num284; num286++) + { + for (int num287 = num285; num287 <= num285 + 1; num287++) + { + if (Main.tile[num286, num287].nactive() && Main.tile[num286, num287].type == 162) + { + WorldGen.KillTile(num286, num287, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num286, (float)num287, 0f, 0); + } + } + } + } + } + this.sloping = false; + float y3 = this.velocity.Y; + Vector4 vector8 = Collision.WalkDownSlope(this.position, this.velocity, this.width, this.height, num2); + this.position.X = vector8.X; + this.position.Y = vector8.Y; + this.velocity.X = vector8.Z; + this.velocity.Y = vector8.W; + if (this.velocity.Y != y3) + { + this.sloping = true; + } + if (this.velocity.Y == num2) + { + Vector2 vector9 = this.position; + vector9.X += this.velocity.X; + bool flag48 = false; + int num288 = (int)(vector9.X / 16f); + int num289 = (int)((vector9.X + (float)this.width) / 16f); + int num290 = (int)((this.position.Y + (float)this.height + 4f) / 16f); + float num291 = (float)((num290 + 3) * 16); + for (int num292 = num288; num292 <= num289; num292++) + { + for (int num293 = num290; num293 <= num290 + 1; num293++) + { + if (Main.tile[num292, num293] == null) + { + Main.tile[num292, num293] = new Tile(); + } + if (Main.tile[num292, num293].slope() != 0) + { + flag48 = true; + } + if (this.waterWalk2 || this.waterWalk) + { + if (Main.tile[num292, num293 - 1] == null) + { + Main.tile[num292, num293 - 1] = new Tile(); + } + if (Main.tile[num292, num293].liquid > 0 && Main.tile[num292, num293 - 1].liquid == 0) + { + int num294 = (int)(Main.tile[num292, num293].liquid / 32 * 2 + 2); + int num295 = num293 * 16 + 16 - num294; + Rectangle rectangle4 = new Rectangle(num292 * 16, num293 * 16 - 17, 16, 16); + if (rectangle4.Intersects(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height)) && (float)num295 < num291) + { + num291 = (float)num295; + } + } + } + if (Main.tile[num292, num293 - 1] == null) + { + Main.tile[num292, num293 - 1] = new Tile(); + } + if (Main.tile[num292, num293].nactive() && (Main.tileSolid[(int)Main.tile[num292, num293].type] || Main.tileSolidTop[(int)Main.tile[num292, num293].type])) + { + int num296 = num293 * 16; + if (Main.tile[num292, num293].halfBrick()) + { + num296 += 8; + } + Rectangle rectangle5 = new Rectangle(num292 * 16, num293 * 16 - 17, 16, 16); + if (rectangle5.Intersects(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height)) && (float)num296 < num291) + { + num291 = (float)num296; + } + } + } + } + float num297 = num291 - (this.position.Y + (float)this.height); + if (num297 > 7f && num297 < 17f && !flag48) + { + this.stepSpeed = 1.5f; + if (num297 > 9f) + { + this.stepSpeed = 2.5f; + } + this.gfxOffY += this.position.Y + (float)this.height - num291; + this.position.Y = num291 - (float)this.height; + } + } + if (this.gravDir == -1f) + { + if ((this.carpetFrame != -1 || this.velocity.Y <= num2) && !this.controlUp) + { + int num298 = 0; + if (this.velocity.X < 0f) + { + num298 = -1; + } + if (this.velocity.X > 0f) + { + num298 = 1; + } + Vector2 vector10 = this.position; + vector10.X += this.velocity.X; + int num299 = (int)((vector10.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num298)) / 16f); + int num300 = (int)(((double)vector10.Y + 0.1) / 16.0); + if (Main.tile[num299, num300] == null) + { + Main.tile[num299, num300] = new Tile(); + } + if (num300 - 1 > 0 && Main.tile[num299, num300 + 1] == null) + { + Main.tile[num299, num300 + 1] = new Tile(); + } + if (num300 - 2 > 0 && Main.tile[num299, num300 + 2] == null) + { + Main.tile[num299, num300 + 2] = new Tile(); + } + if (num300 - 3 > 0 && Main.tile[num299, num300 + 3] == null) + { + Main.tile[num299, num300 + 3] = new Tile(); + } + if (num300 - 4 > 0 && Main.tile[num299, num300 + 4] == null) + { + Main.tile[num299, num300 + 4] = new Tile(); + } + if (num300 - 3 > 0 && Main.tile[num299 - num298, num300 + 3] == null) + { + Main.tile[num299 - num298, num300 + 3] = new Tile(); + } + if ((float)(num299 * 16) < vector10.X + (float)this.width && (float)(num299 * 16 + 16) > vector10.X && ((Main.tile[num299, num300].nactive() && ((Main.tileSolid[(int)Main.tile[num299, num300].type] && !Main.tileSolidTop[(int)Main.tile[num299, num300].type]) || (this.controlUp && Main.tileSolidTop[(int)Main.tile[num299, num300].type] && Main.tile[num299, num300].frameY == 0 && (!Main.tileSolid[(int)Main.tile[num299, num300 + 1].type] || !Main.tile[num299, num300 + 1].nactive())))) || (Main.tile[num299, num300 + 1].halfBrick() && Main.tile[num299, num300 + 1].nactive())) && (!Main.tile[num299, num300 + 1].nactive() || !Main.tileSolid[(int)Main.tile[num299, num300 + 1].type] || Main.tileSolidTop[(int)Main.tile[num299, num300 + 1].type] || Main.tile[num299, num300 + 1].slope() != 0 || (Main.tile[num299, num300 + 1].halfBrick() && (!Main.tile[num299, num300 + 4].nactive() || !Main.tileSolid[(int)Main.tile[num299, num300 + 4].type] || Main.tileSolidTop[(int)Main.tile[num299, num300 + 4].type]))) && (!Main.tile[num299, num300 + 2].nactive() || !Main.tileSolid[(int)Main.tile[num299, num300 + 2].type] || Main.tileSolidTop[(int)Main.tile[num299, num300 + 2].type]) && (!Main.tile[num299, num300 + 3].nactive() || !Main.tileSolid[(int)Main.tile[num299, num300 + 3].type] || Main.tileSolidTop[(int)Main.tile[num299, num300 + 3].type]) && (!Main.tile[num299 - num298, num300 + 3].nactive() || !Main.tileSolid[(int)Main.tile[num299 - num298, num300 + 3].type] || Main.tileSolidTop[(int)Main.tile[num299 - num298, num300 + 3].type])) + { + float num301 = (float)(num300 * 16 + 16); + if (num301 > vector10.Y) + { + float num302 = num301 - vector10.Y; + if ((double)num302 <= 16.1) + { + this.gfxOffY -= num301 - this.position.Y; + this.position.Y = num301; + this.velocity.Y = 0f; + if (num302 < 9f) + { + this.stepSpeed = 1f; + } + else + { + this.stepSpeed = 2f; + } + } + } + } + } + } + else + { + if ((this.carpetFrame != -1 || this.velocity.Y >= num2) && !this.controlDown) + { + int num303 = 0; + if (this.velocity.X < 0f) + { + num303 = -1; + } + if (this.velocity.X > 0f) + { + num303 = 1; + } + Vector2 vector11 = this.position; + vector11.X += this.velocity.X; + int num304 = (int)((vector11.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num303)) / 16f); + int num305 = (int)((vector11.Y + (float)this.height - 1f) / 16f); + if (Main.tile[num304, num305] == null) + { + Main.tile[num304, num305] = new Tile(); + } + if (num305 - 1 > 0 && Main.tile[num304, num305 - 1] == null) + { + Main.tile[num304, num305 - 1] = new Tile(); + } + if (num305 - 2 > 0 && Main.tile[num304, num305 - 2] == null) + { + Main.tile[num304, num305 - 2] = new Tile(); + } + if (num305 - 3 > 0 && Main.tile[num304, num305 - 3] == null) + { + Main.tile[num304, num305 - 3] = new Tile(); + } + if (num305 - 4 > 0 && Main.tile[num304, num305 - 4] == null) + { + Main.tile[num304, num305 - 4] = new Tile(); + } + if (num305 - 3 > 0 && Main.tile[num304 - num303, num305 - 3] == null) + { + Main.tile[num304 - num303, num305 - 3] = new Tile(); + } + if ((float)(num304 * 16) < vector11.X + (float)this.width && (float)(num304 * 16 + 16) > vector11.X && ((Main.tile[num304, num305].nactive() && (Main.tile[num304, num305].slope() == 0 || (Main.tile[num304, num305].slope() == 1 && this.position.X + (float)(this.width / 2) < (float)(num304 * 16)) || (Main.tile[num304, num305].slope() == 2 && this.position.X + (float)(this.width / 2) > (float)(num304 * 16 + 16))) && (Main.tile[num304, num305 - 1].slope() == 0 || this.position.Y + (float)this.height > (float)(num305 * 16)) && ((Main.tileSolid[(int)Main.tile[num304, num305].type] && !Main.tileSolidTop[(int)Main.tile[num304, num305].type]) || (this.controlUp && Main.tileSolidTop[(int)Main.tile[num304, num305].type] && Main.tile[num304, num305].frameY == 0 && (!Main.tileSolid[(int)Main.tile[num304, num305 - 1].type] || !Main.tile[num304, num305 - 1].nactive())))) || (Main.tile[num304, num305 - 1].halfBrick() && Main.tile[num304, num305 - 1].nactive())) && (!Main.tile[num304, num305 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num304, num305 - 1].type] || Main.tileSolidTop[(int)Main.tile[num304, num305 - 1].type] || (Main.tile[num304, num305 - 1].slope() == 1 && this.position.X + (float)(this.width / 2) > (float)(num304 * 16)) || (Main.tile[num304, num305 - 1].slope() == 2 && this.position.X + (float)(this.width / 2) < (float)(num304 * 16 + 16)) || (Main.tile[num304, num305 - 1].halfBrick() && (!Main.tile[num304, num305 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num304, num305 - 4].type] || Main.tileSolidTop[(int)Main.tile[num304, num305 - 4].type]))) && (!Main.tile[num304, num305 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num304, num305 - 2].type] || Main.tileSolidTop[(int)Main.tile[num304, num305 - 2].type]) && (!Main.tile[num304, num305 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num304, num305 - 3].type] || Main.tileSolidTop[(int)Main.tile[num304, num305 - 3].type]) && (!Main.tile[num304 - num303, num305 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num304 - num303, num305 - 3].type] || Main.tileSolidTop[(int)Main.tile[num304 - num303, num305 - 3].type])) + { + float num306 = (float)(num305 * 16); + if (Main.tile[num304, num305].halfBrick()) + { + num306 += 8f; + } + if (Main.tile[num304, num305 - 1].halfBrick()) + { + num306 -= 8f; + } + if (num306 < vector11.Y + (float)this.height) + { + float num307 = vector11.Y + (float)this.height - num306; + if ((double)num307 <= 16.1) + { + this.gfxOffY += this.position.Y + (float)this.height - num306; + this.position.Y = num306 - (float)this.height; + if (num307 < 9f) + { + this.stepSpeed = 1f; + } + else + { + this.stepSpeed = 2f; + } + } + } + } + } + } + this.oldPosition = this.position; + bool flag49 = false; + if (this.velocity.Y > num2) + { + flag49 = true; + } + Vector2 vector12 = this.velocity; + this.slideDir = 0; + bool fall = false; + bool fallThrough = this.controlDown; + if (this.gravDir == -1f) + { + fall = true; + fallThrough = true; + } + if (this.wings == 3 && this.controlUp && this.controlDown) + { + this.position += this.velocity; + } + else + { + if (this.tongued) + { + this.position += this.velocity; + } + else + { + if (this.honeyWet) + { + Vector2 vector13 = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, fallThrough, fall); + Vector2 value3 = this.velocity * 0.25f; + if (this.velocity.X != vector13.X) + { + value3.X = this.velocity.X; + } + if (this.velocity.Y != vector13.Y) + { + value3.Y = this.velocity.Y; + } + this.position += value3; + } + else + { + if (this.wet && !this.merman) + { + Vector2 vector14 = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, fallThrough, fall); + Vector2 value4 = this.velocity * 0.5f; + if (this.velocity.X != vector14.X) + { + value4.X = this.velocity.X; + } + if (this.velocity.Y != vector14.Y) + { + value4.Y = this.velocity.Y; + } + this.position += value4; + } + else + { + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, fallThrough, fall); + if (Collision.up && this.gravDir == 1f) + { + this.jump = 0; + } + if (this.gravDir == -1f && this.velocity.Y >= 0f && (double)this.velocity.Y < 0.01) + { + this.velocity.Y = 0f; + } + if (this.waterWalk || this.waterWalk2) + { + Vector2 value5 = this.velocity; + this.velocity = Collision.WaterCollision(this.position, this.velocity, this.width, this.height, this.controlDown, false, this.waterWalk); + if (value5 != this.velocity) + { + this.fallStart = (int)(this.position.Y / 16f); + } + } + this.position += this.velocity; + } + } + } + } + if (this.wings != 3 || !this.controlUp || !this.controlDown) + { + Vector4 vector15 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, num2); + this.position.X = vector15.X; + this.position.Y = vector15.Y; + this.velocity.X = vector15.Z; + this.velocity.Y = vector15.W; + } + if (vector12.X != this.velocity.X) + { + if (vector12.X < 0f) + { + this.slideDir = -1; + } + else + { + if (vector12.X > 0f) + { + this.slideDir = 1; + } + } + } + if (this.gravDir == 1f && Collision.up) + { + this.velocity.Y = 0.01f; + if (!this.merman) + { + this.jump = 0; + } + } + else + { + if (this.gravDir == -1f && Collision.down) + { + this.velocity.Y = -0.01f; + if (!this.merman) + { + this.jump = 0; + } + } + } + if (this.gravDir == -1f && this.velocity.Y > -1E-05f && this.velocity.Y < 1E-05f) + { + this.velocity.Y = 0f; + } + if (this.velocity.Y == 0f && this.grappling[0] == -1) + { + int num308 = (int)((this.position.X + (float)(this.width / 2)) / 16f); + int num309 = (int)((this.position.Y + (float)this.height) / 16f); + int num310 = -1; + if (Main.tile[num308 - 1, num309] == null) + { + Main.tile[num308 - 1, num309] = new Tile(); + } + if (Main.tile[num308 + 1, num309] == null) + { + Main.tile[num308 + 1, num309] = new Tile(); + } + if (Main.tile[num308, num309] == null) + { + Main.tile[num308, num309] = new Tile(); + } + if (Main.tile[num308, num309].nactive() && Main.tileSolid[(int)Main.tile[num308, num309].type]) + { + num310 = (int)Main.tile[num308, num309].type; + } + else + { + if (Main.tile[num308 - 1, num309].nactive() && Main.tileSolid[(int)Main.tile[num308 - 1, num309].type]) + { + num310 = (int)Main.tile[num308 - 1, num309].type; + } + else + { + if (Main.tile[num308 + 1, num309].nactive() && Main.tileSolid[(int)Main.tile[num308 + 1, num309].type]) + { + num310 = (int)Main.tile[num308 + 1, num309].type; + } + } + } + if (num310 > -1) + { + if (num310 == 229) + { + this.sticky = true; + } + else + { + this.sticky = false; + } + if (num310 == 161 || num310 == 162 || num310 == 163 || num310 == 164 || num310 == 200) + { + this.slippy = true; + } + else + { + this.slippy = false; + } + if (num310 == 197) + { + this.slippy2 = true; + } + else + { + this.slippy2 = false; + } + if (num310 == 198) + { + this.powerrun = true; + } + else + { + this.powerrun = false; + } + if (Main.tile[num308 - 1, num309].slope() != 0 || Main.tile[num308, num309].slope() != 0 || Main.tile[num308 + 1, num309].slope() != 0) + { + num310 = -1; + } + if (!this.wet && (num310 == 147 || num310 == 25 || num310 == 53 || num310 == 189 || num310 == 0 || num310 == 123 || num310 == 57 || num310 == 112 || num310 == 116 || num310 == 196 || num310 == 193 || num310 == 195 || num310 == 197 || num310 == 199 || num310 == 229)) + { + int num311 = 1; + if (flag49) + { + num311 = 20; + } + for (int num312 = 0; num312 < num311; num312++) + { + bool flag50 = true; + int num313 = 76; + if (num310 == 53) + { + num313 = 32; + } + if (num310 == 189) + { + num313 = 16; + } + if (num310 == 0) + { + num313 = 0; + } + if (num310 == 123) + { + num313 = 53; + } + if (num310 == 57) + { + num313 = 36; + } + if (num310 == 112) + { + num313 = 14; + } + if (num310 == 116) + { + num313 = 51; + } + if (num310 == 196) + { + num313 = 108; + } + if (num310 == 193) + { + num313 = 4; + } + if (num310 == 195 || num310 == 199) + { + num313 = 5; + } + if (num310 == 197) + { + num313 = 4; + } + if (num310 == 229) + { + num313 = 153; + } + if (num310 == 25) + { + num313 = 37; + } + if (num313 == 32 && Main.rand.Next(2) == 0) + { + flag50 = false; + } + if (num313 == 14 && Main.rand.Next(2) == 0) + { + flag50 = false; + } + if (num313 == 51 && Main.rand.Next(2) == 0) + { + flag50 = false; + } + if (num313 == 36 && Main.rand.Next(2) == 0) + { + flag50 = false; + } + if (num313 == 0 && Main.rand.Next(3) != 0) + { + flag50 = false; + } + if (num313 == 53 && Main.rand.Next(3) != 0) + { + flag50 = false; + } + Color newColor = default(Color); + if (num310 == 193) + { + newColor = new Color(30, 100, 255, 100); + } + if (num310 == 197) + { + newColor = new Color(97, 200, 255, 100); + } + if (!flag49) + { + float num314 = Math.Abs(this.velocity.X) / 3f; + if ((float)Main.rand.Next(100) > num314 * 100f) + { + flag50 = false; + } + } + if (flag50) + { + float num315 = this.velocity.X; + if (num315 > 6f) + { + num315 = 6f; + } + if (num315 < -6f) + { + num315 = -6f; + } + if (this.velocity.X != 0f || flag49) + { + int num316 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), this.width, 6, num313, 0f, 0f, 50, newColor, 1f); + if (num313 == 76) + { + Main.dust[num316].scale += (float)Main.rand.Next(3) * 0.1f; + Main.dust[num316].noLight = true; + } + if (num313 == 16 || num313 == 108 || num313 == 153) + { + Main.dust[num316].scale += (float)Main.rand.Next(6) * 0.1f; + } + if (num313 == 37) + { + Main.dust[num316].scale += 0.25f; + Main.dust[num316].alpha = 50; + } + if (num313 == 5) + { + Main.dust[num316].scale += (float)Main.rand.Next(2, 8) * 0.1f; + } + Main.dust[num316].noGravity = true; + if (num311 > 1) + { + Dust expr_15B1C_cp_0 = Main.dust[num316]; + expr_15B1C_cp_0.velocity.X = expr_15B1C_cp_0.velocity.X * 1.2f; + Dust expr_15B3C_cp_0 = Main.dust[num316]; + expr_15B3C_cp_0.velocity.Y = expr_15B3C_cp_0.velocity.Y * 0.8f; + Dust expr_15B5C_cp_0 = Main.dust[num316]; + expr_15B5C_cp_0.velocity.Y = expr_15B5C_cp_0.velocity.Y - 1f; + Main.dust[num316].velocity *= 0.8f; + Main.dust[num316].scale += (float)Main.rand.Next(3) * 0.1f; + Main.dust[num316].velocity.X = (Main.dust[num316].position.X - (this.position.X + (float)(this.width / 2))) * 0.2f; + if (Main.dust[num316].velocity.Y > 0f) + { + Dust expr_15C22_cp_0 = Main.dust[num316]; + expr_15C22_cp_0.velocity.Y = expr_15C22_cp_0.velocity.Y * -1f; + } + Dust expr_15C42_cp_0 = Main.dust[num316]; + expr_15C42_cp_0.velocity.X = expr_15C42_cp_0.velocity.X + num315 * 0.3f; + } + else + { + Main.dust[num316].velocity *= 0.2f; + } + Dust expr_15C88_cp_0 = Main.dust[num316]; + expr_15C88_cp_0.position.X = expr_15C88_cp_0.position.X - num315 * 1f; + } + } + } + } + } + } + if (this.whoAmi == Main.myPlayer) + { + Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 1); + } + if (this.position.X < Main.leftWorld + 640f + 16f) + { + this.position.X = Main.leftWorld + 640f + 16f; + this.velocity.X = 0f; + } + if (this.position.X + (float)this.width > Main.rightWorld - 640f - 32f) + { + this.position.X = Main.rightWorld - 640f - 32f - (float)this.width; + this.velocity.X = 0f; + } + if (this.position.Y < Main.topWorld + 640f + 16f) + { + this.position.Y = Main.topWorld + 640f + 16f; + if ((double)this.velocity.Y < 0.11) + { + this.velocity.Y = 0.11f; + } + this.gravDir = 1f; + } + if (this.position.Y > Main.bottomWorld - 640f - 32f - (float)this.height) + { + this.position.Y = Main.bottomWorld - 640f - 32f - (float)this.height; + this.velocity.Y = 0f; + } + this.numMinions = 0; + if (Main.ignoreErrors) + { + try + { + this.ItemCheck(i); + goto IL_15E6C; + } + catch + { + goto IL_15E6C; + } + } + this.ItemCheck(i); + IL_15E6C: + this.PlayerFrame(); + if (this.statLife > this.statLifeMax) + { + this.statLife = this.statLifeMax; + } + this.grappling[0] = -1; + this.grapCount = 0; + } + } + } + public bool SellItem(int price, int stack) + { + if (price <= 0) + { + return false; + } + Item[] array = new Item[58]; + for (int i = 0; i < 58; i++) + { + array[i] = new Item(); + array[i] = (Item)this.inventory[i].Clone(); + } + int j = price / 5; + j *= stack; + if (j < 1) + { + j = 1; + } + bool flag = false; + while (j >= 1000000) + { + if (flag) + { + break; + } + int num = -1; + for (int k = 53; k >= 0; k--) + { + if (num == -1 && (this.inventory[k].type == 0 || this.inventory[k].stack == 0)) + { + num = k; + } + while (this.inventory[k].type == 74 && this.inventory[k].stack < this.inventory[k].maxStack && j >= 1000000) + { + this.inventory[k].stack++; + j -= 1000000; + this.DoCoins(k); + if (this.inventory[k].stack == 0 && num == -1) + { + num = k; + } + } + } + if (j >= 1000000) + { + if (num == -1) + { + flag = true; + } + else + { + this.inventory[num].SetDefaults(74, false); + j -= 1000000; + } + } + } + while (j >= 10000) + { + if (flag) + { + break; + } + int num2 = -1; + for (int l = 53; l >= 0; l--) + { + if (num2 == -1 && (this.inventory[l].type == 0 || this.inventory[l].stack == 0)) + { + num2 = l; + } + while (this.inventory[l].type == 73 && this.inventory[l].stack < this.inventory[l].maxStack && j >= 10000) + { + this.inventory[l].stack++; + j -= 10000; + this.DoCoins(l); + if (this.inventory[l].stack == 0 && num2 == -1) + { + num2 = l; + } + } + } + if (j >= 10000) + { + if (num2 == -1) + { + flag = true; + } + else + { + this.inventory[num2].SetDefaults(73, false); + j -= 10000; + } + } + } + while (j >= 100) + { + if (flag) + { + break; + } + int num3 = -1; + for (int m = 53; m >= 0; m--) + { + if (num3 == -1 && (this.inventory[m].type == 0 || this.inventory[m].stack == 0)) + { + num3 = m; + } + while (this.inventory[m].type == 72 && this.inventory[m].stack < this.inventory[m].maxStack && j >= 100) + { + this.inventory[m].stack++; + j -= 100; + this.DoCoins(m); + if (this.inventory[m].stack == 0 && num3 == -1) + { + num3 = m; + } + } + } + if (j >= 100) + { + if (num3 == -1) + { + flag = true; + } + else + { + this.inventory[num3].SetDefaults(72, false); + j -= 100; + } + } + } + while (j >= 1 && !flag) + { + int num4 = -1; + for (int n = 53; n >= 0; n--) + { + if (num4 == -1 && (this.inventory[n].type == 0 || this.inventory[n].stack == 0)) + { + num4 = n; + } + while (this.inventory[n].type == 71 && this.inventory[n].stack < this.inventory[n].maxStack && j >= 1) + { + this.inventory[n].stack++; + j--; + this.DoCoins(n); + if (this.inventory[n].stack == 0 && num4 == -1) + { + num4 = n; + } + } + } + if (j >= 1) + { + if (num4 == -1) + { + flag = true; + } + else + { + this.inventory[num4].SetDefaults(71, false); + j--; + } + } + } + if (flag) + { + for (int num5 = 0; num5 < 58; num5++) + { + this.inventory[num5] = (Item)array[num5].Clone(); + } + return false; + } + return true; + } + public bool BuyItem(int price) + { + if (price == 0) + { + return true; + } + int num = 0; + Item[] array = new Item[54]; + for (int i = 0; i < 54; i++) + { + array[i] = new Item(); + array[i] = (Item)this.inventory[i].Clone(); + if (this.inventory[i].type == 71) + { + num += this.inventory[i].stack; + } + if (this.inventory[i].type == 72) + { + num += this.inventory[i].stack * 100; + } + if (this.inventory[i].type == 73) + { + num += this.inventory[i].stack * 10000; + } + if (this.inventory[i].type == 74) + { + num += this.inventory[i].stack * 1000000; + } + } + if (num >= price) + { + int j = price; + while (j > 0) + { + if (j >= 1000000) + { + for (int k = 0; k < 54; k++) + { + if (this.inventory[k].type == 74) + { + while (this.inventory[k].stack > 0 && j >= 1000000) + { + j -= 1000000; + this.inventory[k].stack--; + if (this.inventory[k].stack == 0) + { + this.inventory[k].type = 0; + } + } + } + } + } + if (j >= 10000) + { + for (int l = 0; l < 54; l++) + { + if (this.inventory[l].type == 73) + { + while (this.inventory[l].stack > 0 && j >= 10000) + { + j -= 10000; + this.inventory[l].stack--; + if (this.inventory[l].stack == 0) + { + this.inventory[l].type = 0; + } + } + } + } + } + if (j >= 100) + { + for (int m = 0; m < 54; m++) + { + if (this.inventory[m].type == 72) + { + while (this.inventory[m].stack > 0 && j >= 100) + { + j -= 100; + this.inventory[m].stack--; + if (this.inventory[m].stack == 0) + { + this.inventory[m].type = 0; + } + } + } + } + } + if (j >= 1) + { + for (int n = 0; n < 54; n++) + { + if (this.inventory[n].type == 71) + { + while (this.inventory[n].stack > 0 && j >= 1) + { + j--; + this.inventory[n].stack--; + if (this.inventory[n].stack == 0) + { + this.inventory[n].type = 0; + } + } + } + } + } + if (j > 0) + { + int num2 = -1; + for (int num3 = 53; num3 >= 0; num3--) + { + if (this.inventory[num3].type == 0 || this.inventory[num3].stack == 0) + { + num2 = num3; + break; + } + } + if (num2 < 0) + { + for (int num4 = 0; num4 < 54; num4++) + { + this.inventory[num4] = (Item)array[num4].Clone(); + } + return false; + } + bool flag = true; + if (j >= 10000) + { + for (int num5 = 0; num5 < 58; num5++) + { + if (this.inventory[num5].type == 74 && this.inventory[num5].stack >= 1) + { + this.inventory[num5].stack--; + if (this.inventory[num5].stack == 0) + { + this.inventory[num5].type = 0; + } + this.inventory[num2].SetDefaults(73, false); + this.inventory[num2].stack = 100; + flag = false; + break; + } + } + } + else + { + if (j >= 100) + { + for (int num6 = 0; num6 < 54; num6++) + { + if (this.inventory[num6].type == 73 && this.inventory[num6].stack >= 1) + { + this.inventory[num6].stack--; + if (this.inventory[num6].stack == 0) + { + this.inventory[num6].type = 0; + } + this.inventory[num2].SetDefaults(72, false); + this.inventory[num2].stack = 100; + flag = false; + break; + } + } + } + else + { + if (j >= 1) + { + for (int num7 = 0; num7 < 54; num7++) + { + if (this.inventory[num7].type == 72 && this.inventory[num7].stack >= 1) + { + this.inventory[num7].stack--; + if (this.inventory[num7].stack == 0) + { + this.inventory[num7].type = 0; + } + this.inventory[num2].SetDefaults(71, false); + this.inventory[num2].stack = 100; + flag = false; + break; + } + } + } + } + } + if (flag) + { + if (j < 10000) + { + for (int num8 = 0; num8 < 54; num8++) + { + if (this.inventory[num8].type == 73 && this.inventory[num8].stack >= 1) + { + this.inventory[num8].stack--; + if (this.inventory[num8].stack == 0) + { + this.inventory[num8].type = 0; + } + this.inventory[num2].SetDefaults(72, false); + this.inventory[num2].stack = 100; + flag = false; + break; + } + } + } + if (flag && j < 1000000) + { + for (int num9 = 0; num9 < 54; num9++) + { + if (this.inventory[num9].type == 74 && this.inventory[num9].stack >= 1) + { + this.inventory[num9].stack--; + if (this.inventory[num9].stack == 0) + { + this.inventory[num9].type = 0; + } + this.inventory[num2].SetDefaults(73, false); + this.inventory[num2].stack = 100; + break; + } + } + } + } + } + } + return true; + } + return false; + } + public void AdjTiles() + { + int num = 4; + int num2 = 3; + for (int i = 0; i < 251; i++) + { + this.oldAdjTile[i] = this.adjTile[i]; + this.adjTile[i] = false; + } + this.oldAdjWater = this.adjWater; + this.adjWater = false; + this.oldAdjHoney = this.adjHoney; + this.adjHoney = false; + int num3 = (int)((this.position.X + (float)(this.width / 2)) / 16f); + int num4 = (int)((this.position.Y + (float)this.height) / 16f); + for (int j = num3 - num; j <= num3 + num; j++) + { + for (int k = num4 - num2; k < num4 + num2; k++) + { + if (Main.tile[j, k].active()) + { + this.adjTile[(int)Main.tile[j, k].type] = true; + if (Main.tile[j, k].type == 77) + { + this.adjTile[17] = true; + } + if (Main.tile[j, k].type == 133) + { + this.adjTile[17] = true; + this.adjTile[77] = true; + } + if (Main.tile[j, k].type == 134) + { + this.adjTile[16] = true; + } + } + if (Main.tile[j, k].liquid > 200 && Main.tile[j, k].liquidType() == 0) + { + this.adjWater = true; + } + if (Main.tile[j, k].liquid > 200 && Main.tile[j, k].liquidType() == 2) + { + this.adjHoney = true; + } + } + } + if (Main.playerInventory) + { + bool flag = false; + for (int l = 0; l < 251; l++) + { + if (this.oldAdjTile[l] != this.adjTile[l]) + { + flag = true; + break; + } + } + if (this.adjWater != this.oldAdjWater) + { + flag = true; + } + if (this.adjHoney != this.oldAdjHoney) + { + flag = true; + } + if (flag) + { + Recipe.FindRecipes(); + } + } + } + public void PlayerFrame() + { + if (this.frozen) + { + return; + } + if (this.swimTime > 0) + { + this.swimTime--; + if (!this.wet) + { + this.swimTime = 0; + } + } + this.head = this.armor[0].headSlot; + this.body = this.armor[1].bodySlot; + this.legs = this.armor[2].legSlot; + if (this.armor[8].headSlot >= 0) + { + this.head = this.armor[8].headSlot; + } + if (this.armor[9].bodySlot >= 0) + { + this.body = this.armor[9].bodySlot; + } + if (this.armor[10].legSlot >= 0) + { + this.legs = this.armor[10].legSlot; + } + if (Main.myPlayer == this.whoAmi) + { + bool flag = false; + if (this.wings == 3 || (this.wings >= 16 && this.wings <= 19)) + { + flag = true; + } + else + { + if (this.head == 45 || (this.head >= 106 && this.head <= 110)) + { + flag = true; + } + else + { + if (this.body == 26 || (this.body >= 68 && this.body <= 74)) + { + flag = true; + } + else + { + if (this.legs == 25 || (this.legs >= 57 && this.legs <= 63)) + { + flag = true; + } + } + } + } + if (flag) + { + this.velocity.X = this.velocity.X * 0.9f; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + this.jump = 0; + this.statDefense = -1000; + this.AddBuff(23, 2, false); + this.AddBuff(80, 2, false); + this.AddBuff(67, 2, false); + this.AddBuff(32, 2, false); + this.AddBuff(31, 2, false); + this.AddBuff(33, 2, false); + } + } + if (this.wereWolf) + { + this.legs = 20; + this.body = 21; + this.head = 38; + } + if (this.merman) + { + this.head = 39; + this.legs = 21; + this.body = 22; + } + this.socialShadow = false; + this.socialGhost = false; + if (this.head == 101 && this.body == 66 && this.legs == 55) + { + this.socialGhost = true; + } + if (this.head == 99 && this.body == 65 && this.legs == 54) + { + this.turtleArmor = true; + } + if ((this.head == 75 || this.head == 7) && this.body == 7 && this.legs == 7) + { + this.boneArmor = true; + } + if (((this.body == 68 && this.legs == 57 && this.head == 106) || (this.body == 74 && this.legs == 63 && this.head == 106)) && Main.rand.Next(10) == 0) + { + int num = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, this.position.Y - 2f - this.velocity.Y * 2f), this.width, this.height, 43, 0f, 0f, 100, new Color(255, 0, 255), 0.3f); + Main.dust[num].fadeIn = 0.8f; + Main.dust[num].noGravity = true; + Main.dust[num].velocity *= 2f; + } + if (this.head == 5 && this.body == 5 && this.legs == 5) + { + this.socialShadow = true; + } + if (this.head == 5 && this.body == 5 && this.legs == 5 && Main.rand.Next(10) == 0) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 200, default(Color), 1.2f); + } + if (this.head == 45 && this.body == 26 && this.legs == 25 && Main.rand.Next(12) == 0) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 186, 0f, 0f, 160, default(Color), 1.4f); + } + if (this.head == 76 && this.body == 49 && this.legs == 45) + { + this.socialShadow = true; + } + if (this.head == 74 && this.body == 48 && this.legs == 44) + { + this.socialShadow = true; + } + if (this.head == 74 && this.body == 48 && this.legs == 44 && Main.rand.Next(10) == 0) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 200, default(Color), 1.2f); + } + if (this.head == 57 && this.body == 37 && this.legs == 35) + { + int maxValue = 10; + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 1f) + { + maxValue = 2; + } + if (Main.rand.Next(maxValue) == 0) + { + int num2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 115, 0f, 0f, 140, default(Color), 0.75f); + Main.dust[num2].noGravity = true; + Main.dust[num2].fadeIn = 1.5f; + Main.dust[num2].velocity *= 0.3f; + Main.dust[num2].velocity += this.velocity * 0.2f; + } + } + if (this.head == 6 && this.body == 6 && this.legs == 6 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 1f && !this.rocketFrame) + { + for (int i = 0; i < 2; i++) + { + int num3 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, this.position.Y - 2f - this.velocity.Y * 2f), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num3].noGravity = true; + Main.dust[num3].noLight = true; + Dust expr_7B6_cp_0 = Main.dust[num3]; + expr_7B6_cp_0.velocity.X = expr_7B6_cp_0.velocity.X - this.velocity.X * 0.5f; + Dust expr_7E0_cp_0 = Main.dust[num3]; + expr_7E0_cp_0.velocity.Y = expr_7E0_cp_0.velocity.Y - this.velocity.Y * 0.5f; + } + } + if (this.head == 8 && this.body == 8 && this.legs == 8 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 1f) + { + int num4 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, this.position.Y - 2f - this.velocity.Y * 2f), this.width, this.height, 40, 0f, 0f, 50, default(Color), 1.4f); + Main.dust[num4].noGravity = true; + Main.dust[num4].velocity.X = this.velocity.X * 0.25f; + Main.dust[num4].velocity.Y = this.velocity.Y * 0.25f; + } + if (this.head == 9 && this.body == 9 && this.legs == 9 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 1f && !this.rocketFrame) + { + for (int j = 0; j < 2; j++) + { + int num5 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, this.position.Y - 2f - this.velocity.Y * 2f), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num5].noGravity = true; + Main.dust[num5].noLight = true; + Dust expr_A25_cp_0 = Main.dust[num5]; + expr_A25_cp_0.velocity.X = expr_A25_cp_0.velocity.X - this.velocity.X * 0.5f; + Dust expr_A4F_cp_0 = Main.dust[num5]; + expr_A4F_cp_0.velocity.Y = expr_A4F_cp_0.velocity.Y - this.velocity.Y * 0.5f; + } + } + if (this.body == 18 && this.legs == 17 && (this.head == 32 || this.head == 33 || this.head == 34) && Main.rand.Next(10) == 0) + { + int num6 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, this.position.Y - 2f - this.velocity.Y * 2f), this.width, this.height, 43, 0f, 0f, 100, default(Color), 0.3f); + Main.dust[num6].fadeIn = 0.8f; + Main.dust[num6].velocity *= 0f; + } + if (this.body == 24 && this.legs == 23 && (this.head == 42 || this.head == 43 || this.head == 41) && this.velocity.X != 0f && this.velocity.Y != 0f && Main.rand.Next(10) == 0) + { + int num7 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, this.position.Y - 2f - this.velocity.Y * 2f), this.width, this.height, 43, 0f, 0f, 100, default(Color), 0.3f); + Main.dust[num7].fadeIn = 0.8f; + Main.dust[num7].velocity *= 0f; + } + if (this.body == 36 && this.head == 56 && this.velocity.X != 0f && this.velocity.Y == 0f) + { + for (int k = 0; k < 2; k++) + { + int num8 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), this.width, 6, 106, 0f, 0f, 100, default(Color), 0.1f); + Main.dust[num8].fadeIn = 1f; + Main.dust[num8].noGravity = true; + Main.dust[num8].velocity *= 0.2f; + } + } + if (this.body == 27 && this.head == 46 && this.legs == 26) + { + this.frostArmor = true; + if (this.velocity.X != 0f && this.velocity.Y == 0f && this.miscCounter % 2 == 0) + { + for (int l = 0; l < 2; l++) + { + int num9; + if (l == 0) + { + num9 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height + this.gfxOffY), this.width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f); + } + else + { + num9 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)this.height + this.gfxOffY), this.width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f); + } + Main.dust[num9].scale *= 1f + (float)Main.rand.Next(20, 40) * 0.01f; + Main.dust[num9].noGravity = true; + Main.dust[num9].noLight = true; + Main.dust[num9].velocity *= 0.001f; + Dust expr_F0D_cp_0 = Main.dust[num9]; + expr_F0D_cp_0.velocity.Y = expr_F0D_cp_0.velocity.Y - 0.003f; + } + } + } + this.bodyFrame.Width = 40; + this.bodyFrame.Height = 56; + this.legFrame.Width = 40; + this.legFrame.Height = 56; + this.bodyFrame.X = 0; + this.legFrame.X = 0; + if (this.itemAnimation > 0 && this.inventory[this.selectedItem].useStyle != 10) + { + if (this.inventory[this.selectedItem].useStyle == 1 || this.inventory[this.selectedItem].type == 0) + { + if ((double)this.itemAnimation < (double)this.itemAnimationMax * 0.333) + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else + { + if ((double)this.itemAnimation < (double)this.itemAnimationMax * 0.666) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height; + } + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 2) + { + if ((double)this.itemAnimation > (double)this.itemAnimationMax * 0.5) + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 3) + { + if ((double)this.itemAnimation > (double)this.itemAnimationMax * 0.666) + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 4) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + else + { + if (this.inventory[this.selectedItem].useStyle == 5) + { + if (this.inventory[this.selectedItem].type == 281 || this.inventory[this.selectedItem].type == 986) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + else + { + float num10 = this.itemRotation * (float)this.direction; + this.bodyFrame.Y = this.bodyFrame.Height * 3; + if ((double)num10 < -0.75) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + if (this.gravDir == -1f) + { + this.bodyFrame.Y = this.bodyFrame.Height * 4; + } + } + if ((double)num10 > 0.6) + { + this.bodyFrame.Y = this.bodyFrame.Height * 4; + if (this.gravDir == -1f) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + } + } + } + } + } + } + } + } + else + { + if (this.pulley) + { + if (this.pulleyDir == 2) + { + this.bodyFrame.Y = this.bodyFrame.Height; + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + } + else + { + if (this.inventory[this.selectedItem].holdStyle == 1 && (!this.wet || !this.inventory[this.selectedItem].noWet)) + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else + { + if (this.inventory[this.selectedItem].holdStyle == 2 && (!this.wet || !this.inventory[this.selectedItem].noWet)) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + else + { + if (this.inventory[this.selectedItem].holdStyle == 3) + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else + { + if (this.grappling[0] >= 0) + { + this.sandStorm = false; + this.dJumpEffect = false; + this.dJumpEffect2 = false; + this.dJumpEffect3 = false; + Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num11 = 0f; + float num12 = 0f; + for (int m = 0; m < this.grapCount; m++) + { + num11 += Main.projectile[this.grappling[m]].position.X + (float)(Main.projectile[this.grappling[m]].width / 2); + num12 += Main.projectile[this.grappling[m]].position.Y + (float)(Main.projectile[this.grappling[m]].height / 2); + } + num11 /= (float)this.grapCount; + num12 /= (float)this.grapCount; + num11 -= vector.X; + num12 -= vector.Y; + if (num12 < 0f && Math.Abs(num12) > Math.Abs(num11)) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + if (this.gravDir == -1f) + { + this.bodyFrame.Y = this.bodyFrame.Height * 4; + } + } + else + { + if (num12 > 0f && Math.Abs(num12) > Math.Abs(num11)) + { + this.bodyFrame.Y = this.bodyFrame.Height * 4; + if (this.gravDir == -1f) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + } + } + else + { + if (this.swimTime > 0) + { + if (this.swimTime > 20) + { + this.bodyFrame.Y = 0; + } + else + { + if (this.swimTime > 10) + { + this.bodyFrame.Y = this.bodyFrame.Height * 5; + } + else + { + this.bodyFrame.Y = 0; + } + } + } + else + { + if (this.velocity.Y != 0f) + { + if (this.sliding) + { + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else + { + if (this.sandStorm || this.carpetFrame >= 0) + { + this.bodyFrame.Y = this.bodyFrame.Height * 6; + } + else + { + if (this.wings > 0) + { + if (this.velocity.Y > 0f) + { + if (this.controlJump) + { + this.bodyFrame.Y = this.bodyFrame.Height * 6; + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 5; + } + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 6; + } + } + else + { + this.bodyFrame.Y = this.bodyFrame.Height * 5; + } + } + } + this.bodyFrameCounter = 0.0; + } + else + { + if (this.velocity.X != 0f) + { + this.bodyFrameCounter += (double)Math.Abs(this.velocity.X) * 1.5; + this.bodyFrame.Y = this.legFrame.Y; + } + else + { + this.bodyFrameCounter = 0.0; + this.bodyFrame.Y = 0; + } + } + } + } + } + } + } + } + } + if (this.swimTime > 0) + { + this.legFrameCounter += 2.0; + while (this.legFrameCounter > 8.0) + { + this.legFrameCounter -= 8.0; + this.legFrame.Y = this.legFrame.Y + this.legFrame.Height; + } + if (this.legFrame.Y < this.legFrame.Height * 7) + { + this.legFrame.Y = this.legFrame.Height * 19; + } + else + { + if (this.legFrame.Y > this.legFrame.Height * 19) + { + this.legFrame.Y = this.legFrame.Height * 7; + } + } + } + else + { + if (this.velocity.Y != 0f || this.grappling[0] > -1) + { + this.legFrameCounter = 0.0; + this.legFrame.Y = this.legFrame.Height * 5; + } + else + { + if (this.velocity.X != 0f) + { + if ((this.slippy || this.slippy2) && !this.controlLeft && !this.controlRight) + { + this.legFrameCounter = 0.0; + this.legFrame.Y = 0; + } + else + { + this.legFrameCounter += (double)Math.Abs(this.velocity.X) * 1.3; + while (this.legFrameCounter > 8.0) + { + this.legFrameCounter -= 8.0; + this.legFrame.Y = this.legFrame.Y + this.legFrame.Height; + } + if (this.legFrame.Y < this.legFrame.Height * 7) + { + this.legFrame.Y = this.legFrame.Height * 19; + } + else + { + if (this.legFrame.Y > this.legFrame.Height * 19) + { + this.legFrame.Y = this.legFrame.Height * 7; + } + } + } + } + else + { + this.legFrameCounter = 0.0; + this.legFrame.Y = 0; + } + } + } + if (this.carpetFrame >= 0) + { + this.legFrameCounter = 0.0; + this.legFrame.Y = 0; + } + if (this.sandStorm) + { + if (this.miscCounter % 4 == 0 && this.itemAnimation == 0) + { + this.direction *= -1; + } + this.legFrameCounter = 0.0; + this.legFrame.Y = 0; + } + } + public void Teleport(Vector2 newPos, int Style = 0) + { + this.grappling[0] = -1; + Main.TeleportEffect(this.getRect(), Style); + this.position = newPos; + if (this.whoAmi == Main.myPlayer) + { + Main.BlackFadeIn = 255; + Lighting.BlackOut(); + Main.screenLastPosition = Main.screenPosition; + Main.screenPosition.X = this.position.X + (float)(this.width / 2) - (float)(Main.screenWidth / 2); + Main.screenPosition.Y = this.position.Y + (float)(this.height / 2) - (float)(Main.screenHeight / 2); + if (Main.mapTime < 5) + { + Main.mapTime = 5; + } + Main.quickBG = 10; + Main.maxQ = true; + Main.renderNow = true; + } + this.fallStart = (int)(this.position.Y / 16f); + Main.TeleportEffect(this.getRect(), Style); + this.teleportTime = 1f; + this.teleportStyle = Style; + } + public void Spawn() + { + if (this.whoAmi == Main.myPlayer) + { + if (Main.mapTime < 5) + { + Main.mapTime = 5; + } + Main.quickBG = 10; + this.FindSpawn(); + if (!Player.CheckSpawn(this.SpawnX, this.SpawnY)) + { + this.SpawnX = -1; + this.SpawnY = -1; + } + Main.maxQ = true; + } + if (Main.netMode == 1 && this.whoAmi == Main.myPlayer) + { + NetMessage.SendData(12, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + Main.gameMenu = false; + } + this.headPosition = default(Vector2); + this.bodyPosition = default(Vector2); + this.legPosition = default(Vector2); + this.headRotation = 0f; + this.bodyRotation = 0f; + this.legRotation = 0f; + if (this.statLife <= 0) + { + this.statLife = 100; + this.breath = this.breathMax; + if (this.spawnMax) + { + this.statLife = this.statLifeMax; + this.statMana = this.statManaMax2; + } + } + this.immune = true; + this.dead = false; + this.immuneTime = 0; + this.active = true; + if (this.SpawnX >= 0 && this.SpawnY >= 0) + { + this.position.X = (float)(this.SpawnX * 16 + 8 - this.width / 2); + this.position.Y = (float)(this.SpawnY * 16 - this.height); + } + else + { + this.position.X = (float)(Main.spawnTileX * 16 + 8 - this.width / 2); + this.position.Y = (float)(Main.spawnTileY * 16 - this.height); + for (int i = Main.spawnTileX - 1; i < Main.spawnTileX + 2; i++) + { + for (int j = Main.spawnTileY - 3; j < Main.spawnTileY; j++) + { + if (Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + WorldGen.KillTile(i, j, false, false, false); + } + if (Main.tile[i, j].liquid > 0) + { + Main.tile[i, j].lava(false); + Main.tile[i, j].liquid = 0; + WorldGen.SquareTileFrame(i, j, true); + } + } + } + } + this.wet = false; + this.wetCount = 0; + this.lavaWet = false; + this.fallStart = (int)(this.position.Y / 16f); + this.velocity.X = 0f; + this.velocity.Y = 0f; + this.talkNPC = -1; + if (this.pvpDeath) + { + this.pvpDeath = false; + this.immuneTime = 300; + this.statLife = this.statLifeMax; + } + else + { + this.immuneTime = 60; + } + if (this.whoAmi == Main.myPlayer) + { + Main.BlackFadeIn = 255; + Main.renderNow = true; + if (Main.netMode == 1) + { + Netplay.newRecent(); + } + Main.screenPosition.X = this.position.X + (float)(this.width / 2) - (float)(Main.screenWidth / 2); + Main.screenPosition.Y = this.position.Y + (float)(this.height / 2) - (float)(Main.screenHeight / 2); + } + } + public void ShadowDodge() + { + this.immune = true; + this.immuneTime = 80; + if (this.longInvince) + { + this.immuneTime += 40; + } + if (this.whoAmi == Main.myPlayer) + { + for (int i = 0; i < 9; i++) + { + if (this.buffTime[i] > 0 && this.buffType[i] == 59) + { + this.DelBuff(i); + } + } + NetMessage.SendData(62, -1, -1, "", this.whoAmi, 2f, 0f, 0f, 0); + } + } + public void NinjaDodge() + { + this.immune = true; + this.immuneTime = 80; + if (this.longInvince) + { + this.immuneTime += 40; + } + for (int i = 0; i < 100; i++) + { + int num = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 2f); + Dust expr_82_cp_0 = Main.dust[num]; + expr_82_cp_0.position.X = expr_82_cp_0.position.X + (float)Main.rand.Next(-20, 21); + Dust expr_A9_cp_0 = Main.dust[num]; + expr_A9_cp_0.position.Y = expr_A9_cp_0.position.Y + (float)Main.rand.Next(-20, 21); + Main.dust[num].velocity *= 0.4f; + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[num].noGravity = true; + } + } + int num2 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num2].scale = 1.5f; + Main.gore[num2].velocity.X = (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity.Y = (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity *= 0.4f; + num2 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num2].scale = 1.5f; + Main.gore[num2].velocity.X = 1.5f + (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity.Y = 1.5f + (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity *= 0.4f; + num2 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num2].scale = 1.5f; + Main.gore[num2].velocity.X = -1.5f - (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity.Y = 1.5f + (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity *= 0.4f; + num2 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num2].scale = 1.5f; + Main.gore[num2].velocity.X = 1.5f + (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity.Y = -1.5f - (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity *= 0.4f; + num2 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num2].scale = 1.5f; + Main.gore[num2].velocity.X = -1.5f - (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity.Y = -1.5f - (float)Main.rand.Next(-50, 51) * 0.01f; + Main.gore[num2].velocity *= 0.4f; + if (this.whoAmi == Main.myPlayer) + { + NetMessage.SendData(62, -1, -1, "", this.whoAmi, 1f, 0f, 0f, 0); + } + } + public double Hurt(int Damage, int hitDirection, bool pvp = false, bool quiet = false, string deathText = " was slain...", bool Crit = false) + { + if (this.immune) + { + return 0.0; + } + if (this.whoAmi == Main.myPlayer && this.blackBelt && Main.rand.Next(10) == 0) + { + this.NinjaDodge(); + return 0.0; + } + if (this.whoAmi == Main.myPlayer && this.shadowDodge) + { + this.ShadowDodge(); + return 0.0; + } + if (this.whoAmi == Main.myPlayer && this.panic) + { + this.AddBuff(63, 300, true); + } + int num = Damage; + double num2 = Main.CalculateDamage(num, this.statDefense); + if (Crit) + { + num *= 2; + } + if (num2 >= 1.0) + { + if (this.magicCuffs) + { + int num3 = num; + this.statMana += num3; + if (this.statMana > this.statManaMax2) + { + this.statMana = this.statManaMax2; + } + this.ManaEffect(num3); + } + if (this.paladinBuff) + { + int damage = (int)(num2 * 0.25); + num2 = (double)((int)(num2 * 0.75)); + if (this.whoAmi != Main.myPlayer && Main.player[Main.myPlayer].paladinGive) + { + int myPlayer = Main.myPlayer; + if (Main.player[myPlayer].team == this.team && this.team != 0) + { + float num4 = this.position.X - Main.player[myPlayer].position.X; + float num5 = this.position.Y - Main.player[myPlayer].position.Y; + float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); + if (num6 < 800f) + { + Main.player[myPlayer].Hurt(damage, 0, false, false, "", false); + } + } + } + } + if (Main.netMode == 1 && this.whoAmi == Main.myPlayer && !quiet) + { + int number = 0; + if (Crit) + { + number = 1; + } + int num7 = 0; + if (pvp) + { + num7 = 1; + } + NetMessage.SendData(13, -1, -1, "", this.whoAmi, 0f, 0f, 0f, 0); + NetMessage.SendData(16, -1, -1, "", this.whoAmi, 0f, 0f, 0f, 0); + NetMessage.SendData(26, -1, -1, "", this.whoAmi, (float)hitDirection, (float)Damage, (float)num7, number); + } + CombatText.NewText(new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), new Color(255, 80, 90, 255), string.Concat((int)num2), Crit, false); + this.statLife -= (int)num2; + this.immune = true; + if (num2 == 1.0) + { + this.immuneTime = 20; + if (this.longInvince) + { + this.immuneTime += 20; + } + } + else + { + this.immuneTime = 40; + if (this.longInvince) + { + this.immuneTime += 40; + } + } + this.lifeRegenTime = 0; + if (pvp) + { + this.immuneTime = 8; + } + if (this.whoAmi == Main.myPlayer) + { + if (this.starCloak) + { + for (int i = 0; i < 3; i++) + { + float x = this.position.X + (float)Main.rand.Next(-400, 400); + float y = this.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num8 = this.position.X + (float)(this.width / 2) - vector.X; + float num9 = this.position.Y + (float)(this.height / 2) - vector.Y; + num8 += (float)Main.rand.Next(-100, 101); + int num10 = 23; + float num11 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); + num11 = (float)num10 / num11; + num8 *= num11; + num9 *= num11; + int num12 = Projectile.NewProjectile(x, y, num8, num9, 92, 30, 5f, this.whoAmi, 0f, 0f); + Main.projectile[num12].ai[1] = this.position.Y; + } + } + if (this.bee) + { + int num13 = 1; + if (Main.rand.Next(3) == 0) + { + num13++; + } + if (Main.rand.Next(3) == 0) + { + num13++; + } + for (int j = 0; j < num13; j++) + { + float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; + float speedY = (float)Main.rand.Next(-35, 36) * 0.02f; + Projectile.NewProjectile(this.position.X, this.position.Y, speedX, speedY, 181, 7, 0f, Main.myPlayer, 0f, 0f); + } + } + } + if (!this.noKnockback && hitDirection != 0) + { + this.velocity.X = 4.5f * (float)hitDirection; + this.velocity.Y = -3.5f; + } + if (this.frostArmor) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27); + } + else + { + if (this.wereWolf) + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 6); + } + else + { + if (this.boneArmor) + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 2); + } + else + { + if (!this.male) + { + Main.PlaySound(20, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + Main.PlaySound(1, (int)this.position.X, (int)this.position.Y, 1); + } + } + } + } + if (this.statLife > 0) + { + int num14 = 0; + while ((double)num14 < num2 / (double)this.statLifeMax * 100.0) + { + if (this.body == 27 && this.head == 46 && this.legs == 26) + { + Dust.NewDust(this.position, this.width, this.height, 135, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + else + { + if (this.boneArmor) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + else + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + } + num14++; + } + } + else + { + this.statLife = 0; + if (this.whoAmi == Main.myPlayer) + { + this.KillMe(num2, hitDirection, pvp, deathText); + } + } + } + if (pvp) + { + num2 = Main.CalculateDamage(num, this.statDefense); + } + return num2; + } + public void KillMeForGood() + { + if (File.Exists(Main.playerPathName)) + { + File.Delete(Main.playerPathName); + } + if (File.Exists(Main.playerPathName + ".bak")) + { + File.Delete(Main.playerPathName + ".bak"); + } + if (File.Exists(Main.playerPathName + ".dat")) + { + File.Delete(Main.playerPathName + ".dat"); + } + Main.playerPathName = ""; + } + public void KillMe(double dmg, int hitDirection, bool pvp = false, string deathText = " was slain...") + { + if (this.dead) + { + return; + } + if (pvp) + { + this.pvpDeath = true; + } + if (this.difficulty == 0) + { + if (Main.netMode != 1) + { + float num = (float)Main.rand.Next(-35, 36) * 0.1f; + while (num < 2f && num > -2f) + { + num += (float)Main.rand.Next(-30, 31) * 0.1f; + } + int num2 = Main.rand.Next(6); + if (num2 == 0) + { + num2 = 43; + } + else + { + num2 = 200 + num2; + } + int num3 = Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.head / 2), (float)Main.rand.Next(10, 30) * 0.1f * (float)hitDirection + num, (float)Main.rand.Next(-40, -20) * 0.1f, num2, 0, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num3].miscText = this.name + deathText; + } + if (Main.myPlayer == this.whoAmi) + { + for (int i = 0; i < 59; i++) + { + if (this.inventory[i].stack > 0 && this.inventory[i].type >= 1522 && this.inventory[i].type <= 1527) + { + int num4 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, this.inventory[i].type, 1, false, 0, false); + Main.item[num4].SetDefaults(this.inventory[i].name); + Main.item[num4].Prefix((int)this.inventory[i].prefix); + Main.item[num4].stack = this.inventory[i].stack; + Main.item[num4].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num4].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f; + Main.item[num4].noGrabDelay = 100; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num4, 0f, 0f, 0f, 0); + } + this.inventory[i].SetDefaults(0, false); + } + } + Main.mapFullscreen = false; + } + } + else + { + if (Main.netMode != 1) + { + float num5 = (float)Main.rand.Next(-35, 36) * 0.1f; + while (num5 < 2f && num5 > -2f) + { + num5 += (float)Main.rand.Next(-30, 31) * 0.1f; + } + int num6 = Main.rand.Next(6); + if (num6 == 0) + { + num6 = 43; + } + else + { + num6 = 200 + num6; + } + int num7 = Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.head / 2), (float)Main.rand.Next(10, 30) * 0.1f * (float)hitDirection + num5, (float)Main.rand.Next(-40, -20) * 0.1f, num6, 0, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num7].miscText = this.name + deathText; + } + if (Main.myPlayer == this.whoAmi) + { + if (Main.myPlayer == this.whoAmi) + { + Main.mapFullscreen = false; + } + Main.trashItem.SetDefaults(0, false); + if (this.difficulty == 1) + { + this.DropItems(); + } + else + { + if (this.difficulty == 2) + { + this.DropItems(); + this.KillMeForGood(); + } + } + } + } + Main.PlaySound(5, (int)this.position.X, (int)this.position.Y, 1); + this.headVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; + this.bodyVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; + this.legVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; + this.headVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * hitDirection); + this.bodyVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * hitDirection); + this.legVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * hitDirection); + for (int j = 0; j < 100; j++) + { + if (this.boneArmor) + { + Dust.NewDust(this.position, this.width, this.height, 26, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + else + { + Dust.NewDust(this.position, this.width, this.height, 5, (float)(2 * hitDirection), -2f, 0, default(Color), 1f); + } + } + this.dead = true; + this.respawnTimer = 600; + this.immuneAlpha = 0; + this.palladiumRegen = false; + this.iceBarrier = false; + this.crystalLeaf = false; + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, this.name + deathText, 255, 225f, 25f, 25f, 0); + } + else + { + if (Main.netMode == 0) + { + Main.NewText(this.name + deathText, 225, 25, 25, false); + } + } + if (Main.netMode == 1 && this.whoAmi == Main.myPlayer) + { + int num8 = 0; + if (pvp) + { + num8 = 1; + } + NetMessage.SendData(44, -1, -1, deathText, this.whoAmi, (float)hitDirection, (float)((int)dmg), (float)num8, 0); + } + if (!pvp && this.whoAmi == Main.myPlayer && this.difficulty == 0) + { + this.DropCoins(); + } + if (this.whoAmi == Main.myPlayer) + { + try + { + WorldGen.saveToonWhilePlaying(); + } + catch + { + } + } + } + public bool ItemSpace(Item newItem) + { + if (newItem.type == 58) + { + return true; + } + if (newItem.type == 184) + { + return true; + } + int num = 50; + if (newItem.type == 71 || newItem.type == 72 || newItem.type == 73 || newItem.type == 74) + { + num = 54; + } + for (int i = 0; i < num; i++) + { + if (this.inventory[i].type == 0) + { + return true; + } + } + for (int j = 0; j < num; j++) + { + if (this.inventory[j].type > 0 && this.inventory[j].stack < this.inventory[j].maxStack && newItem.IsTheSameAs(this.inventory[j])) + { + return true; + } + } + if (newItem.ammo > 0 && !newItem.notAmmo) + { + if (newItem.type != 75 && newItem.type != 169 && newItem.type != 23 && newItem.type != 408 && newItem.type != 370) + { + for (int k = 54; k < 58; k++) + { + if (this.inventory[k].type == 0) + { + return true; + } + } + } + for (int l = 54; l < 58; l++) + { + if (this.inventory[l].type > 0 && this.inventory[l].stack < this.inventory[l].maxStack && newItem.IsTheSameAs(this.inventory[l])) + { + return true; + } + } + } + return false; + } + public void DoCoins(int i) + { + if (this.inventory[i].stack == 100 && (this.inventory[i].type == 71 || this.inventory[i].type == 72 || this.inventory[i].type == 73)) + { + this.inventory[i].SetDefaults(this.inventory[i].type + 1, false); + for (int j = 0; j < 54; j++) + { + if (this.inventory[j].IsTheSameAs(this.inventory[i]) && j != i && this.inventory[j].type == this.inventory[i].type && this.inventory[j].stack < this.inventory[j].maxStack) + { + this.inventory[j].stack++; + this.inventory[i].SetDefaults(0, false); + this.inventory[i].active = false; + this.inventory[i].name = ""; + this.inventory[i].type = 0; + this.inventory[i].stack = 0; + this.DoCoins(j); + } + } + } + } + public Item FillAmmo(int plr, Item newItem) + { + for (int i = 54; i < 58; i++) + { + if (this.inventory[i].type > 0 && this.inventory[i].stack < this.inventory[i].maxStack && newItem.IsTheSameAs(this.inventory[i])) + { + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + if (newItem.stack + this.inventory[i].stack <= this.inventory[i].maxStack) + { + this.inventory[i].stack += newItem.stack; + ItemText.NewText(newItem, newItem.stack); + this.DoCoins(i); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + return new Item(); + } + newItem.stack -= this.inventory[i].maxStack - this.inventory[i].stack; + ItemText.NewText(newItem, this.inventory[i].maxStack - this.inventory[i].stack); + this.inventory[i].stack = this.inventory[i].maxStack; + this.DoCoins(i); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + } + } + if (newItem.type != 169 && newItem.type != 75 && newItem.type != 23 && newItem.type != 408 && newItem.type != 370 && !newItem.notAmmo) + { + for (int j = 54; j < 58; j++) + { + if (this.inventory[j].type == 0) + { + this.inventory[j] = newItem; + ItemText.NewText(newItem, newItem.stack); + this.DoCoins(j); + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + return new Item(); + } + } + } + return newItem; + } + public Item GetItem(int plr, Item newItem) + { + Item item = newItem; + int num = 50; + if (newItem.noGrabDelay > 0) + { + return item; + } + int num2 = 0; + if (newItem.type == 71 || newItem.type == 72 || newItem.type == 73 || newItem.type == 74) + { + num2 = -4; + num = 54; + } + if (item.ammo > 0 && !item.notAmmo) + { + item = this.FillAmmo(plr, item); + if (item.type == 0 || item.stack == 0) + { + return new Item(); + } + } + for (int i = num2; i < 50; i++) + { + int num3 = i; + if (num3 < 0) + { + num3 = 54 + i; + } + if (this.inventory[num3].type > 0 && this.inventory[num3].stack < this.inventory[num3].maxStack && item.IsTheSameAs(this.inventory[num3])) + { + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + if (item.stack + this.inventory[num3].stack <= this.inventory[num3].maxStack) + { + this.inventory[num3].stack += item.stack; + ItemText.NewText(newItem, item.stack); + this.DoCoins(num3); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + return new Item(); + } + item.stack -= this.inventory[num3].maxStack - this.inventory[num3].stack; + ItemText.NewText(newItem, this.inventory[num3].maxStack - this.inventory[num3].stack); + this.inventory[num3].stack = this.inventory[num3].maxStack; + this.DoCoins(num3); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + } + } + if (newItem.type != 71 && newItem.type != 72 && newItem.type != 73 && newItem.type != 74 && newItem.useStyle > 0) + { + for (int j = 0; j < 10; j++) + { + if (this.inventory[j].type == 0) + { + this.inventory[j] = item; + ItemText.NewText(newItem, newItem.stack); + this.DoCoins(j); + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + return new Item(); + } + } + } + for (int k = num - 1; k >= 0; k--) + { + if (this.inventory[k].type == 0) + { + this.inventory[k] = item; + ItemText.NewText(newItem, newItem.stack); + this.DoCoins(k); + Main.PlaySound(7, (int)this.position.X, (int)this.position.Y, 1); + if (plr == Main.myPlayer) + { + Recipe.FindRecipes(); + } + return new Item(); + } + } + return item; + } + public void PlaceThing() + { + if ((this.inventory[this.selectedItem].type == 1071 || this.inventory[this.selectedItem].type == 1543) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY) + { + int num = Player.tileTargetX; + int num2 = Player.tileTargetY; + if (Main.tile[num, num2] != null && Main.tile[num, num2].active()) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + int num3 = -1; + int num4 = -1; + for (int i = 0; i < 58; i++) + { + if (this.inventory[i].stack > 0 && this.inventory[i].paint > 0) + { + num3 = (int)this.inventory[i].paint; + num4 = i; + break; + } + } + if (num3 > 0 && (int)Main.tile[num, num2].color() != num3 && WorldGen.paintTile(num, num2, (byte)num3, true)) + { + int num5 = num4; + this.inventory[num5].stack--; + if (this.inventory[num5].stack <= 0) + { + this.inventory[num5].SetDefaults(0, false); + } + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + } + } + if ((this.inventory[this.selectedItem].type == 1072 || this.inventory[this.selectedItem].type == 1544) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY) + { + int num6 = Player.tileTargetX; + int num7 = Player.tileTargetY; + if (Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + int num8 = -1; + int num9 = -1; + for (int j = 0; j < 58; j++) + { + if (this.inventory[j].stack > 0 && this.inventory[j].paint > 0) + { + num8 = (int)this.inventory[j].paint; + num9 = j; + break; + } + } + if (num8 > 0 && (int)Main.tile[num6, num7].wallColor() != num8 && WorldGen.paintWall(num6, num7, (byte)num8, true)) + { + int num10 = num9; + this.inventory[num10].stack--; + if (this.inventory[num10].stack <= 0) + { + this.inventory[num10].SetDefaults(0, false); + } + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + } + } + if ((this.inventory[this.selectedItem].type == 1100 || this.inventory[this.selectedItem].type == 1545) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY) + { + int num11 = Player.tileTargetX; + int num12 = Player.tileTargetY; + if (Main.tile[num11, num12] != null && ((Main.tile[num11, num12].wallColor() > 0 && Main.tile[num11, num12].wall > 0) || (Main.tile[num11, num12].color() > 0 && Main.tile[num11, num12].active()))) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + if (Main.tile[num11, num12].color() > 0 && Main.tile[num11, num12].active() && WorldGen.paintTile(num11, num12, 0, true)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + } + else + { + if (Main.tile[num11, num12].wallColor() > 0 && Main.tile[num11, num12].wall > 0 && WorldGen.paintWall(num11, num12, 0, true)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + } + } + } + if ((this.inventory[this.selectedItem].type == 929 || this.inventory[this.selectedItem].type == 1338) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY) + { + int num13 = Player.tileTargetX; + int num14 = Player.tileTargetY; + if (Main.tile[num13, num14].active() && Main.tile[num13, num14].type == 209) + { + int num15 = 0; + if (Main.tile[num13, num14].frameX < 72) + { + if (this.inventory[this.selectedItem].type == 929) + { + num15 = 1; + } + } + else + { + if (Main.tile[num13, num14].frameX < 144 && this.inventory[this.selectedItem].type == 1338) + { + num15 = 2; + } + } + if (num15 > 0) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + int k = (int)(Main.tile[num13, num14].frameX / 18); + int num16 = 0; + int num17 = 0; + while (k >= 4) + { + num16++; + k -= 4; + } + k = num13 - k; + int l; + for (l = (int)(Main.tile[num13, num14].frameY / 18); l >= 3; l -= 3) + { + num17++; + } + l = num14 - l; + this.itemTime = this.inventory[this.selectedItem].useTime; + float num18 = 14f; + float num19 = 0f; + float num20 = 0f; + int type = 162; + if (num15 == 2) + { + type = 281; + } + int damage = this.inventory[this.selectedItem].damage; + int num21 = 8; + if (num17 == 0) + { + num19 = 10f; + num20 = 0f; + } + if (num17 == 1) + { + num19 = 7.5f; + num20 = -2.5f; + } + if (num17 == 2) + { + num19 = 5f; + num20 = -5f; + } + if (num17 == 3) + { + num19 = 2.75f; + num20 = -6f; + } + if (num17 == 4) + { + num19 = 0f; + num20 = -10f; + } + if (num17 == 5) + { + num19 = -2.75f; + num20 = -6f; + } + if (num17 == 6) + { + num19 = -5f; + num20 = -5f; + } + if (num17 == 7) + { + num19 = -7.5f; + num20 = -2.5f; + } + if (num17 == 8) + { + num19 = -10f; + num20 = 0f; + } + Vector2 vector = new Vector2((float)((k + 2) * 16), (float)((l + 2) * 16)); + float num22 = num19; + float num23 = num20; + float num24 = (float)Math.Sqrt((double)(num22 * num22 + num23 * num23)); + num24 = num18 / num24; + num22 *= num24; + num23 *= num24; + Projectile.NewProjectile(vector.X, vector.Y, num22, num23, type, damage, (float)num21, Main.myPlayer, 0f, 0f); + } + } + } + } + if ((this.inventory[this.selectedItem].type == 424 || this.inventory[this.selectedItem].type == 1103) && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == 219) + { + if (this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY && this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + this.inventory[this.selectedItem].stack--; + if (this.inventory[this.selectedItem].stack <= 0) + { + this.inventory[this.selectedItem].SetDefaults(0, false); + } + if (this.selectedItem == 48) + { + Main.mouseItem = this.inventory[this.selectedItem]; + } + Main.PlaySound(7, -1, -1, 1); + int num25 = 1; + int num26; + if (Main.rand.Next(5000) == 0) + { + num26 = 1242; + } + else + { + if (Main.rand.Next(25) == 0) + { + num26 = Main.rand.Next(6); + if (num26 == 0) + { + num26 = 181; + } + else + { + if (num26 == 1) + { + num26 = 180; + } + else + { + if (num26 == 2) + { + num26 = 177; + } + else + { + if (num26 == 3) + { + num26 = 179; + } + else + { + if (num26 == 4) + { + num26 = 178; + } + else + { + num26 = 182; + } + } + } + } + } + if (Main.rand.Next(20) == 0) + { + num25 += Main.rand.Next(0, 2); + } + if (Main.rand.Next(30) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(40) == 0) + { + num25 += Main.rand.Next(0, 4); + } + if (Main.rand.Next(50) == 0) + { + num25 += Main.rand.Next(0, 5); + } + if (Main.rand.Next(60) == 0) + { + num25 += Main.rand.Next(0, 6); + } + } + else + { + if (Main.rand.Next(50) == 0) + { + num26 = 999; + if (Main.rand.Next(20) == 0) + { + num25 += Main.rand.Next(0, 2); + } + if (Main.rand.Next(30) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(40) == 0) + { + num25 += Main.rand.Next(0, 4); + } + if (Main.rand.Next(50) == 0) + { + num25 += Main.rand.Next(0, 5); + } + if (Main.rand.Next(60) == 0) + { + num25 += Main.rand.Next(0, 6); + } + } + else + { + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(5000) == 0) + { + num26 = 74; + if (Main.rand.Next(10) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(10) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(10) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(10) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(10) == 0) + { + num25 += Main.rand.Next(0, 3); + } + } + else + { + if (Main.rand.Next(400) == 0) + { + num26 = 73; + if (Main.rand.Next(5) == 0) + { + num25 += Main.rand.Next(1, 21); + } + if (Main.rand.Next(5) == 0) + { + num25 += Main.rand.Next(1, 21); + } + if (Main.rand.Next(5) == 0) + { + num25 += Main.rand.Next(1, 21); + } + if (Main.rand.Next(5) == 0) + { + num25 += Main.rand.Next(1, 21); + } + if (Main.rand.Next(5) == 0) + { + num25 += Main.rand.Next(1, 20); + } + } + else + { + if (Main.rand.Next(30) == 0) + { + num26 = 72; + if (Main.rand.Next(3) == 0) + { + num25 += Main.rand.Next(5, 26); + } + if (Main.rand.Next(3) == 0) + { + num25 += Main.rand.Next(5, 26); + } + if (Main.rand.Next(3) == 0) + { + num25 += Main.rand.Next(5, 26); + } + if (Main.rand.Next(3) == 0) + { + num25 += Main.rand.Next(5, 25); + } + } + else + { + num26 = 71; + if (Main.rand.Next(2) == 0) + { + num25 += Main.rand.Next(10, 26); + } + if (Main.rand.Next(2) == 0) + { + num25 += Main.rand.Next(10, 26); + } + if (Main.rand.Next(2) == 0) + { + num25 += Main.rand.Next(10, 26); + } + if (Main.rand.Next(2) == 0) + { + num25 += Main.rand.Next(10, 25); + } + } + } + } + } + else + { + num26 = Main.rand.Next(8); + if (num26 == 0) + { + num26 = 12; + } + else + { + if (num26 == 1) + { + num26 = 11; + } + else + { + if (num26 == 2) + { + num26 = 14; + } + else + { + if (num26 == 3) + { + num26 = 13; + } + else + { + if (num26 == 4) + { + num26 = 699; + } + else + { + if (num26 == 5) + { + num26 = 700; + } + else + { + if (num26 == 6) + { + num26 = 701; + } + else + { + num26 = 702; + } + } + } + } + } + } + } + if (Main.rand.Next(20) == 0) + { + num25 += Main.rand.Next(0, 2); + } + if (Main.rand.Next(30) == 0) + { + num25 += Main.rand.Next(0, 3); + } + if (Main.rand.Next(40) == 0) + { + num25 += Main.rand.Next(0, 4); + } + if (Main.rand.Next(50) == 0) + { + num25 += Main.rand.Next(0, 5); + } + if (Main.rand.Next(60) == 0) + { + num25 += Main.rand.Next(0, 6); + } + } + } + } + } + if (num26 > 0) + { + int number = Item.NewItem((int)Main.screenPosition.X + Main.mouseX, (int)Main.screenPosition.Y + Main.mouseY, 1, 1, num26, num25, false, -1, false); + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", number, 1f, 0f, 0f, 0); + } + } + } + } + else + { + if (this.inventory[this.selectedItem].createTile >= 0 && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY) + { + this.showItemIcon = true; + bool flag = false; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid > 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) + { + if (Main.tileSolid[this.inventory[this.selectedItem].createTile]) + { + flag = true; + } + else + { + if (Main.tileLavaDeath[this.inventory[this.selectedItem].createTile]) + { + flag = true; + } + } + } + bool flag2 = true; + if (this.inventory[this.selectedItem].tileWand > 0) + { + int tileWand = this.inventory[this.selectedItem].tileWand; + flag2 = false; + for (int m = 0; m < 58; m++) + { + if (tileWand == this.inventory[m].type && this.inventory[m].stack > 0) + { + flag2 = true; + break; + } + } + } + if (Main.tileRope[this.inventory[this.selectedItem].createTile] && flag2 && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tileRope[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + int num27 = Player.tileTargetY; + int num28 = Player.tileTargetX; + int createTile = this.inventory[this.selectedItem].createTile; + while (Main.tile[num28, num27].active() && (int)Main.tile[num28, num27].type == createTile && num27 < Main.maxTilesX - 5) + { + num27++; + if (Main.tile[num28, num27] == null) + { + flag2 = false; + num27 = Player.tileTargetY; + } + } + if (!Main.tile[num28, num27].active()) + { + Player.tileTargetY = num27; + } + } + if (flag2 && ((!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && !flag) || Main.tileCut[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] || this.inventory[this.selectedItem].createTile == 23 || this.inventory[this.selectedItem].createTile == 2 || this.inventory[this.selectedItem].createTile == 109 || this.inventory[this.selectedItem].createTile == 60 || this.inventory[this.selectedItem].createTile == 70) && this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + bool flag3 = false; + if (this.inventory[this.selectedItem].createTile == 23 || this.inventory[this.selectedItem].createTile == 2 || this.inventory[this.selectedItem].createTile == 109) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == 0) + { + flag3 = true; + } + } + else + { + if (this.inventory[this.selectedItem].createTile == 227) + { + flag3 = true; + } + else + { + if (this.inventory[this.selectedItem].createTile == 60 || this.inventory[this.selectedItem].createTile == 70) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == 59) + { + flag3 = true; + } + } + else + { + if (this.inventory[this.selectedItem].createTile == 4 || this.inventory[this.selectedItem].createTile == 136) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].wall > 0) + { + flag3 = true; + } + else + { + if (!WorldGen.SolidTileNotDoor(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNotDoor(Player.tileTargetX - 1, Player.tileTargetY) && !WorldGen.SolidTileNotDoor(Player.tileTargetX + 1, Player.tileTargetY)) + { + if (!WorldGen.SolidTileNotDoor(Player.tileTargetX, Player.tileTargetY + 1) && (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].halfBrick() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].slope() != 0)) + { + WorldGen.SlopeTile(Player.tileTargetX, Player.tileTargetY + 1, 0); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 14, (float)Player.tileTargetX, (float)(Player.tileTargetY + 1), 0f, 0); + } + } + else + { + if (!WorldGen.SolidTileNotDoor(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNotDoor(Player.tileTargetX - 1, Player.tileTargetY) && (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].halfBrick() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].slope() != 0)) + { + WorldGen.SlopeTile(Player.tileTargetX - 1, Player.tileTargetY, 0); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 14, (float)(Player.tileTargetX - 1), (float)Player.tileTargetY, 0f, 0); + } + } + else + { + if (!WorldGen.SolidTileNotDoor(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNotDoor(Player.tileTargetX - 1, Player.tileTargetY) && !WorldGen.SolidTileNotDoor(Player.tileTargetX + 1, Player.tileTargetY) && (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].halfBrick() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].slope() != 0)) + { + WorldGen.SlopeTile(Player.tileTargetX + 1, Player.tileTargetY, 0); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 14, (float)(Player.tileTargetX + 1), (float)Player.tileTargetY, 0f, 0); + } + } + } + } + } + int num29 = (int)Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].halfBrick()) + { + num29 = -1; + } + int num30 = (int)Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type; + int num31 = (int)Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type; + int num32 = (int)Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].type; + int num33 = (int)Main.tile[Player.tileTargetX + 1, Player.tileTargetY - 1].type; + int num34 = (int)Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].type; + int num35 = (int)Main.tile[Player.tileTargetX + 1, Player.tileTargetY + 1].type; + if (!Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive()) + { + num29 = -1; + } + if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY].nactive()) + { + num30 = -1; + } + if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY].nactive()) + { + num31 = -1; + } + if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].nactive()) + { + num32 = -1; + } + if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY - 1].nactive()) + { + num33 = -1; + } + if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY + 1].nactive()) + { + num34 = -1; + } + if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY + 1].nactive()) + { + num35 = -1; + } + if (num29 >= 0 && Main.tileSolid[num29] && !Main.tileNoAttach[num29]) + { + flag3 = true; + } + else + { + if ((num30 >= 0 && Main.tileSolid[num30] && !Main.tileNoAttach[num30]) || (num30 == 5 && num32 == 5 && num34 == 5) || num30 == 124) + { + flag3 = true; + } + else + { + if ((num31 >= 0 && Main.tileSolid[num31] && !Main.tileNoAttach[num31]) || (num31 == 5 && num33 == 5 && num35 == 5) || num31 == 124) + { + flag3 = true; + } + } + } + } + } + else + { + if (this.inventory[this.selectedItem].createTile == 78 || this.inventory[this.selectedItem].createTile == 98 || this.inventory[this.selectedItem].createTile == 100 || this.inventory[this.selectedItem].createTile == 173 || this.inventory[this.selectedItem].createTile == 174) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive() && (Main.tileSolid[(int)Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type] || Main.tileTable[(int)Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type])) + { + flag3 = true; + } + } + else + { + if (this.inventory[this.selectedItem].createTile == 13 || this.inventory[this.selectedItem].createTile == 29 || this.inventory[this.selectedItem].createTile == 33 || this.inventory[this.selectedItem].createTile == 49 || this.inventory[this.selectedItem].createTile == 50 || this.inventory[this.selectedItem].createTile == 103) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive() && Main.tileTable[(int)Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) + { + flag3 = true; + } + } + else + { + if (this.inventory[this.selectedItem].createTile == 51) + { + if (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall > 0 || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall > 0 || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall > 0 || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall > 0) + { + flag3 = true; + } + } + else + { + if ((Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() && (Main.tileSolid[(int)Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type] || Main.tileRope[(int)Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type])) || (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall > 0 || (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() && (Main.tileSolid[(int)Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type] || Main.tileRope[(int)Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type]))) || (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall > 0 || (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && (Main.tileSolid[(int)Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type] || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == 124 || Main.tileRope[(int)Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]))) || (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall > 0 || (Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() && (Main.tileSolid[(int)Main.tile[Player.tileTargetX, Player.tileTargetY - 1].type] || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].type == 124 || Main.tileRope[(int)Main.tile[Player.tileTargetX, Player.tileTargetY - 1].type]))) || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall > 0) + { + flag3 = true; + } + } + } + } + } + } + } + } + if (Main.tileAlch[this.inventory[this.selectedItem].createTile]) + { + flag3 = true; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tileCut[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + if ((int)Main.tile[Player.tileTargetX, Player.tileTargetY].type != this.inventory[this.selectedItem].createTile) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type != 78) + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, false, false, false); + if (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 4, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + else + { + flag3 = false; + } + } + else + { + flag3 = false; + } + } + if (flag3) + { + int num36 = this.inventory[this.selectedItem].placeStyle; + if (this.inventory[this.selectedItem].createTile == 212 && this.direction > 0) + { + num36 = 1; + } + if (this.inventory[this.selectedItem].createTile == 141) + { + num36 = Main.rand.Next(2); + } + if (this.inventory[this.selectedItem].createTile == 128) + { + if (this.direction < 0) + { + num36 = -1; + } + else + { + num36 = 1; + } + } + if (this.inventory[this.selectedItem].createTile == 241 && this.inventory[this.selectedItem].placeStyle == 0) + { + num36 = Main.rand.Next(0, 9); + } + if (WorldGen.PlaceTile(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createTile, false, false, this.whoAmi, num36)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 1, (float)Player.tileTargetX, (float)Player.tileTargetY, (float)this.inventory[this.selectedItem].createTile, num36); + } + if (this.inventory[this.selectedItem].createTile == 15) + { + if (this.direction == 1) + { + Tile expr_2584 = Main.tile[Player.tileTargetX, Player.tileTargetY]; + expr_2584.frameX += 18; + Tile expr_25A9 = Main.tile[Player.tileTargetX, Player.tileTargetY - 1]; + expr_25A9.frameX += 18; + } + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, Player.tileTargetX - 1, Player.tileTargetY - 1, 3); + } + } + else + { + if (this.inventory[this.selectedItem].createTile == 137) + { + if (this.direction == 1) + { + Tile expr_2613 = Main.tile[Player.tileTargetX, Player.tileTargetY]; + expr_2613.frameX += 18; + } + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); + } + } + else + { + if ((this.inventory[this.selectedItem].createTile == 79 || this.inventory[this.selectedItem].createTile == 90) && Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 5); + } + } + } + if (Main.tileSolid[this.inventory[this.selectedItem].createTile]) + { + int num37 = Player.tileTargetX; + int num38 = Player.tileTargetY + 1; + if (Main.tile[num37, num38] != null && (Main.tile[num37, num38].slope() != 0 || Main.tile[num37, num38].halfBrick())) + { + WorldGen.SlopeTile(num37, num38, 0); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 14, (float)num37, (float)num38, 0f, 0); + } + } + } + } + } + } + } + } + if (this.inventory[this.selectedItem].createWall >= 0 && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f >= (float)Player.tileTargetY) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem && (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall > 0 || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall > 0 || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall > 0 || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall > 0) && (int)Main.tile[Player.tileTargetX, Player.tileTargetY].wall != this.inventory[this.selectedItem].createWall) + { + WorldGen.PlaceWall(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createWall, false); + if ((int)Main.tile[Player.tileTargetX, Player.tileTargetY].wall == this.inventory[this.selectedItem].createWall) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 3, (float)Player.tileTargetX, (float)Player.tileTargetY, (float)this.inventory[this.selectedItem].createWall, 0); + } + if (this.inventory[this.selectedItem].stack > 1) + { + int createWall = this.inventory[this.selectedItem].createWall; + for (int n = 0; n < 4; n++) + { + int num39 = Player.tileTargetX; + int num40 = Player.tileTargetY; + if (n == 0) + { + num39--; + } + if (n == 1) + { + num39++; + } + if (n == 2) + { + num40--; + } + if (n == 3) + { + num40++; + } + if (Main.tile[num39, num40].wall == 0) + { + int num41 = 0; + for (int num42 = 0; num42 < 4; num42++) + { + int num43 = num39; + int num44 = num40; + if (num42 == 0) + { + num43--; + } + if (num42 == 1) + { + num43++; + } + if (num42 == 2) + { + num44--; + } + if (num42 == 3) + { + num44++; + } + if ((int)Main.tile[num43, num44].wall == createWall) + { + num41++; + } + } + if (num41 == 4) + { + WorldGen.PlaceWall(num39, num40, createWall, false); + if ((int)Main.tile[num39, num40].wall == createWall) + { + this.inventory[this.selectedItem].stack--; + if (this.inventory[this.selectedItem].stack == 0) + { + this.inventory[this.selectedItem].SetDefaults(0, false); + } + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 3, (float)num39, (float)num40, (float)createWall, 0); + } + } + } + } + } + } + } + } + } + } + public void ChangeDir(int dir) + { + if (!this.pulley || this.pulleyDir != 2) + { + this.direction = dir; + return; + } + if (this.pulleyDir == 2 && dir == this.direction) + { + return; + } + int num = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num2 = num * 16 + 8 - this.width / 2; + if (!Collision.SolidCollision(new Vector2((float)num2, this.position.Y), this.width, this.height)) + { + if (this.whoAmi == Main.myPlayer) + { + Main.cameraX = Main.cameraX + this.position.X - (float)num2; + } + this.pulleyDir = 1; + this.position.X = (float)num2; + this.direction = dir; + } + } + public Vector2 center() + { + return new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)); + } + public Rectangle getRect() + { + return new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + } + public void ItemCheck(int i) + { + if (this.frozen) + { + return; + } + bool flag = false; + int num = this.inventory[this.selectedItem].damage; + if (num > 0) + { + if (this.inventory[this.selectedItem].melee) + { + num = (int)((float)num * this.meleeDamage); + } + else + { + if (this.inventory[this.selectedItem].ranged) + { + num = (int)((float)num * this.rangedDamage); + if (this.inventory[this.selectedItem].useAmmo == 1) + { + num = (int)((float)num * this.arrowDamage); + } + if (this.inventory[this.selectedItem].useAmmo == 14) + { + num = (int)((float)num * this.bulletDamage); + } + if (this.inventory[this.selectedItem].useAmmo == 771 || this.inventory[this.selectedItem].useAmmo == 246) + { + num = (int)((float)num * this.rocketDamage); + } + } + else + { + if (this.inventory[this.selectedItem].magic) + { + num = (int)((float)num * this.magicDamage); + } + } + } + } + if (this.inventory[this.selectedItem].autoReuse && !this.noItems) + { + this.releaseUseItem = true; + if (this.itemAnimation == 1 && this.inventory[this.selectedItem].stack > 0) + { + if (this.inventory[this.selectedItem].shoot > 0 && this.whoAmi != Main.myPlayer && this.controlUseItem) + { + this.itemAnimation = 2; + } + else + { + this.itemAnimation = 0; + } + } + } + if (this.itemAnimation == 0 && this.reuseDelay > 0) + { + this.itemAnimation = this.reuseDelay; + this.itemTime = this.reuseDelay; + this.reuseDelay = 0; + } + if (this.controlUseItem && this.releaseUseItem && (this.inventory[this.selectedItem].headSlot > 0 || this.inventory[this.selectedItem].bodySlot > 0 || this.inventory[this.selectedItem].legSlot > 0)) + { + if (this.inventory[this.selectedItem].useStyle == 0) + { + this.releaseUseItem = false; + } + if (this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f >= (float)Player.tileTargetY) + { + int num2 = Player.tileTargetX; + int num3 = Player.tileTargetY; + if (Main.tile[num2, num3].active() && Main.tile[num2, num3].type == 128) + { + int num4 = (int)Main.tile[num2, num3].frameY; + int j = 0; + if (this.inventory[this.selectedItem].bodySlot >= 0) + { + j = 1; + } + if (this.inventory[this.selectedItem].legSlot >= 0) + { + j = 2; + } + num4 /= 18; + while (j > num4) + { + num3++; + num4 = (int)Main.tile[num2, num3].frameY; + num4 /= 18; + } + while (j < num4) + { + num3--; + num4 = (int)Main.tile[num2, num3].frameY; + num4 /= 18; + } + int k; + for (k = (int)Main.tile[num2, num3].frameX; k >= 100; k -= 100) + { + } + if (k >= 36) + { + k -= 36; + } + num2 -= k / 18; + int l = (int)Main.tile[num2, num3].frameX; + WorldGen.KillTile(num2, num3, true, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num2, (float)num3, 1f, 0); + } + while (l >= 100) + { + l -= 100; + } + if (num4 == 0 && this.inventory[this.selectedItem].headSlot >= 0) + { + Main.tile[num2, num3].frameX = (short)(l + this.inventory[this.selectedItem].headSlot * 100); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num2, num3, 1); + } + this.inventory[this.selectedItem].SetDefaults(0, false); + Main.mouseItem.SetDefaults(0, false); + this.releaseUseItem = false; + this.mouseInterface = true; + } + else + { + if (num4 == 1 && this.inventory[this.selectedItem].bodySlot >= 0) + { + Main.tile[num2, num3].frameX = (short)(l + this.inventory[this.selectedItem].bodySlot * 100); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num2, num3, 1); + } + this.inventory[this.selectedItem].SetDefaults(0, false); + Main.mouseItem.SetDefaults(0, false); + this.releaseUseItem = false; + this.mouseInterface = true; + } + else + { + if (num4 == 2 && this.inventory[this.selectedItem].legSlot >= 0) + { + Main.tile[num2, num3].frameX = (short)(l + this.inventory[this.selectedItem].legSlot * 100); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num2, num3, 1); + } + this.inventory[this.selectedItem].SetDefaults(0, false); + Main.mouseItem.SetDefaults(0, false); + this.releaseUseItem = false; + this.mouseInterface = true; + } + } + } + } + } + } + if (this.controlUseItem && this.itemAnimation == 0 && this.releaseUseItem && this.inventory[this.selectedItem].useStyle > 0) + { + bool flag2 = true; + if (this.inventory[this.selectedItem].shoot == 0) + { + this.itemRotation = 0f; + } + if (this.wet && (this.inventory[this.selectedItem].shoot == 85 || this.inventory[this.selectedItem].shoot == 15 || this.inventory[this.selectedItem].shoot == 34)) + { + flag2 = false; + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 603 && !Main.cEd) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].type == 1071 || this.inventory[this.selectedItem].type == 1072) + { + bool flag3 = false; + for (int m = 0; m < 58; m++) + { + if (this.inventory[m].paint > 0) + { + flag3 = true; + break; + } + } + if (!flag3) + { + flag2 = false; + } + } + if (this.noItems) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].tileWand > 0) + { + int tileWand = this.inventory[this.selectedItem].tileWand; + flag2 = false; + for (int n = 0; n < 58; n++) + { + if (tileWand == this.inventory[n].type && this.inventory[n].stack > 0) + { + flag2 = true; + break; + } + } + } + if (this.inventory[this.selectedItem].shoot == 6 || this.inventory[this.selectedItem].shoot == 19 || this.inventory[this.selectedItem].shoot == 33 || this.inventory[this.selectedItem].shoot == 52 || this.inventory[this.selectedItem].shoot == 113 || this.inventory[this.selectedItem].shoot == 182) + { + for (int num5 = 0; num5 < 1000; num5++) + { + if (Main.projectile[num5].active && Main.projectile[num5].owner == Main.myPlayer && Main.projectile[num5].type == this.inventory[this.selectedItem].shoot) + { + flag2 = false; + } + } + } + if (this.inventory[this.selectedItem].shoot == 106) + { + int num6 = 0; + for (int num7 = 0; num7 < 1000; num7++) + { + if (Main.projectile[num7].active && Main.projectile[num7].owner == Main.myPlayer && Main.projectile[num7].type == this.inventory[this.selectedItem].shoot) + { + num6++; + } + } + if (num6 >= this.inventory[this.selectedItem].stack) + { + flag2 = false; + } + } + if (this.inventory[this.selectedItem].shoot == 272) + { + int num8 = 0; + for (int num9 = 0; num9 < 1000; num9++) + { + if (Main.projectile[num9].active && Main.projectile[num9].owner == Main.myPlayer && Main.projectile[num9].type == this.inventory[this.selectedItem].shoot) + { + num8++; + } + } + if (num8 >= this.inventory[this.selectedItem].stack) + { + flag2 = false; + } + } + if (this.inventory[this.selectedItem].shoot == 13 || this.inventory[this.selectedItem].shoot == 32 || (this.inventory[this.selectedItem].shoot >= 230 && this.inventory[this.selectedItem].shoot <= 235)) + { + for (int num10 = 0; num10 < 1000; num10++) + { + if (Main.projectile[num10].active && Main.projectile[num10].owner == Main.myPlayer && Main.projectile[num10].type == this.inventory[this.selectedItem].shoot && Main.projectile[num10].ai[0] != 2f) + { + flag2 = false; + } + } + } + if (this.inventory[this.selectedItem].potion && flag2) + { + if (this.potionDelay <= 0) + { + this.potionDelay = this.potionDelayTime; + this.AddBuff(21, this.potionDelay, true); + } + else + { + flag2 = false; + } + } + if (this.inventory[this.selectedItem].mana > 0 && this.silence) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].mana > 0 && flag2) + { + if (this.inventory[this.selectedItem].type != 127 || !this.spaceGun) + { + if (this.statMana >= (int)((float)this.inventory[this.selectedItem].mana * this.manaCost)) + { + this.statMana -= (int)((float)this.inventory[this.selectedItem].mana * this.manaCost); + } + else + { + if (this.manaFlower) + { + this.QuickMana(); + if (this.statMana >= (int)((float)this.inventory[this.selectedItem].mana * this.manaCost)) + { + this.statMana -= (int)((float)this.inventory[this.selectedItem].mana * this.manaCost); + } + else + { + flag2 = false; + } + } + else + { + flag2 = false; + } + } + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].buffType != 0 && flag2) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, this.inventory[this.selectedItem].buffTime, true); + } + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 603 && Main.cEd) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 669) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 115) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 425) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 753) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 994) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1169) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1170) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1171) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1172) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1180) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1181) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1182) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1183) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1242) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1157) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1309) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1311) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.whoAmi == Main.myPlayer && this.inventory[this.selectedItem].type == 1312) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, 3600, true); + } + if (this.inventory[this.selectedItem].type == 43 && Main.dayTime) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].type == 544 && Main.dayTime) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].type == 556 && Main.dayTime) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].type == 557 && Main.dayTime) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].type == 70 && !this.zoneEvil) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].type == 1133 && !this.zoneJungle) + { + flag2 = false; + } + if (this.inventory[this.selectedItem].shoot == 17 && flag2 && i == Main.myPlayer) + { + int num11 = (int)((float)Main.mouseX + Main.screenPosition.X) / 16; + int num12 = (int)((float)Main.mouseY + Main.screenPosition.Y) / 16; + if (Main.tile[num11, num12].active() && (Main.tile[num11, num12].type == 0 || Main.tile[num11, num12].type == 2 || Main.tile[num11, num12].type == 23)) + { + WorldGen.KillTile(num11, num12, false, false, true); + if (!Main.tile[num11, num12].active()) + { + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 4, (float)num11, (float)num12, 0f, 0); + } + } + else + { + flag2 = false; + } + } + else + { + flag2 = false; + } + } + if (flag2 && this.inventory[this.selectedItem].useAmmo > 0) + { + flag2 = false; + for (int num13 = 0; num13 < 58; num13++) + { + if (this.inventory[num13].ammo == this.inventory[this.selectedItem].useAmmo && this.inventory[num13].stack > 0) + { + flag2 = true; + break; + } + } + } + if (flag2) + { + if (this.inventory[this.selectedItem].pick > 0 || this.inventory[this.selectedItem].axe > 0 || this.inventory[this.selectedItem].hammer > 0) + { + this.toolTime = 1; + } + if (this.grappling[0] > -1) + { + this.pulley = false; + this.pulleyDir = 1; + if (this.controlRight) + { + this.direction = 1; + } + else + { + if (this.controlLeft) + { + this.direction = -1; + } + } + } + this.channel = this.inventory[this.selectedItem].channel; + this.attackCD = 0; + if (this.inventory[this.selectedItem].melee) + { + this.itemAnimation = (int)((float)this.inventory[this.selectedItem].useAnimation * this.meleeSpeed); + this.itemAnimationMax = (int)((float)this.inventory[this.selectedItem].useAnimation * this.meleeSpeed); + } + else + { + this.itemAnimation = this.inventory[this.selectedItem].useAnimation; + this.itemAnimationMax = this.inventory[this.selectedItem].useAnimation; + this.reuseDelay = this.inventory[this.selectedItem].reuseDelay; + } + if (this.inventory[this.selectedItem].useSound > 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, this.inventory[this.selectedItem].useSound); + } + } + if (flag2 && (this.inventory[this.selectedItem].shoot == 18 || this.inventory[this.selectedItem].shoot == 72 || this.inventory[this.selectedItem].shoot == 86 || this.inventory[this.selectedItem].shoot == 86 || Main.projPet[this.inventory[this.selectedItem].shoot])) + { + if ((this.inventory[this.selectedItem].shoot >= 191 && this.inventory[this.selectedItem].shoot <= 194) || this.inventory[this.selectedItem].shoot == 266) + { + int num14 = 0; + int num15 = -1; + int num16 = -1; + for (int num17 = 0; num17 < 1000; num17++) + { + if (Main.projectile[num17].active && Main.projectile[num17].owner == i && Main.projectile[num17].minion) + { + num14++; + if (num15 == -1 || Main.projectile[num17].timeLeft < num15) + { + num16 = num17; + num15 = Main.projectile[num17].timeLeft; + } + } + } + if (num14 >= this.maxMinions) + { + Main.projectile[num16].Kill(); + } + } + else + { + for (int num18 = 0; num18 < 1000; num18++) + { + if (Main.projectile[num18].active && Main.projectile[num18].owner == i && Main.projectile[num18].type == this.inventory[this.selectedItem].shoot) + { + Main.projectile[num18].Kill(); + } + if (this.inventory[this.selectedItem].shoot == 72) + { + if (Main.projectile[num18].active && Main.projectile[num18].owner == i && Main.projectile[num18].type == 86) + { + Main.projectile[num18].Kill(); + } + if (Main.projectile[num18].active && Main.projectile[num18].owner == i && Main.projectile[num18].type == 87) + { + Main.projectile[num18].Kill(); + } + } + } + } + } + } + if (!this.controlUseItem) + { + bool arg_176A_0 = this.channel; + this.channel = false; + } + if (this.itemAnimation > 0) + { + if (this.inventory[this.selectedItem].melee) + { + this.itemAnimationMax = (int)((float)this.inventory[this.selectedItem].useAnimation * this.meleeSpeed); + } + else + { + this.itemAnimationMax = this.inventory[this.selectedItem].useAnimation; + } + if (this.inventory[this.selectedItem].mana > 0 && !flag && (this.inventory[this.selectedItem].type != 127 || !this.spaceGun)) + { + this.manaRegenDelay = (int)this.maxRegenDelay; + } + if (Main.dedServ) + { + this.itemHeight = this.inventory[this.selectedItem].height; + this.itemWidth = this.inventory[this.selectedItem].width; + } + else + { + this.itemHeight = Main.itemTexture[this.inventory[this.selectedItem].type].Height; + this.itemWidth = Main.itemTexture[this.inventory[this.selectedItem].type].Width; + } + this.itemAnimation--; + if (!Main.dedServ) + { + if (this.inventory[this.selectedItem].useStyle == 1) + { + if ((double)this.itemAnimation < (double)this.itemAnimationMax * 0.333) + { + float num19 = 10f; + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width > 32) + { + num19 = 14f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 52) + { + num19 = 24f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 64) + { + num19 = 28f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 92) + { + num19 = 38f; + } + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - num19) * (float)this.direction; + this.itemLocation.Y = this.position.Y + 24f; + } + else + { + if ((double)this.itemAnimation < (double)this.itemAnimationMax * 0.666) + { + float num20 = 10f; + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width > 32) + { + num20 = 18f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 52) + { + num20 = 24f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 64) + { + num20 = 28f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 92) + { + num20 = 38f; + } + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - num20) * (float)this.direction; + num20 = 10f; + if (Main.itemTexture[this.inventory[this.selectedItem].type].Height > 32) + { + num20 = 8f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Height >= 32) + { + num20 = 12f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Height > 64) + { + num20 = 14f; + } + this.itemLocation.Y = this.position.Y + num20; + } + else + { + float num21 = 6f; + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width > 32) + { + num21 = 14f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 52) + { + num21 = 24f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 64) + { + num21 = 28f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Width >= 92) + { + num21 = 38f; + } + this.itemLocation.X = this.position.X + (float)this.width * 0.5f - ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - num21) * (float)this.direction; + num21 = 10f; + if (Main.itemTexture[this.inventory[this.selectedItem].type].Height > 32) + { + num21 = 10f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Height > 52) + { + num21 = 12f; + } + if (Main.itemTexture[this.inventory[this.selectedItem].type].Height > 64) + { + num21 = 14f; + } + this.itemLocation.Y = this.position.Y + num21; + } + } + this.itemRotation = ((float)this.itemAnimation / (float)this.itemAnimationMax - 0.5f) * (float)(-(float)this.direction) * 3.5f - (float)this.direction * 0.3f; + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 2) + { + this.itemRotation = (float)this.itemAnimation / (float)this.itemAnimationMax * (float)this.direction * 2f + -1.4f * (float)this.direction; + if ((double)this.itemAnimation < (double)this.itemAnimationMax * 0.5) + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - 9f - this.itemRotation * 12f * (float)this.direction) * (float)this.direction; + this.itemLocation.Y = this.position.Y + 38f + this.itemRotation * (float)this.direction * 4f; + } + else + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - 9f - this.itemRotation * 16f * (float)this.direction) * (float)this.direction; + this.itemLocation.Y = this.position.Y + 38f + this.itemRotation * (float)this.direction; + } + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 3) + { + if ((double)this.itemAnimation > (double)this.itemAnimationMax * 0.666) + { + this.itemLocation.X = -1000f; + this.itemLocation.Y = -1000f; + this.itemRotation = -1.3f * (float)this.direction; + } + else + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - 4f) * (float)this.direction; + this.itemLocation.Y = this.position.Y + 24f; + float num22 = (float)this.itemAnimation / (float)this.itemAnimationMax * (float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * (float)this.direction * this.inventory[this.selectedItem].scale * 1.2f - (float)(10 * this.direction); + if (num22 > -4f && this.direction == -1) + { + num22 = -8f; + } + if (num22 < 4f && this.direction == 1) + { + num22 = 8f; + } + this.itemLocation.X = this.itemLocation.X - num22; + this.itemRotation = 0.8f * (float)this.direction; + } + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 4) + { + this.itemRotation = 0f; + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - 9f - this.itemRotation * 14f * (float)this.direction - 4f) * (float)this.direction; + this.itemLocation.Y = this.position.Y + (float)Main.itemTexture[this.inventory[this.selectedItem].type].Height * 0.5f + 4f; + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 5) + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f - (float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - (float)(this.direction * 2); + this.itemLocation.Y = this.position.Y + (float)this.height * 0.5f - (float)Main.itemTexture[this.inventory[this.selectedItem].type].Height * 0.5f; + } + } + } + } + } + } + } + else + { + if (this.inventory[this.selectedItem].holdStyle == 1 && !this.pulley) + { + if (Main.dedServ) + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + 20f * (float)this.direction; + } + else + { + if (this.inventory[this.selectedItem].type == 930) + { + this.itemLocation.X = this.position.X + (float)(this.width / 2) * 0.5f - 12f - (float)(2 * this.direction); + float num23 = this.position.X + (float)(this.width / 2) + (float)(38 * this.direction); + if (this.direction == 1) + { + num23 -= 10f; + } + float num24 = this.position.Y + (float)(this.height / 2) - 4f * this.gravDir; + if (this.gravDir == -1f) + { + num24 -= 8f; + } + int num25 = 0; + for (int num26 = 54; num26 < 58; num26++) + { + if (this.inventory[num26].stack > 0 && this.inventory[num26].ammo == 931) + { + num25 = this.inventory[num26].type; + break; + } + } + if (num25 == 0) + { + for (int num27 = 0; num27 < 54; num27++) + { + if (this.inventory[num27].stack > 0 && this.inventory[num27].ammo == 931) + { + num25 = this.inventory[num27].type; + break; + } + } + } + if (num25 == 931) + { + num25 = 127; + } + else + { + if (num25 == 1614) + { + num25 = 187; + } + } + if (num25 > 0) + { + int num28 = Dust.NewDust(new Vector2(num23, num24 + this.gfxOffY), 6, 6, num25, 0f, 0f, 100, default(Color), 1.6f); + Main.dust[num28].noGravity = true; + Dust expr_25CD_cp_0 = Main.dust[num28]; + expr_25CD_cp_0.velocity.Y = expr_25CD_cp_0.velocity.Y - 4f * this.gravDir; + } + } + else + { + if (this.inventory[this.selectedItem].type == 968) + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + (float)(8 * this.direction); + if (this.whoAmi == Main.myPlayer) + { + int num29 = (int)(this.itemLocation.X + (float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.8f * (float)this.direction) / 16; + int num30 = (int)(this.itemLocation.Y + (float)(Main.itemTexture[this.inventory[this.selectedItem].type].Height / 2)) / 16; + if (Main.tile[num29, num30] == null) + { + Main.tile[num29, num30] = new Tile(); + } + if (Main.tile[num29, num30].active() && Main.tile[num29, num30].type == 215) + { + this.miscTimer++; + if (Main.rand.Next(5) == 0) + { + this.miscTimer++; + } + if (this.miscTimer > 900) + { + this.miscTimer = 0; + this.inventory[this.selectedItem].SetDefaults(969, false); + if (this.selectedItem == 58) + { + Main.mouseItem.SetDefaults(969, false); + } + for (int num31 = 0; num31 < 58; num31++) + { + if (this.inventory[num31].type == this.inventory[this.selectedItem].type && num31 != this.selectedItem && this.inventory[num31].stack < this.inventory[num31].maxStack) + { + Main.PlaySound(7, -1, -1, 1); + this.inventory[num31].stack++; + this.inventory[this.selectedItem].SetDefaults(0, false); + if (this.selectedItem == 58) + { + Main.mouseItem.SetDefaults(0, false); + } + } + } + } + } + else + { + this.miscTimer = 0; + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 856) + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + (float)(4 * this.direction); + } + else + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + ((float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f + 2f) * (float)this.direction; + if (this.inventory[this.selectedItem].type == 282 || this.inventory[this.selectedItem].type == 286) + { + this.itemLocation.X = this.itemLocation.X - (float)(this.direction * 2); + this.itemLocation.Y = this.itemLocation.Y + 4f; + } + } + } + } + } + this.itemLocation.Y = this.position.Y + 24f; + if (this.inventory[this.selectedItem].type == 856) + { + this.itemLocation.Y = this.position.Y + 34f; + } + if (this.inventory[this.selectedItem].type == 930) + { + this.itemLocation.Y = this.position.Y + 9f; + } + this.itemRotation = 0f; + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + if (this.inventory[this.selectedItem].type == 930) + { + this.itemLocation.Y = this.itemLocation.Y - 24f; + } + } + } + else + { + if (this.inventory[this.selectedItem].holdStyle == 2 && !this.pulley) + { + if (this.inventory[this.selectedItem].type == 946) + { + this.itemRotation = 0f; + this.itemLocation.X = this.position.X + (float)this.width * 0.5f - (float)(16 * this.direction); + this.itemLocation.Y = this.position.Y + 22f; + this.fallStart = (int)(this.position.Y / 16f); + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + if (this.velocity.Y < -2f) + { + this.velocity.Y = -2f; + } + } + else + { + if (this.velocity.Y > 2f) + { + this.velocity.Y = 2f; + } + } + } + else + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f + (float)(6 * this.direction); + this.itemLocation.Y = this.position.Y + 16f; + this.itemRotation = 0.79f * (float)(-(float)this.direction); + if (this.gravDir == -1f) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = this.position.Y + (float)this.height + (this.position.Y - this.itemLocation.Y); + } + } + } + else + { + if (this.inventory[this.selectedItem].holdStyle == 3 && !this.pulley && !Main.dedServ) + { + this.itemLocation.X = this.position.X + (float)this.width * 0.5f - (float)Main.itemTexture[this.inventory[this.selectedItem].type].Width * 0.5f - (float)(this.direction * 2); + this.itemLocation.Y = this.position.Y + (float)this.height * 0.5f - (float)Main.itemTexture[this.inventory[this.selectedItem].type].Height * 0.5f; + this.itemRotation = 0f; + } + } + } + } + if ((((this.inventory[this.selectedItem].type == 974 || this.inventory[this.selectedItem].type == 8 || this.inventory[this.selectedItem].type == 1245 || (this.inventory[this.selectedItem].type >= 427 && this.inventory[this.selectedItem].type <= 433)) && !this.wet) || this.inventory[this.selectedItem].type == 523 || this.inventory[this.selectedItem].type == 1333) && !this.pulley) + { + float r = 1f; + float g = 0.95f; + float b = 0.8f; + int num32 = 0; + if (this.inventory[this.selectedItem].type == 523) + { + num32 = 8; + } + else + { + if (this.inventory[this.selectedItem].type == 974) + { + num32 = 9; + } + else + { + if (this.inventory[this.selectedItem].type == 1245) + { + num32 = 10; + } + else + { + if (this.inventory[this.selectedItem].type == 1333) + { + num32 = 11; + } + else + { + if (this.inventory[this.selectedItem].type >= 427) + { + num32 = this.inventory[this.selectedItem].type - 426; + } + } + } + } + } + if (num32 == 1) + { + r = 0f; + g = 0.1f; + b = 1.3f; + } + else + { + if (num32 == 2) + { + r = 1f; + g = 0.1f; + b = 0.1f; + } + else + { + if (num32 == 3) + { + r = 0f; + g = 1f; + b = 0.1f; + } + else + { + if (num32 == 4) + { + r = 0.9f; + g = 0f; + b = 0.9f; + } + else + { + if (num32 == 5) + { + r = 1.3f; + g = 1.3f; + b = 1.3f; + } + else + { + if (num32 == 6) + { + r = 0.9f; + g = 0.9f; + b = 0f; + } + else + { + if (num32 == 7) + { + r = 0.5f * Main.demonTorch + 1f * (1f - Main.demonTorch); + g = 0.3f; + b = 1f * Main.demonTorch + 0.5f * (1f - Main.demonTorch); + } + else + { + if (num32 == 8) + { + b = 0.7f; + r = 0.85f; + g = 1f; + } + else + { + if (num32 == 9) + { + b = 1f; + r = 0.7f; + g = 0.85f; + } + else + { + if (num32 == 10) + { + b = 0f; + r = 1f; + g = 0.5f; + } + else + { + if (num32 == 11) + { + b = 0.8f; + r = 1.25f; + g = 1.25f; + } + } + } + } + } + } + } + } + } + } + } + int num33 = num32; + if (num33 == 0) + { + num33 = 6; + } + else + { + if (num33 == 8) + { + num33 = 75; + } + else + { + if (num33 == 9) + { + num33 = 135; + } + else + { + if (num33 == 10) + { + num33 = 158; + } + else + { + if (num33 == 11) + { + num33 = 169; + } + else + { + num33 = 58 + num33; + } + } + } + } + } + int maxValue = 30; + if (this.itemAnimation > 0) + { + maxValue = 7; + } + if (this.direction == -1) + { + if (Main.rand.Next(maxValue) == 0) + { + int num34 = Dust.NewDust(new Vector2(this.itemLocation.X - 16f, this.itemLocation.Y - 14f * this.gravDir), 4, 4, num33, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num34].noGravity = true; + } + Main.dust[num34].velocity *= 0.3f; + Dust expr_314A_cp_0 = Main.dust[num34]; + expr_314A_cp_0.velocity.Y = expr_314A_cp_0.velocity.Y - 1.5f; + } + Lighting.addLight((int)((this.itemLocation.X - 12f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f + this.velocity.Y) / 16f), r, g, b); + } + else + { + if (Main.rand.Next(maxValue) == 0) + { + int num35 = Dust.NewDust(new Vector2(this.itemLocation.X + 6f, this.itemLocation.Y - 14f * this.gravDir), 4, 4, num33, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num35].noGravity = true; + } + Main.dust[num35].velocity *= 0.3f; + Dust expr_325D_cp_0 = Main.dust[num35]; + expr_325D_cp_0.velocity.Y = expr_325D_cp_0.velocity.Y - 1.5f; + } + Lighting.addLight((int)((this.itemLocation.X + 12f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f + this.velocity.Y) / 16f), r, g, b); + } + } + if (this.inventory[this.selectedItem].type == 105 && !this.wet && !this.pulley) + { + int maxValue2 = 20; + if (this.itemAnimation > 0) + { + maxValue2 = 7; + } + if (this.direction == -1) + { + if (Main.rand.Next(maxValue2) == 0) + { + int num36 = Dust.NewDust(new Vector2(this.itemLocation.X - 12f, this.itemLocation.Y - 20f * this.gravDir), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num36].noGravity = true; + } + Main.dust[num36].velocity *= 0.3f; + Dust expr_33B5_cp_0 = Main.dust[num36]; + expr_33B5_cp_0.velocity.Y = expr_33B5_cp_0.velocity.Y - 1.5f; + } + Lighting.addLight((int)((this.itemLocation.X - 16f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 1f, 0.95f, 0.8f); + } + else + { + if (Main.rand.Next(maxValue2) == 0) + { + int num37 = Dust.NewDust(new Vector2(this.itemLocation.X + 4f, this.itemLocation.Y - 20f * this.gravDir), 4, 4, 6, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num37].noGravity = true; + } + Main.dust[num37].velocity *= 0.3f; + Dust expr_34C4_cp_0 = Main.dust[num37]; + expr_34C4_cp_0.velocity.Y = expr_34C4_cp_0.velocity.Y - 1.5f; + } + Lighting.addLight((int)((this.itemLocation.X + 6f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 1f, 0.95f, 0.8f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 148 && !this.wet) + { + int maxValue3 = 10; + if (this.itemAnimation > 0) + { + maxValue3 = 7; + } + if (this.direction == -1) + { + if (Main.rand.Next(maxValue3) == 0) + { + int num38 = Dust.NewDust(new Vector2(this.itemLocation.X - 12f, this.itemLocation.Y - 20f * this.gravDir), 4, 4, 172, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num38].noGravity = true; + } + Main.dust[num38].velocity *= 0.3f; + Dust expr_361A_cp_0 = Main.dust[num38]; + expr_361A_cp_0.velocity.Y = expr_361A_cp_0.velocity.Y - 1.5f; + } + Lighting.addLight((int)((this.itemLocation.X - 16f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 0f, 0.5f, 1f); + } + else + { + if (Main.rand.Next(maxValue3) == 0) + { + int num39 = Dust.NewDust(new Vector2(this.itemLocation.X + 4f, this.itemLocation.Y - 20f * this.gravDir), 4, 4, 172, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num39].noGravity = true; + } + Main.dust[num39].velocity *= 0.3f; + Dust expr_372D_cp_0 = Main.dust[num39]; + expr_372D_cp_0.velocity.Y = expr_372D_cp_0.velocity.Y - 1.5f; + } + Lighting.addLight((int)((this.itemLocation.X + 6f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 0f, 0.5f, 1f); + } + } + } + if (this.inventory[this.selectedItem].type == 282 && !this.pulley) + { + if (this.direction == -1) + { + Lighting.addLight((int)((this.itemLocation.X - 16f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 0.7f, 1f, 0.8f); + } + else + { + Lighting.addLight((int)((this.itemLocation.X + 6f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 0.7f, 1f, 0.8f); + } + } + if (this.inventory[this.selectedItem].type == 286 && !this.pulley) + { + if (this.direction == -1) + { + Lighting.addLight((int)((this.itemLocation.X - 16f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 0.7f, 0.8f, 1f); + } + else + { + Lighting.addLight((int)((this.itemLocation.X + 6f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), 0.7f, 0.8f, 1f); + } + } + if (this.controlUseItem) + { + this.releaseUseItem = false; + } + else + { + this.releaseUseItem = true; + } + if (this.itemTime > 0) + { + this.itemTime--; + if (this.itemTime == 0 && this.whoAmi == Main.myPlayer) + { + int type = this.inventory[this.selectedItem].type; + if (type == 65 || type == 676 || type == 723 || type == 724 || type == 757 || type == 674 || type == 675 || type == 989 || type == 1226 || type == 1227) + { + Main.PlaySound(25, -1, -1, 1); + for (int num40 = 0; num40 < 5; num40++) + { + int num41 = Dust.NewDust(this.position, this.width, this.height, 45, 0f, 0f, 255, default(Color), (float)Main.rand.Next(20, 26) * 0.1f); + Main.dust[num41].noLight = true; + Main.dust[num41].noGravity = true; + Main.dust[num41].velocity *= 0.5f; + } + } + } + } + if (i == Main.myPlayer) + { + bool flag4 = true; + int type2 = this.inventory[this.selectedItem].type; + if ((type2 == 65 || type2 == 676 || type2 == 723 || type2 == 724 || type2 == 757 || type2 == 674 || type2 == 675 || type2 == 989 || type2 == 1226 || type2 == 1227) && this.itemAnimation != this.itemAnimationMax - 1) + { + flag4 = false; + } + if (this.inventory[this.selectedItem].shoot > 0 && this.itemAnimation > 0 && this.itemTime == 0 && flag4) + { + int num42 = this.inventory[this.selectedItem].shoot; + float num43 = this.inventory[this.selectedItem].shootSpeed; + if (this.inventory[this.selectedItem].melee && num42 != 25 && num42 != 26 && num42 != 35) + { + num43 /= this.meleeSpeed; + } + bool flag5 = false; + int num44 = num; + float num45 = this.inventory[this.selectedItem].knockBack; + if (num42 == 13 || num42 == 32 || (num42 >= 230 && num42 <= 235)) + { + this.grappling[0] = -1; + this.grapCount = 0; + for (int num46 = 0; num46 < 1000; num46++) + { + if (Main.projectile[num46].active && Main.projectile[num46].owner == i) + { + if (Main.projectile[num46].type == 13) + { + Main.projectile[num46].Kill(); + } + if (Main.projectile[num46].type >= 230 && Main.projectile[num46].type <= 235) + { + Main.projectile[num46].Kill(); + } + } + } + } + if (this.inventory[this.selectedItem].useAmmo > 0) + { + Item item = new Item(); + bool flag6 = false; + for (int num47 = 54; num47 < 58; num47++) + { + if (this.inventory[num47].ammo == this.inventory[this.selectedItem].useAmmo && this.inventory[num47].stack > 0) + { + item = this.inventory[num47]; + flag5 = true; + flag6 = true; + break; + } + } + if (!flag6) + { + for (int num48 = 0; num48 < 54; num48++) + { + if (this.inventory[num48].ammo == this.inventory[this.selectedItem].useAmmo && this.inventory[num48].stack > 0) + { + item = this.inventory[num48]; + flag5 = true; + break; + } + } + } + if (flag5) + { + if (this.inventory[this.selectedItem].useAmmo == 771) + { + num42 += item.shoot; + } + else + { + if (this.inventory[this.selectedItem].useAmmo == 780) + { + num42 += item.shoot; + } + else + { + if (item.shoot > 0) + { + num42 = item.shoot; + } + } + } + if (num42 == 42) + { + if (item.type == 370) + { + num42 = 65; + num44 += 5; + } + else + { + if (item.type == 408) + { + num42 = 68; + num44 += 5; + } + } + } + if (this.magicQuiver && this.inventory[this.selectedItem].useAmmo == 1) + { + num45 = (float)((int)((double)num45 * 1.1)); + num43 *= 1.1f; + num44 = (int)((double)num44 * 1.1); + } + num43 += item.shootSpeed; + if (item.ranged) + { + if (item.damage > 0) + { + num44 += (int)((float)item.damage * this.rangedDamage); + } + } + else + { + num44 += item.damage; + } + if (this.inventory[this.selectedItem].useAmmo == 1 && this.archery) + { + if (num43 < 20f) + { + num43 *= 1.2f; + if (num43 > 20f) + { + num43 = 20f; + } + } + num44 = (int)((double)((float)num44) * 1.2); + } + num45 += item.knockBack; + bool flag7 = false; + if (this.magicQuiver && this.inventory[this.selectedItem].useAmmo == 1 && Main.rand.Next(5) == 0) + { + flag7 = true; + } + if (this.inventory[this.selectedItem].type == 98 && Main.rand.Next(3) == 0) + { + flag7 = true; + } + if (this.inventory[this.selectedItem].type == 533 && Main.rand.Next(2) == 0) + { + flag7 = true; + } + if (this.inventory[this.selectedItem].type == 1553 && Main.rand.Next(2) == 0) + { + flag7 = true; + } + if (this.inventory[this.selectedItem].type == 434 && this.itemAnimation < this.inventory[this.selectedItem].useAnimation - 2) + { + flag7 = true; + } + if (this.ammoCost80 && Main.rand.Next(5) == 0) + { + flag7 = true; + } + if (this.ammoCost75 && Main.rand.Next(4) == 0) + { + flag7 = true; + } + if (num42 == 85 && this.itemAnimation < this.itemAnimationMax - 6) + { + flag7 = true; + } + if ((num42 == 145 || num42 == 146 || num42 == 147 || num42 == 148 || num42 == 149) && this.itemAnimation < this.itemAnimationMax - 5) + { + flag7 = true; + } + if (!flag7) + { + item.stack--; + if (item.stack <= 0) + { + item.active = false; + item.name = ""; + item.type = 0; + } + } + } + } + else + { + flag5 = true; + } + if (this.inventory[this.selectedItem].type == 1254 && num42 == 14) + { + num42 = 242; + } + if (this.inventory[this.selectedItem].type == 1255 && num42 == 14) + { + num42 = 242; + } + if (this.inventory[this.selectedItem].type == 1265 && num42 == 14) + { + num42 = 242; + } + if (num42 == 73) + { + for (int num49 = 0; num49 < 1000; num49++) + { + if (Main.projectile[num49].active && Main.projectile[num49].owner == i) + { + if (Main.projectile[num49].type == 73) + { + num42 = 74; + } + if (num42 == 74 && Main.projectile[num49].type == 74) + { + flag5 = false; + } + } + } + } + if (flag5) + { + if (this.inventory[this.selectedItem].summon) + { + num45 += this.minionKB; + num44 = (int)((float)num44 * this.minionDamage); + } + if (num42 == 228) + { + num45 = 0f; + } + if (this.inventory[this.selectedItem].mech && this.kbGlove) + { + num45 *= 1.7f; + } + if (this.inventory[this.selectedItem].ranged && this.armorSteath) + { + num45 *= 1f + (1f - this.stealth) * 0.5f; + } + if (num42 == 1 && this.inventory[this.selectedItem].type == 120) + { + num42 = 2; + } + if (this.inventory[this.selectedItem].type == 682) + { + num42 = 117; + } + if (this.inventory[this.selectedItem].type == 725) + { + num42 = 120; + } + this.itemTime = this.inventory[this.selectedItem].useTime; + if ((float)Main.mouseX + Main.screenPosition.X > this.position.X + (float)this.width * 0.5f) + { + this.ChangeDir(1); + } + else + { + this.ChangeDir(-1); + } + Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + if (num42 == 9) + { + vector = new Vector2(this.position.X + (float)this.width * 0.5f + (float)(Main.rand.Next(201) * -(float)this.direction) + ((float)Main.mouseX + Main.screenPosition.X - this.position.X), this.position.Y + (float)this.height * 0.5f - 600f); + num45 = 0f; + num44 *= 2; + } + else + { + if (num42 == 51) + { + vector.Y -= 6f * this.gravDir; + } + } + float num50 = (float)Main.mouseX + Main.screenPosition.X - vector.X; + float num51 = (float)Main.mouseY + Main.screenPosition.Y - vector.Y; + if (this.gravDir == -1f) + { + num51 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector.Y; + } + float num52 = (float)Math.Sqrt((double)(num50 * num50 + num51 * num51)); + float num53 = num52; + num52 = num43 / num52; + num50 *= num52; + num51 *= num52; + if (this.inventory[this.selectedItem].type == 757) + { + num44 = (int)((float)num44 * 1.25f); + } + if (num42 == 250) + { + for (int num54 = 0; num54 < 1000; num54++) + { + if (Main.projectile[num54].active && Main.projectile[num54].owner == this.whoAmi && (Main.projectile[num54].type == 250 || Main.projectile[num54].type == 251)) + { + Main.projectile[num54].Kill(); + } + } + } + if (num42 == 12) + { + vector.X += num50 * 3f; + vector.Y += num51 * 3f; + } + if (this.inventory[this.selectedItem].useStyle == 5) + { + this.itemRotation = (float)Math.Atan2((double)(num51 * (float)this.direction), (double)(num50 * (float)this.direction)); + NetMessage.SendData(13, -1, -1, "", this.whoAmi, 0f, 0f, 0f, 0); + NetMessage.SendData(41, -1, -1, "", this.whoAmi, 0f, 0f, 0f, 0); + } + if (num42 == 17) + { + vector.X = (float)Main.mouseX + Main.screenPosition.X; + vector.Y = (float)Main.mouseY + Main.screenPosition.Y; + } + if (num42 == 76) + { + num42 += Main.rand.Next(3); + num53 /= (float)(Main.screenHeight / 2); + if (num53 > 1f) + { + num53 = 1f; + } + float num55 = num50 + (float)Main.rand.Next(-40, 41) * 0.01f; + float num56 = num51 + (float)Main.rand.Next(-40, 41) * 0.01f; + num55 *= num53 + 0.25f; + num56 *= num53 + 0.25f; + int num57 = Projectile.NewProjectile(vector.X, vector.Y, num55, num56, num42, num44, num45, i, 0f, 0f); + Main.projectile[num57].ai[1] = 1f; + num53 = num53 * 2f - 1f; + if (num53 < -1f) + { + num53 = -1f; + } + if (num53 > 1f) + { + num53 = 1f; + } + Main.projectile[num57].ai[0] = num53; + NetMessage.SendData(27, -1, -1, "", num57, 0f, 0f, 0f, 0); + } + else + { + if (this.inventory[this.selectedItem].type == 98 || this.inventory[this.selectedItem].type == 533) + { + float speedX = num50 + (float)Main.rand.Next(-40, 41) * 0.01f; + float speedY = num51 + (float)Main.rand.Next(-40, 41) * 0.01f; + Projectile.NewProjectile(vector.X, vector.Y, speedX, speedY, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 1553) + { + float speedX2 = num50 + (float)Main.rand.Next(-40, 41) * 0.005f; + float speedY2 = num51 + (float)Main.rand.Next(-40, 41) * 0.005f; + Projectile.NewProjectile(vector.X, vector.Y, speedX2, speedY2, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 518) + { + float num58 = num50; + float num59 = num51; + num58 += (float)Main.rand.Next(-40, 41) * 0.04f; + num59 += (float)Main.rand.Next(-40, 41) * 0.04f; + Projectile.NewProjectile(vector.X, vector.Y, num58, num59, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 1265) + { + float num60 = num50; + float num61 = num51; + num60 += (float)Main.rand.Next(-30, 31) * 0.03f; + num61 += (float)Main.rand.Next(-30, 31) * 0.03f; + Projectile.NewProjectile(vector.X, vector.Y, num60, num61, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 534) + { + for (int num62 = 0; num62 < 4; num62++) + { + float num63 = num50; + float num64 = num51; + num63 += (float)Main.rand.Next(-40, 41) * 0.05f; + num64 += (float)Main.rand.Next(-40, 41) * 0.05f; + Projectile.NewProjectile(vector.X, vector.Y, num63, num64, num42, num44, num45, i, 0f, 0f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 1308) + { + int num65 = 4; + for (int num66 = 0; num66 < num65; num66++) + { + float num67 = num50; + float num68 = num51; + float num69 = 0.05f * (float)num66; + num67 += (float)Main.rand.Next(-35, 36) * num69; + num68 += (float)Main.rand.Next(-35, 36) * num69; + num52 = (float)Math.Sqrt((double)(num67 * num67 + num68 * num68)); + num52 = num43 / num52; + num67 *= num52; + num68 *= num52; + float x = vector.X; + float y = vector.Y; + Projectile.NewProjectile(x, y, num67, num68, num42, num44, num45, i, 0f, 0f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 1258) + { + float num70 = num50; + float num71 = num51; + num70 += (float)Main.rand.Next(-40, 41) * 0.01f; + num71 += (float)Main.rand.Next(-40, 41) * 0.01f; + vector.X += (float)Main.rand.Next(-40, 41) * 0.05f; + vector.Y += (float)Main.rand.Next(-45, 36) * 0.05f; + Projectile.NewProjectile(vector.X, vector.Y, num70, num71, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 964) + { + for (int num72 = 0; num72 < 3; num72++) + { + float num73 = num50; + float num74 = num51; + num73 += (float)Main.rand.Next(-35, 36) * 0.04f; + num74 += (float)Main.rand.Next(-35, 36) * 0.04f; + Projectile.NewProjectile(vector.X, vector.Y, num73, num74, num42, num44, num45, i, 0f, 0f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 1569) + { + int num75 = 4; + if (Main.rand.Next(2) == 0) + { + num75++; + } + if (Main.rand.Next(4) == 0) + { + num75++; + } + if (Main.rand.Next(8) == 0) + { + num75++; + } + if (Main.rand.Next(16) == 0) + { + num75++; + } + for (int num76 = 0; num76 < num75; num76++) + { + float num77 = num50; + float num78 = num51; + float num79 = 0.05f * (float)num76; + num77 += (float)Main.rand.Next(-35, 36) * num79; + num78 += (float)Main.rand.Next(-35, 36) * num79; + num52 = (float)Math.Sqrt((double)(num77 * num77 + num78 * num78)); + num52 = num43 / num52; + num77 *= num52; + num78 *= num52; + float x2 = vector.X; + float y2 = vector.Y; + Projectile.NewProjectile(x2, y2, num77, num78, num42, num44, num45, i, 0f, 0f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 1572) + { + for (int num80 = 0; num80 < 1000; num80++) + { + if (Main.projectile[num80].owner == this.whoAmi && Main.projectile[num80].type == 308) + { + Main.projectile[num80].Kill(); + } + } + int num81 = (int)((float)Main.mouseX + Main.screenPosition.X) / 16; + int num82 = (int)((float)Main.mouseY + Main.screenPosition.Y) / 16; + while (num82 < Main.maxTilesY - 10 && Main.tile[num81, num82] != null && !WorldGen.SolidTile(num81, num82) && Main.tile[num81 - 1, num82] != null && !WorldGen.SolidTile(num81 - 1, num82) && Main.tile[num81 + 1, num82] != null && !WorldGen.SolidTile(num81 + 1, num82)) + { + num82++; + } + num82--; + Projectile.NewProjectile((float)Main.mouseX + Main.screenPosition.X, (float)(num82 * 16 - 24), 0f, 15f, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 1244 || this.inventory[this.selectedItem].type == 1256) + { + int num83 = Projectile.NewProjectile(vector.X, vector.Y, num50, num51, num42, num44, num45, i, 0f, 0f); + Main.projectile[num83].ai[0] = (float)Main.mouseX + Main.screenPosition.X; + Main.projectile[num83].ai[1] = (float)Main.mouseY + Main.screenPosition.Y; + } + else + { + if (this.inventory[this.selectedItem].type == 1229) + { + int num84 = Main.rand.Next(2, 4); + if (Main.rand.Next(5) == 0) + { + num84++; + } + for (int num85 = 0; num85 < num84; num85++) + { + float num86 = num50; + float num87 = num51; + if (num85 > 0) + { + num86 += (float)Main.rand.Next(-35, 36) * 0.04f; + num87 += (float)Main.rand.Next(-35, 36) * 0.04f; + } + if (num85 > 1) + { + num86 += (float)Main.rand.Next(-35, 36) * 0.04f; + num87 += (float)Main.rand.Next(-35, 36) * 0.04f; + } + if (num85 > 2) + { + num86 += (float)Main.rand.Next(-35, 36) * 0.04f; + num87 += (float)Main.rand.Next(-35, 36) * 0.04f; + } + int num88 = Projectile.NewProjectile(vector.X, vector.Y, num86, num87, num42, num44, num45, i, 0f, 0f); + Main.projectile[num88].noDropItem = true; + } + } + else + { + if (this.inventory[this.selectedItem].type == 1121 || this.inventory[this.selectedItem].type == 1155) + { + int num89; + if (this.inventory[this.selectedItem].type == 1121) + { + num89 = Main.rand.Next(1, 4); + if (Main.rand.Next(6) == 0) + { + num89++; + } + if (Main.rand.Next(6) == 0) + { + num89++; + } + } + else + { + num89 = Main.rand.Next(2, 5); + if (Main.rand.Next(5) == 0) + { + num89++; + } + if (Main.rand.Next(5) == 0) + { + num89++; + } + } + for (int num90 = 0; num90 < num89; num90++) + { + float num91 = num50; + float num92 = num51; + num91 += (float)Main.rand.Next(-35, 36) * 0.02f; + num92 += (float)Main.rand.Next(-35, 36) * 0.02f; + Projectile.NewProjectile(vector.X, vector.Y, num91, num92, num42, num44, num45, i, 0f, 0f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 679) + { + for (int num93 = 0; num93 < 6; num93++) + { + float num94 = num50; + float num95 = num51; + num94 += (float)Main.rand.Next(-40, 41) * 0.05f; + num95 += (float)Main.rand.Next(-40, 41) * 0.05f; + Projectile.NewProjectile(vector.X, vector.Y, num94, num95, num42, num44, num45, i, 0f, 0f); + } + } + else + { + if (this.inventory[this.selectedItem].type == 434) + { + float num96 = num50; + float num97 = num51; + if (this.itemAnimation < 5) + { + num96 += (float)Main.rand.Next(-40, 41) * 0.01f; + num97 += (float)Main.rand.Next(-40, 41) * 0.01f; + num96 *= 1.1f; + num97 *= 1.1f; + } + else + { + if (this.itemAnimation < 10) + { + num96 += (float)Main.rand.Next(-20, 21) * 0.01f; + num97 += (float)Main.rand.Next(-20, 21) * 0.01f; + num96 *= 1.05f; + num97 *= 1.05f; + } + } + Projectile.NewProjectile(vector.X, vector.Y, num96, num97, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].type == 1157) + { + num42 = Main.rand.Next(191, 195); + num50 = 0f; + num51 = 0f; + vector.X = (float)Main.mouseX + Main.screenPosition.X; + vector.Y = (float)Main.mouseY + Main.screenPosition.Y; + int num98 = Projectile.NewProjectile(vector.X, vector.Y, num50, num51, num42, num44, num45, i, 0f, 0f); + Main.projectile[num98].localAI[0] = 30f; + } + else + { + if (this.inventory[this.selectedItem].type == 1309) + { + num50 = 0f; + num51 = 0f; + vector.X = (float)Main.mouseX + Main.screenPosition.X; + vector.Y = (float)Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector.X, vector.Y, num50, num51, num42, num44, num45, i, 0f, 0f); + } + else + { + if (this.inventory[this.selectedItem].shoot > 0 && (Main.projPet[this.inventory[this.selectedItem].shoot] || this.inventory[this.selectedItem].shoot == 72 || this.inventory[this.selectedItem].shoot == 18) && !this.inventory[this.selectedItem].summon) + { + for (int num99 = 0; num99 < 1000; num99++) + { + if (Main.projectile[num99].active && Main.projectile[num99].owner == this.whoAmi) + { + if (this.inventory[this.selectedItem].shoot == 72) + { + if (Main.projectile[num99].type == 72 || Main.projectile[num99].type == 86 || Main.projectile[num99].type == 87) + { + Main.projectile[num99].Kill(); + } + } + else + { + if (this.inventory[this.selectedItem].shoot == Main.projectile[num99].type) + { + Main.projectile[num99].Kill(); + } + } + } + } + if (num42 == 72) + { + int num100 = Main.rand.Next(3); + if (num100 == 0) + { + num42 = 72; + } + else + { + if (num100 == 1) + { + num42 = 86; + } + else + { + if (num100 == 2) + { + num42 = 87; + } + } + } + } + Projectile.NewProjectile(vector.X, vector.Y, num50, num51, num42, num44, num45, i, 0f, 0f); + } + else + { + int num101 = Projectile.NewProjectile(vector.X, vector.Y, num50, num51, num42, num44, num45, i, 0f, 0f); + if (num42 == 80) + { + Main.projectile[num101].ai[0] = (float)Player.tileTargetX; + Main.projectile[num101].ai[1] = (float)Player.tileTargetY; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 5) + { + this.itemRotation = 0f; + NetMessage.SendData(41, -1, -1, "", this.whoAmi, 0f, 0f, 0f, 0); + } + } + } + if (this.whoAmi == Main.myPlayer && (this.inventory[this.selectedItem].type == 509 || this.inventory[this.selectedItem].type == 510 || this.inventory[this.selectedItem].type == 849 || this.inventory[this.selectedItem].type == 850 || this.inventory[this.selectedItem].type == 851) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f + (float)this.blockRange >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost - (float)this.blockRange <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f + (float)this.blockRange >= (float)Player.tileTargetY) + { + this.showItemIcon = true; + if (this.itemAnimation > 0 && this.itemTime == 0 && this.controlUseItem) + { + int i2 = Player.tileTargetX; + int j2 = Player.tileTargetY; + if (this.inventory[this.selectedItem].type == 509) + { + int num102 = -1; + for (int num103 = 0; num103 < 58; num103++) + { + if (this.inventory[num103].stack > 0 && this.inventory[num103].type == 530) + { + num102 = num103; + break; + } + } + if (num102 >= 0 && WorldGen.PlaceWire(i2, j2)) + { + this.inventory[num102].stack--; + if (this.inventory[num102].stack <= 0) + { + this.inventory[num102].SetDefaults(0, false); + } + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 5, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + else + { + if (this.inventory[this.selectedItem].type == 850) + { + int num104 = -1; + for (int num105 = 0; num105 < 58; num105++) + { + if (this.inventory[num105].stack > 0 && this.inventory[num105].type == 530) + { + num104 = num105; + break; + } + } + if (num104 >= 0 && WorldGen.PlaceWire2(i2, j2)) + { + this.inventory[num104].stack--; + if (this.inventory[num104].stack <= 0) + { + this.inventory[num104].SetDefaults(0, false); + } + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 10, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + } + if (this.inventory[this.selectedItem].type == 851) + { + int num106 = -1; + for (int num107 = 0; num107 < 58; num107++) + { + if (this.inventory[num107].stack > 0 && this.inventory[num107].type == 530) + { + num106 = num107; + break; + } + } + if (num106 >= 0 && WorldGen.PlaceWire3(i2, j2)) + { + this.inventory[num106].stack--; + if (this.inventory[num106].stack <= 0) + { + this.inventory[num106].SetDefaults(0, false); + } + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 12, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + else + { + if (this.inventory[this.selectedItem].type == 510) + { + if (WorldGen.KillActuator(i2, j2)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 9, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + else + { + if (WorldGen.KillWire3(i2, j2)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 13, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + else + { + if (WorldGen.KillWire2(i2, j2)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 11, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + else + { + if (WorldGen.KillWire(i2, j2)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 6, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 849 && this.inventory[this.selectedItem].stack > 0 && WorldGen.PlaceActuator(i2, j2)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + NetMessage.SendData(17, -1, -1, "", 8, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + this.inventory[this.selectedItem].stack--; + if (this.inventory[this.selectedItem].stack <= 0) + { + this.inventory[this.selectedItem].SetDefaults(0, false); + } + } + } + } + } + } + if (this.itemAnimation > 0 && this.itemTime == 0 && (this.inventory[this.selectedItem].type == 507 || this.inventory[this.selectedItem].type == 508)) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Vector2 vector2 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num108 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num109 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + float num110 = (float)Math.Sqrt((double)(num108 * num108 + num109 * num109)); + num110 /= (float)(Main.screenHeight / 2); + if (num110 > 1f) + { + num110 = 1f; + } + num110 = num110 * 2f - 1f; + if (num110 < -1f) + { + num110 = -1f; + } + if (num110 > 1f) + { + num110 = 1f; + } + Main.harpNote = num110; + int style = 26; + if (this.inventory[this.selectedItem].type == 507) + { + style = 35; + } + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, style); + NetMessage.SendData(58, -1, -1, "", this.whoAmi, num110, 0f, 0f, 0); + } + if (((this.inventory[this.selectedItem].type >= 205 && this.inventory[this.selectedItem].type <= 207) || this.inventory[this.selectedItem].type == 1128) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f >= (float)Player.tileTargetY) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + if (this.inventory[this.selectedItem].type == 205) + { + int num111 = (int)Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(); + int num112 = 0; + for (int num113 = Player.tileTargetX - 1; num113 <= Player.tileTargetX + 1; num113++) + { + for (int num114 = Player.tileTargetY - 1; num114 <= Player.tileTargetY + 1; num114++) + { + if ((int)Main.tile[num113, num114].liquidType() == num111) + { + num112 += (int)Main.tile[num113, num114].liquid; + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid > 0 && num112 > 100) + { + int liquidType = (int)Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(); + if (!Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].honey()) + { + this.inventory[this.selectedItem].SetDefaults(1128, false); + } + else + { + this.inventory[this.selectedItem].SetDefaults(206, false); + } + } + else + { + this.inventory[this.selectedItem].SetDefaults(207, false); + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + this.itemTime = this.inventory[this.selectedItem].useTime; + int num115 = (int)Main.tile[Player.tileTargetX, Player.tileTargetY].liquid; + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = 0; + Main.tile[Player.tileTargetX, Player.tileTargetY].lava(false); + Main.tile[Player.tileTargetX, Player.tileTargetY].honey(false); + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY, false); + if (Main.netMode == 1) + { + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + else + { + Liquid.AddWater(Player.tileTargetX, Player.tileTargetY); + } + for (int num116 = Player.tileTargetX - 1; num116 <= Player.tileTargetX + 1; num116++) + { + for (int num117 = Player.tileTargetY - 1; num117 <= Player.tileTargetY + 1; num117++) + { + if (num115 < 256 && (int)Main.tile[num116, num117].liquidType() == num111) + { + int num118 = (int)Main.tile[num116, num117].liquid; + if (num118 + num115 > 255) + { + num118 = 255 - num115; + } + num115 += num118; + Tile expr_6287 = Main.tile[num116, num117]; + expr_6287.liquid -= (byte)num118; + Main.tile[num116, num117].liquidType(liquidType); + if (Main.tile[num116, num117].liquid == 0) + { + Main.tile[num116, num117].lava(false); + Main.tile[num116, num117].honey(false); + } + WorldGen.SquareTileFrame(num116, num117, false); + if (Main.netMode == 1) + { + NetMessage.sendWater(num116, num117); + } + else + { + Liquid.AddWater(num116, num117); + } + } + } + } + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid < 200 && (!Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() || !Main.tileSolid[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tileSolidTop[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type])) + { + if (this.inventory[this.selectedItem].type == 207) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid == 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == 1) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(1); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = 255; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY, true); + this.inventory[this.selectedItem].SetDefaults(205, false); + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.netMode == 1) + { + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 206) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid == 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == 0) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(0); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = 255; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY, true); + this.inventory[this.selectedItem].SetDefaults(205, false); + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.netMode == 1) + { + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 1128 && (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid == 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == 2)) + { + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(2); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = 255; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY, true); + this.inventory[this.selectedItem].SetDefaults(205, false); + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.netMode == 1) + { + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + } + } + } + } + } + } + } + if (!this.channel) + { + this.toolTime = this.itemTime; + } + else + { + this.toolTime--; + if (this.toolTime < 0) + { + if (this.inventory[this.selectedItem].pick > 0) + { + this.toolTime = this.inventory[this.selectedItem].useTime; + } + else + { + this.toolTime = (int)((float)this.inventory[this.selectedItem].useTime * this.pickSpeed); + } + } + } + if ((this.inventory[this.selectedItem].pick > 0 || this.inventory[this.selectedItem].axe > 0 || this.inventory[this.selectedItem].hammer > 0) && this.position.X / 16f - (float)Player.tileRangeX - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetX && (this.position.X + (float)this.width) / 16f + (float)Player.tileRangeX + (float)this.inventory[this.selectedItem].tileBoost - 1f >= (float)Player.tileTargetX && this.position.Y / 16f - (float)Player.tileRangeY - (float)this.inventory[this.selectedItem].tileBoost <= (float)Player.tileTargetY && (this.position.Y + (float)this.height) / 16f + (float)Player.tileRangeY + (float)this.inventory[this.selectedItem].tileBoost - 2f >= (float)Player.tileTargetY) + { + bool flag8 = true; + this.showItemIcon = true; + if (this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem && (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() || (!Main.tileHammer[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] && !Main.tileSolid[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]))) + { + this.poundRelease = false; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].active()) + { + if ((this.inventory[this.selectedItem].pick > 0 && !Main.tileAxe[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] && !Main.tileHammer[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) || (this.inventory[this.selectedItem].axe > 0 && Main.tileAxe[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) || (this.inventory[this.selectedItem].hammer > 0 && Main.tileHammer[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type])) + { + flag8 = false; + } + if (this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + if (this.hitTileX != Player.tileTargetX || this.hitTileY != Player.tileTargetY) + { + this.hitTile = 0; + this.hitTileX = Player.tileTargetX; + this.hitTileY = Player.tileTargetY; + } + if (Main.tileNoFail[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + this.hitTile = 100; + } + if (Main.tileHammer[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + flag8 = false; + if (this.inventory[this.selectedItem].hammer > 0) + { + this.hitTile += this.inventory[this.selectedItem].hammer; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 26 && (this.inventory[this.selectedItem].hammer < 80 || !Main.hardMode)) + { + this.hitTile = 0; + this.Hurt(this.statLife / 2, -this.direction, false, false, Lang.deathMsg(-1, -1, -1, 4), false); + } + if (this.hitTile >= 100) + { + this.hitTile = 0; + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 1f, 0); + } + } + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + else + { + if (Main.tileAxe[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 80) + { + this.hitTile += this.inventory[this.selectedItem].axe * 3; + } + else + { + this.hitTile += this.inventory[this.selectedItem].axe; + } + if (this.inventory[this.selectedItem].axe > 0) + { + if (this.hitTile >= 100) + { + this.hitTile = 0; + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 1f, 0); + } + } + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + else + { + if (this.inventory[this.selectedItem].pick > 0) + { + if (Main.tileDungeon[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 25 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 58 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 117 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 203) + { + this.hitTile += this.inventory[this.selectedItem].pick / 2; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 48 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 232) + { + this.hitTile += this.inventory[this.selectedItem].pick / 4; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 226) + { + this.hitTile += this.inventory[this.selectedItem].pick / 4; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 107 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 221) + { + this.hitTile += this.inventory[this.selectedItem].pick / 2; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 108 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 222) + { + this.hitTile += this.inventory[this.selectedItem].pick / 3; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 111 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 223) + { + this.hitTile += this.inventory[this.selectedItem].pick / 4; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 211) + { + this.hitTile += this.inventory[this.selectedItem].pick / 5; + } + else + { + this.hitTile += this.inventory[this.selectedItem].pick; + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 211 && this.inventory[this.selectedItem].pick < 200) + { + this.hitTile = 0; + } + if ((Main.tile[Player.tileTargetX, Player.tileTargetY].type == 25 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 203) && this.inventory[this.selectedItem].pick < 65) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 117 && this.inventory[this.selectedItem].pick < 65) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 37 && this.inventory[this.selectedItem].pick < 50) + { + this.hitTile = 0; + } + else + { + if ((Main.tile[Player.tileTargetX, Player.tileTargetY].type == 22 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 204) && (double)Player.tileTargetY > Main.worldSurface && this.inventory[this.selectedItem].pick < 55) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 56 && this.inventory[this.selectedItem].pick < 65) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 58 && this.inventory[this.selectedItem].pick < 65) + { + this.hitTile = 0; + } + else + { + if ((Main.tile[Player.tileTargetX, Player.tileTargetY].type == 226 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 237) && this.inventory[this.selectedItem].pick < 210) + { + this.hitTile = 0; + } + else + { + if (Main.tileDungeon[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] && this.inventory[this.selectedItem].pick < 65) + { + if ((double)Player.tileTargetX < (double)Main.maxTilesX * 0.35 || (double)Player.tileTargetX > (double)Main.maxTilesX * 0.65) + { + this.hitTile = 0; + } + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 107 && this.inventory[this.selectedItem].pick < 100) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 108 && this.inventory[this.selectedItem].pick < 110) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 111 && this.inventory[this.selectedItem].pick < 120) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 221 && this.inventory[this.selectedItem].pick < 100) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 222 && this.inventory[this.selectedItem].pick < 110) + { + this.hitTile = 0; + } + else + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 223 && this.inventory[this.selectedItem].pick < 120) + { + this.hitTile = 0; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 147 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 40 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 53 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 57 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 59 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 123 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 224) + { + this.hitTile += this.inventory[this.selectedItem].pick; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 165 || Main.tileRope[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 199 || Main.tileMoss[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + this.hitTile = 100; + } + if (this.hitTile >= 100 && (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 2 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 23 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 60 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 70 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 109 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 71 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == 199 || Main.tileMoss[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type])) + { + this.hitTile = 0; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 128) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 18 || Main.tile[Player.tileTargetX, Player.tileTargetY].frameX == 54) + { + Player.tileTargetX--; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX >= 100) + { + this.hitTile = 0; + } + } + if (this.hitTile >= 100) + { + this.hitTile = 0; + if (Main.netMode == 1 && Main.tile[Player.tileTargetX, Player.tileTargetY].type == 21) + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true, false, false); + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 1f, 0); + NetMessage.SendData(34, -1, -1, "", Player.tileTargetX, (float)Player.tileTargetY, 0f, 0f, 0); + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 0f, 0); + } + } + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)Player.tileTargetX, (float)Player.tileTargetY, 1f, 0); + } + } + this.itemTime = (int)((float)this.inventory[this.selectedItem].useTime * this.pickSpeed); + } + } + } + if (this.inventory[this.selectedItem].hammer > 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tileSolid[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type] && Main.tile[Player.tileTargetX, Player.tileTargetY].type != 10 && this.poundRelease) + { + flag8 = false; + this.itemTime = this.inventory[this.selectedItem].useTime; + this.hitTile += (int)((double)this.inventory[this.selectedItem].hammer * 1.25); + this.hitTile = 100; + if (Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY - 1].type == 10) + { + this.hitTile = 0; + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == 10) + { + this.hitTile = 0; + } + if (this.hitTile >= 100) + { + this.hitTile = 0; + if (this.poundRelease) + { + int num119 = Player.tileTargetX; + int num120 = Player.tileTargetY; + if ((Main.tile[num119, num120].halfBrick() || Main.tile[num119, num120].slope() != 0) && !Main.tileSolidTop[(int)Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + int num121 = 1; + int slope = 2; + if (WorldGen.SolidTile(num119 + 1, num120) && !WorldGen.SolidTile(num119 - 1, num120)) + { + num121 = 2; + slope = 1; + } + if (Main.tile[num119, num120].slope() == 0) + { + WorldGen.SlopeTile(num119, num120, num121); + } + else + { + if ((int)Main.tile[num119, num120].slope() == num121) + { + WorldGen.SlopeTile(num119, num120, slope); + } + else + { + WorldGen.SlopeTile(num119, num120, 0); + } + } + int num122 = (int)Main.tile[num119, num120].slope(); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 14, (float)Player.tileTargetX, (float)Player.tileTargetY, (float)num122, 0); + } + } + else + { + WorldGen.PoundTile(num119, num120); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 7, (float)Player.tileTargetX, (float)Player.tileTargetY, 1f, 0); + } + } + this.poundRelease = false; + } + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true, true, false); + Main.PlaySound(0, Player.tileTargetX * 16, Player.tileTargetY * 16, 1); + } + } + else + { + this.poundRelease = false; + } + } + } + if (this.releaseUseItem) + { + this.poundRelease = true; + } + int num123 = Player.tileTargetX; + int num124 = Player.tileTargetY; + bool flag9 = true; + if (Main.tile[num123, num124].wall > 0) + { + if (!Main.wallHouse[(int)Main.tile[num123, num124].wall]) + { + for (int num125 = num123 - 1; num125 < num123 + 2; num125++) + { + for (int num126 = num124 - 1; num126 < num124 + 2; num126++) + { + if (Main.tile[num125, num126].wall != Main.tile[num123, num124].wall) + { + flag9 = false; + break; + } + } + } + } + else + { + flag9 = false; + } + } + if (flag9 && !Main.tile[num123, num124].active()) + { + int num127 = -1; + if ((double)(((float)Main.mouseX + Main.screenPosition.X) / 16f) < Math.Round((double)(((float)Main.mouseX + Main.screenPosition.X) / 16f))) + { + num127 = 0; + } + int num128 = -1; + if ((double)(((float)Main.mouseY + Main.screenPosition.Y) / 16f) < Math.Round((double)(((float)Main.mouseY + Main.screenPosition.Y) / 16f))) + { + num128 = 0; + } + for (int num129 = Player.tileTargetX + num127; num129 <= Player.tileTargetX + num127 + 1; num129++) + { + for (int num130 = Player.tileTargetY + num128; num130 <= Player.tileTargetY + num128 + 1; num130++) + { + if (flag9) + { + num123 = num129; + num124 = num130; + if (Main.tile[num123, num124].wall > 0) + { + if (!Main.wallHouse[(int)Main.tile[num123, num124].wall]) + { + for (int num131 = num123 - 1; num131 < num123 + 2; num131++) + { + for (int num132 = num124 - 1; num132 < num124 + 2; num132++) + { + if (Main.tile[num131, num132].wall != Main.tile[num123, num124].wall) + { + flag9 = false; + break; + } + } + } + } + else + { + flag9 = false; + } + } + } + } + } + } + if (flag8 && Main.tile[num123, num124].wall > 0 && (!Main.tile[num123, num124].active() || num123 != Player.tileTargetX || num124 != Player.tileTargetY || (!Main.tileHammer[(int)Main.tile[num123, num124].type] && !this.poundRelease)) && this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem && this.inventory[this.selectedItem].hammer > 0) + { + bool flag10 = true; + if (!Main.wallHouse[(int)Main.tile[num123, num124].wall]) + { + flag10 = false; + for (int num133 = num123 - 1; num133 < num123 + 2; num133++) + { + for (int num134 = num124 - 1; num134 < num124 + 2; num134++) + { + if (Main.tile[num133, num134].wall == 0 || Main.wallHouse[(int)Main.tile[num133, num134].wall]) + { + flag10 = true; + break; + } + } + } + } + if (flag10) + { + if (this.hitTileX != num123 || this.hitTileY != num124) + { + this.hitTile = 0; + this.hitTileX = num123; + this.hitTileY = num124; + } + this.hitTile += (int)((float)this.inventory[this.selectedItem].hammer * 1.5f); + if (this.hitTile >= 100) + { + this.hitTile = 0; + WorldGen.KillWall(num123, num124, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 2, (float)num123, (float)num124, 0f, 0); + } + } + else + { + WorldGen.KillWall(num123, num124, true); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 2, (float)num123, (float)num124, 1f, 0); + } + } + this.itemTime = this.inventory[this.selectedItem].useTime / 2; + } + } + } + if (Main.myPlayer == this.whoAmi && this.inventory[this.selectedItem].type == 1326 && this.itemAnimation > 0 && this.itemTime == 0) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Vector2 newPos; + newPos.X = (float)Main.mouseX + Main.screenPosition.X; + newPos.Y = (float)Main.mouseY + Main.screenPosition.Y; + newPos.X -= (float)(this.width / 2); + newPos.Y -= (float)this.height; + if (!Collision.SolidCollision(newPos, this.width, this.height)) + { + this.Teleport(newPos, 1); + NetMessage.SendData(65, -1, -1, "", 0, (float)this.whoAmi, newPos.X, newPos.Y, 1); + } + } + if (this.inventory[this.selectedItem].type == 29 && this.itemAnimation > 0 && this.statLifeMax < 400 && this.itemTime == 0) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + this.statLifeMax += 20; + this.statLife += 20; + if (Main.myPlayer == this.whoAmi) + { + this.HealEffect(20, true); + } + } + if (this.inventory[this.selectedItem].type == 1291 && this.itemAnimation > 0 && this.statLifeMax >= 400 && this.statLifeMax < 500 && this.itemTime == 0) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + this.statLifeMax += 5; + this.statLife += 5; + if (Main.myPlayer == this.whoAmi) + { + this.HealEffect(5, true); + } + } + if (this.inventory[this.selectedItem].type == 109 && this.itemAnimation > 0 && this.statManaMax < 200 && this.itemTime == 0) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + this.statManaMax += 20; + this.statMana += 20; + if (Main.myPlayer == this.whoAmi) + { + this.ManaEffect(20); + } + } + this.PlaceThing(); + } + if (((this.inventory[this.selectedItem].damage >= 0 && this.inventory[this.selectedItem].type > 0 && !this.inventory[this.selectedItem].noMelee) || this.inventory[this.selectedItem].type == 1450) && this.itemAnimation > 0) + { + bool flag11 = false; + Rectangle rectangle = new Rectangle((int)this.itemLocation.X, (int)this.itemLocation.Y, 32, 32); + if (!Main.dedServ) + { + rectangle = new Rectangle((int)this.itemLocation.X, (int)this.itemLocation.Y, Main.itemTexture[this.inventory[this.selectedItem].type].Width, Main.itemTexture[this.inventory[this.selectedItem].type].Height); + } + rectangle.Width = (int)((float)rectangle.Width * this.inventory[this.selectedItem].scale); + rectangle.Height = (int)((float)rectangle.Height * this.inventory[this.selectedItem].scale); + if (this.direction == -1) + { + rectangle.X -= rectangle.Width; + } + if (this.gravDir == 1f) + { + rectangle.Y -= rectangle.Height; + } + if (this.inventory[this.selectedItem].useStyle == 1) + { + if ((double)this.itemAnimation < (double)this.itemAnimationMax * 0.333) + { + if (this.direction == -1) + { + rectangle.X -= (int)((double)rectangle.Width * 1.4 - (double)rectangle.Width); + } + rectangle.Width = (int)((double)rectangle.Width * 1.4); + rectangle.Y += (int)((double)rectangle.Height * 0.5 * (double)this.gravDir); + rectangle.Height = (int)((double)rectangle.Height * 1.1); + } + else + { + if ((double)this.itemAnimation >= (double)this.itemAnimationMax * 0.666) + { + if (this.direction == 1) + { + rectangle.X -= (int)((double)rectangle.Width * 1.2); + } + rectangle.Width *= 2; + rectangle.Y -= (int)(((double)rectangle.Height * 1.4 - (double)rectangle.Height) * (double)this.gravDir); + rectangle.Height = (int)((double)rectangle.Height * 1.4); + } + } + } + else + { + if (this.inventory[this.selectedItem].useStyle == 3) + { + if ((double)this.itemAnimation > (double)this.itemAnimationMax * 0.666) + { + flag11 = true; + } + else + { + if (this.direction == -1) + { + rectangle.X -= (int)((double)rectangle.Width * 1.4 - (double)rectangle.Width); + } + rectangle.Width = (int)((double)rectangle.Width * 1.4); + rectangle.Y += (int)((double)rectangle.Height * 0.6); + rectangle.Height = (int)((double)rectangle.Height * 0.6); + } + } + } + float arg_8661_0 = this.gravDir; + if (this.inventory[this.selectedItem].type == 1450 && Main.rand.Next(3) == 0) + { + int num135 = -1; + float x3 = (float)(rectangle.X + Main.rand.Next(rectangle.Width)); + float y3 = (float)(rectangle.Y + Main.rand.Next(rectangle.Height)); + if (Main.rand.Next(500) == 0) + { + num135 = Gore.NewGore(new Vector2(x3, y3), default(Vector2), 415, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(250) == 0) + { + num135 = Gore.NewGore(new Vector2(x3, y3), default(Vector2), 414, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(80) == 0) + { + num135 = Gore.NewGore(new Vector2(x3, y3), default(Vector2), 413, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(10) == 0) + { + num135 = Gore.NewGore(new Vector2(x3, y3), default(Vector2), 412, (float)Main.rand.Next(51, 101) * 0.01f); + } + else + { + if (Main.rand.Next(3) == 0) + { + num135 = Gore.NewGore(new Vector2(x3, y3), default(Vector2), 411, (float)Main.rand.Next(51, 101) * 0.01f); + } + } + } + } + } + if (num135 >= 0) + { + Gore expr_883B_cp_0 = Main.gore[num135]; + expr_883B_cp_0.velocity.X = expr_883B_cp_0.velocity.X + (float)(this.direction * 2); + Gore expr_885D_cp_0 = Main.gore[num135]; + expr_885D_cp_0.velocity.Y = expr_885D_cp_0.velocity.Y * 0.3f; + } + } + if (!flag11) + { + if (this.inventory[this.selectedItem].type == 989 && Main.rand.Next(5) == 0) + { + int num136 = Main.rand.Next(3); + if (num136 == 0) + { + num136 = 15; + } + else + { + if (num136 == 1) + { + num136 = 57; + } + else + { + num136 = 58; + } + } + int num137 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, num136, (float)(this.direction * 2), 0f, 150, default(Color), 1.3f); + Main.dust[num137].velocity *= 0.2f; + } + if ((this.inventory[this.selectedItem].type == 44 || this.inventory[this.selectedItem].type == 45 || this.inventory[this.selectedItem].type == 46 || this.inventory[this.selectedItem].type == 103 || this.inventory[this.selectedItem].type == 104) && Main.rand.Next(15) == 0) + { + Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 14, (float)(this.direction * 2), 0f, 150, default(Color), 1.3f); + } + if (this.inventory[this.selectedItem].type == 273 || this.inventory[this.selectedItem].type == 675) + { + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 14, (float)(this.direction * 2), 0f, 150, default(Color), 1.4f); + } + int num138 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 27, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.2f); + Main.dust[num138].noGravity = true; + Dust expr_8B0E_cp_0 = Main.dust[num138]; + expr_8B0E_cp_0.velocity.X = expr_8B0E_cp_0.velocity.X / 2f; + Dust expr_8B2C_cp_0 = Main.dust[num138]; + expr_8B2C_cp_0.velocity.Y = expr_8B2C_cp_0.velocity.Y / 2f; + } + if (this.inventory[this.selectedItem].type == 678) + { + int num139 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 71, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.2f); + Main.dust[num139].velocity *= 1.5f; + Main.dust[num139].noGravity = true; + } + if (this.inventory[this.selectedItem].type == 723 && Main.rand.Next(2) == 0) + { + int num140 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 64, 0f, 0f, 150, default(Color), 1.2f); + Main.dust[num140].noGravity = true; + } + if (this.inventory[this.selectedItem].type == 65) + { + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 58, 0f, 0f, 150, default(Color), 1.2f); + } + if (Main.rand.Next(10) == 0) + { + Gore.NewGore(new Vector2((float)rectangle.X, (float)rectangle.Y), default(Vector2), Main.rand.Next(16, 18), 1f); + } + } + if (this.inventory[this.selectedItem].type == 190 || this.inventory[this.selectedItem].type == 213) + { + int num141 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 40, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 0, default(Color), 1.2f); + Main.dust[num141].noGravity = true; + } + if (this.inventory[this.selectedItem].type == 121) + { + for (int num142 = 0; num142 < 2; num142++) + { + int num143 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 6, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num143].noGravity = true; + Dust expr_8E6C_cp_0 = Main.dust[num143]; + expr_8E6C_cp_0.velocity.X = expr_8E6C_cp_0.velocity.X * 2f; + Dust expr_8E8A_cp_0 = Main.dust[num143]; + expr_8E8A_cp_0.velocity.Y = expr_8E8A_cp_0.velocity.Y * 2f; + } + } + if (this.inventory[this.selectedItem].type == 122 || this.inventory[this.selectedItem].type == 217) + { + int num144 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 6, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[num144].noGravity = true; + } + if (this.inventory[this.selectedItem].type == 155) + { + int num145 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 172, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 0.9f); + Main.dust[num145].noGravity = true; + Main.dust[num145].velocity *= 0.1f; + } + if ((this.inventory[this.selectedItem].type == 676 || this.inventory[this.selectedItem].type == 673) && Main.rand.Next(3) == 0) + { + int num146 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 67, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 90, default(Color), 1.5f); + Main.dust[num146].noGravity = true; + Main.dust[num146].velocity *= 0.2f; + } + if (this.inventory[this.selectedItem].type == 724 && Main.rand.Next(5) == 0) + { + int num147 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 67, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 90, default(Color), 1.5f); + Main.dust[num147].noGravity = true; + Main.dust[num147].velocity *= 0.2f; + } + if (this.inventory[this.selectedItem].type >= 795 && this.inventory[this.selectedItem].type <= 802 && Main.rand.Next(3) == 0) + { + int num148 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 115, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 140, default(Color), 1.5f); + Main.dust[num148].noGravity = true; + Main.dust[num148].velocity *= 0.25f; + } + if (this.inventory[this.selectedItem].type == 367 || this.inventory[this.selectedItem].type == 368 || this.inventory[this.selectedItem].type == 674) + { + if (Main.rand.Next(3) == 0) + { + int num149 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 57, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.1f); + Main.dust[num149].noGravity = true; + Dust expr_935E_cp_0 = Main.dust[num149]; + expr_935E_cp_0.velocity.X = expr_935E_cp_0.velocity.X / 2f; + Dust expr_937C_cp_0 = Main.dust[num149]; + expr_937C_cp_0.velocity.Y = expr_937C_cp_0.velocity.Y / 2f; + Dust expr_939A_cp_0 = Main.dust[num149]; + expr_939A_cp_0.velocity.X = expr_939A_cp_0.velocity.X + (float)(this.direction * 2); + } + if (Main.rand.Next(4) == 0) + { + int num149 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 43, 0f, 0f, 254, default(Color), 0.3f); + Main.dust[num149].velocity *= 0f; + } + } + if (this.inventory[this.selectedItem].type >= 198 && this.inventory[this.selectedItem].type <= 203) + { + float num150 = 0.5f; + float num151 = 0.5f; + float num152 = 0.5f; + if (this.inventory[this.selectedItem].type == 198) + { + num150 *= 0.1f; + num151 *= 0.5f; + num152 *= 1.2f; + } + else + { + if (this.inventory[this.selectedItem].type == 199) + { + num150 *= 1f; + num151 *= 0.2f; + num152 *= 0.1f; + } + else + { + if (this.inventory[this.selectedItem].type == 200) + { + num150 *= 0.1f; + num151 *= 1f; + num152 *= 0.2f; + } + else + { + if (this.inventory[this.selectedItem].type == 201) + { + num150 *= 0.8f; + num151 *= 0.1f; + num152 *= 1f; + } + else + { + if (this.inventory[this.selectedItem].type == 202) + { + num150 *= 0.8f; + num151 *= 0.9f; + num152 *= 1f; + } + else + { + if (this.inventory[this.selectedItem].type == 203) + { + num150 *= 0.9f; + num151 *= 0.9f; + num152 *= 0.1f; + } + } + } + } + } + } + Lighting.addLight((int)((this.itemLocation.X + 6f + this.velocity.X) / 16f), (int)((this.itemLocation.Y - 14f) / 16f), num150, num151, num152); + } + if (this.frostBurn && this.inventory[this.selectedItem].melee && !this.inventory[this.selectedItem].noMelee && !this.inventory[this.selectedItem].noUseGraphic && Main.rand.Next(2) == 0) + { + int num153 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 135, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num153].noGravity = true; + Main.dust[num153].velocity *= 0.7f; + Dust expr_9718_cp_0 = Main.dust[num153]; + expr_9718_cp_0.velocity.Y = expr_9718_cp_0.velocity.Y - 0.5f; + } + if (this.inventory[this.selectedItem].melee && !this.inventory[this.selectedItem].noMelee && !this.inventory[this.selectedItem].noUseGraphic && this.meleeEnchant > 0) + { + if (this.meleeEnchant == 1) + { + if (Main.rand.Next(3) == 0) + { + int num154 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 171, 0f, 0f, 100, default(Color), 1f); + Main.dust[num154].noGravity = true; + Main.dust[num154].fadeIn = 1.5f; + Main.dust[num154].velocity *= 0.25f; + } + } + else + { + if (this.meleeEnchant == 2) + { + if (Main.rand.Next(2) == 0) + { + int num155 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 75, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num155].noGravity = true; + Main.dust[num155].velocity *= 0.7f; + Dust expr_98DF_cp_0 = Main.dust[num155]; + expr_98DF_cp_0.velocity.Y = expr_98DF_cp_0.velocity.Y - 0.5f; + } + } + else + { + if (this.meleeEnchant == 3) + { + if (Main.rand.Next(2) == 0) + { + int num156 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 6, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num156].noGravity = true; + Main.dust[num156].velocity *= 0.7f; + Dust expr_99B1_cp_0 = Main.dust[num156]; + expr_99B1_cp_0.velocity.Y = expr_99B1_cp_0.velocity.Y - 0.5f; + } + } + else + { + if (this.meleeEnchant == 4) + { + if (Main.rand.Next(2) == 0) + { + int num157 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 57, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.1f); + Main.dust[num157].noGravity = true; + Dust expr_9A6A_cp_0 = Main.dust[num157]; + expr_9A6A_cp_0.velocity.X = expr_9A6A_cp_0.velocity.X / 2f; + Dust expr_9A88_cp_0 = Main.dust[num157]; + expr_9A88_cp_0.velocity.Y = expr_9A88_cp_0.velocity.Y / 2f; + } + } + else + { + if (this.meleeEnchant == 5) + { + if (Main.rand.Next(2) == 0) + { + int num158 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 169, 0f, 0f, 100, default(Color), 1f); + Dust expr_9B11_cp_0 = Main.dust[num158]; + expr_9B11_cp_0.velocity.X = expr_9B11_cp_0.velocity.X + (float)this.direction; + Dust expr_9B31_cp_0 = Main.dust[num158]; + expr_9B31_cp_0.velocity.Y = expr_9B31_cp_0.velocity.Y + 0.2f; + Main.dust[num158].noGravity = true; + } + } + else + { + if (this.meleeEnchant == 6) + { + if (Main.rand.Next(2) == 0) + { + int num159 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 135, 0f, 0f, 100, default(Color), 1f); + Dust expr_9BC8_cp_0 = Main.dust[num159]; + expr_9BC8_cp_0.velocity.X = expr_9BC8_cp_0.velocity.X + (float)this.direction; + Dust expr_9BE8_cp_0 = Main.dust[num159]; + expr_9BE8_cp_0.velocity.Y = expr_9BE8_cp_0.velocity.Y + 0.2f; + Main.dust[num159].noGravity = true; + } + } + else + { + if (this.meleeEnchant == 7) + { + if (Main.rand.Next(20) == 0) + { + int type3 = Main.rand.Next(139, 143); + int num160 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, type3, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f); + Dust expr_9C9E_cp_0 = Main.dust[num160]; + expr_9C9E_cp_0.velocity.X = expr_9C9E_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_9CD2_cp_0 = Main.dust[num160]; + expr_9CD2_cp_0.velocity.Y = expr_9CD2_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_9D06_cp_0 = Main.dust[num160]; + expr_9D06_cp_0.velocity.X = expr_9D06_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Dust expr_9D34_cp_0 = Main.dust[num160]; + expr_9D34_cp_0.velocity.Y = expr_9D34_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + Main.dust[num160].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + } + if (Main.rand.Next(40) == 0) + { + int type4 = Main.rand.Next(276, 283); + int num161 = Gore.NewGore(new Vector2((float)rectangle.X, (float)rectangle.Y), this.velocity, type4, 1f); + Gore expr_9DE1_cp_0 = Main.gore[num161]; + expr_9DE1_cp_0.velocity.X = expr_9DE1_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Gore expr_9E15_cp_0 = Main.gore[num161]; + expr_9E15_cp_0.velocity.Y = expr_9E15_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Main.gore[num161].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Gore expr_9E78_cp_0 = Main.gore[num161]; + expr_9E78_cp_0.velocity.X = expr_9E78_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Gore expr_9EA6_cp_0 = Main.gore[num161]; + expr_9EA6_cp_0.velocity.Y = expr_9EA6_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + } + } + else + { + if (this.meleeEnchant == 8 && Main.rand.Next(4) == 0) + { + int num162 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 46, 0f, 0f, 100, default(Color), 1f); + Main.dust[num162].noGravity = true; + Main.dust[num162].fadeIn = 1.5f; + Main.dust[num162].velocity *= 0.25f; + } + } + } + } + } + } + } + } + } + if (this.magmaStone) + { + int num163 = Dust.NewDust(new Vector2((float)rectangle.X, (float)rectangle.Y), rectangle.Width, rectangle.Height, 6, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num163].noGravity = true; + Dust expr_9FFA_cp_0 = Main.dust[num163]; + expr_9FFA_cp_0.velocity.X = expr_9FFA_cp_0.velocity.X * 2f; + Dust expr_A018_cp_0 = Main.dust[num163]; + expr_A018_cp_0.velocity.Y = expr_A018_cp_0.velocity.Y * 2f; + } + if (Main.myPlayer == i && this.inventory[this.selectedItem].type != 1450) + { + int num164 = (int)((float)this.inventory[this.selectedItem].damage * this.meleeDamage); + float num165 = this.inventory[this.selectedItem].knockBack; + if (this.kbGlove) + { + num165 *= 2f; + } + int num166 = rectangle.X / 16; + int num167 = (rectangle.X + rectangle.Width) / 16 + 1; + int num168 = rectangle.Y / 16; + int num169 = (rectangle.Y + rectangle.Height) / 16 + 1; + for (int num170 = num166; num170 < num167; num170++) + { + for (int num171 = num168; num171 < num169; num171++) + { + if (Main.tile[num170, num171] != null && Main.tileCut[(int)Main.tile[num170, num171].type] && Main.tile[num170, num171 + 1] != null && Main.tile[num170, num171 + 1].type != 78) + { + WorldGen.KillTile(num170, num171, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num170, (float)num171, 0f, 0); + } + } + } + } + for (int num172 = 0; num172 < 200; num172++) + { + if (Main.npc[num172].active && Main.npc[num172].immune[i] == 0 && this.attackCD == 0 && !Main.npc[num172].dontTakeDamage && (!Main.npc[num172].friendly || (Main.npc[num172].type == 22 && this.killGuide) || (Main.npc[num172].type == 54 && this.killClothier))) + { + Rectangle value = new Rectangle((int)Main.npc[num172].position.X, (int)Main.npc[num172].position.Y, Main.npc[num172].width, Main.npc[num172].height); + if (rectangle.Intersects(value) && (Main.npc[num172].noTileCollide || Collision.CanHit(this.position, this.width, this.height, Main.npc[num172].position, Main.npc[num172].width, Main.npc[num172].height))) + { + bool flag12 = false; + if (Main.rand.Next(1, 101) <= this.meleeCrit) + { + flag12 = true; + } + int num173 = Main.DamageVar((float)num164); + this.StatusNPC(this.inventory[this.selectedItem].type, num172); + this.onHit(Main.npc[num172].center().X, Main.npc[num172].center().Y); + Main.npc[num172].StrikeNPC(num173, num165, this.direction, flag12, false); + if (this.meleeEnchant == 7) + { + Projectile.NewProjectile(Main.npc[num172].center().X, Main.npc[num172].center().Y, Main.npc[num172].velocity.X, Main.npc[num172].velocity.Y, 289, 0, 0f, this.whoAmi, 0f, 0f); + } + if (this.inventory[this.selectedItem].type == 1123) + { + int num174 = Main.rand.Next(1, 4); + for (int num175 = 0; num175 < num174; num175++) + { + float num176 = (float)(this.direction * 2) + (float)Main.rand.Next(-35, 36) * 0.02f; + float num177 = (float)Main.rand.Next(-35, 36) * 0.02f; + num176 *= 0.2f; + num177 *= 0.2f; + Projectile.NewProjectile((float)(rectangle.X + rectangle.Width / 2), (float)(rectangle.Y + rectangle.Height / 2), num176, num177, 181, num173 / 3, 0f, i, 0f, 0f); + } + } + if (Main.npc[num172].value > 0f && this.coins && Main.rand.Next(5) == 0) + { + int type5 = 71; + if (Main.rand.Next(10) == 0) + { + type5 = 72; + } + if (Main.rand.Next(100) == 0) + { + type5 = 73; + } + int num178 = Item.NewItem((int)Main.npc[num172].position.X, (int)Main.npc[num172].position.Y, Main.npc[num172].width, Main.npc[num172].height, type5, 1, false, 0, false); + Main.item[num178].stack = Main.rand.Next(1, 11); + Main.item[num178].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num178].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)this.direction; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num178, 0f, 0f, 0f, 0); + } + } + if (Main.netMode != 0) + { + if (flag12) + { + NetMessage.SendData(28, -1, -1, "", num172, (float)num173, num165, (float)this.direction, 1); + } + else + { + NetMessage.SendData(28, -1, -1, "", num172, (float)num173, num165, (float)this.direction, 0); + } + } + Main.npc[num172].immune[i] = this.itemAnimation; + this.attackCD = (int)((double)this.itemAnimationMax * 0.33); + } + } + } + if (this.hostile) + { + for (int num179 = 0; num179 < 255; num179++) + { + if (num179 != i && Main.player[num179].active && Main.player[num179].hostile && !Main.player[num179].immune && !Main.player[num179].dead && (Main.player[i].team == 0 || Main.player[i].team != Main.player[num179].team)) + { + Rectangle value2 = new Rectangle((int)Main.player[num179].position.X, (int)Main.player[num179].position.Y, Main.player[num179].width, Main.player[num179].height); + if (rectangle.Intersects(value2) && Collision.CanHit(this.position, this.width, this.height, Main.player[num179].position, Main.player[num179].width, Main.player[num179].height)) + { + bool flag13 = false; + if (Main.rand.Next(1, 101) <= 10) + { + flag13 = true; + } + int num180 = Main.DamageVar((float)num164); + this.StatusPvP(this.inventory[this.selectedItem].type, num179); + this.onHit(Main.player[num179].center().X, Main.player[num179].center().Y); + Main.player[num179].Hurt(num180, this.direction, true, false, "", flag13); + if (this.meleeEnchant == 7) + { + Projectile.NewProjectile(Main.player[num179].center().X, Main.player[num179].center().Y, Main.player[num179].velocity.X, Main.player[num179].velocity.Y, 289, 0, 0f, this.whoAmi, 0f, 0f); + } + if (this.inventory[this.selectedItem].type == 1123) + { + int num181 = Main.rand.Next(1, 4); + for (int num182 = 0; num182 < num181; num182++) + { + float num183 = (float)(this.direction * 2) + (float)Main.rand.Next(-35, 36) * 0.02f; + float num184 = (float)Main.rand.Next(-35, 36) * 0.02f; + num183 *= 0.2f; + num184 *= 0.2f; + Projectile.NewProjectile((float)(rectangle.X + rectangle.Width / 2), (float)(rectangle.Y + rectangle.Height / 2), num183, num184, 181, num180 / 3, 0f, i, 0f, 0f); + } + } + if (Main.netMode != 0) + { + if (flag13) + { + NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.whoAmi, -1, -1, -1), num179, (float)this.direction, (float)num180, 1f, 1); + } + else + { + NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.whoAmi, -1, -1, -1), num179, (float)this.direction, (float)num180, 1f, 0); + } + } + this.attackCD = (int)((double)this.itemAnimationMax * 0.33); + } + } + } + } + if (this.inventory[this.selectedItem].type == 787 && (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.1) || this.itemAnimation == (int)((double)this.itemAnimationMax * 0.3) || this.itemAnimation == (int)((double)this.itemAnimationMax * 0.5) || this.itemAnimation == (int)((double)this.itemAnimationMax * 0.7) || this.itemAnimation == (int)((double)this.itemAnimationMax * 0.9))) + { + float num185 = 0f; + float num186 = 0f; + float num187 = 0f; + float num188 = 0f; + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.9)) + { + num185 = -7f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.7)) + { + num185 = -6f; + num186 = 2f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.5)) + { + num185 = -4f; + num186 = 4f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.3)) + { + num185 = -2f; + num186 = 6f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.1)) + { + num186 = 7f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.7)) + { + num188 = 26f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.3)) + { + num188 -= 4f; + num187 -= 20f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.1)) + { + num187 += 6f; + } + if (this.direction == -1) + { + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.9)) + { + num188 -= 8f; + } + if (this.itemAnimation == (int)((double)this.itemAnimationMax * 0.7)) + { + num188 -= 6f; + } + } + num185 *= 1.5f; + num186 *= 1.5f; + num188 *= (float)this.direction; + num187 *= this.gravDir; + Projectile.NewProjectile((float)(rectangle.X + rectangle.Width / 2) + num188, (float)(rectangle.Y + rectangle.Height / 2) + num187, (float)this.direction * num186, num185 * this.gravDir, 131, num164 / 2, 0f, i, 0f, 0f); + } + } + } + } + if (this.itemTime == 0 && this.itemAnimation > 0) + { + if (this.inventory[this.selectedItem].healLife > 0) + { + this.statLife += this.inventory[this.selectedItem].healLife; + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.myPlayer == this.whoAmi) + { + this.HealEffect(this.inventory[this.selectedItem].healLife, true); + } + } + if (this.inventory[this.selectedItem].healMana > 0) + { + this.statMana += this.inventory[this.selectedItem].healMana; + this.itemTime = this.inventory[this.selectedItem].useTime; + if (Main.myPlayer == this.whoAmi) + { + this.ManaEffect(this.inventory[this.selectedItem].healMana); + } + } + if (this.inventory[this.selectedItem].buffType > 0) + { + if (this.whoAmi == Main.myPlayer) + { + this.AddBuff(this.inventory[this.selectedItem].buffType, this.inventory[this.selectedItem].buffTime, true); + } + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + if (this.whoAmi == Main.myPlayer) + { + if (this.itemTime == 0 && this.itemAnimation > 0 && this.inventory[this.selectedItem].type == 361) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + if (Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(1); + } + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, -1f, 0f, 0f, 0); + } + } + if (this.itemTime == 0 && this.itemAnimation > 0 && this.inventory[this.selectedItem].type == 602) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + if (Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(2); + } + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, -2f, 0f, 0f, 0); + } + } + if (this.itemTime == 0 && this.itemAnimation > 0 && this.inventory[this.selectedItem].type == 1315) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + if (Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(3); + } + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, -3f, 0f, 0f, 0); + } + } + if (this.itemTime == 0 && this.itemAnimation > 0 && (this.inventory[this.selectedItem].type == 43 || this.inventory[this.selectedItem].type == 70 || this.inventory[this.selectedItem].type == 544 || this.inventory[this.selectedItem].type == 556 || this.inventory[this.selectedItem].type == 557 || this.inventory[this.selectedItem].type == 560 || this.inventory[this.selectedItem].type == 1133 || this.inventory[this.selectedItem].type == 1331)) + { + bool flag14 = false; + for (int num189 = 0; num189 < 200; num189++) + { + if (Main.npc[num189].active && ((this.inventory[this.selectedItem].type == 43 && Main.npc[num189].type == 4) || (this.inventory[this.selectedItem].type == 70 && Main.npc[num189].type == 13) || ((this.inventory[this.selectedItem].type == 560 & Main.npc[num189].type == 50) || (this.inventory[this.selectedItem].type == 544 && Main.npc[num189].type == 125)) || (this.inventory[this.selectedItem].type == 544 && Main.npc[num189].type == 126) || (this.inventory[this.selectedItem].type == 556 && Main.npc[num189].type == 134) || (this.inventory[this.selectedItem].type == 557 && Main.npc[num189].type == 128) || (this.inventory[this.selectedItem].type == 1133 && Main.npc[num189].type == 222) || (this.inventory[this.selectedItem].type == 1331 && Main.npc[num189].type == 266))) + { + flag14 = true; + break; + } + } + if (flag14) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + } + else + { + if (this.inventory[this.selectedItem].type == 560) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 50); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 50f, 0f, 0f, 0); + } + } + else + { + if (this.inventory[this.selectedItem].type == 43) + { + if (!Main.dayTime) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 4); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 4f, 0f, 0f, 0); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 70) + { + if (this.zoneEvil) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 13); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 13f, 0f, 0f, 0); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 544) + { + if (!Main.dayTime) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 125); + NPC.SpawnOnPlayer(i, 126); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 125f, 0f, 0f, 0); + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 126f, 0f, 0f, 0); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 556) + { + if (!Main.dayTime) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 134); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 134f, 0f, 0f, 0); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 557) + { + if (!Main.dayTime) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 127); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 127f, 0f, 0f, 0); + } + } + } + else + { + if (this.inventory[this.selectedItem].type == 1133) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 222); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 222f, 0f, 0f, 0); + } + } + else + { + if (this.inventory[this.selectedItem].type == 1331 && this.zoneBlood) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(15, (int)this.position.X, (int)this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 266); + } + else + { + NetMessage.SendData(61, -1, -1, "", this.whoAmi, 266f, 0f, 0f, 0); + } + } + } + } + } + } + } + } + } + } + } + } + if (this.inventory[this.selectedItem].type == 50 && this.itemAnimation > 0) + { + if (Main.rand.Next(2) == 0) + { + Dust.NewDust(this.position, this.width, this.height, 15, 0f, 0f, 150, default(Color), 1.1f); + } + if (this.itemTime == 0) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + } + else + { + if (this.itemTime == this.inventory[this.selectedItem].useTime / 2) + { + for (int num190 = 0; num190 < 70; num190++) + { + Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.5f); + } + this.grappling[0] = -1; + this.grapCount = 0; + for (int num191 = 0; num191 < 1000; num191++) + { + if (Main.projectile[num191].active && Main.projectile[num191].owner == i && Main.projectile[num191].aiStyle == 7) + { + Main.projectile[num191].Kill(); + } + } + this.Spawn(); + for (int num192 = 0; num192 < 70; num192++) + { + Dust.NewDust(this.position, this.width, this.height, 15, 0f, 0f, 150, default(Color), 1.5f); + } + } + } + } + if (i == Main.myPlayer) + { + if (this.itemTime == this.inventory[this.selectedItem].useTime && this.inventory[this.selectedItem].tileWand > 0) + { + int tileWand2 = this.inventory[this.selectedItem].tileWand; + int num193 = 0; + while (num193 < 58) + { + if (tileWand2 == this.inventory[num193].type && this.inventory[num193].stack > 0) + { + this.inventory[num193].stack--; + if (this.inventory[num193].stack <= 0) + { + this.inventory[num193] = new Item(); + break; + } + break; + } + else + { + num193++; + } + } + } + if (this.itemTime == this.inventory[this.selectedItem].useTime && this.inventory[this.selectedItem].consumable) + { + bool flag15 = true; + if (this.inventory[this.selectedItem].ranged) + { + if (this.ammoCost80 && Main.rand.Next(5) == 0) + { + flag15 = false; + } + if (this.ammoCost75 && Main.rand.Next(4) == 0) + { + flag15 = false; + } + } + if (flag15) + { + if (this.inventory[this.selectedItem].stack > 0) + { + this.inventory[this.selectedItem].stack--; + } + if (this.inventory[this.selectedItem].stack <= 0) + { + this.itemTime = this.itemAnimation; + } + } + } + if (this.inventory[this.selectedItem].stack <= 0 && this.itemAnimation == 0) + { + this.inventory[this.selectedItem] = new Item(); + } + if (this.selectedItem == 58) + { + if (this.itemAnimation == 0) + { + return; + } + Main.mouseItem = (Item)this.inventory[this.selectedItem].Clone(); + } + } + } + public Color GetImmuneAlpha(Color newColor) + { + float num = (float)(255 - this.immuneAlpha) / 255f; + if (this.shadow > 0f) + { + num *= 1f - this.shadow; + } + if (this.immuneAlpha > 125) + { + return new Color(0, 0, 0, 0); + } + int r = (int)((float)newColor.R * num); + int g = (int)((float)newColor.G * num); + int b = (int)((float)newColor.B * num); + int num2 = (int)((float)newColor.A * num); + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + return new Color(r, g, b, num2); + } + public Color GetImmuneAlpha2(Color newColor) + { + float num = (float)(255 - this.immuneAlpha) / 255f; + if (this.shadow > 0f) + { + num *= 1f - this.shadow; + } + int r = (int)((float)newColor.R * num); + int g = (int)((float)newColor.G * num); + int b = (int)((float)newColor.B * num); + int num2 = (int)((float)newColor.A * num); + if (num2 < 0) + { + num2 = 0; + } + if (num2 > 255) + { + num2 = 255; + } + return new Color(r, g, b, num2); + } + public Color GetDeathAlpha(Color newColor) + { + int r = (int)newColor.R + (int)((double)this.immuneAlpha * 0.9); + int g = (int)newColor.G + (int)((double)this.immuneAlpha * 0.5); + int b = (int)newColor.B + (int)((double)this.immuneAlpha * 0.5); + int num = (int)newColor.A + (int)((double)this.immuneAlpha * 0.4); + if (num < 0) + { + num = 0; + } + if (num > 255) + { + num = 255; + } + return new Color(r, g, b, num); + } + public void DropCoins() + { + for (int i = 0; i < 59; i++) + { + if (this.inventory[i].type >= 71 && this.inventory[i].type <= 74) + { + int num = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, this.inventory[i].type, 1, false, 0, false); + int num2 = this.inventory[i].stack / 2; + num2 = this.inventory[i].stack - num2; + this.inventory[i].stack -= num2; + if (this.inventory[i].stack <= 0) + { + this.inventory[i] = new Item(); + } + Main.item[num].stack = num2; + Main.item[num].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f; + Main.item[num].noGrabDelay = 100; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num, 0f, 0f, 0f, 0); + } + if (i == 58) + { + Main.mouseItem = (Item)this.inventory[i].Clone(); + } + } + } + } + public void DropItems() + { + for (int i = 0; i < 59; i++) + { + if (this.inventory[i].stack > 0 && this.inventory[i].name != "Copper Pickaxe" && this.inventory[i].name != "Copper Axe" && this.inventory[i].name != "Copper Shortsword") + { + int num = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, this.inventory[i].type, 1, false, 0, false); + Main.item[num].SetDefaults(this.inventory[i].name); + Main.item[num].Prefix((int)this.inventory[i].prefix); + Main.item[num].stack = this.inventory[i].stack; + Main.item[num].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f; + Main.item[num].noGrabDelay = 100; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num, 0f, 0f, 0f, 0); + } + } + this.inventory[i] = new Item(); + if (i < 11) + { + if (this.armor[i].stack > 0) + { + int num2 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, this.armor[i].type, 1, false, 0, false); + Main.item[num2].SetDefaults(this.armor[i].name); + Main.item[num2].Prefix((int)this.armor[i].prefix); + Main.item[num2].stack = this.armor[i].stack; + Main.item[num2].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num2].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f; + Main.item[num2].noGrabDelay = 100; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num2, 0f, 0f, 0f, 0); + } + } + this.armor[i] = new Item(); + } + } + this.inventory[0].SetDefaults("Copper Shortsword"); + this.inventory[0].Prefix(-1); + this.inventory[1].SetDefaults("Copper Pickaxe"); + this.inventory[1].Prefix(-1); + this.inventory[2].SetDefaults("Copper Axe"); + this.inventory[2].Prefix(-1); + Main.mouseItem = new Item(); + } + public object Clone() + { + return base.MemberwiseClone(); + } + public object clientClone() + { + Player player = new Player(); + player.zoneEvil = this.zoneEvil; + player.zoneMeteor = this.zoneMeteor; + player.zoneDungeon = this.zoneDungeon; + player.zoneJungle = this.zoneJungle; + player.zoneHoly = this.zoneHoly; + player.zoneSnow = this.zoneSnow; + player.zoneBlood = this.zoneBlood; + player.zoneCandle = this.zoneCandle; + player.direction = this.direction; + player.selectedItem = this.selectedItem; + player.controlUp = this.controlUp; + player.controlDown = this.controlDown; + player.controlLeft = this.controlLeft; + player.controlRight = this.controlRight; + player.controlJump = this.controlJump; + player.controlUseItem = this.controlUseItem; + player.statLife = this.statLife; + player.statLifeMax = this.statLifeMax; + player.statMana = this.statMana; + player.statManaMax = this.statManaMax; + player.position.X = this.position.X; + player.chest = this.chest; + player.talkNPC = this.talkNPC; + for (int i = 0; i < 59; i++) + { + player.inventory[i] = (Item)this.inventory[i].Clone(); + if (i < 11) + { + player.armor[i] = (Item)this.armor[i].Clone(); + } + if (i < 3) + { + player.dye[i] = (Item)this.dye[i].Clone(); + } + } + for (int j = 0; j < 10; j++) + { + player.buffType[j] = this.buffType[j]; + player.buffTime[j] = this.buffTime[j]; + } + return player; + } + private static void EncryptFile(string inputFile, string outputFile) + { + string s = "h3y_gUyZ"; + UnicodeEncoding unicodeEncoding = new UnicodeEncoding(); + byte[] bytes = unicodeEncoding.GetBytes(s); + FileStream fileStream = new FileStream(outputFile, FileMode.Create); + RijndaelManaged rijndaelManaged = new RijndaelManaged(); + CryptoStream cryptoStream = new CryptoStream(fileStream, rijndaelManaged.CreateEncryptor(bytes, bytes), CryptoStreamMode.Write); + FileStream fileStream2 = new FileStream(inputFile, FileMode.Open); + int num; + while ((num = fileStream2.ReadByte()) != -1) + { + cryptoStream.WriteByte((byte)num); + } + fileStream2.Close(); + cryptoStream.Close(); + fileStream.Close(); + } + private static bool DecryptFile(string inputFile, string outputFile) + { + string s = "h3y_gUyZ"; + UnicodeEncoding unicodeEncoding = new UnicodeEncoding(); + byte[] bytes = unicodeEncoding.GetBytes(s); + FileStream fileStream = new FileStream(inputFile, FileMode.Open); + RijndaelManaged rijndaelManaged = new RijndaelManaged(); + CryptoStream cryptoStream = new CryptoStream(fileStream, rijndaelManaged.CreateDecryptor(bytes, bytes), CryptoStreamMode.Read); + FileStream fileStream2 = new FileStream(outputFile, FileMode.Create); + try + { + int num; + while ((num = cryptoStream.ReadByte()) != -1) + { + fileStream2.WriteByte((byte)num); + } + fileStream2.Close(); + cryptoStream.Close(); + fileStream.Close(); + } + catch + { + fileStream2.Close(); + fileStream.Close(); + File.Delete(outputFile); + return true; + } + return false; + } + public static bool CheckSpawn(int x, int y) + { + if (x < 10 || x > Main.maxTilesX - 10 || y < 10 || y > Main.maxTilesX - 10) + { + return false; + } + if (Main.tile[x, y - 1] == null) + { + return false; + } + if (!Main.tile[x, y - 1].active() || Main.tile[x, y - 1].type != 79) + { + return false; + } + for (int i = x - 1; i <= x + 1; i++) + { + for (int j = y - 3; j < y; j++) + { + if (Main.tile[i, j] == null) + { + return false; + } + if (Main.tile[i, j].nactive() && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + Main.NewText("There is not enough space", 255, 240, 20, false); + return false; + } + } + } + return WorldGen.StartRoomCheck(x, y - 1); + } + public void FindSpawn() + { + for (int i = 0; i < 200; i++) + { + if (this.spN[i] == null) + { + this.SpawnX = -1; + this.SpawnY = -1; + return; + } + if (this.spN[i] == Main.worldName && this.spI[i] == Main.worldID) + { + this.SpawnX = this.spX[i]; + this.SpawnY = this.spY[i]; + return; + } + } + } + public void ChangeSpawn(int x, int y) + { + int num = 0; + while (num < 200 && this.spN[num] != null) + { + if (this.spN[num] == Main.worldName && this.spI[num] == Main.worldID) + { + for (int i = num; i > 0; i--) + { + this.spN[i] = this.spN[i - 1]; + this.spI[i] = this.spI[i - 1]; + this.spX[i] = this.spX[i - 1]; + this.spY[i] = this.spY[i - 1]; + } + this.spN[0] = Main.worldName; + this.spI[0] = Main.worldID; + this.spX[0] = x; + this.spY[0] = y; + return; + } + num++; + } + for (int j = 199; j > 0; j--) + { + if (this.spN[j - 1] != null) + { + this.spN[j] = this.spN[j - 1]; + this.spI[j] = this.spI[j - 1]; + this.spX[j] = this.spX[j - 1]; + this.spY[j] = this.spY[j - 1]; + } + } + this.spN[0] = Main.worldName; + this.spI[0] = Main.worldID; + this.spX[0] = x; + this.spY[0] = y; + } + public static void SavePlayer(Player newPlayer, string playerPath) + { + try + { + if (Main.mapEnabled) + { + Map.saveMap(); + } + } + catch + { + } + try + { + Directory.CreateDirectory(Main.PlayerPath); + } + catch + { + } + if (Main.ServerSideCharacter) + { + return; + } + if (playerPath == null || playerPath == "") + { + return; + } + string destFileName = playerPath + ".bak"; + if (File.Exists(playerPath)) + { + File.Copy(playerPath, destFileName, true); + } + string text = playerPath + ".dat"; + using (FileStream fileStream = new FileStream(text, FileMode.Create)) + { + using (BinaryWriter binaryWriter = new BinaryWriter(fileStream)) + { + binaryWriter.Write(Main.curRelease); + binaryWriter.Write(newPlayer.name); + binaryWriter.Write(newPlayer.difficulty); + binaryWriter.Write(newPlayer.hair); + binaryWriter.Write(newPlayer.male); + binaryWriter.Write(newPlayer.statLife); + binaryWriter.Write(newPlayer.statLifeMax); + binaryWriter.Write(newPlayer.statMana); + binaryWriter.Write(newPlayer.statManaMax); + binaryWriter.Write(newPlayer.hairColor.R); + binaryWriter.Write(newPlayer.hairColor.G); + binaryWriter.Write(newPlayer.hairColor.B); + binaryWriter.Write(newPlayer.skinColor.R); + binaryWriter.Write(newPlayer.skinColor.G); + binaryWriter.Write(newPlayer.skinColor.B); + binaryWriter.Write(newPlayer.eyeColor.R); + binaryWriter.Write(newPlayer.eyeColor.G); + binaryWriter.Write(newPlayer.eyeColor.B); + binaryWriter.Write(newPlayer.shirtColor.R); + binaryWriter.Write(newPlayer.shirtColor.G); + binaryWriter.Write(newPlayer.shirtColor.B); + binaryWriter.Write(newPlayer.underShirtColor.R); + binaryWriter.Write(newPlayer.underShirtColor.G); + binaryWriter.Write(newPlayer.underShirtColor.B); + binaryWriter.Write(newPlayer.pantsColor.R); + binaryWriter.Write(newPlayer.pantsColor.G); + binaryWriter.Write(newPlayer.pantsColor.B); + binaryWriter.Write(newPlayer.shoeColor.R); + binaryWriter.Write(newPlayer.shoeColor.G); + binaryWriter.Write(newPlayer.shoeColor.B); + for (int i = 0; i < 11; i++) + { + if (newPlayer.armor[i].name == null) + { + newPlayer.armor[i].name = ""; + } + binaryWriter.Write(newPlayer.armor[i].netID); + binaryWriter.Write(newPlayer.armor[i].prefix); + } + for (int j = 0; j < 3; j++) + { + binaryWriter.Write(newPlayer.dye[j].netID); + binaryWriter.Write(newPlayer.dye[j].prefix); + } + for (int k = 0; k < 58; k++) + { + if (newPlayer.inventory[k].name == null) + { + newPlayer.inventory[k].name = ""; + } + binaryWriter.Write(newPlayer.inventory[k].netID); + binaryWriter.Write(newPlayer.inventory[k].stack); + binaryWriter.Write(newPlayer.inventory[k].prefix); + } + for (int l = 0; l < Chest.maxItems; l++) + { + if (newPlayer.bank[l].name == null) + { + newPlayer.bank[l].name = ""; + } + binaryWriter.Write(newPlayer.bank[l].netID); + binaryWriter.Write(newPlayer.bank[l].stack); + binaryWriter.Write(newPlayer.bank[l].prefix); + } + for (int m = 0; m < Chest.maxItems; m++) + { + if (newPlayer.bank2[m].name == null) + { + newPlayer.bank2[m].name = ""; + } + binaryWriter.Write(newPlayer.bank2[m].netID); + binaryWriter.Write(newPlayer.bank2[m].stack); + binaryWriter.Write(newPlayer.bank2[m].prefix); + } + for (int n = 0; n < 10; n++) + { + binaryWriter.Write(newPlayer.buffType[n]); + binaryWriter.Write(newPlayer.buffTime[n]); + } + for (int num = 0; num < 200; num++) + { + if (newPlayer.spN[num] == null) + { + binaryWriter.Write(-1); + break; + } + binaryWriter.Write(newPlayer.spX[num]); + binaryWriter.Write(newPlayer.spY[num]); + binaryWriter.Write(newPlayer.spI[num]); + binaryWriter.Write(newPlayer.spN[num]); + } + binaryWriter.Write(newPlayer.hbLocked); + binaryWriter.Close(); + } + } + Player.EncryptFile(text, playerPath); + File.Delete(text); + } + public static Player LoadPlayer(string playerPath) + { + bool flag = false; + if (Main.rand == null) + { + Main.rand = new Random((int)DateTime.Now.Ticks); + } + Player player = new Player(); + try + { + string text = playerPath + ".dat"; + flag = Player.DecryptFile(playerPath, text); + if (!flag) + { + using (FileStream fileStream = new FileStream(text, FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader(fileStream)) + { + int num = binaryReader.ReadInt32(); + player.name = binaryReader.ReadString(); + if (num >= 10) + { + if (num >= 17) + { + player.difficulty = binaryReader.ReadByte(); + } + else + { + bool flag2 = binaryReader.ReadBoolean(); + if (flag2) + { + player.difficulty = 2; + } + } + } + player.hair = binaryReader.ReadInt32(); + if (num <= 17) + { + if (player.hair == 5 || player.hair == 6 || player.hair == 9 || player.hair == 11) + { + player.male = false; + } + else + { + player.male = true; + } + } + else + { + player.male = binaryReader.ReadBoolean(); + } + player.statLife = binaryReader.ReadInt32(); + player.statLifeMax = binaryReader.ReadInt32(); + if (player.statLifeMax > 500) + { + player.statLifeMax = 500; + } + if (player.statLife > player.statLifeMax) + { + player.statLife = player.statLifeMax; + } + player.statMana = binaryReader.ReadInt32(); + player.statManaMax = binaryReader.ReadInt32(); + if (player.statManaMax > 200) + { + player.statManaMax = 200; + } + if (player.statMana > 400) + { + player.statMana = 400; + } + player.hairColor.R = binaryReader.ReadByte(); + player.hairColor.G = binaryReader.ReadByte(); + player.hairColor.B = binaryReader.ReadByte(); + player.skinColor.R = binaryReader.ReadByte(); + player.skinColor.G = binaryReader.ReadByte(); + player.skinColor.B = binaryReader.ReadByte(); + player.eyeColor.R = binaryReader.ReadByte(); + player.eyeColor.G = binaryReader.ReadByte(); + player.eyeColor.B = binaryReader.ReadByte(); + player.shirtColor.R = binaryReader.ReadByte(); + player.shirtColor.G = binaryReader.ReadByte(); + player.shirtColor.B = binaryReader.ReadByte(); + player.underShirtColor.R = binaryReader.ReadByte(); + player.underShirtColor.G = binaryReader.ReadByte(); + player.underShirtColor.B = binaryReader.ReadByte(); + player.pantsColor.R = binaryReader.ReadByte(); + player.pantsColor.G = binaryReader.ReadByte(); + player.pantsColor.B = binaryReader.ReadByte(); + player.shoeColor.R = binaryReader.ReadByte(); + player.shoeColor.G = binaryReader.ReadByte(); + player.shoeColor.B = binaryReader.ReadByte(); + Main.player[Main.myPlayer].shirtColor = player.shirtColor; + Main.player[Main.myPlayer].pantsColor = player.pantsColor; + Main.player[Main.myPlayer].hairColor = player.hairColor; + if (num >= 38) + { + for (int i = 0; i < 11; i++) + { + player.armor[i].netDefaults(binaryReader.ReadInt32()); + player.armor[i].Prefix((int)binaryReader.ReadByte()); + } + if (num >= 47) + { + for (int j = 0; j < 3; j++) + { + player.dye[j].netDefaults(binaryReader.ReadInt32()); + player.dye[j].Prefix((int)binaryReader.ReadByte()); + } + } + if (num >= 58) + { + for (int k = 0; k < 58; k++) + { + int num2 = binaryReader.ReadInt32(); + if (num2 >= 1725) + { + player.inventory[k].netDefaults(0); + } + else + { + player.inventory[k].netDefaults(num2); + player.inventory[k].stack = binaryReader.ReadInt32(); + player.inventory[k].Prefix((int)binaryReader.ReadByte()); + } + } + } + else + { + for (int l = 0; l < 48; l++) + { + int num3 = binaryReader.ReadInt32(); + if (num3 >= 1725) + { + player.inventory[l].netDefaults(0); + } + else + { + player.inventory[l].netDefaults(num3); + player.inventory[l].stack = binaryReader.ReadInt32(); + player.inventory[l].Prefix((int)binaryReader.ReadByte()); + } + } + } + if (num >= 58) + { + for (int m = 0; m < 40; m++) + { + player.bank[m].netDefaults(binaryReader.ReadInt32()); + player.bank[m].stack = binaryReader.ReadInt32(); + player.bank[m].Prefix((int)binaryReader.ReadByte()); + } + for (int n = 0; n < 40; n++) + { + player.bank2[n].netDefaults(binaryReader.ReadInt32()); + player.bank2[n].stack = binaryReader.ReadInt32(); + player.bank2[n].Prefix((int)binaryReader.ReadByte()); + } + } + else + { + for (int num4 = 0; num4 < 20; num4++) + { + player.bank[num4].netDefaults(binaryReader.ReadInt32()); + player.bank[num4].stack = binaryReader.ReadInt32(); + player.bank[num4].Prefix((int)binaryReader.ReadByte()); + } + for (int num5 = 0; num5 < 20; num5++) + { + player.bank2[num5].netDefaults(binaryReader.ReadInt32()); + player.bank2[num5].stack = binaryReader.ReadInt32(); + player.bank2[num5].Prefix((int)binaryReader.ReadByte()); + } + } + } + else + { + for (int num6 = 0; num6 < 8; num6++) + { + player.armor[num6].SetDefaults(Item.VersionName(binaryReader.ReadString(), num)); + if (num >= 36) + { + player.armor[num6].Prefix((int)binaryReader.ReadByte()); + } + } + if (num >= 6) + { + for (int num7 = 8; num7 < 11; num7++) + { + player.armor[num7].SetDefaults(Item.VersionName(binaryReader.ReadString(), num)); + if (num >= 36) + { + player.armor[num7].Prefix((int)binaryReader.ReadByte()); + } + } + } + for (int num8 = 0; num8 < 44; num8++) + { + player.inventory[num8].SetDefaults(Item.VersionName(binaryReader.ReadString(), num)); + player.inventory[num8].stack = binaryReader.ReadInt32(); + if (num >= 36) + { + player.inventory[num8].Prefix((int)binaryReader.ReadByte()); + } + } + if (num >= 15) + { + for (int num9 = 44; num9 < 48; num9++) + { + player.inventory[num9].SetDefaults(Item.VersionName(binaryReader.ReadString(), num)); + player.inventory[num9].stack = binaryReader.ReadInt32(); + if (num >= 36) + { + player.inventory[num9].Prefix((int)binaryReader.ReadByte()); + } + } + } + for (int num10 = 0; num10 < 20; num10++) + { + player.bank[num10].SetDefaults(Item.VersionName(binaryReader.ReadString(), num)); + player.bank[num10].stack = binaryReader.ReadInt32(); + if (num >= 36) + { + player.bank[num10].Prefix((int)binaryReader.ReadByte()); + } + } + if (num >= 20) + { + for (int num11 = 0; num11 < 20; num11++) + { + player.bank2[num11].SetDefaults(Item.VersionName(binaryReader.ReadString(), num)); + player.bank2[num11].stack = binaryReader.ReadInt32(); + if (num >= 36) + { + player.bank2[num11].Prefix((int)binaryReader.ReadByte()); + } + } + } + } + if (num < 58) + { + for (int num12 = 40; num12 < 48; num12++) + { + player.inventory[num12 + 10] = (Item)player.inventory[num12].Clone(); + player.inventory[num12].SetDefaults(0, false); + } + } + if (num >= 11) + { + for (int num13 = 0; num13 < 10; num13++) + { + player.buffType[num13] = binaryReader.ReadInt32(); + player.buffTime[num13] = binaryReader.ReadInt32(); + } + } + for (int num14 = 0; num14 < 200; num14++) + { + int num15 = binaryReader.ReadInt32(); + if (num15 == -1) + { + break; + } + player.spX[num14] = num15; + player.spY[num14] = binaryReader.ReadInt32(); + player.spI[num14] = binaryReader.ReadInt32(); + player.spN[num14] = binaryReader.ReadString(); + } + if (num >= 16) + { + player.hbLocked = binaryReader.ReadBoolean(); + } + binaryReader.Close(); + } + } + player.PlayerFrame(); + File.Delete(text); + Player result = player; + return result; + } + } + catch + { + flag = true; + } + if (flag) + { + try + { + string text2 = playerPath + ".bak"; + Player result; + if (File.Exists(text2)) + { + File.Delete(playerPath); + File.Move(text2, playerPath); + result = Player.LoadPlayer(playerPath); + return result; + } + result = new Player(); + return result; + } + catch + { + Player result = new Player(); + return result; + } + } + return new Player(); + } + public bool HasItem(int type) + { + for (int i = 0; i < 58; i++) + { + if (type == this.inventory[i].type && this.inventory[i].stack > 0) + { + return true; + } + } + return false; + } + public void QuickGrapple() + { + if (this.noItems) + { + return; + } + int num = -1; + for (int i = 0; i < 58; i++) + { + if (this.inventory[i].shoot == 13 || this.inventory[i].shoot == 32 || this.inventory[i].shoot == 73 || this.inventory[i].shoot == 165 || (this.inventory[i].shoot >= 230 && this.inventory[i].shoot <= 235) || this.inventory[i].shoot == 256) + { + num = i; + break; + } + } + if (num < 0) + { + return; + } + if (this.inventory[num].shoot == 73) + { + int num2 = 0; + if (num >= 0) + { + for (int j = 0; j < 1000; j++) + { + if (Main.projectile[j].active && Main.projectile[j].owner == Main.myPlayer && (Main.projectile[j].type == 73 || Main.projectile[j].type == 74)) + { + num2++; + } + } + } + if (num2 > 1) + { + num = -1; + } + } + else + { + if (this.inventory[num].shoot == 165) + { + int num3 = 0; + if (num >= 0) + { + for (int k = 0; k < 1000; k++) + { + if (Main.projectile[k].active && Main.projectile[k].owner == Main.myPlayer && Main.projectile[k].type == 165) + { + num3++; + } + } + } + if (num3 > 8) + { + num = -1; + } + } + else + { + if (num >= 0) + { + for (int l = 0; l < 1000; l++) + { + if (Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == this.inventory[num].shoot && Main.projectile[l].ai[0] != 2f) + { + num = -1; + break; + } + } + } + } + } + if (num >= 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, this.inventory[num].useSound); + if (Main.netMode == 1 && this.whoAmi == Main.myPlayer) + { + NetMessage.SendData(51, -1, -1, "", this.whoAmi, 2f, 0f, 0f, 0); + } + int num4 = this.inventory[num].shoot; + float shootSpeed = this.inventory[num].shootSpeed; + int damage = this.inventory[num].damage; + float knockBack = this.inventory[num].knockBack; + if (num4 == 13 || num4 == 32 || (num4 >= 230 && num4 <= 235)) + { + this.grappling[0] = -1; + this.grapCount = 0; + for (int m = 0; m < 1000; m++) + { + if (Main.projectile[m].active && Main.projectile[m].owner == this.whoAmi) + { + if (Main.projectile[m].type == 13) + { + Main.projectile[m].Kill(); + } + if (Main.projectile[m].type >= 230 && Main.projectile[m].type <= 235) + { + Main.projectile[m].Kill(); + } + } + } + } + if (num4 == 256) + { + int num5 = 0; + int num6 = -1; + int num7 = 100000; + for (int n = 0; n < 1000; n++) + { + if (Main.projectile[n].active && Main.projectile[n].owner == this.whoAmi && Main.projectile[n].type == 256) + { + num5++; + if (Main.projectile[n].timeLeft < num7) + { + num6 = n; + num7 = Main.projectile[n].timeLeft; + } + } + } + if (num5 > 1) + { + Main.projectile[num6].Kill(); + } + } + if (num4 == 73) + { + for (int num8 = 0; num8 < 1000; num8++) + { + if (Main.projectile[num8].active && Main.projectile[num8].owner == this.whoAmi && Main.projectile[num8].type == 73) + { + num4 = 74; + } + } + } + Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num9 = (float)Main.mouseX + Main.screenPosition.X - vector.X; + float num10 = (float)Main.mouseY + Main.screenPosition.Y - vector.Y; + if (this.gravDir == -1f) + { + num10 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector.Y; + } + float num11 = (float)Math.Sqrt((double)(num9 * num9 + num10 * num10)); + num11 = shootSpeed / num11; + num9 *= num11; + num10 *= num11; + Projectile.NewProjectile(vector.X, vector.Y, num9, num10, num4, damage, knockBack, this.whoAmi, 0f, 0f); + } + } + public Player() + { + for (int i = 0; i < 59; i++) + { + if (i < 11) + { + this.armor[i] = new Item(); + this.armor[i].name = ""; + } + this.inventory[i] = new Item(); + this.inventory[i].name = ""; + } + for (int j = 0; j < Chest.maxItems; j++) + { + this.bank[j] = new Item(); + this.bank[j].name = ""; + this.bank2[j] = new Item(); + this.bank2[j].name = ""; + } + for (int k = 0; k < 3; k++) + { + this.dye[k] = new Item(); + } + this.grappling[0] = -1; + this.inventory[0].SetDefaults("Copper Shortsword"); + this.inventory[1].SetDefaults("Copper Pickaxe"); + this.inventory[2].SetDefaults("Copper Axe"); + this.statManaMax = 20; + if (Main.cEd) + { + this.inventory[3].SetDefaults(603, false); + } + for (int l = 0; l < 251; l++) + { + this.adjTile[l] = false; + this.oldAdjTile[l] = false; + } + } + } +} diff --git a/Terraria/Program.cs b/Terraria/Program.cs new file mode 100644 index 0000000..51972d6 --- /dev/null +++ b/Terraria/Program.cs @@ -0,0 +1,85 @@ +using System; +using System.IO; +using System.Windows.Forms; +namespace Terraria +{ + internal static class Program + { + private static void Main(string[] args) + { + using (Main main = new Main()) + { + try + { + for (int i = 0; i < args.Length; i++) + { + if (args[i].ToLower() == "-port" || args[i].ToLower() == "-p") + { + i++; + try + { + int serverPort = Convert.ToInt32(args[i]); + Netplay.serverPort = serverPort; + } + catch + { + } + } + if (args[i].ToLower() == "-join" || args[i].ToLower() == "-j") + { + i++; + try + { + main.AutoJoin(args[i]); + } + catch + { + } + } + if (args[i].ToLower() == "-pass" || args[i].ToLower() == "-password") + { + i++; + Netplay.password = args[i]; + main.AutoPass(); + } + if (args[i].ToLower() == "-host") + { + main.AutoHost(); + } + if (args[i].ToLower() == "-loadlib") + { + i++; + string path = args[i]; + main.loadLib(path); + } + } + Steam.Init(); + if (Steam.SteamInit) + { + main.Run(); + } + else + { + MessageBox.Show("Please launch the game from your Steam client.", "Error"); + } + } + catch (Exception ex) + { + try + { + using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) + { + streamWriter.WriteLine(DateTime.Now); + streamWriter.WriteLine(ex); + streamWriter.WriteLine("/n"); + } + MessageBox.Show(ex.ToString(), "Terraria: Error"); + } + catch + { + } + } + } + } + } +} diff --git a/Terraria/Projectile.cs b/Terraria/Projectile.cs new file mode 100644 index 0000000..baf4f8f --- /dev/null +++ b/Terraria/Projectile.cs @@ -0,0 +1,19182 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Projectile + { + public int numHits; + public bool netImportant; + public bool noDropItem; + public bool wet; + public bool honeyWet; + public byte wetCount; + public bool lavaWet; + public int whoAmI; + public static int maxAI = 2; + public Vector2 position; + public Vector2 lastPosition; + public Vector2 velocity; + public Vector2 lastVelocity; + public int width; + public int height; + public float scale = 1f; + public float rotation; + public int type; + public int alpha; + public int owner = 255; + public bool active; + public string name = ""; + public float[] ai = new float[Projectile.maxAI]; + public float[] localAI = new float[Projectile.maxAI]; + public float gfxOffY; + public float stepSpeed = 1f; + public int aiStyle; + public int timeLeft; + public int soundDelay; + public int damage; + public int direction; + public int spriteDirection = 1; + public bool hostile; + public float knockBack; + public bool friendly; + public int penetrate = 1; + public int identity; + public float light; + public bool netUpdate; + public bool netUpdate2; + public int netSpam; + public Vector2[] oldPos = new Vector2[10]; + public bool minion; + public int minionPos; + public int restrikeDelay; + public bool tileCollide; + public int maxUpdates; + public int numUpdates; + public bool ignoreWater; + public bool hide; + public bool ownerHitCheck; + public int[] playerImmune = new int[255]; + public string miscText = ""; + public bool melee; + public bool ranged; + public bool magic; + public int frameCounter; + public int frame; + public void SetDefaults(int Type) + { + this.numHits = 0; + this.netImportant = false; + for (int i = 0; i < this.oldPos.Length; i++) + { + this.oldPos[i].X = 0f; + this.oldPos[i].Y = 0f; + } + for (int j = 0; j < Projectile.maxAI; j++) + { + this.ai[j] = 0f; + this.localAI[j] = 0f; + } + for (int k = 0; k < 255; k++) + { + this.playerImmune[k] = 0; + } + this.noDropItem = false; + this.minion = false; + this.soundDelay = 0; + this.spriteDirection = 1; + this.melee = false; + this.ranged = false; + this.magic = false; + this.ownerHitCheck = false; + this.hide = false; + this.lavaWet = false; + this.wetCount = 0; + this.wet = false; + this.ignoreWater = false; + this.hostile = false; + this.netUpdate = false; + this.netUpdate2 = false; + this.netSpam = 0; + this.numUpdates = 0; + this.maxUpdates = 0; + this.identity = 0; + this.restrikeDelay = 0; + this.light = 0f; + this.penetrate = 1; + this.tileCollide = true; + this.position = default(Vector2); + this.velocity = default(Vector2); + this.aiStyle = 0; + this.alpha = 0; + this.type = Type; + this.active = true; + this.rotation = 0f; + this.scale = 1f; + this.owner = 255; + this.timeLeft = 3600; + this.name = ""; + this.friendly = false; + this.damage = 0; + this.knockBack = 0f; + this.miscText = ""; + if (this.type == 1) + { + this.name = "Wooden Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 2) + { + this.name = "Fire Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.light = 1f; + this.ranged = true; + } + else + { + if (this.type == 3) + { + this.name = "Shuriken"; + this.width = 22; + this.height = 22; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 4; + this.ranged = true; + } + else + { + if (this.type == 4) + { + this.name = "Unholy Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.light = 0.35f; + this.penetrate = 5; + this.ranged = true; + } + else + { + if (this.type == 5) + { + this.name = "Jester's Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.light = 0.4f; + this.penetrate = -1; + this.timeLeft = 120; + this.alpha = 100; + this.ignoreWater = true; + this.ranged = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 6) + { + this.name = "Enchanted Boomerang"; + this.width = 22; + this.height = 22; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.light = 0.4f; + } + else + { + if (this.type == 7 || this.type == 8) + { + this.name = "Vilethorn"; + this.width = 28; + this.height = 28; + this.aiStyle = 4; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.alpha = 255; + this.ignoreWater = true; + this.magic = true; + } + else + { + if (this.type == 9) + { + this.name = "Starfury"; + this.width = 24; + this.height = 24; + this.aiStyle = 5; + this.friendly = true; + this.penetrate = 2; + this.alpha = 50; + this.scale = 0.8f; + this.tileCollide = false; + this.magic = true; + } + else + { + if (this.type == 10) + { + this.name = "Purification Powder"; + this.width = 64; + this.height = 64; + this.aiStyle = 6; + this.friendly = true; + this.tileCollide = false; + this.penetrate = -1; + this.alpha = 255; + this.ignoreWater = true; + } + else + { + if (this.type == 11) + { + this.name = "Vile Powder"; + this.width = 48; + this.height = 48; + this.aiStyle = 6; + this.friendly = true; + this.tileCollide = false; + this.penetrate = -1; + this.alpha = 255; + this.ignoreWater = true; + } + else + { + if (this.type == 12) + { + this.name = "Falling Star"; + this.width = 16; + this.height = 16; + this.aiStyle = 5; + this.friendly = true; + this.penetrate = -1; + this.alpha = 50; + this.light = 1f; + } + else + { + if (this.type == 13) + { + this.netImportant = true; + this.name = "Hook"; + this.width = 18; + this.height = 18; + this.aiStyle = 7; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.timeLeft *= 10; + } + else + { + if (this.type == 14) + { + this.name = "Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 15) + { + this.name = "Ball of Fire"; + this.width = 16; + this.height = 16; + this.aiStyle = 8; + this.friendly = true; + this.light = 0.8f; + this.alpha = 100; + this.magic = true; + } + else + { + if (this.type == 16) + { + this.name = "Magic Missile"; + this.width = 10; + this.height = 10; + this.aiStyle = 9; + this.friendly = true; + this.light = 0.8f; + this.alpha = 100; + this.magic = true; + } + else + { + if (this.type == 17) + { + this.name = "Dirt Ball"; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + } + else + { + if (this.type == 18) + { + this.netImportant = true; + this.name = "Shadow Orb"; + this.width = 32; + this.height = 32; + this.aiStyle = 11; + this.friendly = true; + this.light = 0.9f; + this.alpha = 150; + this.tileCollide = false; + this.penetrate = -1; + this.timeLeft *= 5; + this.ignoreWater = true; + this.scale = 0.8f; + } + else + { + if (this.type == 19) + { + this.name = "Flamarang"; + this.width = 22; + this.height = 22; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = -1; + this.light = 1f; + this.melee = true; + } + else + { + if (this.type == 20) + { + this.name = "Green Laser"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 3; + this.light = 0.75f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.4f; + this.timeLeft = 600; + this.magic = true; + } + else + { + if (this.type == 21) + { + this.name = "Bone"; + this.width = 16; + this.height = 16; + this.aiStyle = 2; + this.scale = 1.2f; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 22) + { + this.name = "Water Stream"; + this.width = 18; + this.height = 18; + this.aiStyle = 12; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.ignoreWater = true; + this.magic = true; + } + else + { + if (this.type == 23) + { + this.name = "Harpoon"; + this.width = 4; + this.height = 4; + this.aiStyle = 13; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.ranged = true; + } + else + { + if (this.type == 24) + { + this.name = "Spiky Ball"; + this.width = 14; + this.height = 14; + this.aiStyle = 14; + this.friendly = true; + this.penetrate = 6; + this.ranged = true; + } + else + { + if (this.type == 25) + { + this.name = "Ball 'O Hurt"; + this.width = 22; + this.height = 22; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.scale = 0.8f; + } + else + { + if (this.type == 26) + { + this.name = "Blue Moon"; + this.width = 22; + this.height = 22; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.scale = 0.8f; + } + else + { + if (this.type == 27) + { + this.name = "Water Bolt"; + this.width = 16; + this.height = 16; + this.aiStyle = 8; + this.friendly = true; + this.alpha = 255; + this.timeLeft /= 2; + this.penetrate = 10; + this.magic = true; + } + else + { + if (this.type == 28) + { + this.name = "Bomb"; + this.width = 22; + this.height = 22; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + } + else + { + if (this.type == 29) + { + this.name = "Dynamite"; + this.width = 10; + this.height = 10; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + } + else + { + if (this.type == 30) + { + this.name = "Grenade"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 31) + { + this.name = "Sand Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 32) + { + this.name = "Ivy Whip"; + this.width = 18; + this.height = 18; + this.aiStyle = 7; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.timeLeft *= 10; + } + else + { + if (this.type == 33) + { + this.name = "Thorn Chakrum"; + this.width = 38; + this.height = 38; + this.aiStyle = 3; + this.friendly = true; + this.scale = 0.9f; + this.penetrate = -1; + this.melee = true; + } + else + { + if (this.type == 34) + { + this.name = "Flamelash"; + this.width = 14; + this.height = 14; + this.aiStyle = 9; + this.friendly = true; + this.light = 0.8f; + this.alpha = 100; + this.penetrate = 1; + this.magic = true; + } + else + { + if (this.type == 35) + { + this.name = "Sunfury"; + this.width = 22; + this.height = 22; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.scale = 0.8f; + } + else + { + if (this.type == 36) + { + this.name = "Meteor Shot"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 2; + this.light = 0.6f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.4f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 37) + { + this.name = "Sticky Bomb"; + this.width = 22; + this.height = 22; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + } + else + { + if (this.type == 38) + { + this.name = "Harpy Feather"; + this.width = 14; + this.height = 14; + this.aiStyle = 0; + this.hostile = true; + this.penetrate = -1; + this.aiStyle = 1; + this.tileCollide = true; + } + else + { + if (this.type == 39) + { + this.name = "Mud Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 40) + { + this.name = "Ash Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 41) + { + this.name = "Hellfire Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + this.light = 0.3f; + } + else + { + if (this.type == 42) + { + this.name = "Sand Ball"; + this.knockBack = 8f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 43) + { + this.name = "Tombstone"; + this.knockBack = 12f; + this.width = 24; + this.height = 24; + this.aiStyle = 17; + this.penetrate = -1; + } + else + { + if (this.type == 44) + { + this.name = "Demon Sickle"; + this.width = 48; + this.height = 48; + this.alpha = 100; + this.light = 0.2f; + this.aiStyle = 18; + this.hostile = true; + this.penetrate = -1; + this.tileCollide = true; + this.scale = 0.9f; + } + else + { + if (this.type == 45) + { + this.name = "Demon Scythe"; + this.width = 48; + this.height = 48; + this.alpha = 100; + this.light = 0.2f; + this.aiStyle = 18; + this.friendly = true; + this.penetrate = 5; + this.tileCollide = true; + this.scale = 0.9f; + this.magic = true; + } + else + { + if (this.type == 46) + { + this.name = "Dark Lance"; + this.width = 20; + this.height = 20; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.1f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 47) + { + this.name = "Trident"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.1f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 48) + { + this.name = "Throwing Knife"; + this.width = 12; + this.height = 12; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 2; + this.ranged = true; + } + else + { + if (this.type == 49) + { + this.name = "Spear"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.2f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 50) + { + this.netImportant = true; + this.name = "Glowstick"; + this.width = 6; + this.height = 6; + this.aiStyle = 14; + this.penetrate = -1; + this.alpha = 75; + this.light = 1f; + this.timeLeft *= 5; + } + else + { + if (this.type == 51) + { + this.name = "Seed"; + this.width = 8; + this.height = 8; + this.aiStyle = 1; + this.friendly = true; + } + else + { + if (this.type == 52) + { + this.name = "Wooden Boomerang"; + this.width = 22; + this.height = 22; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + } + else + { + if (this.type == 53) + { + this.netImportant = true; + this.name = "Sticky Glowstick"; + this.width = 6; + this.height = 6; + this.aiStyle = 14; + this.penetrate = -1; + this.alpha = 75; + this.light = 1f; + this.timeLeft *= 5; + this.tileCollide = false; + } + else + { + if (this.type == 54) + { + this.name = "Poisoned Knife"; + this.width = 12; + this.height = 12; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 2; + this.ranged = true; + } + else + { + if (this.type == 55) + { + this.name = "Stinger"; + this.width = 10; + this.height = 10; + this.aiStyle = 0; + this.hostile = true; + this.penetrate = -1; + this.aiStyle = 1; + this.tileCollide = true; + } + else + { + if (this.type == 56) + { + this.name = "Ebonsand Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 57) + { + this.name = "Cobalt Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 58) + { + this.name = "Mythril Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.08f; + } + else + { + if (this.type == 59) + { + this.name = "Cobalt Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 0.9f; + } + else + { + if (this.type == 60) + { + this.name = "Mythril Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 0.9f; + } + else + { + if (this.type == 61) + { + this.name = "Adamantite Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.16f; + } + else + { + if (this.type == 62) + { + this.name = "Adamantite Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 0.9f; + } + else + { + if (this.type == 63) + { + this.name = "The Dao of Pow"; + this.width = 22; + this.height = 22; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + } + else + { + if (this.type == 64) + { + this.name = "Mythril Halberd"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.25f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 65) + { + this.name = "Ebonsand Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.penetrate = -1; + this.maxUpdates = 1; + } + else + { + if (this.type == 66) + { + this.name = "Adamantite Glaive"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.27f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 67) + { + this.name = "Pearl Sand Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 68) + { + this.name = "Pearl Sand Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.penetrate = -1; + this.maxUpdates = 1; + } + else + { + if (this.type == 69) + { + this.name = "Holy Water"; + this.width = 14; + this.height = 14; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 1; + } + else + { + if (this.type == 70) + { + this.name = "Unholy Water"; + this.width = 14; + this.height = 14; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 1; + } + else + { + if (this.type == 71) + { + this.name = "Silt Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 72) + { + this.netImportant = true; + this.name = "Blue Fairy"; + this.width = 18; + this.height = 18; + this.aiStyle = 11; + this.friendly = true; + this.light = 0.9f; + this.tileCollide = false; + this.penetrate = -1; + this.timeLeft *= 5; + this.ignoreWater = true; + this.scale = 0.8f; + } + else + { + if (this.type == 73 || this.type == 74) + { + this.netImportant = true; + this.name = "Hook"; + this.width = 18; + this.height = 18; + this.aiStyle = 7; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.timeLeft *= 10; + this.light = 0.4f; + } + else + { + if (this.type == 75) + { + this.name = "Happy Bomb"; + this.width = 22; + this.height = 22; + this.aiStyle = 16; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 76 || this.type == 77 || this.type == 78) + { + if (this.type == 76) + { + this.width = 10; + this.height = 22; + } + else + { + if (this.type == 77) + { + this.width = 18; + this.height = 24; + } + else + { + this.width = 22; + this.height = 24; + } + } + this.name = "Note"; + this.aiStyle = 21; + this.friendly = true; + this.ranged = true; + this.alpha = 100; + this.light = 0.3f; + this.penetrate = -1; + this.timeLeft = 180; + this.magic = true; + } + else + { + if (this.type == 79) + { + this.name = "Rainbow"; + this.width = 10; + this.height = 10; + this.aiStyle = 9; + this.friendly = true; + this.light = 0.8f; + this.alpha = 255; + this.magic = true; + } + else + { + if (this.type == 80) + { + this.name = "Ice Block"; + this.width = 16; + this.height = 16; + this.aiStyle = 22; + this.friendly = true; + this.magic = true; + this.tileCollide = false; + this.light = 0.5f; + } + else + { + if (this.type == 81) + { + this.name = "Wooden Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.hostile = true; + this.ranged = true; + } + else + { + if (this.type == 82) + { + this.name = "Flaming Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.hostile = true; + this.ranged = true; + } + else + { + if (this.type == 83) + { + this.name = "Eye Laser"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = 3; + this.light = 0.75f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.7f; + this.timeLeft = 600; + this.magic = true; + } + else + { + if (this.type == 84) + { + this.name = "Pink Laser"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = 3; + this.light = 0.75f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.2f; + this.timeLeft = 600; + this.magic = true; + } + else + { + if (this.type == 85) + { + this.name = "Flames"; + this.width = 6; + this.height = 6; + this.aiStyle = 23; + this.friendly = true; + this.alpha = 255; + this.penetrate = 3; + this.maxUpdates = 2; + this.ranged = true; + } + else + { + if (this.type == 86) + { + this.netImportant = true; + this.name = "Pink Fairy"; + this.width = 18; + this.height = 18; + this.aiStyle = 11; + this.friendly = true; + this.light = 0.9f; + this.tileCollide = false; + this.penetrate = -1; + this.timeLeft *= 5; + this.ignoreWater = true; + this.scale = 0.8f; + } + else + { + if (this.type == 87) + { + this.netImportant = true; + this.name = "Pink Fairy"; + this.width = 18; + this.height = 18; + this.aiStyle = 11; + this.friendly = true; + this.light = 0.9f; + this.tileCollide = false; + this.penetrate = -1; + this.timeLeft *= 5; + this.ignoreWater = true; + this.scale = 0.8f; + } + else + { + if (this.type == 88) + { + this.name = "Purple Laser"; + this.width = 6; + this.height = 6; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 3; + this.light = 0.75f; + this.alpha = 255; + this.maxUpdates = 4; + this.scale = 1.4f; + this.timeLeft = 600; + this.magic = true; + } + else + { + if (this.type == 89) + { + this.name = "Crystal Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 90) + { + this.name = "Crystal Shard"; + this.width = 6; + this.height = 6; + this.aiStyle = 24; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 50; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + this.tileCollide = false; + } + else + { + if (this.type == 91) + { + this.name = "Holy Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 92) + { + this.name = "Hallow Star"; + this.width = 24; + this.height = 24; + this.aiStyle = 5; + this.friendly = true; + this.penetrate = 2; + this.alpha = 50; + this.scale = 0.8f; + this.tileCollide = false; + this.magic = true; + } + else + { + if (this.type == 93) + { + this.light = 0.15f; + this.name = "Magic Dagger"; + this.width = 12; + this.height = 12; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 2; + this.magic = true; + } + else + { + if (this.type == 94) + { + this.ignoreWater = true; + this.name = "Crystal Storm"; + this.width = 8; + this.height = 8; + this.aiStyle = 24; + this.friendly = true; + this.light = 0.5f; + this.alpha = 50; + this.scale = 1.2f; + this.timeLeft = 600; + this.magic = true; + this.tileCollide = true; + this.penetrate = 1; + } + else + { + if (this.type == 95) + { + this.name = "Cursed Flame"; + this.width = 16; + this.height = 16; + this.aiStyle = 8; + this.friendly = true; + this.light = 0.8f; + this.alpha = 100; + this.magic = true; + this.penetrate = 2; + } + else + { + if (this.type == 96) + { + this.name = "Cursed Flame"; + this.width = 16; + this.height = 16; + this.aiStyle = 8; + this.hostile = true; + this.light = 0.8f; + this.alpha = 100; + this.magic = true; + this.penetrate = -1; + this.scale = 0.9f; + this.scale = 1.3f; + } + else + { + if (this.type == 97) + { + this.name = "Cobalt Naginata"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.1f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 98) + { + this.name = "Poison Dart"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.hostile = true; + this.ranged = true; + this.penetrate = -1; + } + else + { + if (this.type == 99) + { + this.name = "Boulder"; + this.width = 31; + this.height = 31; + this.aiStyle = 25; + this.friendly = true; + this.hostile = true; + this.ranged = true; + this.penetrate = -1; + } + else + { + if (this.type == 100) + { + this.name = "Death Laser"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = 3; + this.light = 0.75f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.8f; + this.timeLeft = 1200; + this.magic = true; + } + else + { + if (this.type == 101) + { + this.name = "Eye Fire"; + this.width = 6; + this.height = 6; + this.aiStyle = 23; + this.hostile = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 3; + this.magic = true; + } + else + { + if (this.type == 102) + { + this.name = "Bomb"; + this.width = 22; + this.height = 22; + this.aiStyle = 16; + this.hostile = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 103) + { + this.name = "Cursed Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.light = 1f; + this.ranged = true; + } + else + { + if (this.type == 104) + { + this.name = "Cursed Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 105) + { + this.name = "Gungnir"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.3f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 106) + { + this.name = "Light Disc"; + this.width = 32; + this.height = 32; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.light = 0.4f; + } + else + { + if (this.type == 107) + { + this.name = "Hamdrax"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.1f; + } + else + { + if (this.type == 108) + { + this.name = "Explosives"; + this.width = 260; + this.height = 260; + this.aiStyle = 16; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + this.tileCollide = false; + this.alpha = 255; + this.timeLeft = 2; + } + else + { + if (this.type == 109) + { + this.name = "Snow Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.hostile = true; + this.scale = 0.9f; + this.penetrate = -1; + } + else + { + if (this.type == 110) + { + this.name = "Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 111) + { + this.netImportant = true; + this.name = "Bunny"; + this.width = 18; + this.height = 18; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 112) + { + this.netImportant = true; + this.name = "Penguin"; + this.width = 18; + this.height = 18; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 113) + { + this.name = "Ice Boomerang"; + this.width = 22; + this.height = 22; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.light = 0.4f; + } + else + { + if (this.type == 114) + { + this.name = "Unholy Trident"; + this.width = 16; + this.height = 16; + this.aiStyle = 27; + this.magic = true; + this.penetrate = 3; + this.light = 0.5f; + this.alpha = 255; + this.friendly = true; + } + else + { + if (this.type == 115) + { + this.name = "Unholy Trident"; + this.width = 16; + this.height = 16; + this.aiStyle = 27; + this.hostile = true; + this.magic = true; + this.penetrate = -1; + this.light = 0.5f; + this.alpha = 255; + } + else + { + if (this.type == 116) + { + this.name = "Sword Beam"; + this.width = 16; + this.height = 16; + this.aiStyle = 27; + this.melee = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.friendly = true; + } + else + { + if (this.type == 117) + { + this.name = "Bone Arrow"; + this.maxUpdates = 2; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 118) + { + this.name = "Ice Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 28; + this.alpha = 255; + this.melee = true; + this.penetrate = 1; + this.friendly = true; + } + else + { + if (this.type == 119) + { + this.name = "Frost Bolt"; + this.width = 14; + this.height = 14; + this.aiStyle = 28; + this.alpha = 255; + this.melee = true; + this.penetrate = 2; + this.friendly = true; + } + else + { + if (this.type == 120) + { + this.name = "Frost Arrow"; + this.maxUpdates = 1; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 121) + { + this.name = "Amethyst Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 29; + this.alpha = 255; + this.magic = true; + this.penetrate = 1; + this.friendly = true; + } + else + { + if (this.type == 122) + { + this.name = "Topaz Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 29; + this.alpha = 255; + this.magic = true; + this.penetrate = 2; + this.friendly = true; + } + else + { + if (this.type == 123) + { + this.name = "Sapphire Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 29; + this.alpha = 255; + this.magic = true; + this.penetrate = 2; + this.friendly = true; + } + else + { + if (this.type == 124) + { + this.name = "Emerald Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 29; + this.alpha = 255; + this.magic = true; + this.penetrate = 3; + this.friendly = true; + } + else + { + if (this.type == 125) + { + this.name = "Ruby Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 29; + this.alpha = 255; + this.magic = true; + this.penetrate = 3; + this.friendly = true; + } + else + { + if (this.type == 126) + { + this.name = "Diamond Bolt"; + this.width = 10; + this.height = 10; + this.aiStyle = 29; + this.alpha = 255; + this.magic = true; + this.penetrate = 4; + this.friendly = true; + } + else + { + if (this.type == 127) + { + this.netImportant = true; + this.name = "Turtle"; + this.width = 22; + this.height = 22; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 128) + { + this.name = "Frost Blast"; + this.width = 14; + this.height = 14; + this.aiStyle = 28; + this.alpha = 255; + this.penetrate = -1; + this.friendly = false; + this.hostile = true; + } + else + { + if (this.type == 129) + { + this.name = "Rune Blast"; + this.width = 14; + this.height = 14; + this.aiStyle = 28; + this.alpha = 255; + this.penetrate = -1; + this.friendly = false; + this.hostile = true; + this.tileCollide = false; + } + else + { + if (this.type == 130) + { + this.name = "Mushroom Spear"; + this.width = 22; + this.height = 22; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.2f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 131) + { + this.name = "Mushroom"; + this.width = 22; + this.height = 22; + this.aiStyle = 30; + this.friendly = true; + this.penetrate = 1; + this.tileCollide = false; + this.melee = true; + this.light = 0.5f; + } + else + { + if (this.type == 132) + { + this.name = "Terra Beam"; + this.width = 16; + this.height = 16; + this.aiStyle = 27; + this.melee = true; + this.penetrate = 3; + this.light = 0.5f; + this.alpha = 255; + this.friendly = true; + } + else + { + if (this.type == 133) + { + this.name = "Grenade"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 134) + { + this.name = "Rocket"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 135) + { + this.name = "Proximity Mine"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 136) + { + this.name = "Grenade"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 137) + { + this.name = "Rocket"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 138) + { + this.name = "Proximity Mine"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 139) + { + this.name = "Grenade"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 140) + { + this.name = "Rocket"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 141) + { + this.name = "Proximity Mine"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 142) + { + this.name = "Grenade"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 143) + { + this.name = "Rocket"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 144) + { + this.name = "Proximity Mine"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.friendly = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 145) + { + this.name = "Pure Spray"; + this.width = 6; + this.height = 6; + this.aiStyle = 31; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.tileCollide = false; + this.ignoreWater = true; + } + else + { + if (this.type == 146) + { + this.name = "Hallow Spray"; + this.width = 6; + this.height = 6; + this.aiStyle = 31; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.tileCollide = false; + this.ignoreWater = true; + } + else + { + if (this.type == 147) + { + this.name = "Corrupt Spray"; + this.width = 6; + this.height = 6; + this.aiStyle = 31; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.tileCollide = false; + this.ignoreWater = true; + } + else + { + if (this.type == 148) + { + this.name = "Mushroom Spray"; + this.width = 6; + this.height = 6; + this.aiStyle = 31; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.tileCollide = false; + this.ignoreWater = true; + } + else + { + if (this.type == 149) + { + this.name = "Crimson Spray"; + this.width = 6; + this.height = 6; + this.aiStyle = 31; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.tileCollide = false; + this.ignoreWater = true; + } + else + { + if (this.type == 150 || this.type == 151 || this.type == 152) + { + this.name = "Nettle Burst"; + this.width = 28; + this.height = 28; + this.aiStyle = 4; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.alpha = 255; + this.ignoreWater = true; + this.magic = true; + } + else + { + if (this.type == 153) + { + this.name = "The Rotted Fork"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.1f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 154) + { + this.name = "The Meatball"; + this.width = 22; + this.height = 22; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.scale = 0.8f; + } + else + { + if (this.type == 155) + { + this.netImportant = true; + this.name = "Beach Ball"; + this.width = 44; + this.height = 44; + this.aiStyle = 32; + this.friendly = true; + } + else + { + if (this.type == 156) + { + this.name = "Light Beam"; + this.width = 16; + this.height = 16; + this.aiStyle = 27; + this.melee = true; + this.light = 0.5f; + this.alpha = 255; + this.friendly = true; + } + else + { + if (this.type == 157) + { + this.name = "Night Beam"; + this.width = 32; + this.height = 32; + this.aiStyle = 27; + this.melee = true; + this.light = 0.5f; + this.alpha = 255; + this.friendly = true; + this.scale = 1.2f; + } + else + { + if (this.type == 158) + { + this.name = "Copper Coin"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.alpha = 255; + this.maxUpdates = 1; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 159) + { + this.name = "Silver Coin"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.alpha = 255; + this.maxUpdates = 1; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 160) + { + this.name = "Gold Coin"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.alpha = 255; + this.maxUpdates = 1; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 161) + { + this.name = "Platinum Coin"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.alpha = 255; + this.maxUpdates = 1; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 162) + { + this.name = "Cannonball"; + this.width = 16; + this.height = 16; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 4; + this.alpha = 255; + } + else + { + if (this.type == 163) + { + this.netImportant = true; + this.name = "Flare"; + this.width = 6; + this.height = 6; + this.aiStyle = 33; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.timeLeft = 36000; + } + else + { + if (this.type == 164) + { + this.name = "Landmine"; + this.width = 128; + this.height = 128; + this.aiStyle = 16; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + this.tileCollide = false; + this.alpha = 255; + this.timeLeft = 2; + } + else + { + if (this.type == 165) + { + this.netImportant = true; + this.name = "Web"; + this.width = 12; + this.height = 12; + this.aiStyle = 7; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.timeLeft *= 10; + } + else + { + if (this.type == 166) + { + this.name = "Snow Ball"; + this.width = 14; + this.height = 14; + this.aiStyle = 2; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 167 || this.type == 168 || this.type == 169 || this.type == 170) + { + this.name = "Rocket"; + this.width = 14; + this.height = 14; + this.aiStyle = 34; + this.friendly = true; + this.ranged = true; + this.timeLeft = 45; + } + else + { + if (this.type == 171) + { + this.name = "Rope Coil"; + this.width = 14; + this.height = 14; + this.aiStyle = 35; + this.penetrate = -1; + this.tileCollide = false; + this.timeLeft = 400; + } + else + { + if (this.type == 172) + { + this.name = "Frostburn Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.light = 1f; + this.ranged = true; + } + else + { + if (this.type == 173) + { + this.name = "Enchanted Beam"; + this.width = 16; + this.height = 16; + this.aiStyle = 27; + this.melee = true; + this.penetrate = 1; + this.light = 0.2f; + this.alpha = 255; + this.friendly = true; + } + else + { + if (this.type == 174) + { + this.name = "Ice Spike"; + this.alpha = 255; + this.width = 6; + this.height = 6; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 175) + { + this.name = "Baby Eater"; + this.width = 34; + this.height = 34; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 176) + { + this.name = "Jungle Spike"; + this.alpha = 255; + this.width = 6; + this.height = 6; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 177) + { + this.name = "Icewater Spit"; + this.width = 10; + this.height = 10; + this.aiStyle = 28; + this.alpha = 255; + this.penetrate = -1; + this.friendly = false; + this.hostile = true; + } + else + { + if (this.type == 178) + { + this.name = "Confetti"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.alpha = 255; + this.penetrate = -1; + this.timeLeft = 2; + } + else + { + if (this.type == 179) + { + this.name = "Slush Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 180) + { + this.name = "Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 181) + { + this.name = "Bee"; + this.width = 8; + this.height = 8; + this.aiStyle = 36; + this.friendly = true; + this.penetrate = 3; + this.alpha = 255; + this.timeLeft = 600; + this.magic = true; + this.maxUpdates = 3; + } + else + { + if (this.type == 182) + { + this.light = 0.15f; + this.name = "Possessed Hatchet"; + this.width = 30; + this.height = 30; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = 10; + this.melee = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 183) + { + this.name = "Beenade"; + this.width = 14; + this.height = 22; + this.aiStyle = 14; + this.penetrate = 1; + this.ranged = true; + this.timeLeft = 180; + this.friendly = true; + } + else + { + if (this.type == 184) + { + this.name = "Poison Dart"; + this.width = 6; + this.height = 6; + this.aiStyle = 1; + this.friendly = true; + this.hostile = true; + this.ranged = true; + this.penetrate = -1; + } + else + { + if (this.type == 185) + { + this.name = "Spiky Ball"; + this.width = 14; + this.height = 14; + this.aiStyle = 14; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + this.ranged = true; + this.timeLeft = 900; + } + else + { + if (this.type == 186) + { + this.name = "Spear"; + this.width = 10; + this.height = 14; + this.aiStyle = 37; + this.friendly = true; + this.tileCollide = false; + this.ignoreWater = true; + this.hostile = true; + this.penetrate = -1; + this.ranged = true; + this.timeLeft = 300; + } + else + { + if (this.type == 187) + { + this.name = "Flamethrower"; + this.width = 6; + this.height = 6; + this.aiStyle = 38; + this.alpha = 255; + this.tileCollide = false; + this.ignoreWater = true; + this.timeLeft = 60; + } + else + { + if (this.type == 188) + { + this.name = "Flames"; + this.width = 6; + this.height = 6; + this.aiStyle = 23; + this.friendly = true; + this.hostile = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.magic = true; + } + else + { + if (this.type == 189) + { + this.name = "Wasp"; + this.width = 8; + this.height = 8; + this.aiStyle = 36; + this.friendly = true; + this.penetrate = 4; + this.alpha = 255; + this.timeLeft = 600; + this.magic = true; + this.maxUpdates = 3; + } + else + { + if (this.type == 190) + { + this.name = "Mechanical Piranha"; + this.width = 22; + this.height = 22; + this.aiStyle = 39; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.ranged = true; + } + else + { + if (this.type >= 191 && this.type <= 194) + { + this.netImportant = true; + this.name = "Pygmy"; + this.width = 18; + this.height = 18; + this.aiStyle = 26; + this.penetrate = -1; + this.timeLeft *= 5; + this.minion = true; + if (this.type == 192) + { + this.scale = 1.025f; + } + if (this.type == 193) + { + this.scale = 1.05f; + } + if (this.type == 194) + { + this.scale = 1.075f; + } + } + else + { + if (this.type == 195) + { + this.name = "Pygmy"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + } + else + { + if (this.type == 196) + { + this.name = "Smoke Bomb"; + this.width = 16; + this.height = 16; + this.aiStyle = 14; + this.penetrate = -1; + this.scale = 0.8f; + } + else + { + if (this.type == 197) + { + this.netImportant = true; + this.name = "Baby Skeletron Head"; + this.width = 42; + this.height = 42; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 198) + { + this.netImportant = true; + this.name = "Baby Hornet"; + this.width = 26; + this.height = 26; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 199) + { + this.netImportant = true; + this.name = "Tiki Spirit"; + this.width = 28; + this.height = 28; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 200) + { + this.netImportant = true; + this.name = "Pet Lizard"; + this.width = 28; + this.height = 28; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 201) + { + this.name = "Tombstone"; + this.knockBack = 12f; + this.width = 24; + this.height = 24; + this.aiStyle = 17; + this.penetrate = -1; + } + else + { + if (this.type == 202) + { + this.name = "Tombstone"; + this.knockBack = 12f; + this.width = 24; + this.height = 24; + this.aiStyle = 17; + this.penetrate = -1; + } + else + { + if (this.type == 203) + { + this.name = "Tombstone"; + this.knockBack = 12f; + this.width = 24; + this.height = 24; + this.aiStyle = 17; + this.penetrate = -1; + } + else + { + if (this.type == 204) + { + this.name = "Tombstone"; + this.knockBack = 12f; + this.width = 24; + this.height = 24; + this.aiStyle = 17; + this.penetrate = -1; + } + else + { + if (this.type == 205) + { + this.name = "Tombstone"; + this.knockBack = 12f; + this.width = 24; + this.height = 24; + this.aiStyle = 17; + this.penetrate = -1; + } + else + { + if (this.type == 206) + { + this.name = "Leaf"; + this.width = 14; + this.height = 14; + this.aiStyle = 40; + this.friendly = true; + this.penetrate = 1; + this.alpha = 255; + this.timeLeft = 600; + this.magic = true; + } + else + { + if (this.type == 207) + { + this.name = "Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.2f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 208) + { + this.netImportant = true; + this.name = "Parrot"; + this.width = 18; + this.height = 36; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 209) + { + this.name = "Truffle"; + this.width = 12; + this.height = 32; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + this.light = 0.5f; + } + else + { + if (this.type == 210) + { + this.netImportant = true; + this.name = "Sapling"; + this.width = 14; + this.height = 30; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 211) + { + this.netImportant = true; + this.name = "Wisp"; + this.width = 24; + this.height = 24; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + this.light = 1f; + } + else + { + if (this.type == 212) + { + this.name = "Palladium Pike"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.12f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 213) + { + this.name = "Palladium Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 0.92f; + } + else + { + if (this.type == 214) + { + this.name = "Palladium Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 215) + { + this.name = "Orichalcum Halberd"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.27f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 216) + { + this.name = "Orichalcum Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 0.93f; + } + else + { + if (this.type == 217) + { + this.name = "Orichalcum Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.12f; + } + else + { + if (this.type == 218) + { + this.name = "Titanium Trident"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.28f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 219) + { + this.name = "Titanium Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 0.95f; + } + else + { + if (this.type == 220) + { + this.name = "Titanium Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.2f; + } + else + { + if (this.type == 221) + { + this.name = "Flower Petal"; + this.width = 20; + this.height = 20; + this.aiStyle = 41; + this.friendly = true; + this.tileCollide = false; + this.ignoreWater = true; + this.timeLeft = 120; + this.penetrate = -1; + this.scale = 1f + (float)Main.rand.Next(30) * 0.01f; + this.maxUpdates = 2; + } + else + { + if (this.type == 222) + { + this.name = "Chlorophyte Partisan"; + this.width = 18; + this.height = 18; + this.aiStyle = 19; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.scale = 1.3f; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + } + else + { + if (this.type == 223) + { + this.name = "Chlorophyte Drill"; + this.width = 22; + this.height = 22; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1f; + } + else + { + if (this.type == 224) + { + this.name = "Chlorophyte Chainsaw"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.1f; + } + else + { + if (this.type == 225) + { + this.penetrate = 2; + this.name = "Chlorophyte Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 226) + { + this.netImportant = true; + this.name = "Crystal Leaf"; + this.width = 22; + this.height = 42; + this.aiStyle = 42; + this.friendly = true; + this.tileCollide = false; + this.penetrate = -1; + this.timeLeft *= 5; + this.light = 0.4f; + this.ignoreWater = true; + } + else + { + if (this.type == 227) + { + this.netImportant = true; + this.tileCollide = false; + this.light = 0.1f; + this.name = "Crystal Leaf"; + this.width = 14; + this.height = 14; + this.aiStyle = 43; + this.friendly = true; + this.penetrate = 1; + this.timeLeft = 180; + } + else + { + if (this.type == 228) + { + this.tileCollide = false; + this.name = "Spore Cloud"; + this.width = 30; + this.height = 30; + this.aiStyle = 44; + this.friendly = true; + this.scale = 1.1f; + this.penetrate = -1; + } + else + { + if (this.type == 229) + { + this.name = "Chlorophyte Orb"; + this.width = 30; + this.height = 30; + this.aiStyle = 44; + this.friendly = true; + this.penetrate = -1; + this.light = 0.2f; + } + else + { + if (this.type >= 230 && this.type <= 235) + { + this.netImportant = true; + this.name = "Gem Hook"; + this.width = 18; + this.height = 18; + this.aiStyle = 7; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.timeLeft *= 10; + } + else + { + if (this.type == 236) + { + this.netImportant = true; + this.name = "Baby Dino"; + this.width = 34; + this.height = 34; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 237) + { + this.netImportant = true; + this.name = "Rain Cloud"; + this.width = 28; + this.height = 28; + this.aiStyle = 45; + this.penetrate = -1; + } + else + { + if (this.type == 238) + { + this.tileCollide = false; + this.ignoreWater = true; + this.name = "Rain Cloud"; + this.width = 54; + this.height = 28; + this.aiStyle = 45; + this.penetrate = -1; + } + else + { + if (this.type == 239) + { + this.ignoreWater = true; + this.name = "Rain"; + this.width = 4; + this.height = 40; + this.aiStyle = 45; + this.friendly = true; + this.penetrate = -1; + this.maxUpdates = 1; + this.timeLeft = 300; + this.scale = 1.1f; + this.magic = true; + } + else + { + if (this.type == 240) + { + this.name = "Cannonball"; + this.width = 16; + this.height = 16; + this.aiStyle = 2; + this.hostile = true; + this.penetrate = -1; + this.alpha = 255; + } + else + { + if (this.type == 241) + { + this.name = "Crimsand Ball"; + this.knockBack = 6f; + this.width = 10; + this.height = 10; + this.aiStyle = 10; + this.friendly = true; + this.hostile = true; + this.penetrate = -1; + } + else + { + if (this.type == 242) + { + this.name = "Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 7; + this.scale = 1.18f; + this.timeLeft = 600; + this.ranged = true; + this.ignoreWater = true; + } + else + { + if (this.type == 243) + { + this.name = "Blood Cloud"; + this.width = 28; + this.height = 28; + this.aiStyle = 45; + this.penetrate = -1; + } + else + { + if (this.type == 244) + { + this.tileCollide = false; + this.ignoreWater = true; + this.name = "Blood Cloud"; + this.width = 54; + this.height = 28; + this.aiStyle = 45; + this.penetrate = -1; + } + else + { + if (this.type == 245) + { + this.ignoreWater = true; + this.name = "Blood Rain"; + this.width = 4; + this.height = 40; + this.aiStyle = 45; + this.friendly = true; + this.penetrate = 2; + this.maxUpdates = 1; + this.timeLeft = 300; + this.scale = 1.1f; + this.magic = true; + } + else + { + if (this.type == 246) + { + this.name = "Stynger"; + this.maxUpdates = 1; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + this.alpha = 255; + } + else + { + if (this.type == 247) + { + this.name = "Flower Pow"; + this.width = 34; + this.height = 34; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + } + else + { + if (this.type == 248) + { + this.name = "Flower Pow"; + this.width = 18; + this.height = 18; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 249) + { + this.name = "Stynger"; + this.width = 12; + this.height = 12; + this.aiStyle = 2; + this.friendly = true; + this.ranged = true; + } + else + { + if (this.type == 250) + { + this.name = "Rainbow"; + this.width = 12; + this.height = 12; + this.aiStyle = 46; + this.penetrate = -1; + this.magic = true; + this.alpha = 255; + this.ignoreWater = true; + this.scale = 1.25f; + } + else + { + if (this.type == 251) + { + this.name = "Rainbow"; + this.width = 14; + this.height = 14; + this.aiStyle = 46; + this.friendly = true; + this.penetrate = -1; + this.magic = true; + this.alpha = 255; + this.light = 0.3f; + this.tileCollide = false; + this.ignoreWater = true; + this.scale = 1.25f; + } + else + { + if (this.type == 252) + { + this.name = "Chlorophyte Jackhammer"; + this.width = 18; + this.height = 18; + this.aiStyle = 20; + this.friendly = true; + this.penetrate = -1; + this.tileCollide = false; + this.hide = true; + this.ownerHitCheck = true; + this.melee = true; + this.scale = 1.1f; + } + else + { + if (this.type == 253) + { + this.name = "Ball of Frost"; + this.width = 16; + this.height = 16; + this.aiStyle = 8; + this.friendly = true; + this.light = 0.8f; + this.alpha = 100; + this.magic = true; + } + else + { + if (this.type == 254) + { + this.name = "Magnet Sphere"; + this.width = 38; + this.height = 38; + this.aiStyle = 47; + this.magic = true; + this.timeLeft = 420; + this.light = 0.5f; + } + else + { + if (this.type == 255) + { + this.name = "Magnet Sphere"; + this.width = 8; + this.height = 8; + this.aiStyle = 48; + this.friendly = true; + this.magic = true; + this.maxUpdates = 100; + this.timeLeft = 100; + } + else + { + if (this.type == 256) + { + this.netImportant = true; + this.tileCollide = false; + this.name = "Skeletron Hand"; + this.width = 6; + this.height = 6; + this.aiStyle = 7; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.scale = 1f; + } + else + { + if (this.type == 257) + { + this.name = "Frost Beem"; + this.ignoreWater = true; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + this.light = 0.75f; + this.alpha = 255; + this.maxUpdates = 1; + this.scale = 1.2f; + this.timeLeft = 600; + this.magic = true; + } + else + { + if (this.type == 258) + { + this.name = "Fireball"; + this.width = 16; + this.height = 16; + this.aiStyle = 8; + this.hostile = true; + this.penetrate = -1; + this.alpha = 100; + this.timeLeft = 300; + } + else + { + if (this.type == 259) + { + this.name = "Eye Beam"; + this.ignoreWater = true; + this.tileCollide = false; + this.width = 8; + this.height = 8; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + this.light = 0.3f; + this.scale = 1.1f; + this.magic = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 260) + { + this.name = "Heat Ray"; + this.width = 8; + this.height = 8; + this.aiStyle = 48; + this.friendly = true; + this.magic = true; + this.maxUpdates = 100; + this.timeLeft = 200; + this.penetrate = -1; + } + else + { + if (this.type == 261) + { + this.name = "Boulder"; + this.width = 32; + this.height = 34; + this.aiStyle = 14; + this.friendly = true; + this.penetrate = 6; + this.magic = true; + } + else + { + if (this.type == 262) + { + this.name = "Golem Fist"; + this.width = 30; + this.height = 30; + this.aiStyle = 13; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.melee = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 263) + { + this.name = "Ice Sickle"; + this.width = 34; + this.height = 34; + this.alpha = 100; + this.light = 0.5f; + this.aiStyle = 18; + this.friendly = true; + this.penetrate = 5; + this.tileCollide = true; + this.scale = 1f; + this.melee = true; + this.timeLeft = 180; + } + else + { + if (this.type == 264) + { + this.ignoreWater = true; + this.name = "Rain"; + this.width = 4; + this.height = 40; + this.aiStyle = 45; + this.hostile = true; + this.penetrate = -1; + this.maxUpdates = 1; + this.timeLeft = 120; + this.scale = 1.1f; + } + else + { + if (this.type == 265) + { + this.name = "Poison Fang"; + this.width = 12; + this.height = 12; + this.aiStyle = 1; + this.alpha = 255; + this.friendly = true; + this.magic = true; + this.penetrate = 6; + } + else + { + if (this.type == 266) + { + this.netImportant = true; + this.alpha = 75; + this.name = "Baby Slime"; + this.width = 24; + this.height = 16; + this.aiStyle = 26; + this.penetrate = -1; + this.timeLeft *= 5; + this.minion = true; + } + else + { + if (this.type == 267) + { + this.alpha = 255; + this.name = "Poison Dart"; + this.width = 14; + this.height = 14; + this.aiStyle = 1; + this.friendly = true; + } + else + { + if (this.type == 268) + { + this.netImportant = true; + this.name = "Eye Spring"; + this.width = 18; + this.height = 32; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 269) + { + this.netImportant = true; + this.name = "Baby Snowman"; + this.width = 20; + this.height = 26; + this.aiStyle = 26; + this.friendly = true; + this.penetrate = -1; + this.timeLeft *= 5; + } + else + { + if (this.type == 270) + { + this.name = "Skull"; + this.width = 26; + this.height = 26; + this.aiStyle = 1; + this.alpha = 255; + this.friendly = true; + this.magic = true; + this.penetrate = 6; + } + else + { + if (this.type == 271) + { + this.name = "Boxing Glove"; + this.width = 20; + this.height = 20; + this.aiStyle = 13; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.melee = true; + this.scale = 1.2f; + } + else + { + if (this.type == 272) + { + this.name = "Bananarang"; + this.width = 32; + this.height = 32; + this.aiStyle = 3; + this.friendly = true; + this.scale = 0.9f; + this.penetrate = -1; + this.melee = true; + } + else + { + if (this.type == 273) + { + this.name = "Chain Knife"; + this.width = 26; + this.height = 26; + this.aiStyle = 13; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.melee = true; + } + else + { + if (this.type == 274) + { + this.name = "Death Sickle"; + this.width = 42; + this.height = 42; + this.alpha = 100; + this.light = 0.5f; + this.aiStyle = 18; + this.friendly = true; + this.penetrate = 5; + this.tileCollide = false; + this.scale = 1.1f; + this.melee = true; + this.timeLeft = 180; + } + else + { + if (this.type == 275) + { + this.alpha = 255; + this.name = "Seed"; + this.width = 14; + this.height = 14; + this.aiStyle = 1; + this.hostile = true; + } + else + { + if (this.type == 276) + { + this.alpha = 255; + this.name = "Poison Seed"; + this.width = 14; + this.height = 14; + this.aiStyle = 1; + this.hostile = true; + } + else + { + if (this.type == 277) + { + this.alpha = 255; + this.name = "Thorn Ball"; + this.width = 38; + this.height = 38; + this.aiStyle = 14; + this.hostile = true; + } + else + { + if (this.type == 278) + { + this.name = "Ichor Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.light = 1f; + this.ranged = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 279) + { + this.name = "Ichor Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.25f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 280) + { + this.name = "Golden Shower"; + this.width = 32; + this.height = 32; + this.aiStyle = 12; + this.friendly = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.ignoreWater = true; + this.magic = true; + } + else + { + if (this.type == 281) + { + this.name = "Explosive Bunny"; + this.width = 28; + this.height = 28; + this.aiStyle = 49; + this.friendly = true; + this.penetrate = 1; + this.alpha = 255; + this.timeLeft = 600; + } + else + { + if (this.type == 282) + { + this.name = "Venom Arrow"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.friendly = true; + this.ranged = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 283) + { + this.name = "Venom Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.25f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 284) + { + this.name = "Party Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.3f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 285) + { + this.name = "Nano Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.3f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 286) + { + this.name = "Explosive Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.3f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 287) + { + this.name = "Golden Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.friendly = true; + this.penetrate = 1; + this.light = 0.5f; + this.alpha = 255; + this.maxUpdates = 2; + this.scale = 1.3f; + this.timeLeft = 600; + this.ranged = true; + } + else + { + if (this.type == 288) + { + this.name = "Golden Shower"; + this.width = 32; + this.height = 32; + this.aiStyle = 12; + this.hostile = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.ignoreWater = true; + this.magic = true; + } + else + { + if (this.type == 289) + { + this.name = "Confetti"; + this.width = 10; + this.height = 10; + this.aiStyle = 1; + this.alpha = 255; + this.penetrate = -1; + this.timeLeft = 2; + } + else + { + if (this.type == 290) + { + this.name = "Shadow Beam"; + this.width = 4; + this.height = 4; + this.aiStyle = 48; + this.hostile = true; + this.magic = true; + this.maxUpdates = 100; + this.timeLeft = 100; + this.penetrate = -1; + } + else + { + if (this.type == 291) + { + this.name = "Inferno"; + this.width = 12; + this.height = 12; + this.aiStyle = 50; + this.hostile = true; + this.alpha = 255; + this.magic = true; + this.tileCollide = false; + this.penetrate = -1; + } + else + { + if (this.type == 292) + { + this.name = "Inferno"; + this.width = 130; + this.height = 130; + this.aiStyle = 50; + this.hostile = true; + this.alpha = 255; + this.magic = true; + this.tileCollide = false; + this.penetrate = -1; + } + else + { + if (this.type == 293) + { + this.name = "Lost Soul"; + this.width = 12; + this.height = 12; + this.aiStyle = 51; + this.hostile = true; + this.alpha = 255; + this.magic = true; + this.tileCollide = false; + this.maxUpdates = 1; + this.penetrate = -1; + } + else + { + if (this.type == 294) + { + this.name = "Shadow Beam"; + this.width = 4; + this.height = 4; + this.aiStyle = 48; + this.friendly = true; + this.magic = true; + this.maxUpdates = 100; + this.timeLeft = 300; + this.penetrate = -1; + } + else + { + if (this.type == 295) + { + this.name = "Inferno"; + this.width = 12; + this.height = 12; + this.aiStyle = 50; + this.friendly = true; + this.alpha = 255; + this.magic = true; + this.tileCollide = true; + } + else + { + if (this.type == 296) + { + this.name = "Inferno"; + this.width = 150; + this.height = 150; + this.aiStyle = 50; + this.friendly = true; + this.alpha = 255; + this.magic = true; + this.tileCollide = false; + this.penetrate = -1; + } + else + { + if (this.type == 297) + { + this.name = "Lost Soul"; + this.width = 12; + this.height = 12; + this.aiStyle = 51; + this.friendly = true; + this.alpha = 255; + this.magic = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 298) + { + this.name = "Spirit Heal"; + this.width = 6; + this.height = 6; + this.aiStyle = 52; + this.alpha = 255; + this.magic = true; + this.tileCollide = false; + this.maxUpdates = 3; + } + else + { + if (this.type == 299) + { + this.name = "Shadowflames"; + this.width = 6; + this.height = 6; + this.aiStyle = 1; + this.hostile = true; + this.alpha = 255; + this.penetrate = -1; + this.maxUpdates = 2; + this.magic = true; + this.ignoreWater = true; + this.tileCollide = false; + } + else + { + if (this.type == 300) + { + this.name = "Paladin's Hammer"; + this.width = 38; + this.height = 38; + this.aiStyle = 2; + this.hostile = true; + this.penetrate = -1; + this.ignoreWater = true; + this.tileCollide = false; + } + else + { + if (this.type == 301) + { + this.name = "Paladin's Hammer"; + this.width = 38; + this.height = 38; + this.aiStyle = 3; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.maxUpdates = 2; + } + else + { + if (this.type == 302) + { + this.name = "Sniper Bullet"; + this.width = 4; + this.height = 4; + this.aiStyle = 1; + this.hostile = true; + this.penetrate = -1; + this.light = 0.3f; + this.alpha = 255; + this.maxUpdates = 7; + this.scale = 1.18f; + this.timeLeft = 300; + this.ranged = true; + this.ignoreWater = true; + } + else + { + if (this.type == 303) + { + this.name = "Rocket"; + this.width = 14; + this.height = 14; + this.aiStyle = 16; + this.hostile = true; + this.penetrate = -1; + this.ranged = true; + } + else + { + if (this.type == 304) + { + this.name = "Vampire Knife"; + this.alpha = 255; + this.width = 30; + this.height = 30; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 1; + this.melee = true; + this.light = 0.2f; + this.ignoreWater = true; + this.maxUpdates = 0; + } + else + { + if (this.type == 305) + { + this.name = "Vampire Heal"; + this.width = 6; + this.height = 6; + this.aiStyle = 52; + this.alpha = 255; + this.tileCollide = false; + this.maxUpdates = 10; + } + else + { + if (this.type == 306) + { + this.name = "Eater's Bite"; + this.alpha = 255; + this.width = 14; + this.height = 14; + this.aiStyle = 2; + this.friendly = true; + this.penetrate = 1; + this.melee = true; + this.ignoreWater = true; + this.maxUpdates = 1; + } + else + { + if (this.type == 307) + { + this.name = "Tiny Eater"; + this.width = 16; + this.height = 16; + this.aiStyle = 36; + this.penetrate = 1; + this.alpha = 255; + this.timeLeft = 600; + this.melee = true; + this.maxUpdates = 3; + } + else + { + if (this.type == 308) + { + this.name = "Frost Hydra"; + this.width = 80; + this.height = 74; + this.aiStyle = 53; + this.timeLeft = 3600; + this.light = 0.25f; + this.ignoreWater = true; + } + else + { + if (this.type == 309) + { + this.name = "Frost Blast"; + this.width = 14; + this.height = 14; + this.aiStyle = 28; + this.alpha = 255; + this.penetrate = 1; + this.friendly = true; + this.maxUpdates = 3; + } + else + { + if (this.type == 310) + { + this.netImportant = true; + this.name = "Blue Flare"; + this.width = 6; + this.height = 6; + this.aiStyle = 33; + this.friendly = true; + this.penetrate = -1; + this.alpha = 255; + this.timeLeft = 36000; + } + else + { + this.active = false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + this.width = (int)((float)this.width * this.scale); + this.height = (int)((float)this.height * this.scale); + } + public static int NewProjectile(float X, float Y, float SpeedX, float SpeedY, int Type, int Damage, float KnockBack, int Owner = 255, float ai0 = 0f, float ai1 = 0f) + { + int num = 1000; + for (int i = 0; i < 1000; i++) + { + if (!Main.projectile[i].active) + { + num = i; + break; + } + } + if (num == 1000) + { + return num; + } + Main.projectile[num].SetDefaults(Type); + Main.projectile[num].position.X = X - (float)Main.projectile[num].width * 0.5f; + Main.projectile[num].position.Y = Y - (float)Main.projectile[num].height * 0.5f; + Main.projectile[num].owner = Owner; + Main.projectile[num].velocity.X = SpeedX; + Main.projectile[num].velocity.Y = SpeedY; + Main.projectile[num].damage = Damage; + Main.projectile[num].knockBack = KnockBack; + Main.projectile[num].identity = num; + Main.projectile[num].gfxOffY = 0f; + Main.projectile[num].stepSpeed = 1f; + Main.projectile[num].wet = Collision.WetCollision(Main.projectile[num].position, Main.projectile[num].width, Main.projectile[num].height); + if (Main.projectile[num].ignoreWater) + { + Main.projectile[num].wet = false; + } + Main.projectile[num].honeyWet = Collision.honey; + if (Owner == Main.myPlayer) + { + if (Type == 206) + { + Main.projectile[num].ai[0] = (float)Main.rand.Next(-100, 101) * 0.0005f; + Main.projectile[num].ai[1] = (float)Main.rand.Next(-100, 101) * 0.0005f; + } + else + { + Main.projectile[num].ai[0] = ai0; + Main.projectile[num].ai[1] = ai1; + } + } + if (Main.netMode != 0 && Owner == Main.myPlayer) + { + NetMessage.SendData(27, -1, -1, "", num, 0f, 0f, 0f, 0); + } + if (Owner == Main.myPlayer) + { + if (Type == 28) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 29) + { + Main.projectile[num].timeLeft = 300; + } + if (Type == 30) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 37) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 75) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 133) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 136) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 139) + { + Main.projectile[num].timeLeft = 180; + } + if (Type == 142) + { + Main.projectile[num].timeLeft = 180; + } + } + if (Type == 249) + { + Main.projectile[num].frame = Main.rand.Next(5); + } + return num; + } + public void StatusNPC(int i) + { + if (this.melee && Main.player[this.owner].meleeEnchant > 0) + { + int meleeEnchant = (int)Main.player[this.owner].meleeEnchant; + if (meleeEnchant == 1) + { + Main.npc[i].AddBuff(70, 60 * Main.rand.Next(5, 10), false); + } + if (meleeEnchant == 2) + { + Main.npc[i].AddBuff(39, 60 * Main.rand.Next(3, 7), false); + } + if (meleeEnchant == 3) + { + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false); + } + if (meleeEnchant == 5) + { + Main.npc[i].AddBuff(69, 60 * Main.rand.Next(10, 20), false); + } + if (meleeEnchant == 6) + { + Main.npc[i].AddBuff(31, 60 * Main.rand.Next(1, 4), false); + } + if (meleeEnchant == 8) + { + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(5, 10), false); + } + if (meleeEnchant == 4) + { + Main.npc[i].AddBuff(69, 120, false); + } + } + if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn) + { + Main.npc[i].AddBuff(44, 60 * Main.rand.Next(5, 15), false); + } + if (this.melee && Main.player[this.owner].magmaStone) + { + if (Main.rand.Next(7) == 0) + { + Main.npc[i].AddBuff(24, 360, false); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(24, 120, false); + } + else + { + Main.npc[i].AddBuff(24, 60, false); + } + } + } + if (this.type == 295 || this.type == 296) + { + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(8, 16), false); + } + if (this.type == 2 && Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(24, 180, false); + } + if (this.type == 287) + { + Main.npc[i].AddBuff(72, 120, false); + } + if (this.type == 285) + { + if (Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(31, 180, false); + } + else + { + Main.npc[i].AddBuff(31, 60, false); + } + } + if (this.type == 172) + { + if (Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(44, 240, false); + } + } + else + { + if (this.type == 15) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[i].AddBuff(24, 300, false); + } + } + else + { + if (this.type == 253) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[i].AddBuff(44, 600, false); + } + } + else + { + if (this.type == 19) + { + if (Main.rand.Next(5) == 0) + { + Main.npc[i].AddBuff(24, 180, false); + } + } + else + { + if (this.type == 33) + { + if (Main.rand.Next(5) == 0) + { + Main.npc[i].AddBuff(20, 420, false); + } + } + else + { + if (this.type == 34) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[i].AddBuff(24, 240, false); + } + } + else + { + if (this.type == 35) + { + if (Main.rand.Next(4) == 0) + { + Main.npc[i].AddBuff(24, 180, false); + } + } + else + { + if (this.type == 54) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[i].AddBuff(20, 600, false); + } + } + else + { + if (this.type == 267) + { + if (Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(20, 3600, false); + } + else + { + Main.npc[i].AddBuff(20, 1800, false); + } + } + else + { + if (this.type == 63) + { + if (Main.rand.Next(3) != 0) + { + Main.npc[i].AddBuff(31, 120, false); + } + } + else + { + if (this.type == 85 || this.type == 188) + { + Main.npc[i].AddBuff(24, 1200, false); + } + else + { + if (this.type == 95 || this.type == 103 || this.type == 104) + { + Main.npc[i].AddBuff(39, 420, false); + } + else + { + if (this.type == 278 || this.type == 279 || this.type == 280) + { + Main.npc[i].AddBuff(69, 900, false); + } + else + { + if (this.type == 282 || this.type == 283) + { + Main.npc[i].AddBuff(70, 600, false); + } + else + { + if (this.type == 98) + { + Main.npc[i].AddBuff(20, 600, false); + } + else + { + if (this.type == 184) + { + Main.npc[i].AddBuff(20, 900, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type != 163 && this.type != 310) + { + if (this.type == 265) + { + Main.npc[i].AddBuff(20, 3600, false); + } + return; + } + if (Main.rand.Next(3) == 0) + { + Main.npc[i].AddBuff(24, 600, false); + return; + } + Main.npc[i].AddBuff(24, 300, false); + } + public void StatusPvP(int i) + { + if (this.melee && Main.player[this.owner].meleeEnchant > 0) + { + int meleeEnchant = (int)Main.player[this.owner].meleeEnchant; + if (meleeEnchant == 1) + { + Main.player[i].AddBuff(70, 60 * Main.rand.Next(5, 10), true); + } + if (meleeEnchant == 2) + { + Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7), true); + } + if (meleeEnchant == 3) + { + Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7), true); + } + if (meleeEnchant == 5) + { + Main.player[i].AddBuff(69, 60 * Main.rand.Next(10, 20), true); + } + if (meleeEnchant == 6) + { + Main.player[i].AddBuff(31, 60 * Main.rand.Next(1, 4), true); + } + if (meleeEnchant == 8) + { + Main.player[i].AddBuff(20, 60 * Main.rand.Next(5, 10), true); + } + } + if (this.type == 295 || this.type == 296) + { + Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16), true); + } + if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn) + { + Main.player[i].AddBuff(44, 60 * Main.rand.Next(1, 8), false); + } + if (this.melee && Main.player[this.owner].magmaStone) + { + if (Main.rand.Next(7) == 0) + { + Main.player[i].AddBuff(24, 360, true); + } + else + { + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(24, 120, true); + } + else + { + Main.player[i].AddBuff(24, 60, true); + } + } + } + if (this.type == 2 && Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(24, 180, false); + } + if (this.type == 172) + { + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(44, 240, false); + } + } + else + { + if (this.type == 15) + { + if (Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(24, 300, false); + } + } + else + { + if (this.type == 267) + { + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(20, 3600, true); + } + else + { + Main.player[i].AddBuff(20, 1800, true); + } + } + else + { + if (this.type == 19) + { + if (Main.rand.Next(5) == 0) + { + Main.player[i].AddBuff(24, 180, false); + } + } + else + { + if (this.type == 33) + { + if (Main.rand.Next(5) == 0) + { + Main.player[i].AddBuff(20, 420, false); + } + } + else + { + if (this.type == 34) + { + if (Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(24, 240, false); + } + } + else + { + if (this.type == 35) + { + if (Main.rand.Next(4) == 0) + { + Main.player[i].AddBuff(24, 180, false); + } + } + else + { + if (this.type == 54) + { + if (Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(20, 600, false); + } + } + else + { + if (this.type == 63) + { + if (Main.rand.Next(3) != 0) + { + Main.player[i].AddBuff(31, 120, true); + } + } + else + { + if (this.type == 85 || this.type == 188) + { + Main.player[i].AddBuff(24, 1200, false); + } + else + { + if (this.type == 95 || this.type == 103 || this.type == 104) + { + Main.player[i].AddBuff(39, 420, true); + } + else + { + if (this.type == 278 || this.type == 279 || this.type == 280) + { + Main.player[i].AddBuff(69, 900, true); + } + else + { + if (this.type == 282 || this.type == 283) + { + Main.player[i].AddBuff(70, 600, true); + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type != 163 && this.type != 310) + { + if (this.type == 265) + { + Main.player[i].AddBuff(20, 1800, true); + } + return; + } + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(24, 600, true); + return; + } + Main.player[i].AddBuff(24, 300, true); + } + public void ghostHeal(int dmg, Vector2 Position) + { + float num = 0.1f; + num -= (float)this.numHits * 0.02f; + if (num <= 0f) + { + return; + } + float num2 = (float)dmg * num; + if ((int)num2 <= 0) + { + return; + } + if (!this.magic) + { + return; + } + float num3 = 0f; + int num4 = this.owner; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[this.owner].hostile && !Main.player[i].hostile) || Main.player[this.owner].team == Main.player[i].team)) + { + float num5 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - this.position.X + (float)(this.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - this.position.Y + (float)(this.height / 2)); + if (num5 < 800f && (float)(Main.player[i].statLifeMax - Main.player[i].statLife) > num3) + { + num3 = (float)(Main.player[i].statLifeMax - Main.player[i].statLife); + num4 = i; + } + } + } + Projectile.NewProjectile(Position.X, Position.Y, 0f, 0f, 298, 0, 0f, this.owner, (float)num4, num2); + } + public void vampireHeal(int dmg, Vector2 Position) + { + float num = (float)dmg * 0.075f; + if ((int)num == 0) + { + return; + } + int num2 = this.owner; + Projectile.NewProjectile(Position.X, Position.Y, 0f, 0f, 305, 0, 0f, this.owner, (float)num2, num); + } + public void StatusPlayer(int i) + { + if (this.type == 55 && Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(20, 600, true); + } + if (this.type == 44 && Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(22, 900, true); + } + if (this.type == 293) + { + Main.player[i].AddBuff(80, 60 * Main.rand.Next(2, 7), true); + } + if (this.type == 82 && Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(24, 420, true); + } + if (this.type == 285) + { + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(31, 180, true); + } + else + { + Main.player[i].AddBuff(31, 60, true); + } + } + if (this.type == 96 || this.type == 101) + { + if (Main.rand.Next(3) == 0) + { + Main.player[i].AddBuff(39, 480, true); + } + } + else + { + if (this.type == 288) + { + Main.player[i].AddBuff(69, 900, true); + } + else + { + if (this.type == 253 && Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(44, 600, true); + } + } + } + if (this.type == 291 || this.type == 292) + { + Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16), true); + } + if (this.type == 98) + { + Main.player[i].AddBuff(20, 600, true); + } + if (this.type == 184) + { + Main.player[i].AddBuff(20, 900, true); + } + if (this.type == 290) + { + Main.player[i].AddBuff(32, 60 * Main.rand.Next(5, 16), true); + } + if (this.type == 174) + { + Main.player[i].AddBuff(46, 1200, true); + if (!Main.player[i].frozen && Main.rand.Next(20) == 0) + { + Main.player[i].AddBuff(47, 90, true); + } + } + if (this.type == 257) + { + Main.player[i].AddBuff(46, 2700, true); + if (!Main.player[i].frozen && Main.rand.Next(5) == 0) + { + Main.player[i].AddBuff(47, 60, true); + } + } + if (this.type == 177) + { + Main.player[i].AddBuff(46, 1500, true); + if (!Main.player[i].frozen && Main.rand.Next(10) == 0) + { + Main.player[i].AddBuff(47, Main.rand.Next(30, 120), true); + } + } + if (this.type == 176) + { + if (Main.rand.Next(4) == 0) + { + Main.player[i].AddBuff(20, 1200, true); + return; + } + if (Main.rand.Next(2) == 0) + { + Main.player[i].AddBuff(20, 300, true); + } + } + } + public void Damage() + { + if (this.type == 18 || this.type == 72 || this.type == 86 || this.type == 87 || this.aiStyle == 31 || this.aiStyle == 32 || this.type == 226) + { + return; + } + if (Main.projPet[this.type] && this.type != 266) + { + return; + } + Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + if (this.type == 85 || this.type == 101) + { + int num = 30; + rectangle.X -= num; + rectangle.Y -= num; + rectangle.Width += num * 2; + rectangle.Height += num * 2; + } + if (this.type == 188) + { + int num2 = 20; + rectangle.X -= num2; + rectangle.Y -= num2; + rectangle.Width += num2 * 2; + rectangle.Height += num2 * 2; + } + if (this.aiStyle == 29) + { + int num3 = 4; + rectangle.X -= num3; + rectangle.Y -= num3; + rectangle.Width += num3 * 2; + rectangle.Height += num3 * 2; + } + if (this.friendly && this.owner == Main.myPlayer) + { + if (((this.aiStyle == 16 || this.type == 41) && (this.timeLeft <= 1 || this.type == 108 || this.type == 164)) || (this.type == 286 && this.localAI[1] == -1f)) + { + int myPlayer = Main.myPlayer; + if (Main.player[myPlayer].active && !Main.player[myPlayer].dead && !Main.player[myPlayer].immune && (!this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.player[myPlayer].position, Main.player[myPlayer].width, Main.player[myPlayer].height))) + { + Rectangle value = new Rectangle((int)Main.player[myPlayer].position.X, (int)Main.player[myPlayer].position.Y, Main.player[myPlayer].width, Main.player[myPlayer].height); + if (rectangle.Intersects(value)) + { + if (Main.player[myPlayer].position.X + (float)(Main.player[myPlayer].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + int num4 = Main.DamageVar((float)this.damage); + this.StatusPlayer(myPlayer); + Main.player[myPlayer].Hurt(num4, this.direction, true, false, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), false); + if (Main.netMode != 0) + { + NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), myPlayer, (float)this.direction, (float)num4, 1f, 0); + } + } + } + } + if (this.type != 69 && this.type != 70 && this.type != 10 && this.type != 11 && this.aiStyle != 45) + { + int num5 = (int)(this.position.X / 16f); + int num6 = (int)((this.position.X + (float)this.width) / 16f) + 1; + int num7 = (int)(this.position.Y / 16f); + int num8 = (int)((this.position.Y + (float)this.height) / 16f) + 1; + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int i = num5; i < num6; i++) + { + for (int j = num7; j < num8; j++) + { + if (Main.tile[i, j] != null && Main.tileCut[(int)Main.tile[i, j].type] && Main.tile[i, j + 1] != null && Main.tile[i, j + 1].type != 78) + { + WorldGen.KillTile(i, j, false, false, false); + if (Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)i, (float)j, 0f, 0); + } + } + } + } + } + } + if (this.owner == Main.myPlayer) + { + if (this.damage > 0) + { + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && !Main.npc[k].dontTakeDamage && (((!Main.npc[k].friendly || (Main.npc[k].type == 22 && this.owner < 255 && Main.player[this.owner].killGuide)) && this.friendly) || (Main.npc[k].friendly && this.hostile)) && (this.owner < 0 || Main.npc[k].immune[this.owner] == 0)) + { + bool flag = false; + if (this.type == 11 && (Main.npc[k].type == 47 || Main.npc[k].type == 57)) + { + flag = true; + } + else + { + if (this.type == 31 && Main.npc[k].type == 69) + { + flag = true; + } + } + if (!flag && (Main.npc[k].noTileCollide || !this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.npc[k].position, Main.npc[k].width, Main.npc[k].height))) + { + Rectangle value2 = new Rectangle((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height); + if (rectangle.Intersects(value2)) + { + if (this.aiStyle == 3 && this.type != 301) + { + if (this.ai[0] == 0f) + { + this.velocity.X = -this.velocity.X; + this.velocity.Y = -this.velocity.Y; + this.netUpdate = true; + } + this.ai[0] = 1f; + } + else + { + if (this.aiStyle == 16) + { + if (this.timeLeft > 3) + { + this.timeLeft = 3; + } + if (Main.npc[k].position.X + (float)(Main.npc[k].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + } + else + { + if (this.aiStyle == 50) + { + if (Main.npc[k].position.X + (float)(Main.npc[k].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + } + } + } + if (this.aiStyle == 39) + { + if (this.ai[1] == 0f) + { + this.ai[1] = (float)(k + 1); + this.netUpdate = true; + } + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = 1; + } + else + { + this.direction = -1; + } + } + if (this.type == 41 && this.timeLeft > 1) + { + this.timeLeft = 1; + } + bool flag2 = false; + if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit) + { + flag2 = true; + } + if (this.ranged && Main.rand.Next(1, 101) <= Main.player[this.owner].rangedCrit) + { + flag2 = true; + } + if (this.magic && Main.rand.Next(1, 101) <= Main.player[this.owner].magicCrit) + { + flag2 = true; + } + int num9 = Main.DamageVar((float)this.damage); + if (this.type == 294) + { + this.damage = (int)((double)this.damage * 0.8); + } + if (this.type == 261) + { + float num10 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y)); + if (num10 < 1f) + { + num10 = 1f; + } + num9 = (int)((float)num9 * num10 / 8f); + } + this.StatusNPC(k); + if (this.type != 221 && this.type != 227) + { + Main.player[this.owner].onHit(Main.npc[k].center().X, Main.npc[k].center().Y); + } + int num11 = (int)Main.npc[k].StrikeNPC(num9, this.knockBack, this.direction, flag2, false); + if (num11 > 0 && Main.npc[k].lifeMax > 5 && Main.player[this.owner].ghostHeal) + { + this.ghostHeal(num11, new Vector2(Main.npc[k].center().X, Main.npc[k].center().Y)); + } + if (this.type == 304 && num11 > 0 && Main.npc[k].lifeMax > 5) + { + this.vampireHeal(num11, new Vector2(Main.npc[k].center().X, Main.npc[k].center().Y)); + } + if (this.melee && Main.player[this.owner].meleeEnchant == 7) + { + Projectile.NewProjectile(Main.npc[k].center().X, Main.npc[k].center().Y, Main.npc[k].velocity.X, Main.npc[k].velocity.Y, 289, 0, 0f, this.owner, 0f, 0f); + } + if (Main.npc[k].value > 0f && Main.player[this.owner].coins && Main.rand.Next(5) == 0) + { + int num12 = 71; + if (Main.rand.Next(10) == 0) + { + num12 = 72; + } + if (Main.rand.Next(100) == 0) + { + num12 = 73; + } + int num13 = Item.NewItem((int)Main.npc[k].position.X, (int)Main.npc[k].position.Y, Main.npc[k].width, Main.npc[k].height, num12, 1, false, 0, false); + Main.item[num13].stack = Main.rand.Next(1, 11); + Main.item[num13].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num13].velocity.X = (float)Main.rand.Next(10, 31) * 0.2f * (float)this.direction; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, "", num13, 0f, 0f, 0f, 0); + } + } + if (Main.netMode != 0) + { + if (flag2) + { + NetMessage.SendData(28, -1, -1, "", k, (float)num9, this.knockBack, (float)this.direction, 1); + } + else + { + NetMessage.SendData(28, -1, -1, "", k, (float)num9, this.knockBack, (float)this.direction, 0); + } + } + if (this.type == 286) + { + Main.npc[k].immune[this.owner] = 5; + } + else + { + if (this.penetrate != 1) + { + Main.npc[k].immune[this.owner] = 10; + } + } + if (this.penetrate > 0) + { + this.penetrate--; + if (this.penetrate == 0) + { + break; + } + } + if (this.aiStyle == 7) + { + this.ai[0] = 1f; + this.damage = 0; + this.netUpdate = true; + } + else + { + if (this.aiStyle == 13) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + } + this.numHits++; + } + } + } + } + } + if (this.damage > 0 && Main.player[Main.myPlayer].hostile) + { + for (int l = 0; l < 255; l++) + { + if (l != this.owner && Main.player[l].active && !Main.player[l].dead && !Main.player[l].immune && Main.player[l].hostile && this.playerImmune[l] <= 0 && (Main.player[Main.myPlayer].team == 0 || Main.player[Main.myPlayer].team != Main.player[l].team) && (!this.ownerHitCheck || Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, Main.player[l].position, Main.player[l].width, Main.player[l].height))) + { + Rectangle value3 = new Rectangle((int)Main.player[l].position.X, (int)Main.player[l].position.Y, Main.player[l].width, Main.player[l].height); + if (rectangle.Intersects(value3)) + { + if (this.aiStyle == 3) + { + if (this.ai[0] == 0f) + { + this.velocity.X = -this.velocity.X; + this.velocity.Y = -this.velocity.Y; + this.netUpdate = true; + } + this.ai[0] = 1f; + } + else + { + if (this.aiStyle == 16) + { + if (this.timeLeft > 3) + { + this.timeLeft = 3; + } + if (Main.player[l].position.X + (float)(Main.player[l].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + } + } + if (this.type == 41 && this.timeLeft > 1) + { + this.timeLeft = 1; + } + bool flag3 = false; + if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit) + { + flag3 = true; + } + int num14 = Main.DamageVar((float)this.damage); + if (!Main.player[l].immune) + { + this.StatusPvP(l); + } + if (this.type != 221 && this.type != 227) + { + Main.player[this.owner].onHit(Main.player[l].center().X, Main.player[l].center().Y); + } + int num15 = (int)Main.player[l].Hurt(num14, this.direction, true, false, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), flag3); + if (num15 > 0 && Main.player[this.owner].ghostHeal) + { + this.ghostHeal(num15, new Vector2(Main.player[l].center().X, Main.player[l].center().Y)); + } + if (this.type == 304 && num15 > 0) + { + this.vampireHeal(num15, new Vector2(Main.player[l].center().X, Main.player[l].center().Y)); + } + if (this.melee && Main.player[this.owner].meleeEnchant == 7) + { + Projectile.NewProjectile(Main.player[l].center().X, Main.player[l].center().Y, Main.player[l].velocity.X, Main.player[l].velocity.Y, 289, 0, 0f, this.owner, 0f, 0f); + } + if (Main.netMode != 0) + { + if (flag3) + { + NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), l, (float)this.direction, (float)num14, 1f, 1); + } + else + { + NetMessage.SendData(26, -1, -1, Lang.deathMsg(this.owner, -1, this.whoAmI, -1), l, (float)this.direction, (float)num14, 1f, 0); + } + } + this.playerImmune[l] = 40; + if (this.penetrate > 0) + { + this.penetrate--; + if (this.penetrate == 0) + { + break; + } + } + if (this.aiStyle == 7) + { + this.ai[0] = 1f; + this.damage = 0; + this.netUpdate = true; + } + else + { + if (this.aiStyle == 13) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + } + } + } + } + } + } + if (this.type == 11 && Main.netMode != 1) + { + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active) + { + if (Main.npc[m].type == 46) + { + Rectangle value4 = new Rectangle((int)Main.npc[m].position.X, (int)Main.npc[m].position.Y, Main.npc[m].width, Main.npc[m].height); + if (rectangle.Intersects(value4)) + { + Main.npc[m].Transform(47); + } + } + else + { + if (Main.npc[m].type == 55) + { + Rectangle value5 = new Rectangle((int)Main.npc[m].position.X, (int)Main.npc[m].position.Y, Main.npc[m].width, Main.npc[m].height); + if (rectangle.Intersects(value5)) + { + Main.npc[m].Transform(57); + } + } + } + } + } + } + if (Main.netMode != 2 && this.hostile && Main.myPlayer < 255 && this.damage > 0) + { + int myPlayer2 = Main.myPlayer; + if (Main.player[myPlayer2].active && !Main.player[myPlayer2].dead && !Main.player[myPlayer2].immune) + { + Rectangle value6 = new Rectangle((int)Main.player[myPlayer2].position.X, (int)Main.player[myPlayer2].position.Y, Main.player[myPlayer2].width, Main.player[myPlayer2].height); + if (rectangle.Intersects(value6)) + { + int hitDirection = this.direction; + if (Main.player[myPlayer2].position.X + (float)(Main.player[myPlayer2].width / 2) < this.position.X + (float)(this.width / 2)) + { + hitDirection = -1; + } + else + { + hitDirection = 1; + } + int num16 = Main.DamageVar((float)this.damage); + if (!Main.player[myPlayer2].immune) + { + this.StatusPlayer(myPlayer2); + } + Main.player[myPlayer2].Hurt(num16 * 2, hitDirection, false, false, Lang.deathMsg(-1, -1, this.whoAmI, -1), false); + } + } + } + } + public void ProjLight() + { + if (this.light > 0f) + { + float num = this.light; + float num2 = this.light; + float num3 = this.light; + if (this.type == 259) + { + num3 *= 0.1f; + } + else + { + if (this.type == 2 || this.type == 82) + { + num2 *= 0.75f; + num3 *= 0.55f; + } + else + { + if (this.type == 172) + { + num2 *= 0.55f; + num *= 0.35f; + } + else + { + if (this.type == 308) + { + num2 *= 0.7f; + num *= 0.1f; + } + else + { + if (this.type == 304) + { + num2 *= 0.2f; + num3 *= 0.1f; + } + else + { + if (this.type == 263) + { + num2 *= 0.7f; + num *= 0.1f; + } + else + { + if (this.type == 274) + { + num2 *= 0.1f; + num *= 0.7f; + } + else + { + if (this.type == 254) + { + num *= 0.1f; + } + else + { + if (this.type == 94) + { + num *= 0.5f; + num2 *= 0f; + } + else + { + if (this.type == 95 || this.type == 96 || this.type == 103 || this.type == 104) + { + num *= 0.35f; + num2 *= 1f; + num3 *= 0f; + } + else + { + if (this.type == 4) + { + num2 *= 0.1f; + num *= 0.5f; + } + else + { + if (this.type == 257) + { + num2 *= 0.9f; + num *= 0.1f; + } + else + { + if (this.type == 9) + { + num2 *= 0.1f; + num3 *= 0.6f; + } + else + { + if (this.type == 92) + { + num2 *= 0.6f; + num *= 0.8f; + } + else + { + if (this.type == 93) + { + num2 *= 1f; + num *= 1f; + num3 *= 0.01f; + } + else + { + if (this.type == 12) + { + num *= 0.9f; + num2 *= 0.8f; + num3 *= 0.1f; + } + else + { + if (this.type == 14 || this.type == 110 || this.type == 180 || this.type == 242 || this.type == 302) + { + num2 *= 0.7f; + num3 *= 0.1f; + } + else + { + if (this.type == 15) + { + num2 *= 0.4f; + num3 *= 0.1f; + num = 1f; + } + else + { + if (this.type == 16) + { + num *= 0.1f; + num2 *= 0.4f; + num3 = 1f; + } + else + { + if (this.type == 18) + { + num2 *= 0.1f; + num *= 0.6f; + } + else + { + if (this.type == 19) + { + num2 *= 0.5f; + num3 *= 0.1f; + } + else + { + if (this.type == 20) + { + num *= 0.1f; + num3 *= 0.3f; + } + else + { + if (this.type == 22) + { + num = 0f; + num2 = 0f; + } + else + { + if (this.type == 27) + { + num *= 0f; + num2 *= 0.3f; + num3 = 1f; + } + else + { + if (this.type == 34) + { + num2 *= 0.1f; + num3 *= 0.1f; + } + else + { + if (this.type == 36) + { + num = 0.8f; + num2 *= 0.2f; + num3 *= 0.6f; + } + else + { + if (this.type == 41) + { + num2 *= 0.8f; + num3 *= 0.6f; + } + else + { + if (this.type == 44 || this.type == 45) + { + num3 = 1f; + num *= 0.6f; + num2 *= 0.1f; + } + else + { + if (this.type == 50) + { + num *= 0.7f; + num3 *= 0.8f; + } + else + { + if (this.type == 53) + { + num *= 0.7f; + num2 *= 0.8f; + } + else + { + if (this.type == 72) + { + num *= 0.45f; + num2 *= 0.75f; + num3 = 1f; + } + else + { + if (this.type == 86) + { + num *= 1f; + num2 *= 0.45f; + num3 = 0.75f; + } + else + { + if (this.type == 87) + { + num *= 0.45f; + num2 = 1f; + num3 *= 0.75f; + } + else + { + if (this.type == 73) + { + num *= 0.4f; + num2 *= 0.6f; + num3 *= 1f; + } + else + { + if (this.type == 74) + { + num *= 1f; + num2 *= 0.4f; + num3 *= 0.6f; + } + else + { + if (this.type == 284) + { + num *= 1f; + num2 *= 0.1f; + num3 *= 0.8f; + } + else + { + if (this.type == 285) + { + num *= 0.1f; + num2 *= 0.5f; + num3 *= 1f; + } + else + { + if (this.type == 286) + { + num *= 1f; + num2 *= 0.5f; + num3 *= 0.1f; + } + else + { + if (this.type == 287) + { + num *= 0.9f; + num2 *= 1f; + num3 *= 0.4f; + } + else + { + if (this.type == 283) + { + num *= 0.8f; + num2 *= 0.1f; + } + else + { + if (this.type == 76 || this.type == 77 || this.type == 78) + { + num *= 1f; + num2 *= 0.3f; + num3 *= 0.6f; + } + else + { + if (this.type == 79) + { + num = (float)Main.DiscoR / 255f; + num2 = (float)Main.DiscoG / 255f; + num3 = (float)Main.DiscoB / 255f; + } + else + { + if (this.type == 80) + { + num *= 0f; + num2 *= 0.8f; + num3 *= 1f; + } + else + { + if (this.type == 83 || this.type == 88) + { + num *= 0.7f; + num2 *= 0f; + num3 *= 1f; + } + else + { + if (this.type == 100) + { + num *= 1f; + num2 *= 0.5f; + num3 *= 0f; + } + else + { + if (this.type == 84) + { + num *= 0.8f; + num2 *= 0f; + num3 *= 0.5f; + } + else + { + if (this.type == 89 || this.type == 90) + { + num2 *= 0.2f; + num3 *= 1f; + num *= 0.05f; + } + else + { + if (this.type == 106) + { + num *= 0f; + num2 *= 0.5f; + num3 *= 1f; + } + else + { + if (this.type == 113) + { + num *= 0.25f; + num2 *= 0.75f; + num3 *= 1f; + } + else + { + if (this.type == 114 || this.type == 115) + { + num *= 0.5f; + num2 *= 0.05f; + num3 *= 1f; + } + else + { + if (this.type == 116) + { + num3 *= 0.25f; + } + else + { + if (this.type == 131) + { + num *= 0.1f; + num2 *= 0.4f; + } + else + { + if (this.type == 132 || this.type == 157) + { + num *= 0.2f; + num3 *= 0.6f; + } + else + { + if (this.type == 156) + { + num *= 1f; + num3 *= 0.6f; + num2 = 0f; + } + else + { + if (this.type == 173) + { + num *= 0.3f; + num3 *= 1f; + num2 = 0.4f; + } + else + { + if (this.type == 207) + { + num *= 0.4f; + num3 *= 0.4f; + } + else + { + if (this.type == 253) + { + num = 0f; + num2 *= 0.4f; + } + else + { + if (this.type == 211) + { + num *= 0.5f; + num2 *= 0.9f; + num3 *= 1f; + if (this.localAI[0] == 0f) + { + this.light = 1.5f; + } + else + { + this.light = 1f; + } + } + else + { + if (this.type == 209) + { + float num4 = (255f - (float)this.alpha) / 255f; + num *= 0.3f; + num2 *= 0.4f; + num3 *= 1.75f; + num3 *= num4; + num *= num4; + num2 *= num4; + } + else + { + if (this.type == 226 || (this.type == 227 | this.type == 229)) + { + num *= 0.25f; + num2 *= 1f; + num3 *= 0.5f; + } + else + { + if (this.type == 251) + { + num = (float)Main.DiscoR / 255f; + num2 = (float)Main.DiscoG / 255f; + num3 = (float)Main.DiscoB / 255f; + num = (num + 1f) / 2f; + num2 = (num2 + 1f) / 2f; + num3 = (num3 + 1f) / 2f; + num *= this.light; + num2 *= this.light; + num3 *= this.light; + } + else + { + if (this.type == 278 || this.type == 279) + { + num *= 1f; + num2 *= 1f; + num3 *= 0f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + Lighting.addLight((int)((this.position.X + (float)(this.width / 2)) / 16f), (int)((this.position.Y + (float)(this.height / 2)) / 16f), num, num2, num3); + } + } + public Vector2 center() + { + return new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)); + } + public Rectangle getRect() + { + return new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + } + public void Update(int i) + { + if (this.active) + { + if (Main.player[this.owner].frostBurn && (this.melee || this.ranged) && this.friendly && !this.hostile && Main.rand.Next(2 * (1 + this.maxUpdates)) == 0) + { + int num = Dust.NewDust(this.position, this.width, this.height, 135, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num].noGravity = true; + Main.dust[num].velocity *= 0.7f; + Dust expr_F2_cp_0 = Main.dust[num]; + expr_F2_cp_0.velocity.Y = expr_F2_cp_0.velocity.Y - 0.5f; + } + if (this.melee && Main.player[this.owner].meleeEnchant > 0) + { + if (Main.player[this.owner].meleeEnchant == 1 && Main.rand.Next(3) == 0) + { + int num2 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f); + Main.dust[num2].noGravity = true; + Main.dust[num2].fadeIn = 1.5f; + Main.dust[num2].velocity *= 0.25f; + } + if (Main.player[this.owner].meleeEnchant == 1) + { + if (Main.rand.Next(3) == 0) + { + int num3 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f); + Main.dust[num3].noGravity = true; + Main.dust[num3].fadeIn = 1.5f; + Main.dust[num3].velocity *= 0.25f; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 2) + { + if (Main.rand.Next(2) == 0) + { + int num4 = Dust.NewDust(this.position, this.width, this.height, 75, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num4].noGravity = true; + Main.dust[num4].velocity *= 0.7f; + Dust expr_309_cp_0 = Main.dust[num4]; + expr_309_cp_0.velocity.Y = expr_309_cp_0.velocity.Y - 0.5f; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 3) + { + if (Main.rand.Next(2) == 0) + { + int num5 = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 2.5f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 0.7f; + Dust expr_3D5_cp_0 = Main.dust[num5]; + expr_3D5_cp_0.velocity.Y = expr_3D5_cp_0.velocity.Y - 0.5f; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 4) + { + if (Main.rand.Next(2) == 0) + { + int num6 = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.1f); + Main.dust[num6].noGravity = true; + Dust expr_488_cp_0 = Main.dust[num6]; + expr_488_cp_0.velocity.X = expr_488_cp_0.velocity.X / 2f; + Dust expr_4A6_cp_0 = Main.dust[num6]; + expr_4A6_cp_0.velocity.Y = expr_4A6_cp_0.velocity.Y / 2f; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 5) + { + if (Main.rand.Next(2) == 0) + { + int num7 = Dust.NewDust(this.position, this.width, this.height, 169, 0f, 0f, 100, default(Color), 1f); + Dust expr_529_cp_0 = Main.dust[num7]; + expr_529_cp_0.velocity.X = expr_529_cp_0.velocity.X + (float)this.direction; + Dust expr_549_cp_0 = Main.dust[num7]; + expr_549_cp_0.velocity.Y = expr_549_cp_0.velocity.Y + 0.2f; + Main.dust[num7].noGravity = true; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 6) + { + if (Main.rand.Next(2) == 0) + { + int num8 = Dust.NewDust(this.position, this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f); + Dust expr_5DA_cp_0 = Main.dust[num8]; + expr_5DA_cp_0.velocity.X = expr_5DA_cp_0.velocity.X + (float)this.direction; + Dust expr_5FA_cp_0 = Main.dust[num8]; + expr_5FA_cp_0.velocity.Y = expr_5FA_cp_0.velocity.Y + 0.2f; + Main.dust[num8].noGravity = true; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 7) + { + if (Main.rand.Next(20) == 0) + { + int num9 = Main.rand.Next(139, 143); + int num10 = Dust.NewDust(this.position, this.width, this.height, num9, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f); + Dust expr_6AA_cp_0 = Main.dust[num10]; + expr_6AA_cp_0.velocity.X = expr_6AA_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_6DE_cp_0 = Main.dust[num10]; + expr_6DE_cp_0.velocity.Y = expr_6DE_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_712_cp_0 = Main.dust[num10]; + expr_712_cp_0.velocity.X = expr_712_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Dust expr_740_cp_0 = Main.dust[num10]; + expr_740_cp_0.velocity.Y = expr_740_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + Main.dust[num10].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + } + if (Main.rand.Next(40) == 0) + { + int num11 = Main.rand.Next(276, 283); + int num12 = Gore.NewGore(this.position, this.velocity, num11, 1f); + Gore expr_7DE_cp_0 = Main.gore[num12]; + expr_7DE_cp_0.velocity.X = expr_7DE_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Gore expr_812_cp_0 = Main.gore[num12]; + expr_812_cp_0.velocity.Y = expr_812_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Main.gore[num12].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Gore expr_875_cp_0 = Main.gore[num12]; + expr_875_cp_0.velocity.X = expr_875_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Gore expr_8A3_cp_0 = Main.gore[num12]; + expr_8A3_cp_0.velocity.Y = expr_8A3_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + } + } + else + { + if (Main.player[this.owner].meleeEnchant == 8 && Main.rand.Next(4) == 0) + { + int num13 = Dust.NewDust(this.position, this.width, this.height, 46, 0f, 0f, 100, default(Color), 1f); + Main.dust[num13].noGravity = true; + Main.dust[num13].fadeIn = 1.5f; + Main.dust[num13].velocity *= 0.25f; + } + } + } + } + } + } + } + } + } + if (this.melee && Main.player[this.owner].magmaStone && Main.rand.Next(3) != 0) + { + int num14 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y - 4f), this.width + 8, this.height + 8, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num14].scale = 1.5f; + } + Main.dust[num14].noGravity = true; + Dust expr_A3D_cp_0 = Main.dust[num14]; + expr_A3D_cp_0.velocity.X = expr_A3D_cp_0.velocity.X * 2f; + Dust expr_A5B_cp_0 = Main.dust[num14]; + expr_A5B_cp_0.velocity.Y = expr_A5B_cp_0.velocity.Y * 2f; + } + if (this.minion) + { + this.minionPos = Main.player[this.owner].numMinions; + if (this.minionPos >= Main.player[this.owner].maxMinions) + { + this.Kill(); + } + Main.player[this.owner].numMinions++; + } + this.lastVelocity = this.velocity; + float num15 = 1f + Math.Abs(this.velocity.X) / 3f; + if (this.gfxOffY > 0f) + { + this.gfxOffY -= num15 * this.stepSpeed; + if (this.gfxOffY < 0f) + { + this.gfxOffY = 0f; + } + } + else + { + if (this.gfxOffY < 0f) + { + this.gfxOffY += num15 * this.stepSpeed; + if (this.gfxOffY > 0f) + { + this.gfxOffY = 0f; + } + } + } + if (this.gfxOffY > 16f) + { + this.gfxOffY = 16f; + } + if (this.gfxOffY < -16f) + { + this.gfxOffY = -16f; + } + Vector2 value = this.velocity; + if (this.position.X <= Main.leftWorld || this.position.X + (float)this.width >= Main.rightWorld || this.position.Y <= Main.topWorld || this.position.Y + (float)this.height >= Main.bottomWorld) + { + this.active = false; + return; + } + this.whoAmI = i; + if (this.soundDelay > 0) + { + this.soundDelay--; + } + this.netUpdate = false; + for (int j = 0; j < 255; j++) + { + if (this.playerImmune[j] > 0) + { + this.playerImmune[j]--; + } + } + this.AI(); + if (this.owner < 255 && !Main.player[this.owner].active) + { + this.Kill(); + } + if (this.type == 242 || this.type == 302) + { + this.wet = false; + } + if (!this.ignoreWater) + { + bool flag; + bool flag2; + try + { + flag = Collision.LavaCollision(this.position, this.width, this.height); + flag2 = Collision.WetCollision(this.position, this.width, this.height); + if (flag) + { + this.lavaWet = true; + } + if (Collision.honey) + { + this.honeyWet = true; + } + } + catch + { + this.active = false; + return; + } + if (this.wet && !this.lavaWet) + { + if (this.type == 85 || this.type == 15 || this.type == 34 || this.type == 188) + { + this.Kill(); + } + if (this.type == 2) + { + this.type = 1; + this.light = 0f; + } + } + if (this.type == 80) + { + flag2 = false; + this.wet = false; + if (flag && this.ai[0] >= 0f) + { + this.Kill(); + } + } + if (flag2) + { + if (this.type != 155 && this.wetCount == 0 && !this.wet) + { + if (!flag) + { + if (this.honeyWet) + { + for (int k = 0; k < 10; k++) + { + int num16 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_E4D_cp_0 = Main.dust[num16]; + expr_E4D_cp_0.velocity.Y = expr_E4D_cp_0.velocity.Y - 1f; + Dust expr_E6B_cp_0 = Main.dust[num16]; + expr_E6B_cp_0.velocity.X = expr_E6B_cp_0.velocity.X * 2.5f; + Main.dust[num16].scale = 1.3f; + Main.dust[num16].alpha = 100; + Main.dust[num16].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + for (int l = 0; l < 10; l++) + { + int num17 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_F56_cp_0 = Main.dust[num17]; + expr_F56_cp_0.velocity.Y = expr_F56_cp_0.velocity.Y - 4f; + Dust expr_F74_cp_0 = Main.dust[num17]; + expr_F74_cp_0.velocity.X = expr_F74_cp_0.velocity.X * 2.5f; + Main.dust[num17].scale = 1.3f; + Main.dust[num17].alpha = 100; + Main.dust[num17].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + for (int m = 0; m < 10; m++) + { + int num18 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_105C_cp_0 = Main.dust[num18]; + expr_105C_cp_0.velocity.Y = expr_105C_cp_0.velocity.Y - 1.5f; + Dust expr_107A_cp_0 = Main.dust[num18]; + expr_107A_cp_0.velocity.X = expr_107A_cp_0.velocity.X * 2.5f; + Main.dust[num18].scale = 1.3f; + Main.dust[num18].alpha = 100; + Main.dust[num18].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + this.wet = true; + } + else + { + if (this.wet) + { + this.wet = false; + if (this.type == 155) + { + this.velocity.Y = this.velocity.Y * 0.5f; + } + else + { + if (this.wetCount == 0) + { + this.wetCount = 10; + if (!this.lavaWet) + { + if (this.honeyWet) + { + for (int n = 0; n < 10; n++) + { + int num19 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 152, 0f, 0f, 0, default(Color), 1f); + Dust expr_11D0_cp_0 = Main.dust[num19]; + expr_11D0_cp_0.velocity.Y = expr_11D0_cp_0.velocity.Y - 1f; + Dust expr_11EE_cp_0 = Main.dust[num19]; + expr_11EE_cp_0.velocity.X = expr_11EE_cp_0.velocity.X * 2.5f; + Main.dust[num19].scale = 1.3f; + Main.dust[num19].alpha = 100; + Main.dust[num19].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + for (int num20 = 0; num20 < 10; num20++) + { + int num21 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2)), this.width + 12, 24, Dust.dustWater(), 0f, 0f, 0, default(Color), 1f); + Dust expr_12D3_cp_0 = Main.dust[num21]; + expr_12D3_cp_0.velocity.Y = expr_12D3_cp_0.velocity.Y - 4f; + Dust expr_12F1_cp_0 = Main.dust[num21]; + expr_12F1_cp_0.velocity.X = expr_12F1_cp_0.velocity.X * 2.5f; + Main.dust[num21].scale = 1.3f; + Main.dust[num21].alpha = 100; + Main.dust[num21].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + for (int num22 = 0; num22 < 10; num22++) + { + int num23 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float)(this.height / 2) - 8f), this.width + 12, 24, 35, 0f, 0f, 0, default(Color), 1f); + Dust expr_13D9_cp_0 = Main.dust[num23]; + expr_13D9_cp_0.velocity.Y = expr_13D9_cp_0.velocity.Y - 1.5f; + Dust expr_13F7_cp_0 = Main.dust[num23]; + expr_13F7_cp_0.velocity.X = expr_13F7_cp_0.velocity.X * 2.5f; + Main.dust[num23].scale = 1.3f; + Main.dust[num23].alpha = 100; + Main.dust[num23].noGravity = true; + } + Main.PlaySound(19, (int)this.position.X, (int)this.position.Y, 1); + } + } + } + } + } + if (!this.wet) + { + this.lavaWet = false; + this.honeyWet = false; + } + if (this.wetCount > 0) + { + this.wetCount -= 1; + } + } + this.lastPosition = this.position; + bool flag3 = false; + if (this.tileCollide) + { + Vector2 vector = this.velocity; + bool flag4 = true; + if (this.type == 9 || this.type == 12 || this.type == 15 || this.type == 13 || this.type == 31 || this.type == 39 || this.type == 40) + { + flag4 = false; + } + if (Main.projPet[this.type]) + { + flag4 = false; + if (Main.player[this.owner].position.Y + (float)Main.player[this.owner].height - 12f > this.position.Y + (float)this.height) + { + flag4 = true; + } + } + if (this.aiStyle == 10) + { + if (this.type == 42 || this.type == 65 || this.type == 68 || (this.type == 31 && this.ai[0] == 2f)) + { + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4); + } + else + { + this.velocity = Collision.AnyCollision(this.position, this.velocity, this.width, this.height); + } + } + else + { + if (this.aiStyle == 29) + { + int num24 = this.width - 8; + int num25 = this.height - 8; + Vector2 vector2 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num24 / 2), this.position.Y + (float)(this.height / 2) - (float)(num25 / 2)); + this.velocity = Collision.TileCollision(vector2, this.velocity, num24, num25, flag4, flag4); + } + else + { + if (this.aiStyle == 49) + { + int num26 = this.width - 8; + int num27 = this.height - 8; + Vector2 vector3 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num26 / 2), this.position.Y + (float)(this.height / 2) - (float)(num27 / 2)); + this.velocity = Collision.TileCollision(vector3, this.velocity, num26, num27, flag4, flag4); + } + else + { + if (this.type == 250 || this.type == 267 || this.type == 297) + { + int num28 = 2; + int num29 = 2; + Vector2 vector4 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num28 / 2), this.position.Y + (float)(this.height / 2) - (float)(num29 / 2)); + this.velocity = Collision.TileCollision(vector4, this.velocity, num28, num29, flag4, flag4); + } + else + { + if (this.type == 308) + { + int num30 = 26; + int num31 = this.height; + Vector2 vector5 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num30 / 2), this.position.Y + (float)(this.height / 2) - (float)(num31 / 2)); + this.velocity = Collision.TileCollision(vector5, this.velocity, num30, num31, flag4, flag4); + } + else + { + if (this.type == 261 || this.type == 277) + { + int num32 = 26; + int num33 = 26; + Vector2 vector6 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num32 / 2), this.position.Y + (float)(this.height / 2) - (float)(num33 / 2)); + this.velocity = Collision.TileCollision(vector6, this.velocity, num32, num33, flag4, flag4); + } + else + { + if (this.type == 106 || this.type == 262 || this.type == 271 || this.type == 270 || this.type == 272 || this.type == 273 || this.type == 274 || this.type == 280 || this.type == 288 || this.type == 301) + { + int num34 = 10; + int num35 = 10; + Vector2 vector7 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num34 / 2), this.position.Y + (float)(this.height / 2) - (float)(num35 / 2)); + this.velocity = Collision.TileCollision(vector7, this.velocity, num34, num35, flag4, flag4); + } + else + { + if (this.type == 248 || this.type == 247) + { + int num36 = this.width - 12; + int num37 = this.height - 12; + Vector2 vector8 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num36 / 2), this.position.Y + (float)(this.height / 2) - (float)(num37 / 2)); + this.velocity = Collision.TileCollision(vector8, this.velocity, num36, num37, flag4, flag4); + } + else + { + if (this.aiStyle == 18 || this.type == 254) + { + int num38 = this.width - 36; + int num39 = this.height - 36; + Vector2 vector9 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num38 / 2), this.position.Y + (float)(this.height / 2) - (float)(num39 / 2)); + this.velocity = Collision.TileCollision(vector9, this.velocity, num38, num39, flag4, flag4); + } + else + { + if (this.type == 182 || this.type == 190 || this.type == 33 || this.type == 229 || this.type == 237 || this.type == 243) + { + int num40 = this.width - 20; + int num41 = this.height - 20; + Vector2 vector10 = new Vector2(this.position.X + (float)(this.width / 2) - (float)(num40 / 2), this.position.Y + (float)(this.height / 2) - (float)(num41 / 2)); + this.velocity = Collision.TileCollision(vector10, this.velocity, num40, num41, flag4, flag4); + } + else + { + if (this.aiStyle == 27) + { + int num42 = 6; + this.velocity = Collision.TileCollision(new Vector2(this.position.X + (float)num42, this.position.Y + (float)num42), this.velocity, this.width - num42 * 2, this.height - num42 * 2, flag4, flag4); + } + else + { + if (this.wet) + { + if (this.honeyWet) + { + Vector2 vector11 = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4); + value = this.velocity * 0.25f; + if (this.velocity.X != vector11.X) + { + value.X = this.velocity.X; + } + if (this.velocity.Y != vector11.Y) + { + value.Y = this.velocity.Y; + } + } + else + { + Vector2 vector12 = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4); + value = this.velocity * 0.5f; + if (this.velocity.X != vector12.X) + { + value.X = this.velocity.X; + } + if (this.velocity.Y != vector12.Y) + { + value.Y = this.velocity.Y; + } + } + } + else + { + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag4, flag4); + if (!Main.projPet[this.type]) + { + Vector4 vector13 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, 0f); + if (this.position.X != vector13.X) + { + flag3 = true; + } + if (this.position.Y != vector13.Y) + { + flag3 = true; + } + if (this.velocity.X != vector13.Z) + { + flag3 = true; + } + if (this.velocity.Y != vector13.W) + { + flag3 = true; + } + this.position.X = vector13.X; + this.position.Y = vector13.Y; + this.velocity.X = vector13.Z; + this.velocity.Y = vector13.W; + } + } + } + } + } + } + } + } + } + } + } + } + } + if (vector != this.velocity) + { + flag3 = true; + } + if (flag3 && !Main.projPet[this.type]) + { + if (this.type == 254) + { + this.tileCollide = false; + this.velocity = this.lastVelocity; + if (this.timeLeft > 30) + { + this.timeLeft = 30; + } + } + else + { + if (this.type == 225 && this.penetrate > 0) + { + this.velocity.X = -vector.X; + this.velocity.Y = -vector.Y; + this.penetrate--; + } + else + { + if (this.type == 155) + { + if (this.ai[1] > 10f) + { + string text = string.Concat(new object[] + { + this.name, + " was hit ", + this.ai[1], + " times before touching the ground!" + }); + if (Main.netMode == 0) + { + Main.NewText(text, 255, 240, 20, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, text, 255, 255f, 240f, 20f, 0); + } + } + } + this.ai[1] = 0f; + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.6f; + } + if (this.velocity.Y != vector.Y && vector.Y > 2f) + { + this.velocity.Y = vector.Y * -0.6f; + } + } + else + { + if (this.aiStyle == 33) + { + if (this.localAI[0] == 0f) + { + if (this.wet) + { + this.position += vector / 2f; + } + else + { + this.position += vector; + } + this.velocity *= 0f; + this.localAI[0] = 1f; + } + } + else + { + if (this.type != 308) + { + if (this.type == 94) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + if (this.type == 281) + { + float num43 = Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y); + if (num43 < 2f || this.ai[1] == 2f) + { + this.ai[1] = 2f; + } + else + { + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X * 0.5f; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y * 0.5f; + } + } + } + else + { + if (this.type == 290 || this.type == 294) + { + if (this.velocity.X != vector.X) + { + this.position.X = this.position.X + this.velocity.X; + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.position.Y = this.position.Y + this.velocity.Y; + this.velocity.Y = -vector.Y; + } + } + else + { + if ((this.type == 181 || this.type == 189) && this.penetrate > 0) + { + this.penetrate--; + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + if (this.type == 307 && this.ai[1] < 5f) + { + this.ai[1] += 1f; + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + if (this.type == 99) + { + if (this.velocity.Y != vector.Y && vector.Y > 5f) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + this.velocity.Y = -vector.Y * 0.2f; + } + if (this.velocity.X != vector.X) + { + this.Kill(); + } + } + else + { + if (this.type == 36) + { + if (this.penetrate > 1) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + this.penetrate--; + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + this.Kill(); + } + } + else + { + if (this.aiStyle == 21) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + if (this.aiStyle == 17) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.75f; + } + if (this.velocity.Y != vector.Y && (double)vector.Y > 1.5) + { + this.velocity.Y = vector.Y * -0.7f; + } + } + else + { + if (this.aiStyle == 15) + { + bool flag5 = false; + if (vector.X != this.velocity.X) + { + if (Math.Abs(vector.X) > 4f) + { + flag5 = true; + } + this.position.X = this.position.X + this.velocity.X; + this.velocity.X = -vector.X * 0.2f; + } + if (vector.Y != this.velocity.Y) + { + if (Math.Abs(vector.Y) > 4f) + { + flag5 = true; + } + this.position.Y = this.position.Y + this.velocity.Y; + this.velocity.Y = -vector.Y * 0.2f; + } + this.ai[0] = 1f; + if (flag5) + { + this.netUpdate = true; + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + } + } + else + { + if (this.aiStyle == 39) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + if (this.type == 33 || this.type == 106) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + this.ai[0] = 1f; + if (this.aiStyle == 3) + { + this.velocity.X = -vector.X; + this.velocity.Y = -vector.Y; + } + } + this.netUpdate = true; + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + if (this.aiStyle == 3 || this.aiStyle == 13) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + if (this.type == 33 || this.type == 106) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + else + { + this.ai[0] = 1f; + if (this.aiStyle == 3) + { + this.velocity.X = -vector.X; + this.velocity.Y = -vector.Y; + } + } + this.netUpdate = true; + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + } + else + { + if (this.aiStyle == 8 && this.type != 96) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + this.ai[0] += 1f; + if ((this.ai[0] >= 5f && this.type != 253) || (this.type == 253 && this.ai[0] >= 8f)) + { + this.position += this.velocity; + this.Kill(); + } + else + { + if (this.type == 15 && this.velocity.Y > 4f) + { + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y * 0.8f; + } + } + else + { + if (this.velocity.Y != vector.Y) + { + this.velocity.Y = -vector.Y; + } + } + if (this.velocity.X != vector.X) + { + this.velocity.X = -vector.X; + } + } + } + else + { + if (this.aiStyle == 14) + { + if (this.type == 261 && ((this.velocity.X != vector.X && (vector.X < -3f || vector.X > 3f)) || (this.velocity.Y != vector.Y && (vector.Y < -3f || vector.Y > 3f)))) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(0, (int)this.center().X, (int)this.center().Y, 1); + } + if (this.type == 50) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.2f; + } + if (this.velocity.Y != vector.Y && (double)vector.Y > 1.5) + { + this.velocity.Y = vector.Y * -0.2f; + } + } + else + { + if (this.type == 185) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.9f; + } + if (this.velocity.Y != vector.Y && vector.Y > 1f) + { + this.velocity.Y = vector.Y * -0.9f; + } + } + else + { + if (this.type == 277) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.9f; + } + if (this.velocity.Y != vector.Y && vector.Y > 3f) + { + this.velocity.Y = vector.Y * -0.9f; + } + } + else + { + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.5f; + } + if (this.velocity.Y != vector.Y && vector.Y > 1f) + { + this.velocity.Y = vector.Y * -0.5f; + } + } + } + } + } + else + { + if (this.aiStyle == 16) + { + if (this.velocity.X != vector.X) + { + this.velocity.X = vector.X * -0.4f; + if (this.type == 29) + { + this.velocity.X = this.velocity.X * 0.8f; + } + } + if (this.velocity.Y != vector.Y && (double)vector.Y > 0.7 && this.type != 102) + { + this.velocity.Y = vector.Y * -0.4f; + if (this.type == 29) + { + this.velocity.Y = this.velocity.Y * 0.8f; + } + } + if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303) + { + this.velocity *= 0f; + this.alpha = 255; + this.timeLeft = 3; + } + } + else + { + if (this.aiStyle != 9 || this.owner == Main.myPlayer) + { + this.position += this.velocity; + this.Kill(); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.aiStyle != 4 && this.aiStyle != 38) + { + if (this.wet) + { + this.position += value; + } + else + { + this.position += this.velocity; + } + if (Main.projPet[this.type] && this.tileCollide) + { + Vector4 vector14 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, 0f); + if (this.position.X != vector14.X) + { + } + if (this.position.Y != vector14.Y) + { + } + if (this.velocity.X != vector14.Z) + { + } + if (this.velocity.Y != vector14.W) + { + } + this.position.X = vector14.X; + this.position.Y = vector14.Y; + this.velocity.X = vector14.Z; + this.velocity.Y = vector14.W; + } + } + if ((this.aiStyle != 3 || this.ai[0] != 1f) && (this.aiStyle != 7 || this.ai[0] != 1f) && (this.aiStyle != 13 || this.ai[0] != 1f) && (this.aiStyle != 15 || this.ai[0] != 1f) && this.aiStyle != 15 && this.aiStyle != 26) + { + if (this.velocity.X < 0f) + { + this.direction = -1; + } + else + { + this.direction = 1; + } + } + if (this.active) + { + this.ProjLight(); + if (this.type == 2 || this.type == 82) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + } + else + { + if (this.type == 172) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f); + } + else + { + if (this.type == 103) + { + int num44 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num44].noGravity = true; + Main.dust[num44].scale *= 2f; + } + } + else + { + if (this.type == 278) + { + int num45 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 169, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num45].noGravity = true; + Main.dust[num45].scale *= 1.5f; + } + } + else + { + if (this.type == 4) + { + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.1f); + } + } + else + { + if (this.type == 5) + { + int num46 = Main.rand.Next(3); + if (num46 == 0) + { + num46 = 15; + } + else + { + if (num46 == 1) + { + num46 = 57; + } + else + { + num46 = 58; + } + } + Dust.NewDust(this.position, this.width, this.height, num46, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f); + } + } + } + } + } + } + this.Damage(); + if (Main.netMode != 1 && this.type == 99) + { + Collision.SwitchTiles(this.position, this.width, this.height, this.lastPosition, 3); + } + if (this.type == 94 || this.type == 301) + { + for (int num47 = this.oldPos.Length - 1; num47 > 0; num47--) + { + this.oldPos[num47] = this.oldPos[num47 - 1]; + } + this.oldPos[0] = this.position; + } + this.timeLeft--; + if (this.timeLeft <= 0) + { + this.Kill(); + } + if (this.penetrate == 0) + { + this.Kill(); + } + if (this.active && this.owner == Main.myPlayer) + { + if (this.netUpdate2) + { + this.netUpdate = true; + } + if (!this.active) + { + this.netSpam = 0; + } + if (this.netUpdate) + { + if (this.netSpam < 60) + { + this.netSpam += 5; + NetMessage.SendData(27, -1, -1, "", i, 0f, 0f, 0f, 0); + this.netUpdate2 = false; + } + else + { + this.netUpdate2 = true; + } + } + if (this.netSpam > 0) + { + this.netSpam--; + } + } + if (this.active && this.maxUpdates > 0) + { + this.numUpdates--; + if (this.numUpdates >= 0) + { + this.Update(i); + } + else + { + this.numUpdates = this.maxUpdates; + } + } + this.netUpdate = false; + return; + } + return; + } + } + public void AI() + { + if (this.aiStyle == 1) + { + if (this.type == 282) + { + int num = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f); + Main.dust[num].scale = (float)Main.rand.Next(1, 10) * 0.1f; + Main.dust[num].noGravity = true; + Main.dust[num].fadeIn = 1.5f; + Main.dust[num].velocity *= 0.25f; + Main.dust[num].velocity += this.velocity * 0.25f; + } + if (this.type == 275 || this.type == 276) + { + this.frameCounter++; + if (this.frameCounter > 1) + { + this.frameCounter = 0; + this.frame++; + if (this.frame > 1) + { + this.frame = 0; + } + } + } + if (this.type == 225) + { + int num2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, 0f, 0f, 0, default(Color), 1f); + Main.dust[num2].noGravity = true; + Main.dust[num2].scale = 1.3f; + Main.dust[num2].velocity *= 0.5f; + } + if (this.type == 174) + { + if (this.alpha == 0) + { + int num3 = Dust.NewDust(this.lastPosition - this.velocity * 3f, this.width, this.height, 76, 0f, 0f, 50, default(Color), 1f); + Main.dust[num3].noGravity = true; + Main.dust[num3].noLight = true; + Main.dust[num3].velocity *= 0.5f; + } + this.alpha -= 50; + if (this.alpha < 0) + { + this.alpha = 0; + } + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + } + else + { + if (this.type == 176) + { + if (this.alpha == 0) + { + int num4 = Dust.NewDust(this.lastPosition, this.width, this.height, 22, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num4].noGravity = true; + Main.dust[num4].noLight = true; + Main.dust[num4].velocity *= 0.15f; + Main.dust[num4].fadeIn = 0.8f; + } + this.alpha -= 50; + if (this.alpha < 0) + { + this.alpha = 0; + } + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + } + } + if (this.type == 83 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33); + } + if (this.type == 259 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33); + } + if (this.type == 110 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11); + } + if (this.type == 302 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11); + } + if (this.type == 84 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12); + } + if (this.type == 257 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 12); + } + if (this.type == 100 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 33); + } + if (this.type == 98 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + if (this.type == 184 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + if (this.type == 195 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + if (this.type == 275 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + if (this.type == 276 && this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + if ((this.type == 81 || this.type == 82) && this.ai[1] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 5); + this.ai[1] = 1f; + } + if (this.type == 180 && this.ai[1] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 11); + this.ai[1] = 1f; + } + if (this.type == 248 && this.ai[1] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + this.ai[1] = 1f; + } + if (this.type == 41) + { + int num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.6f); + Main.dust[num5].noGravity = true; + num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num5].noGravity = true; + } + else + { + if (this.type == 55) + { + int num6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, 0f, 0f, 0, default(Color), 0.9f); + Main.dust[num6].noGravity = true; + } + else + { + if (this.type == 91 && Main.rand.Next(2) == 0) + { + int num7; + if (Main.rand.Next(2) == 0) + { + num7 = 15; + } + else + { + num7 = 58; + } + int num8 = Dust.NewDust(this.position, this.width, this.height, num7, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 150, default(Color), 0.9f); + Main.dust[num8].velocity *= 0.25f; + } + } + } + if (this.type == 163 || this.type == 310) + { + if (this.alpha > 0) + { + this.alpha -= 25; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type == 20 || this.type == 14 || this.type == 36 || this.type == 83 || this.type == 84 || this.type == 89 || this.type == 100 || this.type == 104 || this.type == 110 || this.type == 180 || this.type == 279 || (this.type >= 158 && this.type <= 161) || (this.type >= 283 && this.type <= 287)) + { + if (this.alpha > 0) + { + this.alpha -= 15; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type == 242 || this.type == 302) + { + float num9 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y)); + if (this.alpha > 0) + { + this.alpha -= (int)((byte)((double)num9 * 0.9)); + } + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type == 257) + { + if (this.alpha > 0) + { + this.alpha -= 10; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type == 88) + { + if (this.alpha > 0) + { + this.alpha -= 10; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type != 5 && this.type != 14 && this.type != 270 && this.type != 180 && this.type != 259 && this.type != 242 && this.type != 302 && this.type != 20 && this.type != 36 && this.type != 38 && this.type != 55 && this.type != 83 && this.type != 84 && this.type != 88 && this.type != 89 && this.type != 98 && this.type != 100 && this.type != 265 && this.type != 104 && this.type != 110 && this.type != 184 && this.type != 257 && this.type != 248 && (this.type < 283 || this.type > 287) && this.type != 279 && this.type != 299 && (this.type < 158 || this.type > 161)) + { + this.ai[0] += 1f; + } + if (this.type == 299) + { + if (this.localAI[0] == 6f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + for (int i = 0; i < 40; i++) + { + int num10 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, 0f, 0f, 100, default(Color), 1f); + Main.dust[num10].velocity *= 3f; + Main.dust[num10].velocity += this.velocity * 0.75f; + Main.dust[num10].scale *= 1.2f; + Main.dust[num10].noGravity = true; + } + } + this.localAI[0] += 1f; + if (this.localAI[0] > 6f) + { + for (int j = 0; j < 3; j++) + { + int num11 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num11].velocity *= 0.6f; + Main.dust[num11].scale *= 1.4f; + Main.dust[num11].noGravity = true; + } + } + } + else + { + if (this.type == 270) + { + if (this.alpha > 0) + { + this.alpha -= 50; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + this.frame++; + if (this.frame > 2) + { + this.frame = 0; + } + for (int k = 0; k < 2; k++) + { + int num12 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num12].position -= this.velocity * 2f; + Main.dust[num12].noGravity = true; + Dust expr_10B6_cp_0 = Main.dust[num12]; + expr_10B6_cp_0.velocity.X = expr_10B6_cp_0.velocity.X * 0.3f; + Dust expr_10D4_cp_0 = Main.dust[num12]; + expr_10D4_cp_0.velocity.Y = expr_10D4_cp_0.velocity.Y * 0.3f; + } + } + } + if (this.type == 259) + { + if (this.alpha > 0) + { + this.alpha -= 10; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type == 265) + { + if (this.alpha > 0) + { + this.alpha -= 50; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + if (this.alpha == 0) + { + int num13 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f); + Main.dust[num13].noGravity = true; + Main.dust[num13].velocity *= 0.3f; + Main.dust[num13].velocity -= this.velocity * 0.4f; + } + } + if (this.type == 207) + { + if (this.alpha < 170) + { + for (int l = 0; l < 10; l++) + { + float x = this.position.X - this.velocity.X / 10f * (float)l; + float y = this.position.Y - this.velocity.Y / 10f * (float)l; + int num14 = Dust.NewDust(new Vector2(x, y), 1, 1, 75, 0f, 0f, 0, default(Color), 1f); + Main.dust[num14].alpha = this.alpha; + Main.dust[num14].position.X = x; + Main.dust[num14].position.Y = y; + Main.dust[num14].velocity *= 0f; + Main.dust[num14].noGravity = true; + } + } + float num15 = (float)Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y)); + float num16 = this.localAI[0]; + if (num16 == 0f) + { + this.localAI[0] = num15; + num16 = num15; + } + if (this.alpha > 0) + { + this.alpha -= 25; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + float num17 = this.position.X; + float num18 = this.position.Y; + float num19 = 300f; + bool flag = false; + int num20 = 0; + if (this.ai[1] == 0f) + { + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && !Main.npc[m].dontTakeDamage && !Main.npc[m].friendly && Main.npc[m].lifeMax > 5 && (this.ai[1] == 0f || this.ai[1] == (float)(m + 1))) + { + float num21 = Main.npc[m].position.X + (float)(Main.npc[m].width / 2); + float num22 = Main.npc[m].position.Y + (float)(Main.npc[m].height / 2); + float num23 = Math.Abs(this.position.X + (float)(this.width / 2) - num21) + Math.Abs(this.position.Y + (float)(this.height / 2) - num22); + if (num23 < num19 && Collision.CanHit(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), 1, 1, Main.npc[m].position, Main.npc[m].width, Main.npc[m].height)) + { + num19 = num23; + num17 = num21; + num18 = num22; + flag = true; + num20 = m; + } + } + } + if (flag) + { + this.ai[1] = (float)(num20 + 1); + } + flag = false; + } + if (this.ai[1] != 0f) + { + int num24 = (int)(this.ai[1] - 1f); + if (Main.npc[num24].active) + { + float num25 = Main.npc[num24].position.X + (float)(Main.npc[num24].width / 2); + float num26 = Main.npc[num24].position.Y + (float)(Main.npc[num24].height / 2); + float num27 = Math.Abs(this.position.X + (float)(this.width / 2) - num25) + Math.Abs(this.position.Y + (float)(this.height / 2) - num26); + if (num27 < 1000f) + { + flag = true; + num17 = Main.npc[num24].position.X + (float)(Main.npc[num24].width / 2); + num18 = Main.npc[num24].position.Y + (float)(Main.npc[num24].height / 2); + } + } + } + if (flag) + { + float num28 = num16; + Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num29 = num17 - vector.X; + float num30 = num18 - vector.Y; + float num31 = (float)Math.Sqrt((double)(num29 * num29 + num30 * num30)); + num31 = num28 / num31; + num29 *= num31; + num30 *= num31; + this.velocity.X = (this.velocity.X * 5f + num29) / 6f; + this.velocity.Y = (this.velocity.Y * 5f + num30) / 6f; + } + } + else + { + if (this.type == 81 || this.type == 91) + { + if (this.ai[0] >= 20f) + { + this.ai[0] = 20f; + this.velocity.Y = this.velocity.Y + 0.07f; + } + } + else + { + if (this.type == 174) + { + if (this.ai[0] >= 5f) + { + this.ai[0] = 5f; + this.velocity.Y = this.velocity.Y + 0.15f; + } + } + else + { + if (this.type == 246) + { + this.alpha -= 20; + if (this.alpha < 0) + { + this.alpha = 0; + } + if (this.ai[0] >= 60f) + { + this.ai[0] = 60f; + this.velocity.Y = this.velocity.Y + 0.15f; + } + } + else + { + if (this.type != 239 && this.type != 264) + { + if (this.type == 176) + { + if (this.ai[0] >= 15f) + { + this.ai[0] = 15f; + this.velocity.Y = this.velocity.Y + 0.05f; + } + } + else + { + if (this.type == 275 || this.type == 276) + { + if (this.alpha > 0) + { + this.alpha -= 30; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + if (this.ai[0] >= 35f) + { + this.ai[0] = 35f; + this.velocity.Y = this.velocity.Y + 0.025f; + } + } + else + { + if (this.type == 172) + { + if (this.ai[0] >= 17f) + { + this.ai[0] = 17f; + this.velocity.Y = this.velocity.Y + 0.085f; + } + } + else + { + if (this.type == 117) + { + if (this.ai[0] >= 35f) + { + this.ai[0] = 35f; + this.velocity.Y = this.velocity.Y + 0.06f; + } + } + else + { + if (this.type == 120) + { + int num32 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f); + Main.dust[num32].noGravity = true; + Main.dust[num32].velocity *= 0.3f; + if (this.ai[0] >= 30f) + { + this.ai[0] = 30f; + this.velocity.Y = this.velocity.Y + 0.05f; + } + } + else + { + if (this.type == 195) + { + if (this.ai[0] >= 20f) + { + this.ai[0] = 20f; + this.velocity.Y = this.velocity.Y + 0.075f; + } + } + else + { + if (this.type == 267) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 3f) + { + this.alpha = 0; + } + if (this.ai[0] >= 20f) + { + this.ai[0] = 20f; + this.velocity.Y = this.velocity.Y + 0.075f; + } + } + else + { + if (this.ai[0] >= 15f) + { + this.ai[0] = 15f; + this.velocity.Y = this.velocity.Y + 0.1f; + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.type == 248) + { + if (this.velocity.X < 0f) + { + this.rotation -= (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.05f; + } + else + { + this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.05f; + } + } + if (this.type == 270) + { + this.spriteDirection = this.direction; + if (this.direction < 0) + { + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + } + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + return; + } + } + else + { + if (this.aiStyle == 2) + { + if (this.type == 93 && Main.rand.Next(5) == 0) + { + int num33 = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 0.3f); + Dust expr_1D89_cp_0 = Main.dust[num33]; + expr_1D89_cp_0.velocity.X = expr_1D89_cp_0.velocity.X * 0.3f; + Dust expr_1DA7_cp_0 = Main.dust[num33]; + expr_1DA7_cp_0.velocity.Y = expr_1DA7_cp_0.velocity.Y * 0.3f; + } + if (this.type == 304 && this.localAI[0] == 0f) + { + this.localAI[0] += 1f; + this.alpha = 0; + } + this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.03f * (float)this.direction; + if (this.type == 162) + { + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + } + this.ai[0] += 1f; + if (this.ai[0] >= 18f) + { + this.velocity.Y = this.velocity.Y + 0.28f; + this.velocity.X = this.velocity.X * 0.99f; + } + if (this.ai[0] > 2f) + { + this.alpha = 0; + if (this.ai[0] == 3f) + { + for (int n = 0; n < 10; n++) + { + int num34 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num34].velocity *= 0.5f; + Main.dust[num34].velocity += this.velocity * 0.1f; + } + for (int num35 = 0; num35 < 5; num35++) + { + int num36 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num36].noGravity = true; + Main.dust[num36].velocity *= 3f; + Main.dust[num36].velocity += this.velocity * 0.2f; + num36 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num36].velocity *= 2f; + Main.dust[num36].velocity += this.velocity * 0.3f; + } + for (int num37 = 0; num37 < 1; num37++) + { + int num38 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num38].position += this.velocity * 1.25f; + Main.gore[num38].scale = 1.5f; + Main.gore[num38].velocity += this.velocity * 0.5f; + Main.gore[num38].velocity *= 0.02f; + } + } + } + } + else + { + if (this.type == 281) + { + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + } + this.ai[0] += 1f; + if (this.ai[0] >= 18f) + { + this.velocity.Y = this.velocity.Y + 0.28f; + this.velocity.X = this.velocity.X * 0.99f; + } + if (this.ai[0] > 2f) + { + this.alpha = 0; + if (this.ai[0] == 3f) + { + for (int num39 = 0; num39 < 10; num39++) + { + int num40 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num40].velocity *= 0.5f; + Main.dust[num40].velocity += this.velocity * 0.1f; + } + for (int num41 = 0; num41 < 5; num41++) + { + int num42 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num42].noGravity = true; + Main.dust[num42].velocity *= 3f; + Main.dust[num42].velocity += this.velocity * 0.2f; + num42 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num42].velocity *= 2f; + Main.dust[num42].velocity += this.velocity * 0.3f; + } + for (int num43 = 0; num43 < 1; num43++) + { + int num44 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num44].position += this.velocity * 1.25f; + Main.gore[num44].scale = 1.5f; + Main.gore[num44].velocity += this.velocity * 0.5f; + Main.gore[num44].velocity *= 0.02f; + } + } + } + } + else + { + if (this.type == 240) + { + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + } + this.ai[0] += 1f; + if (this.ai[0] >= 16f) + { + this.velocity.Y = this.velocity.Y + 0.18f; + this.velocity.X = this.velocity.X * 0.991f; + } + if (this.ai[0] > 2f) + { + this.alpha = 0; + if (this.ai[0] == 3f) + { + for (int num45 = 0; num45 < 7; num45++) + { + int num46 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num46].velocity *= 0.5f; + Main.dust[num46].velocity += this.velocity * 0.1f; + } + for (int num47 = 0; num47 < 3; num47++) + { + int num48 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num48].noGravity = true; + Main.dust[num48].velocity *= 3f; + Main.dust[num48].velocity += this.velocity * 0.2f; + num48 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num48].velocity *= 2f; + Main.dust[num48].velocity += this.velocity * 0.3f; + } + for (int num49 = 0; num49 < 1; num49++) + { + int num50 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num50].position += this.velocity * 1.25f; + Main.gore[num50].scale = 1.25f; + Main.gore[num50].velocity += this.velocity * 0.5f; + Main.gore[num50].velocity *= 0.02f; + } + } + } + } + else + { + if (this.type == 249) + { + this.ai[0] += 1f; + if (this.ai[0] >= 0f) + { + this.velocity.Y = this.velocity.Y + 0.25f; + } + } + else + { + if (this.type == 69 || this.type == 70) + { + this.ai[0] += 1f; + if (this.ai[0] >= 10f) + { + this.velocity.Y = this.velocity.Y + 0.25f; + this.velocity.X = this.velocity.X * 0.99f; + } + } + else + { + if (this.type == 166) + { + this.ai[0] += 1f; + if (this.ai[0] >= 20f) + { + this.velocity.Y = this.velocity.Y + 0.3f; + this.velocity.X = this.velocity.X * 0.98f; + } + } + else + { + if (this.type == 300) + { + if (this.ai[0] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 1); + } + this.ai[0] += 1f; + if (this.ai[0] >= 60f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + this.velocity.X = this.velocity.X * 0.99f; + } + } + else + { + if (this.type == 306) + { + if (this.alpha <= 200) + { + for (int num51 = 0; num51 < 4; num51++) + { + float num52 = this.velocity.X / 4f * (float)num51; + float num53 = this.velocity.Y / 4f * (float)num51; + int num54 = Dust.NewDust(this.position, this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f); + Main.dust[num54].position.X = this.center().X - num52; + Main.dust[num54].position.Y = this.center().Y - num53; + Main.dust[num54].velocity *= 0f; + Main.dust[num54].scale = 0.7f; + } + } + this.alpha -= 50; + if (this.alpha < 0) + { + this.alpha = 0; + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 0.785f; + } + else + { + if (this.type == 304) + { + this.ai[0] += 1f; + if (this.ai[0] >= 30f) + { + this.alpha += 10; + this.damage = (int)((double)this.damage * 0.9); + this.knockBack = (float)((int)((double)this.knockBack * 0.9)); + if (this.alpha >= 255) + { + this.active = false; + } + } + if (this.ai[0] < 30f) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + } + } + else + { + this.ai[0] += 1f; + if (this.ai[0] >= 20f) + { + this.velocity.Y = this.velocity.Y + 0.4f; + this.velocity.X = this.velocity.X * 0.97f; + } + else + { + if (this.type == 48 || this.type == 54 || this.type == 93) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + } + } + } + } + } + } + } + } + } + } + } + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + } + if (this.type == 54 && Main.rand.Next(20) == 0) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 0.75f); + return; + } + } + else + { + if (this.aiStyle == 3) + { + if (this.soundDelay == 0) + { + this.soundDelay = 8; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 7); + } + if (this.type == 19) + { + for (int num55 = 0; num55 < 2; num55++) + { + int num56 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num56].noGravity = true; + Dust expr_2F65_cp_0 = Main.dust[num56]; + expr_2F65_cp_0.velocity.X = expr_2F65_cp_0.velocity.X * 0.3f; + Dust expr_2F83_cp_0 = Main.dust[num56]; + expr_2F83_cp_0.velocity.Y = expr_2F83_cp_0.velocity.Y * 0.3f; + } + } + else + { + if (this.type == 33) + { + if (Main.rand.Next(1) == 0) + { + int num57 = Dust.NewDust(this.position, this.width, this.height, 40, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 0, default(Color), 1.4f); + Main.dust[num57].noGravity = true; + } + } + else + { + if (this.type == 6) + { + if (Main.rand.Next(5) == 0) + { + int num58 = Main.rand.Next(3); + if (num58 == 0) + { + num58 = 15; + } + else + { + if (num58 == 1) + { + num58 = 57; + } + else + { + num58 = 58; + } + } + Dust.NewDust(this.position, this.width, this.height, num58, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, 150, default(Color), 0.7f); + } + } + else + { + if (this.type == 113 && Main.rand.Next(1) == 0) + { + int num59 = Dust.NewDust(this.position, this.width, this.height, 76, this.velocity.X * 0.15f, this.velocity.Y * 0.15f, 0, default(Color), 1.1f); + Main.dust[num59].noGravity = true; + Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.05f, this.velocity.Y * 0.05f, 150, default(Color), 0.6f); + } + } + } + } + if (this.ai[0] == 0f) + { + this.ai[1] += 1f; + if (this.type == 106) + { + if (this.ai[1] >= 45f) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.netUpdate = true; + } + } + else + { + if (this.type == 182) + { + if (Main.rand.Next(2) == 0) + { + int num60 = Dust.NewDust(this.position, this.width, this.height, 57, 0f, 0f, 255, default(Color), 0.75f); + Main.dust[num60].velocity *= 0.1f; + Main.dust[num60].noGravity = true; + } + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + else + { + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + } + float num61 = this.position.X; + float num62 = this.position.Y; + bool flag2 = false; + if (this.ai[1] > 10f) + { + for (int num63 = 0; num63 < 200; num63++) + { + if (Main.npc[num63].active && !Main.npc[num63].dontTakeDamage && !Main.npc[num63].friendly && Main.npc[num63].lifeMax > 5) + { + float num64 = Main.npc[num63].position.X + (float)(Main.npc[num63].width / 2); + float num65 = Main.npc[num63].position.Y + (float)(Main.npc[num63].height / 2); + float num66 = Math.Abs(this.position.X + (float)(this.width / 2) - num64) + Math.Abs(this.position.Y + (float)(this.height / 2) - num65); + if (num66 < 800f && Collision.CanHit(new Vector2(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2)), 1, 1, Main.npc[num63].position, Main.npc[num63].width, Main.npc[num63].height)) + { + num61 = num64; + num62 = num65; + flag2 = true; + } + } + } + } + if (!flag2) + { + num61 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f; + num62 = this.position.Y + (float)(this.height / 2) + this.velocity.Y * 100f; + if (this.ai[1] >= 30f) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.netUpdate = true; + } + } + float num67 = 12f; + float num68 = 0.25f; + Vector2 vector2 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num69 = num61 - vector2.X; + float num70 = num62 - vector2.Y; + float num71 = (float)Math.Sqrt((double)(num69 * num69 + num70 * num70)); + num71 = num67 / num71; + num69 *= num71; + num70 *= num71; + if (this.velocity.X < num69) + { + this.velocity.X = this.velocity.X + num68; + if (this.velocity.X < 0f && num69 > 0f) + { + this.velocity.X = this.velocity.X + num68 * 2f; + } + } + else + { + if (this.velocity.X > num69) + { + this.velocity.X = this.velocity.X - num68; + if (this.velocity.X > 0f && num69 < 0f) + { + this.velocity.X = this.velocity.X - num68 * 2f; + } + } + } + if (this.velocity.Y < num70) + { + this.velocity.Y = this.velocity.Y + num68; + if (this.velocity.Y < 0f && num70 > 0f) + { + this.velocity.Y = this.velocity.Y + num68 * 2f; + } + } + else + { + if (this.velocity.Y > num70) + { + this.velocity.Y = this.velocity.Y - num68; + if (this.velocity.Y > 0f && num70 < 0f) + { + this.velocity.Y = this.velocity.Y - num68 * 2f; + } + } + } + } + else + { + if (this.type == 301) + { + if (this.ai[1] >= 20f) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.netUpdate = true; + } + } + else + { + if (this.ai[1] >= 30f) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + this.netUpdate = true; + } + } + } + } + } + else + { + this.tileCollide = false; + float num72 = 9f; + float num73 = 0.4f; + if (this.type == 19) + { + num72 = 13f; + num73 = 0.6f; + } + else + { + if (this.type == 33) + { + num72 = 15f; + num73 = 0.8f; + } + else + { + if (this.type == 182) + { + num72 = 16f; + num73 = 1.2f; + } + else + { + if (this.type == 106) + { + num72 = 16f; + num73 = 1.2f; + } + else + { + if (this.type == 272) + { + num72 = 15f; + num73 = 1f; + } + else + { + if (this.type == 301) + { + num72 = 15f; + num73 = 3f; + } + } + } + } + } + } + Vector2 vector3 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num74 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector3.X; + float num75 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector3.Y; + float num76 = (float)Math.Sqrt((double)(num74 * num74 + num75 * num75)); + if (num76 > 3000f) + { + this.Kill(); + } + num76 = num72 / num76; + num74 *= num76; + num75 *= num76; + if (this.velocity.X < num74) + { + this.velocity.X = this.velocity.X + num73; + if (this.velocity.X < 0f && num74 > 0f) + { + this.velocity.X = this.velocity.X + num73; + } + } + else + { + if (this.velocity.X > num74) + { + this.velocity.X = this.velocity.X - num73; + if (this.velocity.X > 0f && num74 < 0f) + { + this.velocity.X = this.velocity.X - num73; + } + } + } + if (this.velocity.Y < num75) + { + this.velocity.Y = this.velocity.Y + num73; + if (this.velocity.Y < 0f && num75 > 0f) + { + this.velocity.Y = this.velocity.Y + num73; + } + } + else + { + if (this.velocity.Y > num75) + { + this.velocity.Y = this.velocity.Y - num73; + if (this.velocity.Y > 0f && num75 < 0f) + { + this.velocity.Y = this.velocity.Y - num73; + } + } + } + if (Main.myPlayer == this.owner) + { + Rectangle rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + Rectangle value = new Rectangle((int)Main.player[this.owner].position.X, (int)Main.player[this.owner].position.Y, Main.player[this.owner].width, Main.player[this.owner].height); + if (rectangle.Intersects(value)) + { + this.Kill(); + } + } + } + if (this.type == 106) + { + this.rotation += 0.3f * (float)this.direction; + return; + } + this.rotation += 0.4f * (float)this.direction; + return; + } + else + { + if (this.aiStyle == 4) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + if (this.ai[0] == 0f) + { + if (this.type >= 150 && this.type <= 152 && this.ai[1] == 0f && this.alpha == 255 && Main.rand.Next(2) == 0) + { + this.type++; + this.netUpdate = true; + } + this.alpha -= 50; + if (this.type >= 150 && this.type <= 152) + { + this.alpha -= 25; + } + if (this.alpha <= 0) + { + this.alpha = 0; + this.ai[0] = 1f; + if (this.ai[1] == 0f) + { + this.ai[1] += 1f; + this.position += this.velocity * 1f; + } + if (this.type == 7 && Main.myPlayer == this.owner) + { + int num77 = this.type; + if (this.ai[1] >= 6f) + { + num77++; + } + int num78 = Projectile.NewProjectile(this.position.X + this.velocity.X + (float)(this.width / 2), this.position.Y + this.velocity.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, num77, this.damage, this.knockBack, this.owner, 0f, 0f); + Main.projectile[num78].damage = this.damage; + Main.projectile[num78].ai[1] = this.ai[1] + 1f; + NetMessage.SendData(27, -1, -1, "", num78, 0f, 0f, 0f, 0); + return; + } + if ((this.type == 150 || this.type == 151) && Main.myPlayer == this.owner) + { + int num79 = this.type; + if (this.type == 150) + { + num79 = 151; + } + else + { + if (this.type == 151) + { + num79 = 150; + } + } + if (this.ai[1] >= 10f && this.type == 151) + { + num79 = 152; + } + int num80 = Projectile.NewProjectile(this.position.X + this.velocity.X + (float)(this.width / 2), this.position.Y + this.velocity.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, num79, this.damage, this.knockBack, this.owner, 0f, 0f); + Main.projectile[num80].damage = this.damage; + Main.projectile[num80].ai[1] = this.ai[1] + 1f; + NetMessage.SendData(27, -1, -1, "", num80, 0f, 0f, 0f, 0); + return; + } + } + } + else + { + if (this.alpha < 170 && this.alpha + 5 >= 170) + { + if (this.type >= 150 && this.type <= 152) + { + for (int num81 = 0; num81 < 8; num81++) + { + int num82 = Dust.NewDust(this.position, this.width, this.height, 7, this.velocity.X * 0.025f, this.velocity.Y * 0.025f, 200, default(Color), 1.3f); + Main.dust[num82].noGravity = true; + Main.dust[num82].velocity *= 0.5f; + } + } + else + { + for (int num83 = 0; num83 < 3; num83++) + { + Dust.NewDust(this.position, this.width, this.height, 18, this.velocity.X * 0.025f, this.velocity.Y * 0.025f, 170, default(Color), 1.2f); + } + Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, 170, default(Color), 1.1f); + } + } + if (this.type >= 150 && this.type <= 152) + { + this.alpha += 3; + } + else + { + this.alpha += 5; + } + if (this.alpha >= 255) + { + this.Kill(); + return; + } + } + } + else + { + if (this.aiStyle == 5) + { + if (this.type == 92) + { + if (this.position.Y > this.ai[1]) + { + this.tileCollide = true; + } + } + else + { + if (this.ai[1] == 0f && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[1] = 1f; + this.netUpdate = true; + } + if (this.ai[1] != 0f) + { + this.tileCollide = true; + } + } + if (this.soundDelay == 0) + { + this.soundDelay = 20 + Main.rand.Next(40); + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 9); + } + if (this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + } + this.alpha += (int)(25f * this.localAI[0]); + if (this.alpha > 200) + { + this.alpha = 200; + this.localAI[0] = -1f; + } + if (this.alpha < 0) + { + this.alpha = 0; + this.localAI[0] = 1f; + } + this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f * (float)this.direction; + if (this.ai[1] == 1f || this.type == 92) + { + this.light = 0.9f; + if (Main.rand.Next(10) == 0) + { + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.2f); + } + if (Main.rand.Next(20) == 0) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.2f, this.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); + return; + } + } + } + else + { + if (this.aiStyle == 6) + { + this.velocity *= 0.95f; + this.ai[0] += 1f; + if (this.ai[0] == 180f) + { + this.Kill(); + } + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + for (int num84 = 0; num84 < 30; num84++) + { + Dust.NewDust(this.position, this.width, this.height, 10 + this.type, this.velocity.X, this.velocity.Y, 50, default(Color), 1f); + } + } + if (this.type == 10 || this.type == 11) + { + int num85 = (int)(this.position.X / 16f) - 1; + int num86 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num87 = (int)(this.position.Y / 16f) - 1; + int num88 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num85 < 0) + { + num85 = 0; + } + if (num86 > Main.maxTilesX) + { + num86 = Main.maxTilesX; + } + if (num87 < 0) + { + num87 = 0; + } + if (num88 > Main.maxTilesY) + { + num88 = Main.maxTilesY; + } + for (int num89 = num85; num89 < num86; num89++) + { + for (int num90 = num87; num90 < num88; num90++) + { + Vector2 vector4; + vector4.X = (float)(num89 * 16); + vector4.Y = (float)(num90 * 16); + if (this.position.X + (float)this.width > vector4.X && this.position.X < vector4.X + 16f && this.position.Y + (float)this.height > vector4.Y && this.position.Y < vector4.Y + 16f && Main.myPlayer == this.owner && Main.tile[num89, num90].active()) + { + if (this.type == 10) + { + if (Main.tile[num89, num90].type == 23 || Main.tile[num89, num90].type == 199) + { + Main.tile[num89, num90].type = 2; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + if (Main.tile[num89, num90].type == 25 || Main.tile[num89, num90].type == 203) + { + Main.tile[num89, num90].type = 1; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + if (Main.tile[num89, num90].type == 112 || Main.tile[num89, num90].type == 234) + { + Main.tile[num89, num90].type = 53; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + if (Main.tile[num89, num90].type == 163 || Main.tile[num89, num90].type == 200) + { + Main.tile[num89, num90].type = 161; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + } + else + { + if (this.type == 11) + { + if (Main.tile[num89, num90].type == 109) + { + Main.tile[num89, num90].type = 2; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + if (Main.tile[num89, num90].type == 116) + { + Main.tile[num89, num90].type = 53; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + if (Main.tile[num89, num90].type == 117) + { + Main.tile[num89, num90].type = 1; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + if (Main.tile[num89, num90].type == 164) + { + Main.tile[num89, num90].type = 161; + WorldGen.SquareTileFrame(num89, num90, true); + if (Main.netMode == 1) + { + NetMessage.SendTileSquare(-1, num89, num90, 1); + } + } + } + } + } + } + } + return; + } + } + else + { + if (this.aiStyle == 7) + { + if (Main.player[this.owner].dead) + { + this.Kill(); + return; + } + Vector2 vector5 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num91 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector5.X; + float num92 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector5.Y; + float num93 = (float)Math.Sqrt((double)(num91 * num91 + num92 * num92)); + this.rotation = (float)Math.Atan2((double)num92, (double)num91) - 1.57f; + if (this.type == 256) + { + this.rotation = (float)Math.Atan2((double)num92, (double)num91) + 3.92500019f; + } + if (this.ai[0] == 0f) + { + if ((num93 > 300f && this.type == 13) || (num93 > 400f && this.type == 32) || (num93 > 440f && this.type == 73) || (num93 > 440f && this.type == 74) || (num93 > 250f && this.type == 165) || (num93 > 350f && this.type == 256)) + { + this.ai[0] = 1f; + } + else + { + if (this.type >= 230 && this.type <= 235) + { + int num94 = 300 + (this.type - 230) * 30; + if (num93 > (float)num94) + { + this.ai[0] = 1f; + } + } + } + int num95 = (int)(this.position.X / 16f) - 1; + int num96 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num97 = (int)(this.position.Y / 16f) - 1; + int num98 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num95 < 0) + { + num95 = 0; + } + if (num96 > Main.maxTilesX) + { + num96 = Main.maxTilesX; + } + if (num97 < 0) + { + num97 = 0; + } + if (num98 > Main.maxTilesY) + { + num98 = Main.maxTilesY; + } + for (int num99 = num95; num99 < num96; num99++) + { + int num100 = num97; + while (num100 < num98) + { + if (Main.tile[num99, num100] == null) + { + Main.tile[num99, num100] = new Tile(); + } + Vector2 vector6; + vector6.X = (float)(num99 * 16); + vector6.Y = (float)(num100 * 16); + if (this.position.X + (float)this.width > vector6.X && this.position.X < vector6.X + 16f && this.position.Y + (float)this.height > vector6.Y && this.position.Y < vector6.Y + 16f && Main.tile[num99, num100].nactive() && Main.tileSolid[(int)Main.tile[num99, num100].type]) + { + if (Main.player[this.owner].grapCount < 10) + { + Main.player[this.owner].grappling[Main.player[this.owner].grapCount] = this.whoAmI; + Main.player[this.owner].grapCount++; + } + if (Main.myPlayer == this.owner) + { + int num101 = 0; + int num102 = -1; + int num103 = 100000; + if (this.type == 73 || this.type == 74) + { + for (int num104 = 0; num104 < 1000; num104++) + { + if (num104 != this.whoAmI && Main.projectile[num104].active && Main.projectile[num104].owner == this.owner && Main.projectile[num104].aiStyle == 7 && Main.projectile[num104].ai[0] == 2f) + { + Main.projectile[num104].Kill(); + } + } + } + else + { + int num105 = 3; + if (this.type == 165) + { + num105 = 8; + } + if (this.type == 256) + { + num105 = 2; + } + for (int num106 = 0; num106 < 1000; num106++) + { + if (Main.projectile[num106].active && Main.projectile[num106].owner == this.owner && Main.projectile[num106].aiStyle == 7) + { + if (Main.projectile[num106].timeLeft < num103) + { + num102 = num106; + num103 = Main.projectile[num106].timeLeft; + } + num101++; + } + } + if (num101 > num105) + { + Main.projectile[num102].Kill(); + } + } + } + WorldGen.KillTile(num99, num100, true, true, false); + Main.PlaySound(0, num99 * 16, num100 * 16, 1); + this.velocity.X = 0f; + this.velocity.Y = 0f; + this.ai[0] = 2f; + this.position.X = (float)(num99 * 16 + 8 - this.width / 2); + this.position.Y = (float)(num100 * 16 + 8 - this.height / 2); + this.damage = 0; + this.netUpdate = true; + if (Main.myPlayer == this.owner) + { + NetMessage.SendData(13, -1, -1, "", this.owner, 0f, 0f, 0f, 0); + break; + } + break; + } + else + { + num100++; + } + } + if (this.ai[0] == 2f) + { + return; + } + } + return; + } + if (this.ai[0] == 1f) + { + float num107 = 11f; + if (this.type == 32) + { + num107 = 15f; + } + if (this.type == 73 || this.type == 74) + { + num107 = 17f; + } + if (this.type >= 230 && this.type <= 235) + { + num107 = 11f + (float)(this.type - 230) * 0.75f; + } + if (num93 < 24f) + { + this.Kill(); + } + num93 = num107 / num93; + num91 *= num93; + num92 *= num93; + this.velocity.X = num91; + this.velocity.Y = num92; + return; + } + if (this.ai[0] == 2f) + { + int num108 = (int)(this.position.X / 16f) - 1; + int num109 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num110 = (int)(this.position.Y / 16f) - 1; + int num111 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num108 < 0) + { + num108 = 0; + } + if (num109 > Main.maxTilesX) + { + num109 = Main.maxTilesX; + } + if (num110 < 0) + { + num110 = 0; + } + if (num111 > Main.maxTilesY) + { + num111 = Main.maxTilesY; + } + bool flag3 = true; + for (int num112 = num108; num112 < num109; num112++) + { + for (int num113 = num110; num113 < num111; num113++) + { + if (Main.tile[num112, num113] == null) + { + Main.tile[num112, num113] = new Tile(); + } + Vector2 vector7; + vector7.X = (float)(num112 * 16); + vector7.Y = (float)(num113 * 16); + if (this.position.X + (float)(this.width / 2) > vector7.X && this.position.X + (float)(this.width / 2) < vector7.X + 16f && this.position.Y + (float)(this.height / 2) > vector7.Y && this.position.Y + (float)(this.height / 2) < vector7.Y + 16f && Main.tile[num112, num113].nactive() && Main.tileSolid[(int)Main.tile[num112, num113].type]) + { + flag3 = false; + } + } + } + if (flag3) + { + this.ai[0] = 1f; + return; + } + if (Main.player[this.owner].grapCount < 10) + { + Main.player[this.owner].grappling[Main.player[this.owner].grapCount] = this.whoAmI; + Main.player[this.owner].grapCount++; + return; + } + } + } + else + { + if (this.aiStyle == 8) + { + if (this.type == 258 && this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20); + } + if (this.type == 96 && this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20); + } + if (this.type == 27) + { + for (int num114 = 0; num114 < 5; num114++) + { + float num115 = this.velocity.X / 3f * (float)num114; + float num116 = this.velocity.Y / 3f * (float)num114; + int num117 = 4; + int num118 = Dust.NewDust(new Vector2(this.position.X + (float)num117, this.position.Y + (float)num117), this.width - num117 * 2, this.height - num117 * 2, 172, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num118].noGravity = true; + Main.dust[num118].velocity *= 0.1f; + Main.dust[num118].velocity += this.velocity * 0.1f; + Dust expr_52E1_cp_0 = Main.dust[num118]; + expr_52E1_cp_0.position.X = expr_52E1_cp_0.position.X - num115; + Dust expr_52FC_cp_0 = Main.dust[num118]; + expr_52FC_cp_0.position.Y = expr_52FC_cp_0.position.Y - num116; + } + if (Main.rand.Next(5) == 0) + { + int num119 = 4; + int num120 = Dust.NewDust(new Vector2(this.position.X + (float)num119, this.position.Y + (float)num119), this.width - num119 * 2, this.height - num119 * 2, 172, 0f, 0f, 100, default(Color), 0.6f); + Main.dust[num120].velocity *= 0.25f; + Main.dust[num120].velocity += this.velocity * 0.5f; + } + } + else + { + if (this.type == 95 || this.type == 96) + { + int num121 = Dust.NewDust(new Vector2(this.position.X + this.velocity.X, this.position.Y + this.velocity.Y), this.width, this.height, 75, this.velocity.X, this.velocity.Y, 100, default(Color), 3f * this.scale); + Main.dust[num121].noGravity = true; + } + else + { + if (this.type == 253) + { + for (int num122 = 0; num122 < 2; num122++) + { + int num123 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num123].noGravity = true; + Dust expr_551A_cp_0 = Main.dust[num123]; + expr_551A_cp_0.velocity.X = expr_551A_cp_0.velocity.X * 0.3f; + Dust expr_5538_cp_0 = Main.dust[num123]; + expr_5538_cp_0.velocity.Y = expr_5538_cp_0.velocity.Y * 0.3f; + } + } + else + { + for (int num124 = 0; num124 < 2; num124++) + { + int num125 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num125].noGravity = true; + Dust expr_55E5_cp_0 = Main.dust[num125]; + expr_55E5_cp_0.velocity.X = expr_55E5_cp_0.velocity.X * 0.3f; + Dust expr_5603_cp_0 = Main.dust[num125]; + expr_5603_cp_0.velocity.Y = expr_5603_cp_0.velocity.Y * 0.3f; + } + } + } + } + if (this.type != 27 && this.type != 96 && this.type != 258) + { + this.ai[1] += 1f; + } + if (this.ai[1] >= 20f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + } + this.rotation += 0.3f * (float)this.direction; + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + return; + } + } + else + { + if (this.aiStyle == 9) + { + if (this.type == 34) + { + int num126 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 3.5f); + Main.dust[num126].noGravity = true; + Main.dust[num126].velocity *= 1.4f; + num126 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1.5f); + } + else + { + if (this.type == 79) + { + if (this.soundDelay == 0 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 2f) + { + this.soundDelay = 10; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 9); + } + for (int num127 = 0; num127 < 1; num127++) + { + int num128 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2.5f); + Main.dust[num128].velocity *= 0.1f; + Main.dust[num128].velocity += this.velocity * 0.2f; + Main.dust[num128].position.X = this.position.X + (float)(this.width / 2) + 4f + (float)Main.rand.Next(-2, 3); + Main.dust[num128].position.Y = this.position.Y + (float)(this.height / 2) + (float)Main.rand.Next(-2, 3); + Main.dust[num128].noGravity = true; + } + } + else + { + if (this.soundDelay == 0 && Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 2f) + { + this.soundDelay = 10; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 9); + } + int num129 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 2f); + Main.dust[num129].velocity *= 0.3f; + Main.dust[num129].position.X = this.position.X + (float)(this.width / 2) + 4f + (float)Main.rand.Next(-4, 5); + Main.dust[num129].position.Y = this.position.Y + (float)(this.height / 2) + (float)Main.rand.Next(-4, 5); + Main.dust[num129].noGravity = true; + } + } + if (Main.myPlayer == this.owner && this.ai[0] == 0f) + { + if (Main.player[this.owner].channel) + { + float num130 = 12f; + if (this.type == 16) + { + num130 = 15f; + } + Vector2 vector8 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num131 = (float)Main.mouseX + Main.screenPosition.X - vector8.X; + float num132 = (float)Main.mouseY + Main.screenPosition.Y - vector8.Y; + if (Main.player[this.owner].gravDir == -1f) + { + num132 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector8.Y; + } + float num133 = (float)Math.Sqrt((double)(num131 * num131 + num132 * num132)); + num133 = (float)Math.Sqrt((double)(num131 * num131 + num132 * num132)); + if (num133 > num130) + { + num133 = num130 / num133; + num131 *= num133; + num132 *= num133; + int num134 = (int)(num131 * 1000f); + int num135 = (int)(this.velocity.X * 1000f); + int num136 = (int)(num132 * 1000f); + int num137 = (int)(this.velocity.Y * 1000f); + if (num134 != num135 || num136 != num137) + { + this.netUpdate = true; + } + this.velocity.X = num131; + this.velocity.Y = num132; + } + else + { + int num138 = (int)(num131 * 1000f); + int num139 = (int)(this.velocity.X * 1000f); + int num140 = (int)(num132 * 1000f); + int num141 = (int)(this.velocity.Y * 1000f); + if (num138 != num139 || num140 != num141) + { + this.netUpdate = true; + } + this.velocity.X = num131; + this.velocity.Y = num132; + } + } + else + { + if (this.ai[0] == 0f) + { + this.ai[0] = 1f; + this.netUpdate = true; + float num142 = 12f; + Vector2 vector9 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num143 = (float)Main.mouseX + Main.screenPosition.X - vector9.X; + float num144 = (float)Main.mouseY + Main.screenPosition.Y - vector9.Y; + float num145 = (float)Math.Sqrt((double)(num143 * num143 + num144 * num144)); + if (num145 == 0f) + { + vector9 = new Vector2(Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2), Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2)); + num143 = this.position.X + (float)this.width * 0.5f - vector9.X; + num144 = this.position.Y + (float)this.height * 0.5f - vector9.Y; + num145 = (float)Math.Sqrt((double)(num143 * num143 + num144 * num144)); + } + num145 = num142 / num145; + num143 *= num145; + num144 *= num145; + this.velocity.X = num143; + this.velocity.Y = num144; + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.Kill(); + } + } + } + } + if (this.type == 34) + { + this.rotation += 0.3f * (float)this.direction; + } + else + { + if (this.velocity.X != 0f || this.velocity.Y != 0f) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 2.355f; + } + } + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + return; + } + } + else + { + if (this.aiStyle == 10) + { + if (this.type == 31 && this.ai[0] != 2f) + { + if (Main.rand.Next(2) == 0) + { + int num146 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, this.velocity.Y / 2f, 0, default(Color), 1f); + Dust expr_5FE2_cp_0 = Main.dust[num146]; + expr_5FE2_cp_0.velocity.X = expr_5FE2_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 39) + { + if (Main.rand.Next(2) == 0) + { + int num147 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 38, 0f, this.velocity.Y / 2f, 0, default(Color), 1f); + Dust expr_607C_cp_0 = Main.dust[num147]; + expr_607C_cp_0.velocity.X = expr_607C_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 40) + { + if (Main.rand.Next(2) == 0) + { + int num148 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, this.velocity.Y / 2f, 0, default(Color), 1f); + Main.dust[num148].velocity *= 0.4f; + } + } + else + { + if (this.type == 42 || this.type == 31) + { + if (Main.rand.Next(2) == 0) + { + int num149 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, 0f, 0, default(Color), 1f); + Dust expr_61AD_cp_0 = Main.dust[num149]; + expr_61AD_cp_0.velocity.X = expr_61AD_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 56 || this.type == 65) + { + if (Main.rand.Next(2) == 0) + { + int num150 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 0, default(Color), 1f); + Dust expr_6245_cp_0 = Main.dust[num150]; + expr_6245_cp_0.velocity.X = expr_6245_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 67 || this.type == 68) + { + if (Main.rand.Next(2) == 0) + { + int num151 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51, 0f, 0f, 0, default(Color), 1f); + Dust expr_62DD_cp_0 = Main.dust[num151]; + expr_62DD_cp_0.velocity.X = expr_62DD_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 71) + { + if (Main.rand.Next(2) == 0) + { + int num152 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53, 0f, 0f, 0, default(Color), 1f); + Dust expr_636B_cp_0 = Main.dust[num152]; + expr_636B_cp_0.velocity.X = expr_636B_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 179) + { + if (Main.rand.Next(2) == 0) + { + int num153 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 149, 0f, 0f, 0, default(Color), 1f); + Dust expr_63FF_cp_0 = Main.dust[num153]; + expr_63FF_cp_0.velocity.X = expr_63FF_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type == 241) + { + if (Main.rand.Next(2) == 0) + { + int num154 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, 0f, 0, default(Color), 1f); + Dust expr_648D_cp_0 = Main.dust[num154]; + expr_648D_cp_0.velocity.X = expr_648D_cp_0.velocity.X * 0.4f; + } + } + else + { + if (this.type != 109 && Main.rand.Next(20) == 0) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, 0f, 0f, 0, default(Color), 1f); + } + } + } + } + } + } + } + } + } + } + if (Main.myPlayer == this.owner && this.ai[0] == 0f) + { + if (Main.player[this.owner].channel) + { + float num155 = 12f; + Vector2 vector10 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num156 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; + float num157 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; + float num158 = (float)Math.Sqrt((double)(num156 * num156 + num157 * num157)); + num158 = (float)Math.Sqrt((double)(num156 * num156 + num157 * num157)); + if (num158 > num155) + { + num158 = num155 / num158; + num156 *= num158; + num157 *= num158; + if (num156 != this.velocity.X || num157 != this.velocity.Y) + { + this.netUpdate = true; + } + this.velocity.X = num156; + this.velocity.Y = num157; + } + else + { + if (num156 != this.velocity.X || num157 != this.velocity.Y) + { + this.netUpdate = true; + } + this.velocity.X = num156; + this.velocity.Y = num157; + } + } + else + { + this.ai[0] = 1f; + this.netUpdate = true; + } + } + if (this.ai[0] == 1f && this.type != 109) + { + if (this.type == 42 || this.type == 65 || this.type == 68) + { + this.ai[1] += 1f; + if (this.ai[1] >= 60f) + { + this.ai[1] = 60f; + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + else + { + this.velocity.Y = this.velocity.Y + 0.41f; + } + } + else + { + if (this.ai[0] == 2f && this.type != 109) + { + this.velocity.Y = this.velocity.Y + 0.2f; + if ((double)this.velocity.X < -0.04) + { + this.velocity.X = this.velocity.X + 0.04f; + } + else + { + if ((double)this.velocity.X > 0.04) + { + this.velocity.X = this.velocity.X - 0.04f; + } + else + { + this.velocity.X = 0f; + } + } + } + } + this.rotation += 0.1f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.aiStyle == 11) + { + if (this.type == 72 || this.type == 86 || this.type == 87) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = -1; + } + else + { + if (this.velocity.X < 0f) + { + this.spriteDirection = 1; + } + } + this.rotation = this.velocity.X * 0.1f; + this.frameCounter++; + if (this.frameCounter >= 4) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 4) + { + this.frame = 0; + } + if (Main.rand.Next(6) == 0) + { + int num159 = 56; + if (this.type == 86) + { + num159 = 73; + } + else + { + if (this.type == 87) + { + num159 = 74; + } + } + int num160 = Dust.NewDust(this.position, this.width, this.height, num159, 0f, 0f, 200, default(Color), 0.8f); + Main.dust[num160].velocity *= 0.3f; + } + } + else + { + this.rotation += 0.02f; + } + if (Main.myPlayer == this.owner) + { + if (this.type == 72 || this.type == 86 || this.type == 87) + { + if (Main.player[Main.myPlayer].fairy) + { + this.timeLeft = 2; + } + } + else + { + if (Main.player[Main.myPlayer].lightOrb) + { + this.timeLeft = 2; + } + } + } + if (Main.player[this.owner].dead) + { + this.Kill(); + return; + } + float num161 = 3f; + if (this.type == 72 || this.type == 86 || this.type == 87) + { + num161 = 3.75f; + } + Vector2 vector11 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num162 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector11.X; + float num163 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector11.Y; + int num164 = 70; + if (this.type == 18) + { + if (Main.player[this.owner].controlUp) + { + num163 = Main.player[this.owner].position.Y - 40f - vector11.Y; + num162 -= 6f; + num164 = 4; + } + else + { + if (Main.player[this.owner].controlDown) + { + num163 = Main.player[this.owner].position.Y + (float)Main.player[this.owner].height + 40f - vector11.Y; + num162 -= 6f; + num164 = 4; + } + } + } + float num165 = (float)Math.Sqrt((double)(num162 * num162 + num163 * num163)); + num165 = (float)Math.Sqrt((double)(num162 * num162 + num163 * num163)); + if (this.type == 72 || this.type == 86 || this.type == 87) + { + num164 = 40; + } + if (num165 > 800f) + { + this.position.X = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - (float)(this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - (float)(this.height / 2); + return; + } + if (num165 > (float)num164) + { + num165 = num161 / num165; + num162 *= num165; + num163 *= num165; + this.velocity.X = num162; + this.velocity.Y = num163; + return; + } + this.velocity.X = 0f; + this.velocity.Y = 0f; + return; + } + else + { + if (this.aiStyle == 12) + { + if (this.type == 288 && this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 17); + } + if (this.type == 280 || this.type == 288) + { + this.scale -= 0.002f; + if (this.scale <= 0f) + { + this.Kill(); + } + if (this.type == 288) + { + this.ai[0] = 4f; + } + if (this.ai[0] <= 3f) + { + this.ai[0] += 1f; + return; + } + this.velocity.Y = this.velocity.Y + 0.075f; + for (int num166 = 0; num166 < 3; num166++) + { + float num167 = this.velocity.X / 3f * (float)num166; + float num168 = this.velocity.Y / 3f * (float)num166; + int num169 = 14; + int num170 = Dust.NewDust(new Vector2(this.position.X + (float)num169, this.position.Y + (float)num169), this.width - num169 * 2, this.height - num169 * 2, 170, 0f, 0f, 100, default(Color), 1f); + Main.dust[num170].noGravity = true; + Main.dust[num170].velocity *= 0.1f; + Main.dust[num170].velocity += this.velocity * 0.5f; + Dust expr_6E74_cp_0 = Main.dust[num170]; + expr_6E74_cp_0.position.X = expr_6E74_cp_0.position.X - num167; + Dust expr_6E8F_cp_0 = Main.dust[num170]; + expr_6E8F_cp_0.position.Y = expr_6E8F_cp_0.position.Y - num168; + } + if (Main.rand.Next(8) == 0) + { + int num171 = 16; + int num172 = Dust.NewDust(new Vector2(this.position.X + (float)num171, this.position.Y + (float)num171), this.width - num171 * 2, this.height - num171 * 2, 170, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num172].velocity *= 0.25f; + Main.dust[num172].velocity += this.velocity * 0.5f; + return; + } + } + else + { + this.scale -= 0.02f; + if (this.scale <= 0f) + { + this.Kill(); + } + if (this.ai[0] > 3f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + for (int num173 = 0; num173 < 1; num173++) + { + for (int num174 = 0; num174 < 3; num174++) + { + float num175 = this.velocity.X / 3f * (float)num174; + float num176 = this.velocity.Y / 3f * (float)num174; + int num177 = 6; + int num178 = Dust.NewDust(new Vector2(this.position.X + (float)num177, this.position.Y + (float)num177), this.width - num177 * 2, this.height - num177 * 2, 172, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num178].noGravity = true; + Main.dust[num178].velocity *= 0.3f; + Main.dust[num178].velocity += this.velocity * 0.5f; + Dust expr_70DA_cp_0 = Main.dust[num178]; + expr_70DA_cp_0.position.X = expr_70DA_cp_0.position.X - num175; + Dust expr_70F5_cp_0 = Main.dust[num178]; + expr_70F5_cp_0.position.Y = expr_70F5_cp_0.position.Y - num176; + } + if (Main.rand.Next(8) == 0) + { + int num179 = 6; + int num180 = Dust.NewDust(new Vector2(this.position.X + (float)num179, this.position.Y + (float)num179), this.width - num179 * 2, this.height - num179 * 2, 172, 0f, 0f, 100, default(Color), 0.75f); + Main.dust[num180].velocity *= 0.5f; + Main.dust[num180].velocity += this.velocity * 0.5f; + } + } + return; + } + this.ai[0] += 1f; + return; + } + } + else + { + if (this.aiStyle == 13) + { + if (Main.player[this.owner].dead) + { + this.Kill(); + return; + } + Main.player[this.owner].itemAnimation = 5; + Main.player[this.owner].itemTime = 5; + if (this.alpha == 0) + { + if (this.position.X + (float)(this.width / 2) > Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2)) + { + Main.player[this.owner].ChangeDir(1); + } + else + { + Main.player[this.owner].ChangeDir(-1); + } + } + Vector2 vector12 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num181 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector12.X; + float num182 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector12.Y; + float num183 = (float)Math.Sqrt((double)(num181 * num181 + num182 * num182)); + if (this.ai[0] == 0f) + { + if (num183 > 700f) + { + this.ai[0] = 1f; + } + else + { + if (this.type == 262 && num183 > 500f) + { + this.ai[0] = 1f; + } + else + { + if (this.type == 271 && num183 > 200f) + { + this.ai[0] = 1f; + } + else + { + if (this.type == 273 && num183 > 150f) + { + this.ai[0] = 1f; + } + } + } + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + this.ai[1] += 1f; + if (this.ai[1] > 5f) + { + this.alpha = 0; + } + if (this.type == 262 && this.ai[1] > 8f) + { + this.ai[1] = 8f; + } + if (this.type == 271 && this.ai[1] > 8f) + { + this.ai[1] = 8f; + } + if (this.type == 273 && this.ai[1] > 8f) + { + this.ai[1] = 8f; + } + if (this.ai[1] >= 10f) + { + this.ai[1] = 15f; + this.velocity.Y = this.velocity.Y + 0.3f; + } + if (this.type == 262 && this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + else + { + if (this.type == 262) + { + this.spriteDirection = 1; + } + } + if (this.type == 271 && this.velocity.X < 0f) + { + this.spriteDirection = -1; + return; + } + if (this.type == 271) + { + this.spriteDirection = 1; + return; + } + } + else + { + if (this.ai[0] == 1f) + { + this.tileCollide = false; + this.rotation = (float)Math.Atan2((double)num182, (double)num181) - 1.57f; + float num184 = 20f; + if (this.type == 262) + { + num184 = 30f; + } + if (num183 < 50f) + { + this.Kill(); + } + num183 = num184 / num183; + num181 *= num183; + num182 *= num183; + this.velocity.X = num181; + this.velocity.Y = num182; + if (this.type == 262 && this.velocity.X < 0f) + { + this.spriteDirection = 1; + } + else + { + if (this.type == 262) + { + this.spriteDirection = -1; + } + } + if (this.type == 271 && this.velocity.X < 0f) + { + this.spriteDirection = 1; + return; + } + if (this.type == 271) + { + this.spriteDirection = -1; + return; + } + } + } + } + else + { + if (this.aiStyle == 14) + { + if (this.type == 196) + { + int num185 = Main.rand.Next(1, 3); + for (int num186 = 0; num186 < num185; num186++) + { + int num187 = Dust.NewDust(this.position, this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f); + Main.dust[num187].alpha += Main.rand.Next(100); + Main.dust[num187].velocity *= 0.3f; + Dust expr_7745_cp_0 = Main.dust[num187]; + expr_7745_cp_0.velocity.X = expr_7745_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.025f; + Dust expr_7773_cp_0 = Main.dust[num187]; + expr_7773_cp_0.velocity.Y = expr_7773_cp_0.velocity.Y - (0.4f + (float)Main.rand.Next(-3, 14) * 0.15f); + Main.dust[num187].fadeIn = 1.25f + (float)Main.rand.Next(20) * 0.15f; + } + } + if (this.type == 53) + { + try + { + Vector2 value2 = Collision.TileCollision(this.position, this.velocity, this.width, this.height, false, false); + //this.velocity != value2; + int num188 = (int)(this.position.X / 16f) - 1; + int num189 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num190 = (int)(this.position.Y / 16f) - 1; + int num191 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num188 < 0) + { + num188 = 0; + } + if (num189 > Main.maxTilesX) + { + num189 = Main.maxTilesX; + } + if (num190 < 0) + { + num190 = 0; + } + if (num191 > Main.maxTilesY) + { + num191 = Main.maxTilesY; + } + for (int num192 = num188; num192 < num189; num192++) + { + for (int num193 = num190; num193 < num191; num193++) + { + if (Main.tile[num192, num193] != null && Main.tile[num192, num193].nactive() && (Main.tileSolid[(int)Main.tile[num192, num193].type] || (Main.tileSolidTop[(int)Main.tile[num192, num193].type] && Main.tile[num192, num193].frameY == 0))) + { + Vector2 vector13; + vector13.X = (float)(num192 * 16); + vector13.Y = (float)(num193 * 16); + if (this.position.X + (float)this.width > vector13.X && this.position.X < vector13.X + 16f && this.position.Y + (float)this.height > vector13.Y && this.position.Y < vector13.Y + 16f) + { + this.velocity.X = 0f; + this.velocity.Y = -0.2f; + } + } + } + } + } + catch + { + } + } + if (this.type == 277 && this.alpha > 0) + { + this.alpha -= 30; + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.type == 261 || this.type == 277) + { + this.ai[0] += 1f; + if (this.ai[0] > 15f) + { + this.ai[0] = 15f; + if (this.velocity.Y == 0f && this.velocity.X != 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01) + { + this.Kill(); + } + } + this.velocity.Y = this.velocity.Y + 0.2f; + } + this.rotation += this.velocity.X * 0.05f; + } + else + { + this.ai[0] += 1f; + if (this.ai[0] > 5f) + { + this.ai[0] = 5f; + if (this.velocity.Y == 0f && this.velocity.X != 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01) + { + this.velocity.X = 0f; + this.netUpdate = true; + } + } + this.velocity.Y = this.velocity.Y + 0.2f; + } + this.rotation += this.velocity.X * 0.1f; + } + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + return; + } + } + else + { + if (this.aiStyle == 15) + { + if (this.type == 25) + { + if (Main.rand.Next(15) == 0) + { + Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.3f); + } + } + else + { + if (this.type == 26) + { + int num194 = Dust.NewDust(this.position, this.width, this.height, 172, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, default(Color), 1.5f); + Main.dust[num194].noGravity = true; + Dust expr_7D2E_cp_0 = Main.dust[num194]; + expr_7D2E_cp_0.velocity.X = expr_7D2E_cp_0.velocity.X / 2f; + Dust expr_7D4C_cp_0 = Main.dust[num194]; + expr_7D4C_cp_0.velocity.Y = expr_7D4C_cp_0.velocity.Y / 2f; + } + else + { + if (this.type == 35) + { + int num195 = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, default(Color), 3f); + Main.dust[num195].noGravity = true; + Dust expr_7DDB_cp_0 = Main.dust[num195]; + expr_7DDB_cp_0.velocity.X = expr_7DDB_cp_0.velocity.X * 2f; + Dust expr_7DF9_cp_0 = Main.dust[num195]; + expr_7DF9_cp_0.velocity.Y = expr_7DF9_cp_0.velocity.Y * 2f; + } + else + { + if (this.type == 154) + { + int num196 = Dust.NewDust(this.position, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140, default(Color), 1.5f); + Main.dust[num196].noGravity = true; + Main.dust[num196].velocity *= 0.25f; + } + } + } + } + if (Main.player[this.owner].dead) + { + this.Kill(); + return; + } + Main.player[this.owner].itemAnimation = 10; + Main.player[this.owner].itemTime = 10; + if (this.position.X + (float)(this.width / 2) > Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2)) + { + Main.player[this.owner].ChangeDir(1); + this.direction = 1; + } + else + { + Main.player[this.owner].ChangeDir(-1); + this.direction = -1; + } + Vector2 vector14 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num197 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector14.X; + float num198 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector14.Y; + float num199 = (float)Math.Sqrt((double)(num197 * num197 + num198 * num198)); + if (this.ai[0] == 0f) + { + float num200 = 160f; + if (this.type == 63) + { + num200 *= 1.5f; + } + if (this.type == 247) + { + num200 *= 1.5f; + } + this.tileCollide = true; + if (num199 > num200) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + else + { + if (!Main.player[this.owner].channel) + { + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.9f; + } + this.velocity.Y = this.velocity.Y + 1f; + this.velocity.X = this.velocity.X * 0.9f; + } + } + } + else + { + if (this.ai[0] == 1f) + { + float num201 = 14f / Main.player[this.owner].meleeSpeed; + float num202 = 0.9f / Main.player[this.owner].meleeSpeed; + float num203 = 300f; + if (this.type == 63) + { + num203 *= 1.5f; + num201 *= 1.5f; + num202 *= 1.5f; + } + if (this.type == 247) + { + num203 *= 1.5f; + num201 = 15.9f; + num202 *= 2f; + } + Math.Abs(num197); + Math.Abs(num198); + if (this.ai[1] == 1f) + { + this.tileCollide = false; + } + if (!Main.player[this.owner].channel || num199 > num203 || !this.tileCollide) + { + this.ai[1] = 1f; + if (this.tileCollide) + { + this.netUpdate = true; + } + this.tileCollide = false; + if (num199 < 20f) + { + this.Kill(); + } + } + if (!this.tileCollide) + { + num202 *= 2f; + } + int num204 = 60; + if (this.type == 247) + { + num204 = 100; + } + if (num199 > (float)num204 || !this.tileCollide) + { + num199 = num201 / num199; + num197 *= num199; + num198 *= num199; + new Vector2(this.velocity.X, this.velocity.Y); + float num205 = num197 - this.velocity.X; + float num206 = num198 - this.velocity.Y; + float num207 = (float)Math.Sqrt((double)(num205 * num205 + num206 * num206)); + num207 = num202 / num207; + num205 *= num207; + num206 *= num207; + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + this.velocity.X = this.velocity.X + num205; + this.velocity.Y = this.velocity.Y + num206; + } + else + { + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 6f) + { + this.velocity.X = this.velocity.X * 0.96f; + this.velocity.Y = this.velocity.Y + 0.2f; + } + if (Main.player[this.owner].velocity.X == 0f) + { + this.velocity.X = this.velocity.X * 0.96f; + } + } + } + } + if (this.type != 247) + { + this.rotation = (float)Math.Atan2((double)num198, (double)num197) - this.velocity.X * 0.1f; + return; + } + if (this.velocity.X < 0f) + { + this.rotation -= (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f; + } + else + { + this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f; + } + float num208 = this.position.X; + float num209 = this.position.Y; + float num210 = 600f; + bool flag4 = false; + if (this.owner == Main.myPlayer) + { + this.localAI[1] += 1f; + if (this.localAI[1] > 20f) + { + this.localAI[1] = 20f; + for (int num211 = 0; num211 < 200; num211++) + { + if (Main.npc[num211].active && !Main.npc[num211].dontTakeDamage && !Main.npc[num211].friendly && Main.npc[num211].lifeMax > 5) + { + float num212 = Main.npc[num211].position.X + (float)(Main.npc[num211].width / 2); + float num213 = Main.npc[num211].position.Y + (float)(Main.npc[num211].height / 2); + float num214 = Math.Abs(this.position.X + (float)(this.width / 2) - num212) + Math.Abs(this.position.Y + (float)(this.height / 2) - num213); + if (num214 < num210 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num211].position, Main.npc[num211].width, Main.npc[num211].height)) + { + num210 = num214; + num208 = num212; + num209 = num213; + flag4 = true; + } + } + } + } + } + if (flag4) + { + this.localAI[1] = 0f; + float num215 = 14f; + vector14 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num197 = num208 - vector14.X; + num198 = num209 - vector14.Y; + num199 = (float)Math.Sqrt((double)(num197 * num197 + num198 * num198)); + num199 = num215 / num199; + num197 *= num199; + num198 *= num199; + Projectile.NewProjectile(vector14.X, vector14.Y, num197, num198, 248, (int)((double)this.damage / 1.5), this.knockBack / 2f, Main.myPlayer, 0f, 0f); + return; + } + } + else + { + if (this.aiStyle == 16) + { + if (this.type == 108 || this.type == 164) + { + this.ai[0] += 1f; + if (this.ai[0] > 3f) + { + this.Kill(); + } + } + if (this.type == 37) + { + try + { + int num216 = (int)(this.position.X / 16f) - 1; + int num217 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num218 = (int)(this.position.Y / 16f) - 1; + int num219 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num216 < 0) + { + num216 = 0; + } + if (num217 > Main.maxTilesX) + { + num217 = Main.maxTilesX; + } + if (num218 < 0) + { + num218 = 0; + } + if (num219 > Main.maxTilesY) + { + num219 = Main.maxTilesY; + } + for (int num220 = num216; num220 < num217; num220++) + { + for (int num221 = num218; num221 < num219; num221++) + { + if (Main.tile[num220, num221] != null && Main.tile[num220, num221].nactive() && (Main.tileSolid[(int)Main.tile[num220, num221].type] || (Main.tileSolidTop[(int)Main.tile[num220, num221].type] && Main.tile[num220, num221].frameY == 0))) + { + Vector2 vector15; + vector15.X = (float)(num220 * 16); + vector15.Y = (float)(num221 * 16); + if (this.position.X + (float)this.width - 4f > vector15.X && this.position.X + 4f < vector15.X + 16f && this.position.Y + (float)this.height - 4f > vector15.Y && this.position.Y + 4f < vector15.Y + 16f) + { + this.velocity.X = 0f; + this.velocity.Y = -0.2f; + } + } + } + } + } + catch + { + } + } + if (this.type == 102) + { + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + } + if (this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + } + this.frameCounter++; + if (this.frameCounter > 3) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 1) + { + this.frame = 0; + } + if (this.velocity.Y == 0f) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.damage = 40; + this.knockBack = 8f; + this.timeLeft = 3; + this.netUpdate = true; + } + } + if (this.type == 303 && this.timeLeft <= 3 && this.hostile) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + } + if (this.owner == Main.myPlayer && this.timeLeft <= 3) + { + this.tileCollide = false; + this.ai[1] = 0f; + this.alpha = 255; + if (this.type == 28 || this.type == 37 || this.type == 75) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.damage = 100; + this.knockBack = 8f; + } + else + { + if (this.type == 29) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 250; + this.height = 250; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.damage = 250; + this.knockBack = 10f; + } + else + { + if (this.type == 30) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.knockBack = 8f; + } + else + { + if (this.type == 133 || this.type == 134 || this.type == 135 || this.type == 136 || this.type == 137 || this.type == 138) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.knockBack = 8f; + } + else + { + if (this.type == 139 || this.type == 140 || this.type == 141 || this.type == 142 || this.type == 143 || this.type == 144) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 200; + this.height = 200; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.knockBack = 10f; + } + } + } + } + } + } + else + { + if (this.type != 30 && this.type != 108 && this.type != 133 && this.type != 134 && this.type != 135 && this.type != 136 && this.type != 137 && this.type != 138 && this.type != 139 && this.type != 140 && this.type != 141 && this.type != 142 && this.type != 143 && this.type != 144 && this.type != 164 && this.type != 303) + { + this.damage = 0; + } + if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303) + { + if (Math.Abs(this.velocity.X) >= 8f || Math.Abs(this.velocity.Y) >= 8f) + { + for (int num222 = 0; num222 < 2; num222++) + { + float num223 = 0f; + float num224 = 0f; + if (num222 == 1) + { + num223 = this.velocity.X * 0.5f; + num224 = this.velocity.Y * 0.5f; + } + int num225 = Dust.NewDust(new Vector2(this.position.X + 3f + num223, this.position.Y + 3f + num224) - this.velocity * 0.5f, this.width - 8, this.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num225].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num225].velocity *= 0.2f; + Main.dust[num225].noGravity = true; + num225 = Dust.NewDust(new Vector2(this.position.X + 3f + num223, this.position.Y + 3f + num224) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num225].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num225].velocity *= 0.05f; + } + } + if (Math.Abs(this.velocity.X) < 15f && Math.Abs(this.velocity.Y) < 15f) + { + this.velocity *= 1.1f; + } + } + else + { + if (this.type == 133 || this.type == 136 || this.type == 139 || this.type == 142) + { + int num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f); + Main.dust[num226].scale *= 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num226].velocity *= 0.2f; + Main.dust[num226].noGravity = true; + } + else + { + if (this.type == 135 || this.type == 138 || this.type == 141 || this.type == 144) + { + if ((double)this.velocity.X > -0.2 && (double)this.velocity.X < 0.2 && (double)this.velocity.Y > -0.2 && (double)this.velocity.Y < 0.2) + { + this.alpha += 2; + if (this.alpha > 200) + { + this.alpha = 200; + } + } + else + { + this.alpha = 0; + int num227 = Dust.NewDust(new Vector2(this.position.X + 3f, this.position.Y + 3f) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, 0f, 0f, 100, default(Color), 1f); + Main.dust[num227].scale *= 1.6f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num227].velocity *= 0.05f; + Main.dust[num227].noGravity = true; + } + } + else + { + if (this.type != 30 && Main.rand.Next(2) == 0) + { + int num228 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1f); + Main.dust[num228].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num228].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num228].noGravity = true; + if (Main.rand.Next(3) == 0) + { + num228 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num228].scale = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num228].noGravity = true; + } + } + } + } + } + } + this.ai[0] += 1f; + if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + } + else + { + if (this.type == 135 || this.type == 138 || this.type == 141 || this.type == 144) + { + this.velocity.Y = this.velocity.Y + 0.2f; + this.velocity *= 0.97f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + if ((double)this.velocity.Y > -0.1 && (double)this.velocity.Y < 0.1) + { + this.velocity.Y = 0f; + } + } + else + { + if (this.type == 133 || this.type == 136 || this.type == 139 || this.type == 142) + { + if (this.ai[0] > 15f) + { + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + else + { + if ((this.type == 30 && this.ai[0] > 10f) || (this.type != 30 && this.ai[0] > 5f)) + { + this.ai[0] = 10f; + if (this.velocity.Y == 0f && this.velocity.X != 0f) + { + this.velocity.X = this.velocity.X * 0.97f; + if (this.type == 29) + { + this.velocity.X = this.velocity.X * 0.99f; + } + if ((double)this.velocity.X > -0.01 && (double)this.velocity.X < 0.01) + { + this.velocity.X = 0f; + this.netUpdate = true; + } + } + this.velocity.Y = this.velocity.Y + 0.2f; + } + } + } + } + if (this.type != 134 && this.type != 137 && this.type != 140 && this.type != 143 && this.type != 303) + { + this.rotation += this.velocity.X * 0.1f; + return; + } + } + else + { + if (this.aiStyle == 17) + { + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + this.rotation += this.velocity.X * 0.1f; + this.velocity.Y = this.velocity.Y + 0.2f; + if (this.owner == Main.myPlayer) + { + int num229 = (int)((this.position.X + (float)(this.width / 2)) / 16f); + int num230 = (int)((this.position.Y + (float)this.height - 4f) / 16f); + if (Main.tile[num229, num230] != null && !Main.tile[num229, num230].active()) + { + int num231 = 0; + if (this.type >= 201 && this.type <= 205) + { + num231 = this.type - 200; + } + WorldGen.PlaceTile(num229, num230, 85, false, false, this.owner, num231); + if (Main.tile[num229, num230].active()) + { + if (Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, "", 1, (float)num229, (float)num230, 85f, num231); + } + int num232 = Sign.ReadSign(num229, num230); + if (num232 >= 0) + { + Sign.TextSign(num232, this.miscText); + } + this.Kill(); + return; + } + } + } + } + else + { + if (this.aiStyle == 18) + { + if (this.ai[1] == 0f && this.type == 44) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + if (this.type != 263 && this.type != 274) + { + this.rotation += (float)this.direction * 0.8f; + this.ai[0] += 1f; + if (this.ai[0] >= 30f) + { + if (this.ai[0] < 100f) + { + this.velocity *= 1.06f; + } + else + { + this.ai[0] = 200f; + } + } + for (int num233 = 0; num233 < 2; num233++) + { + int num234 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, 0f, 0f, 100, default(Color), 1f); + Main.dust[num234].noGravity = true; + } + return; + } + if (this.type == 274 && this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + this.rotation += (float)this.direction * 0.05f; + this.rotation += (float)this.direction * 0.5f * ((float)this.timeLeft / 180f); + if (this.type == 274) + { + this.velocity *= 0.96f; + return; + } + this.velocity *= 0.95f; + return; + } + else + { + if (this.aiStyle == 19) + { + this.direction = Main.player[this.owner].direction; + Main.player[this.owner].heldProj = this.whoAmI; + Main.player[this.owner].itemTime = Main.player[this.owner].itemAnimation; + this.position.X = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - (float)(this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - (float)(this.height / 2); + if (!Main.player[this.owner].frozen) + { + if (this.type == 46) + { + if (this.ai[0] == 0f) + { + this.ai[0] = 3f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 1.6f; + } + else + { + this.ai[0] += 1.4f; + } + } + else + { + if (this.type == 105) + { + if (this.ai[0] == 0f) + { + this.ai[0] = 3f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 2.4f; + } + else + { + this.ai[0] += 2.1f; + } + } + else + { + if (this.type == 222) + { + if (this.ai[0] == 0f) + { + this.ai[0] = 3f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 2.4f; + if (this.localAI[0] == 0f && Main.myPlayer == this.owner) + { + this.localAI[0] = 1f; + Projectile.NewProjectile(this.center().X + this.velocity.X * this.ai[0], this.center().Y + this.velocity.Y * this.ai[0], this.velocity.X, this.velocity.Y, 228, this.damage, this.knockBack, this.owner, 0f, 0f); + } + } + else + { + this.ai[0] += 2.1f; + } + } + else + { + if (this.type == 47) + { + if (this.ai[0] == 0f) + { + this.ai[0] = 4f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 1.2f; + } + else + { + this.ai[0] += 0.9f; + } + } + else + { + if (this.type == 153) + { + this.spriteDirection = -this.direction; + if (this.ai[0] == 0f) + { + this.ai[0] = 4f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 1.5f; + } + else + { + this.ai[0] += 1.3f; + } + } + else + { + if (this.type == 49) + { + if (this.ai[0] == 0f) + { + this.ai[0] = 4f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 1.1f; + } + else + { + this.ai[0] += 0.85f; + } + } + else + { + if (this.type == 64 || this.type == 215) + { + this.spriteDirection = -this.direction; + if (this.ai[0] == 0f) + { + this.ai[0] = 3f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 1.9f; + } + else + { + this.ai[0] += 1.7f; + } + } + else + { + if (this.type == 66 || this.type == 97 || this.type == 212 || this.type == 218) + { + this.spriteDirection = -this.direction; + if (this.ai[0] == 0f) + { + this.ai[0] = 3f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 2.1f; + } + else + { + this.ai[0] += 1.9f; + } + } + else + { + if (this.type == 130) + { + this.spriteDirection = -this.direction; + if (this.ai[0] == 0f) + { + this.ai[0] = 3f; + this.netUpdate = true; + } + if (Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3) + { + this.ai[0] -= 1.3f; + } + else + { + this.ai[0] += 1f; + } + } + } + } + } + } + } + } + } + } + } + this.position += this.velocity * this.ai[0]; + if (this.type == 130) + { + if (this.ai[1] == 0f || this.ai[1] == 4f || this.ai[1] == 8f || this.ai[1] == 12f || this.ai[1] == 16f || this.ai[1] == 20f || this.ai[1] == 24f) + { + Projectile.NewProjectile(this.position.X + (float)(this.width / 2), this.position.Y + (float)(this.height / 2), this.velocity.X, this.velocity.Y, 131, this.damage / 2, 0f, this.owner, 0f, 0f); + } + this.ai[1] += 1f; + } + if (Main.player[this.owner].itemAnimation == 0) + { + this.Kill(); + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 2.355f; + if (this.spriteDirection == -1) + { + this.rotation -= 1.57f; + } + if (this.type == 46) + { + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(this.position, this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.4f); + } + int num235 = Dust.NewDust(this.position, this.width, this.height, 27, this.velocity.X * 0.2f + (float)(this.direction * 3), this.velocity.Y * 0.2f, 100, default(Color), 1.2f); + Main.dust[num235].noGravity = true; + Dust expr_A7A4_cp_0 = Main.dust[num235]; + expr_A7A4_cp_0.velocity.X = expr_A7A4_cp_0.velocity.X / 2f; + Dust expr_A7C4_cp_0 = Main.dust[num235]; + expr_A7C4_cp_0.velocity.Y = expr_A7C4_cp_0.velocity.Y / 2f; + num235 = Dust.NewDust(this.position - this.velocity * 2f, this.width, this.height, 27, 0f, 0f, 150, default(Color), 1.4f); + Dust expr_A838_cp_0 = Main.dust[num235]; + expr_A838_cp_0.velocity.X = expr_A838_cp_0.velocity.X / 5f; + Dust expr_A858_cp_0 = Main.dust[num235]; + expr_A858_cp_0.velocity.Y = expr_A858_cp_0.velocity.Y / 5f; + return; + } + if (this.type == 105) + { + if (Main.rand.Next(3) == 0) + { + int num236 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 57, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 200, default(Color), 1.2f); + Main.dust[num236].velocity += this.velocity * 0.3f; + Main.dust[num236].velocity *= 0.2f; + } + if (Main.rand.Next(4) == 0) + { + int num237 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 43, 0f, 0f, 254, default(Color), 0.3f); + Main.dust[num237].velocity += this.velocity * 0.5f; + Main.dust[num237].velocity *= 0.5f; + return; + } + } + else + { + if (this.type == 153) + { + int num238 = Dust.NewDust(this.position - this.velocity * 3f, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140, default(Color), 1f); + Main.dust[num238].noGravity = true; + Main.dust[num238].fadeIn = 1.25f; + Main.dust[num238].velocity *= 0.25f; + return; + } + } + } + else + { + if (this.aiStyle == 20) + { + if (this.type == 252) + { + this.frameCounter++; + if (this.frameCounter >= 4) + { + this.frameCounter = 0; + this.frame++; + } + if (this.frame > 3) + { + this.frame = 0; + } + } + if (this.soundDelay <= 0) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 22); + this.soundDelay = 30; + } + if (Main.myPlayer == this.owner) + { + if (Main.player[this.owner].channel) + { + float num239 = Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].shootSpeed * this.scale; + Vector2 vector16 = new Vector2(Main.player[this.owner].position.X + (float)Main.player[this.owner].width * 0.5f, Main.player[this.owner].position.Y + (float)Main.player[this.owner].height * 0.5f); + float num240 = (float)Main.mouseX + Main.screenPosition.X - vector16.X; + float num241 = (float)Main.mouseY + Main.screenPosition.Y - vector16.Y; + float num242 = (float)Math.Sqrt((double)(num240 * num240 + num241 * num241)); + num242 = (float)Math.Sqrt((double)(num240 * num240 + num241 * num241)); + num242 = num239 / num242; + num240 *= num242; + num241 *= num242; + if (num240 != this.velocity.X || num241 != this.velocity.Y) + { + this.netUpdate = true; + } + this.velocity.X = num240; + this.velocity.Y = num241; + } + else + { + this.Kill(); + } + } + if (this.velocity.X > 0f) + { + Main.player[this.owner].ChangeDir(1); + } + else + { + if (this.velocity.X < 0f) + { + Main.player[this.owner].ChangeDir(-1); + } + } + this.spriteDirection = this.direction; + Main.player[this.owner].ChangeDir(this.direction); + Main.player[this.owner].heldProj = this.whoAmI; + Main.player[this.owner].itemTime = 2; + Main.player[this.owner].itemAnimation = 2; + this.position.X = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - (float)(this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - (float)(this.height / 2); + this.rotation = (float)(Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.5700000524520874); + if (Main.player[this.owner].direction == 1) + { + Main.player[this.owner].itemRotation = (float)Math.Atan2((double)(this.velocity.Y * (float)this.direction), (double)(this.velocity.X * (float)this.direction)); + } + else + { + Main.player[this.owner].itemRotation = (float)Math.Atan2((double)(this.velocity.Y * (float)this.direction), (double)(this.velocity.X * (float)this.direction)); + } + this.velocity.X = this.velocity.X * (1f + (float)Main.rand.Next(-3, 4) * 0.01f); + if (Main.rand.Next(6) == 0) + { + int num243 = Dust.NewDust(this.position + this.velocity * (float)Main.rand.Next(6, 10) * 0.1f, this.width, this.height, 31, 0f, 0f, 80, default(Color), 1.4f); + Dust expr_AF7A_cp_0 = Main.dust[num243]; + expr_AF7A_cp_0.position.X = expr_AF7A_cp_0.position.X - 4f; + Main.dust[num243].noGravity = true; + Main.dust[num243].velocity *= 0.2f; + Main.dust[num243].velocity.Y = (float)(-(float)Main.rand.Next(7, 13)) * 0.15f; + return; + } + } + else + { + if (this.aiStyle == 21) + { + this.rotation = this.velocity.X * 0.1f; + this.spriteDirection = -this.direction; + if (Main.rand.Next(3) == 0) + { + int num244 = Dust.NewDust(this.position, this.width, this.height, 27, 0f, 0f, 80, default(Color), 1f); + Main.dust[num244].noGravity = true; + Main.dust[num244].velocity *= 0.2f; + } + if (this.ai[1] == 1f) + { + this.ai[1] = 0f; + Main.harpNote = this.ai[0]; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 26); + return; + } + } + else + { + if (this.aiStyle == 22) + { + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.alpha = 255; + } + if (this.ai[1] < 0f) + { + if (this.velocity.X > 0f) + { + this.rotation += 0.3f; + } + else + { + this.rotation -= 0.3f; + } + int num245 = (int)(this.position.X / 16f) - 1; + int num246 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num247 = (int)(this.position.Y / 16f) - 1; + int num248 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num245 < 0) + { + num245 = 0; + } + if (num246 > Main.maxTilesX) + { + num246 = Main.maxTilesX; + } + if (num247 < 0) + { + num247 = 0; + } + if (num248 > Main.maxTilesY) + { + num248 = Main.maxTilesY; + } + int num249 = (int)this.position.X + 4; + int num250 = (int)this.position.Y + 4; + for (int num251 = num245; num251 < num246; num251++) + { + for (int num252 = num247; num252 < num248; num252++) + { + if (Main.tile[num251, num252] != null && Main.tile[num251, num252].active() && Main.tile[num251, num252].type != 127 && Main.tileSolid[(int)Main.tile[num251, num252].type] && !Main.tileSolidTop[(int)Main.tile[num251, num252].type]) + { + Vector2 vector17; + vector17.X = (float)(num251 * 16); + vector17.Y = (float)(num252 * 16); + if ((float)(num249 + 8) > vector17.X && (float)num249 < vector17.X + 16f && (float)(num250 + 8) > vector17.Y && (float)num250 < vector17.Y + 16f) + { + this.Kill(); + } + } + } + } + int num253 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f); + Main.dust[num253].noGravity = true; + Main.dust[num253].velocity *= 0.3f; + return; + } + if (this.ai[0] < 0f) + { + if (this.ai[0] == -1f) + { + for (int num254 = 0; num254 < 10; num254++) + { + int num255 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1.1f); + Main.dust[num255].noGravity = true; + Main.dust[num255].velocity *= 1.3f; + } + } + else + { + if (Main.rand.Next(30) == 0) + { + int num256 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 100, default(Color), 1f); + Main.dust[num256].velocity *= 0.2f; + } + } + int num257 = (int)this.position.X / 16; + int num258 = (int)this.position.Y / 16; + if (Main.tile[num257, num258] == null || !Main.tile[num257, num258].active()) + { + this.Kill(); + } + this.ai[0] -= 1f; + if (this.ai[0] <= -300f && (Main.myPlayer == this.owner || Main.netMode == 2) && Main.tile[num257, num258].active() && Main.tile[num257, num258].type == 127) + { + WorldGen.KillTile(num257, num258, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num257, (float)num258, 0f, 0); + } + this.Kill(); + return; + } + } + else + { + int num259 = (int)(this.position.X / 16f) - 1; + int num260 = (int)((this.position.X + (float)this.width) / 16f) + 2; + int num261 = (int)(this.position.Y / 16f) - 1; + int num262 = (int)((this.position.Y + (float)this.height) / 16f) + 2; + if (num259 < 0) + { + num259 = 0; + } + if (num260 > Main.maxTilesX) + { + num260 = Main.maxTilesX; + } + if (num261 < 0) + { + num261 = 0; + } + if (num262 > Main.maxTilesY) + { + num262 = Main.maxTilesY; + } + int num263 = (int)this.position.X + 4; + int num264 = (int)this.position.Y + 4; + for (int num265 = num259; num265 < num260; num265++) + { + for (int num266 = num261; num266 < num262; num266++) + { + if (Main.tile[num265, num266] != null && Main.tile[num265, num266].nactive() && Main.tile[num265, num266].type != 127 && Main.tileSolid[(int)Main.tile[num265, num266].type] && !Main.tileSolidTop[(int)Main.tile[num265, num266].type]) + { + Vector2 vector18; + vector18.X = (float)(num265 * 16); + vector18.Y = (float)(num266 * 16); + if ((float)(num263 + 8) > vector18.X && (float)num263 < vector18.X + 16f && (float)(num264 + 8) > vector18.Y && (float)num264 < vector18.Y + 16f) + { + this.Kill(); + } + } + } + } + if (this.lavaWet) + { + this.Kill(); + } + if (this.active) + { + int num267 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f); + Main.dust[num267].noGravity = true; + Main.dust[num267].velocity *= 0.3f; + int num268 = (int)this.ai[0]; + int num269 = (int)this.ai[1]; + if (this.velocity.X > 0f) + { + this.rotation += 0.3f; + } + else + { + this.rotation -= 0.3f; + } + if (Main.myPlayer == this.owner) + { + int num270 = (int)((this.position.X + (float)(this.width / 2)) / 16f); + int num271 = (int)((this.position.Y + (float)(this.height / 2)) / 16f); + bool flag5 = false; + if (num270 == num268 && num271 == num269) + { + flag5 = true; + } + if (((this.velocity.X <= 0f && num270 <= num268) || (this.velocity.X >= 0f && num270 >= num268)) && ((this.velocity.Y <= 0f && num271 <= num269) || (this.velocity.Y >= 0f && num271 >= num269))) + { + flag5 = true; + } + if (flag5) + { + if (WorldGen.PlaceTile(num268, num269, 127, false, false, this.owner, 0)) + { + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 1, (float)((int)this.ai[0]), (float)((int)this.ai[1]), 127f, 0); + } + this.damage = 0; + this.ai[0] = -1f; + this.velocity *= 0f; + this.alpha = 255; + this.position.X = (float)(num268 * 16); + this.position.Y = (float)(num269 * 16); + this.netUpdate = true; + return; + } + this.ai[1] = -1f; + return; + } + } + } + } + } + else + { + if (this.aiStyle == 23) + { + if (this.type == 188 && this.ai[0] < 8f) + { + this.ai[0] = 8f; + } + if (this.timeLeft > 60) + { + this.timeLeft = 60; + } + if (this.ai[0] > 7f) + { + float num272 = 1f; + if (this.ai[0] == 8f) + { + num272 = 0.25f; + } + else + { + if (this.ai[0] == 9f) + { + num272 = 0.5f; + } + else + { + if (this.ai[0] == 10f) + { + num272 = 0.75f; + } + } + } + this.ai[0] += 1f; + int num273 = 6; + if (this.type == 101) + { + num273 = 75; + } + if (num273 == 6 || Main.rand.Next(2) == 0) + { + for (int num274 = 0; num274 < 1; num274++) + { + int num275 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num273, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f); + if (Main.rand.Next(3) != 0 || (num273 == 75 && Main.rand.Next(3) == 0)) + { + Main.dust[num275].noGravity = true; + Main.dust[num275].scale *= 3f; + Dust expr_BCE4_cp_0 = Main.dust[num275]; + expr_BCE4_cp_0.velocity.X = expr_BCE4_cp_0.velocity.X * 2f; + Dust expr_BD04_cp_0 = Main.dust[num275]; + expr_BD04_cp_0.velocity.Y = expr_BD04_cp_0.velocity.Y * 2f; + } + if (this.type == 188) + { + Main.dust[num275].scale *= 1.25f; + } + else + { + Main.dust[num275].scale *= 1.5f; + } + Dust expr_BD69_cp_0 = Main.dust[num275]; + expr_BD69_cp_0.velocity.X = expr_BD69_cp_0.velocity.X * 1.2f; + Dust expr_BD89_cp_0 = Main.dust[num275]; + expr_BD89_cp_0.velocity.Y = expr_BD89_cp_0.velocity.Y * 1.2f; + Main.dust[num275].scale *= num272; + if (num273 == 75) + { + Main.dust[num275].velocity += this.velocity; + if (!Main.dust[num275].noGravity) + { + Main.dust[num275].velocity *= 0.5f; + } + } + } + } + } + else + { + this.ai[0] += 1f; + } + this.rotation += 0.3f * (float)this.direction; + return; + } + if (this.aiStyle == 24) + { + this.light = this.scale * 0.5f; + this.rotation += this.velocity.X * 0.2f; + this.ai[1] += 1f; + if (this.type == 94) + { + if (Main.rand.Next(4) == 0) + { + int num276 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 70, 0f, 0f, 0, default(Color), 1f); + Main.dust[num276].noGravity = true; + Main.dust[num276].velocity *= 0.5f; + Main.dust[num276].scale *= 0.9f; + } + this.velocity *= 0.985f; + if (this.ai[1] > 130f) + { + this.scale -= 0.05f; + if ((double)this.scale <= 0.2) + { + this.scale = 0.2f; + this.Kill(); + return; + } + } + } + else + { + this.velocity *= 0.96f; + if (this.ai[1] > 15f) + { + this.scale -= 0.05f; + if ((double)this.scale <= 0.2) + { + this.scale = 0.2f; + this.Kill(); + return; + } + } + } + } + else + { + if (this.aiStyle == 25) + { + if (this.ai[0] != 0f && this.velocity.Y <= 0f && this.velocity.X == 0f) + { + float num277 = 0.5f; + int i2 = (int)((this.position.X - 8f) / 16f); + int num278 = (int)(this.position.Y / 16f); + bool flag6 = false; + bool flag7 = false; + if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1)) + { + flag6 = true; + } + i2 = (int)((this.position.X + (float)this.width + 8f) / 16f); + if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1)) + { + flag7 = true; + } + if (flag6) + { + this.velocity.X = num277; + } + else + { + if (flag7) + { + this.velocity.X = -num277; + } + else + { + i2 = (int)((this.position.X - 8f - 16f) / 16f); + num278 = (int)(this.position.Y / 16f); + flag6 = false; + flag7 = false; + if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1)) + { + flag6 = true; + } + i2 = (int)((this.position.X + (float)this.width + 8f + 16f) / 16f); + if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1)) + { + flag7 = true; + } + if (flag6) + { + this.velocity.X = num277; + } + else + { + if (flag7) + { + this.velocity.X = -num277; + } + else + { + i2 = (int)((this.position.X + 4f) / 16f); + num278 = (int)((this.position.Y + (float)this.height + 8f) / 16f); + if (WorldGen.SolidTile(i2, num278) || WorldGen.SolidTile(i2, num278 + 1)) + { + flag6 = true; + } + if (!flag6) + { + this.velocity.X = num277; + } + else + { + this.velocity.X = -num277; + } + } + } + } + } + } + this.rotation += this.velocity.X * 0.06f; + this.ai[0] = 1f; + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + } + if (this.velocity.Y <= 6f) + { + if (this.velocity.X > 0f && this.velocity.X < 7f) + { + this.velocity.X = this.velocity.X + 0.05f; + } + if (this.velocity.X < 0f && this.velocity.X > -7f) + { + this.velocity.X = this.velocity.X - 0.05f; + } + } + this.velocity.Y = this.velocity.Y + 0.3f; + return; + } + if (this.aiStyle == 26) + { + if (!Main.player[this.owner].active) + { + this.active = false; + return; + } + bool flag8 = false; + bool flag9 = false; + bool flag10 = false; + bool flag11 = false; + int num279 = 85; + if (this.type == 112) + { + num279 = 100; + } + if (this.type == 127) + { + num279 = 50; + } + if (this.type >= 191 && this.type <= 194) + { + if (this.lavaWet) + { + this.ai[0] = 1f; + this.ai[1] = 0f; + } + num279 = 60 + 30 * this.minionPos; + } + else + { + if (this.type == 266) + { + num279 = 60 + 30 * this.minionPos; + } + } + if (Main.myPlayer == this.owner) + { + if (this.type == 111) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].bunny = false; + } + if (Main.player[Main.myPlayer].bunny) + { + this.timeLeft = 2; + } + } + if (this.type == 112) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].penguin = false; + } + if (Main.player[Main.myPlayer].penguin) + { + this.timeLeft = 2; + } + } + if (this.type == 127) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].turtle = false; + } + if (Main.player[Main.myPlayer].turtle) + { + this.timeLeft = 2; + } + } + if (this.type == 175) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].eater = false; + } + if (Main.player[Main.myPlayer].eater) + { + this.timeLeft = 2; + } + } + if (this.type == 197) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].skeletron = false; + } + if (Main.player[Main.myPlayer].skeletron) + { + this.timeLeft = 2; + } + } + if (this.type == 198) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].hornet = false; + } + if (Main.player[Main.myPlayer].hornet) + { + this.timeLeft = 2; + } + } + if (this.type == 199) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].tiki = false; + } + if (Main.player[Main.myPlayer].tiki) + { + this.timeLeft = 2; + } + } + if (this.type == 200) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].lizard = false; + } + if (Main.player[Main.myPlayer].lizard) + { + this.timeLeft = 2; + } + } + if (this.type == 208) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].parrot = false; + } + if (Main.player[Main.myPlayer].parrot) + { + this.timeLeft = 2; + } + } + if (this.type == 209) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].truffle = false; + } + if (Main.player[Main.myPlayer].truffle) + { + this.timeLeft = 2; + } + } + if (this.type == 210) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].sapling = false; + } + if (Main.player[Main.myPlayer].sapling) + { + this.timeLeft = 2; + } + } + if (this.type == 211) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].wisp = false; + } + if (Main.player[Main.myPlayer].wisp) + { + this.timeLeft = 2; + } + } + if (this.type == 236) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].dino = false; + } + if (Main.player[Main.myPlayer].dino) + { + this.timeLeft = 2; + } + } + if (this.type == 266) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].slime = false; + } + if (Main.player[Main.myPlayer].slime) + { + this.timeLeft = 2; + } + } + if (this.type == 268) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].eyeSpring = false; + } + if (Main.player[Main.myPlayer].eyeSpring) + { + this.timeLeft = 2; + } + } + if (this.type == 269) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].snowman = false; + } + if (Main.player[Main.myPlayer].snowman) + { + this.timeLeft = 2; + } + } + if (this.type >= 191 && this.type <= 194) + { + if (Main.player[Main.myPlayer].dead) + { + Main.player[Main.myPlayer].pygmy = false; + } + if (Main.player[Main.myPlayer].pygmy) + { + this.timeLeft = Main.rand.Next(2, 10); + } + } + } + if ((this.type >= 191 && this.type <= 194) || this.type == 266) + { + num279 = 10; + int num280 = 40 * (this.minionPos + 1) * Main.player[this.owner].direction; + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2) - (float)num279 + (float)num280) + { + flag8 = true; + } + else + { + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) > this.position.X + (float)(this.width / 2) + (float)num279 + (float)num280) + { + flag9 = true; + } + } + } + else + { + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2) - (float)num279) + { + flag8 = true; + } + else + { + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) > this.position.X + (float)(this.width / 2) + (float)num279) + { + flag9 = true; + } + } + } + if (this.type == 175) + { + float num281 = 0.1f; + this.tileCollide = false; + int num282 = 300; + Vector2 vector19 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num283 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector19.X; + float num284 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector19.Y; + if (this.type == 127) + { + num284 = Main.player[this.owner].position.Y - vector19.Y; + } + float num285 = (float)Math.Sqrt((double)(num283 * num283 + num284 * num284)); + float num286 = 7f; + if (num285 < (float)num282 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + if (num285 < 150f) + { + if (Math.Abs(this.velocity.X) > 2f || Math.Abs(this.velocity.Y) > 2f) + { + this.velocity *= 0.99f; + } + num281 = 0.01f; + if (num283 < -2f) + { + num283 = -2f; + } + if (num283 > 2f) + { + num283 = 2f; + } + if (num284 < -2f) + { + num284 = -2f; + } + if (num284 > 2f) + { + num284 = 2f; + } + } + else + { + if (num285 > 300f) + { + num281 = 0.2f; + } + num285 = num286 / num285; + num283 *= num285; + num284 *= num285; + } + if (Math.Abs(num283) > Math.Abs(num284) || num281 == 0.05f) + { + if (this.velocity.X < num283) + { + this.velocity.X = this.velocity.X + num281; + if (num281 > 0.05f && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num281; + } + } + if (this.velocity.X > num283) + { + this.velocity.X = this.velocity.X - num281; + if (num281 > 0.05f && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num281; + } + } + } + if (Math.Abs(num283) <= Math.Abs(num284) || num281 == 0.05f) + { + if (this.velocity.Y < num284) + { + this.velocity.Y = this.velocity.Y + num281; + if (num281 > 0.05f && this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + num281; + } + } + if (this.velocity.Y > num284) + { + this.velocity.Y = this.velocity.Y - num281; + if (num281 > 0.05f && this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - num281; + } + } + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 1) + { + this.frame = 0; + return; + } + } + else + { + if (this.type == 197) + { + float num287 = 0.1f; + this.tileCollide = false; + int num288 = 300; + Vector2 vector20 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num289 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector20.X; + float num290 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector20.Y; + if (this.type == 127) + { + num290 = Main.player[this.owner].position.Y - vector20.Y; + } + float num291 = (float)Math.Sqrt((double)(num289 * num289 + num290 * num290)); + float num292 = 3f; + if (num291 > 500f) + { + this.localAI[0] = 10000f; + } + if (this.localAI[0] >= 10000f) + { + num292 = 14f; + } + if (num291 < (float)num288 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + if (num291 < 150f) + { + if (Math.Abs(this.velocity.X) > 2f || Math.Abs(this.velocity.Y) > 2f) + { + this.velocity *= 0.99f; + } + num287 = 0.01f; + if (num289 < -2f) + { + num289 = -2f; + } + if (num289 > 2f) + { + num289 = 2f; + } + if (num290 < -2f) + { + num290 = -2f; + } + if (num290 > 2f) + { + num290 = 2f; + } + } + else + { + if (num291 > 300f) + { + num287 = 0.2f; + } + num291 = num292 / num291; + num289 *= num291; + num290 *= num291; + } + if (this.velocity.X < num289) + { + this.velocity.X = this.velocity.X + num287; + if (num287 > 0.05f && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num287; + } + } + if (this.velocity.X > num289) + { + this.velocity.X = this.velocity.X - num287; + if (num287 > 0.05f && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num287; + } + } + if (this.velocity.Y < num290) + { + this.velocity.Y = this.velocity.Y + num287; + if (num287 > 0.05f && this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + num287; + } + } + if (this.velocity.Y > num290) + { + this.velocity.Y = this.velocity.Y - num287; + if (num287 > 0.05f && this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - num287; + } + } + this.localAI[0] += (float)Main.rand.Next(10); + if (this.localAI[0] > 10000f) + { + if (this.localAI[1] == 0f) + { + if (this.velocity.X < 0f) + { + this.localAI[1] = -1f; + } + else + { + this.localAI[1] = 1f; + } + } + this.rotation += 0.25f * this.localAI[1]; + if (this.localAI[0] > 12000f) + { + this.localAI[0] = 0f; + } + } + else + { + this.localAI[1] = 0f; + float num293 = this.velocity.X * 0.1f; + if (this.rotation > num293) + { + this.rotation -= (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f; + if (this.rotation < num293) + { + this.rotation = num293; + } + } + if (this.rotation < num293) + { + this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.01f; + if (this.rotation > num293) + { + this.rotation = num293; + } + } + } + if ((double)this.rotation > 6.28) + { + this.rotation -= 6.28f; + } + if ((double)this.rotation < -6.28) + { + this.rotation += 6.28f; + return; + } + } + else + { + if (this.type == 198) + { + float num294 = 0.4f; + this.tileCollide = false; + int num295 = 100; + Vector2 vector21 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num296 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector21.X; + float num297 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector21.Y; + num297 += (float)Main.rand.Next(-10, 21); + num296 += (float)Main.rand.Next(-10, 21); + num296 += (float)(60 * -(float)Main.player[this.owner].direction); + num297 -= 60f; + if (this.type == 127) + { + num297 = Main.player[this.owner].position.Y - vector21.Y; + } + float num298 = (float)Math.Sqrt((double)(num296 * num296 + num297 * num297)); + float num299 = 14f; + if (num298 < (float)num295 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + if (num298 < 50f) + { + if (Math.Abs(this.velocity.X) > 2f || Math.Abs(this.velocity.Y) > 2f) + { + this.velocity *= 0.99f; + } + num294 = 0.01f; + } + else + { + if (num298 < 100f) + { + num294 = 0.1f; + } + if (num298 > 300f) + { + num294 = 0.6f; + } + num298 = num299 / num298; + num296 *= num298; + num297 *= num298; + } + if (this.velocity.X < num296) + { + this.velocity.X = this.velocity.X + num294; + if (num294 > 0.05f && this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num294; + } + } + if (this.velocity.X > num296) + { + this.velocity.X = this.velocity.X - num294; + if (num294 > 0.05f && this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num294; + } + } + if (this.velocity.Y < num297) + { + this.velocity.Y = this.velocity.Y + num294; + if (num294 > 0.05f && this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + num294 * 2f; + } + } + if (this.velocity.Y > num297) + { + this.velocity.Y = this.velocity.Y - num294; + if (num294 > 0.05f && this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - num294 * 2f; + } + } + if ((double)this.velocity.X > 0.25) + { + this.direction = -1; + } + else + { + if ((double)this.velocity.X < -0.25) + { + this.direction = 1; + } + } + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.05f; + this.frameCounter++; + if (this.frameCounter > 2) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 3) + { + this.frame = 0; + return; + } + } + else + { + if (this.type == 211) + { + this.ignoreWater = false; + float num300 = 0.2f; + float num301 = 5f; + this.tileCollide = false; + Vector2 vector22 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num302 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector22.X; + float num303 = Main.player[this.owner].position.Y + Main.player[this.owner].gfxOffY + (float)(Main.player[this.owner].height / 2) - vector22.Y; + if (Main.player[this.owner].controlLeft) + { + num302 -= 120f; + } + else + { + if (Main.player[this.owner].controlRight) + { + num302 += 120f; + } + } + if (Main.player[this.owner].controlDown) + { + num303 += 120f; + } + else + { + if (Main.player[this.owner].controlUp) + { + num303 -= 120f; + } + num303 -= 60f; + } + float num304 = (float)Math.Sqrt((double)(num302 * num302 + num303 * num303)); + if (num304 > 1000f) + { + this.position.X = this.position.X + num302; + this.position.Y = this.position.Y + num303; + } + if (this.localAI[0] == 1f) + { + if (num304 < 10f && Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y) < num301 && Main.player[this.owner].velocity.Y == 0f) + { + this.localAI[0] = 0f; + } + num301 = 12f; + if (num304 < num301) + { + this.velocity.X = num302; + this.velocity.Y = num303; + } + else + { + num304 = num301 / num304; + this.velocity.X = num302 * num304; + this.velocity.Y = num303 * num304; + } + if ((double)this.velocity.X > 0.5) + { + this.direction = -1; + } + else + { + if ((double)this.velocity.X < -0.5) + { + this.direction = 1; + } + } + this.spriteDirection = this.direction; + this.rotation -= (0.2f + Math.Abs(this.velocity.X) * 0.025f) * (float)this.direction; + this.frameCounter++; + if (this.frameCounter > 3) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame < 5) + { + this.frame = 5; + } + if (this.frame > 9) + { + this.frame = 5; + } + for (int num305 = 0; num305 < 2; num305++) + { + int num306 = Dust.NewDust(new Vector2(this.position.X + 3f, this.position.Y + 4f), 14, 14, 156, 0f, 0f, 0, default(Color), 1f); + Main.dust[num306].velocity *= 0.2f; + Main.dust[num306].noGravity = true; + Main.dust[num306].scale = 1.25f; + } + return; + } + if (num304 > 200f) + { + this.localAI[0] = 1f; + } + if ((double)this.velocity.X > 0.5) + { + this.direction = -1; + } + else + { + if ((double)this.velocity.X < -0.5) + { + this.direction = 1; + } + } + this.spriteDirection = this.direction; + if (num304 < 10f) + { + this.velocity.X = num302; + this.velocity.Y = num303; + this.rotation = this.velocity.X * 0.05f; + if (num304 < num301) + { + this.position += this.velocity; + this.velocity *= 0f; + num300 = 0f; + } + this.direction = -Main.player[this.owner].direction; + } + num304 = num301 / num304; + num302 *= num304; + num303 *= num304; + if (this.velocity.X < num302) + { + this.velocity.X = this.velocity.X + num300; + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + } + if (this.velocity.X > num302) + { + this.velocity.X = this.velocity.X - num300; + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X * 0.99f; + } + } + if (this.velocity.Y < num303) + { + this.velocity.Y = this.velocity.Y + num300; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y * 0.99f; + } + } + if (this.velocity.Y > num303) + { + this.velocity.Y = this.velocity.Y - num300; + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.99f; + } + } + if (this.velocity.X != 0f || this.velocity.Y != 0f) + { + this.rotation = this.velocity.X * 0.05f; + } + this.frameCounter++; + if (this.frameCounter > 3) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 4) + { + this.frame = 0; + return; + } + } + else + { + if (this.type == 199) + { + float num307 = 0.1f; + this.tileCollide = false; + int num308 = 200; + Vector2 vector23 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num309 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector23.X; + float num310 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector23.Y; + num310 -= 60f; + num309 -= 2f; + if (this.type == 127) + { + num310 = Main.player[this.owner].position.Y - vector23.Y; + } + float num311 = (float)Math.Sqrt((double)(num309 * num309 + num310 * num310)); + float num312 = 4f; + float num313 = num311; + if (num311 < (float)num308 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + if (num311 < 4f) + { + this.velocity.X = num309; + this.velocity.Y = num310; + num307 = 0f; + } + else + { + if (num311 > 350f) + { + num307 = 0.2f; + num312 = 10f; + } + num311 = num312 / num311; + num309 *= num311; + num310 *= num311; + } + if (this.velocity.X < num309) + { + this.velocity.X = this.velocity.X + num307; + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num307; + } + } + if (this.velocity.X > num309) + { + this.velocity.X = this.velocity.X - num307; + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num307; + } + } + if (this.velocity.Y < num310) + { + this.velocity.Y = this.velocity.Y + num307; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + num307; + } + } + if (this.velocity.Y > num310) + { + this.velocity.Y = this.velocity.Y - num307; + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - num307; + } + } + this.direction = -Main.player[this.owner].direction; + this.spriteDirection = 1; + this.rotation = this.velocity.Y * 0.05f * (float)(-(float)this.direction); + if (num313 >= 50f) + { + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frameCounter = 0; + if (this.velocity.X < 0f) + { + if (this.frame < 2) + { + this.frame++; + } + if (this.frame > 2) + { + this.frame--; + return; + } + } + else + { + if (this.frame < 6) + { + this.frame++; + } + if (this.frame > 6) + { + this.frame--; + return; + } + } + } + } + else + { + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame += this.direction; + this.frameCounter = 0; + } + if (this.frame > 7) + { + this.frame = 0; + } + if (this.frame < 0) + { + this.frame = 7; + return; + } + } + } + else + { + if (this.ai[1] == 0f) + { + int num314 = 500; + if (this.type == 127) + { + num314 = 200; + } + if (this.type == 208) + { + num314 = 300; + } + if ((this.type >= 191 && this.type <= 194) || this.type == 266) + { + num314 += 40 * this.minionPos; + if (this.localAI[0] > 0f) + { + num314 += 500; + } + if (this.type == 266 && this.localAI[0] > 0f) + { + num314 += 100; + } + } + if (Main.player[this.owner].rocketDelay2 > 0) + { + this.ai[0] = 1f; + } + Vector2 vector24 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num315 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector24.X; + if (this.type >= 191) + { + int arg_E8AA_0 = this.type; + } + float num316 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector24.Y; + float num317 = (float)Math.Sqrt((double)(num315 * num315 + num316 * num316)); + if (num317 > 2000f) + { + this.position.X = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - (float)(this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - (float)(this.height / 2); + } + else + { + if (num317 > (float)num314 || (Math.Abs(num316) > 300f && (((this.type < 191 || this.type > 194) && this.type != 266) || this.localAI[0] <= 0f))) + { + this.ai[0] = 1f; + if (num316 > 0f && this.velocity.Y < 0f) + { + this.velocity.Y = 0f; + } + if (num316 < 0f && this.velocity.Y > 0f) + { + this.velocity.Y = 0f; + } + } + } + } + if (this.type == 209 && this.ai[0] != 0f) + { + if (Main.player[this.owner].velocity.Y == 0f && this.alpha >= 100) + { + this.position.X = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - (float)(this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float)Main.player[this.owner].height - (float)this.height; + this.ai[0] = 0f; + return; + } + this.velocity.X = 0f; + this.velocity.Y = 0f; + this.alpha += 5; + if (this.alpha > 255) + { + this.alpha = 255; + return; + } + } + else + { + if (this.ai[0] != 0f) + { + float num318 = 0.2f; + int num319 = 200; + if (this.type == 127) + { + num319 = 100; + } + if (this.type >= 191 && this.type <= 194) + { + num318 = 0.5f; + num319 = 100; + } + this.tileCollide = false; + Vector2 vector25 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num320 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector25.X; + if ((this.type >= 191 && this.type <= 194) || this.type == 266) + { + num320 -= (float)(40 * Main.player[this.owner].direction); + float num321 = 600f; + bool flag12 = false; + for (int num322 = 0; num322 < 200; num322++) + { + if (Main.npc[num322].active && !Main.npc[num322].dontTakeDamage && !Main.npc[num322].friendly && Main.npc[num322].lifeMax > 5) + { + float num323 = Main.npc[num322].position.X + (float)(Main.npc[num322].width / 2); + float num324 = Main.npc[num322].position.Y + (float)(Main.npc[num322].height / 2); + float num325 = Math.Abs(Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - num323) + Math.Abs(Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - num324); + if (num325 < num321) + { + flag12 = true; + break; + } + } + } + if (!flag12) + { + num320 -= (float)(40 * this.minionPos * Main.player[this.owner].direction); + } + } + float num326 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector25.Y; + if (this.type == 127) + { + num326 = Main.player[this.owner].position.Y - vector25.Y; + } + float num327 = (float)Math.Sqrt((double)(num320 * num320 + num326 * num326)); + float num328 = 10f; + if (this.type == 111) + { + num328 = 11f; + } + if (this.type == 127) + { + num328 = 9f; + } + if (this.type >= 191 && this.type <= 194) + { + num318 = 0.4f; + num328 = 12f; + if (num328 < Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y)) + { + num328 = Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y); + } + } + if (this.type == 208 && Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y) > 4f) + { + num319 = -1; + } + if (num327 < (float)num319 && Main.player[this.owner].velocity.Y == 0f && this.position.Y + (float)this.height <= Main.player[this.owner].position.Y + (float)Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0f; + if (this.velocity.Y < -6f) + { + this.velocity.Y = -6f; + } + } + if (num327 < 60f) + { + num320 = this.velocity.X; + num326 = this.velocity.Y; + } + else + { + num327 = num328 / num327; + num320 *= num327; + num326 *= num327; + } + if (this.velocity.X < num320) + { + this.velocity.X = this.velocity.X + num318; + if (this.velocity.X < 0f) + { + this.velocity.X = this.velocity.X + num318 * 1.5f; + } + } + if (this.velocity.X > num320) + { + this.velocity.X = this.velocity.X - num318; + if (this.velocity.X > 0f) + { + this.velocity.X = this.velocity.X - num318 * 1.5f; + } + } + if (this.velocity.Y < num326) + { + this.velocity.Y = this.velocity.Y + num318; + if (this.velocity.Y < 0f) + { + this.velocity.Y = this.velocity.Y + num318 * 1.5f; + } + } + if (this.velocity.Y > num326) + { + this.velocity.Y = this.velocity.Y - num318; + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y - num318 * 1.5f; + } + } + if (this.type == 111) + { + this.frame = 7; + } + if (this.type == 112) + { + this.frame = 2; + } + if (this.type >= 191 && this.type <= 194 && this.frame < 12) + { + this.frame = Main.rand.Next(12, 18); + this.frameCounter = 0; + } + if ((double)this.velocity.X > 0.5) + { + this.spriteDirection = -1; + } + else + { + if ((double)this.velocity.X < -0.5) + { + this.spriteDirection = 1; + } + } + if (this.type == 112) + { + if (this.spriteDirection == -1) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + } + } + else + { + if (this.type == 127) + { + this.frameCounter += 3; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame <= 5 || this.frame > 15) + { + this.frame = 6; + } + this.rotation = this.velocity.X * 0.1f; + } + else + { + if (this.type == 269) + { + if (this.frame == 6) + { + this.frameCounter = 0; + } + else + { + if (this.frame < 4 || this.frame > 6) + { + this.frameCounter = 0; + this.frame = 4; + } + else + { + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + } + } + this.rotation = this.velocity.X * 0.05f; + } + else + { + if (this.type == 266) + { + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame < 2 || this.frame > 5) + { + this.frame = 2; + } + this.rotation = this.velocity.X * 0.1f; + } + else + { + if (this.type == 268) + { + this.frameCounter++; + if (this.frameCounter > 4) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame < 6 || this.frame > 7) + { + this.frame = 6; + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.58f; + } + else + { + if (this.type == 200) + { + this.frameCounter += 3; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame <= 5 || this.frame > 9) + { + this.frame = 6; + } + this.rotation = this.velocity.X * 0.1f; + } + else + { + if (this.type == 208) + { + this.rotation = this.velocity.X * 0.075f; + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 4) + { + this.frame = 1; + } + if (this.frame < 1) + { + this.frame = 1; + } + } + else + { + if (this.type == 236) + { + this.rotation = this.velocity.Y * 0.05f * (float)this.direction; + if (this.velocity.Y < 0f) + { + this.frameCounter += 2; + } + else + { + this.frameCounter++; + } + if (this.frameCounter >= 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 12) + { + this.frame = 9; + } + if (this.frame < 9) + { + this.frame = 9; + } + } + else + { + if (this.type == 210) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.58f; + this.frameCounter += 3; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 11) + { + this.frame = 7; + } + if (this.frame < 7) + { + this.frame = 7; + } + } + else + { + if (this.spriteDirection == -1) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f; + } + } + } + } + } + } + } + } + } + } + if (this.type >= 191 && this.type <= 194) + { + return; + } + if (this.type != 127 && this.type != 200 && this.type != 208 && this.type != 210 && this.type != 236 && this.type != 266 && this.type != 268 && this.type != 269) + { + int num329 = Dust.NewDust(new Vector2(this.position.X + (float)(this.width / 2) - 4f, this.position.Y + (float)(this.height / 2) - 4f) - this.velocity, 8, 8, 16, -this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 50, default(Color), 1.7f); + Main.dust[num329].velocity.X = Main.dust[num329].velocity.X * 0.2f; + Main.dust[num329].velocity.Y = Main.dust[num329].velocity.Y * 0.2f; + Main.dust[num329].noGravity = true; + return; + } + } + else + { + if (this.type >= 191 && this.type <= 194) + { + float num330 = (float)(40 * this.minionPos); + int num331 = 30; + int num332 = 60; + this.localAI[0] -= 1f; + if (this.localAI[0] < 0f) + { + this.localAI[0] = 0f; + } + if (this.ai[1] > 0f) + { + this.ai[1] -= 1f; + } + else + { + float num333 = this.position.X; + float num334 = this.position.Y; + float num335 = 100000f; + float num336 = num335; + int num337 = -1; + for (int num338 = 0; num338 < 200; num338++) + { + if (Main.npc[num338].active && !Main.npc[num338].dontTakeDamage && !Main.npc[num338].friendly && Main.npc[num338].lifeMax > 5) + { + float num339 = Main.npc[num338].position.X + (float)(Main.npc[num338].width / 2); + float num340 = Main.npc[num338].position.Y + (float)(Main.npc[num338].height / 2); + float num341 = Math.Abs(this.position.X + (float)(this.width / 2) - num339) + Math.Abs(this.position.Y + (float)(this.height / 2) - num340); + if (num341 < num335) + { + if (num337 == -1 && num341 <= num336) + { + num336 = num341; + num333 = num339; + num334 = num340; + } + if (Collision.CanHit(this.position, this.width, this.height, Main.npc[num338].position, Main.npc[num338].width, Main.npc[num338].height)) + { + num335 = num341; + num333 = num339; + num334 = num340; + num337 = num338; + } + } + } + } + if (num337 == -1 && num336 < num335) + { + num335 = num336; + } + float num342 = 400f; + if ((double)this.position.Y > Main.worldSurface * 16.0) + { + num342 = 200f; + } + if (num335 < num342 + num330 && num337 == -1) + { + float num343 = num333 - (this.position.X + (float)(this.width / 2)); + if (num343 < -5f) + { + flag8 = true; + flag9 = false; + } + else + { + if (num343 > 5f) + { + flag9 = true; + flag8 = false; + } + } + } + else + { + if (num337 >= 0 && num335 < 800f + num330) + { + this.localAI[0] = (float)num332; + float num344 = num333 - (this.position.X + (float)(this.width / 2)); + if (num344 > 300f || num344 < -300f) + { + if (num344 < -50f) + { + flag8 = true; + flag9 = false; + } + else + { + if (num344 > 50f) + { + flag9 = true; + flag8 = false; + } + } + } + else + { + if (this.owner == Main.myPlayer) + { + this.ai[1] = (float)num331; + float num345 = 12f; + Vector2 vector26 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)(this.height / 2) - 8f); + float num346 = num333 - vector26.X + (float)Main.rand.Next(-20, 21); + float num347 = Math.Abs(num346) * 0.1f; + num347 = num347 * (float)Main.rand.Next(0, 100) * 0.001f; + float num348 = num334 - vector26.Y + (float)Main.rand.Next(-20, 21) - num347; + float num349 = (float)Math.Sqrt((double)(num346 * num346 + num348 * num348)); + num349 = num345 / num349; + num346 *= num349; + num348 *= num349; + int num350 = this.damage; + int num351 = 195; + int num352 = Projectile.NewProjectile(vector26.X, vector26.Y, num346, num348, num351, num350, this.knockBack, Main.myPlayer, 0f, 0f); + Main.projectile[num352].timeLeft = 300; + if (num346 < 0f) + { + this.direction = -1; + } + if (num346 > 0f) + { + this.direction = 1; + } + this.netUpdate = true; + } + } + } + } + } + } + if (this.type == 266) + { + float num353 = (float)(40 * this.minionPos); + int num354 = 60; + this.localAI[0] -= 1f; + if (this.localAI[0] < 0f) + { + this.localAI[0] = 0f; + } + if (this.ai[1] > 0f) + { + this.ai[1] -= 1f; + } + else + { + float num355 = this.position.X; + float num356 = this.position.Y; + float num357 = 100000f; + float num358 = num357; + int num359 = -1; + for (int num360 = 0; num360 < 200; num360++) + { + if (Main.npc[num360].active && !Main.npc[num360].dontTakeDamage && !Main.npc[num360].friendly && Main.npc[num360].lifeMax > 5) + { + float num361 = Main.npc[num360].position.X + (float)(Main.npc[num360].width / 2); + float num362 = Main.npc[num360].position.Y + (float)(Main.npc[num360].height / 2); + float num363 = Math.Abs(this.position.X + (float)(this.width / 2) - num361) + Math.Abs(this.position.Y + (float)(this.height / 2) - num362); + if (num363 < num357) + { + if (num359 == -1 && num363 <= num358) + { + num358 = num363; + num355 = num361; + num356 = num362; + } + if (Collision.CanHit(this.position, this.width, this.height, Main.npc[num360].position, Main.npc[num360].width, Main.npc[num360].height)) + { + num357 = num363; + num355 = num361; + num356 = num362; + num359 = num360; + } + } + } + } + if (num359 == -1 && num358 < num357) + { + num357 = num358; + } + float num364 = 300f; + if ((double)this.position.Y > Main.worldSurface * 16.0) + { + num364 = 150f; + } + if (num357 < num364 + num353 && num359 == -1) + { + float num365 = num355 - (this.position.X + (float)(this.width / 2)); + if (num365 < -5f) + { + flag8 = true; + flag9 = false; + } + else + { + if (num365 > 5f) + { + flag9 = true; + flag8 = false; + } + } + } + if (num359 >= 0 && num357 < 800f + num353) + { + this.friendly = true; + this.localAI[0] = (float)num354; + float num366 = num355 - (this.position.X + (float)(this.width / 2)); + if (num366 < -10f) + { + flag8 = true; + flag9 = false; + } + else + { + if (num366 > 10f) + { + flag9 = true; + flag8 = false; + } + } + if (num356 < this.center().Y - 100f && num366 > -50f && num366 < 50f && this.velocity.Y == 0f) + { + float num367 = Math.Abs(num356 - this.center().Y); + if (num367 < 120f) + { + this.velocity.Y = -10f; + } + else + { + if (num367 < 210f) + { + this.velocity.Y = -13f; + } + else + { + if (num367 < 270f) + { + this.velocity.Y = -15f; + } + else + { + if (num367 < 310f) + { + this.velocity.Y = -17f; + } + else + { + if (num367 < 380f) + { + this.velocity.Y = -18f; + } + } + } + } + } + } + } + else + { + this.friendly = false; + } + } + } + if (this.ai[1] != 0f) + { + flag8 = false; + flag9 = false; + } + else + { + if (this.type >= 191 && this.type <= 195 && this.localAI[0] == 0f) + { + this.direction = Main.player[this.owner].direction; + } + } + if (this.type == 127) + { + if ((double)this.rotation > -0.1 && (double)this.rotation < 0.1) + { + this.rotation = 0f; + } + else + { + if (this.rotation < 0f) + { + this.rotation += 0.1f; + } + else + { + this.rotation -= 0.1f; + } + } + } + else + { + this.rotation = 0f; + } + this.tileCollide = true; + float num368 = 0.08f; + float num369 = 6.5f; + if (this.type == 127) + { + num369 = 2f; + num368 = 0.04f; + } + if (this.type == 112) + { + num369 = 6f; + num368 = 0.06f; + } + if (this.type == 268) + { + num369 = 8f; + num368 = 0.4f; + } + if ((this.type >= 191 && this.type <= 194) || this.type == 266) + { + num369 = 6f; + num368 = 0.2f; + if (num369 < Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y)) + { + num369 = Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y); + num368 = 0.3f; + } + } + if (flag8) + { + if ((double)this.velocity.X > -3.5) + { + this.velocity.X = this.velocity.X - num368; + } + else + { + this.velocity.X = this.velocity.X - num368 * 0.25f; + } + } + else + { + if (flag9) + { + if ((double)this.velocity.X < 3.5) + { + this.velocity.X = this.velocity.X + num368; + } + else + { + this.velocity.X = this.velocity.X + num368 * 0.25f; + } + } + else + { + this.velocity.X = this.velocity.X * 0.9f; + if (this.velocity.X >= -num368 && this.velocity.X <= num368) + { + this.velocity.X = 0f; + } + } + } + if (this.type == 208) + { + this.velocity.X = this.velocity.X * 0.95f; + if ((double)this.velocity.X > -0.1 && (double)this.velocity.X < 0.1) + { + this.velocity.X = 0f; + } + flag8 = false; + flag9 = false; + } + if (flag8 || flag9) + { + int num370 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int j2 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (this.type == 236) + { + num370 += this.direction; + } + if (flag8) + { + num370--; + } + if (flag9) + { + num370++; + } + num370 += (int)this.velocity.X; + if (WorldGen.SolidTile(num370, j2)) + { + flag11 = true; + } + } + if (Main.player[this.owner].position.Y + (float)Main.player[this.owner].height - 8f > this.position.Y + (float)this.height) + { + flag10 = true; + } + if (this.type == 268 && this.frameCounter < 10) + { + flag11 = false; + } + if (this.velocity.Y >= 0f) + { + int num371 = 0; + if (this.velocity.X < 0f) + { + num371 = -1; + } + if (this.velocity.X > 0f) + { + num371 = 1; + } + Vector2 vector27 = this.position; + vector27.X += this.velocity.X; + int num372 = (int)((vector27.X + (float)(this.width / 2) + (float)((this.width / 2 + 1) * num371)) / 16f); + int num373 = (int)((vector27.Y + (float)this.height - 1f) / 16f); + bool flag13 = false; + if (Main.tile[num372, num373] == null) + { + Main.tile[num372, num373] = new Tile(); + } + if (num373 - 1 > 0 && Main.tile[num372, num373 - 1] == null) + { + Main.tile[num372, num373 - 1] = new Tile(); + } + if (num373 - 2 > 0 && Main.tile[num372, num373 - 2] == null) + { + Main.tile[num372, num373 - 2] = new Tile(); + } + if (num373 - 3 > 0 && Main.tile[num372, num373 - 3] == null) + { + Main.tile[num372, num373 - 3] = new Tile(); + } + if (num373 - 4 > 0 && Main.tile[num372, num373 - 4] == null) + { + Main.tile[num372, num373 - 4] = new Tile(); + } + if (num373 - 3 > 0 && Main.tile[num372 - num371, num373 - 3] == null) + { + Main.tile[num372 - num371, num373 - 3] = new Tile(); + } + if ((float)(num372 * 16) < vector27.X + (float)this.width && (float)(num372 * 16 + 16) > vector27.X && ((Main.tile[num372, num373].nactive() && (Main.tile[num372, num373].slope() == 0 || (Main.tile[num372, num373].slope() == 1 && this.position.X + (float)(this.width / 2) < (float)(num372 * 16)) || (Main.tile[num372, num373].slope() == 2 && this.position.X + (float)(this.width / 2) > (float)(num372 * 16 + 16))) && (Main.tile[num372, num373 - 1].slope() == 0 || this.position.Y + (float)this.height > (float)(num373 * 16)) && ((Main.tileSolid[(int)Main.tile[num372, num373].type] && !Main.tileSolidTop[(int)Main.tile[num372, num373].type]) || (flag13 && Main.tileSolidTop[(int)Main.tile[num372, num373].type] && Main.tile[num372, num373].frameY == 0 && (!Main.tileSolid[(int)Main.tile[num372, num373 - 1].type] || !Main.tile[num372, num373 - 1].nactive())))) || (Main.tile[num372, num373 - 1].halfBrick() && Main.tile[num372, num373 - 1].nactive())) && (!Main.tile[num372, num373 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 1].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 1].type] || Main.tile[num372, num373 - 1].slope() != 0 || (Main.tile[num372, num373 - 1].halfBrick() && (!Main.tile[num372, num373 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 4].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 4].type]))) && (!Main.tile[num372, num373 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 2].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 2].type]) && (!Main.tile[num372, num373 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num372, num373 - 3].type] || Main.tileSolidTop[(int)Main.tile[num372, num373 - 3].type]) && (!Main.tile[num372 - num371, num373 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num372 - num371, num373 - 3].type] || Main.tileSolidTop[(int)Main.tile[num372 - num371, num373 - 3].type])) + { + float num374 = (float)(num373 * 16); + if (Main.tile[num372, num373].halfBrick()) + { + num374 += 8f; + } + if (Main.tile[num372, num373 - 1].halfBrick()) + { + num374 -= 8f; + } + if (num374 < vector27.Y + (float)this.height) + { + float num375 = vector27.Y + (float)this.height - num374; + if ((double)num375 <= 16.1) + { + this.gfxOffY += this.position.Y + (float)this.height - num374; + this.position.Y = num374 - (float)this.height; + if (num375 < 9f) + { + this.stepSpeed = 1f; + } + else + { + this.stepSpeed = 2f; + } + } + } + } + } + if (this.velocity.Y == 0f || this.type == 200) + { + if (!flag10 && (this.velocity.X < 0f || this.velocity.X > 0f)) + { + int num376 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int j3 = (int)(this.position.Y + (float)(this.height / 2)) / 16 + 1; + if (flag8) + { + num376--; + } + if (flag9) + { + num376++; + } + WorldGen.SolidTile(num376, j3); + } + if (flag11) + { + int num377 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num378 = (int)(this.position.Y + (float)this.height) / 16 + 1; + if (WorldGen.SolidTile(num377, num378) || Main.tile[num377, num378].halfBrick() || Main.tile[num377, num378].slope() > 0 || this.type == 200) + { + if (this.type == 200) + { + this.velocity.Y = -3.1f; + } + else + { + try + { + num377 = (int)(this.position.X + (float)(this.width / 2)) / 16; + num378 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + if (flag8) + { + num377--; + } + if (flag9) + { + num377++; + } + num377 += (int)this.velocity.X; + if (!WorldGen.SolidTile(num377, num378 - 1) && !WorldGen.SolidTile(num377, num378 - 2)) + { + this.velocity.Y = -5.1f; + } + else + { + if (!WorldGen.SolidTile(num377, num378 - 2)) + { + this.velocity.Y = -7.1f; + } + else + { + if (WorldGen.SolidTile(num377, num378 - 5)) + { + this.velocity.Y = -11.1f; + } + else + { + if (WorldGen.SolidTile(num377, num378 - 4)) + { + this.velocity.Y = -10.1f; + } + else + { + this.velocity.Y = -9.1f; + } + } + } + } + } + catch + { + this.velocity.Y = -9.1f; + } + } + if (this.type == 127) + { + this.ai[0] = 1f; + } + } + } + else + { + if (this.type == 266 && (flag8 || flag9)) + { + this.velocity.Y = this.velocity.Y - 6f; + } + } + } + if (this.velocity.X > num369) + { + this.velocity.X = num369; + } + if (this.velocity.X < -num369) + { + this.velocity.X = -num369; + } + if (this.velocity.X < 0f) + { + this.direction = -1; + } + if (this.velocity.X > 0f) + { + this.direction = 1; + } + if (this.velocity.X > num368 && flag9) + { + this.direction = 1; + } + if (this.velocity.X < -num368 && flag8) + { + this.direction = -1; + } + if (this.direction == -1) + { + this.spriteDirection = 1; + } + if (this.direction == 1) + { + this.spriteDirection = -1; + } + if (this.type >= 191 && this.type <= 194) + { + if (this.ai[1] > 0f) + { + if (this.localAI[1] == 0f) + { + this.localAI[1] = 1f; + this.frame = 1; + } + if (this.frame != 0) + { + this.frameCounter++; + if (this.frameCounter > 4) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame == 4) + { + this.frame = 0; + } + } + } + else + { + if (this.velocity.Y == 0f) + { + this.localAI[1] = 0f; + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame < 5) + { + this.frame = 5; + } + if (this.frame >= 11) + { + this.frame = 5; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0; + this.frame = 4; + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter = 0; + this.frame = 4; + } + } + } + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 268) + { + if (this.velocity.Y == 0f) + { + if (this.frame > 5) + { + this.frameCounter = 0; + } + if (this.velocity.X == 0f) + { + int num379 = 3; + this.frameCounter++; + if (this.frameCounter < num379) + { + this.frame = 0; + } + else + { + if (this.frameCounter < num379 * 2) + { + this.frame = 1; + } + else + { + if (this.frameCounter < num379 * 3) + { + this.frame = 2; + } + else + { + if (this.frameCounter < num379 * 4) + { + this.frame = 3; + } + else + { + this.frameCounter = num379 * 4; + } + } + } + } + } + else + { + this.velocity.X = this.velocity.X * 0.8f; + this.frameCounter++; + int num380 = 3; + if (this.frameCounter < num380) + { + this.frame = 0; + } + else + { + if (this.frameCounter < num380 * 2) + { + this.frame = 1; + } + else + { + if (this.frameCounter < num380 * 3) + { + this.frame = 2; + } + else + { + if (this.frameCounter < num380 * 4) + { + this.frame = 3; + } + else + { + if (flag8 || flag9) + { + this.velocity.X = this.velocity.X * 2f; + this.frame = 4; + this.velocity.Y = -6.1f; + this.frameCounter = 0; + for (int num381 = 0; num381 < 4; num381++) + { + int num382 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), this.width, 4, 5, 0f, 0f, 0, default(Color), 1f); + Main.dust[num382].velocity += this.velocity; + Main.dust[num382].velocity *= 0.4f; + } + } + else + { + this.frameCounter = num380 * 4; + } + } + } + } + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0; + this.frame = 5; + } + else + { + this.frame = 4; + this.frameCounter = 3; + } + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 269) + { + if (this.velocity.Y >= 0f && (double)this.velocity.Y <= 0.8) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8) + { + int num383 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), this.width, 6, 76, 0f, 0f, 0, default(Color), 1f); + Main.dust[num383].noGravity = true; + Main.dust[num383].velocity *= 0.3f; + Main.dust[num383].noLight = true; + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 3) + { + this.frame = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + this.frameCounter = 0; + this.frame = 2; + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 236) + { + if (this.velocity.Y >= 0f && (double)this.velocity.Y <= 0.8) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8) + { + if (this.frame < 2) + { + this.frame = 2; + } + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 8) + { + this.frame = 2; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + this.frameCounter = 0; + this.frame = 1; + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 266) + { + if (this.velocity.Y >= 0f && (double)this.velocity.Y <= 0.8) + { + if (this.velocity.X == 0f) + { + this.frameCounter++; + } + else + { + this.frameCounter += 3; + } + } + else + { + this.frameCounter += 5; + } + if (this.frameCounter >= 20) + { + this.frameCounter -= 20; + this.frame++; + } + if (this.frame > 1) + { + this.frame = 0; + } + if (this.wet && Main.player[this.owner].position.Y + (float)Main.player[this.owner].height < this.position.Y + (float)this.height && this.localAI[0] == 0f) + { + if (this.velocity.Y > -4f) + { + this.velocity.Y = this.velocity.Y - 0.2f; + } + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + } + else + { + this.velocity.Y = this.velocity.Y + 0.4f; + } + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 111) + { + if (this.velocity.Y == 0f) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 7) + { + this.frame = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0; + this.frame = 4; + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter = 0; + this.frame = 6; + } + } + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 112) + { + if (this.velocity.Y == 0f) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.8 || (double)this.velocity.X > 0.8) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 3) + { + this.frame = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + if (this.velocity.Y < 0f) + { + this.frameCounter = 0; + this.frame = 2; + } + else + { + if (this.velocity.Y > 0f) + { + this.frameCounter = 0; + this.frame = 2; + } + } + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 127) + { + if (this.velocity.Y == 0f) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 5) + { + this.frame = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 200) + { + if (this.velocity.Y == 0f) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 5) + { + this.frame = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + this.rotation = this.velocity.X * 0.1f; + this.frameCounter++; + if (this.velocity.Y < 0f) + { + this.frameCounter += 2; + } + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 9) + { + this.frame = 6; + } + if (this.frame < 6) + { + this.frame = 6; + } + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y > 4f) + { + this.velocity.Y = 4f; + return; + } + } + else + { + if (this.type == 208) + { + if (this.velocity.Y == 0f && this.velocity.X == 0f) + { + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) < this.position.X + (float)(this.width / 2)) + { + this.direction = -1; + } + else + { + if (Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) > this.position.X + (float)(this.width / 2)) + { + this.direction = 1; + } + } + this.rotation = 0f; + this.frame = 0; + } + else + { + this.rotation = this.velocity.X * 0.075f; + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 4) + { + this.frame = 1; + } + if (this.frame < 1) + { + this.frame = 1; + } + } + this.velocity.Y = this.velocity.Y + 0.1f; + if (this.velocity.Y > 4f) + { + this.velocity.Y = 4f; + return; + } + } + else + { + if (this.type == 209) + { + if (this.alpha > 0) + { + this.alpha -= 5; + if (this.alpha < 0) + { + this.alpha = 0; + } + } + if (this.velocity.Y == 0f) + { + if (this.velocity.X == 0f) + { + this.frame = 0; + this.frameCounter = 0; + } + else + { + if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 11) + { + this.frame = 2; + } + if (this.frame < 2) + { + this.frame = 2; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + } + else + { + this.frame = 1; + this.frameCounter = 0; + this.rotation = 0f; + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.type == 210) + { + if (this.velocity.Y == 0f) + { + if ((double)this.velocity.X < -0.1 || (double)this.velocity.X > 0.1) + { + this.frameCounter += (int)Math.Abs(this.velocity.X); + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 6) + { + this.frame = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.rotation = this.velocity.X * 0.05f; + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame > 11) + { + this.frame = 7; + } + if (this.frame < 7) + { + this.frame = 7; + } + } + this.velocity.Y = this.velocity.Y + 0.4f; + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (this.aiStyle == 27) + { + if (this.type == 115) + { + this.ai[0] += 1f; + if (this.ai[0] < 30f) + { + this.velocity *= 1.125f; + } + } + if (this.type == 115 && this.localAI[1] < 5f) + { + this.localAI[1] = 5f; + for (int num384 = 5; num384 < 25; num384++) + { + float num385 = this.velocity.X * (30f / (float)num384); + float num386 = this.velocity.Y * (30f / (float)num384); + num385 *= 80f; + num386 *= 80f; + int num387 = Dust.NewDust(new Vector2(this.position.X - num385, this.position.Y - num386), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 0.9f); + Main.dust[num387].velocity *= 0.25f; + Main.dust[num387].velocity -= this.velocity * 5f; + } + } + if (this.localAI[1] > 7f && this.type == 173) + { + int num388 = Main.rand.Next(3); + if (num388 == 0) + { + num388 = 15; + } + else + { + if (num388 == 1) + { + num388 = 57; + } + else + { + num388 = 58; + } + } + int num389 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, num388, 0f, 0f, 100, default(Color), 1.25f); + Main.dust[num389].velocity *= 0.1f; + } + if (this.localAI[1] > 7f && this.type == 132) + { + int num390 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.25f); + Main.dust[num390].velocity *= -0.25f; + num390 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 4f + 2f, this.position.Y + 2f - this.velocity.Y * 4f), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.25f); + Main.dust[num390].velocity *= -0.25f; + Main.dust[num390].position -= this.velocity * 0.5f; + } + if (this.localAI[1] < 15f) + { + this.localAI[1] += 1f; + } + else + { + if (this.type == 114 || this.type == 115) + { + int num391 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 4f), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 0.6f); + Main.dust[num391].velocity *= -0.25f; + } + else + { + if (this.type == 116) + { + int num392 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 5f + 2f, this.position.Y + 2f - this.velocity.Y * 5f), 8, 8, 64, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.5f); + Main.dust[num392].velocity *= -0.25f; + Main.dust[num392].noGravity = true; + } + } + if (this.localAI[0] == 0f) + { + this.scale -= 0.02f; + this.alpha += 30; + if (this.alpha >= 250) + { + this.alpha = 255; + this.localAI[0] = 1f; + } + } + else + { + if (this.localAI[0] == 1f) + { + this.scale += 0.02f; + this.alpha -= 30; + if (this.alpha <= 0) + { + this.alpha = 0; + this.localAI[0] = 0f; + } + } + } + } + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + if (this.type == 157) + { + this.rotation += (float)this.direction * 0.4f; + this.spriteDirection = this.direction; + } + else + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 0.785f; + } + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + return; + } + } + else + { + if (this.aiStyle == 28) + { + if (this.type == 177) + { + for (int num393 = 0; num393 < 3; num393++) + { + int num394 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 137, this.velocity.X, this.velocity.Y, Main.rand.Next(0, 101), default(Color), 1f + (float)Main.rand.Next(-20, 40) * 0.01f); + Main.dust[num394].noGravity = true; + Main.dust[num394].velocity *= 0.3f; + } + } + if (this.type == 118) + { + for (int num395 = 0; num395 < 2; num395++) + { + int num396 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f); + Main.dust[num396].noGravity = true; + Main.dust[num396].velocity *= 0.3f; + } + } + if (this.type == 119 || this.type == 128) + { + for (int num397 = 0; num397 < 3; num397++) + { + int num398 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f); + Main.dust[num398].noGravity = true; + Main.dust[num398].velocity *= 0.3f; + } + } + if (this.type == 309) + { + for (int num399 = 0; num399 < 3; num399++) + { + int num400 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 185, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f); + Main.dust[num400].noGravity = true; + Main.dust[num400].velocity *= 0.3f; + } + } + if (this.type == 129) + { + for (int num401 = 0; num401 < 6; num401++) + { + int num402 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 106, this.velocity.X, this.velocity.Y, 100, default(Color), 1f); + Main.dust[num402].noGravity = true; + Main.dust[num402].velocity *= 0.1f + (float)Main.rand.Next(4) * 0.1f; + Main.dust[num402].scale *= 1f + (float)Main.rand.Next(5) * 0.1f; + } + } + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 28); + return; + } + } + else + { + if (this.aiStyle == 29) + { + int num403 = this.type - 121 + 86; + for (int num404 = 0; num404 < 2; num404++) + { + int num405 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num403, this.velocity.X, this.velocity.Y, 50, default(Color), 1.2f); + Main.dust[num405].noGravity = true; + Main.dust[num405].velocity *= 0.3f; + } + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + return; + } + } + else + { + if (this.aiStyle == 30) + { + this.velocity *= 0.8f; + this.rotation += 0.2f; + this.alpha += 4; + if (this.alpha >= 255) + { + this.Kill(); + return; + } + } + else + { + if (this.aiStyle == 31) + { + int num406 = 110; + int num407 = 0; + if (this.type == 146) + { + num406 = 111; + num407 = 2; + } + if (this.type == 147) + { + num406 = 112; + num407 = 1; + } + if (this.type == 148) + { + num406 = 113; + num407 = 3; + } + if (this.type == 149) + { + num406 = 114; + num407 = 4; + } + if (this.owner == Main.myPlayer) + { + WorldGen.Convert((int)(this.position.X + (float)(this.width / 2)) / 16, (int)(this.position.Y + (float)(this.height / 2)) / 16, num407, 2); + } + if (this.timeLeft > 133) + { + this.timeLeft = 133; + } + if (this.ai[0] > 7f) + { + float num408 = 1f; + if (this.ai[0] == 8f) + { + num408 = 0.2f; + } + else + { + if (this.ai[0] == 9f) + { + num408 = 0.4f; + } + else + { + if (this.ai[0] == 10f) + { + num408 = 0.6f; + } + else + { + if (this.ai[0] == 11f) + { + num408 = 0.8f; + } + } + } + } + this.ai[0] += 1f; + for (int num409 = 0; num409 < 1; num409++) + { + int num410 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num406, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num410].noGravity = true; + Main.dust[num410].scale *= 1.75f; + Dust expr_1352D_cp_0 = Main.dust[num410]; + expr_1352D_cp_0.velocity.X = expr_1352D_cp_0.velocity.X * 2f; + Dust expr_1354D_cp_0 = Main.dust[num410]; + expr_1354D_cp_0.velocity.Y = expr_1354D_cp_0.velocity.Y * 2f; + Main.dust[num410].scale *= num408; + } + } + else + { + this.ai[0] += 1f; + } + this.rotation += 0.3f * (float)this.direction; + return; + } + if (this.aiStyle == 32) + { + this.timeLeft = 10; + this.ai[0] += 1f; + if (this.ai[0] >= 20f) + { + this.ai[0] = 15f; + for (int num411 = 0; num411 < 255; num411++) + { + Rectangle rectangle2 = new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height); + if (Main.player[num411].active) + { + Rectangle value3 = new Rectangle((int)Main.player[num411].position.X, (int)Main.player[num411].position.Y, Main.player[num411].width, Main.player[num411].height); + if (rectangle2.Intersects(value3)) + { + this.ai[0] = 0f; + this.velocity.Y = -4.5f; + if (this.velocity.X > 2f) + { + this.velocity.X = 2f; + } + if (this.velocity.X < -2f) + { + this.velocity.X = -2f; + } + this.velocity.X = (this.velocity.X + (float)Main.player[num411].direction * 1.75f) / 2f; + this.velocity.X = this.velocity.X + Main.player[num411].velocity.X * 3f; + this.velocity.Y = this.velocity.Y + Main.player[num411].velocity.Y; + if (this.velocity.X > 6f) + { + this.velocity.X = 6f; + } + if (this.velocity.X < -6f) + { + this.velocity.X = -6f; + } + this.netUpdate = true; + this.ai[1] += 1f; + } + } + } + } + if (this.velocity.X == 0f && this.velocity.Y == 0f) + { + this.Kill(); + } + this.rotation += 0.02f * this.velocity.X; + if (this.velocity.Y == 0f) + { + this.velocity.X = this.velocity.X * 0.98f; + } + else + { + if (this.wet) + { + this.velocity.X = this.velocity.X * 0.99f; + } + else + { + this.velocity.X = this.velocity.X * 0.995f; + } + } + if ((double)this.velocity.X > -0.03 && (double)this.velocity.X < 0.03) + { + this.velocity.X = 0f; + } + if (this.wet) + { + this.ai[1] = 0f; + if (this.velocity.Y > 0f) + { + this.velocity.Y = this.velocity.Y * 0.95f; + } + this.velocity.Y = this.velocity.Y - 0.1f; + if (this.velocity.Y < -4f) + { + this.velocity.Y = -4f; + } + if (this.velocity.X == 0f) + { + this.Kill(); + } + } + else + { + this.velocity.Y = this.velocity.Y + 0.1f; + } + if (this.velocity.Y > 10f) + { + this.velocity.Y = 10f; + return; + } + } + else + { + if (this.aiStyle == 33) + { + if (this.alpha > 0) + { + this.alpha -= 50; + if (this.alpha < 0) + { + this.alpha = 0; + } + } + float num412 = 4f; + float num413 = this.ai[0]; + float num414 = this.ai[1]; + if (num413 == 0f && num414 == 0f) + { + num413 = 1f; + } + float num415 = (float)Math.Sqrt((double)(num413 * num413 + num414 * num414)); + num415 = num412 / num415; + num413 *= num415; + num414 *= num415; + if (this.alpha < 70) + { + int num416 = 127; + if (this.type == 310) + { + num416 = 187; + } + int num417 = Dust.NewDust(new Vector2(this.position.X, this.position.Y - 2f), 6, 6, num416, this.velocity.X, this.velocity.Y, 100, default(Color), 1.6f); + Main.dust[num417].noGravity = true; + Dust expr_13B42_cp_0 = Main.dust[num417]; + expr_13B42_cp_0.position.X = expr_13B42_cp_0.position.X - num413 * 1f; + Dust expr_13B67_cp_0 = Main.dust[num417]; + expr_13B67_cp_0.position.Y = expr_13B67_cp_0.position.Y - num414 * 1f; + Dust expr_13B8C_cp_0 = Main.dust[num417]; + expr_13B8C_cp_0.velocity.X = expr_13B8C_cp_0.velocity.X - num413; + Dust expr_13BAB_cp_0 = Main.dust[num417]; + expr_13BAB_cp_0.velocity.Y = expr_13BAB_cp_0.velocity.Y - num414; + } + if (this.localAI[0] == 0f) + { + this.ai[0] = this.velocity.X; + this.ai[1] = this.velocity.Y; + this.localAI[1] += 1f; + if (this.localAI[1] >= 30f) + { + this.velocity.Y = this.velocity.Y + 0.09f; + this.localAI[1] = 30f; + } + } + else + { + if (!Collision.SolidCollision(this.position, this.width, this.height)) + { + this.localAI[0] = 0f; + this.localAI[1] = 30f; + } + this.damage = 0; + } + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + } + this.rotation = (float)Math.Atan2((double)this.ai[1], (double)this.ai[0]) + 1.57f; + return; + } + if (this.aiStyle == 34) + { + int num418 = Dust.NewDust(new Vector2(this.position.X + 2f, this.position.Y + 20f), 8, 8, 6, this.velocity.X, this.velocity.Y, 100, default(Color), 1.2f); + Main.dust[num418].noGravity = true; + Main.dust[num418].velocity *= 0.2f; + return; + } + if (this.aiStyle == 35) + { + this.ai[0] += 1f; + if (this.ai[0] > 30f) + { + this.velocity.Y = this.velocity.Y + 0.2f; + this.velocity.X = this.velocity.X * 0.985f; + if (this.velocity.Y > 14f) + { + this.velocity.Y = 14f; + } + } + this.rotation += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * (float)this.direction * 0.02f; + if (this.owner == Main.myPlayer) + { + Vector2 vector28 = Collision.TileCollision(this.position, this.velocity, this.width, this.height, true, true); + if (vector28 != this.velocity) + { + this.position += vector28; + int num419 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num420 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + int num421 = 10; + if (Main.tile[num419, num420] != null) + { + while (Main.tile[num419, num420] != null && Main.tile[num419, num420].active()) + { + if (!Main.tileRope[(int)Main.tile[num419, num420].type]) + { + break; + } + num420++; + } + while (num421 > 0) + { + num421--; + if (Main.tile[num419, num420] == null) + { + break; + } + if (Main.tile[num419, num420].active() && (Main.tileCut[(int)Main.tile[num419, num420].type] || Main.tile[num419, num420].type == 165)) + { + WorldGen.KillTile(num419, num420, false, false, false); + NetMessage.SendData(17, -1, -1, "", 0, (float)num419, (float)num420, 0f, 0); + } + if (!Main.tile[num419, num420].active()) + { + WorldGen.PlaceTile(num419, num420, 213, false, false, -1, 0); + NetMessage.SendData(17, -1, -1, "", 1, (float)num419, (float)num420, 213f, 0); + this.ai[1] += 1f; + } + else + { + num421 = 0; + } + num420++; + } + this.Kill(); + return; + } + } + } + } + else + { + if (this.aiStyle == 36) + { + if (this.type != 307 && this.wet && !this.honeyWet) + { + this.Kill(); + } + if (this.alpha > 0) + { + this.alpha -= 50; + } + else + { + this.maxUpdates = 0; + } + if (this.alpha < 0) + { + this.alpha = 0; + } + if (this.type == 307) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + this.frameCounter++; + if (this.frameCounter >= 6) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 2) + { + this.frame = 0; + } + for (int num422 = 0; num422 < 3; num422++) + { + float num423 = this.velocity.X / 3f * (float)num422; + float num424 = this.velocity.Y / 3f * (float)num422; + int num425 = Dust.NewDust(this.position, this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f); + Main.dust[num425].position.X = this.center().X - num423; + Main.dust[num425].position.Y = this.center().Y - num424; + Main.dust[num425].velocity *= 0f; + Main.dust[num425].scale = 0.5f; + } + } + else + { + if (this.velocity.X > 0f) + { + this.spriteDirection = 1; + } + else + { + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + } + } + this.rotation = this.velocity.X * 0.1f; + this.frameCounter++; + if (this.frameCounter >= 3) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 3) + { + this.frame = 0; + } + } + float num426 = this.position.X; + float num427 = this.position.Y; + float num428 = 100000f; + bool flag14 = false; + this.ai[0] += 1f; + if (this.ai[0] > 30f) + { + this.ai[0] = 30f; + for (int num429 = 0; num429 < 200; num429++) + { + if (Main.npc[num429].active && !Main.npc[num429].dontTakeDamage && !Main.npc[num429].friendly && Main.npc[num429].lifeMax > 5 && (!Main.npc[num429].wet || this.type == 307)) + { + float num430 = Main.npc[num429].position.X + (float)(Main.npc[num429].width / 2); + float num431 = Main.npc[num429].position.Y + (float)(Main.npc[num429].height / 2); + float num432 = Math.Abs(this.position.X + (float)(this.width / 2) - num430) + Math.Abs(this.position.Y + (float)(this.height / 2) - num431); + if (num432 < 800f && num432 < num428 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num429].position, Main.npc[num429].width, Main.npc[num429].height)) + { + num428 = num432; + num426 = num430; + num427 = num431; + flag14 = true; + } + } + } + } + if (!flag14) + { + num426 = this.position.X + (float)(this.width / 2) + this.velocity.X * 100f; + num427 = this.position.Y + (float)(this.height / 2) + this.velocity.Y * 100f; + } + else + { + if (this.type == 307) + { + this.friendly = true; + } + } + float num433 = 6f; + float num434 = 0.1f; + if (this.type == 189) + { + num433 = 7f; + num434 = 0.15f; + } + if (this.type == 307) + { + num433 = 9f; + num434 = 0.2f; + } + Vector2 vector29 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num435 = num426 - vector29.X; + float num436 = num427 - vector29.Y; + float num437 = (float)Math.Sqrt((double)(num435 * num435 + num436 * num436)); + num437 = num433 / num437; + num435 *= num437; + num436 *= num437; + if (this.velocity.X < num435) + { + this.velocity.X = this.velocity.X + num434; + if (this.velocity.X < 0f && num435 > 0f) + { + this.velocity.X = this.velocity.X + num434 * 2f; + } + } + else + { + if (this.velocity.X > num435) + { + this.velocity.X = this.velocity.X - num434; + if (this.velocity.X > 0f && num435 < 0f) + { + this.velocity.X = this.velocity.X - num434 * 2f; + } + } + } + if (this.velocity.Y < num436) + { + this.velocity.Y = this.velocity.Y + num434; + if (this.velocity.Y < 0f && num436 > 0f) + { + this.velocity.Y = this.velocity.Y + num434 * 2f; + return; + } + } + else + { + if (this.velocity.Y > num436) + { + this.velocity.Y = this.velocity.Y - num434; + if (this.velocity.Y > 0f && num436 < 0f) + { + this.velocity.Y = this.velocity.Y - num434 * 2f; + return; + } + } + } + } + else + { + if (this.aiStyle == 37) + { + if (this.ai[1] == 0f) + { + this.ai[1] = this.position.Y - 5f; + } + if (this.ai[0] == 0f) + { + if (Collision.SolidCollision(this.position, this.width, this.height)) + { + this.velocity.Y = this.velocity.Y * -1f; + this.ai[0] += 1f; + return; + } + float num438 = this.position.Y - this.ai[1]; + if (num438 > 300f) + { + this.velocity.Y = this.velocity.Y * -1f; + this.ai[0] += 1f; + return; + } + } + else + { + if (Collision.SolidCollision(this.position, this.width, this.height)) + { + this.Kill(); + return; + } + } + } + else + { + if (this.aiStyle == 38) + { + this.ai[0] += 1f; + if (this.ai[0] >= 6f) + { + this.ai[0] = 0f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 34); + if (Main.myPlayer == this.owner) + { + Projectile.NewProjectile(this.position.X, this.position.Y, this.velocity.X, this.velocity.Y, 188, this.damage, this.knockBack, this.owner, 0f, 0f); + return; + } + } + } + else + { + if (this.aiStyle == 39) + { + this.alpha -= 50; + if (this.alpha < 0) + { + this.alpha = 0; + } + if (Main.player[this.owner].dead) + { + this.Kill(); + return; + } + if (this.alpha == 0) + { + Main.player[this.owner].itemAnimation = 5; + Main.player[this.owner].itemTime = 5; + if (this.position.X + (float)(this.width / 2) > Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2)) + { + Main.player[this.owner].ChangeDir(1); + } + else + { + Main.player[this.owner].ChangeDir(-1); + } + } + Vector2 vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num439 = Main.player[this.owner].position.X + (float)(Main.player[this.owner].width / 2) - vector30.X; + float num440 = Main.player[this.owner].position.Y + (float)(Main.player[this.owner].height / 2) - vector30.Y; + float num441 = (float)Math.Sqrt((double)(num439 * num439 + num440 * num440)); + if (!Main.player[this.owner].channel && this.alpha == 0) + { + this.ai[0] = 1f; + this.ai[1] = -1f; + } + if (this.ai[1] > 0f && num441 > 1500f) + { + this.ai[1] = 0f; + this.ai[0] = 1f; + } + if (this.ai[1] > 0f) + { + this.tileCollide = false; + int num442 = (int)this.ai[1] - 1; + if (Main.npc[num442].active && Main.npc[num442].life > 0) + { + float num443 = 16f; + vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num439 = Main.npc[num442].position.X + (float)(Main.npc[num442].width / 2) - vector30.X; + num440 = Main.npc[num442].position.Y + (float)(Main.npc[num442].height / 2) - vector30.Y; + num441 = (float)Math.Sqrt((double)(num439 * num439 + num440 * num440)); + if (num441 < num443) + { + this.velocity.X = num439; + this.velocity.Y = num440; + if (num441 > num443 / 2f) + { + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + } + else + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + } + } + else + { + num441 = num443 / num441; + num439 *= num441; + num440 *= num441; + this.velocity.X = num439; + this.velocity.Y = num440; + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + } + else + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + } + this.ai[0] = 1f; + } + else + { + this.ai[1] = 0f; + float num444 = this.position.X; + float num445 = this.position.Y; + float num446 = 3000f; + int num447 = -1; + for (int num448 = 0; num448 < 200; num448++) + { + if (Main.npc[num448].active && !Main.npc[num448].friendly && Main.npc[num448].lifeMax > 5) + { + float num449 = Main.npc[num448].position.X + (float)(Main.npc[num448].width / 2); + float num450 = Main.npc[num448].position.Y + (float)(Main.npc[num448].height / 2); + float num451 = Math.Abs(this.position.X + (float)(this.width / 2) - num449) + Math.Abs(this.position.Y + (float)(this.height / 2) - num450); + if (num451 < num446 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num448].position, Main.npc[num448].width, Main.npc[num448].height)) + { + num446 = num451; + num444 = num449; + num445 = num450; + num447 = num448; + } + } + } + if (num447 >= 0) + { + float num452 = 16f; + vector30 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + num439 = num444 - vector30.X; + num440 = num445 - vector30.Y; + num441 = (float)Math.Sqrt((double)(num439 * num439 + num440 * num440)); + num441 = num452 / num441; + num439 *= num441; + num440 *= num441; + this.velocity.X = num439; + this.velocity.Y = num440; + this.ai[0] = 0f; + this.ai[1] = (float)(num447 + 1); + } + } + } + else + { + if (this.ai[0] == 0f) + { + if (num441 > 700f) + { + this.ai[0] = 1f; + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + } + else + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + } + else + { + if (this.ai[0] == 1f) + { + this.tileCollide = false; + if (this.velocity.X < 0f) + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + } + else + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + if (this.velocity.X < 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)(-(double)this.velocity.Y), (double)(-(double)this.velocity.X)); + } + else + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X); + } + float num453 = 20f; + if (num441 < 70f) + { + this.Kill(); + } + num441 = num453 / num441; + num439 *= num441; + num440 *= num441; + this.velocity.X = num439; + this.velocity.Y = num440; + } + } + } + this.frameCounter++; + if (this.frameCounter >= 4) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 4) + { + this.frame = 0; + return; + } + } + else + { + if (this.aiStyle == 40) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 3f) + { + this.localAI[0] = 100f; + this.alpha -= 50; + if (this.alpha < 0) + { + this.alpha = 0; + } + } + this.frameCounter++; + if (this.frameCounter >= 3) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= 5) + { + this.frame = 0; + } + this.velocity.X = this.velocity.X + this.ai[0]; + this.velocity.Y = this.velocity.Y + this.ai[1]; + this.localAI[1] += 1f; + if (this.localAI[1] == 50f) + { + this.localAI[1] = 51f; + this.ai[0] = (float)Main.rand.Next(-100, 101) * 6E-05f; + this.ai[1] = (float)Main.rand.Next(-100, 101) * 6E-05f; + } + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) > 16f) + { + this.velocity.X = this.velocity.X * 0.95f; + this.velocity.Y = this.velocity.Y * 0.95f; + } + if (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y) < 12f) + { + this.velocity.X = this.velocity.X * 1.05f; + this.velocity.Y = this.velocity.Y * 1.05f; + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f; + return; + } + if (this.aiStyle == 41) + { + if (this.localAI[0] == 0f) + { + this.localAI[0] = 1f; + this.frame = Main.rand.Next(3); + } + this.rotation += this.velocity.X * 0.01f; + return; + } + if (this.aiStyle == 42) + { + if (!Main.player[this.owner].crystalLeaf) + { + this.Kill(); + return; + } + this.position.X = Main.player[this.owner].center().X - (float)(this.width / 2); + this.position.Y = Main.player[this.owner].center().Y - (float)(this.height / 2) + Main.player[this.owner].gfxOffY - 60f; + if (Main.player[this.owner].gravDir == -1f) + { + this.position.Y = this.position.Y + 120f; + this.rotation = 3.14f; + } + else + { + this.rotation = 0f; + } + this.position.X = (float)((int)this.position.X); + this.position.Y = (float)((int)this.position.Y); + float num454 = (float)Main.mouseTextColor / 200f - 0.35f; + num454 *= 0.2f; + this.scale = num454 + 0.95f; + if (this.owner == Main.myPlayer) + { + if (this.ai[0] != 0f) + { + this.ai[0] -= 1f; + return; + } + float num455 = this.position.X; + float num456 = this.position.Y; + float num457 = 700f; + bool flag15 = false; + for (int num458 = 0; num458 < 200; num458++) + { + if (Main.npc[num458].active && !Main.npc[num458].friendly && Main.npc[num458].lifeMax > 5) + { + float num459 = Main.npc[num458].position.X + (float)(Main.npc[num458].width / 2); + float num460 = Main.npc[num458].position.Y + (float)(Main.npc[num458].height / 2); + float num461 = Math.Abs(this.position.X + (float)(this.width / 2) - num459) + Math.Abs(this.position.Y + (float)(this.height / 2) - num460); + if (num461 < num457 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num458].position, Main.npc[num458].width, Main.npc[num458].height)) + { + num457 = num461; + num455 = num459; + num456 = num460; + flag15 = true; + } + } + } + if (flag15) + { + float num462 = 12f; + Vector2 vector31 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num463 = num455 - vector31.X; + float num464 = num456 - vector31.Y; + float num465 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + num465 = num462 / num465; + num463 *= num465; + num464 *= num465; + Projectile.NewProjectile(this.center().X - 4f, this.center().Y, num463, num464, 227, 40, 5f, this.owner, 0f, 0f); + this.ai[0] = 60f; + return; + } + } + } + else + { + if (this.aiStyle == 43) + { + if (this.localAI[1] == 0f) + { + Main.PlaySound(6, (int)this.position.X, (int)this.position.Y, 1); + this.localAI[1] += 1f; + for (int num466 = 0; num466 < 5; num466++) + { + int num467 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f); + Main.dust[num467].noGravity = true; + Main.dust[num467].velocity *= 3f; + Main.dust[num467].scale = 1.5f; + } + } + this.ai[0] = (float)Main.rand.Next(-100, 101) * 0.0025f; + this.ai[1] = (float)Main.rand.Next(-100, 101) * 0.0025f; + if (this.localAI[0] == 0f) + { + this.scale += 0.05f; + if ((double)this.scale > 1.2) + { + this.localAI[0] = 1f; + } + } + else + { + this.scale -= 0.05f; + if ((double)this.scale < 0.8) + { + this.localAI[0] = 0f; + } + } + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 3.14f; + int num468 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f); + Main.dust[num468].noGravity = true; + Main.dust[num468].velocity *= 0.1f; + Main.dust[num468].scale = 1.5f; + return; + } + if (this.aiStyle == 44) + { + if (this.type == 228) + { + this.velocity *= 0.96f; + this.alpha += 4; + if (this.alpha > 255) + { + this.Kill(); + } + } + else + { + if (this.type == 229) + { + if (this.ai[0] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + this.ai[0] += 1f; + if (this.ai[0] > 20f) + { + this.velocity.Y = this.velocity.Y + 0.3f; + this.velocity.X = this.velocity.X * 0.98f; + } + } + } + this.frameCounter++; + if (this.frameCounter > 5) + { + this.frame++; + this.frameCounter = 0; + } + if (this.frame >= Main.projFrames[this.type]) + { + this.frame = 0; + return; + } + } + else + { + if (this.aiStyle == 45) + { + if (this.type == 237 || this.type == 243) + { + float num469 = this.ai[0]; + float num470 = this.ai[1]; + if (num469 != 0f && num470 != 0f) + { + bool flag16 = false; + bool flag17 = false; + if ((this.velocity.X < 0f && this.center().X < num469) || (this.velocity.X > 0f && this.center().X > num469)) + { + flag16 = true; + } + if ((this.velocity.Y < 0f && this.center().Y < num470) || (this.velocity.Y > 0f && this.center().Y > num470)) + { + flag17 = true; + } + if (flag16 && flag17) + { + this.Kill(); + } + } + this.rotation += this.velocity.X * 0.02f; + this.frameCounter++; + if (this.frameCounter > 4) + { + this.frameCounter = 0; + this.frame++; + if (this.frame > 3) + { + this.frame = 0; + return; + } + } + } + else + { + if (this.type == 238 || this.type == 244) + { + this.frameCounter++; + if (this.frameCounter > 8) + { + this.frameCounter = 0; + this.frame++; + if (this.frame > 5) + { + this.frame = 0; + } + } + this.ai[1] += 1f; + if (this.type == 244 && this.ai[1] >= 1800f) + { + this.alpha += 5; + if (this.alpha > 255) + { + this.alpha = 255; + this.Kill(); + } + } + else + { + if (this.type == 238 && this.ai[1] >= 3600f) + { + this.alpha += 5; + if (this.alpha > 255) + { + this.alpha = 255; + this.Kill(); + } + } + else + { + this.ai[0] += 1f; + if (this.type == 244) + { + if (this.ai[0] > 10f) + { + this.ai[0] = 0f; + if (this.owner == Main.myPlayer) + { + int num471 = (int)(this.position.X + 14f + (float)Main.rand.Next(this.width - 28)); + int num472 = (int)(this.position.Y + (float)this.height + 4f); + Projectile.NewProjectile((float)num471, (float)num472, 0f, 5f, 245, this.damage, 0f, this.owner, 0f, 0f); + } + } + } + else + { + if (this.ai[0] > 8f) + { + this.ai[0] = 0f; + if (this.owner == Main.myPlayer) + { + int num473 = (int)(this.position.X + 14f + (float)Main.rand.Next(this.width - 28)); + int num474 = (int)(this.position.Y + (float)this.height + 4f); + Projectile.NewProjectile((float)num473, (float)num474, 0f, 5f, 239, this.damage, 0f, this.owner, 0f, 0f); + } + } + } + } + } + this.localAI[0] += 1f; + if (this.localAI[0] >= 10f) + { + this.localAI[0] = 0f; + int num475 = 0; + int num476 = 0; + float num477 = 0f; + int num478 = this.type; + for (int num479 = 0; num479 < 1000; num479++) + { + if (Main.projectile[num479].active && Main.projectile[num479].owner == this.owner && Main.projectile[num479].type == num478 && Main.projectile[num479].ai[1] < 3600f) + { + num475++; + if (Main.projectile[num479].ai[1] > num477) + { + num476 = num479; + num477 = Main.projectile[num479].ai[1]; + } + } + } + if (this.type == 244) + { + if (num475 > 1) + { + Main.projectile[num476].netUpdate = true; + Main.projectile[num476].ai[1] = 36000f; + return; + } + } + else + { + if (num475 > 2) + { + Main.projectile[num476].netUpdate = true; + Main.projectile[num476].ai[1] = 36000f; + return; + } + } + } + } + else + { + if (this.type == 239) + { + this.alpha = 50; + return; + } + if (this.type == 245) + { + this.alpha = 100; + return; + } + if (this.type == 264) + { + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) + 1.57f; + return; + } + } + } + } + else + { + if (this.aiStyle == 46) + { + if (this.type == 250) + { + if (this.owner == Main.myPlayer) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 4f) + { + this.localAI[0] = 3f; + Projectile.NewProjectile(this.center().X, this.center().Y, this.velocity.X * 0.001f, this.velocity.Y * 0.001f, 251, this.damage, this.knockBack, this.owner, 0f, 0f); + } + if (this.timeLeft > 150) + { + this.timeLeft = 150; + } + } + float num480 = 1f; + if (this.velocity.Y < 0f) + { + num480 -= this.velocity.Y / 3f; + } + this.ai[0] += num480; + if (this.ai[0] > 30f) + { + this.velocity.Y = this.velocity.Y + 0.5f; + if (this.velocity.Y > 0f) + { + this.velocity.X = this.velocity.X * 0.95f; + } + else + { + this.velocity.X = this.velocity.X * 1.05f; + } + } + float num481 = this.velocity.X; + float num482 = this.velocity.Y; + float num483 = (float)Math.Sqrt((double)(num481 * num481 + num482 * num482)); + num483 = 15.95f * this.scale / num483; + num481 *= num483; + num482 *= num483; + this.velocity.X = num481; + this.velocity.Y = num482; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + return; + } + int num484 = 300; + if (this.localAI[0] == 0f) + { + if (this.velocity.X > 0f) + { + this.spriteDirection = -1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + else + { + this.spriteDirection = 1; + this.rotation = (float)Math.Atan2((double)this.velocity.Y, (double)this.velocity.X) - 1.57f; + } + this.localAI[0] = 1f; + this.timeLeft = num484; + } + this.velocity.X = this.velocity.X * 0.98f; + this.velocity.Y = this.velocity.Y * 0.98f; + if (this.rotation == 0f) + { + this.alpha = 255; + return; + } + if (this.timeLeft < 10) + { + this.alpha = 255 - (int)(255f * (float)this.timeLeft / 10f); + return; + } + if (this.timeLeft > num484 - 10) + { + int num485 = num484 - this.timeLeft; + this.alpha = 255 - (int)(255f * (float)num485 / 10f); + return; + } + this.alpha = 0; + return; + } + else + { + if (this.aiStyle == 47) + { + if (this.ai[0] == 0f) + { + this.ai[0] = this.velocity.X; + this.ai[1] = this.velocity.Y; + } + if (this.velocity.X > 0f) + { + this.rotation += (Math.Abs(this.velocity.Y) + Math.Abs(this.velocity.X)) * 0.001f; + } + else + { + this.rotation -= (Math.Abs(this.velocity.Y) + Math.Abs(this.velocity.X)) * 0.001f; + } + this.frameCounter++; + if (this.frameCounter > 6) + { + this.frameCounter = 0; + this.frame++; + if (this.frame > 4) + { + this.frame = 0; + } + } + if (Math.Sqrt((double)(this.velocity.X * this.velocity.X + this.velocity.Y * this.velocity.Y)) > 2.0) + { + this.velocity *= 0.98f; + } + for (int num486 = 0; num486 < 1000; num486++) + { + if (num486 != this.whoAmI && Main.projectile[num486].active && Main.projectile[num486].owner == this.owner && Main.projectile[num486].type == this.type && this.timeLeft > Main.projectile[num486].timeLeft && Main.projectile[num486].timeLeft > 30) + { + Main.projectile[num486].timeLeft = 30; + } + } + int[] array = new int[20]; + int num487 = 0; + float num488 = 300f; + bool flag18 = false; + for (int num489 = 0; num489 < 200; num489++) + { + if (Main.npc[num489].active && !Main.npc[num489].dontTakeDamage && !Main.npc[num489].friendly && Main.npc[num489].lifeMax > 5) + { + float num490 = Main.npc[num489].position.X + (float)(Main.npc[num489].width / 2); + float num491 = Main.npc[num489].position.Y + (float)(Main.npc[num489].height / 2); + float num492 = Math.Abs(this.position.X + (float)(this.width / 2) - num490) + Math.Abs(this.position.Y + (float)(this.height / 2) - num491); + if (num492 < num488 && Collision.CanHit(this.center(), 1, 1, Main.npc[num489].center(), 1, 1)) + { + if (num487 < 20) + { + array[num487] = num489; + num487++; + } + flag18 = true; + } + } + } + if (this.timeLeft < 30) + { + flag18 = false; + } + if (flag18) + { + int num493 = Main.rand.Next(num487); + num493 = array[num493]; + float num494 = Main.npc[num493].position.X + (float)(Main.npc[num493].width / 2); + float num495 = Main.npc[num493].position.Y + (float)(Main.npc[num493].height / 2); + this.localAI[0] += 1f; + if (this.localAI[0] > 8f) + { + this.localAI[0] = 0f; + float num496 = 6f; + Vector2 value4 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + value4 += this.velocity * 4f; + float num497 = num494 - value4.X; + float num498 = num495 - value4.Y; + float num499 = (float)Math.Sqrt((double)(num497 * num497 + num498 * num498)); + num499 = num496 / num499; + num497 *= num499; + num498 *= num499; + Projectile.NewProjectile(value4.X, value4.Y, num497, num498, 255, this.damage, this.knockBack, this.owner, 0f, 0f); + return; + } + } + } + else + { + if (this.aiStyle == 48) + { + if (this.type == 255) + { + for (int num500 = 0; num500 < 4; num500++) + { + Vector2 value5 = this.position; + value5 -= this.velocity * ((float)num500 * 0.25f); + this.alpha = 255; + int num501 = Dust.NewDust(value5, 1, 1, 160, 0f, 0f, 0, default(Color), 1f); + Main.dust[num501].position = value5; + Dust expr_16D3E_cp_0 = Main.dust[num501]; + expr_16D3E_cp_0.position.X = expr_16D3E_cp_0.position.X + (float)(this.width / 2); + Dust expr_16D62_cp_0 = Main.dust[num501]; + expr_16D62_cp_0.position.Y = expr_16D62_cp_0.position.Y + (float)(this.height / 2); + Main.dust[num501].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num501].velocity *= 0.2f; + } + return; + } + if (this.type == 290) + { + if (this.localAI[0] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + } + this.localAI[0] += 1f; + if (this.localAI[0] > 3f) + { + for (int num502 = 0; num502 < 3; num502++) + { + Vector2 value6 = this.position; + value6 -= this.velocity * ((float)num502 * 0.3334f); + this.alpha = 255; + int num503 = Dust.NewDust(value6, 1, 1, 173, 0f, 0f, 0, default(Color), 1f); + Main.dust[num503].position = value6; + Main.dust[num503].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num503].velocity *= 0.2f; + } + return; + } + } + else + { + if (this.type == 294) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 9f) + { + for (int num504 = 0; num504 < 4; num504++) + { + Vector2 value7 = this.position; + value7 -= this.velocity * ((float)num504 * 0.25f); + this.alpha = 255; + int num505 = Dust.NewDust(value7, 1, 1, 173, 0f, 0f, 0, default(Color), 1f); + Main.dust[num505].position = value7; + Main.dust[num505].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num505].velocity *= 0.2f; + } + return; + } + } + else + { + this.localAI[0] += 1f; + if (this.localAI[0] > 3f) + { + for (int num506 = 0; num506 < 4; num506++) + { + Vector2 value8 = this.position; + value8 -= this.velocity * ((float)num506 * 0.25f); + this.alpha = 255; + int num507 = Dust.NewDust(value8, 1, 1, 162, 0f, 0f, 0, default(Color), 1f); + Main.dust[num507].position = value8; + Dust expr_170FE_cp_0 = Main.dust[num507]; + expr_170FE_cp_0.position.X = expr_170FE_cp_0.position.X + (float)(this.width / 2); + Dust expr_17122_cp_0 = Main.dust[num507]; + expr_17122_cp_0.position.Y = expr_17122_cp_0.position.Y + (float)(this.height / 2); + Main.dust[num507].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num507].velocity *= 0.2f; + } + return; + } + } + } + } + else + { + if (this.aiStyle == 49) + { + if (this.ai[1] == 0f) + { + this.ai[1] = 1f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + } + if (this.ai[1] == 1f) + { + if (this.velocity.X > 0f) + { + this.direction = 1; + } + else + { + if (this.velocity.X < 0f) + { + this.direction = -1; + } + } + this.spriteDirection = this.direction; + this.ai[0] += 1f; + this.rotation += this.velocity.X * 0.05f + (float)this.direction * 0.05f; + if (this.ai[0] >= 18f) + { + this.velocity.Y = this.velocity.Y + 0.28f; + this.velocity.X = this.velocity.X * 0.99f; + } + if ((double)this.velocity.Y > 15.9) + { + this.velocity.Y = 15.9f; + } + if (this.ai[0] > 2f) + { + this.alpha = 0; + if (this.ai[0] == 3f) + { + for (int num508 = 0; num508 < 10; num508++) + { + int num509 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num509].velocity *= 0.5f; + Main.dust[num509].velocity += this.velocity * 0.1f; + } + for (int num510 = 0; num510 < 5; num510++) + { + int num511 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num511].noGravity = true; + Main.dust[num511].velocity *= 3f; + Main.dust[num511].velocity += this.velocity * 0.2f; + num511 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num511].velocity *= 2f; + Main.dust[num511].velocity += this.velocity * 0.3f; + } + for (int num512 = 0; num512 < 1; num512++) + { + int num513 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num513].position += this.velocity * 1.25f; + Main.gore[num513].scale = 1.5f; + Main.gore[num513].velocity += this.velocity * 0.5f; + Main.gore[num513].velocity *= 0.02f; + } + return; + } + } + } + else + { + if (this.ai[1] == 2f) + { + this.rotation = 0f; + this.velocity.X = this.velocity.X * 0.95f; + this.velocity.Y = this.velocity.Y + 0.2f; + return; + } + } + } + else + { + if (this.aiStyle == 50) + { + if (this.type == 291) + { + if (this.localAI[0] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 20); + this.localAI[0] += 1f; + } + bool flag19 = false; + bool flag20 = false; + if (this.velocity.X < 0f && this.position.X < this.ai[0]) + { + flag19 = true; + } + if (this.velocity.X > 0f && this.position.X > this.ai[0]) + { + flag19 = true; + } + if (this.velocity.Y < 0f && this.position.Y < this.ai[1]) + { + flag20 = true; + } + if (this.velocity.Y > 0f && this.position.Y > this.ai[1]) + { + flag20 = true; + } + if (flag19 && flag20) + { + this.Kill(); + } + for (int num514 = 0; num514 < 10; num514++) + { + int num515 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num515].noGravity = true; + Main.dust[num515].velocity *= 0.5f; + Main.dust[num515].velocity += this.velocity * 0.1f; + } + return; + } + if (this.type == 295) + { + for (int num516 = 0; num516 < 8; num516++) + { + int num517 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num517].noGravity = true; + Main.dust[num517].velocity *= 0.5f; + Main.dust[num517].velocity += this.velocity * 0.1f; + } + return; + } + if (this.localAI[0] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + this.localAI[0] += 1f; + } + this.ai[0] += 1f; + if (this.type == 296) + { + this.ai[0] += 3f; + } + float num518 = 25f; + if (this.ai[0] > 180f) + { + num518 -= (this.ai[0] - 180f) / 2f; + } + if (num518 <= 0f) + { + num518 = 0f; + this.Kill(); + } + if (this.type == 296) + { + num518 *= 0.7f; + } + int num519 = 0; + while ((float)num519 < num518) + { + float num520 = (float)Main.rand.Next(-10, 11); + float num521 = (float)Main.rand.Next(-10, 11); + float num522 = (float)Main.rand.Next(3, 9); + float num523 = (float)Math.Sqrt((double)(num520 * num520 + num521 * num521)); + num523 = num522 / num523; + num520 *= num523; + num521 *= num523; + int num524 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 174, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num524].noGravity = true; + Main.dust[num524].position.X = this.center().X; + Main.dust[num524].position.Y = this.center().Y; + Dust expr_17B71_cp_0 = Main.dust[num524]; + expr_17B71_cp_0.position.X = expr_17B71_cp_0.position.X + (float)Main.rand.Next(-10, 11); + Dust expr_17B9B_cp_0 = Main.dust[num524]; + expr_17B9B_cp_0.position.Y = expr_17B9B_cp_0.position.Y + (float)Main.rand.Next(-10, 11); + Main.dust[num524].velocity.X = num520; + Main.dust[num524].velocity.Y = num521; + num519++; + } + return; + } + else + { + if (this.aiStyle == 51) + { + if (this.type == 297) + { + this.localAI[0] += 1f; + if (this.localAI[0] > 4f) + { + for (int num525 = 0; num525 < 5; num525++) + { + int num526 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 2f); + Main.dust[num526].noGravity = true; + Main.dust[num526].velocity *= 0f; + } + } + } + else + { + if (this.localAI[0] == 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 8); + this.localAI[0] += 1f; + } + for (int num527 = 0; num527 < 9; num527++) + { + int num528 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f); + Main.dust[num528].noGravity = true; + Main.dust[num528].velocity *= 0f; + } + } + float num529 = this.center().X; + float num530 = this.center().Y; + float num531 = 400f; + bool flag21 = false; + if (this.type == 297) + { + for (int num532 = 0; num532 < 200; num532++) + { + if (Main.npc[num532].active && !Main.npc[num532].dontTakeDamage && !Main.npc[num532].friendly && Main.npc[num532].lifeMax > 5 && Collision.CanHit(this.center(), 1, 1, Main.npc[num532].center(), 1, 1)) + { + float num533 = Main.npc[num532].position.X + (float)(Main.npc[num532].width / 2); + float num534 = Main.npc[num532].position.Y + (float)(Main.npc[num532].height / 2); + float num535 = Math.Abs(this.position.X + (float)(this.width / 2) - num533) + Math.Abs(this.position.Y + (float)(this.height / 2) - num534); + if (num535 < num531) + { + num531 = num535; + num529 = num533; + num530 = num534; + flag21 = true; + } + } + } + } + else + { + num531 = 200f; + for (int num536 = 0; num536 < 255; num536++) + { + if (Main.player[num536].active && !Main.player[num536].dead) + { + float num537 = Main.player[num536].position.X + (float)(Main.player[num536].width / 2); + float num538 = Main.player[num536].position.Y + (float)(Main.player[num536].height / 2); + float num539 = Math.Abs(this.position.X + (float)(this.width / 2) - num537) + Math.Abs(this.position.Y + (float)(this.height / 2) - num538); + if (num539 < num531) + { + num531 = num539; + num529 = num537; + num530 = num538; + flag21 = true; + } + } + } + } + if (flag21) + { + float num540 = 3f; + if (this.type == 297) + { + num540 = 6f; + } + Vector2 vector32 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num541 = num529 - vector32.X; + float num542 = num530 - vector32.Y; + float num543 = (float)Math.Sqrt((double)(num541 * num541 + num542 * num542)); + num543 = num540 / num543; + num541 *= num543; + num542 *= num543; + if (this.type == 297) + { + this.velocity.X = (this.velocity.X * 20f + num541) / 21f; + this.velocity.Y = (this.velocity.Y * 20f + num542) / 21f; + return; + } + this.velocity.X = (this.velocity.X * 100f + num541) / 101f; + this.velocity.Y = (this.velocity.Y * 100f + num542) / 101f; + return; + } + } + else + { + if (this.aiStyle == 52) + { + int num544 = (int)this.ai[0]; + float num545 = 4f; + Vector2 vector33 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num546 = Main.player[num544].center().X - vector33.X; + float num547 = Main.player[num544].center().Y - vector33.Y; + float num548 = (float)Math.Sqrt((double)(num546 * num546 + num547 * num547)); + if (num548 < 50f && this.position.X < Main.player[num544].position.X + (float)Main.player[num544].width && this.position.X + (float)this.width > Main.player[num544].position.X && this.position.Y < Main.player[num544].position.Y + (float)Main.player[num544].height && this.position.Y + (float)this.height > Main.player[num544].position.Y) + { + if (this.owner == Main.myPlayer) + { + int num549 = (int)this.ai[1]; + Main.player[num544].HealEffect(num549, false); + Main.player[num544].statLife += num549; + if (Main.player[num544].statLife > Main.player[num544].statLifeMax) + { + Main.player[num544].statLife = Main.player[num544].statLifeMax; + } + NetMessage.SendData(66, -1, -1, "", num544, (float)num549, 0f, 0f, 0); + } + this.Kill(); + } + num548 = num545 / num548; + num546 *= num548; + num547 *= num548; + this.velocity.X = (this.velocity.X * 15f + num546) / 16f; + this.velocity.Y = (this.velocity.Y * 15f + num547) / 16f; + if (this.type == 305) + { + for (int num550 = 0; num550 < 3; num550++) + { + float num551 = this.velocity.X * 0.334f * (float)num550; + float num552 = -(this.velocity.Y * 0.334f) * (float)num550; + int num553 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 183, 0f, 0f, 100, default(Color), 1.1f); + Main.dust[num553].noGravity = true; + Main.dust[num553].velocity *= 0f; + Dust expr_18598_cp_0 = Main.dust[num553]; + expr_18598_cp_0.position.X = expr_18598_cp_0.position.X - num551; + Dust expr_185B7_cp_0 = Main.dust[num553]; + expr_185B7_cp_0.position.Y = expr_185B7_cp_0.position.Y - num552; + } + return; + } + for (int num554 = 0; num554 < 5; num554++) + { + float num555 = this.velocity.X * 0.2f * (float)num554; + float num556 = -(this.velocity.Y * 0.2f) * (float)num554; + int num557 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 175, 0f, 0f, 100, default(Color), 1.3f); + Main.dust[num557].noGravity = true; + Main.dust[num557].velocity *= 0f; + Dust expr_186AF_cp_0 = Main.dust[num557]; + expr_186AF_cp_0.position.X = expr_186AF_cp_0.position.X - num555; + Dust expr_186CE_cp_0 = Main.dust[num557]; + expr_186CE_cp_0.position.Y = expr_186CE_cp_0.position.Y - num556; + } + return; + } + else + { + if (this.aiStyle == 53) + { + if (this.localAI[0] == 0f) + { + this.localAI[1] = 1f; + this.localAI[0] = 1f; + this.ai[0] = 120f; + int num558 = 80; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 46); + for (int num559 = 0; num559 < num558; num559++) + { + int num560 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 16f), this.width, this.height - 16, 185, 0f, 0f, 0, default(Color), 1f); + Main.dust[num560].velocity *= 2f; + Main.dust[num560].noGravity = true; + Main.dust[num560].scale *= 1.15f; + } + } + this.velocity.X = 0f; + this.velocity.Y = this.velocity.Y + 0.2f; + if (this.velocity.Y > 16f) + { + this.velocity.Y = 16f; + } + bool flag22 = false; + float num561 = this.center().X; + float num562 = this.center().Y; + float num563 = 1000f; + for (int num564 = 0; num564 < 200; num564++) + { + if (Main.npc[num564].active && !Main.npc[num564].dontTakeDamage && !Main.npc[num564].friendly && Main.npc[num564].lifeMax > 5) + { + float num565 = Main.npc[num564].position.X + (float)(Main.npc[num564].width / 2); + float num566 = Main.npc[num564].position.Y + (float)(Main.npc[num564].height / 2); + float num567 = Math.Abs(this.position.X + (float)(this.width / 2) - num565) + Math.Abs(this.position.Y + (float)(this.height / 2) - num566); + if (num567 < num563 && Collision.CanHit(this.position, this.width, this.height, Main.npc[num564].position, Main.npc[num564].width, Main.npc[num564].height)) + { + num563 = num567; + num561 = num565; + num562 = num566; + flag22 = true; + } + } + } + if (flag22) + { + float num568 = num561; + float num569 = num562; + num561 -= this.center().X; + num562 -= this.center().Y; + if (num561 < 0f) + { + this.spriteDirection = -1; + } + else + { + this.spriteDirection = 1; + } + int num570; + if (num562 > 0f) + { + num570 = 0; + } + else + { + if (Math.Abs(num562) > Math.Abs(num561) * 3f) + { + num570 = 4; + } + else + { + if (Math.Abs(num562) > Math.Abs(num561) * 2f) + { + num570 = 3; + } + else + { + if (Math.Abs(num561) > Math.Abs(num562) * 3f) + { + num570 = 0; + } + else + { + if (Math.Abs(num561) > Math.Abs(num562) * 2f) + { + num570 = 1; + } + else + { + num570 = 2; + } + } + } + } + } + this.frame = num570 * 2; + if (this.ai[0] > 40f && this.localAI[1] == 0f) + { + this.frame++; + } + if (this.ai[0] <= 0f) + { + this.localAI[1] = 0f; + this.ai[0] = 60f; + if (Main.myPlayer == this.owner) + { + float num571 = 6f; + Vector2 vector34 = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + if (num570 == 0) + { + vector34.Y += 12f; + vector34.X += (float)(24 * this.spriteDirection); + } + else + { + if (num570 == 1) + { + vector34.Y += 0f; + vector34.X += (float)(24 * this.spriteDirection); + } + else + { + if (num570 == 2) + { + vector34.Y -= 2f; + vector34.X += (float)(24 * this.spriteDirection); + } + else + { + if (num570 == 3) + { + vector34.Y -= 6f; + vector34.X += (float)(14 * this.spriteDirection); + } + else + { + if (num570 == 4) + { + vector34.Y -= 14f; + vector34.X += (float)(2 * this.spriteDirection); + } + } + } + } + } + if (this.spriteDirection < 0) + { + vector34.X += 10f; + } + float num572 = num568 - vector34.X; + float num573 = num569 - vector34.Y; + float num574 = (float)Math.Sqrt((double)(num572 * num572 + num573 * num573)); + num574 = num571 / num574; + num572 *= num574; + num573 *= num574; + int num575 = this.damage; + int num576 = 309; + Projectile.NewProjectile(vector34.X, vector34.Y, num572, num573, num576, num575, this.knockBack, Main.myPlayer, 0f, 0f); + } + } + } + else + { + if (this.ai[0] <= 60f && (this.frame == 1 || this.frame == 3 || this.frame == 5 || this.frame == 7 || this.frame == 9)) + { + this.frame--; + } + } + if (this.ai[0] > 0f) + { + this.ai[0] -= 1f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + public void Kill() + { + if (!this.active) + { + return; + } + this.timeLeft = 0; + if (this.type == 1 || this.type == 81 || this.type == 98) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int i = 0; i < 10; i++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 184 || this.type == 195) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int j = 0; j < 5; j++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 275 || this.type == 276) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 291) + { + if (this.owner == Main.myPlayer) + { + Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 292, this.damage, this.knockBack, this.owner, 0f, 0f); + } + } + else + { + if (this.type == 295) + { + if (this.owner == Main.myPlayer) + { + Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 296, (int)((double)this.damage * 0.65), this.knockBack, this.owner, 0f, 0f); + } + } + else + { + if (this.type == 270) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 27); + for (int l = 0; l < 20; l++) + { + int num = Dust.NewDust(this.position, this.width, this.height, 26, 0f, 0f, 100, default(Color), 1f); + Main.dust[num].noGravity = true; + Main.dust[num].velocity *= 1.2f; + Main.dust[num].scale = 1.3f; + Main.dust[num].velocity -= this.lastVelocity * 0.3f; + num = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num].noGravity = true; + Main.dust[num].velocity *= 3f; + } + } + else + { + if (this.type == 265) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 27); + for (int m = 0; m < 15; m++) + { + int num2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num2].noGravity = true; + Main.dust[num2].velocity *= 1.2f; + Main.dust[num2].velocity -= this.lastVelocity * 0.3f; + } + } + else + { + if (this.type == 304) + { + for (int n = 0; n < 3; n++) + { + int num3 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 182, 0f, 0f, 100, default(Color), 0.8f); + Main.dust[num3].noGravity = true; + Main.dust[num3].velocity *= 1.2f; + Main.dust[num3].velocity -= this.lastVelocity * 0.3f; + } + } + else + { + if (this.type == 263) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27); + for (int num4 = 0; num4 < 15; num4++) + { + int num5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, Main.rand.Next(0, 101), default(Color), 1f + (float)Main.rand.Next(40) * 0.01f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 2f; + } + } + else + { + if (this.type == 261) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num6 = 0; num6 < 5; num6++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 148, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 229) + { + for (int num7 = 0; num7 < 25; num7++) + { + int num8 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f); + Main.dust[num8].noGravity = true; + Main.dust[num8].velocity *= 1.5f; + Main.dust[num8].scale = 1.5f; + } + } + else + { + if (this.type == 239) + { + int num9 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), 2, 2, 154, 0f, 0f, 0, default(Color), 1f); + Dust expr_896_cp_0 = Main.dust[num9]; + expr_896_cp_0.position.X = expr_896_cp_0.position.X - 2f; + Main.dust[num9].alpha = 38; + Main.dust[num9].velocity *= 0.1f; + Main.dust[num9].velocity += -this.lastVelocity * 0.25f; + Main.dust[num9].scale = 0.95f; + } + else + { + if (this.type == 245) + { + int num10 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), 2, 2, 114, 0f, 0f, 0, default(Color), 1f); + Main.dust[num10].noGravity = true; + Dust expr_994_cp_0 = Main.dust[num10]; + expr_994_cp_0.position.X = expr_994_cp_0.position.X - 2f; + Main.dust[num10].alpha = 38; + Main.dust[num10].velocity *= 0.1f; + Main.dust[num10].velocity += -this.lastVelocity * 0.25f; + Main.dust[num10].scale = 0.95f; + } + else + { + if (this.type == 264) + { + int num11 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float)this.height - 2f), 2, 2, 54, 0f, 0f, 0, default(Color), 1f); + Main.dust[num11].noGravity = true; + Dust expr_A92_cp_0 = Main.dust[num11]; + expr_A92_cp_0.position.X = expr_A92_cp_0.position.X - 2f; + Main.dust[num11].alpha = 38; + Main.dust[num11].velocity *= 0.1f; + Main.dust[num11].velocity += -this.lastVelocity * 0.25f; + Main.dust[num11].scale = 0.95f; + } + else + { + if (this.type == 206 || this.type == 225) + { + Main.PlaySound(6, (int)this.position.X, (int)this.position.Y, 1); + for (int num12 = 0; num12 < 5; num12++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 227) + { + Main.PlaySound(6, (int)this.position.X, (int)this.position.Y, 1); + for (int num13 = 0; num13 < 15; num13++) + { + int num14 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157, 0f, 0f, 0, default(Color), 1f); + Main.dust[num14].noGravity = true; + Main.dust[num14].velocity += this.lastVelocity; + Main.dust[num14].scale = 1.5f; + } + } + else + { + if (this.type == 237 && this.owner == Main.myPlayer) + { + Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 238, this.damage, this.knockBack, this.owner, 0f, 0f); + } + else + { + if (this.type == 243 && this.owner == Main.myPlayer) + { + Projectile.NewProjectile(this.center().X, this.center().Y, 0f, 0f, 244, this.damage, this.knockBack, this.owner, 0f, 0f); + } + else + { + if (this.type == 120) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num15 = 0; num15 < 10; num15++) + { + int num16 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 100, default(Color), 1f); + if (num15 < 5) + { + Main.dust[num16].noGravity = true; + } + Main.dust[num16].velocity *= 0.2f; + } + } + else + { + if (this.type == 181 || this.type == 189) + { + for (int num17 = 0; num17 < 6; num17++) + { + int num18 = Dust.NewDust(this.position, this.width, this.height, 150, this.velocity.X, this.velocity.Y, 50, default(Color), 1f); + Main.dust[num18].noGravity = true; + Main.dust[num18].scale = 1f; + } + } + else + { + if (this.type == 178) + { + for (int num19 = 0; num19 < 85; num19++) + { + int num20 = Main.rand.Next(139, 143); + int num21 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num20, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f); + Dust expr_F6F_cp_0 = Main.dust[num21]; + expr_F6F_cp_0.velocity.X = expr_F6F_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f; + Dust expr_F9D_cp_0 = Main.dust[num21]; + expr_F9D_cp_0.velocity.Y = expr_F9D_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f; + Dust expr_FCB_cp_0 = Main.dust[num21]; + expr_FCB_cp_0.velocity.X = expr_FCB_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_FFF_cp_0 = Main.dust[num21]; + expr_FFF_cp_0.velocity.Y = expr_FFF_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_1033_cp_0 = Main.dust[num21]; + expr_1033_cp_0.velocity.X = expr_1033_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Dust expr_1061_cp_0 = Main.dust[num21]; + expr_1061_cp_0.velocity.Y = expr_1061_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + Main.dust[num21].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + } + for (int num22 = 0; num22 < 40; num22++) + { + int num23 = Main.rand.Next(276, 283); + int num24 = Gore.NewGore(this.position, this.velocity, num23, 1f); + Gore expr_1105_cp_0 = Main.gore[num24]; + expr_1105_cp_0.velocity.X = expr_1105_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f; + Gore expr_1133_cp_0 = Main.gore[num24]; + expr_1133_cp_0.velocity.Y = expr_1133_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f; + Gore expr_1161_cp_0 = Main.gore[num24]; + expr_1161_cp_0.velocity.X = expr_1161_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Gore expr_1195_cp_0 = Main.gore[num24]; + expr_1195_cp_0.velocity.Y = expr_1195_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Main.gore[num24].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Gore expr_11F8_cp_0 = Main.gore[num24]; + expr_11F8_cp_0.velocity.X = expr_11F8_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Gore expr_1226_cp_0 = Main.gore[num24]; + expr_1226_cp_0.velocity.Y = expr_1226_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + } + } + else + { + if (this.type == 289) + { + for (int num25 = 0; num25 < 30; num25++) + { + int num26 = Main.rand.Next(139, 143); + int num27 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num26, this.velocity.X, this.velocity.Y, 0, default(Color), 1.2f); + Dust expr_12F0_cp_0 = Main.dust[num27]; + expr_12F0_cp_0.velocity.X = expr_12F0_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f; + Dust expr_131E_cp_0 = Main.dust[num27]; + expr_131E_cp_0.velocity.Y = expr_131E_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f; + Dust expr_134C_cp_0 = Main.dust[num27]; + expr_134C_cp_0.velocity.X = expr_134C_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_1380_cp_0 = Main.dust[num27]; + expr_1380_cp_0.velocity.Y = expr_1380_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_13B4_cp_0 = Main.dust[num27]; + expr_13B4_cp_0.velocity.X = expr_13B4_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Dust expr_13E2_cp_0 = Main.dust[num27]; + expr_13E2_cp_0.velocity.Y = expr_13E2_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + Main.dust[num27].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + } + for (int num28 = 0; num28 < 15; num28++) + { + int num29 = Main.rand.Next(276, 283); + int num30 = Gore.NewGore(this.position, this.velocity, num29, 1f); + Gore expr_1486_cp_0 = Main.gore[num30]; + expr_1486_cp_0.velocity.X = expr_1486_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f; + Gore expr_14B4_cp_0 = Main.gore[num30]; + expr_14B4_cp_0.velocity.Y = expr_14B4_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f; + Gore expr_14E2_cp_0 = Main.gore[num30]; + expr_14E2_cp_0.velocity.X = expr_14E2_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Gore expr_1516_cp_0 = Main.gore[num30]; + expr_1516_cp_0.velocity.Y = expr_1516_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Main.gore[num30].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Gore expr_1579_cp_0 = Main.gore[num30]; + expr_1579_cp_0.velocity.X = expr_1579_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Gore expr_15A7_cp_0 = Main.gore[num30]; + expr_15A7_cp_0.velocity.Y = expr_15A7_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + } + } + else + { + if (this.type == 171) + { + if (this.ai[1] == 0f) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + } + if (this.ai[1] < 10f) + { + Vector2 vector = new Vector2(this.position.X + (float)this.width * 0.5f, this.position.Y + (float)this.height * 0.5f); + float num31 = -this.velocity.X; + float num32 = -this.velocity.Y; + float num33 = 1f; + if (this.ai[0] <= 17f) + { + num33 = this.ai[0] / 17f; + } + int num34 = (int)(30f * num33); + float num35 = 1f; + if (this.ai[0] <= 30f) + { + num35 = this.ai[0] / 30f; + } + float num36 = 0.4f * num35; + float num37 = num36; + num32 += num37; + for (int num38 = 0; num38 < num34; num38++) + { + float num39 = (float)Math.Sqrt((double)(num31 * num31 + num32 * num32)); + float num40 = 5.6f; + if (Math.Abs(num31) + Math.Abs(num32) < 1f) + { + num40 *= Math.Abs(num31) + Math.Abs(num32) / 1f; + } + num39 = num40 / num39; + num31 *= num39; + num32 *= num39; + Math.Atan2((double)num32, (double)num31); + if ((float)num38 > this.ai[1]) + { + for (int num41 = 0; num41 < 4; num41++) + { + int num42 = Dust.NewDust(vector, this.width, this.height, 129, 0f, 0f, 0, default(Color), 1f); + Main.dust[num42].noGravity = true; + Main.dust[num42].velocity *= 0.3f; + } + } + vector.X += num31; + vector.Y += num32; + num31 = -this.velocity.X; + num32 = -this.velocity.Y; + num37 += num36; + num32 += num37; + } + } + } + else + { + if (this.type == 117) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num43 = 0; num43 < 10; num43++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 166) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 51); + for (int num44 = 0; num44 < 10; num44++) + { + int num45 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 76, 0f, 0f, 0, default(Color), 1f); + Main.dust[num45].noGravity = true; + Main.dust[num45].velocity -= this.lastVelocity * 0.25f; + } + } + else + { + if (this.type == 158) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num46 = 0; num46 < 10; num46++) + { + int num47 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 9, 0f, 0f, 0, default(Color), 1f); + Main.dust[num47].noGravity = true; + Main.dust[num47].velocity -= this.velocity * 0.5f; + } + } + else + { + if (this.type == 159) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num48 = 0; num48 < 10; num48++) + { + int num49 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11, 0f, 0f, 0, default(Color), 1f); + Main.dust[num49].noGravity = true; + Main.dust[num49].velocity -= this.velocity * 0.5f; + } + } + else + { + if (this.type == 160) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num50 = 0; num50 < 10; num50++) + { + int num51 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 19, 0f, 0f, 0, default(Color), 1f); + Main.dust[num51].noGravity = true; + Main.dust[num51].velocity -= this.velocity * 0.5f; + } + } + else + { + if (this.type == 161) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num52 = 0; num52 < 10; num52++) + { + int num53 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11, 0f, 0f, 0, default(Color), 1f); + Main.dust[num53].noGravity = true; + Main.dust[num53].velocity -= this.velocity * 0.5f; + } + } + else + { + if (this.type >= 191 && this.type <= 194) + { + int num54 = Gore.NewGore(new Vector2(this.position.X - (float)(this.width / 2), this.position.Y - (float)(this.height / 2)), new Vector2(0f, 0f), Main.rand.Next(61, 64), this.scale); + Main.gore[num54].velocity *= 0.1f; + } + else + { + if (Main.projPet[this.type]) + { + int num55 = Gore.NewGore(new Vector2(this.position.X - (float)(this.width / 2), this.position.Y - (float)(this.height / 2)), new Vector2(0f, 0f), Main.rand.Next(11, 14), this.scale); + Main.gore[num55].velocity *= 0.1f; + } + else + { + if (this.type == 93) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num56 = 0; num56 < 10; num56++) + { + int num57 = Dust.NewDust(this.position, this.width, this.height, 57, 0f, 0f, 100, default(Color), 0.5f); + Dust expr_1E73_cp_0 = Main.dust[num57]; + expr_1E73_cp_0.velocity.X = expr_1E73_cp_0.velocity.X * 2f; + Dust expr_1E91_cp_0 = Main.dust[num57]; + expr_1E91_cp_0.velocity.Y = expr_1E91_cp_0.velocity.Y * 2f; + } + } + else + { + if (this.type == 99) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num58 = 0; num58 < 30; num58++) + { + int num59 = Dust.NewDust(this.position, this.width, this.height, 1, 0f, 0f, 0, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num59].scale *= 1.4f; + } + this.velocity *= 1.9f; + } + } + else + { + if (this.type == 91 || this.type == 92) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num60 = 0; num60 < 10; num60++) + { + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f); + } + for (int num61 = 0; num61 < 3; num61++) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); + } + if (this.type == 12 && this.damage < 500) + { + for (int num62 = 0; num62 < 10; num62++) + { + Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f); + } + for (int num63 = 0; num63 < 3; num63++) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); + } + } + if ((this.type == 91 || (this.type == 92 && this.ai[0] > 0f)) && this.owner == Main.myPlayer) + { + float x = this.position.X + (float)Main.rand.Next(-400, 400); + float y = this.position.Y - (float)Main.rand.Next(600, 900); + Vector2 vector2 = new Vector2(x, y); + float num64 = this.position.X + (float)(this.width / 2) - vector2.X; + float num65 = this.position.Y + (float)(this.height / 2) - vector2.Y; + int num66 = 22; + float num67 = (float)Math.Sqrt((double)(num64 * num64 + num65 * num65)); + num67 = (float)num66 / num67; + num64 *= num67; + num65 *= num67; + int num68 = this.damage; + if (this.type == 91) + { + num68 = (int)((float)num68 * 0.5f); + } + int num69 = Projectile.NewProjectile(x, y, num64, num65, 92, num68, this.knockBack, this.owner, 0f, 0f); + if (this.type == 91) + { + Main.projectile[num69].ai[1] = this.position.Y; + Main.projectile[num69].ai[0] = 1f; + } + else + { + Main.projectile[num69].ai[1] = this.position.Y; + } + } + } + else + { + if (this.type == 89) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num70 = 0; num70 < 5; num70++) + { + int num71 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 68, 0f, 0f, 0, default(Color), 1f); + Main.dust[num71].noGravity = true; + Main.dust[num71].velocity *= 1.5f; + Main.dust[num71].scale *= 0.9f; + } + if (this.type == 89 && this.owner == Main.myPlayer) + { + for (int num72 = 0; num72 < 3; num72++) + { + float num73 = -this.velocity.X * (float)Main.rand.Next(40, 70) * 0.01f + (float)Main.rand.Next(-20, 21) * 0.4f; + float num74 = -this.velocity.Y * (float)Main.rand.Next(40, 70) * 0.01f + (float)Main.rand.Next(-20, 21) * 0.4f; + Projectile.NewProjectile(this.position.X + num73, this.position.Y + num74, num73, num74, 90, (int)((double)this.damage * 0.5), 0f, this.owner, 0f, 0f); + } + } + } + else + { + if (this.type == 177) + { + for (int num75 = 0; num75 < 20; num75++) + { + int num76 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 137, 0f, 0f, Main.rand.Next(0, 101), default(Color), 1f + (float)Main.rand.Next(-20, 40) * 0.01f); + Main.dust[num76].velocity -= this.lastVelocity * 0.2f; + if (Main.rand.Next(3) == 0) + { + Main.dust[num76].scale *= 0.8f; + Main.dust[num76].velocity *= 0.5f; + } + else + { + Main.dust[num76].noGravity = true; + } + } + } + else + { + if (this.type == 119 || this.type == 118 || this.type == 128) + { + int num77 = 10; + if (this.type == 119) + { + num77 = 20; + } + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27); + for (int num78 = 0; num78 < num77; num78++) + { + int num79 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, 0f, 0f, 0, default(Color), 1f); + if (Main.rand.Next(3) != 0) + { + Main.dust[num79].velocity *= 2f; + Main.dust[num79].noGravity = true; + Main.dust[num79].scale *= 1.75f; + } + else + { + Main.dust[num79].scale *= 0.5f; + } + } + } + else + { + if (this.type == 309) + { + int num80 = 10; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27); + for (int num81 = 0; num81 < num80; num81++) + { + int num82 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 185, 0f, 0f, 0, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num82].velocity *= 2f; + Main.dust[num82].noGravity = true; + Main.dust[num82].scale *= 1.75f; + } + } + } + else + { + if (this.type == 308) + { + int num83 = 80; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27); + for (int num84 = 0; num84 < num83; num84++) + { + int num85 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 16f), this.width, this.height - 16, 185, 0f, 0f, 0, default(Color), 1f); + Main.dust[num85].velocity *= 2f; + Main.dust[num85].noGravity = true; + Main.dust[num85].scale *= 1.15f; + } + } + else + { + if (this.aiStyle == 29) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + int num86 = this.type - 121 + 86; + for (int num87 = 0; num87 < 15; num87++) + { + int num88 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num86, this.lastVelocity.X, this.lastVelocity.Y, 50, default(Color), 1.2f); + Main.dust[num88].noGravity = true; + Main.dust[num88].scale *= 1.25f; + Main.dust[num88].velocity *= 0.5f; + } + } + else + { + if (this.type == 80) + { + if (this.ai[0] >= 0f) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 27); + for (int num89 = 0; num89 < 10; num89++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, 0f, 0f, 0, default(Color), 1f); + } + } + int num90 = (int)this.position.X / 16; + int num91 = (int)this.position.Y / 16; + if (Main.tile[num90, num91] == null) + { + Main.tile[num90, num91] = new Tile(); + } + if (Main.tile[num90, num91].type == 127 && Main.tile[num90, num91].active()) + { + WorldGen.KillTile(num90, num91, false, false, false); + } + } + else + { + if (this.type == 76 || this.type == 77 || this.type == 78) + { + for (int num92 = 0; num92 < 5; num92++) + { + int num93 = Dust.NewDust(this.position, this.width, this.height, 27, 0f, 0f, 80, default(Color), 1.5f); + Main.dust[num93].noGravity = true; + } + } + else + { + if (this.type == 55) + { + for (int num94 = 0; num94 < 5; num94++) + { + int num95 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num95].noGravity = true; + } + } + else + { + if (this.type == 51 || this.type == 267) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num96 = 0; num96 < 5; num96++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, 0f, 0f, 0, default(Color), 0.7f); + } + } + else + { + if (this.type == 2 || this.type == 82) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num97 = 0; num97 < 20; num97++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1f); + } + } + else + { + if (this.type == 172) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num98 = 0; num98 < 20; num98++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, 0f, 0f, 100, default(Color), 1f); + } + } + else + { + if (this.type == 103) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num99 = 0; num99 < 20; num99++) + { + int num100 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num100].scale *= 2.5f; + Main.dust[num100].noGravity = true; + Main.dust[num100].velocity *= 5f; + } + } + } + else + { + if (this.type == 278) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num101 = 0; num101 < 20; num101++) + { + int num102 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 169, 0f, 0f, 100, default(Color), 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num102].scale *= 1.5f; + Main.dust[num102].noGravity = true; + Main.dust[num102].velocity *= 5f; + } + } + } + else + { + if (this.type == 3 || this.type == 48 || this.type == 54) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num103 = 0; num103 < 10; num103++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 1, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 0.75f); + } + } + else + { + if (this.type == 4) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num104 = 0; num104 < 10; num104++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, 0f, 0f, 150, default(Color), 1.1f); + } + } + else + { + if (this.type == 5) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num105 = 0; num105 < 60; num105++) + { + int num106 = Main.rand.Next(3); + if (num106 == 0) + { + num106 = 15; + } + else + { + if (num106 == 1) + { + num106 = 57; + } + else + { + num106 = 58; + } + } + Dust.NewDust(this.position, this.width, this.height, num106, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, default(Color), 1.5f); + } + } + else + { + if (this.type == 9 || this.type == 12) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num107 = 0; num107 < 10; num107++) + { + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f); + } + for (int num108 = 0; num108 < 3; num108++) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); + } + if (this.type == 12 && this.damage < 100) + { + for (int num109 = 0; num109 < 10; num109++) + { + Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, default(Color), 1.2f); + } + for (int num110 = 0; num110 < 3; num110++) + { + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); + } + } + } + else + { + if (this.type == 281) + { + Main.PlaySound(4, (int)this.position.X, (int)this.position.Y, 1); + int num111 = Gore.NewGore(this.position, new Vector2((float)Main.rand.Next(-20, 21) * 0.2f, (float)Main.rand.Next(-20, 21) * 0.2f), 76, 1f); + Main.gore[num111].velocity -= this.velocity * 0.5f; + num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2((float)Main.rand.Next(-20, 21) * 0.2f, (float)Main.rand.Next(-20, 21) * 0.2f), 77, 1f); + Main.gore[num111].velocity -= this.velocity * 0.5f; + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num112 = 0; num112 < 20; num112++) + { + int num113 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num113].velocity *= 1.4f; + } + for (int num114 = 0; num114 < 10; num114++) + { + int num115 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num115].noGravity = true; + Main.dust[num115].velocity *= 5f; + num115 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num115].velocity *= 3f; + } + num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num111].velocity *= 0.4f; + Gore expr_3667_cp_0 = Main.gore[num111]; + expr_3667_cp_0.velocity.X = expr_3667_cp_0.velocity.X + 1f; + Gore expr_3685_cp_0 = Main.gore[num111]; + expr_3685_cp_0.velocity.Y = expr_3685_cp_0.velocity.Y + 1f; + num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num111].velocity *= 0.4f; + Gore expr_3703_cp_0 = Main.gore[num111]; + expr_3703_cp_0.velocity.X = expr_3703_cp_0.velocity.X - 1f; + Gore expr_3721_cp_0 = Main.gore[num111]; + expr_3721_cp_0.velocity.Y = expr_3721_cp_0.velocity.Y + 1f; + num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num111].velocity *= 0.4f; + Gore expr_379F_cp_0 = Main.gore[num111]; + expr_379F_cp_0.velocity.X = expr_379F_cp_0.velocity.X + 1f; + Gore expr_37BD_cp_0 = Main.gore[num111]; + expr_37BD_cp_0.velocity.Y = expr_37BD_cp_0.velocity.Y - 1f; + num111 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num111].velocity *= 0.4f; + Gore expr_383B_cp_0 = Main.gore[num111]; + expr_383B_cp_0.velocity.X = expr_383B_cp_0.velocity.X - 1f; + Gore expr_3859_cp_0 = Main.gore[num111]; + expr_3859_cp_0.velocity.Y = expr_3859_cp_0.velocity.Y - 1f; + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.Damage(); + } + else + { + if (this.type == 162) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num116 = 0; num116 < 20; num116++) + { + int num117 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num117].velocity *= 1.4f; + } + for (int num118 = 0; num118 < 10; num118++) + { + int num119 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num119].noGravity = true; + Main.dust[num119].velocity *= 5f; + num119 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num119].velocity *= 3f; + } + int num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num120].velocity *= 0.4f; + Gore expr_3B0C_cp_0 = Main.gore[num120]; + expr_3B0C_cp_0.velocity.X = expr_3B0C_cp_0.velocity.X + 1f; + Gore expr_3B2A_cp_0 = Main.gore[num120]; + expr_3B2A_cp_0.velocity.Y = expr_3B2A_cp_0.velocity.Y + 1f; + num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num120].velocity *= 0.4f; + Gore expr_3BA8_cp_0 = Main.gore[num120]; + expr_3BA8_cp_0.velocity.X = expr_3BA8_cp_0.velocity.X - 1f; + Gore expr_3BC6_cp_0 = Main.gore[num120]; + expr_3BC6_cp_0.velocity.Y = expr_3BC6_cp_0.velocity.Y + 1f; + num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num120].velocity *= 0.4f; + Gore expr_3C44_cp_0 = Main.gore[num120]; + expr_3C44_cp_0.velocity.X = expr_3C44_cp_0.velocity.X + 1f; + Gore expr_3C62_cp_0 = Main.gore[num120]; + expr_3C62_cp_0.velocity.Y = expr_3C62_cp_0.velocity.Y - 1f; + num120 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num120].velocity *= 0.4f; + Gore expr_3CE0_cp_0 = Main.gore[num120]; + expr_3CE0_cp_0.velocity.X = expr_3CE0_cp_0.velocity.X - 1f; + Gore expr_3CFE_cp_0 = Main.gore[num120]; + expr_3CFE_cp_0.velocity.Y = expr_3CFE_cp_0.velocity.Y - 1f; + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 128; + this.height = 128; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.Damage(); + } + else + { + if (this.type == 240) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num121 = 0; num121 < 20; num121++) + { + int num122 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num122].velocity *= 1.4f; + } + for (int num123 = 0; num123 < 10; num123++) + { + int num124 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num124].noGravity = true; + Main.dust[num124].velocity *= 5f; + num124 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num124].velocity *= 3f; + } + int num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num125].velocity *= 0.4f; + Gore expr_3FB1_cp_0 = Main.gore[num125]; + expr_3FB1_cp_0.velocity.X = expr_3FB1_cp_0.velocity.X + 1f; + Gore expr_3FCF_cp_0 = Main.gore[num125]; + expr_3FCF_cp_0.velocity.Y = expr_3FCF_cp_0.velocity.Y + 1f; + num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num125].velocity *= 0.4f; + Gore expr_404D_cp_0 = Main.gore[num125]; + expr_404D_cp_0.velocity.X = expr_404D_cp_0.velocity.X - 1f; + Gore expr_406B_cp_0 = Main.gore[num125]; + expr_406B_cp_0.velocity.Y = expr_406B_cp_0.velocity.Y + 1f; + num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num125].velocity *= 0.4f; + Gore expr_40E9_cp_0 = Main.gore[num125]; + expr_40E9_cp_0.velocity.X = expr_40E9_cp_0.velocity.X + 1f; + Gore expr_4107_cp_0 = Main.gore[num125]; + expr_4107_cp_0.velocity.Y = expr_4107_cp_0.velocity.Y - 1f; + num125 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num125].velocity *= 0.4f; + Gore expr_4185_cp_0 = Main.gore[num125]; + expr_4185_cp_0.velocity.X = expr_4185_cp_0.velocity.X - 1f; + Gore expr_41A3_cp_0 = Main.gore[num125]; + expr_41A3_cp_0.velocity.Y = expr_41A3_cp_0.velocity.Y - 1f; + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 96; + this.height = 96; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.Damage(); + } + else + { + if (this.type == 283 || this.type == 282) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num126 = 0; num126 < 10; num126++) + { + int num127 = Dust.NewDust(this.position, this.width, this.height, 171, 0f, 0f, 100, default(Color), 1f); + Main.dust[num127].scale = (float)Main.rand.Next(1, 10) * 0.1f; + Main.dust[num127].noGravity = true; + Main.dust[num127].fadeIn = 1.5f; + Main.dust[num127].velocity *= 0.75f; + } + } + else + { + if (this.type == 284) + { + for (int num128 = 0; num128 < 10; num128++) + { + int num129 = Main.rand.Next(139, 143); + int num130 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, num129, -this.velocity.X * 0.3f, -this.velocity.Y * 0.3f, 0, default(Color), 1.2f); + Dust expr_43D2_cp_0 = Main.dust[num130]; + expr_43D2_cp_0.velocity.X = expr_43D2_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f; + Dust expr_4400_cp_0 = Main.dust[num130]; + expr_4400_cp_0.velocity.Y = expr_4400_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f; + Dust expr_442E_cp_0 = Main.dust[num130]; + expr_442E_cp_0.velocity.X = expr_442E_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_4462_cp_0 = Main.dust[num130]; + expr_4462_cp_0.velocity.Y = expr_4462_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Dust expr_4496_cp_0 = Main.dust[num130]; + expr_4496_cp_0.velocity.X = expr_4496_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Dust expr_44C4_cp_0 = Main.dust[num130]; + expr_44C4_cp_0.velocity.Y = expr_44C4_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + Main.dust[num130].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + } + for (int num131 = 0; num131 < 5; num131++) + { + int num132 = Main.rand.Next(276, 283); + int num133 = Gore.NewGore(this.position, -this.velocity * 0.3f, num132, 1f); + Gore expr_4577_cp_0 = Main.gore[num133]; + expr_4577_cp_0.velocity.X = expr_4577_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.01f; + Gore expr_45A5_cp_0 = Main.gore[num133]; + expr_45A5_cp_0.velocity.Y = expr_45A5_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.01f; + Gore expr_45D3_cp_0 = Main.gore[num133]; + expr_45D3_cp_0.velocity.X = expr_45D3_cp_0.velocity.X * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Gore expr_4607_cp_0 = Main.gore[num133]; + expr_4607_cp_0.velocity.Y = expr_4607_cp_0.velocity.Y * (1f + (float)Main.rand.Next(-50, 51) * 0.01f); + Main.gore[num133].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Gore expr_466A_cp_0 = Main.gore[num133]; + expr_466A_cp_0.velocity.X = expr_466A_cp_0.velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; + Gore expr_4698_cp_0 = Main.gore[num133]; + expr_4698_cp_0.velocity.Y = expr_4698_cp_0.velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; + } + } + else + { + if (this.type == 286) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num134 = 0; num134 < 7; num134++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + } + for (int num135 = 0; num135 < 3; num135++) + { + int num136 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num136].noGravity = true; + Main.dust[num136].velocity *= 3f; + num136 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num136].velocity *= 2f; + } + int num137 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num137].velocity *= 0.3f; + Gore expr_48CD_cp_0 = Main.gore[num137]; + expr_48CD_cp_0.velocity.X = expr_48CD_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f; + Gore expr_48FB_cp_0 = Main.gore[num137]; + expr_48FB_cp_0.velocity.Y = expr_48FB_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f; + if (this.owner == Main.myPlayer) + { + this.localAI[1] = -1f; + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 80; + this.height = 80; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.Damage(); + } + } + else + { + if (this.type == 14 || this.type == 20 || this.type == 36 || this.type == 83 || this.type == 84 || this.type == 104 || this.type == 279 || this.type == 100 || this.type == 110 || this.type == 180 || this.type == 207 || this.type == 242 || this.type == 302 || this.type == 257 || this.type == 259 || this.type == 285 || this.type == 287) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + } + else + { + if (this.type == 15 || this.type == 34) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num138 = 0; num138 < 20; num138++) + { + int num139 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num139].noGravity = true; + Main.dust[num139].velocity *= 2f; + num139 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num139].velocity *= 2f; + } + } + else + { + if (this.type == 253) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num140 = 0; num140 < 20; num140++) + { + int num141 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num141].noGravity = true; + Main.dust[num141].velocity *= 2f; + num141 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[num141].velocity *= 2f; + } + } + else + { + if (this.type == 95 || this.type == 96) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num142 = 0; num142 < 20; num142++) + { + int num143 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 2f * this.scale); + Main.dust[num143].noGravity = true; + Main.dust[num143].velocity *= 2f; + num143 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, -this.velocity.X * 0.2f, -this.velocity.Y * 0.2f, 100, default(Color), 1f * this.scale); + Main.dust[num143].velocity *= 2f; + } + } + else + { + if (this.type == 79) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num144 = 0; num144 < 20; num144++) + { + int num145 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2f); + Main.dust[num145].noGravity = true; + Main.dust[num145].velocity *= 4f; + } + } + else + { + if (this.type == 16) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num146 = 0; num146 < 20; num146++) + { + int num147 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 2f); + Main.dust[num147].noGravity = true; + Main.dust[num147].velocity *= 2f; + num147 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 15, 0f, 0f, 100, default(Color), 1f); + } + } + else + { + if (this.type == 17) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num148 = 0; num148 < 5; num148++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, 0f, 0f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 31 || this.type == 42) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num149 = 0; num149 < 5; num149++) + { + int num150 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, 0f, 0f, 0, default(Color), 1f); + Main.dust[num150].velocity *= 0.6f; + } + } + else + { + if (this.type == 109) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num151 = 0; num151 < 5; num151++) + { + int num152 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51, 0f, 0f, 0, default(Color), 0.6f); + Main.dust[num152].velocity *= 0.6f; + } + } + else + { + if (this.type == 39) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num153 = 0; num153 < 5; num153++) + { + int num154 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 38, 0f, 0f, 0, default(Color), 1f); + Main.dust[num154].velocity *= 0.6f; + } + } + else + { + if (this.type == 71) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num155 = 0; num155 < 5; num155++) + { + int num156 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53, 0f, 0f, 0, default(Color), 1f); + Main.dust[num156].velocity *= 0.6f; + } + } + else + { + if (this.type == 40) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num157 = 0; num157 < 5; num157++) + { + int num158 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, 0f, 0f, 0, default(Color), 1f); + Main.dust[num158].velocity *= 0.6f; + } + } + else + { + if (this.type == 21) + { + Main.PlaySound(0, (int)this.position.X, (int)this.position.Y, 1); + for (int num159 = 0; num159 < 10; num159++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, 0f, 0f, 0, default(Color), 0.8f); + } + } + else + { + if (this.type == 24) + { + for (int num160 = 0; num160 < 10; num160++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 1, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 0.75f); + } + } + else + { + if (this.type == 27) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num161 = 0; num161 < 30; num161++) + { + int num162 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100, default(Color), 1f); + Main.dust[num162].noGravity = true; + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100, default(Color), 0.5f); + } + } + else + { + if (this.type == 38) + { + for (int num163 = 0; num163 < 10; num163++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 42, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 0, default(Color), 1f); + } + } + else + { + if (this.type == 44 || this.type == 45) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num164 = 0; num164 < 30; num164++) + { + int num165 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100, default(Color), 1.7f); + Main.dust[num165].noGravity = true; + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100, default(Color), 1f); + } + } + else + { + if (this.type == 41) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num166 = 0; num166 < 10; num166++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + } + for (int num167 = 0; num167 < 5; num167++) + { + int num168 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num168].noGravity = true; + Main.dust[num168].velocity *= 3f; + num168 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num168].velocity *= 2f; + } + int num169 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num169].velocity *= 0.4f; + Gore expr_5AF4_cp_0 = Main.gore[num169]; + expr_5AF4_cp_0.velocity.X = expr_5AF4_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.1f; + Gore expr_5B22_cp_0 = Main.gore[num169]; + expr_5B22_cp_0.velocity.Y = expr_5B22_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.1f; + num169 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num169].velocity *= 0.4f; + Gore expr_5BB0_cp_0 = Main.gore[num169]; + expr_5BB0_cp_0.velocity.X = expr_5BB0_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.1f; + Gore expr_5BDE_cp_0 = Main.gore[num169]; + expr_5BDE_cp_0.velocity.Y = expr_5BDE_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.1f; + if (this.owner == Main.myPlayer) + { + this.penetrate = -1; + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 64; + this.height = 64; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.Damage(); + } + } + else + { + if (this.type == 306) + { + Main.PlaySound(3, (int)this.position.X, (int)this.position.Y, 1); + for (int num170 = 0; num170 < 20; num170++) + { + int num171 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f); + Main.dust[num171].scale *= 1.1f; + Main.dust[num171].noGravity = true; + } + for (int num172 = 0; num172 < 30; num172++) + { + int num173 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 184, 0f, 0f, 0, default(Color), 1f); + Main.dust[num173].velocity *= 2.5f; + Main.dust[num173].scale *= 0.8f; + Main.dust[num173].noGravity = true; + } + if (this.owner == Main.myPlayer) + { + int num174 = 2; + if (Main.rand.Next(10) == 0) + { + num174++; + } + if (Main.rand.Next(10) == 0) + { + num174++; + } + for (int num175 = 0; num175 < num174; num175++) + { + float num176 = (float)Main.rand.Next(-35, 36) * 0.02f; + float num177 = (float)Main.rand.Next(-35, 36) * 0.02f; + num176 *= 10f; + num177 *= 10f; + Projectile.NewProjectile(this.position.X, this.position.Y, num176, num177, 307, (int)((double)this.damage * 0.55), (float)((int)((double)this.knockBack * 0.3)), Main.myPlayer, 0f, 0f); + } + } + } + else + { + if (this.type == 183) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num178 = 0; num178 < 20; num178++) + { + int num179 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num179].velocity *= 1f; + } + int num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Gore expr_5FF3_cp_0 = Main.gore[num180]; + expr_5FF3_cp_0.velocity.X = expr_5FF3_cp_0.velocity.X + 1f; + Gore expr_6011_cp_0 = Main.gore[num180]; + expr_6011_cp_0.velocity.Y = expr_6011_cp_0.velocity.Y + 1f; + Main.gore[num180].velocity *= 0.3f; + num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Gore expr_608F_cp_0 = Main.gore[num180]; + expr_608F_cp_0.velocity.X = expr_608F_cp_0.velocity.X - 1f; + Gore expr_60AD_cp_0 = Main.gore[num180]; + expr_60AD_cp_0.velocity.Y = expr_60AD_cp_0.velocity.Y + 1f; + Main.gore[num180].velocity *= 0.3f; + num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Gore expr_612B_cp_0 = Main.gore[num180]; + expr_612B_cp_0.velocity.X = expr_612B_cp_0.velocity.X + 1f; + Gore expr_6149_cp_0 = Main.gore[num180]; + expr_6149_cp_0.velocity.Y = expr_6149_cp_0.velocity.Y - 1f; + Main.gore[num180].velocity *= 0.3f; + num180 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Gore expr_61C7_cp_0 = Main.gore[num180]; + expr_61C7_cp_0.velocity.X = expr_61C7_cp_0.velocity.X - 1f; + Gore expr_61E5_cp_0 = Main.gore[num180]; + expr_61E5_cp_0.velocity.Y = expr_61E5_cp_0.velocity.Y - 1f; + Main.gore[num180].velocity *= 0.3f; + if (this.owner == Main.myPlayer) + { + int num181 = Main.rand.Next(15, 25); + for (int num182 = 0; num182 < num181; num182++) + { + float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; + float speedY = (float)Main.rand.Next(-35, 36) * 0.02f; + Projectile.NewProjectile(this.position.X, this.position.Y, speedX, speedY, 181, this.damage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + else + { + if (this.aiStyle == 34) + { + if (this.owner != Main.myPlayer) + { + this.timeLeft = 60; + } + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + if (this.type == 167) + { + for (int num183 = 0; num183 < 400; num183++) + { + float num184 = 16f; + if (num183 < 300) + { + num184 = 12f; + } + if (num183 < 200) + { + num184 = 8f; + } + if (num183 < 100) + { + num184 = 4f; + } + int num185 = 130; + int num186 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num185, 0f, 0f, 100, default(Color), 1f); + float num187 = Main.dust[num186].velocity.X; + float num188 = Main.dust[num186].velocity.Y; + if (num187 == 0f && num188 == 0f) + { + num187 = 1f; + } + float num189 = (float)Math.Sqrt((double)(num187 * num187 + num188 * num188)); + num189 = num184 / num189; + num187 *= num189; + num188 *= num189; + Main.dust[num186].velocity *= 0.5f; + Dust expr_6424_cp_0 = Main.dust[num186]; + expr_6424_cp_0.velocity.X = expr_6424_cp_0.velocity.X + num187; + Dust expr_643F_cp_0 = Main.dust[num186]; + expr_643F_cp_0.velocity.Y = expr_643F_cp_0.velocity.Y + num188; + Main.dust[num186].scale = 1.3f; + Main.dust[num186].noGravity = true; + } + } + if (this.type == 168) + { + for (int num190 = 0; num190 < 400; num190++) + { + float num191 = 2f * ((float)num190 / 100f); + if (num190 > 100) + { + num191 = 10f; + } + if (num190 > 250) + { + num191 = 13f; + } + int num192 = 131; + int num193 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num192, 0f, 0f, 100, default(Color), 1f); + float num194 = Main.dust[num193].velocity.X; + float num195 = Main.dust[num193].velocity.Y; + if (num194 == 0f && num195 == 0f) + { + num194 = 1f; + } + float num196 = (float)Math.Sqrt((double)(num194 * num194 + num195 * num195)); + num196 = num191 / num196; + if (num190 <= 200) + { + num194 *= num196; + num195 *= num196; + } + else + { + num194 = num194 * num196 * 1.25f; + num195 = num195 * num196 * 0.75f; + } + Main.dust[num193].velocity *= 0.5f; + Dust expr_65CA_cp_0 = Main.dust[num193]; + expr_65CA_cp_0.velocity.X = expr_65CA_cp_0.velocity.X + num194; + Dust expr_65E5_cp_0 = Main.dust[num193]; + expr_65E5_cp_0.velocity.Y = expr_65E5_cp_0.velocity.Y + num195; + if (num190 > 100) + { + Main.dust[num193].scale = 1.3f; + Main.dust[num193].noGravity = true; + } + } + } + if (this.type == 169) + { + for (int num197 = 0; num197 < 400; num197++) + { + int num198 = 132; + float num199 = 14f; + if (num197 > 100) + { + num199 = 10f; + } + if (num197 > 100) + { + num198 = 133; + } + if (num197 > 200) + { + num199 = 6f; + } + if (num197 > 200) + { + num198 = 132; + } + if (num197 > 300) + { + num199 = 6f; + } + if (num197 > 300) + { + num198 = 133; + } + int num200 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num198, 0f, 0f, 100, default(Color), 1f); + float num201 = Main.dust[num200].velocity.X; + float num202 = Main.dust[num200].velocity.Y; + if (num201 == 0f && num202 == 0f) + { + num201 = 1f; + } + float num203 = (float)Math.Sqrt((double)(num201 * num201 + num202 * num202)); + num203 = num199 / num203; + if (num197 > 300) + { + num201 = num201 * num203 * 0.5f; + num202 *= num203; + } + else + { + if (num197 > 200) + { + num201 *= num203; + num202 = num202 * num203 * 0.5f; + } + else + { + num201 *= num203; + num202 *= num203; + } + } + Main.dust[num200].velocity *= 0.5f; + Dust expr_67C2_cp_0 = Main.dust[num200]; + expr_67C2_cp_0.velocity.X = expr_67C2_cp_0.velocity.X + num201; + Dust expr_67DD_cp_0 = Main.dust[num200]; + expr_67DD_cp_0.velocity.Y = expr_67DD_cp_0.velocity.Y + num202; + if (num197 <= 200) + { + Main.dust[num200].scale = 1.3f; + Main.dust[num200].noGravity = true; + } + } + } + if (this.type == 170) + { + for (int num204 = 0; num204 < 400; num204++) + { + int num205 = 133; + float num206 = 16f; + if (num204 > 100) + { + num206 = 11f; + } + if (num204 > 100) + { + num205 = 134; + } + if (num204 > 200) + { + num206 = 8f; + } + if (num204 > 200) + { + num205 = 133; + } + if (num204 > 300) + { + num206 = 5f; + } + if (num204 > 300) + { + num205 = 134; + } + int num207 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, num205, 0f, 0f, 100, default(Color), 1f); + float num208 = Main.dust[num207].velocity.X; + float num209 = Main.dust[num207].velocity.Y; + if (num208 == 0f && num209 == 0f) + { + num208 = 1f; + } + float num210 = (float)Math.Sqrt((double)(num208 * num208 + num209 * num209)); + num210 = num206 / num210; + if (num204 > 300) + { + num208 = num208 * num210 * 0.7f; + num209 *= num210; + } + else + { + if (num204 > 200) + { + num208 *= num210; + num209 = num209 * num210 * 0.7f; + } + else + { + if (num204 > 100) + { + num208 = num208 * num210 * 0.7f; + num209 *= num210; + } + else + { + num208 *= num210; + num209 = num209 * num210 * 0.7f; + } + } + } + Main.dust[num207].velocity *= 0.5f; + Dust expr_69DF_cp_0 = Main.dust[num207]; + expr_69DF_cp_0.velocity.X = expr_69DF_cp_0.velocity.X + num208; + Dust expr_69FA_cp_0 = Main.dust[num207]; + expr_69FA_cp_0.velocity.Y = expr_69FA_cp_0.velocity.Y + num209; + if (Main.rand.Next(3) != 0) + { + Main.dust[num207].scale = 1.3f; + Main.dust[num207].noGravity = true; + } + } + } + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 192; + this.height = 192; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.penetrate = -1; + this.Damage(); + } + else + { + if (this.type == 133 || this.type == 134 || this.type == 135 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 303) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 22; + this.height = 22; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + for (int num211 = 0; num211 < 30; num211++) + { + int num212 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num212].velocity *= 1.4f; + } + for (int num213 = 0; num213 < 20; num213++) + { + int num214 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 3.5f); + Main.dust[num214].noGravity = true; + Main.dust[num214].velocity *= 7f; + num214 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num214].velocity *= 3f; + } + for (int num215 = 0; num215 < 2; num215++) + { + float scaleFactor = 0.4f; + if (num215 == 1) + { + scaleFactor = 0.8f; + } + int num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num216].velocity *= scaleFactor; + Gore expr_6DD2_cp_0 = Main.gore[num216]; + expr_6DD2_cp_0.velocity.X = expr_6DD2_cp_0.velocity.X + 1f; + Gore expr_6DF0_cp_0 = Main.gore[num216]; + expr_6DF0_cp_0.velocity.Y = expr_6DF0_cp_0.velocity.Y + 1f; + num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num216].velocity *= scaleFactor; + Gore expr_6E6B_cp_0 = Main.gore[num216]; + expr_6E6B_cp_0.velocity.X = expr_6E6B_cp_0.velocity.X - 1f; + Gore expr_6E89_cp_0 = Main.gore[num216]; + expr_6E89_cp_0.velocity.Y = expr_6E89_cp_0.velocity.Y + 1f; + num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num216].velocity *= scaleFactor; + Gore expr_6F04_cp_0 = Main.gore[num216]; + expr_6F04_cp_0.velocity.X = expr_6F04_cp_0.velocity.X + 1f; + Gore expr_6F22_cp_0 = Main.gore[num216]; + expr_6F22_cp_0.velocity.Y = expr_6F22_cp_0.velocity.Y - 1f; + num216 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num216].velocity *= scaleFactor; + Gore expr_6F9D_cp_0 = Main.gore[num216]; + expr_6F9D_cp_0.velocity.X = expr_6F9D_cp_0.velocity.X - 1f; + Gore expr_6FBB_cp_0 = Main.gore[num216]; + expr_6FBB_cp_0.velocity.Y = expr_6FBB_cp_0.velocity.Y - 1f; + } + } + else + { + if (this.type == 139 || this.type == 140 || this.type == 141 || this.type == 142 || this.type == 143 || this.type == 144) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 80; + this.height = 80; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + for (int num217 = 0; num217 < 40; num217++) + { + int num218 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num218].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num218].scale = 0.5f; + Main.dust[num218].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num219 = 0; num219 < 70; num219++) + { + int num220 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num220].noGravity = true; + Main.dust[num220].velocity *= 5f; + num220 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num220].velocity *= 2f; + } + for (int num221 = 0; num221 < 3; num221++) + { + float scaleFactor2 = 0.33f; + if (num221 == 1) + { + scaleFactor2 = 0.66f; + } + if (num221 == 2) + { + scaleFactor2 = 1f; + } + int num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num222].velocity *= scaleFactor2; + Gore expr_7340_cp_0 = Main.gore[num222]; + expr_7340_cp_0.velocity.X = expr_7340_cp_0.velocity.X + 1f; + Gore expr_735E_cp_0 = Main.gore[num222]; + expr_735E_cp_0.velocity.Y = expr_735E_cp_0.velocity.Y + 1f; + num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num222].velocity *= scaleFactor2; + Gore expr_73F9_cp_0 = Main.gore[num222]; + expr_73F9_cp_0.velocity.X = expr_73F9_cp_0.velocity.X - 1f; + Gore expr_7417_cp_0 = Main.gore[num222]; + expr_7417_cp_0.velocity.Y = expr_7417_cp_0.velocity.Y + 1f; + num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num222].velocity *= scaleFactor2; + Gore expr_74B2_cp_0 = Main.gore[num222]; + expr_74B2_cp_0.velocity.X = expr_74B2_cp_0.velocity.X + 1f; + Gore expr_74D0_cp_0 = Main.gore[num222]; + expr_74D0_cp_0.velocity.Y = expr_74D0_cp_0.velocity.Y - 1f; + num222 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num222].velocity *= scaleFactor2; + Gore expr_756B_cp_0 = Main.gore[num222]; + expr_756B_cp_0.velocity.X = expr_756B_cp_0.velocity.X - 1f; + Gore expr_7589_cp_0 = Main.gore[num222]; + expr_7589_cp_0.velocity.Y = expr_7589_cp_0.velocity.Y - 1f; + } + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 10; + this.height = 10; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + } + else + { + if (this.type == 246) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num223 = 0; num223 < 10; num223++) + { + int num224 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num224].velocity *= 0.9f; + } + for (int num225 = 0; num225 < 5; num225++) + { + int num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num226].noGravity = true; + Main.dust[num226].velocity *= 3f; + num226 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num226].velocity *= 2f; + } + int num227 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num227].velocity *= 0.3f; + Gore expr_783D_cp_0 = Main.gore[num227]; + expr_783D_cp_0.velocity.X = expr_783D_cp_0.velocity.X + (float)Main.rand.Next(-1, 2); + Gore expr_7863_cp_0 = Main.gore[num227]; + expr_7863_cp_0.velocity.Y = expr_7863_cp_0.velocity.Y + (float)Main.rand.Next(-1, 2); + if (this.owner == Main.myPlayer) + { + int num228 = Main.rand.Next(2, 6); + for (int num229 = 0; num229 < num228; num229++) + { + float num230 = (float)Main.rand.Next(-100, 101); + num230 += 0.01f; + float num231 = (float)Main.rand.Next(-100, 101); + num230 -= 0.01f; + float num232 = (float)Math.Sqrt((double)(num230 * num230 + num231 * num231)); + num232 = 8f / num232; + num230 *= num232; + num231 *= num232; + Projectile.NewProjectile(this.center().X - this.lastVelocity.X, this.center().Y - this.lastVelocity.Y, num230, num231, 249, this.damage, this.knockBack, this.owner, 0f, 0f); + } + } + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 150; + this.height = 150; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.penetrate = -1; + this.Damage(); + } + else + { + if (this.type == 249) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + for (int num233 = 0; num233 < 7; num233++) + { + int num234 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num234].velocity *= 0.8f; + } + for (int num235 = 0; num235 < 2; num235++) + { + int num236 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num236].noGravity = true; + Main.dust[num236].velocity *= 2.5f; + num236 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num236].velocity *= 1.5f; + } + int num237 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num237].velocity *= 0.2f; + Gore expr_7C13_cp_0 = Main.gore[num237]; + expr_7C13_cp_0.velocity.X = expr_7C13_cp_0.velocity.X + (float)Main.rand.Next(-1, 2); + Gore expr_7C39_cp_0 = Main.gore[num237]; + expr_7C39_cp_0.velocity.Y = expr_7C39_cp_0.velocity.Y + (float)Main.rand.Next(-1, 2); + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 100; + this.height = 100; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + this.penetrate = -1; + this.Damage(); + } + else + { + if (this.type == 28 || this.type == 30 || this.type == 37 || this.type == 75 || this.type == 102 || this.type == 164) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 22; + this.height = 22; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + for (int num238 = 0; num238 < 20; num238++) + { + int num239 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num239].velocity *= 1.4f; + } + for (int num240 = 0; num240 < 10; num240++) + { + int num241 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[num241].noGravity = true; + Main.dust[num241].velocity *= 5f; + num241 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num241].velocity *= 3f; + } + int num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num242].velocity *= 0.4f; + Gore expr_7FCA_cp_0 = Main.gore[num242]; + expr_7FCA_cp_0.velocity.X = expr_7FCA_cp_0.velocity.X + 1f; + Gore expr_7FEA_cp_0 = Main.gore[num242]; + expr_7FEA_cp_0.velocity.Y = expr_7FEA_cp_0.velocity.Y + 1f; + num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num242].velocity *= 0.4f; + Gore expr_806E_cp_0 = Main.gore[num242]; + expr_806E_cp_0.velocity.X = expr_806E_cp_0.velocity.X - 1f; + Gore expr_808E_cp_0 = Main.gore[num242]; + expr_808E_cp_0.velocity.Y = expr_808E_cp_0.velocity.Y + 1f; + num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num242].velocity *= 0.4f; + Gore expr_8112_cp_0 = Main.gore[num242]; + expr_8112_cp_0.velocity.X = expr_8112_cp_0.velocity.X + 1f; + Gore expr_8132_cp_0 = Main.gore[num242]; + expr_8132_cp_0.velocity.Y = expr_8132_cp_0.velocity.Y - 1f; + num242 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num242].velocity *= 0.4f; + Gore expr_81B6_cp_0 = Main.gore[num242]; + expr_81B6_cp_0.velocity.X = expr_81B6_cp_0.velocity.X - 1f; + Gore expr_81D6_cp_0 = Main.gore[num242]; + expr_81D6_cp_0.velocity.Y = expr_81D6_cp_0.velocity.Y - 1f; + } + else + { + if (this.type == 29 || this.type == 108) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 14); + if (this.type == 29) + { + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 200; + this.height = 200; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + } + for (int num243 = 0; num243 < 50; num243++) + { + int num244 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num244].velocity *= 1.4f; + } + for (int num245 = 0; num245 < 80; num245++) + { + int num246 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num246].noGravity = true; + Main.dust[num246].velocity *= 5f; + num246 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num246].velocity *= 3f; + } + for (int num247 = 0; num247 < 2; num247++) + { + int num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num248].scale = 1.5f; + Gore expr_84DD_cp_0 = Main.gore[num248]; + expr_84DD_cp_0.velocity.X = expr_84DD_cp_0.velocity.X + 1.5f; + Gore expr_84FD_cp_0 = Main.gore[num248]; + expr_84FD_cp_0.velocity.Y = expr_84FD_cp_0.velocity.Y + 1.5f; + num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num248].scale = 1.5f; + Gore expr_8596_cp_0 = Main.gore[num248]; + expr_8596_cp_0.velocity.X = expr_8596_cp_0.velocity.X - 1.5f; + Gore expr_85B6_cp_0 = Main.gore[num248]; + expr_85B6_cp_0.velocity.Y = expr_85B6_cp_0.velocity.Y + 1.5f; + num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num248].scale = 1.5f; + Gore expr_864F_cp_0 = Main.gore[num248]; + expr_864F_cp_0.velocity.X = expr_864F_cp_0.velocity.X + 1.5f; + Gore expr_866F_cp_0 = Main.gore[num248]; + expr_866F_cp_0.velocity.Y = expr_866F_cp_0.velocity.Y - 1.5f; + num248 = Gore.NewGore(new Vector2(this.position.X + (float)(this.width / 2) - 24f, this.position.Y + (float)(this.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num248].scale = 1.5f; + Gore expr_8708_cp_0 = Main.gore[num248]; + expr_8708_cp_0.velocity.X = expr_8708_cp_0.velocity.X - 1.5f; + Gore expr_8728_cp_0 = Main.gore[num248]; + expr_8728_cp_0.velocity.Y = expr_8728_cp_0.velocity.Y - 1.5f; + } + this.position.X = this.position.X + (float)(this.width / 2); + this.position.Y = this.position.Y + (float)(this.height / 2); + this.width = 10; + this.height = 10; + this.position.X = this.position.X - (float)(this.width / 2); + this.position.Y = this.position.Y - (float)(this.height / 2); + } + else + { + if (this.type == 69) + { + Main.PlaySound(13, (int)this.position.X, (int)this.position.Y, 1); + for (int num249 = 0; num249 < 5; num249++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13, 0f, 0f, 0, default(Color), 1f); + } + for (int num250 = 0; num250 < 30; num250++) + { + int num251 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 33, 0f, -2f, 0, default(Color), 1.1f); + Main.dust[num251].alpha = 100; + Dust expr_88DA_cp_0 = Main.dust[num251]; + expr_88DA_cp_0.velocity.X = expr_88DA_cp_0.velocity.X * 1.5f; + Main.dust[num251].velocity *= 3f; + } + } + else + { + if (this.type == 70) + { + Main.PlaySound(13, (int)this.position.X, (int)this.position.Y, 1); + for (int num252 = 0; num252 < 5; num252++) + { + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13, 0f, 0f, 0, default(Color), 1f); + } + for (int num253 = 0; num253 < 30; num253++) + { + int num254 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 52, 0f, -2f, 0, default(Color), 1.1f); + Main.dust[num254].alpha = 100; + Dust expr_8A30_cp_0 = Main.dust[num254]; + expr_8A30_cp_0.velocity.X = expr_8A30_cp_0.velocity.X * 1.5f; + Main.dust[num254].velocity *= 3f; + } + } + else + { + if (this.type == 114 || this.type == 115) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num255 = 4; num255 < 31; num255++) + { + float num256 = this.lastVelocity.X * (30f / (float)num255); + float num257 = this.lastVelocity.Y * (30f / (float)num255); + int num258 = Dust.NewDust(new Vector2(this.position.X - num256, this.position.Y - num257), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.4f); + Main.dust[num258].noGravity = true; + Main.dust[num258].velocity *= 0.5f; + num258 = Dust.NewDust(new Vector2(this.position.X - num256, this.position.Y - num257), 8, 8, 27, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 0.9f); + Main.dust[num258].velocity *= 0.5f; + } + } + else + { + if (this.type == 116) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num259 = 4; num259 < 31; num259++) + { + float num260 = this.lastVelocity.X * (30f / (float)num259); + float num261 = this.lastVelocity.Y * (30f / (float)num259); + int num262 = Dust.NewDust(new Vector2(this.position.X - num260, this.position.Y - num261), 8, 8, 64, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.8f); + Main.dust[num262].noGravity = true; + num262 = Dust.NewDust(new Vector2(this.position.X - num260, this.position.Y - num261), 8, 8, 64, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.4f); + Main.dust[num262].noGravity = true; + } + } + else + { + if (this.type == 173) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num263 = 4; num263 < 24; num263++) + { + float num264 = this.lastVelocity.X * (30f / (float)num263); + float num265 = this.lastVelocity.Y * (30f / (float)num263); + int num266 = Main.rand.Next(3); + if (num266 == 0) + { + num266 = 15; + } + else + { + if (num266 == 1) + { + num266 = 57; + } + else + { + num266 = 58; + } + } + int num267 = Dust.NewDust(new Vector2(this.position.X - num264, this.position.Y - num265), 8, 8, num266, this.lastVelocity.X * 0.2f, this.lastVelocity.Y * 0.2f, 100, default(Color), 1.8f); + Main.dust[num267].velocity *= 1.5f; + Main.dust[num267].noGravity = true; + } + } + else + { + if (this.type == 132) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num268 = 4; num268 < 31; num268++) + { + float num269 = this.lastVelocity.X * (30f / (float)num268); + float num270 = this.lastVelocity.Y * (30f / (float)num268); + int num271 = Dust.NewDust(new Vector2(this.lastPosition.X - num269, this.lastPosition.Y - num270), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.8f); + Main.dust[num271].noGravity = true; + Main.dust[num271].velocity *= 0.5f; + num271 = Dust.NewDust(new Vector2(this.lastPosition.X - num269, this.lastPosition.Y - num270), 8, 8, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.4f); + Main.dust[num271].velocity *= 0.05f; + } + } + else + { + if (this.type == 156) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num272 = 4; num272 < 31; num272++) + { + float num273 = this.lastVelocity.X * (30f / (float)num272); + float num274 = this.lastVelocity.Y * (30f / (float)num272); + int num275 = Dust.NewDust(new Vector2(this.lastPosition.X - num273, this.lastPosition.Y - num274), 8, 8, 73, this.lastVelocity.X, this.lastVelocity.Y, 255, default(Color), 1.8f); + Main.dust[num275].noGravity = true; + Main.dust[num275].velocity *= 0.5f; + num275 = Dust.NewDust(new Vector2(this.lastPosition.X - num273, this.lastPosition.Y - num274), 8, 8, 73, this.lastVelocity.X, this.lastVelocity.Y, 255, default(Color), 1.4f); + Main.dust[num275].velocity *= 0.05f; + Main.dust[num275].noGravity = true; + } + } + else + { + if (this.type == 157) + { + Main.PlaySound(2, (int)this.position.X, (int)this.position.Y, 10); + for (int num276 = 4; num276 < 31; num276++) + { + int num277 = Dust.NewDust(this.position, this.width, this.height, 107, this.lastVelocity.X, this.lastVelocity.Y, 100, default(Color), 1.8f); + Main.dust[num277].noGravity = true; + Main.dust[num277].velocity *= 0.5f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (this.owner == Main.myPlayer) + { + if (this.type == 28 || this.type == 29 || this.type == 37 || this.type == 108 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 142 || this.type == 143 || this.type == 144) + { + int num278 = 3; + if (this.type == 28 || this.type == 37) + { + num278 = 4; + } + if (this.type == 29) + { + num278 = 7; + } + if (this.type == 142 || this.type == 143 || this.type == 144) + { + num278 = 5; + } + if (this.type == 108) + { + num278 = 10; + } + int num279 = (int)(this.position.X / 16f - (float)num278); + int num280 = (int)(this.position.X / 16f + (float)num278); + int num281 = (int)(this.position.Y / 16f - (float)num278); + int num282 = (int)(this.position.Y / 16f + (float)num278); + if (num279 < 0) + { + num279 = 0; + } + if (num280 > Main.maxTilesX) + { + num280 = Main.maxTilesX; + } + if (num281 < 0) + { + num281 = 0; + } + if (num282 > Main.maxTilesY) + { + num282 = Main.maxTilesY; + } + bool flag = false; + for (int num283 = num279; num283 <= num280; num283++) + { + for (int num284 = num281; num284 <= num282; num284++) + { + float num285 = Math.Abs((float)num283 - this.position.X / 16f); + float num286 = Math.Abs((float)num284 - this.position.Y / 16f); + double num287 = Math.Sqrt((double)(num285 * num285 + num286 * num286)); + if (num287 < (double)num278 && Main.tile[num283, num284] != null && Main.tile[num283, num284].wall == 0) + { + flag = true; + break; + } + } + } + for (int num288 = num279; num288 <= num280; num288++) + { + for (int num289 = num281; num289 <= num282; num289++) + { + float num290 = Math.Abs((float)num288 - this.position.X / 16f); + float num291 = Math.Abs((float)num289 - this.position.Y / 16f); + double num292 = Math.Sqrt((double)(num290 * num290 + num291 * num291)); + if (num292 < (double)num278) + { + bool flag2 = true; + if (Main.tile[num288, num289] != null && Main.tile[num288, num289].active()) + { + flag2 = true; + if (Main.tileDungeon[(int)Main.tile[num288, num289].type] || Main.tile[num288, num289].type == 21 || Main.tile[num288, num289].type == 26 || Main.tile[num288, num289].type == 107 || Main.tile[num288, num289].type == 108 || Main.tile[num288, num289].type == 111 || Main.tile[num288, num289].type == 226 || Main.tile[num288, num289].type == 237 || Main.tile[num288, num289].type == 221 || Main.tile[num288, num289].type == 222 || Main.tile[num288, num289].type == 223 || Main.tile[num288, num289].type == 211) + { + flag2 = false; + } + if (!Main.hardMode && Main.tile[num288, num289].type == 58) + { + flag2 = false; + } + if (flag2) + { + WorldGen.KillTile(num288, num289, false, false, false); + if (!Main.tile[num288, num289].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num288, (float)num289, 0f, 0); + } + } + } + if (flag2) + { + for (int num293 = num288 - 1; num293 <= num288 + 1; num293++) + { + for (int num294 = num289 - 1; num294 <= num289 + 1; num294++) + { + if (Main.tile[num293, num294] != null && Main.tile[num293, num294].wall > 0 && flag) + { + WorldGen.KillWall(num293, num294, false); + if (Main.tile[num293, num294].wall == 0 && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, "", 2, (float)num293, (float)num294, 0f, 0); + } + } + } + } + } + } + } + } + } + if (Main.netMode != 0) + { + NetMessage.SendData(29, -1, -1, "", this.identity, (float)this.owner, 0f, 0f, 0); + } + if (!this.noDropItem) + { + int num295 = -1; + if (this.aiStyle == 10) + { + int num296 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num297 = (int)(this.position.Y + (float)(this.width / 2)) / 16; + int num298 = 0; + int num299 = 2; + if (this.type == 109) + { + num298 = 147; + num299 = 0; + } + if (this.type == 31) + { + num298 = 53; + num299 = 0; + } + if (this.type == 42) + { + num298 = 53; + num299 = 0; + } + if (this.type == 56) + { + num298 = 112; + num299 = 0; + } + if (this.type == 65) + { + num298 = 112; + num299 = 0; + } + if (this.type == 67) + { + num298 = 116; + num299 = 0; + } + if (this.type == 68) + { + num298 = 116; + num299 = 0; + } + if (this.type == 71) + { + num298 = 123; + num299 = 0; + } + if (this.type == 39) + { + num298 = 59; + num299 = 176; + } + if (this.type == 40) + { + num298 = 57; + num299 = 172; + } + if (this.type == 179) + { + num298 = 224; + num299 = 0; + } + if (this.type == 241) + { + num298 = 234; + num299 = 0; + } + if (Main.tile[num296, num297].halfBrick() && this.velocity.Y > 0f && Math.Abs(this.velocity.Y) > Math.Abs(this.velocity.X)) + { + num297--; + } + if (!Main.tile[num296, num297].active()) + { + WorldGen.PlaceTile(num296, num297, num298, false, true, -1, 0); + if (Main.tile[num296, num297].active() && (int)Main.tile[num296, num297].type == num298) + { + NetMessage.SendData(17, -1, -1, "", 1, (float)num296, (float)num297, (float)num298, 0); + } + else + { + if (num299 > 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num299, 1, false, 0, false); + } + } + } + else + { + if (num299 > 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, num299, 1, false, 0, false); + } + } + } + if (this.type == 1 && Main.rand.Next(3) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false); + } + if (this.type == 103 && Main.rand.Next(6) == 0) + { + if (Main.rand.Next(3) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 545, 1, false, 0, false); + } + else + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false); + } + } + if (this.type == 2 && Main.rand.Next(3) == 0) + { + if (Main.rand.Next(3) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 41, 1, false, 0, false); + } + else + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false); + } + } + if (this.type == 172 && Main.rand.Next(3) == 0) + { + if (Main.rand.Next(3) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 988, 1, false, 0, false); + } + else + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 40, 1, false, 0, false); + } + } + if (this.type == 171) + { + if (this.ai[1] == 0f) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 985, 1, false, 0, false); + } + else + { + if (this.ai[1] < 10f) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 965, (int)(10f - this.ai[1]), false, 0, false); + } + } + } + if (this.type == 91 && Main.rand.Next(6) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 516, 1, false, 0, false); + } + if (this.type == 50 && Main.rand.Next(3) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 282, 1, false, 0, false); + } + if (this.type == 53 && Main.rand.Next(3) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 286, 1, false, 0, false); + } + if (this.type == 48 && Main.rand.Next(2) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 279, 1, false, 0, false); + } + if (this.type == 54 && Main.rand.Next(2) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 287, 1, false, 0, false); + } + if (this.type == 3 && Main.rand.Next(2) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 42, 1, false, 0, false); + } + if (this.type == 4 && Main.rand.Next(4) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 47, 1, false, 0, false); + } + if (this.type == 12 && this.damage > 100) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 75, 1, false, 0, false); + } + if (this.type == 155) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 859, 1, false, 0, false); + } + if (this.type == 21 && Main.rand.Next(2) == 0) + { + num295 = Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 154, 1, false, 0, false); + } + if (Main.netMode == 1 && num295 >= 0) + { + NetMessage.SendData(21, -1, -1, "", num295, 0f, 0f, 0f, 0); + } + } + if (this.type == 69 || this.type == 70) + { + int num300 = (int)(this.position.X + (float)(this.width / 2)) / 16; + int num301 = (int)(this.position.Y + (float)(this.height / 2)) / 16; + for (int num302 = num300 - 4; num302 <= num300 + 4; num302++) + { + for (int num303 = num301 - 4; num303 <= num301 + 4; num303++) + { + if (Math.Abs(num302 - num300) + Math.Abs(num303 - num301) < 6) + { + if (this.type == 69) + { + if (Main.tile[num302, num303].type == 2) + { + Main.tile[num302, num303].type = 109; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 1 || Main.tileMoss[(int)Main.tile[num302, num303].type]) + { + Main.tile[num302, num303].type = 117; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 53 || Main.tile[num302, num303].type == 234) + { + Main.tile[num302, num303].type = 116; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 23 || Main.tile[num302, num303].type == 199) + { + Main.tile[num302, num303].type = 109; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 25 || Main.tile[num302, num303].type == 203) + { + Main.tile[num302, num303].type = 117; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 161 || Main.tile[num302, num303].type == 163 || Main.tile[num302, num303].type == 200) + { + Main.tile[num302, num303].type = 164; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 112) + { + Main.tile[num302, num303].type = 116; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 161 || Main.tile[num302, num303].type == 163) + { + Main.tile[num302, num303].type = 164; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + } + } + } + } + } + } + } + } + else + { + if (Main.tile[num302, num303].type == 2) + { + Main.tile[num302, num303].type = 23; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 1 || Main.tileMoss[(int)Main.tile[num302, num303].type]) + { + Main.tile[num302, num303].type = 25; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 53) + { + Main.tile[num302, num303].type = 112; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 109) + { + Main.tile[num302, num303].type = 23; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 117) + { + Main.tile[num302, num303].type = 25; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 116) + { + Main.tile[num302, num303].type = 112; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + else + { + if (Main.tile[num302, num303].type == 161 || Main.tile[num302, num303].type == 164 || Main.tile[num302, num303].type == 200) + { + Main.tile[num302, num303].type = 163; + WorldGen.SquareTileFrame(num302, num303, true); + NetMessage.SendTileSquare(-1, num302, num303, 1); + } + } + } + } + } + } + } + } + } + } + } + } + } + this.active = false; + } + public Color GetAlpha(Color newColor) + { + if (this.type == 34 || this.type == 15 || this.type == 93 || this.type == 94 || this.type == 95 || this.type == 96 || this.type == 253 || this.type == 258 || (this.type == 102 && this.alpha < 255)) + { + return new Color(200, 200, 200, 25); + } + if (this.type == 16) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 76 || this.type == 77 || this.type == 78) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 308) + { + return new Color(200, 200, 255, 125); + } + if (this.type == 263) + { + if (this.timeLeft < 255) + { + return new Color(255, 255, 255, (int)((byte)this.timeLeft)); + } + return new Color(255, 255, 255, 255); + } + else + { + if (this.type == 274) + { + if (this.timeLeft < 85) + { + byte b = (byte)(this.timeLeft * 3); + byte a = (byte)(100f * ((float)b / 255f)); + return new Color((int)b, (int)b, (int)b, (int)a); + } + return new Color(255, 255, 255, 100); + } + else + { + if (this.type == 5) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 300 || this.type == 301) + { + return new Color(250, 250, 250, 50); + } + if (this.type == 304) + { + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, (int)((byte)((float)(255 - this.alpha) / 3f))); + } + if (this.type == 116 || this.type == 132 || this.type == 156 || this.type == 157 || this.type == 157 || this.type == 173) + { + if (this.localAI[1] >= 15f) + { + return new Color(255, 255, 255, this.alpha); + } + if (this.localAI[1] < 5f) + { + return new Color(0, 0, 0, 0); + } + int num = (int)((this.localAI[1] - 5f) / 10f * 255f); + return new Color(num, num, num, num); + } + else + { + if (this.type == 254) + { + if (this.timeLeft < 30) + { + float num2 = (float)this.timeLeft / 30f; + this.alpha = (int)(255f - 255f * num2); + } + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0); + } + if (this.type == 265) + { + if (this.alpha > 0) + { + return new Color(0, 0, 0, 0); + } + return new Color(255, 255, 255, 0); + } + else + { + if (this.type == 270) + { + if (this.alpha > 0) + { + return new Color(0, 0, 0, 0); + } + return new Color(255, 255, 255, 200); + } + else + { + if (this.type == 257) + { + if (this.alpha > 200) + { + return new Color(0, 0, 0, 0); + } + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0); + } + else + { + if (this.type == 259) + { + if (this.alpha > 200) + { + return new Color(0, 0, 0, 0); + } + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0); + } + else + { + if (this.type >= 150 && this.type <= 152) + { + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 255 - this.alpha); + } + if (this.type == 250) + { + return new Color(0, 0, 0, 0); + } + if (this.type == 251) + { + int num3 = 255 - this.alpha; + int num4 = 255 - this.alpha; + int num5 = 255 - this.alpha; + return new Color(num3, num4, num5, 0); + } + if (this.type == 131) + { + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0); + } + if (this.type == 211) + { + return new Color(255, 255, 255, 0); + } + if (this.type == 229) + { + return new Color(255, 255, 255, 50); + } + if (this.type == 221) + { + return new Color(255, 255, 255, 200); + } + if (this.type == 207) + { + return new Color(0, 0, 0, 0); + } + if (this.type != 242) + { + int num3; + int num4; + int num5; + if (this.type == 209) + { + num3 = (int)newColor.R - this.alpha; + num4 = (int)newColor.G - this.alpha; + num5 = (int)newColor.B - this.alpha / 2; + } + else + { + if (this.type == 130) + { + return new Color(255, 255, 255, 175); + } + if (this.type == 182) + { + return new Color(255, 255, 255, 200); + } + if (this.type == 226) + { + num3 = 255; + num4 = 255; + num5 = 255; + float num6 = (float)Main.mouseTextColor / 200f - 0.3f; + num3 = (int)((float)num3 * num6); + num4 = (int)((float)num4 * num6); + num5 = (int)((float)num5 * num6); + num3 += 50; + if (num3 > 255) + { + num3 = 255; + } + num4 += 50; + if (num4 > 255) + { + num4 = 255; + } + num5 += 50; + if (num5 > 255) + { + num5 = 255; + } + return new Color(num3, num4, num5, 200); + } + if (this.type == 227) + { + num4 = (num3 = (num5 = 255)); + float num7 = (float)Main.mouseTextColor / 100f - 1.6f; + num3 = (int)((float)num3 * num7); + num4 = (int)((float)num4 * num7); + num5 = (int)((float)num5 * num7); + int a2 = (int)(100f * num7); + num3 += 50; + if (num3 > 255) + { + num3 = 255; + } + num4 += 50; + if (num4 > 255) + { + num4 = 255; + } + num5 += 50; + if (num5 > 255) + { + num5 = 255; + } + return new Color(num3, num4, num5, a2); + } + if (this.type == 114 || this.type == 115) + { + if (this.localAI[1] >= 15f) + { + return new Color(255, 255, 255, this.alpha); + } + if (this.localAI[1] < 5f) + { + return new Color(0, 0, 0, 0); + } + int num8 = (int)((this.localAI[1] - 5f) / 10f * 255f); + return new Color(num8, num8, num8, num8); + } + else + { + if (this.type == 83 || this.type == 88 || this.type == 89 || this.type == 90 || this.type == 100 || this.type == 104 || this.type == 279 || (this.type >= 283 && this.type <= 287)) + { + if (this.alpha < 200) + { + return new Color(255 - this.alpha, 255 - this.alpha, 255 - this.alpha, 0); + } + return new Color(0, 0, 0, 0); + } + else + { + if (this.type == 34 || this.type == 35 || this.type == 15 || this.type == 19 || this.type == 44 || this.type == 45) + { + return Color.White; + } + if (this.type == 79) + { + num3 = Main.DiscoR; + num4 = Main.DiscoG; + num5 = Main.DiscoB; + return default(Color); + } + if (this.type == 9 || this.type == 15 || this.type == 34 || this.type == 50 || this.type == 53 || this.type == 76 || this.type == 77 || this.type == 78 || this.type == 92 || this.type == 91) + { + num3 = (int)newColor.R - this.alpha / 3; + num4 = (int)newColor.G - this.alpha / 3; + num5 = (int)newColor.B - this.alpha / 3; + } + else + { + if (this.type == 18) + { + return new Color(255, 255, 255, 50); + } + if (this.type == 16 || this.type == 44 || this.type == 45) + { + num3 = (int)newColor.R; + num4 = (int)newColor.G; + num5 = (int)newColor.B; + } + else + { + if (this.type == 12 || this.type == 72 || this.type == 86 || this.type == 87) + { + return new Color(255, 255, 255, (int)newColor.A - this.alpha); + } + } + } + } + } + } + float num9 = (float)(255 - this.alpha) / 255f; + num3 = (int)((float)newColor.R * num9); + num4 = (int)((float)newColor.G * num9); + num5 = (int)((float)newColor.B * num9); + int num10 = (int)newColor.A - this.alpha; + if (num10 < 0) + { + num10 = 0; + } + if (num10 > 255) + { + num10 = 255; + } + return new Color(num3, num4, num5, num10); + } + if (this.alpha < 140) + { + return new Color(255, 255, 255, 100); + } + return new Color(0, 0, 0, 0); + } + } + } + } + } + } + } + } + } +} diff --git a/Terraria/Rain.cs b/Terraria/Rain.cs new file mode 100644 index 0000000..311c49d --- /dev/null +++ b/Terraria/Rain.cs @@ -0,0 +1,123 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Rain + { + public Vector2 position; + public Vector2 velocity; + public float scale; + public int alpha; + public bool active; + public byte type; + public static void MakeRain() + { + if ((double)Main.screenPosition.Y > Main.worldSurface * 16.0) + { + return; + } + if (Main.gameMenu) + { + return; + } + float num = (float)Main.screenWidth / 1920f; + num *= 25f; + num *= 0.25f + 1f * Main.cloudAlpha; + int num2 = 0; + while ((float)num2 < num) + { + int num3 = 600; + if (Main.player[Main.myPlayer].velocity.Y < 0f) + { + num3 += (int)(Math.Abs(Main.player[Main.myPlayer].velocity.Y) * 30f); + } + Vector2 vector; + vector.X = (float)Main.rand.Next((int)Main.screenPosition.X - num3, (int)Main.screenPosition.X + Main.screenWidth + num3); + vector.Y = Main.screenPosition.Y - (float)Main.rand.Next(20, 100); + vector.X -= Main.windSpeed * 15f * 40f; + vector.X += Main.player[Main.myPlayer].velocity.X * 40f; + if (vector.X < 0f) + { + vector.X = 0f; + } + if (vector.X > (float)((Main.maxTilesX - 1) * 16)) + { + vector.X = (float)((Main.maxTilesX - 1) * 16); + } + int num4 = (int)vector.X / 16; + int num5 = (int)vector.Y / 16; + if (num4 < 0) + { + num4 = 0; + } + if (num4 > Main.maxTilesX - 1) + { + num4 = Main.maxTilesX - 1; + } + if (Main.gameMenu || (!WorldGen.SolidTile(num4, num5) && Main.tile[num4, num5].wall <= 0)) + { + Vector2 vector2 = new Vector2(Main.windSpeed * 12f, 14f); + Rain.NewRain(vector, vector2); + } + num2++; + } + } + public void Update() + { + this.position += this.velocity; + if (Collision.SolidCollision(this.position, 2, 2) || this.position.Y > Main.screenPosition.Y + (float)Main.screenHeight + 100f || Collision.WetCollision(this.position, 2, 2)) + { + this.active = false; + if ((float)Main.rand.Next(100) < Main.gfxQuality * 100f) + { + int num = Dust.NewDust(this.position - this.velocity, 2, 2, 154, 0f, 0f, 0, default(Color), 1f); + Dust expr_C3_cp_0 = Main.dust[num]; + expr_C3_cp_0.position.X = expr_C3_cp_0.position.X - 2f; + Main.dust[num].alpha = 38; + Main.dust[num].velocity *= 0.1f; + Main.dust[num].velocity += -this.velocity * 0.025f; + Main.dust[num].scale = 0.75f; + } + } + } + public static int NewRain(Vector2 Position, Vector2 Velocity) + { + int num = -1; + int num2 = (int)((float)Main.maxRain * Main.cloudAlpha); + if (num2 > Main.maxRain) + { + num2 = Main.maxRain; + } + float num3 = (1f + Main.gfxQuality) / 2f; + if ((double)num3 < 0.9) + { + num2 = (int)((float)num2 * num3); + } + float num4 = (float)(800 - Main.snowTiles); + if (num4 < 0f) + { + num4 = 0f; + } + num4 /= 800f; + num2 = (int)((float)num2 * num4); + for (int i = 0; i < num2; i++) + { + if (!Main.rain[i].active) + { + num = i; + break; + } + } + if (num == -1) + { + return Main.maxRain; + } + Main.rain[num].active = true; + Main.rain[num].position = Position; + Main.rain[num].scale = 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Main.rain[num].velocity = Velocity * Main.rain[num].scale; + Main.rain[num].type = (byte)Main.rand.Next(3); + return num; + } + } +} diff --git a/Terraria/Recipe.cs b/Terraria/Recipe.cs new file mode 100644 index 0000000..3210600 --- /dev/null +++ b/Terraria/Recipe.cs @@ -0,0 +1,4892 @@ +using System; +namespace Terraria +{ + public class Recipe + { + public static int maxRequirements = 15; + public static int maxRecipes = 900; + public static int numRecipes = 0; + private static Recipe newRecipe = new Recipe(); + public Item createItem = new Item(); + public Item[] requiredItem = new Item[Recipe.maxRequirements]; + public int[] requiredTile = new int[Recipe.maxRequirements]; + public bool needHoney; + public bool needWater; + public bool anyWood; + public bool anyIronBar; + public Recipe() + { + for (int i = 0; i < Recipe.maxRequirements; i++) + { + this.requiredItem[i] = new Item(); + this.requiredTile[i] = -1; + } + } + public void Create() + { + int num = 0; + while (num < Recipe.maxRequirements && this.requiredItem[num].type != 0) + { + int num2 = this.requiredItem[num].stack; + for (int i = 0; i < 58; i++) + { + if (Main.player[Main.myPlayer].inventory[i].IsTheSameAs(this.requiredItem[num]) || this.useWood(Main.player[Main.myPlayer].inventory[i].type, this.requiredItem[num].type) || this.useIronBar(Main.player[Main.myPlayer].inventory[i].type, this.requiredItem[num].type)) + { + if (Main.player[Main.myPlayer].inventory[i].stack > num2) + { + Main.player[Main.myPlayer].inventory[i].stack -= num2; + num2 = 0; + } + else + { + num2 -= Main.player[Main.myPlayer].inventory[i].stack; + Main.player[Main.myPlayer].inventory[i] = new Item(); + } + } + if (num2 <= 0) + { + break; + } + } + num++; + } + Recipe.FindRecipes(); + } + public bool useWood(int invType, int reqType) + { + return (reqType == 9 || reqType == 619 || reqType == 620 || reqType == 621 || reqType == 911) && (this.anyWood && (invType == 9 || invType == 619 || invType == 620 || invType == 621 || invType == 911)); + } + public bool useIronBar(int invType, int reqType) + { + return (reqType == 22 || reqType == 704) && (this.anyIronBar && (invType == 22 || invType == 704)); + } + public static void FindRecipes() + { + int num = Main.availableRecipe[Main.focusRecipe]; + float num2 = Main.availableRecipeY[Main.focusRecipe]; + for (int i = 0; i < Recipe.maxRecipes; i++) + { + Main.availableRecipe[i] = 0; + } + Main.numAvailableRecipes = 0; + int num3 = 0; + while (num3 < Recipe.maxRecipes && Main.recipe[num3].createItem.type != 0) + { + bool flag = true; + bool flag2 = false; + if (Main.guideItem.type > 0 && Main.guideItem.stack > 0 && Main.guideItem.name != "") + { + flag2 = true; + } + if (flag2) + { + for (int j = 0; j < Recipe.maxRequirements; j++) + { + if (Main.recipe[num3].requiredItem[j].type == 0) + { + break; + } + if (Main.guideItem.IsTheSameAs(Main.recipe[num3].requiredItem[j]) || Main.recipe[num3].useWood(Main.guideItem.type, Main.recipe[num3].requiredItem[j].type) || Main.recipe[num3].useIronBar(Main.guideItem.type, Main.recipe[num3].requiredItem[j].type)) + { + Main.availableRecipe[Main.numAvailableRecipes] = num3; + Main.numAvailableRecipes++; + break; + } + } + } + else + { + int num4 = 0; + while (num4 < Recipe.maxRequirements && Main.recipe[num3].requiredItem[num4].type != 0) + { + int num5 = Main.recipe[num3].requiredItem[num4].stack; + for (int k = 0; k < 58; k++) + { + if (Main.player[Main.myPlayer].inventory[k].IsTheSameAs(Main.recipe[num3].requiredItem[num4]) || Main.recipe[num3].useWood(Main.player[Main.myPlayer].inventory[k].type, Main.recipe[num3].requiredItem[num4].type) || Main.recipe[num3].useIronBar(Main.player[Main.myPlayer].inventory[k].type, Main.recipe[num3].requiredItem[num4].type)) + { + num5 -= Main.player[Main.myPlayer].inventory[k].stack; + } + if (num5 <= 0) + { + break; + } + } + if (num5 > 0) + { + flag = false; + break; + } + num4++; + } + if (flag) + { + bool flag3 = true; + int num6 = 0; + while (num6 < Recipe.maxRequirements && Main.recipe[num3].requiredTile[num6] != -1) + { + if (!Main.player[Main.myPlayer].adjTile[Main.recipe[num3].requiredTile[num6]]) + { + flag3 = false; + break; + } + num6++; + } + if (flag3 && (!Main.recipe[num3].needWater || Main.recipe[num3].needWater == Main.player[Main.myPlayer].adjWater) && (!Main.recipe[num3].needHoney || Main.recipe[num3].needHoney == Main.player[Main.myPlayer].adjHoney)) + { + Main.availableRecipe[Main.numAvailableRecipes] = num3; + Main.numAvailableRecipes++; + } + } + } + num3++; + } + for (int l = 0; l < Main.numAvailableRecipes; l++) + { + if (num == Main.availableRecipe[l]) + { + Main.focusRecipe = l; + break; + } + } + if (Main.focusRecipe >= Main.numAvailableRecipes) + { + Main.focusRecipe = Main.numAvailableRecipes - 1; + } + if (Main.focusRecipe < 0) + { + Main.focusRecipe = 0; + } + float num7 = Main.availableRecipeY[Main.focusRecipe] - num2; + for (int m = 0; m < Recipe.maxRecipes; m++) + { + Main.availableRecipeY[m] -= num7; + } + } + public static void SetupRecipes() + { + Recipe.newRecipe.createItem.SetDefaults(8, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(23, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(523, false); + Recipe.newRecipe.createItem.stack = 33; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 33; + Recipe.newRecipe.requiredItem[1].SetDefaults(522, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1333, false); + Recipe.newRecipe.createItem.stack = 33; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 33; + Recipe.newRecipe.requiredItem[1].SetDefaults(1332, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(974, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(664, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(427, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(177, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(428, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(178, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(429, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(179, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(432, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(180, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(430, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(181, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(431, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(182, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1245, false); + Recipe.newRecipe.createItem.stack = 3; + Recipe.newRecipe.requiredItem[0].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(999, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(985, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Rope"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(966, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Torch"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(235, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(166, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(23, false); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(286, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(282, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults(23, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mug"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass"); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Ale"); + Recipe.newRecipe.requiredItem[0].SetDefaults(351, false); + Recipe.newRecipe.requiredTile[0] = 94; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bowl of Soup"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bowl"); + Recipe.newRecipe.requiredItem[1].SetDefaults("Mushroom"); + Recipe.newRecipe.requiredItem[2].SetDefaults("Goldfish"); + Recipe.newRecipe.requiredTile[0] = 96; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(968, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(967, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wood"); + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bottle"); + Recipe.newRecipe.createItem.stack = 2; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass"); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bottled Water"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bottle"); + Recipe.newRecipe.needWater = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1134, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bottle"); + Recipe.newRecipe.needHoney = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(422, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults("Bottled Water"); + Recipe.newRecipe.requiredItem[1].SetDefaults(501, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredItem[2].SetDefaults(369, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(423, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults("Bottled Water"); + Recipe.newRecipe.requiredItem[1].SetDefaults(370, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(59, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(28, false); + Recipe.newRecipe.createItem.stack = 2; + Recipe.newRecipe.requiredItem[0].SetDefaults(5, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(23, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredItem[2].SetDefaults(31, false); + Recipe.newRecipe.requiredItem[2].stack = 2; + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Healing Potion"); + Recipe.newRecipe.requiredItem[0].SetDefaults(28, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredItem[1].SetDefaults(183, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Greater Healing Potion"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(501, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredItem[2].SetDefaults(502, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(110, false); + Recipe.newRecipe.createItem.stack = 2; + Recipe.newRecipe.requiredItem[0].SetDefaults(75, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(23, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredItem[2].SetDefaults(31, false); + Recipe.newRecipe.requiredItem[2].stack = 2; + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mana Potion"); + Recipe.newRecipe.requiredItem[0].SetDefaults(110, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredItem[1].SetDefaults(183, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(226, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(28, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(110, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(227, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Healing Potion"); + Recipe.newRecipe.requiredItem[1].SetDefaults("Mana Potion"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(288, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(318, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(317, false); + Recipe.newRecipe.requiredItem[3].SetDefaults("Obsidian"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(289, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Mushroom"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(290, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Cactus"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(291, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(317, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Coral"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(292, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Iron Ore"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(292, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Lead Ore"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(293, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(314, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[3].SetDefaults("Fallen Star"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(294, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(314, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(316, false); + Recipe.newRecipe.requiredItem[3].SetDefaults("Fallen Star"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(295, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[3].SetDefaults("Feather"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(296, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(314, false); + Recipe.newRecipe.requiredItem[3].SetDefaults("Gold Ore"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(296, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(314, false); + Recipe.newRecipe.requiredItem[3].SetDefaults("Platinum Ore"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(297, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(314, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(298, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Glowing Mushroom"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(299, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(315, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(300, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(316, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Rotten Chunk"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(300, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(316, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1330, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(301, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(316, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Cactus"); + Recipe.newRecipe.requiredItem[3].SetDefaults("Worm Teeth"); + Recipe.newRecipe.requiredItem[4].SetDefaults("Stinger"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(302, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(317, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(319, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(303, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults("Lens"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(304, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(313, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(319, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(305, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(318, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(316, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(315, false); + Recipe.newRecipe.requiredItem[4].SetDefaults("Feather"); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1359, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(209, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1354, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(174, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1340, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1339, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1355, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1348, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1356, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1332, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1353, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(522, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1357, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1346, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1358, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(126, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1345, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 243; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(949, false); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(593, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(40, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(3, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Flaming Arrow"); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(988, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults(974, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(51, false); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(75, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Unholy Arrow"); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults(69, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Hellfire Arrow"); + Recipe.newRecipe.createItem.stack = 25; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredItem[1].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[2].stack = 5; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(545, false); + Recipe.newRecipe.createItem.stack = 35; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 35; + Recipe.newRecipe.requiredItem[1].SetDefaults(522, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1334, false); + Recipe.newRecipe.createItem.stack = 35; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 35; + Recipe.newRecipe.requiredItem[1].SetDefaults(1332, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(516, false); + Recipe.newRecipe.createItem.stack = 45; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 45; + Recipe.newRecipe.requiredItem[1].SetDefaults(501, false); + Recipe.newRecipe.requiredItem[1].stack = 6; + Recipe.newRecipe.requiredItem[2].SetDefaults(526, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1341, false); + Recipe.newRecipe.createItem.stack = 35; + Recipe.newRecipe.requiredItem[0].SetDefaults(40, false); + Recipe.newRecipe.requiredItem[0].stack = 35; + Recipe.newRecipe.requiredItem[1].SetDefaults(1339, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Meteor Shot"); + Recipe.newRecipe.createItem.stack = 70; + Recipe.newRecipe.requiredItem[0].SetDefaults("Musket Ball"); + Recipe.newRecipe.requiredItem[0].stack = 70; + Recipe.newRecipe.requiredItem[1].SetDefaults(117, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(278, false); + Recipe.newRecipe.createItem.stack = 70; + Recipe.newRecipe.requiredItem[0].SetDefaults("Musket Ball"); + Recipe.newRecipe.requiredItem[0].stack = 70; + Recipe.newRecipe.requiredItem[1].SetDefaults(21, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(515, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults("Musket Ball"); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(546, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults("Musket Ball"); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(522, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1335, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults("Musket Ball"); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1332, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1179, false); + Recipe.newRecipe.createItem.stack = 70; + Recipe.newRecipe.requiredItem[0].SetDefaults("Musket Ball"); + Recipe.newRecipe.requiredItem[0].stack = 70; + Recipe.newRecipe.requiredItem[1].SetDefaults(1006, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1302, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1432, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1344, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1349, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1432, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1345, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1350, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1432, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1346, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1351, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1432, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1347, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1352, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1432, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1348, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1342, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1432, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(1339, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(67, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(60, false); + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(287, false); + Recipe.newRecipe.createItem.stack = 20; + Recipe.newRecipe.requiredItem[0].SetDefaults(279, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(67, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(94, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(632, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(631, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(913, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(633, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1702, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(170, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1431, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bottle"); + Recipe.newRecipe.requiredItem[1].SetDefaults(75, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Chinese Lantern"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults("Torch"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tiki Torch"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Torch"); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lamp Post"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Iron Bar"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults("Glass"); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredItem[2].SetDefaults("Torch"); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Skull Lantern"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Torch"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(663, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(662, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Clay Pot"); + Recipe.newRecipe.requiredItem[0].SetDefaults(133, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Pink Vase"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Clay Block"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bowl"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Clay Block"); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Glass"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults(169, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(392, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1267, false); + Recipe.newRecipe.createItem.stack = 20; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass Wall"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Amethyst"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1268, false); + Recipe.newRecipe.createItem.stack = 20; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass Wall"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Topaz"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1269, false); + Recipe.newRecipe.createItem.stack = 20; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass Wall"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Sapphire"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1270, false); + Recipe.newRecipe.createItem.stack = 20; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass Wall"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Emerald"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1271, false); + Recipe.newRecipe.createItem.stack = 20; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass Wall"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Ruby"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1272, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults("Glass Wall"); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults("Amethyst"); + Recipe.newRecipe.requiredItem[2].SetDefaults("Topaz"); + Recipe.newRecipe.requiredItem[3].SetDefaults("Sapphire"); + Recipe.newRecipe.requiredItem[4].SetDefaults("Emerald"); + Recipe.newRecipe.requiredItem[5].SetDefaults("Ruby"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(775, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredItem[1].SetDefaults(23, false); + Recipe.newRecipe.requiredTile[0] = 217; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1102, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(1101, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gray Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gray Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Gray Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Red Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(133, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Red Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Red Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults("Copper Ore"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Copper Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Silver Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silver Ore"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Gold Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults("Gold Ore"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults("Tin Ore"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults("Tungsten Ore"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Brick Wall"); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Brick"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults("Platinum Ore"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Hellstone Brick"); + Recipe.newRecipe.requiredItem[0].SetDefaults(174, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(3, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(192, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(173, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(330, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(192, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(606, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(577, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(594, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(593, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(595, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(594, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(883, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(664, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(884, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(883, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(587, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(586, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(592, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(591, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(607, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(169, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(608, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(607, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(412, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(408, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(409, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(417, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(412, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(609, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(61, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(610, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(609, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(413, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(172, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(418, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(413, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(414, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(176, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(419, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(414, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(611, false); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(424, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(133, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(615, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(611, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(612, false); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(424, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(169, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(616, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(612, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(613, false); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(424, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredItem[2].SetDefaults(255, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(617, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(613, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(614, false); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(424, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(618, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(614, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(415, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(364, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(420, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(415, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(416, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(365, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(421, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(416, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(604, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(366, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(605, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(604, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1589, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1104, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1590, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(1589, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1591, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1105, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1592, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(1591, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1593, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1106, false); + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1594, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(1593, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(577, false); + Recipe.newRecipe.createItem.stack = 5; + Recipe.newRecipe.requiredItem[0].SetDefaults(56, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(61, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(176, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(2, false); + Recipe.newRecipe.needWater = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(30, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(2, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(26, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1723, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredTile[0] = 191; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(93, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(623, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(622, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(927, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(624, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(25, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(34, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(48, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(32, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(36, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Piano"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredItem[2].SetDefaults("Book"); + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bed"); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Dresser"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 16; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(651, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(629, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(626, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(639, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(636, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(642, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredItem[2].SetDefaults("Book"); + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(645, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(648, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 16; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(650, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(628, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(625, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(638, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(635, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(641, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredItem[2].SetDefaults("Book"); + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(644, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(647, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 16; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(912, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(915, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(914, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(917, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(916, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(919, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredItem[2].SetDefaults("Book"); + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(920, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(918, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 16; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(652, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(630, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(627, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(640, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(637, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(643, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredItem[2].SetDefaults("Book"); + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(646, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(649, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 16; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Sign"); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1447, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1448, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(479, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(480, false); + Recipe.newRecipe.createItem.stack = 2; + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(498, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bookcase"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Book"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Barrel"); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyIronBar = true; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Grandfather Clock"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Iron Bar"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults("Glass"); + Recipe.newRecipe.requiredItem[1].stack = 6; + Recipe.newRecipe.requiredItem[2].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[2].stack = 10; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Keg"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 14; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Loom"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1706, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1714, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1715, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bench"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 106; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Sawmill"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Iron Bar"); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredItem[2].SetDefaults("Chain"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyWood = true; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(727, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(728, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(729, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(24, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(196, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(39, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(733, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(734, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(735, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(656, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(657, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(658, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(620, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(730, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(731, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(732, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(653, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(654, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(655, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(619, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(924, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(925, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(926, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(921, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(922, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(923, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(911, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(736, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(737, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(738, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(659, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(660, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(661, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(621, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1703, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(170, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1709, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(170, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1713, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(170, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1719, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(170, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1707, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1127, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1711, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1127, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1717, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1127, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1721, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1127, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1708, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1344, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1712, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1344, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1718, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1344, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1722, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1344, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(894, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(895, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(896, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(881, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(882, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(750, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(816, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(807, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(812, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(276, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(764, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(183, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(818, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(183, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(810, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(183, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(814, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(183, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(763, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(836, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 218; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(770, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(763, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(817, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(763, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(809, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(763, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(813, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(763, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(828, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(763, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(762, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(23, false); + Recipe.newRecipe.requiredTile[0] = 220; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(769, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults(762, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(815, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(762, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(768, false); + Recipe.newRecipe.createItem.stack = 4; + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(820, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(808, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(811, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(827, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Bone"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(361, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(362, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.anyWood = true; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].SetDefaults(150, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Red Banner"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Green Banner"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Blue Banner"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Yellow Banner"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(255, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(195, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 13; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(247, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(255, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(248, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(255, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(249, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(255, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(240, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(254, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(241, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(254, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(262, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1282, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(262, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Amethyst"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1283, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(262, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Topaz"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1284, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(262, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Sapphire"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1285, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(262, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Emerald"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1286, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(262, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Ruby"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1287, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(262, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Diamond"); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 86; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(259, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(68, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(252, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(259, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(253, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(259, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(978, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(803, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(981, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(979, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(804, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(981, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(980, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(805, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(981, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(250, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(261, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredItem[1].SetDefaults("Bottled Water"); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(33, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[2].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(360, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Stone Block"); + Recipe.newRecipe.requiredItem[0].stack = 100; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(12, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Amethyst Staff"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Copper Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Amethyst"); + Recipe.newRecipe.requiredItem[1].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Watch"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 14; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Copper Chandelier"); + Recipe.newRecipe.requiredItem[0].SetDefaults(20, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Ore"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Topaz Staff"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Topaz"); + Recipe.newRecipe.requiredItem[1].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Watch"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 14; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tin Chandelier"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tin Bar"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(11, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(35, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(10, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(7, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(4, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(6, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Iron Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Iron Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Iron Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Iron Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Ore"); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Anvil"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Lead Bar"); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(205, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Iron Door"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Lead Door"); + Recipe.newRecipe.requiredItem[0].SetDefaults(704, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Trash Can"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Bathtub"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 14; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Toilet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cooking Pot"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Iron Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Wood"); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Chain"); + Recipe.newRecipe.createItem.stack = 10; + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(14, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Sapphire Staff"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silver Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Sapphire"); + Recipe.newRecipe.requiredItem[1].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Watch"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 14; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Silver Chandelier"); + Recipe.newRecipe.requiredItem[0].SetDefaults(21, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Ore"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Emerald Staff"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Emerald"); + Recipe.newRecipe.requiredItem[1].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Watch"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 14; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Tungsten Chandelier"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Tungsten Bar"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(13, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Ruby Staff"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Gold Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Ruby"); + Recipe.newRecipe.requiredItem[1].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 35; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Watch"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 14; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Crown"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults("Ruby"); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Gold Chandelier"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Candle"); + Recipe.newRecipe.requiredItem[0].SetDefaults(19, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Candelabra"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults("Gold Bar"); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults("Torch"); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Ore"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Axe"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 9; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Hammer"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(9, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyWood = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Broadsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Shortsword"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Bow"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 7; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Diamond Staff"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Diamond"); + Recipe.newRecipe.requiredItem[1].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 35; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Watch"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 14; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Crown"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults("Ruby"); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Chandelier"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(85, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Candle"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[1].SetDefaults(8, false); + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Platinum Candelabra"); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults("Torch"); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Throne"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Gold Bar"); + Recipe.newRecipe.requiredItem[1].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Throne"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Silk"); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults("Platinum Bar"); + Recipe.newRecipe.requiredItem[1].stack = 30; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(56, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(44, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(45, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(46, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Shadow Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults(86, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Shadow Scalemail"); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredItem[1].SetDefaults(86, false); + Recipe.newRecipe.requiredItem[1].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Shadow Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(86, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Nightmare Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(86, false); + Recipe.newRecipe.requiredItem[1].stack = 6; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("The Breaker"); + Recipe.newRecipe.requiredItem[0].SetDefaults(57, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(86, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(880, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(796, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(799, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(795, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(792, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults(1329, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(793, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredItem[1].SetDefaults(1329, false); + Recipe.newRecipe.requiredItem[1].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(794, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1329, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(798, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(1329, false); + Recipe.newRecipe.requiredItem[1].stack = 6; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(797, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(1329, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(801, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1257, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(1329, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Grappling Hook"); + Recipe.newRecipe.requiredItem[0].SetDefaults(85, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(118, false); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1236, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(181, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1237, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(180, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1238, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(177, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1239, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(179, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1240, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(178, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1241, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(182, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1522, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(181, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1523, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(180, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1524, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(177, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1525, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(179, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1526, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(178, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1527, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(182, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(116, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(198, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(177, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(199, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(178, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(200, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(179, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(201, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(181, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(202, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(182, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(203, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(180, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Blue Phasesaber"); + Recipe.newRecipe.requiredItem[0].SetDefaults(198, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Red Phasesaber"); + Recipe.newRecipe.requiredItem[0].SetDefaults(199, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Green Phasesaber"); + Recipe.newRecipe.requiredItem[0].SetDefaults(200, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Purple Phasesaber"); + Recipe.newRecipe.requiredItem[0].SetDefaults(201, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("White Phasesaber"); + Recipe.newRecipe.requiredItem[0].SetDefaults(202, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Yellow Phasesaber"); + Recipe.newRecipe.requiredItem[0].SetDefaults(203, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(204, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 35; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(127, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults(75, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(197, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(98, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[1].stack = 20; + Recipe.newRecipe.requiredItem[2].SetDefaults(75, false); + Recipe.newRecipe.requiredItem[2].stack = 5; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Meteor Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Meteor Suit"); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 25; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Meteor Leggings"); + Recipe.newRecipe.requiredItem[0].SetDefaults(117, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(151, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(154, false); + Recipe.newRecipe.requiredItem[0].stack = 40; + Recipe.newRecipe.requiredItem[1].SetDefaults(150, false); + Recipe.newRecipe.requiredItem[1].stack = 40; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(152, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(154, false); + Recipe.newRecipe.requiredItem[0].stack = 60; + Recipe.newRecipe.requiredItem[1].SetDefaults(150, false); + Recipe.newRecipe.requiredItem[1].stack = 50; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(153, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(154, false); + Recipe.newRecipe.requiredItem[0].stack = 50; + Recipe.newRecipe.requiredItem[1].SetDefaults(150, false); + Recipe.newRecipe.requiredItem[1].stack = 45; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(190, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(331, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(209, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1310, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(209, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(191, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(331, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredItem[1].SetDefaults(209, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(185, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(331, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(210, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(228, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(331, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(229, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(331, false); + Recipe.newRecipe.requiredItem[0].stack = 16; + Recipe.newRecipe.requiredItem[1].SetDefaults(209, false); + Recipe.newRecipe.requiredItem[1].stack = 12; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(230, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(331, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredItem[1].SetDefaults(210, false); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(174, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(173, false); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 77; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(119, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(55, false); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(120, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(121, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(122, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(217, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(219, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Handgun"); + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(231, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(232, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(233, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(175, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(273, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(46, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(155, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(190, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(121, false); + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(273, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(795, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(155, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(190, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(121, false); + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(675, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(273, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1570, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(674, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(368, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1570, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(757, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(675, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(674, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1570, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(389, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(527, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(528, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 7; + Recipe.newRecipe.requiredItem[3].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[3].stack = 7; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(364, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Mask"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Hat"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Breastplate"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Leggings"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Drill"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(776, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Chainsaw"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(991, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Repeater"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Cobalt Sword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(537, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(381, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1104, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Mask"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Headgear"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Breastplate"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Leggings"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Drill"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1188, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Chainsaw"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1222, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Repeater"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Palladium Sword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1186, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1184, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(365, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Hat"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Hood"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Chainmail"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Greaves"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Drill"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Pickaxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Chainsaw"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Waraxe"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Repeater"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Sword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mythril Halberd"); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(525, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(382, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1105, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Mask"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Headgear"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Breastplate"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Leggings"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Drill"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1195, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Chainsaw"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1223, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Repeater"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Sword"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Orichalcum Halberd"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1220, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1191, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(366, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredTile[0] = 133; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(402, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(400, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Breastplate"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Leggings"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Drill"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(778, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Chainsaw"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(993, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Repeater"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(482, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Adamantite Glaive"); + Recipe.newRecipe.requiredItem[0].SetDefaults(391, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(524, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(366, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults(221, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1106, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredTile[0] = 133; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Mask"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1216, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1217, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Breastplate"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Leggings"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Drill"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1202, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Chainsaw"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1224, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Repeater"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1199, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Titanium Trident"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1198, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1221, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1106, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults(221, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(559, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(553, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(558, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(551, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(552, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(579, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(990, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(578, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(368, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(550, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(947, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 133; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Chlorophyte Helmet"); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1001, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1003, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1004, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1005, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1231, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1230, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1232, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1233, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1262, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1234, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1229, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1227, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1226, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1228, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1235, false); + Recipe.newRecipe.createItem.stack = 50; + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1503, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1504, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1505, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1506, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1507, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1543, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1544, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1545, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1508, false); + Recipe.newRecipe.requiredItem[0].stack = 8; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1316, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredItem[1].SetDefaults(1328, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1317, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredItem[1].SetDefaults(1328, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1318, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredItem[1].SetDefaults(1328, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1552, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1006, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(183, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredTile[0] = 247; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1546, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1552, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1547, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1552, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1548, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1552, false); + Recipe.newRecipe.requiredItem[0].stack = 12; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1549, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1552, false); + Recipe.newRecipe.requiredItem[0].stack = 24; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1550, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1552, false); + Recipe.newRecipe.requiredItem[0].stack = 18; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(533, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(98, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(324, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(319, false); + Recipe.newRecipe.requiredItem[2].stack = 5; + Recipe.newRecipe.requiredItem[3].SetDefaults(548, false); + Recipe.newRecipe.requiredItem[3].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(561, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1225, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredItem[2].SetDefaults(548, false); + Recipe.newRecipe.requiredItem[2].stack = 5; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(506, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(324, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(547, false); + Recipe.newRecipe.requiredItem[2].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(494, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(508, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 25; + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 12; + Recipe.newRecipe.requiredItem[3].SetDefaults(549, false); + Recipe.newRecipe.requiredItem[3].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(425, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(507, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(501, false); + Recipe.newRecipe.requiredItem[1].stack = 80; + Recipe.newRecipe.requiredItem[2].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[2].stack = 12; + Recipe.newRecipe.requiredItem[3].SetDefaults(549, false); + Recipe.newRecipe.requiredItem[3].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(497, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(275, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredItem[1].SetDefaults(319, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredItem[2].SetDefaults(261, false); + Recipe.newRecipe.requiredItem[2].stack = 15; + Recipe.newRecipe.requiredItem[3].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[3].stack = 5; + Recipe.newRecipe.requiredItem[4].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[4].stack = 5; + Recipe.newRecipe.requiredItem[5].SetDefaults(547, false); + Recipe.newRecipe.requiredItem[5].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(495, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults(526, false); + Recipe.newRecipe.requiredItem[1].stack = 4; + Recipe.newRecipe.requiredItem[2].SetDefaults(501, false); + Recipe.newRecipe.requiredItem[2].stack = 60; + Recipe.newRecipe.requiredItem[3].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[3].stack = 10; + Recipe.newRecipe.requiredItem[4].SetDefaults(549, false); + Recipe.newRecipe.requiredItem[4].stack = 20; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(493, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(320, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[1].stack = 20; + Recipe.newRecipe.requiredItem[2].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[2].stack = 25; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(492, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(320, false); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[1].stack = 20; + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 25; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(761, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(501, false); + Recipe.newRecipe.requiredItem[1].stack = 100; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(785, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1516, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(749, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1611, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(786, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1517, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(821, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1518, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(822, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1519, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1165, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1520, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1515, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1521, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(823, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(575, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredItem[1].SetDefaults(1508, false); + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1085, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1073, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1086, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1074, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1087, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1075, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1088, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1076, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1089, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1077, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1090, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1078, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1091, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1079, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1092, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1080, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1093, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1081, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1094, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1082, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1095, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1083, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1096, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1084, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1007, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1115, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1008, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1114, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1009, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1110, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1010, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1112, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1011, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1108, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1012, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1107, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1013, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1116, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1014, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1109, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1015, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1111, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1016, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1118, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1017, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1117, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1018, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1113, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1050, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1119, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1031, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1007, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1008, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1009, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1033, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1009, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1010, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1011, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1035, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1013, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1014, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1015, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1063, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1031, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1064, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1033, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1065, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1035, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1032, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1031, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1034, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1033, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1036, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1035, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1068, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1008, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1009, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1010, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1069, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1012, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1013, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1014, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1070, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1016, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1017, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1018, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1066, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1068, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1069, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(1070, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1067, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1066, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1019, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1007, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1020, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1008, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1021, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1009, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1022, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1010, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1023, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1011, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1024, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1012, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1025, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1013, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1026, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1014, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1027, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1015, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1028, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1016, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1029, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1017, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1030, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1018, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1050, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1038, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1007, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1039, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1008, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1040, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1009, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1041, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1010, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1042, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1011, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1043, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1012, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1044, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1013, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1045, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1014, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1046, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1015, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1047, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1016, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1048, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1017, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1049, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1018, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1051, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1007, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1052, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1008, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1053, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1009, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1054, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1010, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1055, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1011, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1056, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1012, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1057, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1013, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1058, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1014, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1059, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1015, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1060, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1016, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1061, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1017, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1062, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1018, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1037, false); + Recipe.newRecipe.requiredTile[0] = 228; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(394, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(187, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(268, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(395, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(17, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(18, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(393, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(395, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(709, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(18, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(393, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(396, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(158, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(193, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(397, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(156, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(193, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1613, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(397, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1612, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1724, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(53, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(215, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(399, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(53, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(159, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1163, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(987, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(159, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(983, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(857, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(159, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1250, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(399, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(158, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1251, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1163, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(158, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1252, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(983, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(158, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1164, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(399, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1163, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(983, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(405, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(54, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(128, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(405, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1579, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(128, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(898, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(405, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(212, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(285, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(907, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(863, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(193, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(908, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(907, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(906, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(555, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(223, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(189, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(897, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(536, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(211, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(936, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(897, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(935, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1343, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1322, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(936, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(982, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(111, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(49, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1595, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(982, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(216, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(860, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(49, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(535, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(861, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(485, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(497, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(862, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(532, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(554, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1247, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1132, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(532, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1578, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1132, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1290, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(976, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(953, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(975, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(984, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(976, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(977, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(963, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(901, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(886, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(892, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(902, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(887, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(885, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(903, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(889, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(893, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(904, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(890, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(891, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1612, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(901, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(902, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(903, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(904, false); + Recipe.newRecipe.requiredItem[4].SetDefaults(888, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(935, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(489, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(490, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(491, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1301, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(935, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1248, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(193, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(173, false); + Recipe.newRecipe.requiredItem[0].stack = 20; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(518, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(531, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(502, false); + Recipe.newRecipe.requiredItem[1].stack = 30; + Recipe.newRecipe.requiredItem[2].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[2].stack = 15; + Recipe.newRecipe.requiredTile[0] = 101; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(519, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(531, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(522, false); + Recipe.newRecipe.requiredItem[1].stack = 30; + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 15; + Recipe.newRecipe.requiredTile[0] = 101; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1336, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(531, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(1332, false); + Recipe.newRecipe.requiredItem[1].stack = 30; + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 15; + Recipe.newRecipe.requiredTile[0] = 101; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Goggles"); + Recipe.newRecipe.requiredItem[0].SetDefaults(38, false); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(266, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(324, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(323, false); + Recipe.newRecipe.requiredItem[1].stack = 10; + Recipe.newRecipe.requiredItem[2].SetDefaults(180, false); + Recipe.newRecipe.requiredItem[2].stack = 5; + Recipe.newRecipe.requiredTile[0] = 17; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Sunglasses"); + Recipe.newRecipe.requiredItem[0].SetDefaults("Black Lens"); + Recipe.newRecipe.requiredItem[0].stack = 2; + Recipe.newRecipe.requiredTile[0] = 18; + Recipe.newRecipe.requiredTile[1] = 15; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults("Mana Crystal"); + Recipe.newRecipe.requiredItem[0].SetDefaults(75, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(511, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(530, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(512, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(26, false); + Recipe.newRecipe.requiredItem[0].stack = 4; + Recipe.newRecipe.requiredItem[1].SetDefaults(530, false); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(580, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(167, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(581, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Iron Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(582, false); + Recipe.newRecipe.requiredItem[0].SetDefaults("Iron Bar"); + Recipe.newRecipe.requiredItem[0].stack = 10; + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 2; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(583, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(17, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(583, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(709, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(584, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(16, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(584, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(708, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(585, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(15, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(585, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(707, false); + Recipe.newRecipe.requiredItem[1].SetDefaults("Wire"); + Recipe.newRecipe.requiredItem[1].stack = 1; + Recipe.newRecipe.requiredTile[0] = 16; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(540, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(3, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(565, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(562, false); + Recipe.newRecipe.requiredItem[1].SetDefaults(563, false); + Recipe.newRecipe.requiredItem[2].SetDefaults(564, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(566, false); + Recipe.newRecipe.requiredItem[4].SetDefaults(567, false); + Recipe.newRecipe.requiredItem[5].SetDefaults(568, false); + Recipe.newRecipe.requiredItem[6].SetDefaults(569, false); + Recipe.newRecipe.requiredItem[7].SetDefaults(570, false); + Recipe.newRecipe.requiredItem[8].SetDefaults(571, false); + Recipe.newRecipe.requiredItem[9].SetDefaults(572, false); + Recipe.newRecipe.requiredItem[10].SetDefaults(573, false); + Recipe.newRecipe.requiredItem[11].SetDefaults(574, false); + Recipe.newRecipe.requiredTile[0] = 114; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(43, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(38, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(70, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(67, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults(68, false); + Recipe.newRecipe.requiredItem[1].stack = 15; + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1331, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1330, false); + Recipe.newRecipe.requiredItem[0].stack = 15; + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(1133, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1125, false); + Recipe.newRecipe.requiredItem[0].stack = 5; + Recipe.newRecipe.requiredItem[1].SetDefaults(1127, false); + Recipe.newRecipe.requiredItem[1].stack = 3; + Recipe.newRecipe.requiredItem[2].SetDefaults(209, false); + Recipe.newRecipe.requiredItem[3].SetDefaults(1124, false); + Recipe.newRecipe.requiredItem[3].stack = 5; + Recipe.newRecipe.requiredItem[4].SetDefaults(173, false); + Recipe.newRecipe.requiredItem[4].stack = 2; + Recipe.newRecipe.requiredItem[5].SetDefaults(1134, false); + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(560, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(23, false); + Recipe.newRecipe.requiredItem[0].stack = 99; + Recipe.newRecipe.requiredItem[1].SetDefaults(264, false); + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(560, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(23, false); + Recipe.newRecipe.requiredItem[0].stack = 99; + Recipe.newRecipe.requiredItem[1].SetDefaults(715, false); + Recipe.newRecipe.requiredTile[0] = 26; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(544, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(38, false); + Recipe.newRecipe.requiredItem[0].stack = 3; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredItem[2].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[2].stack = 6; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(556, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(68, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 6; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(556, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(1330, false); + Recipe.newRecipe.requiredItem[0].stack = 6; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredItem[2].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[2].stack = 6; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(557, false); + Recipe.newRecipe.requiredItem[0].SetDefaults(154, false); + Recipe.newRecipe.requiredItem[0].stack = 30; + Recipe.newRecipe.requiredItem[1].SetDefaults(22, false); + Recipe.newRecipe.requiredItem[1].stack = 5; + Recipe.newRecipe.requiredItem[2].SetDefaults(520, false); + Recipe.newRecipe.requiredItem[2].stack = 3; + Recipe.newRecipe.requiredItem[3].SetDefaults(521, false); + Recipe.newRecipe.requiredItem[3].stack = 3; + Recipe.newRecipe.requiredTile[0] = 134; + Recipe.newRecipe.anyIronBar = true; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(71, false); + Recipe.newRecipe.createItem.stack = 100; + Recipe.newRecipe.requiredItem[0].SetDefaults(72, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(72, false); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults(71, false); + Recipe.newRecipe.requiredItem[0].stack = 100; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(72, false); + Recipe.newRecipe.createItem.stack = 100; + Recipe.newRecipe.requiredItem[0].SetDefaults(73, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(73, false); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults(72, false); + Recipe.newRecipe.requiredItem[0].stack = 100; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(73, false); + Recipe.newRecipe.createItem.stack = 100; + Recipe.newRecipe.requiredItem[0].SetDefaults(74, false); + Recipe.newRecipe.requiredItem[0].stack = 1; + Recipe.addRecipe(); + Recipe.newRecipe.createItem.SetDefaults(74, false); + Recipe.newRecipe.createItem.stack = 1; + Recipe.newRecipe.requiredItem[0].SetDefaults(73, false); + Recipe.newRecipe.requiredItem[0].stack = 100; + Recipe.addRecipe(); + Recipe.wallReturn(); + for (int i = 0; i < Recipe.numRecipes; i++) + { + int num = 0; + while (Main.recipe[i].requiredItem[num].type > 0) + { + Main.recipe[i].requiredItem[num].checkMat(); + num++; + } + Main.recipe[i].createItem.checkMat(); + } + } + private static void wallReturn() + { + int num = Recipe.numRecipes; + for (int i = 0; i < num; i++) + { + if (Main.recipe[i].createItem.createWall > 0 && Main.recipe[i].requiredItem[1].type == 0) + { + Recipe.newRecipe.createItem.SetDefaults(Main.recipe[i].requiredItem[0].type, false); + Recipe.newRecipe.createItem.stack = Main.recipe[i].requiredItem[0].stack; + Recipe.newRecipe.requiredItem[0].SetDefaults(Main.recipe[i].createItem.type, false); + Recipe.newRecipe.requiredItem[0].stack = Main.recipe[i].createItem.stack; + for (int j = 0; j < Recipe.newRecipe.requiredTile.Length; j++) + { + Recipe.newRecipe.requiredTile[j] = Main.recipe[i].requiredTile[j]; + } + Recipe.addRecipe(); + Recipe recipe = Main.recipe[Recipe.numRecipes - 1]; + for (int k = Recipe.numRecipes - 2; k > i; k--) + { + Main.recipe[k + 1] = Main.recipe[k]; + } + Main.recipe[i + 1] = recipe; + } + } + } + private static void addRecipe() + { + Main.recipe[Recipe.numRecipes] = Recipe.newRecipe; + Recipe.newRecipe = new Recipe(); + Recipe.numRecipes++; + } + } +} diff --git a/Terraria/ServerSock.cs b/Terraria/ServerSock.cs new file mode 100644 index 0000000..05302e1 --- /dev/null +++ b/Terraria/ServerSock.cs @@ -0,0 +1,230 @@ +using Microsoft.Xna.Framework; +using System; +using System.Net.Sockets; +namespace Terraria +{ + public class ServerSock + { + public Socket clientSocket; + public NetworkStream networkStream; + public TcpClient tcpClient = new TcpClient(); + public int whoAmI; + public string statusText2; + public int statusCount; + public int statusMax; + public bool[,] tileSection = new bool[Main.maxTilesX / 200 + 1, Main.maxTilesY / 150 + 1]; + public string statusText = ""; + public bool active; + public bool locked; + public bool kill; + public int timeOut; + public bool announced; + public string name = "Anonymous"; + public string oldName = ""; + public int state; + public float spamProjectile; + public float spamAddBlock; + public float spamDelBlock; + public float spamWater; + public float spamProjectileMax = 100f; + public float spamAddBlockMax = 100f; + public float spamDelBlockMax = 500f; + public float spamWaterMax = 50f; + public byte[] readBuffer; + public byte[] writeBuffer; + public void SpamUpdate() + { + if (!Netplay.spamCheck) + { + this.spamProjectile = 0f; + this.spamDelBlock = 0f; + this.spamAddBlock = 0f; + this.spamWater = 0f; + return; + } + if (this.spamProjectile > this.spamProjectileMax) + { + NetMessage.BootPlayer(this.whoAmI, "Cheating attempt detected: Projectile spam"); + } + if (this.spamAddBlock > this.spamAddBlockMax) + { + NetMessage.BootPlayer(this.whoAmI, "Cheating attempt detected: Add tile spam"); + } + if (this.spamDelBlock > this.spamDelBlockMax) + { + NetMessage.BootPlayer(this.whoAmI, "Cheating attempt detected: Remove tile spam"); + } + if (this.spamWater > this.spamWaterMax) + { + NetMessage.BootPlayer(this.whoAmI, "Cheating attempt detected: Liquid spam"); + } + this.spamProjectile -= 0.4f; + if (this.spamProjectile < 0f) + { + this.spamProjectile = 0f; + } + this.spamAddBlock -= 0.3f; + if (this.spamAddBlock < 0f) + { + this.spamAddBlock = 0f; + } + this.spamDelBlock -= 5f; + if (this.spamDelBlock < 0f) + { + this.spamDelBlock = 0f; + } + this.spamWater -= 0.2f; + if (this.spamWater < 0f) + { + this.spamWater = 0f; + } + } + public void SpamClear() + { + this.spamProjectile = 0f; + this.spamAddBlock = 0f; + this.spamDelBlock = 0f; + this.spamWater = 0f; + } + public static void CheckSection(int who, Vector2 position) + { + int sectionX = Netplay.GetSectionX((int)(position.X / 16f)); + int sectionY = Netplay.GetSectionY((int)(position.Y / 16f)); + int num = 0; + for (int i = sectionX - 1; i < sectionX + 2; i++) + { + for (int j = sectionY - 1; j < sectionY + 2; j++) + { + if (i >= 0 && i < Main.maxSectionsX && j >= 0 && j < Main.maxSectionsY && !Netplay.serverSock[who].tileSection[i, j]) + { + num++; + } + } + } + if (num > 0) + { + int num2 = num * 150; + NetMessage.SendData(9, who, -1, "Receiving tile data", num2, 0f, 0f, 0f, 0); + Netplay.serverSock[who].statusText2 = "is receiving tile data"; + Netplay.serverSock[who].statusMax += num2; + for (int k = sectionX - 1; k < sectionX + 2; k++) + { + for (int l = sectionY - 1; l < sectionY + 2; l++) + { + if (k >= 0 && k < Main.maxSectionsX && l >= 0 && l < Main.maxSectionsY && !Netplay.serverSock[who].tileSection[k, l]) + { + NetMessage.SendSection(who, k, l); + NetMessage.SendData(11, who, -1, "", k, (float)l, (float)k, (float)l, 0); + } + } + } + } + } + public bool SectionRange(int size, int firstX, int firstY) + { + for (int i = 0; i < 4; i++) + { + int num = firstX; + int num2 = firstY; + if (i == 1) + { + num += size; + } + if (i == 2) + { + num2 += size; + } + if (i == 3) + { + num += size; + num2 += size; + } + int sectionX = Netplay.GetSectionX(num); + int sectionY = Netplay.GetSectionY(num2); + if (this.tileSection[sectionX, sectionY]) + { + return true; + } + } + return false; + } + public void Reset() + { + for (int i = 0; i < Main.maxSectionsX; i++) + { + for (int j = 0; j < Main.maxSectionsY; j++) + { + this.tileSection[i, j] = false; + } + } + if (this.whoAmI < 255) + { + Main.player[this.whoAmI] = new Player(); + } + this.timeOut = 0; + this.statusCount = 0; + this.statusMax = 0; + this.statusText2 = ""; + this.statusText = ""; + this.name = "Anonymous"; + this.state = 0; + this.locked = false; + this.kill = false; + this.SpamClear(); + this.active = false; + NetMessage.buffer[this.whoAmI].Reset(); + if (this.networkStream != null) + { + this.networkStream.Close(); + } + if (this.tcpClient != null) + { + this.tcpClient.Close(); + } + } + public void ServerWriteCallBack(IAsyncResult ar) + { + NetMessage.buffer[this.whoAmI].spamCount--; + if (this.statusMax > 0) + { + this.statusCount++; + } + } + public void ServerReadCallBack(IAsyncResult ar) + { + int num = 0; + if (!Netplay.disconnect) + { + try + { + num = this.networkStream.EndRead(ar); + } + catch + { + } + if (num == 0) + { + this.kill = true; + } + else + { + if (Main.ignoreErrors) + { + try + { + NetMessage.RecieveBytes(this.readBuffer, num, this.whoAmI); + goto IL_57; + } + catch + { + goto IL_57; + } + } + NetMessage.RecieveBytes(this.readBuffer, num, this.whoAmI); + } + } + IL_57: + this.locked = false; + } + } +} diff --git a/Terraria/Sign.cs b/Terraria/Sign.cs new file mode 100644 index 0000000..7671b9f --- /dev/null +++ b/Terraria/Sign.cs @@ -0,0 +1,75 @@ +using System; +namespace Terraria +{ + public class Sign + { + public const int maxSigns = 1000; + public int x; + public int y; + public string text; + public object Clone() + { + return base.MemberwiseClone(); + } + public static void KillSign(int x, int y) + { + for (int i = 0; i < 1000; i++) + { + if (Main.sign[i] != null && Main.sign[i].x == x && Main.sign[i].y == y) + { + Main.sign[i] = null; + } + } + } + public static int ReadSign(int i, int j) + { + int k = (int)(Main.tile[i, j].frameX / 18); + int num = (int)(Main.tile[i, j].frameY / 18); + while (k > 1) + { + k -= 2; + } + int num2 = i - k; + int num3 = j - num; + if (Main.tile[num2, num3].type != 55 && Main.tile[num2, num3].type != 85) + { + Sign.KillSign(num2, num3); + return -1; + } + int num4 = -1; + for (int l = 0; l < 1000; l++) + { + if (Main.sign[l] != null && Main.sign[l].x == num2 && Main.sign[l].y == num3) + { + num4 = l; + break; + } + } + if (num4 < 0) + { + for (int m = 0; m < 1000; m++) + { + if (Main.sign[m] == null) + { + num4 = m; + Main.sign[m] = new Sign(); + Main.sign[m].x = num2; + Main.sign[m].y = num3; + Main.sign[m].text = ""; + break; + } + } + } + return num4; + } + public static void TextSign(int i, string text) + { + if (Main.tile[Main.sign[i].x, Main.sign[i].y] == null || !Main.tile[Main.sign[i].x, Main.sign[i].y].active() || (Main.tile[Main.sign[i].x, Main.sign[i].y].type != 55 && Main.tile[Main.sign[i].x, Main.sign[i].y].type != 85)) + { + Main.sign[i] = null; + return; + } + Main.sign[i].text = text; + } + } +} diff --git a/Terraria/Star.cs b/Terraria/Star.cs new file mode 100644 index 0000000..908ddf3 --- /dev/null +++ b/Terraria/Star.cs @@ -0,0 +1,69 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Star + { + public Vector2 position; + public float scale; + public float rotation; + public int type; + public float twinkle; + public float twinkleSpeed; + public float rotationSpeed; + public static void SpawnStars() + { + Main.numStars = Main.rand.Next(65, 130); + Main.numStars = 130; + for (int i = 0; i < Main.numStars; i++) + { + Main.star[i] = new Star(); + Main.star[i].position.X = (float)Main.rand.Next(-12, Main.screenWidth + 1); + Main.star[i].position.Y = (float)Main.rand.Next(-12, Main.screenHeight); + Main.star[i].rotation = (float)Main.rand.Next(628) * 0.01f; + Main.star[i].scale = (float)Main.rand.Next(50, 120) * 0.01f; + Main.star[i].type = Main.rand.Next(0, 5); + Main.star[i].twinkle = (float)Main.rand.Next(101) * 0.01f; + Main.star[i].twinkleSpeed = (float)Main.rand.Next(40, 100) * 0.0001f; + if (Main.rand.Next(2) == 0) + { + Main.star[i].twinkleSpeed *= -1f; + } + Main.star[i].rotationSpeed = (float)Main.rand.Next(10, 40) * 0.0001f; + if (Main.rand.Next(2) == 0) + { + Main.star[i].rotationSpeed *= -1f; + } + } + } + public static void UpdateStars() + { + for (int i = 0; i < Main.numStars; i++) + { + Main.star[i].twinkle += Main.star[i].twinkleSpeed; + if (Main.star[i].twinkle > 1f) + { + Main.star[i].twinkle = 1f; + Main.star[i].twinkleSpeed *= -1f; + } + else + { + if ((double)Main.star[i].twinkle < 0.5) + { + Main.star[i].twinkle = 0.5f; + Main.star[i].twinkleSpeed *= -1f; + } + } + Main.star[i].rotation += Main.star[i].rotationSpeed; + if ((double)Main.star[i].rotation > 6.28) + { + Main.star[i].rotation -= 6.28f; + } + if (Main.star[i].rotation < 0f) + { + Main.star[i].rotation += 6.28f; + } + } + } + } +} diff --git a/Terraria/Steam.cs b/Terraria/Steam.cs new file mode 100644 index 0000000..3c2b76d --- /dev/null +++ b/Terraria/Steam.cs @@ -0,0 +1,21 @@ +using System; +using System.Runtime.InteropServices; +namespace Terraria +{ + public class Steam + { + public static bool SteamInit; + [DllImport("steam_api.dll")] + private static extern bool SteamAPI_Init(); + [DllImport("steam_api.dll")] + private static extern bool SteamAPI_Shutdown(); + public static void Init() + { + Steam.SteamInit = Steam.SteamAPI_Init(); + } + public static void Kill() + { + Steam.SteamAPI_Shutdown(); + } + } +} diff --git a/Terraria/Tile.cs b/Terraria/Tile.cs new file mode 100644 index 0000000..ba20a8c --- /dev/null +++ b/Terraria/Tile.cs @@ -0,0 +1,571 @@ +using Microsoft.Xna.Framework; +using System; +namespace Terraria +{ + public class Tile + { + public byte type; + public byte wall; + public byte liquid; + public byte tileHeader; + public byte tileHeader2; + public byte tileHeader3; + public byte tileHeader4; + public byte tileHeader5; + public short frameX; + public short frameY; + public object Clone() + { + return base.MemberwiseClone(); + } + public bool isTheSameAs(Tile compTile) + { + if (compTile == null) + { + return false; + } + if (this.active() != compTile.active()) + { + return false; + } + if (this.active()) + { + if (this.type != compTile.type) + { + return false; + } + if (Main.tileFrameImportant[(int)this.type]) + { + if (this.frameX != compTile.frameX) + { + return false; + } + if (this.frameY != compTile.frameY) + { + return false; + } + } + } + return this.wall == compTile.wall && this.liquid == compTile.liquid && this.lava() == compTile.lava() && this.honey() == compTile.honey() && this.wire() == compTile.wire() && this.wire2() == compTile.wire2() && this.wire3() == compTile.wire3() && this.halfBrick() == compTile.halfBrick() && this.actuator() == compTile.actuator() && this.inActive() == compTile.inActive() && this.wallColor() == compTile.wallColor() && this.color() == compTile.color() && this.slope() == compTile.slope(); + } + public byte wallFrameX() + { + byte b = 0; + if ((this.tileHeader4 & 16) == 16) + { + b += 1; + } + if ((this.tileHeader4 & 32) == 32) + { + b += 2; + } + if ((this.tileHeader4 & 64) == 64) + { + b += 4; + } + if ((this.tileHeader4 & 128) == 128) + { + b += 8; + } + return (byte)(b * 18); + } + public void wallFrameX(int wallFrameX) + { + int num = wallFrameX / 18; + if ((num & 1) == 1) + { + this.tileHeader4 |= 16; + } + else + { + this.tileHeader4 = (byte)((int)this.tileHeader4 & -17); + } + if ((num & 2) == 2) + { + this.tileHeader4 |= 32; + } + else + { + this.tileHeader4 = (byte)((int)this.tileHeader4 & -33); + } + if ((num & 4) == 4) + { + this.tileHeader4 |= 64; + } + else + { + this.tileHeader4 = (byte)((int)this.tileHeader4 & -65); + } + if ((num & 8) == 8) + { + this.tileHeader4 |= 128; + return; + } + this.tileHeader4 = (byte)((int)this.tileHeader4 & -129); + } + public byte wallFrameY() + { + byte b = 0; + if ((this.tileHeader5 & 1) == 1) + { + b += 1; + } + if ((this.tileHeader5 & 2) == 2) + { + b += 2; + } + if ((this.tileHeader5 & 4) == 4) + { + b += 4; + } + return (byte)(b * 18); + } + public void wallFrameY(int wallFrameX) + { + int num = wallFrameX / 18; + if ((num & 1) == 1) + { + this.tileHeader5 |= 1; + } + else + { + this.tileHeader5 = (byte)((int)this.tileHeader5 & -2); + } + if ((num & 2) == 2) + { + this.tileHeader5 |= 2; + } + else + { + this.tileHeader5 = (byte)((int)this.tileHeader5 & -3); + } + if ((num & 4) == 4) + { + this.tileHeader5 |= 4; + return; + } + this.tileHeader5 = (byte)((int)this.tileHeader5 & -5); + } + public byte frameNumber() + { + byte b = 0; + if ((this.tileHeader4 & 1) == 1) + { + b += 1; + } + if ((this.tileHeader4 & 2) == 2) + { + b += 2; + } + return b; + } + public void frameNumber(byte frameNumber) + { + if ((frameNumber & 1) == 1) + { + this.tileHeader4 |= 1; + } + else + { + this.tileHeader4 = (byte)((int)this.tileHeader4 & -2); + } + if ((frameNumber & 2) == 2) + { + this.tileHeader4 |= 2; + return; + } + this.tileHeader4 = (byte)((int)this.tileHeader4 & -3); + } + public byte wallFrameNumber() + { + byte b = 0; + if ((this.tileHeader4 & 4) == 4) + { + b += 1; + } + if ((this.tileHeader4 & 8) == 8) + { + b += 2; + } + return b; + } + public void wallFrameNumber(byte wallFrameNumber) + { + if ((wallFrameNumber & 4) == 4) + { + this.tileHeader4 |= 4; + } + else + { + this.tileHeader4 = (byte)((int)this.tileHeader4 & -5); + } + if ((wallFrameNumber & 8) == 8) + { + this.tileHeader4 |= 8; + return; + } + this.tileHeader4 = (byte)((int)this.tileHeader4 & -9); + } + public byte slope() + { + byte b = 0; + if ((this.tileHeader3 & 16) == 16) + { + b += 1; + } + if ((this.tileHeader3 & 32) == 32) + { + b += 2; + } + return b; + } + public void slope(byte slope) + { + if ((slope & 1) == 1) + { + this.tileHeader3 |= 16; + } + else + { + this.tileHeader3 = (byte)((int)this.tileHeader3 & -17); + } + if ((slope & 2) == 2) + { + this.tileHeader3 |= 32; + return; + } + this.tileHeader3 = (byte)((int)this.tileHeader3 & -33); + } + public byte color() + { + byte b = 0; + if ((this.tileHeader2 & 4) == 4) + { + b += 1; + } + if ((this.tileHeader2 & 8) == 8) + { + b += 2; + } + if ((this.tileHeader2 & 16) == 16) + { + b += 4; + } + if ((this.tileHeader2 & 32) == 32) + { + b += 8; + } + if ((this.tileHeader2 & 64) == 64) + { + b += 16; + } + return b; + } + public void color(byte color) + { + if (color > 27) + { + color = 27; + } + if ((color & 1) == 1) + { + this.tileHeader2 |= 4; + } + else + { + this.tileHeader2 = (byte)((int)this.tileHeader2 & -5); + } + if ((color & 2) == 2) + { + this.tileHeader2 |= 8; + } + else + { + this.tileHeader2 = (byte)((int)this.tileHeader2 & -9); + } + if ((color & 4) == 4) + { + this.tileHeader2 |= 16; + } + else + { + this.tileHeader2 = (byte)((int)this.tileHeader2 & -17); + } + if ((color & 8) == 8) + { + this.tileHeader2 |= 32; + } + else + { + this.tileHeader2 = (byte)((int)this.tileHeader2 & -33); + } + if ((color & 16) == 16) + { + this.tileHeader2 |= 64; + return; + } + this.tileHeader2 = (byte)((int)this.tileHeader2 & -65); + } + public byte wallColor() + { + byte b = 0; + if ((this.tileHeader2 & 128) == 128) + { + b += 1; + } + if ((this.tileHeader3 & 1) == 1) + { + b += 2; + } + if ((this.tileHeader3 & 2) == 2) + { + b += 4; + } + if ((this.tileHeader3 & 4) == 4) + { + b += 8; + } + if ((this.tileHeader3 & 8) == 8) + { + b += 16; + } + return b; + } + public void wallColor(byte wallColor) + { + if (wallColor > 27) + { + wallColor = 27; + } + if ((wallColor & 1) == 1) + { + this.tileHeader2 |= 128; + } + else + { + this.tileHeader2 = (byte)((int)this.tileHeader2 & -129); + } + if ((wallColor & 2) == 2) + { + this.tileHeader3 |= 1; + } + else + { + this.tileHeader3 = (byte)((int)this.tileHeader3 & -2); + } + if ((wallColor & 4) == 4) + { + this.tileHeader3 |= 2; + } + else + { + this.tileHeader3 = (byte)((int)this.tileHeader3 & -3); + } + if ((wallColor & 8) == 8) + { + this.tileHeader3 |= 4; + } + else + { + this.tileHeader3 = (byte)((int)this.tileHeader3 & -5); + } + if ((wallColor & 16) == 16) + { + this.tileHeader3 |= 8; + return; + } + this.tileHeader3 = (byte)((int)this.tileHeader3 & -9); + } + public bool lava() + { + return (this.tileHeader & 8) == 8; + } + public void lava(bool lava) + { + if (lava) + { + this.tileHeader |= 8; + this.tileHeader3 = (byte)((int)this.tileHeader3 & -65); + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -9); + } + public bool honey() + { + return (this.tileHeader3 & 64) == 64; + } + public void honey(bool honey) + { + if (honey) + { + this.tileHeader3 |= 64; + this.tileHeader = (byte)((int)this.tileHeader & -9); + return; + } + this.tileHeader3 = (byte)((int)this.tileHeader3 & -65); + } + public void liquidType(int liquidType) + { + if (liquidType == 0) + { + this.honey(false); + this.lava(false); + } + if (liquidType == 1) + { + this.honey(false); + this.lava(true); + } + if (liquidType == 2) + { + this.honey(true); + this.lava(false); + } + } + public byte liquidType() + { + if (this.honey()) + { + return 2; + } + if (this.lava()) + { + return 1; + } + return 0; + } + public bool checkingLiquid() + { + return (this.tileHeader & 2) == 2; + } + public void checkingLiquid(bool checkingLiquid) + { + if (checkingLiquid) + { + this.tileHeader |= 2; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -3); + } + public bool skipLiquid() + { + return (this.tileHeader & 4) == 4; + } + public void skipLiquid(bool skipLiquid) + { + if (skipLiquid) + { + this.tileHeader |= 4; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -5); + } + public bool wire() + { + return (this.tileHeader & 16) == 16; + } + public void wire(bool wire) + { + if (wire) + { + this.tileHeader |= 16; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -17); + } + public bool halfBrick() + { + return (this.tileHeader & 32) == 32; + } + public void halfBrick(bool halfBrick) + { + if (halfBrick) + { + this.tileHeader |= 32; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -33); + } + public bool actuator() + { + return (this.tileHeader & 64) == 64; + } + public void actuator(bool actuator) + { + if (actuator) + { + this.tileHeader |= 64; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -65); + } + public bool nactive() + { + return ((this.tileHeader & 1) != 1 || (this.tileHeader & 128) != 128) && (this.tileHeader & 1) == 1; + } + public bool inActive() + { + return (this.tileHeader & 128) == 128; + } + public void inActive(bool inActive) + { + if (inActive) + { + this.tileHeader |= 128; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -129); + } + public bool active() + { + return (this.tileHeader & 1) == 1; + } + public void active(bool active) + { + if (active) + { + this.tileHeader |= 1; + return; + } + this.tileHeader = (byte)((int)this.tileHeader & -2); + } + public bool wire2() + { + return (this.tileHeader2 & 1) == 1; + } + public void wire2(bool wire2) + { + if (wire2) + { + this.tileHeader2 |= 1; + return; + } + this.tileHeader2 = (byte)((int)this.tileHeader2 & -2); + } + public bool wire3() + { + return (this.tileHeader2 & 2) == 2; + } + public void wire3(bool wire3) + { + if (wire3) + { + this.tileHeader2 |= 2; + return; + } + this.tileHeader2 = (byte)((int)this.tileHeader2 & -3); + } + public Color actColor(Color oldColor) + { + if (this.inActive()) + { + float num = 0.4f; + int r = (int)((byte)(num * (float)oldColor.R)); + int g = (int)((byte)(num * (float)oldColor.G)); + int b = (int)((byte)(num * (float)oldColor.B)); + return new Color(r, g, b, (int)oldColor.A); + } + return oldColor; + } + } +} diff --git a/Terraria/WorldGen.cs b/Terraria/WorldGen.cs new file mode 100644 index 0000000..b56e7ba --- /dev/null +++ b/Terraria/WorldGen.cs @@ -0,0 +1,46469 @@ +using Microsoft.Xna.Framework; +using System; +using System.Diagnostics; +using System.IO; +using System.Threading; +namespace Terraria +{ + internal class WorldGen + { + public static int tileReframeCount = 0; + public static bool noMapUpdate = false; + public static double worldSurfaceLow; + public static int tLeft; + public static int tRight; + public static int tTop; + public static int tBottom; + public static int tRooms; + public static int[] mossType = new int[3]; + public static int c = 0; + public static int m = 0; + public static int a = 0; + public static int co = 0; + public static int ir = 0; + public static int si = 0; + public static int go = 0; + public static int copperBar = 20; + public static int ironBar = 22; + public static int silverBar = 21; + public static int goldBar = 19; + public static int treeBG = 0; + public static int corruptBG = 0; + public static int jungleBG = 0; + public static int snowBG = 0; + public static int hallowBG = 0; + public static int crimsonBG = 0; + public static int desertBG = 0; + public static int oceanBG = 0; + public static int oreTier1 = -1; + public static int oreTier2 = -1; + public static int oreTier3 = -1; + public static bool crimson = false; + public static byte mossTile = 179; + public static byte mossWall = 54; + public static Vector2[] teleport = new Vector2[2]; + private static int dWallCount = 0; + private static bool dWallBroke = false; + public static int maxMech = 1000; + public static int[] mechX = new int[WorldGen.maxMech]; + public static int[] mechY = new int[WorldGen.maxMech]; + public static int numMechs = 0; + public static int[] mechTime = new int[WorldGen.maxMech]; + public static int maxWire = 2000; + public static int[] wireX = new int[WorldGen.maxWire]; + public static int[] wireY = new int[WorldGen.maxWire]; + public static int numWire = 0; + public static int[] noWireX = new int[WorldGen.maxWire]; + public static int[] noWireY = new int[WorldGen.maxWire]; + public static int numNoWire = 0; + public static int maxPump = 20; + public static int[] inPumpX = new int[WorldGen.maxPump]; + public static int[] inPumpY = new int[WorldGen.maxPump]; + public static int numInPump = 0; + public static int[] outPumpX = new int[WorldGen.maxPump]; + public static int[] outPumpY = new int[WorldGen.maxPump]; + public static int numOutPump = 0; + public static bool[] gem = new bool[6]; + public static int totalEvil = 0; + public static int totalGood = 0; + public static int totalSolid = 0; + public static int totalEvil2 = 0; + public static int totalGood2 = 0; + public static int totalSolid2 = 0; + public static byte tEvil = 0; + public static byte tGood = 0; + public static int totalX = 0; + public static int totalD = 0; + public static bool hardLock = false; + private static Vector2[] heartPos = new Vector2[100]; + private static int heartCount = 0; + private static object padlock = new object(); + public static int lavaLine; + public static int waterLine; + public static bool noTileActions = false; + public static bool spawnEye = false; + public static int spawnHardBoss = 0; + public static bool gen = false; + public static bool shadowOrbSmashed = false; + public static int shadowOrbCount = 0; + public static int altarCount = 0; + public static bool spawnMeteor = false; + public static bool loadFailed = false; + public static bool loadSuccess = false; + public static bool worldCleared = false; + public static bool worldBackup = false; + public static bool loadBackup = false; + private static int lastMaxTilesX = 0; + private static int lastMaxTilesY = 0; + public static bool saveLock = false; + private static bool mergeUp = false; + private static bool mergeDown = false; + private static bool mergeLeft = false; + private static bool mergeRight = false; + private static int tempMoonPhase = Main.moonPhase; + private static bool tempDayTime = Main.dayTime; + private static bool tempBloodMoon = Main.bloodMoon; + private static bool tempEclipse = Main.eclipse; + private static double tempTime = Main.time; + public static bool tempRaining = false; + public static float tempMaxRain = 0f; + public static int tempRainTime = 0; + private static bool stopDrops = false; + private static bool mudWall = false; + private static int grassSpread = 0; + public static bool noLiquidCheck = false; + [ThreadStatic] + public static Random genRand = new Random(); + public static string statusText = ""; + public static bool destroyObject = false; + public static int spawnDelay = 0; + public static int spawnNPC = 0; + public static int numTileCount = 0; + public static int maxTileCount = 3500; + public static int maxWallOut2 = 5000; + public static int numWallOut2 = 0; + public static int[] countX = new int[WorldGen.maxTileCount]; + public static int[] countY = new int[WorldGen.maxTileCount]; + public static int lavaCount = 0; + public static int iceCount = 0; + public static int rockCount = 0; + public static int maxRoomTiles = 750; + public static int numRoomTiles; + public static int[] roomX = new int[WorldGen.maxRoomTiles]; + public static int[] roomY = new int[WorldGen.maxRoomTiles]; + public static int roomX1; + public static int roomX2; + public static int roomY1; + public static int roomY2; + public static bool canSpawn; + public static bool[] houseTile = new bool[251]; + public static int bestX = 0; + public static int bestY = 0; + public static int hiScore = 0; + public static int dungeonX; + public static int dungeonY; + public static Vector2 lastDungeonHall = default(Vector2); + public static int maxDRooms = 100; + public static int numDRooms = 0; + public static int[] dRoomX = new int[WorldGen.maxDRooms]; + public static int[] dRoomY = new int[WorldGen.maxDRooms]; + public static int[] dRoomSize = new int[WorldGen.maxDRooms]; + private static bool[] dRoomTreasure = new bool[WorldGen.maxDRooms]; + private static int[] dRoomL = new int[WorldGen.maxDRooms]; + private static int[] dRoomR = new int[WorldGen.maxDRooms]; + private static int[] dRoomT = new int[WorldGen.maxDRooms]; + private static int[] dRoomB = new int[WorldGen.maxDRooms]; + private static int numDDoors; + private static int[] DDoorX = new int[300]; + private static int[] DDoorY = new int[300]; + private static int[] DDoorPos = new int[300]; + private static int numDPlats; + private static int[] DPlatX = new int[300]; + private static int[] DPlatY = new int[300]; + private static int[] JChestX = new int[100]; + private static int[] JChestY = new int[100]; + private static int numJChests = 0; + private static int[] HiveX = new int[100]; + private static int[] HiveY = new int[100]; + private static int numHives = 0; + public static int dEnteranceX = 0; + public static bool dSurface = false; + private static double dxStrength1; + private static double dyStrength1; + private static double dxStrength2; + private static double dyStrength2; + private static int dMinX; + private static int dMaxX; + private static int dMinY; + private static int dMaxY; + private static int numIslandHouses = 0; + private static int houseCount = 0; + private static int[] fihX = new int[300]; + private static int[] fihY = new int[300]; + private static int numMCaves = 0; + private static int[] mCaveX = new int[300]; + private static int[] mCaveY = new int[300]; + private static int JungleX = 0; + private static int hellChest = 0; + private static bool roomTorch; + private static bool roomDoor; + private static bool roomChair; + private static bool roomTable; + private static bool roomOccupied; + private static bool roomEvil; + public static bool MoveNPC(int x, int y, int n) + { + if (!WorldGen.StartRoomCheck(x, y)) + { + Main.NewText(Lang.inter[40], 255, 240, 20, false); + return false; + } + if (!WorldGen.RoomNeeds(WorldGen.spawnNPC)) + { + if (Lang.lang <= 1) + { + int num = 0; + string[] array = new string[4]; + if (!WorldGen.roomTorch) + { + array[num] = "a light source"; + num++; + } + if (!WorldGen.roomDoor) + { + array[num] = "a door"; + num++; + } + if (!WorldGen.roomTable) + { + array[num] = "a table"; + num++; + } + if (!WorldGen.roomChair) + { + array[num] = "a chair"; + num++; + } + string text = ""; + for (int i = 0; i < num; i++) + { + if (num == 2 && i == 1) + { + text += " and "; + } + else + { + if (i > 0 && i != num - 1) + { + text += ", and "; + } + else + { + if (i > 0) + { + text += ", "; + } + } + } + text += array[i]; + } + Main.NewText("This housing is missing " + text + ".", 255, 240, 20, false); + } + else + { + Main.NewText(Lang.inter[39], 255, 240, 20, false); + } + return false; + } + WorldGen.ScoreRoom(-1); + if (WorldGen.hiScore <= 0) + { + if (WorldGen.roomOccupied) + { + Main.NewText(Lang.inter[41], 255, 240, 20, false); + } + else + { + if (WorldGen.roomEvil) + { + Main.NewText(Lang.inter[42], 255, 240, 20, false); + } + else + { + Main.NewText(Lang.inter[40], 255, 240, 20, false); + } + } + return false; + } + if (n > 0 && !WorldGen.CheckConditions(Main.npc[n].type)) + { + Main.NewText(Lang.inter[55] + " " + Main.npc[n].name, 255, 240, 20, false); + return false; + } + return true; + } + public static void moveRoom(int x, int y, int n) + { + if (Main.netMode == 1) + { + NetMessage.SendData(60, -1, -1, "", n, (float)x, (float)y, 1f, 0); + return; + } + WorldGen.spawnNPC = Main.npc[n].type; + Main.npc[n].homeless = true; + WorldGen.SpawnNPC(x, y); + } + public static void kickOut(int n) + { + if (Main.netMode == 1) + { + NetMessage.SendData(60, -1, -1, "", n, 0f, 0f, 0f, 0); + return; + } + Main.npc[n].homeless = true; + } + public static bool NextNPC() + { + if (WorldGen.CheckConditions(WorldGen.spawnNPC)) + { + return true; + } + for (int i = 0; i < 301; i++) + { + if (Main.nextNPC[i] && WorldGen.CheckConditions(i)) + { + WorldGen.spawnNPC = i; + return true; + } + } + return false; + } + public static bool CheckConditions(int type) + { + if (type != 160) + { + return true; + } + if ((double)WorldGen.roomY2 > Main.worldSurface) + { + return false; + } + int num = 0; + int num2 = WorldGen.roomX1 - Main.zoneX / 2 / 16 - 1 - Lighting.offScreenTiles; + int num3 = WorldGen.roomX2 + Main.zoneX / 2 / 16 + 1 + Lighting.offScreenTiles; + int num4 = WorldGen.roomY1 - Main.zoneY / 2 / 16 - 1 - Lighting.offScreenTiles; + int num5 = WorldGen.roomY2 + Main.zoneY / 2 / 16 + 1 + Lighting.offScreenTiles; + if (num2 < 0) + { + num2 = 0; + } + if (num3 >= Main.maxTilesX) + { + num3 = Main.maxTilesX - 1; + } + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + for (int i = num2 + 1; i < num3; i++) + { + for (int j = num4 + 2; j < num5 + 2; j++) + { + if (Main.tile[i, j].active() && (Main.tile[i, j].type == 70 || Main.tile[i, j].type == 71 || Main.tile[i, j].type == 72)) + { + num++; + } + } + } + return num >= 100; + } + public static void SpawnNPC(int x, int y) + { + if (Main.wallHouse[(int)Main.tile[x, y].wall]) + { + WorldGen.canSpawn = true; + } + if (!WorldGen.canSpawn) + { + return; + } + if (!WorldGen.StartRoomCheck(x, y)) + { + return; + } + if (!WorldGen.RoomNeeds(WorldGen.spawnNPC)) + { + return; + } + WorldGen.ScoreRoom(-1); + if (WorldGen.hiScore > 0) + { + int num = -1; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].homeless && Main.npc[i].type == WorldGen.spawnNPC && WorldGen.CheckConditions(Main.npc[i].type)) + { + num = i; + break; + } + } + if (!WorldGen.NextNPC()) + { + return; + } + if (num == -1) + { + int num2 = WorldGen.bestX; + int num3 = WorldGen.bestY; + bool flag = false; + if (!flag) + { + flag = true; + Rectangle value = new Rectangle(num2 * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, num3 * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active) + { + Rectangle rectangle = new Rectangle((int)Main.player[j].position.X, (int)Main.player[j].position.Y, Main.player[j].width, Main.player[j].height); + if (rectangle.Intersects(value)) + { + flag = false; + break; + } + } + } + } + if (!flag && (double)num3 <= Main.worldSurface) + { + for (int k = 1; k < 500; k++) + { + for (int l = 0; l < 2; l++) + { + if (l == 0) + { + num2 = WorldGen.bestX + k; + } + else + { + num2 = WorldGen.bestX - k; + } + if (num2 > 10 && num2 < Main.maxTilesX - 10) + { + int num4 = WorldGen.bestY - k; + double num5 = (double)(WorldGen.bestY + k); + if (num4 < 10) + { + num4 = 10; + } + if (num5 > Main.worldSurface) + { + num5 = Main.worldSurface; + } + int num6 = num4; + while ((double)num6 < num5) + { + num3 = num6; + if (Main.tile[num2, num3].nactive() && Main.tileSolid[(int)Main.tile[num2, num3].type]) + { + if (!Collision.SolidTiles(num2 - 1, num2 + 1, num3 - 3, num3 - 1)) + { + flag = true; + Rectangle value2 = new Rectangle(num2 * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, num3 * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + for (int m = 0; m < 255; m++) + { + if (Main.player[m].active) + { + Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X, (int)Main.player[m].position.Y, Main.player[m].width, Main.player[m].height); + if (rectangle2.Intersects(value2)) + { + flag = false; + break; + } + } + } + break; + } + break; + } + else + { + num6++; + } + } + } + if (flag) + { + break; + } + } + if (flag) + { + break; + } + } + } + int num7 = NPC.NewNPC(num2 * 16, num3 * 16, WorldGen.spawnNPC, 1); + Main.npc[num7].homeTileX = WorldGen.bestX; + Main.npc[num7].homeTileY = WorldGen.bestY; + if (num2 < WorldGen.bestX) + { + Main.npc[num7].direction = 1; + } + else + { + if (num2 > WorldGen.bestX) + { + Main.npc[num7].direction = -1; + } + } + Main.npc[num7].netUpdate = true; + string str = Main.npc[num7].name; + if (Main.chrName[Main.npc[num7].type] != "") + { + if (Lang.lang <= 1) + { + str = Main.chrName[Main.npc[num7].type] + " " + Lang.the + Main.npc[num7].name; + } + else + { + str = Main.chrName[Main.npc[num7].type]; + } + } + if (Main.netMode == 0) + { + Main.NewText(str + " " + Lang.misc[18], 50, 125, 255, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, str + " " + Lang.misc[18], 255, 50f, 125f, 255f, 0); + } + } + } + else + { + WorldGen.spawnNPC = 0; + Main.npc[num].homeTileX = WorldGen.bestX; + Main.npc[num].homeTileY = WorldGen.bestY; + Main.npc[num].homeless = false; + } + WorldGen.spawnNPC = 0; + } + } + public static bool RoomNeeds(int npcType) + { + WorldGen.roomChair = false; + WorldGen.roomDoor = false; + WorldGen.roomTable = false; + WorldGen.roomTorch = false; + if (WorldGen.houseTile[15] || WorldGen.houseTile[79] || WorldGen.houseTile[89] || WorldGen.houseTile[102]) + { + WorldGen.roomChair = true; + } + if (WorldGen.houseTile[14] || WorldGen.houseTile[18] || WorldGen.houseTile[87] || WorldGen.houseTile[88] || WorldGen.houseTile[90] || WorldGen.houseTile[101]) + { + WorldGen.roomTable = true; + } + if (WorldGen.houseTile[4] || WorldGen.houseTile[33] || WorldGen.houseTile[34] || WorldGen.houseTile[35] || WorldGen.houseTile[36] || WorldGen.houseTile[42] || WorldGen.houseTile[49] || WorldGen.houseTile[93] || WorldGen.houseTile[95] || WorldGen.houseTile[98] || WorldGen.houseTile[100] || WorldGen.houseTile[149] || WorldGen.houseTile[170] || WorldGen.houseTile[171] || WorldGen.houseTile[172] || WorldGen.houseTile[173] || WorldGen.houseTile[174]) + { + WorldGen.roomTorch = true; + } + if (WorldGen.houseTile[10] || WorldGen.houseTile[11] || WorldGen.houseTile[19]) + { + WorldGen.roomDoor = true; + } + if (WorldGen.roomChair && WorldGen.roomTable && WorldGen.roomDoor && WorldGen.roomTorch) + { + WorldGen.canSpawn = true; + } + else + { + WorldGen.canSpawn = false; + } + return WorldGen.canSpawn; + } + public static void QuickFindHome(int npc) + { + if (Main.npc[npc].homeTileX > 10 && Main.npc[npc].homeTileY > 10 && Main.npc[npc].homeTileX < Main.maxTilesX - 10 && Main.npc[npc].homeTileY < Main.maxTilesY) + { + WorldGen.canSpawn = false; + WorldGen.StartRoomCheck(Main.npc[npc].homeTileX, Main.npc[npc].homeTileY - 1); + if (!WorldGen.canSpawn) + { + for (int i = Main.npc[npc].homeTileX - 1; i < Main.npc[npc].homeTileX + 2; i++) + { + int num = Main.npc[npc].homeTileY - 1; + while (num < Main.npc[npc].homeTileY + 2 && !WorldGen.StartRoomCheck(i, num)) + { + num++; + } + } + } + if (!WorldGen.canSpawn) + { + int num2 = 10; + for (int j = Main.npc[npc].homeTileX - num2; j <= Main.npc[npc].homeTileX + num2; j += 2) + { + int num3 = Main.npc[npc].homeTileY - num2; + while (num3 <= Main.npc[npc].homeTileY + num2 && !WorldGen.StartRoomCheck(j, num3)) + { + num3 += 2; + } + } + } + if (WorldGen.canSpawn) + { + WorldGen.RoomNeeds(Main.npc[npc].type); + if (WorldGen.canSpawn) + { + WorldGen.ScoreRoom(npc); + } + if (WorldGen.canSpawn && WorldGen.hiScore > 0) + { + Main.npc[npc].homeTileX = WorldGen.bestX; + Main.npc[npc].homeTileY = WorldGen.bestY; + Main.npc[npc].homeless = false; + WorldGen.canSpawn = false; + return; + } + Main.npc[npc].homeless = true; + return; + } + else + { + Main.npc[npc].homeless = true; + } + } + } + public static void ScoreRoom(int ignoreNPC = -1) + { + WorldGen.roomOccupied = false; + WorldGen.roomEvil = false; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].townNPC && ignoreNPC != i && !Main.npc[i].homeless) + { + for (int j = 0; j < WorldGen.numRoomTiles; j++) + { + if (Main.npc[i].homeTileX == WorldGen.roomX[j] && Main.npc[i].homeTileY == WorldGen.roomY[j]) + { + bool flag = false; + for (int k = 0; k < WorldGen.numRoomTiles; k++) + { + if (Main.npc[i].homeTileX == WorldGen.roomX[k] && Main.npc[i].homeTileY - 1 == WorldGen.roomY[k]) + { + flag = true; + break; + } + } + if (flag) + { + WorldGen.roomOccupied = true; + WorldGen.hiScore = -1; + return; + } + } + } + } + } + WorldGen.hiScore = 0; + int num = 50; + int num2 = 0; + int num3 = WorldGen.roomX1 - Main.zoneX / 2 / 16 - 1 - Lighting.offScreenTiles; + int num4 = WorldGen.roomX2 + Main.zoneX / 2 / 16 + 1 + Lighting.offScreenTiles; + int num5 = WorldGen.roomY1 - Main.zoneY / 2 / 16 - 1 - Lighting.offScreenTiles; + int num6 = WorldGen.roomY2 + Main.zoneY / 2 / 16 + 1 + Lighting.offScreenTiles; + if (num3 < 0) + { + num3 = 0; + } + if (num4 >= Main.maxTilesX) + { + num4 = Main.maxTilesX - 1; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + for (int l = num3 + 1; l < num4; l++) + { + for (int m = num5 + 2; m < num6 + 2; m++) + { + if (Main.tile[l, m].active()) + { + if (Main.tile[l, m].type == 23 || Main.tile[l, m].type == 24 || Main.tile[l, m].type == 25 || Main.tile[l, m].type == 32 || Main.tile[l, m].type == 112 || Main.tile[l, m].type == 163) + { + num2++; + } + else + { + if (Main.tile[l, m].type == 199 || Main.tile[l, m].type == 201 || Main.tile[l, m].type == 200 || Main.tile[l, m].type == 203 || Main.tile[l, m].type == 234) + { + num2++; + } + else + { + if (Main.tile[l, m].type == 27) + { + num2 -= 5; + } + else + { + if (Main.tile[l, m].type == 109 || Main.tile[l, m].type == 110 || Main.tile[l, m].type == 113 || Main.tile[l, m].type == 116 || Main.tile[l, m].type == 164) + { + num2--; + } + } + } + } + } + } + } + if (num2 < 50) + { + num2 = 0; + } + num -= num2; + if (num <= -250) + { + WorldGen.hiScore = num; + WorldGen.roomEvil = true; + return; + } + num3 = WorldGen.roomX1; + num4 = WorldGen.roomX2; + num5 = WorldGen.roomY1; + num6 = WorldGen.roomY2; + for (int n = num3 + 1; n < num4; n++) + { + for (int num7 = num5 + 2; num7 < num6 + 2; num7++) + { + if (Main.tile[n, num7].nactive()) + { + int num8 = num; + if (Main.tileSolid[(int)Main.tile[n, num7].type] && !Main.tileSolidTop[(int)Main.tile[n, num7].type] && !Collision.SolidTiles(n - 1, n + 1, num7 - 3, num7 - 1) && Main.tile[n - 1, num7].nactive() && Main.tileSolid[(int)Main.tile[n - 1, num7].type] && Main.tile[n + 1, num7].nactive() && Main.tileSolid[(int)Main.tile[n + 1, num7].type]) + { + for (int num9 = n - 2; num9 < n + 3; num9++) + { + for (int num10 = num7 - 4; num10 < num7; num10++) + { + if (Main.tile[num9, num10].nactive()) + { + if (num9 == n) + { + num8 -= 15; + } + else + { + if (Main.tile[num9, num10].type == 10 || Main.tile[num9, num10].type == 11) + { + num8 -= 20; + } + else + { + if (Main.tileSolid[(int)Main.tile[num9, num10].type]) + { + num8 -= 5; + } + else + { + num8 += 5; + } + } + } + } + } + } + if (num8 > WorldGen.hiScore) + { + bool flag2 = false; + for (int num11 = 0; num11 < WorldGen.numRoomTiles; num11++) + { + if (WorldGen.roomX[num11] == n && WorldGen.roomY[num11] == num7) + { + flag2 = true; + break; + } + } + if (flag2) + { + WorldGen.hiScore = num8; + WorldGen.bestX = n; + WorldGen.bestY = num7; + } + } + } + } + } + } + } + public static bool StartRoomCheck(int x, int y) + { + WorldGen.roomX1 = x; + WorldGen.roomX2 = x; + WorldGen.roomY1 = y; + WorldGen.roomY2 = y; + WorldGen.numRoomTiles = 0; + for (int i = 0; i < 251; i++) + { + WorldGen.houseTile[i] = false; + } + WorldGen.canSpawn = true; + if (Main.tile[x, y].nactive() && Main.tileSolid[(int)Main.tile[x, y].type]) + { + WorldGen.canSpawn = false; + } + WorldGen.CheckRoom(x, y); + if (WorldGen.numRoomTiles < 60) + { + WorldGen.canSpawn = false; + } + return WorldGen.canSpawn; + } + public static void CheckRoom(int x, int y) + { + if (!WorldGen.canSpawn) + { + return; + } + if (x < 10 || y < 10 || x >= Main.maxTilesX - 10 || y >= WorldGen.lastMaxTilesY - 10) + { + WorldGen.canSpawn = false; + return; + } + for (int i = 0; i < WorldGen.numRoomTiles; i++) + { + if (WorldGen.roomX[i] == x && WorldGen.roomY[i] == y) + { + return; + } + } + WorldGen.roomX[WorldGen.numRoomTiles] = x; + WorldGen.roomY[WorldGen.numRoomTiles] = y; + WorldGen.numRoomTiles++; + if (WorldGen.numRoomTiles >= WorldGen.maxRoomTiles) + { + WorldGen.canSpawn = false; + return; + } + if (Main.tile[x, y].nactive()) + { + WorldGen.houseTile[(int)Main.tile[x, y].type] = true; + if (Main.tileSolid[(int)Main.tile[x, y].type]) + { + return; + } + if (Main.tile[x, y].type == 11 && (Main.tile[x, y].frameX == 0 || Main.tile[x, y].frameX == 54)) + { + return; + } + } + if (x < WorldGen.roomX1) + { + WorldGen.roomX1 = x; + } + if (x > WorldGen.roomX2) + { + WorldGen.roomX2 = x; + } + if (y < WorldGen.roomY1) + { + WorldGen.roomY1 = y; + } + if (y > WorldGen.roomY2) + { + WorldGen.roomY2 = y; + } + bool flag = false; + bool flag2 = false; + for (int j = -2; j < 3; j++) + { + if (Main.wallHouse[(int)Main.tile[x + j, y].wall]) + { + flag = true; + } + if (Main.tile[x + j, y].nactive() && (Main.tileSolid[(int)Main.tile[x + j, y].type] || Main.tile[x + j, y].type == 11)) + { + flag = true; + } + if (Main.wallHouse[(int)Main.tile[x, y + j].wall]) + { + flag2 = true; + } + if (Main.tile[x, y + j].nactive() && (Main.tileSolid[(int)Main.tile[x, y + j].type] || Main.tile[x, y + j].type == 11)) + { + flag2 = true; + } + } + if (!flag || !flag2) + { + WorldGen.canSpawn = false; + return; + } + for (int k = x - 1; k < x + 2; k++) + { + for (int l = y - 1; l < y + 2; l++) + { + if ((k != x || l != y) && WorldGen.canSpawn) + { + WorldGen.CheckRoom(k, l); + } + } + } + } + public static void dropMeteor() + { + bool flag = true; + int num = 0; + if (Main.netMode == 1) + { + return; + } + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active) + { + flag = false; + break; + } + } + int num2 = 0; + float num3 = (float)(Main.maxTilesX / 4200); + int num4 = (int)(400f * num3); + for (int j = 5; j < Main.maxTilesX - 5; j++) + { + int num5 = 5; + while ((double)num5 < Main.worldSurface) + { + if (Main.tile[j, num5].active() && Main.tile[j, num5].type == 37) + { + num2++; + if (num2 > num4) + { + return; + } + } + num5++; + } + } + while (!flag) + { + float num6 = (float)Main.maxTilesX * 0.08f; + int num7 = Main.rand.Next(50, Main.maxTilesX - 50); + while ((float)num7 > (float)Main.spawnTileX - num6 && (float)num7 < (float)Main.spawnTileX + num6) + { + num7 = Main.rand.Next(50, Main.maxTilesX - 50); + } + for (int k = Main.rand.Next(100); k < Main.maxTilesY; k++) + { + if (Main.tile[num7, k].active() && Main.tileSolid[(int)Main.tile[num7, k].type]) + { + flag = WorldGen.meteor(num7, k); + break; + } + } + num++; + if (num >= 100) + { + return; + } + } + } + public static bool meteor(int i, int j) + { + if (i < 50 || i > Main.maxTilesX - 50) + { + return false; + } + if (j < 50 || j > Main.maxTilesY - 50) + { + return false; + } + int num = 25; + Rectangle rectangle = new Rectangle((i - num) * 16, (j - num) * 16, num * 2 * 16, num * 2 * 16); + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active) + { + Rectangle value = new Rectangle((int)(Main.player[k].position.X + (float)(Main.player[k].width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(Main.player[k].position.Y + (float)(Main.player[k].height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + if (rectangle.Intersects(value)) + { + return false; + } + } + } + for (int l = 0; l < 200; l++) + { + if (Main.npc[l].active) + { + Rectangle value2 = new Rectangle((int)Main.npc[l].position.X, (int)Main.npc[l].position.Y, Main.npc[l].width, Main.npc[l].height); + if (rectangle.Intersects(value2)) + { + return false; + } + } + } + for (int m = i - num; m < i + num; m++) + { + for (int n = j - num; n < j + num; n++) + { + if (Main.tile[m, n].active() && Main.tile[m, n].type == 21) + { + return false; + } + } + } + WorldGen.stopDrops = true; + num = 15; + for (int num2 = i - num; num2 < i + num; num2++) + { + for (int num3 = j - num; num3 < j + num; num3++) + { + if (num3 > j + Main.rand.Next(-2, 3) - 5 && (double)(Math.Abs(i - num2) + Math.Abs(j - num3)) < (double)num * 1.5 + (double)Main.rand.Next(-5, 5)) + { + if (!Main.tileSolid[(int)Main.tile[num2, num3].type]) + { + Main.tile[num2, num3].active(false); + } + Main.tile[num2, num3].type = 37; + } + } + } + num = 10; + for (int num4 = i - num; num4 < i + num; num4++) + { + for (int num5 = j - num; num5 < j + num; num5++) + { + if (num5 > j + Main.rand.Next(-2, 3) - 5 && Math.Abs(i - num4) + Math.Abs(j - num5) < num + Main.rand.Next(-3, 4)) + { + Main.tile[num4, num5].active(false); + } + } + } + num = 16; + for (int num6 = i - num; num6 < i + num; num6++) + { + for (int num7 = j - num; num7 < j + num; num7++) + { + if (Main.tile[num6, num7].type == 5 || Main.tile[num6, num7].type == 32) + { + WorldGen.KillTile(num6, num7, false, false, false); + } + WorldGen.SquareTileFrame(num6, num7, true); + WorldGen.SquareWallFrame(num6, num7, true); + } + } + num = 23; + for (int num8 = i - num; num8 < i + num; num8++) + { + for (int num9 = j - num; num9 < j + num; num9++) + { + if (Main.tile[num8, num9].active() && Main.rand.Next(10) == 0 && (double)(Math.Abs(i - num8) + Math.Abs(j - num9)) < (double)num * 1.3) + { + if (Main.tile[num8, num9].type == 5 || Main.tile[num8, num9].type == 32) + { + WorldGen.KillTile(num8, num9, false, false, false); + } + Main.tile[num8, num9].type = 37; + WorldGen.SquareTileFrame(num8, num9, true); + } + } + } + WorldGen.stopDrops = false; + if (Main.netMode == 0) + { + Main.NewText(Lang.gen[59], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.gen[59], 255, 50f, 255f, 130f, 0); + } + } + if (Main.netMode != 1) + { + NetMessage.SendTileSquare(-1, i, j, 30); + } + return true; + } + public static void setWorldSize() + { + Main.bottomWorld = (float)(Main.maxTilesY * 16); + Main.rightWorld = (float)(Main.maxTilesX * 16); + Main.maxSectionsX = Main.maxTilesX / 200; + Main.maxSectionsY = Main.maxTilesY / 150; + } + public static void worldGenCallBack(object threadContext) + { + Main.PlaySound(10, -1, -1, 1); + WorldGen.clearWorld(); + WorldGen.generateWorld(-1); + WorldGen.saveWorld(true); + Main.LoadWorlds(); + if (Main.menuMode == 10) + { + Main.menuMode = 6; + } + Main.PlaySound(10, -1, -1, 1); + } + public static void CreateNewWorld() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.worldGenCallBack), 1); + } + public static void SaveAndQuitCallBack(object threadContext) + { + Main.menuMode = 10; + Main.gameMenu = true; + Player.SavePlayer(Main.player[Main.myPlayer], Main.playerPathName); + if (Main.netMode == 0) + { + WorldGen.saveWorld(false); + Main.PlaySound(10, -1, -1, 1); + } + else + { + Netplay.disconnect = true; + Main.netMode = 0; + } + Main.menuMode = 0; + } + public static void SaveAndQuit() + { + Main.PlaySound(11, -1, -1, 1); + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.SaveAndQuitCallBack), 1); + } + public static void playWorldCallBack(object threadContext) + { + if (Main.rand == null) + { + Main.rand = new Random((int)DateTime.Now.Ticks); + } + for (int i = 0; i < 255; i++) + { + if (i != Main.myPlayer) + { + Main.player[i].active = false; + } + } + WorldGen.noMapUpdate = true; + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + if (File.Exists(Main.worldPathName + ".bak")) + { + WorldGen.worldBackup = true; + } + else + { + WorldGen.worldBackup = false; + } + if (!Main.dedServ) + { + if (WorldGen.worldBackup) + { + Main.menuMode = 200; + return; + } + Main.menuMode = 201; + return; + } + else + { + if (!WorldGen.worldBackup) + { + Console.WriteLine("Load failed! No backup found."); + return; + } + File.Copy(Main.worldPathName + ".bak", Main.worldPathName, true); + File.Delete(Main.worldPathName + ".bak"); + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + Console.WriteLine("Load failed!"); + return; + } + } + } + } + } + if (Main.mapEnabled) + { + Map.loadMap(); + } + WorldGen.EveryTileFrame(); + while (Main.loadMapLock) + { + float num = (float)Main.loadMapLastX / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[68], + " ", + (int)(num * 100f + 1f), + "%" + }); + Thread.Sleep(0); + if (!Main.mapEnabled) + { + break; + } + } + if (Main.gameMenu) + { + Main.gameMenu = false; + } + Main.player[Main.myPlayer].Spawn(); + Main.player[Main.myPlayer].UpdatePlayer(Main.myPlayer); + Main.dayTime = WorldGen.tempDayTime; + Main.time = WorldGen.tempTime; + Main.moonPhase = WorldGen.tempMoonPhase; + Main.bloodMoon = WorldGen.tempBloodMoon; + Main.raining = WorldGen.tempRaining; + Main.rainTime = WorldGen.tempRainTime; + Main.maxRaining = WorldGen.tempMaxRain; + Main.cloudAlpha = WorldGen.tempMaxRain; + Main.PlaySound(11, -1, -1, 1); + Main.resetClouds = true; + WorldGen.noMapUpdate = false; + } + public static void playWorld() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.playWorldCallBack), 1); + } + public static void saveAndPlayCallBack(object threadContext) + { + WorldGen.saveWorld(false); + } + public static void saveAndPlay() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.saveAndPlayCallBack), 1); + } + public static void saveToonWhilePlayingCallBack(object threadContext) + { + Player.SavePlayer(Main.player[Main.myPlayer], Main.playerPathName); + } + public static void saveToonWhilePlaying() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.saveToonWhilePlayingCallBack), 1); + } + public static void serverLoadWorldCallBack(object threadContext) + { + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + if (File.Exists(Main.worldPathName + ".bak")) + { + WorldGen.worldBackup = true; + } + else + { + WorldGen.worldBackup = false; + } + if (!Main.dedServ) + { + if (WorldGen.worldBackup) + { + Main.menuMode = 200; + return; + } + Main.menuMode = 201; + return; + } + else + { + if (!WorldGen.worldBackup) + { + Console.WriteLine("Load failed! No backup found."); + return; + } + File.Copy(Main.worldPathName + ".bak", Main.worldPathName, true); + File.Delete(Main.worldPathName + ".bak"); + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + WorldGen.loadWorld(); + if (WorldGen.loadFailed || !WorldGen.loadSuccess) + { + Console.WriteLine("Load failed!"); + return; + } + } + } + } + } + Main.PlaySound(10, -1, -1, 1); + Netplay.StartServer(); + Main.dayTime = WorldGen.tempDayTime; + Main.time = WorldGen.tempTime; + Main.raining = WorldGen.tempRaining; + Main.rainTime = WorldGen.tempRainTime; + Main.maxRaining = WorldGen.tempMaxRain; + Main.cloudAlpha = WorldGen.tempMaxRain; + Main.moonPhase = WorldGen.tempMoonPhase; + Main.bloodMoon = WorldGen.tempBloodMoon; + Main.eclipse = WorldGen.tempEclipse; + } + public static void serverLoadWorld() + { + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.serverLoadWorldCallBack), 1); + } + public static void clearWorld() + { + if (Main.mapReady) + { + for (int i = 0; i < WorldGen.lastMaxTilesX; i++) + { + float num = (float)i / (float)WorldGen.lastMaxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[65], + " ", + (int)(num * 100f + 1f), + "%" + }); + for (int j = 0; j < WorldGen.lastMaxTilesY; j++) + { + if (Main.map[i, j] != null) + { + Main.map[i, j] = null; + } + } + } + } + Main.clearMap = true; + Main.mapTime = 0; + Main.updateMap = false; + Main.mapReady = false; + Main.refreshMap = false; + Main.eclipse = false; + WorldGen.spawnHardBoss = 0; + WorldGen.totalSolid2 = 0; + WorldGen.totalGood2 = 0; + WorldGen.totalEvil2 = 0; + WorldGen.totalSolid = 0; + WorldGen.totalGood = 0; + WorldGen.totalEvil = 0; + WorldGen.tempMaxRain = 0f; + Main.maxRaining = 0f; + WorldGen.totalX = 0; + WorldGen.totalD = 0; + WorldGen.tEvil = 0; + WorldGen.tGood = 0; + NPC.clrNames(); + Main.trashItem = new Item(); + WorldGen.spawnEye = false; + WorldGen.spawnNPC = 0; + WorldGen.shadowOrbCount = 0; + WorldGen.altarCount = 0; + WorldGen.oreTier1 = -1; + WorldGen.oreTier2 = -1; + WorldGen.oreTier3 = -1; + Main.cloudBGActive = 0f; + Main.raining = false; + Main.hardMode = false; + Main.helpText = 0; + Main.dungeonX = 0; + Main.dungeonY = 0; + NPC.downedBoss1 = false; + NPC.downedBoss2 = false; + NPC.downedBoss3 = false; + NPC.downedQueenBee = false; + NPC.downedMechBossAny = false; + NPC.downedMechBoss1 = false; + NPC.downedMechBoss2 = false; + NPC.downedMechBoss3 = false; + NPC.downedPlantBoss = false; + NPC.savedGoblin = false; + NPC.savedWizard = false; + NPC.savedMech = false; + NPC.downedGoblins = false; + NPC.downedClown = false; + NPC.downedFrost = false; + NPC.downedPirates = false; + WorldGen.shadowOrbSmashed = false; + WorldGen.spawnMeteor = false; + WorldGen.stopDrops = false; + Main.invasionDelay = 0; + Main.invasionType = 0; + Main.invasionSize = 0; + Main.invasionWarn = 0; + Main.invasionX = 0.0; + Main.treeX[0] = Main.maxTilesX; + Main.treeX[1] = Main.maxTilesX; + Main.treeX[2] = Main.maxTilesX; + Main.treeStyle[0] = 0; + Main.treeStyle[1] = 0; + Main.treeStyle[2] = 0; + Main.treeStyle[3] = 0; + WorldGen.noLiquidCheck = false; + Liquid.numLiquid = 0; + LiquidBuffer.numLiquidBuffer = 0; + if (Main.netMode == 1 || WorldGen.lastMaxTilesX > Main.maxTilesX || WorldGen.lastMaxTilesY > Main.maxTilesY) + { + for (int k = 0; k < WorldGen.lastMaxTilesX; k++) + { + float num2 = (float)k / (float)WorldGen.lastMaxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[46], + " ", + (int)(num2 * 100f + 1f), + "%" + }); + for (int l = 0; l < WorldGen.lastMaxTilesY; l++) + { + Main.tile[k, l] = null; + } + } + } + WorldGen.lastMaxTilesX = Main.maxTilesX; + WorldGen.lastMaxTilesY = Main.maxTilesY; + if (Main.netMode != 1) + { + for (int m = 0; m < Main.maxTilesX; m++) + { + float num3 = (float)m / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[47], + " ", + (int)(num3 * 100f + 1f), + "%" + }); + for (int n = 0; n < Main.maxTilesY; n++) + { + Main.tile[m, n] = new Tile(); + } + } + } + for (int num4 = 0; num4 < 6000; num4++) + { + Main.dust[num4] = new Dust(); + } + for (int num5 = 0; num5 < 500; num5++) + { + Main.gore[num5] = new Gore(); + } + for (int num6 = 0; num6 < 400; num6++) + { + Main.item[num6] = new Item(); + } + for (int num7 = 0; num7 < 200; num7++) + { + Main.npc[num7] = new NPC(); + } + for (int num8 = 0; num8 < 1000; num8++) + { + Main.projectile[num8] = new Projectile(); + } + for (int num9 = 0; num9 < 1000; num9++) + { + Main.chest[num9] = null; + } + for (int num10 = 0; num10 < 1000; num10++) + { + Main.sign[num10] = null; + } + for (int num11 = 0; num11 < Liquid.resLiquid; num11++) + { + Main.liquid[num11] = new Liquid(); + } + for (int num12 = 0; num12 < 10000; num12++) + { + Main.liquidBuffer[num12] = new LiquidBuffer(); + } + WorldGen.setWorldSize(); + WorldGen.worldCleared = true; + } + public static void saveWorld(bool resetTime = false) + { + if (Main.worldName == "") + { + Main.worldName = "World"; + } + if (WorldGen.saveLock) + { + return; + } + WorldGen.saveLock = true; + while (WorldGen.hardLock) + { + Main.statusText = Lang.gen[48]; + } + lock (WorldGen.padlock) + { + try + { + Directory.CreateDirectory(Main.WorldPath); + } + catch + { + } + if (!Main.skipMenu) + { + bool value = Main.dayTime; + WorldGen.tempTime = Main.time; + WorldGen.tempMoonPhase = Main.moonPhase; + WorldGen.tempBloodMoon = Main.bloodMoon; + WorldGen.tempEclipse = Main.eclipse; + if (resetTime) + { + value = true; + WorldGen.tempTime = 13500.0; + WorldGen.tempMoonPhase = 0; + WorldGen.tempBloodMoon = false; + WorldGen.tempEclipse = false; + } + if (Main.worldPathName != null) + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + string text = Main.worldPathName + ".sav"; + using (FileStream fileStream = new FileStream(text, FileMode.Create)) + { + using (BinaryWriter binaryWriter = new BinaryWriter(fileStream)) + { + binaryWriter.Write(Main.curRelease); + binaryWriter.Write(Main.worldName); + binaryWriter.Write(Main.worldID); + binaryWriter.Write((int)Main.leftWorld); + binaryWriter.Write((int)Main.rightWorld); + binaryWriter.Write((int)Main.topWorld); + binaryWriter.Write((int)Main.bottomWorld); + binaryWriter.Write(Main.maxTilesY); + binaryWriter.Write(Main.maxTilesX); + binaryWriter.Write((byte)Main.moonType); + binaryWriter.Write(Main.treeX[0]); + binaryWriter.Write(Main.treeX[1]); + binaryWriter.Write(Main.treeX[2]); + binaryWriter.Write(Main.treeStyle[0]); + binaryWriter.Write(Main.treeStyle[1]); + binaryWriter.Write(Main.treeStyle[2]); + binaryWriter.Write(Main.treeStyle[3]); + binaryWriter.Write(Main.caveBackX[0]); + binaryWriter.Write(Main.caveBackX[1]); + binaryWriter.Write(Main.caveBackX[2]); + binaryWriter.Write(Main.caveBackStyle[0]); + binaryWriter.Write(Main.caveBackStyle[1]); + binaryWriter.Write(Main.caveBackStyle[2]); + binaryWriter.Write(Main.caveBackStyle[3]); + binaryWriter.Write(Main.iceBackStyle); + binaryWriter.Write(Main.jungleBackStyle); + binaryWriter.Write(Main.hellBackStyle); + binaryWriter.Write(Main.spawnTileX); + binaryWriter.Write(Main.spawnTileY); + binaryWriter.Write(Main.worldSurface); + binaryWriter.Write(Main.rockLayer); + binaryWriter.Write(WorldGen.tempTime); + binaryWriter.Write(value); + binaryWriter.Write(WorldGen.tempMoonPhase); + binaryWriter.Write(WorldGen.tempBloodMoon); + binaryWriter.Write(WorldGen.tempEclipse); + binaryWriter.Write(Main.dungeonX); + binaryWriter.Write(Main.dungeonY); + binaryWriter.Write(WorldGen.crimson); + binaryWriter.Write(NPC.downedBoss1); + binaryWriter.Write(NPC.downedBoss2); + binaryWriter.Write(NPC.downedBoss3); + binaryWriter.Write(NPC.downedQueenBee); + binaryWriter.Write(NPC.downedMechBoss1); + binaryWriter.Write(NPC.downedMechBoss2); + binaryWriter.Write(NPC.downedMechBoss3); + binaryWriter.Write(NPC.downedMechBossAny); + binaryWriter.Write(NPC.downedPlantBoss); + binaryWriter.Write(NPC.downedGolemBoss); + binaryWriter.Write(NPC.savedGoblin); + binaryWriter.Write(NPC.savedWizard); + binaryWriter.Write(NPC.savedMech); + binaryWriter.Write(NPC.downedGoblins); + binaryWriter.Write(NPC.downedClown); + binaryWriter.Write(NPC.downedFrost); + binaryWriter.Write(NPC.downedPirates); + binaryWriter.Write(WorldGen.shadowOrbSmashed); + binaryWriter.Write(WorldGen.spawnMeteor); + binaryWriter.Write((byte)WorldGen.shadowOrbCount); + binaryWriter.Write(WorldGen.altarCount); + binaryWriter.Write(Main.hardMode); + binaryWriter.Write(Main.invasionDelay); + binaryWriter.Write(Main.invasionSize); + binaryWriter.Write(Main.invasionType); + binaryWriter.Write(Main.invasionX); + binaryWriter.Write(WorldGen.tempRaining); + binaryWriter.Write(WorldGen.tempRainTime); + binaryWriter.Write(WorldGen.tempMaxRain); + binaryWriter.Write(WorldGen.oreTier1); + binaryWriter.Write(WorldGen.oreTier2); + binaryWriter.Write(WorldGen.oreTier3); + binaryWriter.Write((byte)WorldGen.treeBG); + binaryWriter.Write((byte)WorldGen.corruptBG); + binaryWriter.Write((byte)WorldGen.jungleBG); + binaryWriter.Write((byte)WorldGen.snowBG); + binaryWriter.Write((byte)WorldGen.hallowBG); + binaryWriter.Write((byte)WorldGen.crimsonBG); + binaryWriter.Write((byte)WorldGen.desertBG); + binaryWriter.Write((byte)WorldGen.oceanBG); + binaryWriter.Write((int)Main.cloudBGActive); + binaryWriter.Write((short)Main.numClouds); + binaryWriter.Write(Main.windSpeedSet); + for (int i = 0; i < Main.maxTilesX; i++) + { + float num = (float)i / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[49], + " ", + (int)(num * 100f + 1f), + "%" + }); + for (int j = 0; j < Main.maxTilesY; j++) + { + if (Main.tile[i, j].type == 127 && Main.tile[i, j].active()) + { + WorldGen.KillTile(i, j, false, false, false); + WorldGen.KillTile(i, j, false, false, false); + if (!Main.tile[i, j].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)i, (float)j, 0f, 0); + } + } + Tile tile = (Tile)Main.tile[i, j].Clone(); + binaryWriter.Write(tile.active()); + if (tile.active()) + { + binaryWriter.Write(tile.type); + if (Main.tileFrameImportant[(int)tile.type]) + { + binaryWriter.Write(tile.frameX); + binaryWriter.Write(tile.frameY); + } + if (tile.color() > 0) + { + binaryWriter.Write(true); + binaryWriter.Write(tile.color()); + } + else + { + binaryWriter.Write(false); + } + } + if (Main.tile[i, j].wall > 0) + { + binaryWriter.Write(true); + binaryWriter.Write(tile.wall); + if (tile.wallColor() > 0) + { + binaryWriter.Write(true); + binaryWriter.Write(tile.wallColor()); + } + else + { + binaryWriter.Write(false); + } + } + else + { + binaryWriter.Write(false); + } + if (tile.liquid > 0) + { + binaryWriter.Write(true); + binaryWriter.Write(tile.liquid); + binaryWriter.Write(tile.lava()); + binaryWriter.Write(tile.honey()); + } + else + { + binaryWriter.Write(false); + } + binaryWriter.Write(tile.wire()); + binaryWriter.Write(tile.wire2()); + binaryWriter.Write(tile.wire3()); + binaryWriter.Write(tile.halfBrick()); + binaryWriter.Write(tile.slope()); + binaryWriter.Write(tile.actuator()); + binaryWriter.Write(tile.inActive()); + int num2 = 1; + while (j + num2 < Main.maxTilesY && tile.isTheSameAs(Main.tile[i, j + num2])) + { + num2++; + } + num2--; + binaryWriter.Write((short)num2); + j += num2; + } + } + for (int k = 0; k < 1000; k++) + { + if (Main.chest[k] == null) + { + binaryWriter.Write(false); + } + else + { + Chest chest = (Chest)Main.chest[k].Clone(); + binaryWriter.Write(true); + binaryWriter.Write(chest.x); + binaryWriter.Write(chest.y); + for (int l = 0; l < Chest.maxItems; l++) + { + if (chest.item[l] == null) + { + chest.item[l] = new Item(); + } + if (chest.item[l].type == 0) + { + chest.item[l].stack = 0; + } + binaryWriter.Write((short)chest.item[l].stack); + if (chest.item[l].stack > 0) + { + binaryWriter.Write(chest.item[l].netID); + binaryWriter.Write(chest.item[l].prefix); + } + } + } + } + for (int m = 0; m < 1000; m++) + { + if (Main.sign[m] == null || Main.sign[m].text == null) + { + binaryWriter.Write(false); + } + else + { + Sign sign = (Sign)Main.sign[m].Clone(); + binaryWriter.Write(true); + binaryWriter.Write(sign.text); + binaryWriter.Write(sign.x); + binaryWriter.Write(sign.y); + } + } + for (int n = 0; n < 200; n++) + { + NPC nPC = (NPC)Main.npc[n].Clone(); + if (nPC.active && nPC.townNPC) + { + binaryWriter.Write(true); + binaryWriter.Write(nPC.name); + binaryWriter.Write(nPC.position.X); + binaryWriter.Write(nPC.position.Y); + binaryWriter.Write(nPC.homeless); + binaryWriter.Write(nPC.homeTileX); + binaryWriter.Write(nPC.homeTileY); + } + } + binaryWriter.Write(false); + binaryWriter.Write(Main.chrName[17]); + binaryWriter.Write(Main.chrName[18]); + binaryWriter.Write(Main.chrName[19]); + binaryWriter.Write(Main.chrName[20]); + binaryWriter.Write(Main.chrName[22]); + binaryWriter.Write(Main.chrName[54]); + binaryWriter.Write(Main.chrName[38]); + binaryWriter.Write(Main.chrName[107]); + binaryWriter.Write(Main.chrName[108]); + binaryWriter.Write(Main.chrName[124]); + binaryWriter.Write(Main.chrName[160]); + binaryWriter.Write(Main.chrName[178]); + binaryWriter.Write(Main.chrName[207]); + binaryWriter.Write(Main.chrName[208]); + binaryWriter.Write(Main.chrName[209]); + binaryWriter.Write(Main.chrName[227]); + binaryWriter.Write(Main.chrName[228]); + binaryWriter.Write(Main.chrName[229]); + binaryWriter.Write(true); + binaryWriter.Write(Main.worldName); + binaryWriter.Write(Main.worldID); + binaryWriter.Close(); + fileStream.Close(); + if (File.Exists(Main.worldPathName)) + { + Main.statusText = Lang.gen[50]; + string destFileName = Main.worldPathName + ".bak"; + File.Copy(Main.worldPathName, destFileName, true); + } + File.Copy(text, Main.worldPathName, true); + File.Delete(text); + } + } + WorldGen.saveLock = false; + } + } + } + } + public static void randMoon() + { + Main.moonType = WorldGen.genRand.Next(Main.maxMoons); + } + public static void setBG(int bg, int style) + { + if (bg == 0) + { + WorldGen.treeBG = style; + Main.treeMntBG[0] = 7; + Main.treeMntBG[1] = 8; + if (style == 1) + { + Main.treeBG[0] = 50; + Main.treeBG[1] = 51; + Main.treeBG[2] = 52; + return; + } + if (style == 2) + { + Main.treeBG[0] = 53; + Main.treeBG[1] = 54; + Main.treeBG[2] = 55; + return; + } + if (style == 3) + { + Main.treeMntBG[1] = 90; + Main.treeBG[0] = 91; + Main.treeBG[1] = -1; + Main.treeBG[2] = 92; + return; + } + if (style == 31) + { + Main.treeMntBG[1] = 90; + Main.treeBG[0] = 91; + Main.treeBG[1] = -1; + Main.treeBG[2] = 11; + return; + } + if (style == 4) + { + Main.treeMntBG[0] = 93; + Main.treeMntBG[1] = 94; + Main.treeBG[0] = -1; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + } + if (style == 5) + { + Main.treeMntBG[0] = 93; + Main.treeMntBG[1] = 94; + Main.treeBG[0] = -1; + Main.treeBG[1] = -1; + Main.treeBG[2] = 55; + return; + } + if (style == 51) + { + Main.treeMntBG[0] = 93; + Main.treeMntBG[1] = 94; + Main.treeBG[0] = -1; + Main.treeBG[1] = -1; + Main.treeBG[2] = 11; + return; + } + if (style == 6) + { + Main.treeMntBG[0] = 171; + Main.treeMntBG[1] = 172; + Main.treeBG[0] = 173; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + } + if (style == 7) + { + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + } + if (style == 71) + { + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = 11; + return; + } + if (style == 72) + { + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = 52; + return; + } + if (style == 73) + { + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = 55; + return; + } + if (style == 8) + { + Main.treeMntBG[0] = 179; + Main.treeMntBG[1] = 180; + Main.treeBG[0] = 184; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + } + Main.treeBG[0] = 9; + Main.treeBG[1] = 10; + Main.treeBG[2] = 11; + return; + } + else + { + if (bg == 1) + { + WorldGen.corruptBG = style; + if (style == 1) + { + Main.corruptBG[0] = 56; + Main.corruptBG[1] = 57; + Main.corruptBG[2] = 58; + return; + } + Main.corruptBG[0] = 12; + Main.corruptBG[1] = 13; + Main.corruptBG[2] = 14; + return; + } + else + { + if (bg == 2) + { + WorldGen.jungleBG = style; + if (style == 1) + { + Main.jungleBG[0] = 59; + Main.jungleBG[1] = 60; + Main.jungleBG[2] = 61; + return; + } + Main.jungleBG[0] = 15; + Main.jungleBG[1] = 16; + Main.jungleBG[2] = 17; + return; + } + else + { + if (bg == 3) + { + WorldGen.snowBG = style; + Main.snowMntBG[0] = 35; + Main.snowMntBG[1] = 36; + if (style == 1) + { + Main.snowBG[0] = 95; + Main.snowBG[1] = 96; + Main.snowBG[2] = 97; + return; + } + if (style == 2) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 99; + Main.snowBG[0] = -1; + Main.snowBG[1] = -1; + Main.snowBG[2] = -1; + return; + } + if (style == 21) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 99; + Main.snowBG[0] = 95; + Main.snowBG[1] = 96; + Main.snowBG[2] = 97; + return; + } + if (style == 22) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 99; + Main.snowBG[0] = 37; + Main.snowBG[1] = 38; + Main.snowBG[2] = 39; + return; + } + if (style == 3) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 100; + Main.snowBG[0] = -1; + Main.snowBG[1] = -1; + Main.snowBG[2] = -1; + return; + } + if (style == 31) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 100; + Main.snowBG[0] = 95; + Main.snowBG[1] = 96; + Main.snowBG[2] = 97; + return; + } + if (style == 32) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 100; + Main.snowBG[0] = 37; + Main.snowBG[1] = 38; + Main.snowBG[2] = 39; + return; + } + if (style == 4) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 101; + Main.snowBG[0] = -1; + Main.snowBG[1] = -1; + Main.snowBG[2] = -1; + return; + } + if (style == 41) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 101; + Main.snowBG[0] = 95; + Main.snowBG[1] = 96; + Main.snowBG[2] = 97; + return; + } + if (style == 42) + { + Main.snowMntBG[0] = 98; + Main.snowMntBG[1] = 101; + Main.snowBG[0] = 37; + Main.snowBG[1] = 38; + Main.snowBG[2] = 39; + return; + } + Main.snowBG[0] = 37; + Main.snowBG[1] = 38; + Main.snowBG[2] = 39; + return; + } + else + { + if (bg == 4) + { + WorldGen.hallowBG = style; + if (style == 1) + { + Main.hallowBG[0] = 102; + Main.hallowBG[1] = 103; + Main.hallowBG[2] = 104; + return; + } + Main.hallowBG[0] = 29; + Main.hallowBG[1] = 30; + Main.hallowBG[2] = 31; + return; + } + else + { + if (bg == 5) + { + WorldGen.crimsonBG = style; + if (style == 1) + { + Main.crimsonBG[0] = 105; + Main.crimsonBG[1] = 106; + Main.crimsonBG[2] = 107; + } + if (style == 2) + { + Main.crimsonBG[0] = 174; + Main.crimsonBG[1] = -1; + Main.crimsonBG[2] = 175; + return; + } + Main.crimsonBG[0] = 43; + Main.crimsonBG[1] = 44; + Main.crimsonBG[2] = 45; + return; + } + else + { + if (bg != 6) + { + if (bg == 7) + { + WorldGen.oceanBG = style; + if (style == 1) + { + Main.oceanBG = 110; + return; + } + if (style == 2) + { + Main.oceanBG = 111; + return; + } + Main.oceanBG = 28; + } + return; + } + WorldGen.desertBG = style; + if (style == 1) + { + Main.desertBG[0] = 108; + Main.desertBG[1] = 109; + return; + } + Main.desertBG[0] = 21; + Main.desertBG[1] = 20; + return; + } + } + } + } + } + } + } + public static void RandomWeather() + { + if (Main.cloudLimit < 10) + { + return; + } + Main.numClouds = WorldGen.genRand.Next(10, Main.cloudLimit); + Main.windSpeed = 0f; + while (Main.windSpeed == 0f) + { + Main.windSpeed = (float)WorldGen.genRand.Next(-100, 101) * 0.01f; + Main.windSpeedSet = Main.windSpeed; + } + Cloud.resetClouds(); + } + public static void loadWorld() + { + Main.checkXMas(); + if (!File.Exists(Main.worldPathName) && Main.autoGen) + { + for (int i = Main.worldPathName.Length - 1; i >= 0; i--) + { + if (Main.worldPathName.Substring(i, 1) == string.Concat(Path.DirectorySeparatorChar)) + { + string path = Main.worldPathName.Substring(0, i); + Directory.CreateDirectory(path); + break; + } + } + WorldGen.clearWorld(); + WorldGen.generateWorld(-1); + WorldGen.saveWorld(false); + } + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + using (FileStream fileStream = new FileStream(Main.worldPathName, FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader(fileStream)) + { + try + { + WorldGen.loadFailed = false; + WorldGen.loadSuccess = false; + int num = binaryReader.ReadInt32(); + if (num > Main.curRelease) + { + WorldGen.loadFailed = true; + WorldGen.loadSuccess = false; + try + { + binaryReader.Close(); + fileStream.Close(); + } + catch + { + } + } + else + { + Main.worldName = binaryReader.ReadString(); + Main.worldID = binaryReader.ReadInt32(); + Main.leftWorld = (float)binaryReader.ReadInt32(); + Main.rightWorld = (float)binaryReader.ReadInt32(); + Main.topWorld = (float)binaryReader.ReadInt32(); + Main.bottomWorld = (float)binaryReader.ReadInt32(); + Main.maxTilesY = binaryReader.ReadInt32(); + Main.maxTilesX = binaryReader.ReadInt32(); + if (num >= 63) + { + Main.moonType = (int)binaryReader.ReadByte(); + } + else + { + WorldGen.randMoon(); + } + WorldGen.clearWorld(); + if (num >= 44) + { + Main.treeX[0] = binaryReader.ReadInt32(); + Main.treeX[1] = binaryReader.ReadInt32(); + Main.treeX[2] = binaryReader.ReadInt32(); + Main.treeStyle[0] = binaryReader.ReadInt32(); + Main.treeStyle[1] = binaryReader.ReadInt32(); + Main.treeStyle[2] = binaryReader.ReadInt32(); + Main.treeStyle[3] = binaryReader.ReadInt32(); + } + if (num >= 60) + { + Main.caveBackX[0] = binaryReader.ReadInt32(); + Main.caveBackX[1] = binaryReader.ReadInt32(); + Main.caveBackX[2] = binaryReader.ReadInt32(); + Main.caveBackStyle[0] = binaryReader.ReadInt32(); + Main.caveBackStyle[1] = binaryReader.ReadInt32(); + Main.caveBackStyle[2] = binaryReader.ReadInt32(); + Main.caveBackStyle[3] = binaryReader.ReadInt32(); + Main.iceBackStyle = binaryReader.ReadInt32(); + if (num >= 61) + { + Main.jungleBackStyle = binaryReader.ReadInt32(); + Main.hellBackStyle = binaryReader.ReadInt32(); + } + } + else + { + WorldGen.setCaveBacks(); + } + Main.spawnTileX = binaryReader.ReadInt32(); + Main.spawnTileY = binaryReader.ReadInt32(); + Main.worldSurface = binaryReader.ReadDouble(); + Main.rockLayer = binaryReader.ReadDouble(); + WorldGen.tempTime = binaryReader.ReadDouble(); + WorldGen.tempDayTime = binaryReader.ReadBoolean(); + WorldGen.tempMoonPhase = binaryReader.ReadInt32(); + WorldGen.tempBloodMoon = binaryReader.ReadBoolean(); + if (num >= 70) + { + WorldGen.tempEclipse = binaryReader.ReadBoolean(); + Main.eclipse = WorldGen.tempEclipse; + } + Main.dungeonX = binaryReader.ReadInt32(); + Main.dungeonY = binaryReader.ReadInt32(); + if (num >= 56) + { + WorldGen.crimson = binaryReader.ReadBoolean(); + } + else + { + WorldGen.crimson = false; + } + NPC.downedBoss1 = binaryReader.ReadBoolean(); + NPC.downedBoss2 = binaryReader.ReadBoolean(); + NPC.downedBoss3 = binaryReader.ReadBoolean(); + if (num >= 66) + { + NPC.downedQueenBee = binaryReader.ReadBoolean(); + } + if (num >= 44) + { + NPC.downedMechBoss1 = binaryReader.ReadBoolean(); + NPC.downedMechBoss2 = binaryReader.ReadBoolean(); + NPC.downedMechBoss3 = binaryReader.ReadBoolean(); + NPC.downedMechBossAny = binaryReader.ReadBoolean(); + } + if (num >= 64) + { + NPC.downedPlantBoss = binaryReader.ReadBoolean(); + NPC.downedGolemBoss = binaryReader.ReadBoolean(); + } + if (num >= 29) + { + NPC.savedGoblin = binaryReader.ReadBoolean(); + NPC.savedWizard = binaryReader.ReadBoolean(); + if (num >= 34) + { + NPC.savedMech = binaryReader.ReadBoolean(); + } + NPC.downedGoblins = binaryReader.ReadBoolean(); + } + if (num >= 32) + { + NPC.downedClown = binaryReader.ReadBoolean(); + } + if (num >= 37) + { + NPC.downedFrost = binaryReader.ReadBoolean(); + } + if (num >= 56) + { + NPC.downedPirates = binaryReader.ReadBoolean(); + } + WorldGen.shadowOrbSmashed = binaryReader.ReadBoolean(); + WorldGen.spawnMeteor = binaryReader.ReadBoolean(); + WorldGen.shadowOrbCount = (int)binaryReader.ReadByte(); + if (num >= 23) + { + WorldGen.altarCount = binaryReader.ReadInt32(); + Main.hardMode = binaryReader.ReadBoolean(); + } + Main.invasionDelay = binaryReader.ReadInt32(); + Main.invasionSize = binaryReader.ReadInt32(); + Main.invasionType = binaryReader.ReadInt32(); + Main.invasionX = binaryReader.ReadDouble(); + if (num >= 53) + { + WorldGen.tempRaining = binaryReader.ReadBoolean(); + WorldGen.tempRainTime = binaryReader.ReadInt32(); + WorldGen.tempMaxRain = binaryReader.ReadSingle(); + } + if (num >= 54) + { + WorldGen.oreTier1 = binaryReader.ReadInt32(); + WorldGen.oreTier2 = binaryReader.ReadInt32(); + WorldGen.oreTier3 = binaryReader.ReadInt32(); + } + else + { + if (num >= 23 && WorldGen.altarCount == 0) + { + WorldGen.oreTier1 = -1; + WorldGen.oreTier2 = -1; + WorldGen.oreTier3 = -1; + } + else + { + WorldGen.oreTier1 = 107; + WorldGen.oreTier2 = 108; + WorldGen.oreTier3 = 111; + } + } + int style = 0; + int style2 = 0; + int style3 = 0; + int style4 = 0; + int style5 = 0; + int style6 = 0; + int style7 = 0; + int style8 = 0; + if (num >= 55) + { + style = (int)binaryReader.ReadByte(); + style2 = (int)binaryReader.ReadByte(); + style3 = (int)binaryReader.ReadByte(); + } + if (num >= 60) + { + style4 = (int)binaryReader.ReadByte(); + style5 = (int)binaryReader.ReadByte(); + style6 = (int)binaryReader.ReadByte(); + style7 = (int)binaryReader.ReadByte(); + style8 = (int)binaryReader.ReadByte(); + } + WorldGen.setBG(0, style); + WorldGen.setBG(1, style2); + WorldGen.setBG(2, style3); + WorldGen.setBG(3, style4); + WorldGen.setBG(4, style5); + WorldGen.setBG(5, style6); + WorldGen.setBG(6, style7); + WorldGen.setBG(7, style8); + if (num >= 60) + { + Main.cloudBGActive = (float)binaryReader.ReadInt32(); + if (Main.cloudBGActive >= 1f) + { + Main.cloudBGAlpha = 1f; + } + else + { + Main.cloudBGAlpha = 0f; + } + } + else + { + Main.cloudBGActive = (float)(-(float)WorldGen.genRand.Next(8640, 86400)); + } + if (num >= 62) + { + Main.numClouds = (int)binaryReader.ReadInt16(); + Main.windSpeedSet = binaryReader.ReadSingle(); + Main.windSpeed = Main.windSpeedSet; + } + else + { + WorldGen.RandomWeather(); + } + for (int j = 0; j < Main.maxTilesX; j++) + { + float num2 = (float)j / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[51], + " ", + (int)(num2 * 100f + 1f), + "%" + }); + for (int k = 0; k < Main.maxTilesY; k++) + { + Main.tile[j, k].active(binaryReader.ReadBoolean()); + if (Main.tile[j, k].active()) + { + Main.tile[j, k].type = binaryReader.ReadByte(); + if (Main.tile[j, k].type == 127) + { + Main.tile[j, k].active(false); + } + if (Main.tileFrameImportant[(int)Main.tile[j, k].type]) + { + if (num < 28 && Main.tile[j, k].type == 4) + { + Main.tile[j, k].frameX = 0; + Main.tile[j, k].frameY = 0; + } + else + { + if (num < 40 && Main.tile[j, k].type == 19) + { + Main.tile[j, k].frameX = 0; + Main.tile[j, k].frameY = 0; + } + else + { + Main.tile[j, k].frameX = binaryReader.ReadInt16(); + Main.tile[j, k].frameY = binaryReader.ReadInt16(); + if (Main.tile[j, k].type == 144) + { + Main.tile[j, k].frameY = 0; + } + } + } + } + else + { + Main.tile[j, k].frameX = -1; + Main.tile[j, k].frameY = -1; + } + if (num >= 48 && binaryReader.ReadBoolean()) + { + Main.tile[j, k].color(binaryReader.ReadByte()); + } + } + if (num <= 25) + { + binaryReader.ReadBoolean(); + } + if (binaryReader.ReadBoolean()) + { + Main.tile[j, k].wall = binaryReader.ReadByte(); + if (num >= 48 && binaryReader.ReadBoolean()) + { + Main.tile[j, k].wallColor(binaryReader.ReadByte()); + } + } + if (binaryReader.ReadBoolean()) + { + Main.tile[j, k].liquid = binaryReader.ReadByte(); + Main.tile[j, k].lava(binaryReader.ReadBoolean()); + if (num >= 51) + { + Main.tile[j, k].honey(binaryReader.ReadBoolean()); + } + } + if (num >= 33) + { + Main.tile[j, k].wire(binaryReader.ReadBoolean()); + } + if (num >= 43) + { + Main.tile[j, k].wire2(binaryReader.ReadBoolean()); + Main.tile[j, k].wire3(binaryReader.ReadBoolean()); + } + if (num >= 41) + { + Main.tile[j, k].halfBrick(binaryReader.ReadBoolean()); + if (!Main.tileSolid[(int)Main.tile[j, k].type]) + { + Main.tile[j, k].halfBrick(false); + } + if (num >= 49) + { + Main.tile[j, k].slope(binaryReader.ReadByte()); + if (!Main.tileSolid[(int)Main.tile[j, k].type]) + { + Main.tile[j, k].slope(0); + } + } + } + if (num >= 42) + { + Main.tile[j, k].actuator(binaryReader.ReadBoolean()); + Main.tile[j, k].inActive(binaryReader.ReadBoolean()); + } + if (num >= 25) + { + int num3 = (int)binaryReader.ReadInt16(); + if (num3 > 0) + { + for (int l = k + 1; l < k + num3 + 1; l++) + { + Main.tile[j, l].active(Main.tile[j, k].active()); + Main.tile[j, l].type = Main.tile[j, k].type; + Main.tile[j, l].wall = Main.tile[j, k].wall; + Main.tile[j, l].frameX = Main.tile[j, k].frameX; + Main.tile[j, l].frameY = Main.tile[j, k].frameY; + Main.tile[j, l].liquid = Main.tile[j, k].liquid; + Main.tile[j, l].lava(Main.tile[j, k].lava()); + Main.tile[j, l].honey(Main.tile[j, k].honey()); + Main.tile[j, l].wire(Main.tile[j, k].wire()); + Main.tile[j, l].wire2(Main.tile[j, k].wire2()); + Main.tile[j, l].wire3(Main.tile[j, k].wire3()); + Main.tile[j, l].halfBrick(Main.tile[j, k].halfBrick()); + Main.tile[j, l].actuator(Main.tile[j, k].actuator()); + Main.tile[j, l].inActive(Main.tile[j, k].inActive()); + Main.tile[j, l].color(Main.tile[j, k].color()); + Main.tile[j, l].wallColor(Main.tile[j, k].wallColor()); + } + k += num3; + } + } + } + } + if (num < 67) + { + WorldGen.FixSunflowers(); + } + int num4 = 40; + if (num < 58) + { + num4 = 20; + } + for (int m = 0; m < 1000; m++) + { + if (binaryReader.ReadBoolean()) + { + Main.chest[m] = new Chest(); + Main.chest[m].x = binaryReader.ReadInt32(); + Main.chest[m].y = binaryReader.ReadInt32(); + for (int n = 0; n < 40; n++) + { + Main.chest[m].item[n] = new Item(); + if (n < num4) + { + int num5; + if (num >= 59) + { + num5 = (int)binaryReader.ReadInt16(); + } + else + { + num5 = (int)binaryReader.ReadByte(); + } + if (num5 > 0) + { + if (num >= 38) + { + Main.chest[m].item[n].netDefaults(binaryReader.ReadInt32()); + } + else + { + string defaults = Item.VersionName(binaryReader.ReadString(), num); + Main.chest[m].item[n].SetDefaults(defaults); + } + Main.chest[m].item[n].stack = num5; + if (num >= 36) + { + Main.chest[m].item[n].Prefix((int)binaryReader.ReadByte()); + } + } + } + } + } + } + for (int num6 = 0; num6 < 1000; num6++) + { + if (binaryReader.ReadBoolean()) + { + string text = binaryReader.ReadString(); + int num7 = binaryReader.ReadInt32(); + int num8 = binaryReader.ReadInt32(); + if (Main.tile[num7, num8].active() && (Main.tile[num7, num8].type == 55 || Main.tile[num7, num8].type == 85)) + { + Main.sign[num6] = new Sign(); + Main.sign[num6].x = num7; + Main.sign[num6].y = num8; + Main.sign[num6].text = text; + } + } + } + bool flag = binaryReader.ReadBoolean(); + int num9 = 0; + while (flag) + { + Main.npc[num9].SetDefaults(binaryReader.ReadString()); + Main.npc[num9].position.X = binaryReader.ReadSingle(); + Main.npc[num9].position.Y = binaryReader.ReadSingle(); + Main.npc[num9].homeless = binaryReader.ReadBoolean(); + Main.npc[num9].homeTileX = binaryReader.ReadInt32(); + Main.npc[num9].homeTileY = binaryReader.ReadInt32(); + flag = binaryReader.ReadBoolean(); + num9++; + } + if (num >= 31) + { + Main.chrName[17] = binaryReader.ReadString(); + Main.chrName[18] = binaryReader.ReadString(); + Main.chrName[19] = binaryReader.ReadString(); + Main.chrName[20] = binaryReader.ReadString(); + Main.chrName[22] = binaryReader.ReadString(); + Main.chrName[54] = binaryReader.ReadString(); + Main.chrName[38] = binaryReader.ReadString(); + Main.chrName[107] = binaryReader.ReadString(); + Main.chrName[108] = binaryReader.ReadString(); + if (num >= 35) + { + Main.chrName[124] = binaryReader.ReadString(); + if (num >= 65) + { + Main.chrName[160] = binaryReader.ReadString(); + Main.chrName[178] = binaryReader.ReadString(); + Main.chrName[207] = binaryReader.ReadString(); + Main.chrName[208] = binaryReader.ReadString(); + Main.chrName[209] = binaryReader.ReadString(); + Main.chrName[227] = binaryReader.ReadString(); + Main.chrName[228] = binaryReader.ReadString(); + Main.chrName[229] = binaryReader.ReadString(); + } + } + } + if (num >= 7) + { + bool flag2 = binaryReader.ReadBoolean(); + string text2 = binaryReader.ReadString(); + int num10 = binaryReader.ReadInt32(); + if (!flag2 || !(text2 == Main.worldName) || num10 != Main.worldID) + { + WorldGen.loadSuccess = false; + WorldGen.loadFailed = true; + binaryReader.Close(); + fileStream.Close(); + return; + } + WorldGen.loadSuccess = true; + } + else + { + WorldGen.loadSuccess = true; + } + binaryReader.Close(); + fileStream.Close(); + if (!WorldGen.loadFailed && WorldGen.loadSuccess) + { + WorldGen.gen = true; + for (int num11 = 0; num11 < Main.maxTilesX; num11++) + { + float num12 = (float)num11 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[52], + " ", + (int)(num12 * 100f + 1f), + "%" + }); + WorldGen.CountTiles(num11); + } + WorldGen.waterLine = Main.maxTilesY; + NPC.setNames(); + Liquid.QuickWater(2, -1, -1); + WorldGen.WaterCheck(); + int num13 = 0; + Liquid.quickSettle = true; + int num14 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + float num15 = 0f; + while (Liquid.numLiquid > 0 && num13 < 100000) + { + num13++; + float num16 = (float)(num14 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float)num14; + if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num14) + { + num14 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + } + if (num16 > num15) + { + num15 = num16; + } + else + { + num16 = num15; + } + Main.statusText = string.Concat(new object[] + { + Lang.gen[27], + " ", + (int)(num16 * 100f / 2f + 50f), + "%" + }); + Liquid.UpdateLiquid(); + } + Liquid.quickSettle = false; + Main.weatherCounter = WorldGen.genRand.Next(3600, 18000); + Cloud.resetClouds(); + WorldGen.WaterCheck(); + WorldGen.gen = false; + } + } + } + catch + { + WorldGen.loadFailed = true; + WorldGen.loadSuccess = false; + try + { + binaryReader.Close(); + fileStream.Close(); + } + catch + { + } + } + } + } + } + private static void resetGen() + { + WorldGen.mudWall = false; + WorldGen.hellChest = 0; + WorldGen.JungleX = 0; + WorldGen.numMCaves = 0; + WorldGen.numIslandHouses = 0; + WorldGen.houseCount = 0; + WorldGen.dEnteranceX = 0; + WorldGen.numDRooms = 0; + WorldGen.numDDoors = 0; + WorldGen.numDPlats = 0; + WorldGen.numJChests = 0; + WorldGen.numHives = 0; + } + public static bool mayanTrap(int x2, int y2) + { + int num = 1; + if (WorldGen.genRand.Next(3) == 0) + { + num = 0; + } + int num2 = y2; + while (!WorldGen.SolidTile(x2, num2)) + { + num2++; + if (num2 >= Main.maxTilesY - 300) + { + return false; + } + } + if (Main.tile[x2, num2].type == 232) + { + return false; + } + num2--; + if (Main.tile[x2, num2].liquid > 0 && Main.tile[x2, num2].lava()) + { + return false; + } + if (num == -1 && Main.rand.Next(20) == 0) + { + num = 2; + } + else + { + if (num == -1) + { + num = Main.rand.Next(2); + } + } + if (Main.tile[x2, num2].nactive() || Main.tile[x2 - 1, num2].nactive() || Main.tile[x2 + 1, num2].nactive() || Main.tile[x2, num2 - 1].nactive() || Main.tile[x2 - 1, num2 - 1].nactive() || Main.tile[x2 + 1, num2 - 1].nactive() || Main.tile[x2, num2 - 2].nactive() || Main.tile[x2 - 1, num2 - 2].nactive() || Main.tile[x2 + 1, num2 - 2].nactive()) + { + return false; + } + if (Main.tile[x2, num2 + 1].type == 48) + { + return false; + } + if (Main.tile[x2, num2 + 1].type == 232) + { + return false; + } + if (num == 0) + { + int num3 = x2; + int num4 = num2; + num4 -= WorldGen.genRand.Next(3); + while (!WorldGen.SolidTile(num3, num4)) + { + num3--; + } + int num5 = num3; + num3 = x2; + while (!WorldGen.SolidTile(num3, num4)) + { + num3++; + } + int num6 = num3; + int num7 = x2 - num5; + int num8 = num6 - x2; + bool flag = false; + bool flag2 = false; + if (num7 > 5 && num7 < 50) + { + flag = true; + } + if (num8 > 5 && num8 < 50) + { + flag2 = true; + } + if (flag && !WorldGen.SolidTile(num5, num4 + 1)) + { + flag = false; + } + if (flag2 && !WorldGen.SolidTile(num6, num4 + 1)) + { + flag2 = false; + } + if (flag && (Main.tile[num5, num4].type == 10 || Main.tile[num5, num4].type == 48 || Main.tile[num5, num4 + 1].type == 10 || Main.tile[num5, num4 + 1].type == 48)) + { + flag = false; + } + if (flag2 && (Main.tile[num6, num4].type == 10 || Main.tile[num6, num4].type == 48 || Main.tile[num6, num4 + 1].type == 10 || Main.tile[num6, num4 + 1].type == 48)) + { + flag2 = false; + } + int num9; + if (flag && flag2) + { + num9 = 1; + num3 = num5; + if (WorldGen.genRand.Next(2) == 0) + { + num3 = num6; + num9 = -1; + } + } + else + { + if (flag2) + { + num3 = num6; + num9 = -1; + } + else + { + if (!flag) + { + return false; + } + num3 = num5; + num9 = 1; + } + } + if (Main.tile[num3, num4].wall != 87) + { + return false; + } + if (Main.tile[num3, num4].type == 190) + { + return false; + } + if (Main.tile[num3, num4].type == 135) + { + return false; + } + if (Main.tile[num3, num4].type == 137) + { + return false; + } + if (Main.tile[num3, num4].type == 232) + { + return false; + } + WorldGen.PlaceTile(x2, num2, 135, true, true, -1, 6); + WorldGen.KillTile(num3, num4, false, false, false); + int num10 = WorldGen.genRand.Next(3); + if (Main.tile[x2, num2].wire()) + { + num10 = 0; + } + if (Main.tile[x2, num2].wire2()) + { + num10 = 1; + } + if (Main.tile[x2, num2].wire3()) + { + num10 = 2; + } + int num11 = Math.Abs(num3 - x2); + int style = 1; + if (num11 < 10 && WorldGen.genRand.Next(3) != 0) + { + style = 2; + } + WorldGen.PlaceTile(num3, num4, 137, true, true, -1, style); + if (num9 == 1) + { + Tile expr_482 = Main.tile[num3, num4]; + expr_482.frameX += 18; + } + int i = WorldGen.genRand.Next(5); + int num12 = num4; + while (i > 0) + { + i--; + num12--; + if (!WorldGen.SolidTile(num3, num12) || !WorldGen.SolidTile(num3 - num9, num12) || WorldGen.SolidTile(num3 + num9, num12)) + { + break; + } + WorldGen.PlaceTile(num3, num12, 137, true, true, -1, style); + if (num9 == 1) + { + Tile expr_505 = Main.tile[num3, num12]; + expr_505.frameX += 18; + } + if (num10 == 0) + { + Main.tile[num3, num12].wire(true); + } + else + { + if (num10 == 1) + { + Main.tile[num3, num12].wire2(true); + } + else + { + if (num10 == 2) + { + Main.tile[num3, num12].wire3(true); + } + } + } + } + int num13 = x2; + int num14 = num2; + while (num13 != num3 || num14 != num4) + { + if (num10 == 0) + { + Main.tile[num13, num14].wire(true); + } + else + { + if (num10 == 1) + { + Main.tile[num13, num14].wire2(true); + } + else + { + if (num10 == 2) + { + Main.tile[num13, num14].wire3(true); + } + } + } + if (num13 > num3) + { + num13--; + } + if (num13 < num3) + { + num13++; + } + if (num10 == 0) + { + Main.tile[num13, num14].wire(true); + } + else + { + if (num10 == 1) + { + Main.tile[num13, num14].wire2(true); + } + else + { + if (num10 == 2) + { + Main.tile[num13, num14].wire3(true); + } + } + } + if (num14 > num4) + { + num14--; + } + if (num14 < num4) + { + num14++; + } + if (num10 == 0) + { + Main.tile[num13, num14].wire(true); + } + else + { + if (num10 == 1) + { + Main.tile[num13, num14].wire2(true); + } + else + { + if (num10 == 2) + { + Main.tile[num13, num14].wire3(true); + } + } + } + } + return true; + } + else + { + if (num != 1) + { + return false; + } + int num15 = num2; + while (!WorldGen.SolidTile(x2, num15)) + { + num15--; + if ((double)num15 < Main.worldSurface) + { + return false; + } + } + int num16 = Math.Abs(num15 - num2); + if (num16 < 3) + { + return false; + } + int num17 = WorldGen.genRand.Next(3); + if (Main.tile[x2, num2].wire()) + { + num17 = 0; + } + if (Main.tile[x2, num2].wire2()) + { + num17 = 1; + } + if (Main.tile[x2, num2].wire3()) + { + num17 = 2; + } + int style2 = 3; + if (num16 < 16 && Main.rand.Next(3) != 0) + { + style2 = 4; + } + if (Main.tile[x2, num15].type == 135) + { + return false; + } + if (Main.tile[x2, num15].type == 137) + { + return false; + } + if (Main.tile[x2, num15].type == 232) + { + return false; + } + if (Main.tile[x2, num15].wall != 87) + { + return false; + } + WorldGen.PlaceTile(x2, num2, 135, true, true, -1, 6); + WorldGen.PlaceTile(x2, num15, 137, true, true, -1, style2); + for (int j = 0; j < 2; j++) + { + int k = WorldGen.genRand.Next(1, 5); + int num18 = x2; + int num19 = -1; + if (j == 1) + { + num19 = 1; + } + while (k > 0) + { + k--; + num18 += num19; + if (!WorldGen.SolidTile(num18, num15 - 1) || WorldGen.SolidTile(num18, num15 + 1)) + { + break; + } + WorldGen.PlaceTile(num18, num15, 137, true, true, -1, style2); + if (num17 == 0) + { + Main.tile[num18, num15].wire(true); + } + else + { + if (num17 == 1) + { + Main.tile[num18, num15].wire2(true); + } + else + { + if (num17 == 2) + { + Main.tile[num18, num15].wire3(true); + } + } + } + } + } + int num20 = x2; + int num21 = num2; + while (num20 != x2 || num21 != num15) + { + if (num17 == 0) + { + Main.tile[num20, num21].wire(true); + } + else + { + if (num17 == 1) + { + Main.tile[num20, num21].wire2(true); + } + else + { + if (num17 == 2) + { + Main.tile[num20, num21].wire3(true); + } + } + } + if (num20 > x2) + { + num20--; + } + if (num20 < x2) + { + num20++; + } + if (num17 == 0) + { + Main.tile[num20, num21].wire(true); + } + else + { + if (num17 == 1) + { + Main.tile[num20, num21].wire2(true); + } + else + { + if (num17 == 2) + { + Main.tile[num20, num21].wire3(true); + } + } + } + if (num21 > num15) + { + num21--; + } + if (num21 < num15) + { + num21++; + } + if (num17 == 0) + { + Main.tile[num20, num21].wire(true); + } + else + { + if (num17 == 1) + { + Main.tile[num20, num21].wire2(true); + } + else + { + if (num17 == 2) + { + Main.tile[num20, num21].wire3(true); + } + } + } + } + return true; + } + } + public static bool placeTrap(int x2, int y2, int type = -1) + { + int num = y2; + while (!WorldGen.SolidTile(x2, num)) + { + num++; + if (num >= Main.maxTilesY - 300) + { + return false; + } + } + num--; + if (Main.tile[x2, num].wall == 87) + { + return false; + } + if (Main.tile[x2, num].liquid > 0 && Main.tile[x2, num].lava()) + { + return false; + } + if (type == -1 && Main.rand.Next(20) == 0) + { + type = 2; + } + else + { + if (type == -1) + { + type = Main.rand.Next(2); + } + } + if (Main.tile[x2, num].nactive() || Main.tile[x2 - 1, num].nactive() || Main.tile[x2 + 1, num].nactive() || Main.tile[x2, num - 1].nactive() || Main.tile[x2 - 1, num - 1].nactive() || Main.tile[x2 + 1, num - 1].nactive() || Main.tile[x2, num - 2].nactive() || Main.tile[x2 - 1, num - 2].nactive() || Main.tile[x2 + 1, num - 2].nactive()) + { + return false; + } + if (Main.tile[x2, num + 1].type == 48) + { + return false; + } + if (Main.tile[x2, num + 1].type == 232) + { + return false; + } + if (type == 1) + { + for (int i = x2 - 3; i <= x2 + 3; i++) + { + for (int j = num - 3; j <= num + 3; j++) + { + if (Main.tile[i, j].type == 147 || Main.tile[i, j].type == 161) + { + type = 0; + } + } + } + } + if (type == 0) + { + int num2 = x2; + int num3 = num; + num3 -= WorldGen.genRand.Next(3); + while (!WorldGen.SolidTile(num2, num3)) + { + num2--; + } + int num4 = num2; + num2 = x2; + while (!WorldGen.SolidTile(num2, num3)) + { + num2++; + } + int num5 = num2; + int num6 = x2 - num4; + int num7 = num5 - x2; + bool flag = false; + bool flag2 = false; + if (num6 > 5 && num6 < 50) + { + flag = true; + } + if (num7 > 5 && num7 < 50) + { + flag2 = true; + } + if (flag && !WorldGen.SolidTile(num4, num3 + 1)) + { + flag = false; + } + if (flag2 && !WorldGen.SolidTile(num5, num3 + 1)) + { + flag2 = false; + } + if (flag && (Main.tile[num4, num3].type == 10 || Main.tile[num4, num3].type == 48 || Main.tile[num4, num3 + 1].type == 10 || Main.tile[num4, num3 + 1].type == 48)) + { + flag = false; + } + if (flag2 && (Main.tile[num5, num3].type == 10 || Main.tile[num5, num3].type == 48 || Main.tile[num5, num3 + 1].type == 10 || Main.tile[num5, num3 + 1].type == 48)) + { + flag2 = false; + } + int num8; + if (flag && flag2) + { + num8 = 1; + num2 = num4; + if (WorldGen.genRand.Next(2) == 0) + { + num2 = num5; + num8 = -1; + } + } + else + { + if (flag2) + { + num2 = num5; + num8 = -1; + } + else + { + if (!flag) + { + return false; + } + num2 = num4; + num8 = 1; + } + } + if (Main.tile[num2, num3].type == 190) + { + return false; + } + if (Main.tile[x2, num].wall > 0) + { + WorldGen.PlaceTile(x2, num, 135, true, true, -1, 2); + } + else + { + WorldGen.PlaceTile(x2, num, 135, true, true, -1, WorldGen.genRand.Next(2, 4)); + } + WorldGen.KillTile(num2, num3, false, false, false); + WorldGen.PlaceTile(num2, num3, 137, true, true, -1, 0); + if (num8 == 1) + { + Tile expr_42F = Main.tile[num2, num3]; + expr_42F.frameX += 18; + } + int num9 = x2; + int num10 = num; + while (num9 != num2 || num10 != num3) + { + Main.tile[num9, num10].wire(true); + if (num9 > num2) + { + num9--; + } + if (num9 < num2) + { + num9++; + } + Main.tile[num9, num10].wire(true); + if (num10 > num3) + { + num10--; + } + if (num10 < num3) + { + num10++; + } + Main.tile[num9, num10].wire(true); + } + return true; + } + else + { + if (type != 1) + { + if (type == 2) + { + int num11 = Main.rand.Next(4, 7); + int num12 = x2 + Main.rand.Next(-1, 2); + int num13 = num; + for (int k = 0; k < num11; k++) + { + num13++; + if (!WorldGen.SolidTile(num12, num13)) + { + return false; + } + } + for (int l = num12 - 2; l <= num12 + 2; l++) + { + for (int m = num13 - 2; m <= num13 + 2; m++) + { + if (!WorldGen.SolidTile(l, m)) + { + return false; + } + } + } + WorldGen.KillTile(num12, num13, false, false, false); + Main.tile[num12, num13].active(true); + Main.tile[num12, num13].type = 141; + Main.tile[num12, num13].frameX = 0; + Main.tile[num12, num13].frameY = (short)(18 * Main.rand.Next(2)); + WorldGen.PlaceTile(x2, num, 135, true, true, -1, WorldGen.genRand.Next(2, 4)); + int num14 = x2; + int num15 = num; + while (num14 != num12 || num15 != num13) + { + Main.tile[num14, num15].wire(true); + if (num14 > num12) + { + num14--; + } + if (num14 < num12) + { + num14++; + } + Main.tile[num14, num15].wire(true); + if (num15 > num13) + { + num15--; + } + if (num15 < num13) + { + num15++; + } + Main.tile[num14, num15].wire(true); + } + } + return false; + } + int num16 = num - 8; + int num17 = x2 + WorldGen.genRand.Next(-1, 2); + bool flag3 = true; + while (flag3) + { + bool flag4 = true; + int num18 = 0; + for (int n = num17 - 2; n <= num17 + 3; n++) + { + for (int num19 = num16; num19 <= num16 + 3; num19++) + { + if (!WorldGen.SolidTile(n, num19)) + { + flag4 = false; + } + if (Main.tile[n, num19].active() && (Main.tile[n, num19].type == 0 || Main.tile[n, num19].type == 1 || Main.tile[n, num19].type == 59)) + { + num18++; + } + } + } + num16--; + if ((double)num16 < Main.worldSurface) + { + return false; + } + if (flag4 && num18 > 2) + { + flag3 = false; + } + } + if (num - num16 <= 5 || num - num16 >= 40) + { + return false; + } + for (int num20 = num17; num20 <= num17 + 1; num20++) + { + for (int num21 = num16; num21 <= num; num21++) + { + if (WorldGen.SolidTile(num20, num21)) + { + WorldGen.KillTile(num20, num21, false, false, false); + } + } + } + for (int num22 = num17 - 2; num22 <= num17 + 3; num22++) + { + for (int num23 = num16 - 2; num23 <= num16 + 3; num23++) + { + if (WorldGen.SolidTile(num22, num23)) + { + Main.tile[num22, num23].type = 1; + } + } + } + WorldGen.PlaceTile(x2, num, 135, true, true, -1, WorldGen.genRand.Next(2, 4)); + WorldGen.PlaceTile(num17, num16 + 2, 130, true, false, -1, 0); + WorldGen.PlaceTile(num17 + 1, num16 + 2, 130, true, false, -1, 0); + WorldGen.PlaceTile(num17 + 1, num16 + 1, 138, true, false, -1, 0); + num16 += 2; + Main.tile[num17, num16].wire(true); + Main.tile[num17 + 1, num16].wire(true); + num16++; + WorldGen.PlaceTile(num17, num16, 130, true, false, -1, 0); + WorldGen.PlaceTile(num17 + 1, num16, 130, true, false, -1, 0); + Main.tile[num17, num16].wire(true); + Main.tile[num17 + 1, num16].wire(true); + WorldGen.PlaceTile(num17, num16 + 1, 130, true, false, -1, 0); + WorldGen.PlaceTile(num17 + 1, num16 + 1, 130, true, false, -1, 0); + Main.tile[num17, num16 + 1].wire(true); + Main.tile[num17 + 1, num16 + 1].wire(true); + int num24 = x2; + int num25 = num; + while (num24 != num17 || num25 != num16) + { + Main.tile[num24, num25].wire(true); + if (num24 > num17) + { + num24--; + } + if (num24 < num17) + { + num24++; + } + Main.tile[num24, num25].wire(true); + if (num25 > num16) + { + num25--; + } + if (num25 < num16) + { + num25++; + } + Main.tile[num24, num25].wire(true); + } + return true; + } + } + public static int countTiles(int x, int y, bool jungle = false, bool lavaOk = false) + { + WorldGen.numTileCount = 0; + WorldGen.lavaCount = 0; + WorldGen.iceCount = 0; + WorldGen.rockCount = 0; + WorldGen.nextCount(x, y, jungle, lavaOk); + return WorldGen.numTileCount; + } + public static void nextCount(int x, int y, bool jungle = false, bool lavaOk = false) + { + if (WorldGen.numTileCount >= WorldGen.maxTileCount) + { + return; + } + if (x <= 1 || x >= Main.maxTilesX - 1 || y <= 1 || y >= Main.maxTilesY - 1) + { + WorldGen.numTileCount = WorldGen.maxTileCount; + return; + } + for (int i = 0; i < WorldGen.numTileCount; i++) + { + if (WorldGen.countX[i] == x && WorldGen.countY[i] == y) + { + return; + } + } + if (!jungle) + { + if (Main.tile[x, y].wall != 0) + { + WorldGen.numTileCount = WorldGen.maxTileCount; + return; + } + if (!lavaOk) + { + if (Main.tile[x, y].lava() && Main.tile[x, y].liquid > 0) + { + WorldGen.lavaCount++; + WorldGen.numTileCount = WorldGen.maxTileCount; + return; + } + } + else + { + if (Main.tile[x, y].lava() && Main.tile[x, y].liquid > 0) + { + WorldGen.lavaCount++; + } + } + } + if (Main.tile[x, y].active()) + { + if (Main.tile[x, y].type == 1) + { + WorldGen.rockCount++; + } + if (Main.tile[x, y].type == 147 || Main.tile[x, y].type == 161) + { + WorldGen.iceCount++; + } + } + if (!WorldGen.SolidTile(x, y)) + { + WorldGen.countX[WorldGen.numTileCount] = x; + WorldGen.countY[WorldGen.numTileCount] = y; + WorldGen.numTileCount++; + WorldGen.nextCount(x - 1, y, jungle, lavaOk); + WorldGen.nextCount(x + 1, y, jungle, lavaOk); + WorldGen.nextCount(x, y - 1, jungle, lavaOk); + WorldGen.nextCount(x, y + 1, jungle, lavaOk); + } + } + public static int countDirtTiles(int x, int y) + { + WorldGen.numTileCount = 0; + WorldGen.nextDirtCount(x, y); + return WorldGen.numTileCount; + } + public static void nextDirtCount(int x, int y) + { + if (WorldGen.numTileCount >= WorldGen.maxTileCount) + { + return; + } + if (x <= 1 || x >= Main.maxTilesX - 1 || y <= 1 || y >= Main.maxTilesY - 1) + { + WorldGen.numTileCount = WorldGen.maxTileCount; + return; + } + for (int i = 0; i < WorldGen.numTileCount; i++) + { + if (WorldGen.countX[i] == x && WorldGen.countY[i] == y) + { + return; + } + } + if (Main.tile[x, y].active() && (Main.tile[x, y].type == 147 || Main.tile[x, y].type == 161)) + { + WorldGen.numTileCount = WorldGen.maxTileCount; + return; + } + if (Main.tile[x, y].wall == 78) + { + WorldGen.numTileCount = 3500; + return; + } + if (!WorldGen.SolidTile(x, y) && (Main.tile[x, y].wall == 2 || Main.tile[x, y].wall == 59)) + { + WorldGen.countX[WorldGen.numTileCount] = x; + WorldGen.countY[WorldGen.numTileCount] = y; + WorldGen.numTileCount++; + WorldGen.nextDirtCount(x - 1, y); + WorldGen.nextDirtCount(x + 1, y); + WorldGen.nextDirtCount(x, y - 1); + WorldGen.nextDirtCount(x, y + 1); + WorldGen.nextDirtCount(x - 1, y - 1); + WorldGen.nextDirtCount(x - 1, y + 1); + WorldGen.nextDirtCount(x + 1, y - 1); + WorldGen.nextDirtCount(x + 1, y + 1); + WorldGen.nextDirtCount(x - 2, y); + WorldGen.nextDirtCount(x + 2, y); + } + } + public static void mossCave(int x, int y) + { + WorldGen.mossOut(x, y); + } + public static void mossOut(int x, int y) + { + if (!WorldGen.SolidTile(x, y) && Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = WorldGen.mossWall; + WorldGen.mossOut(x - 1, y); + WorldGen.mossOut(x + 1, y); + WorldGen.mossOut(x, y - 1); + WorldGen.mossOut(x, y + 1); + return; + } + if (Main.tile[x, y].active()) + { + if (Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = WorldGen.mossWall; + } + int type = (int)Main.tile[x, y].type; + if (type == 1) + { + Main.tile[x, y].type = WorldGen.mossTile; + } + } + } + public static void wallOut(int x, int y, int wall) + { + if (!WorldGen.SolidTile(x, y) && Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = (byte)wall; + WorldGen.wallOut(x - 1, y, wall); + WorldGen.wallOut(x + 1, y, wall); + WorldGen.wallOut(x, y - 1, wall); + WorldGen.wallOut(x, y + 1, wall); + return; + } + if (Main.tile[x, y].active() && Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = (byte)wall; + } + } + public static void wallOut2(int x, int y, int wall) + { + try + { + if (!WorldGen.SolidTile(x, y) && (int)Main.tile[x, y].wall != wall && Main.tile[x, y].wall != 4 && Main.tile[x, y].wall != 40 && Main.tile[x, y].wall != 3) + { + if (wall != 63 || Main.tile[x, y].wall != 0) + { + WorldGen.numWallOut2++; + if (WorldGen.numWallOut2 < WorldGen.maxWallOut2) + { + Main.tile[x, y].wall = (byte)wall; + WorldGen.wallOut2(x - 1, y, wall); + WorldGen.wallOut2(x + 1, y, wall); + WorldGen.wallOut2(x, y - 1, wall); + WorldGen.wallOut2(x, y + 1, wall); + if (wall == 63) + { + WorldGen.wallOut2(x - 1, y - 1, wall); + WorldGen.wallOut2(x - 1, y + 1, wall); + WorldGen.wallOut2(x + 1, y - 1, wall); + WorldGen.wallOut2(x + 1, y + 1, wall); + WorldGen.wallOut2(x - 2, y, wall); + WorldGen.wallOut2(x + 2, y, wall); + } + } + } + } + else + { + if (Main.tile[x, y].active() && (int)Main.tile[x, y].wall != wall && Main.tile[x, y].wall != 4 && Main.tile[x, y].wall != 40 && Main.tile[x, y].wall != 3) + { + Main.tile[x, y].wall = (byte)wall; + } + } + } + catch + { + } + } + public static void gemCave(int x, int y) + { + WorldGen.countTiles(x, y, false, false); + for (int i = 0; i < 6; i++) + { + WorldGen.gem[i] = false; + } + WorldGen.gem[WorldGen.genRand.Next(6)] = true; + for (int j = 0; j < 6; j++) + { + if (WorldGen.genRand.Next(6) == 0) + { + WorldGen.gem[j] = true; + } + } + WorldGen.gemOut(x, y); + } + public static int randGem() + { + int num = WorldGen.genRand.Next(6); + while (!WorldGen.gem[num]) + { + num = WorldGen.genRand.Next(6); + } + return num; + } + public static int randGemTile() + { + if (WorldGen.genRand.Next(20) != 0) + { + return 1; + } + int num = WorldGen.randGem(); + if (num == 0) + { + return 67; + } + if (num == 1) + { + return 66; + } + if (num == 2) + { + return 63; + } + if (num == 3) + { + return 65; + } + if (num == 4) + { + return 64; + } + return 68; + } + public static void gemOut(int x, int y) + { + if (!WorldGen.SolidTile(x, y) && Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = (byte)(48 + WorldGen.randGem()); + if (!Main.tile[x, y].active() && WorldGen.genRand.Next(2) == 0) + { + WorldGen.PlaceTile(x, y, 178, true, false, -1, WorldGen.randGem()); + } + WorldGen.gemOut(x - 1, y); + WorldGen.gemOut(x + 1, y); + WorldGen.gemOut(x, y - 1); + WorldGen.gemOut(x, y + 1); + return; + } + if (Main.tile[x, y].active()) + { + int type = (int)Main.tile[x, y].type; + if (type == 0 || type == 1 || type == 40 || type == 59 || type == 60 || type == 70 || type == 147 || type == 161) + { + Main.tile[x, y].type = (byte)WorldGen.randGemTile(); + } + for (int i = 0; i < 4; i++) + { + int num = x; + int num2 = y; + if (i == 0) + { + x--; + } + if (i == 1) + { + x++; + } + if (i == 2) + { + y--; + } + if (i == 3) + { + y++; + } + type = (int)Main.tile[num, num2].type; + if (type == 0 || type == 1 || type == 40 || type == 59 || type == 60 || type == 70 || type == 147 || type == 161) + { + Main.tile[num, num2].type = (byte)WorldGen.randGemTile(); + } + } + } + } + public static void spiderOut(int x, int y) + { + if (!WorldGen.SolidTile(x, y) && Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = 62; + WorldGen.SquareWallFrame(x, y, true); + if (!Main.tile[x, y].active()) + { + Main.tile[x, y].liquid = 0; + Main.tile[x, y].lava(false); + if (WorldGen.SolidTile(x, y + 1) && WorldGen.genRand.Next(3) == 0) + { + if (WorldGen.genRand.Next(15) == 0) + { + WorldGen.AddBuriedChest(x, y, 939, true, 15); + } + else + { + WorldGen.PlacePot(x, y, 28, WorldGen.genRand.Next(19, 21)); + } + } + if (!Main.tile[x, y].active()) + { + if (WorldGen.SolidTile(x, y - 1) && WorldGen.genRand.Next(3) == 0) + { + WorldGen.PlaceTight(x, y, 165, true); + } + else + { + if (WorldGen.SolidTile(x, y + 1)) + { + WorldGen.PlaceTile(x, y, 187, true, false, -1, 9 + WorldGen.genRand.Next(5)); + if (WorldGen.genRand.Next(3) == 0) + { + if (!Main.tile[x, y].active()) + { + WorldGen.PlaceSmallPile(x, y, 34 + WorldGen.genRand.Next(4), 1, 185); + } + if (!Main.tile[x, y].active()) + { + WorldGen.PlaceSmallPile(x, y, 48 + WorldGen.genRand.Next(6), 0, 185); + } + } + } + } + } + } + WorldGen.spiderOut(x - 1, y); + WorldGen.spiderOut(x + 1, y); + WorldGen.spiderOut(x, y - 1); + WorldGen.spiderOut(x, y + 1); + return; + } + if (Main.tile[x, y].active() && Main.tile[x, y].wall == 0) + { + Main.tile[x, y].wall = 62; + } + } + public static void randMoss() + { + WorldGen.mossType[0] = WorldGen.genRand.Next(5); + WorldGen.mossType[1] = WorldGen.genRand.Next(5); + while (WorldGen.mossType[1] == WorldGen.mossType[0]) + { + WorldGen.mossType[1] = WorldGen.genRand.Next(5); + } + WorldGen.mossType[2] = WorldGen.genRand.Next(5); + while (WorldGen.mossType[2] == WorldGen.mossType[0] || WorldGen.mossType[2] == WorldGen.mossType[1]) + { + WorldGen.mossType[2] = WorldGen.genRand.Next(5); + } + } + public static void setMoss(int x, int y) + { + int num; + if ((double)x < (double)Main.maxTilesX * 0.334) + { + num = 0; + } + else + { + if ((double)x < (double)Main.maxTilesX * 0.667) + { + num = 1; + } + else + { + num = 2; + } + } + WorldGen.mossWall = (byte)(54 + WorldGen.mossType[num]); + WorldGen.mossTile = (byte)(179 + WorldGen.mossType[num]); + } + public static void setCaveBacks() + { + int maxValue = 8; + if (Main.maxTilesX == 4200) + { + Main.caveBackX[0] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.5 - (double)((float)Main.maxTilesX * 0.25f)), (int)((double)Main.maxTilesX * 0.5 + (double)((float)Main.maxTilesX * 0.25f))); + Main.caveBackX[1] = Main.maxTilesX; + Main.caveBackX[2] = Main.maxTilesX; + Main.caveBackStyle[0] = WorldGen.genRand.Next(maxValue); + Main.caveBackStyle[1] = WorldGen.genRand.Next(maxValue); + while (Main.caveBackStyle[1] == Main.caveBackStyle[0]) + { + Main.caveBackStyle[1] = WorldGen.genRand.Next(maxValue); + } + } + else + { + if (Main.maxTilesX == 6400) + { + Main.caveBackX[0] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.334 - (double)((float)Main.maxTilesX * 0.2f)), (int)((double)Main.maxTilesX * 0.334 + (double)((float)Main.maxTilesX * 0.2f))); + Main.caveBackX[1] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.667 - (double)((float)Main.maxTilesX * 0.2f)), (int)((double)Main.maxTilesX * 0.667 + (double)((float)Main.maxTilesX * 0.2f))); + Main.caveBackX[2] = Main.maxTilesX; + Main.caveBackStyle[0] = WorldGen.genRand.Next(maxValue); + Main.caveBackStyle[1] = WorldGen.genRand.Next(maxValue); + Main.caveBackStyle[2] = WorldGen.genRand.Next(maxValue); + while (Main.caveBackStyle[1] == Main.caveBackStyle[0]) + { + Main.caveBackStyle[1] = WorldGen.genRand.Next(maxValue); + } + while (Main.caveBackStyle[2] == Main.caveBackStyle[0] || Main.caveBackStyle[2] == Main.caveBackStyle[1]) + { + Main.caveBackStyle[2] = WorldGen.genRand.Next(maxValue); + } + } + else + { + Main.caveBackX[0] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.25 - (double)((float)Main.maxTilesX * 0.15f)), (int)((double)Main.maxTilesX * 0.25 + (double)((float)Main.maxTilesX * 0.15f))); + Main.caveBackX[1] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.5 - (double)((float)Main.maxTilesX * 0.15f)), (int)((double)Main.maxTilesX * 0.5 + (double)((float)Main.maxTilesX * 0.15f))); + Main.caveBackX[2] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.75 - (double)((float)Main.maxTilesX * 0.15f)), (int)((double)Main.maxTilesX * 0.75 + (double)((float)Main.maxTilesX * 0.15f))); + Main.caveBackStyle[0] = WorldGen.genRand.Next(maxValue); + Main.caveBackStyle[1] = WorldGen.genRand.Next(maxValue); + Main.caveBackStyle[2] = WorldGen.genRand.Next(maxValue); + Main.caveBackStyle[3] = WorldGen.genRand.Next(maxValue); + while (Main.caveBackStyle[1] == Main.caveBackStyle[0]) + { + Main.caveBackStyle[1] = WorldGen.genRand.Next(maxValue); + } + while (Main.caveBackStyle[2] == Main.caveBackStyle[0] || Main.caveBackStyle[2] == Main.caveBackStyle[1]) + { + Main.caveBackStyle[2] = WorldGen.genRand.Next(maxValue); + } + while (Main.caveBackStyle[3] == Main.caveBackStyle[0] || Main.caveBackStyle[3] == Main.caveBackStyle[1] || Main.caveBackStyle[3] == Main.caveBackStyle[2]) + { + Main.caveBackStyle[3] = WorldGen.genRand.Next(maxValue); + } + } + } + Main.iceBackStyle = WorldGen.genRand.Next(4); + Main.hellBackStyle = WorldGen.genRand.Next(3); + Main.jungleBackStyle = WorldGen.genRand.Next(2); + } + public static void randomBackgrounds() + { + WorldGen.treeBG = WorldGen.genRand.Next(9); + if ((WorldGen.treeBG == 1 || WorldGen.treeBG == 2) && WorldGen.genRand.Next(2) == 0) + { + WorldGen.treeBG = WorldGen.genRand.Next(7); + } + if (WorldGen.treeBG == 0) + { + WorldGen.treeBG = WorldGen.genRand.Next(7); + } + if (WorldGen.treeBG == 3 && WorldGen.genRand.Next(3) == 0) + { + WorldGen.treeBG = 31; + } + if (WorldGen.treeBG == 5 && WorldGen.genRand.Next(2) == 0) + { + WorldGen.treeBG = 51; + } + if (WorldGen.treeBG == 7 && WorldGen.genRand.Next(4) == 0) + { + WorldGen.treeBG = WorldGen.genRand.Next(71, 74); + } + WorldGen.setBG(0, WorldGen.treeBG); + WorldGen.setBG(1, WorldGen.genRand.Next(2)); + WorldGen.setBG(2, WorldGen.genRand.Next(2)); + WorldGen.snowBG = WorldGen.genRand.Next(6); + if (WorldGen.snowBG == 2 && WorldGen.genRand.Next(2) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.snowBG = 21; + } + else + { + WorldGen.snowBG = 22; + } + } + if (WorldGen.snowBG == 3 && WorldGen.genRand.Next(2) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.snowBG = 31; + } + else + { + WorldGen.snowBG = 32; + } + } + if (WorldGen.snowBG == 4 && WorldGen.genRand.Next(2) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.snowBG = 41; + } + else + { + WorldGen.snowBG = 42; + } + } + WorldGen.setBG(3, WorldGen.snowBG); + WorldGen.setBG(4, WorldGen.genRand.Next(2)); + WorldGen.setBG(5, WorldGen.genRand.Next(3)); + WorldGen.setBG(6, WorldGen.genRand.Next(2)); + WorldGen.setBG(7, WorldGen.genRand.Next(3)); + } + public static void generateWorld(int seed = -1) + { + if (seed > 0) + { + WorldGen.genRand = new Random(seed); + } + else + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + WorldGen.randMoon(); + WorldGen.RandomWeather(); + Main.cloudAlpha = 0f; + Main.maxRaining = 0f; + WorldGen.tempMaxRain = 0f; + Main.raining = false; + WorldGen.crimson = false; + WorldGen.heartCount = 0; + Main.checkXMas(); + NPC.clrNames(); + NPC.setNames(); + WorldGen.gen = true; + WorldGen.resetGen(); + WorldGen.worldSurfaceLow = 0.0; + int type = 7; + int type2 = 6; + int type3 = 9; + int type4 = 8; + Main.cloudBGActive = (float)(-(float)WorldGen.genRand.Next(8640, 86400)); + WorldGen.copperBar = 20; + WorldGen.ironBar = 22; + WorldGen.silverBar = 21; + WorldGen.goldBar = 19; + if (WorldGen.genRand.Next(2) == 0) + { + type = 166; + WorldGen.copperBar = 703; + } + if (WorldGen.genRand.Next(2) == 0) + { + type2 = 167; + WorldGen.ironBar = 704; + } + if (WorldGen.genRand.Next(2) == 0) + { + type3 = 168; + WorldGen.silverBar = 705; + } + if (WorldGen.genRand.Next(2) == 0) + { + type4 = 169; + WorldGen.goldBar = 706; + } + WorldGen.randomBackgrounds(); + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.crimson = true; + } + int num = WorldGen.genRand.Next(5); + if (num == 0) + { + num = 119; + } + else + { + if (num == 1) + { + num = 120; + } + else + { + if (num == 2) + { + num = 158; + } + else + { + if (num == 3) + { + num = 175; + } + else + { + if (num == 4) + { + num = 45; + } + } + } + } + } + Main.worldID = WorldGen.genRand.Next(2147483647); + int num2 = 0; + int num3 = 0; + double num4 = (double)Main.maxTilesY * 0.3; + num4 *= (double)WorldGen.genRand.Next(90, 110) * 0.005; + double num5 = num4 + (double)Main.maxTilesY * 0.2; + num5 *= (double)WorldGen.genRand.Next(90, 110) * 0.01; + if (Main.maxTilesX == 4200) + { + Main.treeX[0] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.5 - (double)((float)Main.maxTilesX * 0.25f)), (int)((double)Main.maxTilesX * 0.5 + (double)((float)Main.maxTilesX * 0.25f))); + Main.treeStyle[0] = WorldGen.genRand.Next(6); + Main.treeStyle[1] = WorldGen.genRand.Next(6); + while (Main.treeStyle[1] == Main.treeStyle[0]) + { + Main.treeStyle[1] = WorldGen.genRand.Next(6); + } + Main.treeX[1] = Main.maxTilesX; + Main.treeX[2] = Main.maxTilesX; + } + else + { + if (Main.maxTilesX == 6400) + { + Main.treeX[0] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.334 - (double)((float)Main.maxTilesX * 0.2f)), (int)((double)Main.maxTilesX * 0.334 + (double)((float)Main.maxTilesX * 0.2f))); + Main.treeX[1] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.667 - (double)((float)Main.maxTilesX * 0.2f)), (int)((double)Main.maxTilesX * 0.667 + (double)((float)Main.maxTilesX * 0.2f))); + Main.treeStyle[0] = WorldGen.genRand.Next(6); + Main.treeStyle[1] = WorldGen.genRand.Next(6); + Main.treeStyle[2] = WorldGen.genRand.Next(6); + while (Main.treeStyle[1] == Main.treeStyle[0]) + { + Main.treeStyle[1] = WorldGen.genRand.Next(6); + } + while (Main.treeStyle[2] == Main.treeStyle[0] || Main.treeStyle[2] == Main.treeStyle[1]) + { + Main.treeStyle[2] = WorldGen.genRand.Next(6); + } + Main.treeX[2] = Main.maxTilesX; + } + else + { + Main.treeX[0] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.25 - (double)((float)Main.maxTilesX * 0.15f)), (int)((double)Main.maxTilesX * 0.25 + (double)((float)Main.maxTilesX * 0.15f))); + Main.treeX[1] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.5 - (double)((float)Main.maxTilesX * 0.15f)), (int)((double)Main.maxTilesX * 0.5 + (double)((float)Main.maxTilesX * 0.15f))); + Main.treeX[2] = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.75 - (double)((float)Main.maxTilesX * 0.15f)), (int)((double)Main.maxTilesX * 0.75 + (double)((float)Main.maxTilesX * 0.15f))); + Main.treeStyle[0] = WorldGen.genRand.Next(6); + Main.treeStyle[1] = WorldGen.genRand.Next(6); + Main.treeStyle[2] = WorldGen.genRand.Next(6); + Main.treeStyle[3] = WorldGen.genRand.Next(6); + while (Main.treeStyle[1] == Main.treeStyle[0]) + { + Main.treeStyle[1] = WorldGen.genRand.Next(6); + } + while (Main.treeStyle[2] == Main.treeStyle[0] || Main.treeStyle[2] == Main.treeStyle[1]) + { + Main.treeStyle[2] = WorldGen.genRand.Next(6); + } + while (Main.treeStyle[3] == Main.treeStyle[0] || Main.treeStyle[3] == Main.treeStyle[1] || Main.treeStyle[3] == Main.treeStyle[2]) + { + Main.treeStyle[3] = WorldGen.genRand.Next(6); + } + } + } + WorldGen.setCaveBacks(); + WorldGen.worldSurfaceLow = num4; + double num6 = num4; + double num7 = num5; + double num8 = num5; + int num9 = 0; + if (WorldGen.genRand.Next(2) == 0) + { + num9 = -1; + } + else + { + num9 = 1; + } + for (int i = 0; i < Main.maxTilesX; i++) + { + float num10 = (float)i / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[0], + " ", + (int)(num10 * 100f + 1f), + "%" + }); + if (num4 < WorldGen.worldSurfaceLow) + { + WorldGen.worldSurfaceLow = num4; + } + if (num4 > num6) + { + num6 = num4; + } + if (num5 < num7) + { + num7 = num5; + } + if (num5 > num8) + { + num8 = num5; + } + if (num3 <= 0) + { + num2 = WorldGen.genRand.Next(0, 5); + num3 = WorldGen.genRand.Next(5, 40); + if (num2 == 0) + { + num3 *= (int)((double)WorldGen.genRand.Next(5, 30) * 0.2); + } + } + num3--; + if (num2 == 0) + { + while (WorldGen.genRand.Next(0, 7) == 0) + { + num4 += (double)WorldGen.genRand.Next(-1, 2); + } + } + else + { + if (num2 == 1) + { + while (WorldGen.genRand.Next(0, 4) == 0) + { + num4 -= 1.0; + } + while (WorldGen.genRand.Next(0, 10) == 0) + { + num4 += 1.0; + } + } + else + { + if (num2 == 2) + { + while (WorldGen.genRand.Next(0, 4) == 0) + { + num4 += 1.0; + } + while (WorldGen.genRand.Next(0, 10) == 0) + { + num4 -= 1.0; + } + } + else + { + if (num2 == 3) + { + while (WorldGen.genRand.Next(0, 2) == 0) + { + num4 -= 1.0; + } + while (WorldGen.genRand.Next(0, 6) == 0) + { + num4 += 1.0; + } + } + else + { + if (num2 == 4) + { + while (WorldGen.genRand.Next(0, 2) == 0) + { + num4 += 1.0; + } + while (WorldGen.genRand.Next(0, 5) == 0) + { + num4 -= 1.0; + } + } + } + } + } + } + if (num4 < (double)Main.maxTilesY * 0.17) + { + num4 = (double)Main.maxTilesY * 0.17; + num3 = 0; + } + else + { + if (num4 > (double)Main.maxTilesY * 0.3) + { + num4 = (double)Main.maxTilesY * 0.3; + num3 = 0; + } + } + if ((i < 275 || i > Main.maxTilesX - 275) && num4 > (double)Main.maxTilesY * 0.25) + { + num4 = (double)Main.maxTilesY * 0.25; + num3 = 1; + } + while (WorldGen.genRand.Next(0, 3) == 0) + { + num5 += (double)WorldGen.genRand.Next(-2, 3); + } + if (num5 < num4 + (double)Main.maxTilesY * 0.05) + { + num5 += 1.0; + } + if (num5 > num4 + (double)Main.maxTilesY * 0.35) + { + num5 -= 1.0; + } + int num11 = 0; + while ((double)num11 < num4) + { + Main.tile[i, num11].active(false); + Main.tile[i, num11].frameX = -1; + Main.tile[i, num11].frameY = -1; + num11++; + } + for (int j = (int)num4; j < Main.maxTilesY; j++) + { + if ((double)j < num5) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = 0; + Main.tile[i, j].frameX = -1; + Main.tile[i, j].frameY = -1; + } + else + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = 1; + Main.tile[i, j].frameX = -1; + Main.tile[i, j].frameY = -1; + } + } + } + Main.worldSurface = num6 + 25.0; + Main.rockLayer = num8; + double num12 = (double)((int)((Main.rockLayer - Main.worldSurface) / 6.0) * 6); + Main.rockLayer = Main.worldSurface + num12; + WorldGen.waterLine = (int)(Main.rockLayer + (double)Main.maxTilesY) / 2; + WorldGen.waterLine += WorldGen.genRand.Next(-100, 20); + WorldGen.lavaLine = WorldGen.waterLine + WorldGen.genRand.Next(50, 80); + int num13 = 0; + for (int k = 0; k < (int)((double)Main.maxTilesX * 0.0015); k++) + { + int[] array = new int[10]; + int[] array2 = new int[10]; + int num14 = WorldGen.genRand.Next(450, Main.maxTilesX - 450); + int num15 = 0; + for (int l = 0; l < 10; l++) + { + while (!Main.tile[num14, num15].active()) + { + num15++; + } + array[l] = num14; + array2[l] = num15 - WorldGen.genRand.Next(11, 16); + num14 += WorldGen.genRand.Next(5, 11); + } + for (int m = 0; m < 10; m++) + { + WorldGen.TileRunner(array[m], array2[m], (double)WorldGen.genRand.Next(5, 8), WorldGen.genRand.Next(6, 9), 0, true, -2f, -0.3f, false, true); + WorldGen.TileRunner(array[m], array2[m], (double)WorldGen.genRand.Next(5, 8), WorldGen.genRand.Next(6, 9), 0, true, 2f, -0.3f, false, true); + } + } + Main.statusText = Lang.gen[1]; + int num16 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.0008), (int)((double)Main.maxTilesX * 0.0025)); + num16 += 2; + int[] array3 = new int[num16]; + int[] array4 = new int[num16]; + int num17 = 0; + for (int n = 0; n < num16; n++) + { + int num18 = WorldGen.genRand.Next(Main.maxTilesX); + while ((float)num18 > (float)Main.maxTilesX * 0.4f && (float)num18 < (float)Main.maxTilesX * 0.6f) + { + num18 = WorldGen.genRand.Next(Main.maxTilesX); + } + int num19 = WorldGen.genRand.Next(35, 90); + if (n == 1) + { + float num20 = (float)(Main.maxTilesX / 4200); + num19 += (int)((float)WorldGen.genRand.Next(20, 40) * num20); + } + if (WorldGen.genRand.Next(3) == 0) + { + num19 *= 2; + } + if (n == 1) + { + num19 *= 2; + } + int num21 = num18 - num19; + num19 = WorldGen.genRand.Next(35, 90); + if (WorldGen.genRand.Next(3) == 0) + { + num19 *= 2; + } + if (n == 1) + { + num19 *= 2; + } + int num22 = num18 + num19; + if (num21 < 0) + { + num21 = 0; + } + if (num22 > Main.maxTilesX) + { + num22 = Main.maxTilesX; + } + if (n == 0) + { + num21 = 0; + num22 = WorldGen.genRand.Next(260, 300); + if (num9 == 1) + { + num22 += 40; + } + } + else + { + if (n == 2) + { + num21 = Main.maxTilesX - WorldGen.genRand.Next(260, 300); + num22 = Main.maxTilesX; + if (num9 == -1) + { + num21 -= 40; + } + } + } + int num23 = WorldGen.genRand.Next(50, 100); + for (int num24 = num21; num24 < num22; num24++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num23 += WorldGen.genRand.Next(-1, 2); + if (num23 < 50) + { + num23 = 50; + } + if (num23 > 100) + { + num23 = 100; + } + } + int num25 = 0; + while ((double)num25 < Main.worldSurface) + { + if (Main.tile[num24, num25].active()) + { + if (num24 == (num21 + num22) / 2 && WorldGen.genRand.Next(7) == 0) + { + array3[num17] = num24; + array4[num17] = num25; + num17++; + } + int num26 = num23; + if (num24 - num21 < num26) + { + num26 = num24 - num21; + } + if (num22 - num24 < num26) + { + num26 = num22 - num24; + } + num26 += WorldGen.genRand.Next(5); + for (int num27 = num25; num27 < num25 + num26; num27++) + { + if (num24 > num21 + WorldGen.genRand.Next(5) && num24 < num22 - WorldGen.genRand.Next(5)) + { + Main.tile[num24, num27].type = 53; + } + } + break; + } + num25++; + } + } + } + for (int num28 = 0; num28 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 8E-06); num28++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)Main.worldSurface, (int)Main.rockLayer), (double)WorldGen.genRand.Next(15, 70), WorldGen.genRand.Next(20, 130), 53, false, 0f, 0f, false, true); + } + WorldGen.numMCaves = 0; + Main.statusText = Lang.gen[2]; + for (int num29 = 0; num29 < (int)((double)Main.maxTilesX * 0.0008); num29++) + { + int num30 = 0; + bool flag = false; + bool flag2 = false; + int num31 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.25), (int)((double)Main.maxTilesX * 0.75)); + while (!flag2) + { + flag2 = true; + while (num31 > Main.maxTilesX / 2 - 100 && num31 < Main.maxTilesX / 2 + 100) + { + num31 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.25), (int)((double)Main.maxTilesX * 0.75)); + } + for (int num32 = 0; num32 < WorldGen.numMCaves; num32++) + { + if (num31 > WorldGen.mCaveX[num32] - 50 && num31 < WorldGen.mCaveX[num32] + 50) + { + num30++; + flag2 = false; + break; + } + } + if (num30 >= 200) + { + flag = true; + break; + } + } + if (!flag) + { + int num33 = 0; + while ((double)num33 < Main.worldSurface) + { + if (Main.tile[num31, num33].active()) + { + for (int num34 = num31 - 50; num34 < num31 + 50; num34++) + { + for (int num35 = num33 - 25; num35 < num33 + 25; num35++) + { + if (Main.tile[num34, num35].active() && (Main.tile[num34, num35].type == 53 || Main.tile[num34, num35].type == 151)) + { + flag = true; + } + } + } + if (!flag) + { + WorldGen.Mountinater(num31, num33); + WorldGen.mCaveX[WorldGen.numMCaves] = num31; + WorldGen.mCaveY[WorldGen.numMCaves] = num33; + WorldGen.numMCaves++; + break; + } + } + num33++; + } + } + } + for (int num36 = 1; num36 < Main.maxTilesX - 1; num36++) + { + byte wall = 2; + float num37 = (float)num36 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[3], + " ", + (int)(num37 * 100f + 1f), + "%" + }); + bool flag3 = false; + num13 += WorldGen.genRand.Next(-1, 2); + if (num13 < 0) + { + num13 = 0; + } + if (num13 > 10) + { + num13 = 10; + } + int num38 = 0; + while ((double)num38 < Main.worldSurface + 10.0 && (double)num38 <= Main.worldSurface + (double)num13) + { + if (Main.tile[num36, num38].active()) + { + if (Main.tile[num36, num38].type == 147) + { + wall = 40; + } + else + { + wall = 2; + } + } + if (flag3 && Main.tile[num36, num38].wall != 64) + { + Main.tile[num36, num38].wall = wall; + } + if (Main.tile[num36, num38].active() && Main.tile[num36 - 1, num38].active() && Main.tile[num36 + 1, num38].active() && Main.tile[num36, num38 + 1].active() && Main.tile[num36 - 1, num38 + 1].active() && Main.tile[num36 + 1, num38 + 1].active()) + { + flag3 = true; + } + num38++; + } + } + Main.statusText = Lang.gen[4]; + for (int num39 = 0; num39 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0002); num39++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int)WorldGen.worldSurfaceLow + 1), (double)WorldGen.genRand.Next(4, 15), WorldGen.genRand.Next(5, 40), 1, false, 0f, 0f, false, true); + } + for (int num40 = 0; num40 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0002); num40++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)num6 + 1), (double)WorldGen.genRand.Next(4, 10), WorldGen.genRand.Next(5, 30), 1, false, 0f, 0f, false, true); + } + for (int num41 = 0; num41 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0045); num41++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, (int)num8 + 1), (double)WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(2, 23), 1, false, 0f, 0f, false, true); + } + Main.statusText = Lang.gen[5]; + for (int num42 = 0; num42 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.005); num42++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(2, 40), 0, false, 0f, 0f, false, true); + } + Main.statusText = Lang.gen[6]; + for (int num43 = 0; num43 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05); num43++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int)WorldGen.worldSurfaceLow), (double)WorldGen.genRand.Next(4, 14), WorldGen.genRand.Next(10, 50), 40, false, 0f, 0f, false, true); + } + for (int num44 = 0; num44 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 5E-05); num44++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)num6 + 1), (double)WorldGen.genRand.Next(8, 14), WorldGen.genRand.Next(15, 45), 40, false, 0f, 0f, false, true); + } + for (int num45 = 0; num45 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05); num45++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, (int)num8 + 1), (double)WorldGen.genRand.Next(8, 15), WorldGen.genRand.Next(5, 50), 40, false, 0f, 0f, false, true); + } + for (int num46 = 5; num46 < Main.maxTilesX - 5; num46++) + { + int num47 = 1; + while ((double)num47 < Main.worldSurface - 1.0) + { + if (Main.tile[num46, num47].active()) + { + for (int num48 = num47; num48 < num47 + 5; num48++) + { + if (Main.tile[num46, num48].type == 40) + { + Main.tile[num46, num48].type = 0; + } + } + break; + } + num47++; + } + } + int num49 = 0; + for (int num50 = 0; num50 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0015); num50++) + { + float num51 = (float)((double)num50 / ((double)(Main.maxTilesX * Main.maxTilesY) * 0.0015)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[7], + " ", + (int)(num51 * 100f + 1f), + "%" + }); + int type5 = -1; + if (WorldGen.genRand.Next(5) == 0) + { + type5 = -2; + } + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 5), WorldGen.genRand.Next(2, 20), type5, false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, Main.maxTilesY), (double)WorldGen.genRand.Next(8, 15), WorldGen.genRand.Next(7, 30), type5, false, 0f, 0f, false, true); + } + for (int num52 = 0; num52 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 3E-05); num52++) + { + float num53 = (float)((double)num52 / ((double)(Main.maxTilesX * Main.maxTilesY) * 3E-05)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[8], + " ", + (int)(num53 * 100f + 1f), + "%" + }); + if (num8 <= (double)Main.maxTilesY) + { + int type6 = -1; + if (WorldGen.genRand.Next(6) == 0) + { + type6 = -2; + } + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)num8 + 1), (double)WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(30, 200), type6, false, 0f, 0f, false, true); + } + } + for (int num54 = 0; num54 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.00013); num54++) + { + float num55 = (float)((double)num54 / ((double)(Main.maxTilesX * Main.maxTilesY) * 0.00013)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[9], + " ", + (int)(num55 * 100f + 1f), + "%" + }); + if (num8 <= (double)Main.maxTilesY) + { + int type7 = -1; + if (WorldGen.genRand.Next(10) == 0) + { + type7 = -2; + } + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num8, Main.maxTilesY), (double)WorldGen.genRand.Next(6, 20), WorldGen.genRand.Next(50, 300), type7, false, 0f, 0f, false, true); + } + } + Main.statusText = Lang.gen[10]; + for (int num56 = 0; num56 < (int)((double)Main.maxTilesX * 0.0025); num56++) + { + num49 = WorldGen.genRand.Next(0, Main.maxTilesX); + int num57 = 0; + while ((double)num57 < num6) + { + if (Main.tile[num49, num57].active()) + { + WorldGen.TileRunner(num49, num57, (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(5, 50), -1, false, (float)WorldGen.genRand.Next(-10, 11) * 0.1f, 1f, false, true); + break; + } + num57++; + } + } + for (int num58 = 0; num58 < (int)((double)Main.maxTilesX * 0.0007); num58++) + { + num49 = WorldGen.genRand.Next(0, Main.maxTilesX); + int num59 = 0; + while ((double)num59 < num6) + { + if (Main.tile[num49, num59].active()) + { + WorldGen.TileRunner(num49, num59, (double)WorldGen.genRand.Next(10, 15), WorldGen.genRand.Next(50, 130), -1, false, (float)WorldGen.genRand.Next(-10, 11) * 0.1f, 2f, false, true); + break; + } + num59++; + } + } + for (int num60 = 0; num60 < (int)((double)Main.maxTilesX * 0.0003); num60++) + { + num49 = WorldGen.genRand.Next(0, Main.maxTilesX); + int num61 = 0; + while ((double)num61 < num6) + { + if (Main.tile[num49, num61].active()) + { + WorldGen.TileRunner(num49, num61, (double)WorldGen.genRand.Next(12, 25), WorldGen.genRand.Next(150, 500), -1, false, (float)WorldGen.genRand.Next(-10, 11) * 0.1f, 4f, false, true); + WorldGen.TileRunner(num49, num61, (double)WorldGen.genRand.Next(8, 17), WorldGen.genRand.Next(60, 200), -1, false, (float)WorldGen.genRand.Next(-10, 11) * 0.1f, 2f, false, true); + WorldGen.TileRunner(num49, num61, (double)WorldGen.genRand.Next(5, 13), WorldGen.genRand.Next(40, 170), -1, false, (float)WorldGen.genRand.Next(-10, 11) * 0.1f, 2f, false, true); + break; + } + num61++; + } + } + for (int num62 = 0; num62 < (int)((double)Main.maxTilesX * 0.0004); num62++) + { + num49 = WorldGen.genRand.Next(0, Main.maxTilesX); + int num63 = 0; + while ((double)num63 < num6) + { + if (Main.tile[num49, num63].active()) + { + WorldGen.TileRunner(num49, num63, (double)WorldGen.genRand.Next(7, 12), WorldGen.genRand.Next(150, 250), -1, false, 0f, 1f, true, true); + break; + } + num63++; + } + } + float num64 = (float)(Main.maxTilesX / 4200); + int num65 = 0; + while ((float)num65 < 5f * num64) + { + try + { + WorldGen.Caverer(WorldGen.genRand.Next(100, Main.maxTilesX - 100), WorldGen.genRand.Next((int)Main.rockLayer, Main.maxTilesY - 400)); + } + catch + { + } + num65++; + } + int[] array5 = new int[Main.maxTilesY]; + int[] array6 = new int[Main.maxTilesY]; + int num66 = (int)Main.worldSurface; + int num67 = 0; + Main.statusText = Lang.gen[56]; + int num68 = WorldGen.genRand.Next(Main.maxTilesX); + if (num9 == 1) + { + while ((float)num68 < (float)Main.maxTilesX * 0.55f || (float)num68 > (float)Main.maxTilesX * 0.7f) + { + num68 = WorldGen.genRand.Next(Main.maxTilesX); + } + } + else + { + while ((float)num68 < (float)Main.maxTilesX * 0.3f || (float)num68 > (float)Main.maxTilesX * 0.45f) + { + num68 = WorldGen.genRand.Next(Main.maxTilesX); + } + } + int num69 = WorldGen.genRand.Next(50, 90); + float num70 = (float)(Main.maxTilesX / 4200); + num69 += (int)((float)WorldGen.genRand.Next(20, 40) * num70); + num69 += (int)((float)WorldGen.genRand.Next(20, 40) * num70); + int num71 = num68 - num69; + num69 = WorldGen.genRand.Next(50, 90); + num69 += (int)((float)WorldGen.genRand.Next(20, 40) * num70); + num69 += (int)((float)WorldGen.genRand.Next(20, 40) * num70); + int num72 = num68 + num69; + if (num71 < 0) + { + num71 = 0; + } + if (num72 > Main.maxTilesX) + { + num72 = Main.maxTilesX; + } + int num73 = WorldGen.lavaLine - 60; + for (int num74 = 0; num74 < WorldGen.lavaLine - 100; num74++) + { + num71 += WorldGen.genRand.Next(-4, 4); + num72 += WorldGen.genRand.Next(-3, 5); + array5[num74] = num71; + array6[num74] = num72; + for (int num75 = num71; num75 < num72; num75++) + { + if (num74 < num73) + { + num73 += WorldGen.genRand.Next(-2, 3); + if (num73 < WorldGen.lavaLine - 140) + { + num73 = WorldGen.lavaLine - 140; + } + if (num73 > WorldGen.lavaLine - 100) + { + num73 = WorldGen.lavaLine - 100; + } + if (Main.tile[num75, num74].wall == 2) + { + Main.tile[num75, num74].wall = 40; + } + int type8 = (int)Main.tile[num75, num74].type; + if (type8 == 0 || type8 == 2 || type8 == 23 || type8 == 40 || type8 == 53) + { + Main.tile[num75, num74].type = 147; + } + else + { + if (type8 == 1) + { + Main.tile[num75, num74].type = 161; + } + } + } + else + { + num73 += WorldGen.genRand.Next(1, 3); + } + } + if (num67 < num73) + { + num67 = num73; + } + } + for (int num76 = 0; num76 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.002); num76++) + { + int num77 = WorldGen.genRand.Next(1, Main.maxTilesX - 1); + int num78 = WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)num6); + if (num78 >= Main.maxTilesY) + { + num78 = Main.maxTilesY - 2; + } + if (Main.tile[num77 - 1, num78].active() && Main.tile[num77 - 1, num78].type == 0 && Main.tile[num77 + 1, num78].active() && Main.tile[num77 + 1, num78].type == 0 && Main.tile[num77, num78 - 1].active() && Main.tile[num77, num78 - 1].type == 0 && Main.tile[num77, num78 + 1].active() && Main.tile[num77, num78 + 1].type == 0) + { + Main.tile[num77, num78].active(true); + Main.tile[num77, num78].type = 2; + } + num77 = WorldGen.genRand.Next(1, Main.maxTilesX - 1); + num78 = WorldGen.genRand.Next(0, (int)WorldGen.worldSurfaceLow); + if (num78 >= Main.maxTilesY) + { + num78 = Main.maxTilesY - 2; + } + if (Main.tile[num77 - 1, num78].active() && Main.tile[num77 - 1, num78].type == 0 && Main.tile[num77 + 1, num78].active() && Main.tile[num77 + 1, num78].type == 0 && Main.tile[num77, num78 - 1].active() && Main.tile[num77, num78 - 1].type == 0 && Main.tile[num77, num78 + 1].active() && Main.tile[num77, num78 + 1].type == 0) + { + Main.tile[num77, num78].active(true); + Main.tile[num77, num78].type = 2; + } + } + Main.statusText = Lang.gen[11] + " 0%"; + float num79 = (float)(Main.maxTilesX / 4200); + num79 *= 1.5f; + float num80 = (float)WorldGen.genRand.Next(15, 30) * 0.01f; + int num81; + if (num9 == -1) + { + num80 = 1f - num80; + num81 = (int)((float)Main.maxTilesX * num80); + } + else + { + num81 = (int)((float)Main.maxTilesX * num80); + } + int num82 = (int)((double)Main.maxTilesY + Main.rockLayer) / 2; + num81 += WorldGen.genRand.Next((int)(-100f * num79), (int)(101f * num79)); + num82 += WorldGen.genRand.Next((int)(-100f * num79), (int)(101f * num79)); + int num83 = num81; + int num84 = num82; + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next((int)(250f * num79), (int)(500f * num79)), WorldGen.genRand.Next(50, 150), 59, false, (float)(num9 * 3), 0f, false, true); + int num85 = 0; + while ((float)num85 < 6f * num79) + { + WorldGen.TileRunner(num81 + WorldGen.genRand.Next(-(int)(125f * num79), (int)(125f * num79)), num82 + WorldGen.genRand.Next(-(int)(125f * num79), (int)(125f * num79)), (double)WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(63, 65), false, 0f, 0f, false, true); + num85++; + } + WorldGen.mudWall = true; + Main.statusText = Lang.gen[11] + " 15%"; + num81 += WorldGen.genRand.Next((int)(-250f * num79), (int)(251f * num79)); + num82 += WorldGen.genRand.Next((int)(-150f * num79), (int)(151f * num79)); + int num86 = num81; + int num87 = num82; + int num88 = num81; + int num89 = num82; + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next((int)(250f * num79), (int)(500f * num79)), WorldGen.genRand.Next(50, 150), 59, false, 0f, 0f, false, true); + WorldGen.mudWall = false; + int num90 = 0; + while ((float)num90 < 6f * num79) + { + WorldGen.TileRunner(num81 + WorldGen.genRand.Next(-(int)(125f * num79), (int)(125f * num79)), num82 + WorldGen.genRand.Next(-(int)(125f * num79), (int)(125f * num79)), (double)WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(65, 67), false, 0f, 0f, false, true); + num90++; + } + WorldGen.mudWall = true; + Main.statusText = Lang.gen[11] + " 30%"; + num81 += WorldGen.genRand.Next((int)(-400f * num79), (int)(401f * num79)); + num82 += WorldGen.genRand.Next((int)(-150f * num79), (int)(151f * num79)); + int num91 = num81; + int num92 = num82; + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next((int)(250f * num79), (int)(500f * num79)), WorldGen.genRand.Next(50, 150), 59, false, (float)(num9 * -3), 0f, false, true); + WorldGen.mudWall = false; + int num93 = 0; + while ((float)num93 < 6f * num79) + { + WorldGen.TileRunner(num81 + WorldGen.genRand.Next(-(int)(125f * num79), (int)(125f * num79)), num82 + WorldGen.genRand.Next(-(int)(125f * num79), (int)(125f * num79)), (double)WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(67, 69), false, 0f, 0f, false, true); + num93++; + } + WorldGen.mudWall = true; + Main.statusText = Lang.gen[11] + " 45%"; + num81 = (num83 + num86 + num91) / 3; + num82 = (num84 + num87 + num92) / 3; + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next((int)(400f * num79), (int)(600f * num79)), 10000, 59, false, 0f, -20f, true, true); + WorldGen.JungleRunner(num81, num82); + Main.statusText = Lang.gen[11] + " 60%"; + WorldGen.mudWall = false; + for (int num94 = 0; num94 < Main.maxTilesX / 4; num94++) + { + num81 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + num82 = WorldGen.genRand.Next((int)num4 + 10, Main.maxTilesY - 200); + while (Main.tile[num81, num82].wall != 64 && Main.tile[num81, num82].wall != 15) + { + num81 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + num82 = WorldGen.genRand.Next((int)num4 + 10, Main.maxTilesY - 200); + } + WorldGen.MudWallRunner(num81, num82); + } + num81 = num88; + num82 = num89; + int num95 = 0; + while ((float)num95 <= 20f * num79) + { + Main.statusText = string.Concat(new object[] + { + Lang.gen[11], + " ", + (int)(60f + (float)num95 / num79), + "%" + }); + num81 += WorldGen.genRand.Next((int)(-5f * num79), (int)(6f * num79)); + num82 += WorldGen.genRand.Next((int)(-5f * num79), (int)(6f * num79)); + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next(40, 100), WorldGen.genRand.Next(300, 500), 59, false, 0f, 0f, false, true); + num95++; + } + int num96 = 0; + while ((float)num96 <= 10f * num79) + { + Main.statusText = string.Concat(new object[] + { + Lang.gen[11], + " ", + (int)(80f + (float)num96 / num79 * 2f), + "%" + }); + num81 = num88 + WorldGen.genRand.Next((int)(-600f * num79), (int)(600f * num79)); + num82 = num89 + WorldGen.genRand.Next((int)(-200f * num79), (int)(200f * num79)); + while (num81 < 1 || num81 >= Main.maxTilesX - 1 || num82 < 1 || num82 >= Main.maxTilesY - 1 || Main.tile[num81, num82].type != 59) + { + num81 = num88 + WorldGen.genRand.Next((int)(-600f * num79), (int)(600f * num79)); + num82 = num89 + WorldGen.genRand.Next((int)(-200f * num79), (int)(200f * num79)); + } + int num97 = 0; + while ((float)num97 < 8f * num79) + { + num81 += WorldGen.genRand.Next(-30, 31); + num82 += WorldGen.genRand.Next(-30, 31); + int type9 = -1; + if (WorldGen.genRand.Next(7) == 0) + { + type9 = -2; + } + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(30, 70), type9, false, 0f, 0f, false, true); + num97++; + } + num96++; + } + int num98 = 0; + while ((float)num98 <= 300f * num79) + { + num81 = num88 + WorldGen.genRand.Next((int)(-600f * num79), (int)(600f * num79)); + num82 = num89 + WorldGen.genRand.Next((int)(-200f * num79), (int)(200f * num79)); + while (num81 < 1 || num81 >= Main.maxTilesX - 1 || num82 < 1 || num82 >= Main.maxTilesY - 1 || Main.tile[num81, num82].type != 59) + { + num81 = num88 + WorldGen.genRand.Next((int)(-600f * num79), (int)(600f * num79)); + num82 = num89 + WorldGen.genRand.Next((int)(-200f * num79), (int)(200f * num79)); + } + WorldGen.TileRunner(num81, num82, (double)WorldGen.genRand.Next(4, 10), WorldGen.genRand.Next(5, 30), 1, false, 0f, 0f, false, true); + if (WorldGen.genRand.Next(4) == 0) + { + int type10 = WorldGen.genRand.Next(63, 69); + WorldGen.TileRunner(num81 + WorldGen.genRand.Next(-1, 2), num82 + WorldGen.genRand.Next(-1, 2), (double)WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(4, 8), type10, false, 0f, 0f, false, true); + } + num98++; + } + float num99 = (float)(Main.maxTilesX / 4200); + float num100 = (float)WorldGen.genRand.Next((int)(5f * num99), (int)(8f * num99)); + int num101 = 0; + while ((float)num101 < num100) + { + bool flag4 = true; + while (flag4) + { + num81 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + num82 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 300); + if (Main.tile[num81, num82].type == 59) + { + flag4 = false; + int num102 = 100; + for (int num103 = num81 - num102; num103 < num81 + num102; num103 += 5) + { + if (Main.tile[num81, num82].wall == 3 || Main.tile[num81, num82].wall == 83) + { + flag4 = true; + break; + } + } + if (!flag4) + { + WorldGen.HiveX[WorldGen.numHives] = num81; + WorldGen.HiveY[WorldGen.numHives] = num82; + WorldGen.numHives++; + } + } + } + num101++; + } + for (int num104 = 0; num104 < Main.maxTilesX; num104++) + { + for (int num105 = 0; num105 < Main.maxTilesY; num105++) + { + if (Main.tile[num104, num105].active()) + { + try + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num104, num105, 59, 60, true, 0); + } + catch + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num104, num105, 59, 60, false, 0); + } + } + } + } + WorldGen.numIslandHouses = 0; + WorldGen.houseCount = 0; + Main.statusText = Lang.gen[12]; + for (int num106 = 0; num106 < (int)((double)Main.maxTilesX * 0.0008); num106++) + { + int num107 = 0; + bool flag5 = false; + int num108 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.1), (int)((double)Main.maxTilesX * 0.9)); + bool flag6 = false; + while (!flag6) + { + flag6 = true; + while (num108 > Main.maxTilesX / 2 - 80 && num108 < Main.maxTilesX / 2 + 80) + { + num108 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.1), (int)((double)Main.maxTilesX * 0.9)); + } + for (int num109 = 0; num109 < WorldGen.numIslandHouses; num109++) + { + if (num108 > WorldGen.fihX[num109] - 180 && num108 < WorldGen.fihX[num109] + 180) + { + num107++; + flag6 = false; + break; + } + } + if (num107 >= 200) + { + flag5 = true; + break; + } + } + if (!flag5) + { + int num110 = 200; + while ((double)num110 < Main.worldSurface) + { + if (Main.tile[num108, num110].active()) + { + int num111 = num108; + int num112 = WorldGen.genRand.Next(90, num110 - 100); + while ((double)num112 > WorldGen.worldSurfaceLow - 50.0) + { + num112--; + } + WorldGen.CloudIsland(num111, num112); + WorldGen.fihX[WorldGen.numIslandHouses] = num111; + WorldGen.fihY[WorldGen.numIslandHouses] = num112; + WorldGen.numIslandHouses++; + break; + } + num110++; + } + } + } + Main.statusText = Lang.gen[13]; + for (int num113 = 0; num113 < Main.maxTilesX / 500; num113++) + { + int num114 = 0; + bool flag7 = true; + while (flag7) + { + int num115 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.3), (int)((double)Main.maxTilesX * 0.7)); + int num116 = WorldGen.genRand.Next((int)Main.rockLayer, Main.maxTilesY - 350); + flag7 = false; + int num117 = 60; + for (int num118 = num115 - num117; num118 < num115 + num117; num118 += 3) + { + for (int num119 = num116 - num117; num119 < num116 + num117; num119 += 3) + { + if (Main.tile[num118, num119].type == 147 || Main.tile[num118, num119].type == 161 || Main.tile[num118, num119].type == 162) + { + flag7 = true; + break; + } + } + } + if (!flag7) + { + WorldGen.ShroomPatch(num115, num116); + } + num114++; + if (num114 > 100) + { + break; + } + } + } + for (int num120 = 0; num120 < Main.maxTilesX; num120++) + { + for (int num121 = (int)Main.worldSurface; num121 < Main.maxTilesY; num121++) + { + if (Main.tile[num120, num121].active()) + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num120, num121, 59, 70, false, 0); + if (Main.tile[num120, num121].type == 70 && WorldGen.genRand.Next(20) == 0) + { + int num122; + if (WorldGen.genRand.Next(5) == 0) + { + num122 = 2; + } + else + { + num122 = 1; + } + int num123 = WorldGen.genRand.Next(2, 6); + int num124 = num121 - num123; + bool flag8 = true; + for (int num125 = num120 - num122; num125 <= num120 + num122; num125++) + { + if (Main.tile[num125, num124].active()) + { + flag8 = false; + } + if (Main.tileBrick[(int)Main.tile[num125, num124 - 1].type]) + { + flag8 = false; + } + if (Main.tileBrick[(int)Main.tile[num125, num124 + 1].type]) + { + flag8 = false; + } + } + if (Main.tile[num120 - num122 - 1, num124].type == 190) + { + flag8 = false; + } + if (Main.tile[num120 + num122 + 1, num124].type == 190) + { + flag8 = false; + } + for (int num126 = num124; num126 < num121; num126++) + { + if (Main.tile[num120, num126].active()) + { + flag8 = false; + } + if (Main.tileBrick[(int)Main.tile[num120 - 1, num126].type]) + { + flag8 = false; + } + if (Main.tileBrick[(int)Main.tile[num120 + 1, num126].type]) + { + flag8 = false; + } + } + if (flag8) + { + for (int num127 = num120 - num122; num127 <= num120 + num122; num127++) + { + WorldGen.PlaceTile(num127, num124, 190, true, true, -1, 0); + } + for (int num128 = num124; num128 < num121; num128++) + { + WorldGen.PlaceTile(num120, num128, 190, true, true, -1, 0); + } + } + } + } + } + } + Main.statusText = Lang.gen[14]; + for (int num129 = 0; num129 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.001); num129++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(2, 40), 59, false, 0f, 0f, false, true); + } + Main.statusText = Lang.gen[15]; + for (int num130 = 0; num130 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0001); num130++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num8, Main.maxTilesY), (double)WorldGen.genRand.Next(5, 12), WorldGen.genRand.Next(15, 50), 123, false, 0f, 0f, false, true); + } + for (int num131 = 0; num131 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0005); num131++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num8, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 5), WorldGen.genRand.Next(2, 5), 123, false, 0f, 0f, false, true); + } + Main.statusText = Lang.gen[16]; + for (int num132 = 0; num132 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); num132++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)num6), (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(2, 6), type, false, 0f, 0f, false, true); + } + for (int num133 = 0; num133 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 8E-05); num133++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, (int)num8), (double)WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 7), type, false, 0f, 0f, false, true); + } + for (int num134 = 0; num134 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0002); num134++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), type, false, 0f, 0f, false, true); + } + for (int num135 = 0; num135 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 3E-05); num135++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)num6), (double)WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(2, 5), type2, false, 0f, 0f, false, true); + } + for (int num136 = 0; num136 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 8E-05); num136++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, (int)num8), (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), type2, false, 0f, 0f, false, true); + } + for (int num137 = 0; num137 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0002); num137++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), type2, false, 0f, 0f, false, true); + } + for (int num138 = 0; num138 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2.6E-05); num138++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num6, (int)num8), (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), type3, false, 0f, 0f, false, true); + } + for (int num139 = 0; num139 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.00015); num139++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), type3, false, 0f, 0f, false, true); + } + for (int num140 = 0; num140 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.00017); num140++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int)WorldGen.worldSurfaceLow), (double)WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), type3, false, 0f, 0f, false, true); + } + for (int num141 = 0; num141 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.00012); num141++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(4, 8), WorldGen.genRand.Next(4, 8), type4, false, 0f, 0f, false, true); + } + for (int num142 = 0; num142 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.00012); num142++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int)WorldGen.worldSurfaceLow - 20), (double)WorldGen.genRand.Next(4, 8), WorldGen.genRand.Next(4, 8), type4, false, 0f, 0f, false, true); + } + if (WorldGen.crimson) + { + for (int num143 = 0; num143 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05); num143++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 4), WorldGen.genRand.Next(3, 6), 204, false, 0f, 0f, false, true); + } + } + else + { + for (int num144 = 0; num144 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05); num144++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)num7, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 4), WorldGen.genRand.Next(3, 6), 22, false, 0f, 0f, false, true); + } + } + Main.statusText = Lang.gen[17]; + for (int num145 = 0; num145 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0006); num145++) + { + int num146 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num147 = WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY - 20); + if (num145 < WorldGen.numMCaves) + { + num146 = WorldGen.mCaveX[num145]; + num147 = WorldGen.mCaveY[num145]; + } + if (!Main.tile[num146, num147].active()) + { + if ((double)num147 <= Main.worldSurface) + { + if (Main.tile[num146, num147].wall <= 0) + { + goto IL_3CC7; + } + } + while (!Main.tile[num146, num147].active() && num147 > (int)WorldGen.worldSurfaceLow) + { + num147--; + } + num147++; + int num148 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num148 = -1; + } + while (!Main.tile[num146, num147].active() && num146 > 10 && num146 < Main.maxTilesX - 10) + { + num146 += num148; + } + num146 -= num148; + if ((double)num147 > Main.worldSurface || Main.tile[num146, num147].wall > 0) + { + WorldGen.TileRunner(num146, num147, (double)WorldGen.genRand.Next(4, 11), WorldGen.genRand.Next(2, 4), 51, true, (float)num148, -1f, false, false); + } + } + IL_3CC7:; + } + Main.statusText = Lang.gen[18] + " 0%"; + int num149 = Main.maxTilesY - WorldGen.genRand.Next(150, 190); + for (int num150 = 0; num150 < Main.maxTilesX; num150++) + { + num149 += WorldGen.genRand.Next(-3, 4); + if (num149 < Main.maxTilesY - 190) + { + num149 = Main.maxTilesY - 190; + } + if (num149 > Main.maxTilesY - 160) + { + num149 = Main.maxTilesY - 160; + } + for (int num151 = num149 - 20 - WorldGen.genRand.Next(3); num151 < Main.maxTilesY; num151++) + { + if (num151 >= num149) + { + Main.tile[num150, num151].active(false); + Main.tile[num150, num151].lava(false); + Main.tile[num150, num151].liquid = 0; + } + else + { + Main.tile[num150, num151].type = 57; + } + } + } + int num152 = Main.maxTilesY - WorldGen.genRand.Next(40, 70); + for (int num153 = 10; num153 < Main.maxTilesX - 10; num153++) + { + num152 += WorldGen.genRand.Next(-10, 11); + if (num152 > Main.maxTilesY - 60) + { + num152 = Main.maxTilesY - 60; + } + if (num152 < Main.maxTilesY - 100) + { + num152 = Main.maxTilesY - 120; + } + for (int num154 = num152; num154 < Main.maxTilesY - 10; num154++) + { + if (!Main.tile[num153, num154].active()) + { + Main.tile[num153, num154].lava(true); + Main.tile[num153, num154].liquid = 255; + } + } + } + for (int num155 = 0; num155 < Main.maxTilesX; num155++) + { + if (WorldGen.genRand.Next(50) == 0) + { + int num156 = Main.maxTilesY - 65; + while (!Main.tile[num155, num156].active() && num156 > Main.maxTilesY - 135) + { + num156--; + } + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), num156 + WorldGen.genRand.Next(20, 50), (double)WorldGen.genRand.Next(15, 20), 1000, 57, true, 0f, (float)WorldGen.genRand.Next(1, 3), true, true); + } + } + Liquid.QuickWater(-2, -1, -1); + for (int num157 = 0; num157 < Main.maxTilesX; num157++) + { + float num158 = (float)num157 / (float)(Main.maxTilesX - 1); + Main.statusText = string.Concat(new object[] + { + Lang.gen[18], + " ", + (int)(num158 * 100f / 2f + 50f), + "%" + }); + if (WorldGen.genRand.Next(13) == 0) + { + int num159 = Main.maxTilesY - 65; + while ((Main.tile[num157, num159].liquid > 0 || Main.tile[num157, num159].active()) && num159 > Main.maxTilesY - 140) + { + num159--; + } + WorldGen.TileRunner(num157, num159 - WorldGen.genRand.Next(2, 5), (double)WorldGen.genRand.Next(5, 30), 1000, 57, true, 0f, (float)WorldGen.genRand.Next(1, 3), true, true); + float num160 = (float)WorldGen.genRand.Next(1, 3); + if (WorldGen.genRand.Next(3) == 0) + { + num160 *= 0.5f; + } + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.TileRunner(num157, num159 - WorldGen.genRand.Next(2, 5), (double)((int)((float)WorldGen.genRand.Next(5, 15) * num160)), (int)((float)WorldGen.genRand.Next(10, 15) * num160), 57, true, 1f, 0.3f, false, true); + } + if (WorldGen.genRand.Next(2) == 0) + { + num160 = (float)WorldGen.genRand.Next(1, 3); + WorldGen.TileRunner(num157, num159 - WorldGen.genRand.Next(2, 5), (double)((int)((float)WorldGen.genRand.Next(5, 15) * num160)), (int)((float)WorldGen.genRand.Next(10, 15) * num160), 57, true, -1f, 0.3f, false, true); + } + WorldGen.TileRunner(num157 + WorldGen.genRand.Next(-10, 10), num159 + WorldGen.genRand.Next(-10, 10), (double)WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(5, 10), -2, false, (float)WorldGen.genRand.Next(-1, 3), (float)WorldGen.genRand.Next(-1, 3), false, true); + if (WorldGen.genRand.Next(3) == 0) + { + WorldGen.TileRunner(num157 + WorldGen.genRand.Next(-10, 10), num159 + WorldGen.genRand.Next(-10, 10), (double)WorldGen.genRand.Next(10, 30), WorldGen.genRand.Next(10, 20), -2, false, (float)WorldGen.genRand.Next(-1, 3), (float)WorldGen.genRand.Next(-1, 3), false, true); + } + if (WorldGen.genRand.Next(5) == 0) + { + WorldGen.TileRunner(num157 + WorldGen.genRand.Next(-15, 15), num159 + WorldGen.genRand.Next(-15, 10), (double)WorldGen.genRand.Next(15, 30), WorldGen.genRand.Next(5, 20), -2, false, (float)WorldGen.genRand.Next(-1, 3), (float)WorldGen.genRand.Next(-1, 3), false, true); + } + } + } + for (int num161 = 0; num161 < Main.maxTilesX; num161++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(20, Main.maxTilesX - 20), WorldGen.genRand.Next(Main.maxTilesY - 180, Main.maxTilesY - 10), (double)WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(2, 7), -2, false, 0f, 0f, false, true); + } + for (int num162 = 0; num162 < Main.maxTilesX; num162++) + { + if (!Main.tile[num162, Main.maxTilesY - 145].active()) + { + Main.tile[num162, Main.maxTilesY - 145].liquid = 255; + Main.tile[num162, Main.maxTilesY - 145].lava(true); + } + if (!Main.tile[num162, Main.maxTilesY - 144].active()) + { + Main.tile[num162, Main.maxTilesY - 144].liquid = 255; + Main.tile[num162, Main.maxTilesY - 144].lava(true); + } + } + for (int num163 = 0; num163 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008); num163++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(Main.maxTilesY - 140, Main.maxTilesY), (double)WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(3, 7), 58, false, 0f, 0f, false, true); + } + WorldGen.AddHellHouses(); + int num164 = WorldGen.genRand.Next(2, (int)((double)Main.maxTilesX * 0.005)); + for (int num165 = 0; num165 < num164; num165++) + { + float num166 = (float)num165 / (float)num164; + Main.statusText = string.Concat(new object[] + { + Lang.gen[19], + " ", + (int)(num166 * 100f), + "%" + }); + int num167 = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + while (num167 > Main.maxTilesX / 2 - 50 && num167 < Main.maxTilesX / 2 + 50) + { + num167 = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + } + int num168 = (int)WorldGen.worldSurfaceLow - 20; + while (!Main.tile[num167, num168].active()) + { + num168++; + } + WorldGen.Lakinater(num167, num168); + } + int x; + if (num9 == -1) + { + x = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.05), (int)((double)Main.maxTilesX * 0.2)); + num9 = -1; + } + else + { + x = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.8), (int)((double)Main.maxTilesX * 0.95)); + num9 = 1; + } + int y = (int)((Main.worldSurface + Main.rockLayer) / 2.0) + WorldGen.genRand.Next(-200, 200); + WorldGen.MakeDungeon(x, y, 41, 7); + if (WorldGen.crimson) + { + int num169 = 0; + while ((double)num169 < (double)Main.maxTilesX * 0.00045) + { + float num170 = (float)((double)num169 / ((double)Main.maxTilesX * 0.00045)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[72], + " ", + (int)(num170 * 100f), + "%" + }); + bool flag9 = false; + int num171 = 0; + int num172 = 0; + int num173 = 0; + while (!flag9) + { + int num174 = 0; + flag9 = true; + int num175 = Main.maxTilesX / 2; + int num176 = 200; + if (num9 < 0) + { + num171 = WorldGen.genRand.Next(600, Main.maxTilesX - 320); + } + else + { + num171 = WorldGen.genRand.Next(320, Main.maxTilesX - 600); + } + num172 = num171 - WorldGen.genRand.Next(200) - 100; + num173 = num171 + WorldGen.genRand.Next(200) + 100; + if (num172 < 285) + { + num172 = 285; + } + if (num173 > Main.maxTilesX - 285) + { + num173 = Main.maxTilesX - 285; + } + if (num9 < 0 && num172 < 400) + { + num172 = 400; + } + else + { + if (num9 > 0 && num172 > Main.maxTilesX - 400) + { + num172 = Main.maxTilesX - 400; + } + } + if (num171 > num175 - num176 && num171 < num175 + num176) + { + flag9 = false; + } + if (num172 > num175 - num176 && num172 < num175 + num176) + { + flag9 = false; + } + if (num173 > num175 - num176 && num173 < num175 + num176) + { + flag9 = false; + } + for (int num177 = num172; num177 < num173; num177++) + { + for (int num178 = 0; num178 < (int)Main.worldSurface; num178 += 5) + { + if (Main.tile[num177, num178].active() && Main.tileDungeon[(int)Main.tile[num177, num178].type]) + { + flag9 = false; + break; + } + if (!flag9) + { + break; + } + } + } + if (num174 < 200 && WorldGen.JungleX > num172 && WorldGen.JungleX < num173) + { + num174++; + flag9 = false; + } + } + WorldGen.CrimStart(num171, (int)WorldGen.worldSurfaceLow - 10); + for (int num179 = num172; num179 < num173; num179++) + { + int num180 = (int)WorldGen.worldSurfaceLow; + while ((double)num180 < Main.worldSurface - 1.0) + { + if (Main.tile[num179, num180].active()) + { + int num181 = num180 + WorldGen.genRand.Next(10, 14); + for (int num182 = num180; num182 < num181; num182++) + { + if ((Main.tile[num179, num182].type == 59 || Main.tile[num179, num182].type == 60) && num179 >= num172 + WorldGen.genRand.Next(5) && num179 < num173 - WorldGen.genRand.Next(5)) + { + Main.tile[num179, num182].type = 0; + } + } + break; + } + num180++; + } + } + double num183 = Main.worldSurface + 40.0; + for (int num184 = num172; num184 < num173; num184++) + { + num183 += (double)WorldGen.genRand.Next(-2, 3); + if (num183 < Main.worldSurface + 30.0) + { + num183 = Main.worldSurface + 30.0; + } + if (num183 > Main.worldSurface + 50.0) + { + num183 = Main.worldSurface + 50.0; + } + num49 = num184; + bool flag10 = false; + int num185 = (int)WorldGen.worldSurfaceLow; + while ((double)num185 < num183) + { + if (Main.tile[num49, num185].active()) + { + if (Main.tile[num49, num185].type == 53 && num49 >= num172 + WorldGen.genRand.Next(5) && num49 <= num173 - WorldGen.genRand.Next(5)) + { + Main.tile[num49, num185].type = 234; + } + if (Main.tile[num49, num185].type == 0 && (double)num185 < Main.worldSurface - 1.0 && !flag10) + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num49, num185, 0, 199, true, 0); + } + flag10 = true; + if (Main.tile[num49, num185].type == 1 && num49 >= num172 + WorldGen.genRand.Next(5) && num49 <= num173 - WorldGen.genRand.Next(5)) + { + Main.tile[num49, num185].type = 203; + } + if (Main.tile[num49, num185].type == 2) + { + Main.tile[num49, num185].type = 199; + } + if (Main.tile[num49, num185].type == 161) + { + Main.tile[num49, num185].type = 200; + } + } + num185++; + } + } + int num186 = WorldGen.genRand.Next(10, 15); + for (int num187 = 0; num187 < num186; num187++) + { + int num188 = 0; + bool flag11 = false; + int num189 = 0; + while (!flag11) + { + num188++; + int num190 = WorldGen.genRand.Next(num172 - num189, num173 + num189); + int num191 = WorldGen.genRand.Next((int)(Main.worldSurface - (double)(num189 / 2)), (int)(Main.worldSurface + 100.0 + (double)num189)); + if (num188 > 100) + { + num189++; + num188 = 0; + } + if (!Main.tile[num190, num191].active()) + { + while (!Main.tile[num190, num191].active()) + { + num191++; + } + num191--; + } + else + { + while (Main.tile[num190, num191].active() && (double)num191 > Main.worldSurface) + { + num191--; + } + } + if (num189 > 10 || (Main.tile[num190, num191 + 1].active() && Main.tile[num190, num191 + 1].type == 203)) + { + WorldGen.Place3x2(num190, num191, 26, 1); + if (Main.tile[num190, num191].type == 26) + { + flag11 = true; + } + } + if (num189 > 100) + { + flag11 = true; + } + } + } + num169++; + } + } + else + { + int num192 = 0; + while ((double)num192 < (double)Main.maxTilesX * 0.00045) + { + float num193 = (float)((double)num192 / ((double)Main.maxTilesX * 0.00045)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[20], + " ", + (int)(num193 * 100f), + "%" + }); + bool flag12 = false; + int num194 = 0; + int num195 = 0; + int num196 = 0; + while (!flag12) + { + int num197 = 0; + flag12 = true; + int num198 = Main.maxTilesX / 2; + int num199 = 200; + num194 = WorldGen.genRand.Next(320, Main.maxTilesX - 320); + num195 = num194 - WorldGen.genRand.Next(200) - 100; + num196 = num194 + WorldGen.genRand.Next(200) + 100; + if (num195 < 285) + { + num195 = 285; + } + if (num196 > Main.maxTilesX - 285) + { + num196 = Main.maxTilesX - 285; + } + if (num194 > num198 - num199 && num194 < num198 + num199) + { + flag12 = false; + } + if (num195 > num198 - num199 && num195 < num198 + num199) + { + flag12 = false; + } + if (num196 > num198 - num199 && num196 < num198 + num199) + { + flag12 = false; + } + for (int num200 = num195; num200 < num196; num200++) + { + for (int num201 = 0; num201 < (int)Main.worldSurface; num201 += 5) + { + if (Main.tile[num200, num201].active() && Main.tileDungeon[(int)Main.tile[num200, num201].type]) + { + flag12 = false; + break; + } + if (!flag12) + { + break; + } + } + } + if (num197 < 200 && WorldGen.JungleX > num195 && WorldGen.JungleX < num196) + { + num197++; + flag12 = false; + } + } + int num202 = 0; + for (int num203 = num195; num203 < num196; num203++) + { + if (num202 > 0) + { + num202--; + } + if (num203 == num194 || num202 == 0) + { + int num204 = (int)WorldGen.worldSurfaceLow; + while ((double)num204 < Main.worldSurface - 1.0) + { + if (Main.tile[num203, num204].active() || Main.tile[num203, num204].wall > 0) + { + if (num203 == num194) + { + num202 = 20; + WorldGen.ChasmRunner(num203, num204, WorldGen.genRand.Next(150) + 150, true); + break; + } + if (WorldGen.genRand.Next(35) == 0 && num202 == 0) + { + num202 = 30; + bool makeOrb = true; + WorldGen.ChasmRunner(num203, num204, WorldGen.genRand.Next(50) + 50, makeOrb); + break; + } + break; + } + else + { + num204++; + } + } + } + int num205 = (int)WorldGen.worldSurfaceLow; + while ((double)num205 < Main.worldSurface - 1.0) + { + if (Main.tile[num203, num205].active()) + { + int num206 = num205 + WorldGen.genRand.Next(10, 14); + for (int num207 = num205; num207 < num206; num207++) + { + if ((Main.tile[num203, num207].type == 59 || Main.tile[num203, num207].type == 60) && num203 >= num195 + WorldGen.genRand.Next(5) && num203 < num196 - WorldGen.genRand.Next(5)) + { + Main.tile[num203, num207].type = 0; + } + } + break; + } + num205++; + } + } + double num208 = Main.worldSurface + 40.0; + for (int num209 = num195; num209 < num196; num209++) + { + num208 += (double)WorldGen.genRand.Next(-2, 3); + if (num208 < Main.worldSurface + 30.0) + { + num208 = Main.worldSurface + 30.0; + } + if (num208 > Main.worldSurface + 50.0) + { + num208 = Main.worldSurface + 50.0; + } + num49 = num209; + bool flag13 = false; + int num210 = (int)WorldGen.worldSurfaceLow; + while ((double)num210 < num208) + { + if (Main.tile[num49, num210].active()) + { + if (Main.tile[num49, num210].type == 53 && num49 >= num195 + WorldGen.genRand.Next(5) && num49 <= num196 - WorldGen.genRand.Next(5)) + { + Main.tile[num49, num210].type = 112; + } + if (Main.tile[num49, num210].type == 0 && (double)num210 < Main.worldSurface - 1.0 && !flag13) + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num49, num210, 0, 23, true, 0); + } + flag13 = true; + if (Main.tile[num49, num210].type == 1 && num49 >= num195 + WorldGen.genRand.Next(5) && num49 <= num196 - WorldGen.genRand.Next(5)) + { + Main.tile[num49, num210].type = 25; + } + if (Main.tile[num49, num210].type == 2) + { + Main.tile[num49, num210].type = 23; + } + if (Main.tile[num49, num210].type == 161) + { + Main.tile[num49, num210].type = 163; + } + } + num210++; + } + } + for (int num211 = num195; num211 < num196; num211++) + { + for (int num212 = 0; num212 < Main.maxTilesY - 50; num212++) + { + if (Main.tile[num211, num212].active() && Main.tile[num211, num212].type == 31) + { + int num213 = num211 - 13; + int num214 = num211 + 13; + int num215 = num212 - 13; + int num216 = num212 + 13; + for (int num217 = num213; num217 < num214; num217++) + { + if (num217 > 10 && num217 < Main.maxTilesX - 10) + { + for (int num218 = num215; num218 < num216; num218++) + { + if (Math.Abs(num217 - num211) + Math.Abs(num218 - num212) < 9 + WorldGen.genRand.Next(11) && WorldGen.genRand.Next(3) != 0 && Main.tile[num217, num218].type != 31) + { + Main.tile[num217, num218].active(true); + Main.tile[num217, num218].type = 25; + if (Math.Abs(num217 - num211) <= 1 && Math.Abs(num218 - num212) <= 1) + { + Main.tile[num217, num218].active(false); + } + } + if (Main.tile[num217, num218].type != 31 && Math.Abs(num217 - num211) <= 2 + WorldGen.genRand.Next(3) && Math.Abs(num218 - num212) <= 2 + WorldGen.genRand.Next(3)) + { + Main.tile[num217, num218].active(false); + } + } + } + } + } + } + } + num192++; + } + } + for (int num219 = num66; num219 < num67; num219++) + { + for (int num220 = array5[num219]; num220 < array6[num219]; num220++) + { + int type11 = (int)Main.tile[num220, num219].type; + if (type11 == 123) + { + Main.tile[num220, num219].type = 224; + } + else + { + if (type11 == 59) + { + bool flag14 = true; + int num221 = 3; + for (int num222 = num220 - num221; num222 <= num220 + num221; num222++) + { + for (int num223 = num219 - num221; num223 <= num219 + num221; num223++) + { + if (Main.tile[num222, num223].type == 60 || Main.tile[num222, num223].type == 70 || Main.tile[num222, num223].type == 71 || Main.tile[num222, num223].type == 72) + { + flag14 = false; + break; + } + } + } + if (flag14) + { + Main.tile[num220, num219].type = 224; + } + } + else + { + if (type11 == 1) + { + Main.tile[num220, num219].type = 161; + } + } + } + } + } + Main.statusText = Lang.gen[21]; + for (int num224 = 0; num224 < WorldGen.numMCaves; num224++) + { + int i2 = WorldGen.mCaveX[num224]; + int j2 = WorldGen.mCaveY[num224]; + WorldGen.CaveOpenater(i2, j2); + WorldGen.Cavinator(i2, j2, WorldGen.genRand.Next(40, 50)); + } + int num225 = 0; + int num226 = 0; + int num227 = 20; + int num228 = Main.maxTilesX - 20; + Main.statusText = Lang.gen[22]; + for (int num229 = 0; num229 < 2; num229++) + { + if (num229 == 0) + { + int num230 = 0; + int num231 = WorldGen.genRand.Next(125, 200) + 50; + if (num9 == 1) + { + num231 = 275; + } + int num232 = 0; + float num233 = 1f; + int num234 = 0; + while (!Main.tile[num231 - 1, num234].active()) + { + num234++; + } + num225 = num234; + num234 += WorldGen.genRand.Next(1, 5); + for (int num235 = num231 - 1; num235 >= num230; num235--) + { + num232++; + if (num232 < 3) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.2f; + } + else + { + if (num232 < 6) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.15f; + } + else + { + if (num232 < 9) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.1f; + } + else + { + if (num232 < 15) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.07f; + } + else + { + if (num232 < 50) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.05f; + } + else + { + if (num232 < 75) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.04f; + } + else + { + if (num232 < 100) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.03f; + } + else + { + if (num232 < 125) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.02f; + } + else + { + if (num232 < 150) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.01f; + } + else + { + if (num232 < 175) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.005f; + } + else + { + if (num232 < 200) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.001f; + } + else + { + if (num232 < 230) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.01f; + } + else + { + if (num232 < 235) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.05f; + } + else + { + if (num232 < 240) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.1f; + } + else + { + if (num232 < 245) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.05f; + } + else + { + if (num232 < 255) + { + num233 += (float)WorldGen.genRand.Next(10, 20) * 0.01f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (num232 == 235) + { + num228 = num235; + } + if (num232 == 235) + { + num227 = num235; + } + int num236 = WorldGen.genRand.Next(15, 20); + int num237 = 0; + while ((float)num237 < (float)num234 + num233 + (float)num236) + { + if ((float)num237 < (float)num234 + num233 * 0.75f - 3f) + { + Main.tile[num235, num237].active(false); + if (num237 > num234) + { + Main.tile[num235, num237].liquid = 255; + } + else + { + if (num237 == num234) + { + Main.tile[num235, num237].liquid = 127; + } + } + } + else + { + if (num237 > num234) + { + Main.tile[num235, num237].type = 53; + Main.tile[num235, num237].active(true); + } + } + Main.tile[num235, num237].wall = 0; + num237++; + } + } + } + else + { + int num230 = Main.maxTilesX - WorldGen.genRand.Next(125, 200) - 50; + int num231 = Main.maxTilesX; + if (num9 == -1) + { + num230 = Main.maxTilesX - 275; + } + float num238 = 1f; + int num239 = 0; + int num240 = 0; + while (!Main.tile[num230, num240].active()) + { + num240++; + } + num226 = num240; + num240 += WorldGen.genRand.Next(1, 5); + for (int num241 = num230; num241 < num231; num241++) + { + num239++; + if (num239 < 3) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.2f; + } + else + { + if (num239 < 6) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.15f; + } + else + { + if (num239 < 9) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.1f; + } + else + { + if (num239 < 15) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.07f; + } + else + { + if (num239 < 50) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.05f; + } + else + { + if (num239 < 75) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.04f; + } + else + { + if (num239 < 100) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.03f; + } + else + { + if (num239 < 125) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.02f; + } + else + { + if (num239 < 150) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.01f; + } + else + { + if (num239 < 175) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.005f; + } + else + { + if (num239 < 200) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.001f; + } + else + { + if (num239 < 230) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.01f; + } + else + { + if (num239 < 235) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.05f; + } + else + { + if (num239 < 240) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.1f; + } + else + { + if (num239 < 245) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.05f; + } + else + { + if (num239 < 255) + { + num238 += (float)WorldGen.genRand.Next(10, 20) * 0.01f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (num239 == 235) + { + num228 = num241; + } + int num242 = WorldGen.genRand.Next(15, 20); + int num243 = 0; + while ((float)num243 < (float)num240 + num238 + (float)num242) + { + if ((float)num243 < (float)num240 + num238 * 0.75f - 3f && (double)num243 < Main.worldSurface - 2.0) + { + Main.tile[num241, num243].active(false); + if (num243 > num240) + { + Main.tile[num241, num243].liquid = 255; + } + else + { + if (num243 == num240) + { + Main.tile[num241, num243].liquid = 127; + } + } + } + else + { + if (num243 > num240) + { + Main.tile[num241, num243].type = 53; + Main.tile[num241, num243].active(true); + } + } + Main.tile[num241, num243].wall = 0; + num243++; + } + } + } + } + while (!Main.tile[num227, num225].active()) + { + num225++; + } + num225++; + while (!Main.tile[num228, num226].active()) + { + num226++; + } + num226++; + Main.statusText = Lang.gen[23]; + for (int num244 = 63; num244 <= 68; num244++) + { + float num245 = 0f; + if (num244 == 67) + { + num245 = (float)Main.maxTilesX * 0.5f; + } + else + { + if (num244 == 66) + { + num245 = (float)Main.maxTilesX * 0.45f; + } + else + { + if (num244 == 63) + { + num245 = (float)Main.maxTilesX * 0.3f; + } + else + { + if (num244 == 65) + { + num245 = (float)Main.maxTilesX * 0.25f; + } + else + { + if (num244 == 64) + { + num245 = (float)Main.maxTilesX * 0.1f; + } + else + { + if (num244 == 68) + { + num245 = (float)Main.maxTilesX * 0.05f; + } + } + } + } + } + } + num245 *= 0.2f; + int num246 = 0; + while ((float)num246 < num245) + { + int num247 = WorldGen.genRand.Next(0, Main.maxTilesX); + int num248 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY); + while (Main.tile[num247, num248].type != 1) + { + num247 = WorldGen.genRand.Next(0, Main.maxTilesX); + num248 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY); + } + WorldGen.TileRunner(num247, num248, (double)WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(3, 7), num244, false, 0f, 0f, false, true); + num246++; + } + } + for (int num249 = 0; num249 < 2; num249++) + { + int num250 = 1; + int num251 = 5; + int num252 = Main.maxTilesX - 5; + if (num249 == 1) + { + num250 = -1; + num251 = Main.maxTilesX - 5; + num252 = 5; + } + for (int num253 = num251; num253 != num252; num253 += num250) + { + for (int num254 = 10; num254 < Main.maxTilesY - 10; num254++) + { + if (Main.tile[num253, num254].active() && Main.tile[num253, num254 + 1].active() && Main.tileSand[(int)Main.tile[num253, num254].type] && Main.tileSand[(int)Main.tile[num253, num254 + 1].type]) + { + byte type12 = Main.tile[num253, num254].type; + int num255 = num253 + num250; + int num256 = num254 + 1; + if (!Main.tile[num255, num254].active() && !Main.tile[num255, num254 + 1].active()) + { + while (!Main.tile[num255, num256].active()) + { + num256++; + } + num256--; + Main.tile[num253, num254].active(false); + Main.tile[num255, num256].active(true); + Main.tile[num255, num256].type = type12; + } + } + } + } + } + for (int num257 = 0; num257 < Main.maxTilesX; num257++) + { + float num258 = (float)num257 / (float)(Main.maxTilesX - 1); + Main.statusText = string.Concat(new object[] + { + Lang.gen[24], + " ", + (int)(num258 * 100f), + "%" + }); + for (int num259 = Main.maxTilesY - 5; num259 > 0; num259--) + { + if (Main.tile[num257, num259].active()) + { + if (Main.tile[num257, num259].type == 53) + { + int num260 = num259; + while (!Main.tile[num257, num260 + 1].active()) + { + if (num260 >= Main.maxTilesY - 5) + { + break; + } + Main.tile[num257, num260 + 1].active(true); + Main.tile[num257, num260 + 1].type = 53; + num260++; + } + } + else + { + if (Main.tile[num257, num259].type == 123) + { + int num261 = num259; + while (!Main.tile[num257, num261 + 1].active()) + { + if (num261 >= Main.maxTilesY - 5) + { + break; + } + Main.tile[num257, num261 + 1].active(true); + Main.tile[num257, num261 + 1].type = 123; + Main.tile[num257, num261].active(false); + num261++; + } + } + else + { + if (Main.tile[num257, num259].type == 224) + { + int num262 = num259; + while (!Main.tile[num257, num262 + 1].active()) + { + if (num262 >= Main.maxTilesY - 5) + { + break; + } + Main.tile[num257, num262 + 1].active(true); + Main.tile[num257, num262 + 1].type = 224; + Main.tile[num257, num262].active(false); + num262++; + } + } + else + { + if (Main.tile[num257, num259].type == 234) + { + int num263 = num259; + while (!Main.tile[num257, num263 + 1].active()) + { + if (num263 >= Main.maxTilesY - 5) + { + break; + } + Main.tile[num257, num263 + 1].active(true); + Main.tile[num257, num263 + 1].type = 234; + Main.tile[num257, num263].active(false); + num263++; + } + } + else + { + if (Main.tile[num257, num259].type == 112) + { + int num264 = num259; + while (!Main.tile[num257, num264 + 1].active() && num264 < Main.maxTilesY - 5) + { + Main.tile[num257, num264 + 1].active(true); + Main.tile[num257, num264 + 1].type = 112; + Main.tile[num257, num264].active(false); + num264++; + } + } + } + } + } + } + } + } + } + for (int num265 = 3; num265 < Main.maxTilesX - 3; num265++) + { + float num266 = (float)num265 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[25], + " ", + (int)(num266 * 100f + 1f), + "%" + }); + bool flag15 = true; + int num267 = 0; + while ((double)num267 < Main.worldSurface) + { + if (flag15) + { + if (Main.tile[num265, num267].wall == 2 || Main.tile[num265, num267].wall == 40 || Main.tile[num265, num267].wall == 64) + { + Main.tile[num265, num267].wall = 0; + } + if (Main.tile[num265, num267].type != 53 && Main.tile[num265, num267].type != 112 && Main.tile[num265, num267].type != 234) + { + if (Main.tile[num265 - 1, num267].wall == 2 || Main.tile[num265 - 1, num267].wall == 40 || Main.tile[num265 - 1, num267].wall == 40) + { + Main.tile[num265 - 1, num267].wall = 0; + } + if ((Main.tile[num265 - 2, num267].wall == 2 || Main.tile[num265 - 2, num267].wall == 40 || Main.tile[num265 - 2, num267].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num265 - 2, num267].wall = 0; + } + if ((Main.tile[num265 - 3, num267].wall == 2 || Main.tile[num265 - 3, num267].wall == 40 || Main.tile[num265 - 3, num267].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num265 - 3, num267].wall = 0; + } + if (Main.tile[num265 + 1, num267].wall == 2 || Main.tile[num265 + 1, num267].wall == 40 || Main.tile[num265 + 1, num267].wall == 40) + { + Main.tile[num265 + 1, num267].wall = 0; + } + if ((Main.tile[num265 + 2, num267].wall == 2 || Main.tile[num265 + 2, num267].wall == 40 || Main.tile[num265 + 2, num267].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num265 + 2, num267].wall = 0; + } + if ((Main.tile[num265 + 3, num267].wall == 2 || Main.tile[num265 + 3, num267].wall == 40 || Main.tile[num265 + 3, num267].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num265 + 3, num267].wall = 0; + } + if (Main.tile[num265, num267].active()) + { + flag15 = false; + } + } + } + else + { + if (Main.tile[num265, num267].wall == 0 && Main.tile[num265, num267 + 1].wall == 0 && Main.tile[num265, num267 + 2].wall == 0 && Main.tile[num265, num267 + 3].wall == 0 && Main.tile[num265, num267 + 4].wall == 0 && Main.tile[num265 - 1, num267].wall == 0 && Main.tile[num265 + 1, num267].wall == 0 && Main.tile[num265 - 2, num267].wall == 0 && Main.tile[num265 + 2, num267].wall == 0 && !Main.tile[num265, num267].active() && !Main.tile[num265, num267 + 1].active() && !Main.tile[num265, num267 + 2].active() && !Main.tile[num265, num267 + 3].active()) + { + flag15 = true; + } + } + num267++; + } + } + for (int num268 = Main.maxTilesX - 5; num268 >= 5; num268--) + { + float num269 = (float)num268 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[25], + " ", + (int)(num269 * 100f + 1f), + "%" + }); + bool flag16 = true; + int num270 = 0; + while ((double)num270 < Main.worldSurface) + { + if (flag16) + { + if (Main.tile[num268, num270].wall == 2 || Main.tile[num268, num270].wall == 40 || Main.tile[num268, num270].wall == 64) + { + Main.tile[num268, num270].wall = 0; + } + if (Main.tile[num268, num270].type != 53) + { + if (Main.tile[num268 - 1, num270].wall == 2 || Main.tile[num268 - 1, num270].wall == 40 || Main.tile[num268 - 1, num270].wall == 40) + { + Main.tile[num268 - 1, num270].wall = 0; + } + if ((Main.tile[num268 - 2, num270].wall == 2 || Main.tile[num268 - 2, num270].wall == 40 || Main.tile[num268 - 2, num270].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num268 - 2, num270].wall = 0; + } + if ((Main.tile[num268 - 3, num270].wall == 2 || Main.tile[num268 - 3, num270].wall == 40 || Main.tile[num268 - 3, num270].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num268 - 3, num270].wall = 0; + } + if (Main.tile[num268 + 1, num270].wall == 2 || Main.tile[num268 + 1, num270].wall == 40 || Main.tile[num268 + 1, num270].wall == 40) + { + Main.tile[num268 + 1, num270].wall = 0; + } + if ((Main.tile[num268 + 2, num270].wall == 2 || Main.tile[num268 + 2, num270].wall == 40 || Main.tile[num268 + 2, num270].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num268 + 2, num270].wall = 0; + } + if ((Main.tile[num268 + 3, num270].wall == 2 || Main.tile[num268 + 3, num270].wall == 40 || Main.tile[num268 + 3, num270].wall == 40) && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num268 + 3, num270].wall = 0; + } + if (Main.tile[num268, num270].active()) + { + flag16 = false; + } + } + } + else + { + if (Main.tile[num268, num270].wall == 0 && Main.tile[num268, num270 + 1].wall == 0 && Main.tile[num268, num270 + 2].wall == 0 && Main.tile[num268, num270 + 3].wall == 0 && Main.tile[num268, num270 + 4].wall == 0 && Main.tile[num268 - 1, num270].wall == 0 && Main.tile[num268 + 1, num270].wall == 0 && Main.tile[num268 - 2, num270].wall == 0 && Main.tile[num268 + 2, num270].wall == 0 && !Main.tile[num268, num270].active() && !Main.tile[num268, num270 + 1].active() && !Main.tile[num268, num270 + 2].active() && !Main.tile[num268, num270 + 3].active()) + { + flag16 = true; + } + } + num270++; + } + } + for (int num271 = 0; num271 < num17; num271++) + { + int num272 = array3[num271]; + int num273 = array4[num271]; + if (num272 > 300 && num272 < Main.maxTilesX - 300 && (num9 >= 0 || (double)num272 >= (double)WorldGen.dungeonX + (double)Main.maxTilesX * 0.15)) + { + if (num9 <= 0 || (double)num272 <= (double)WorldGen.dungeonX - (double)Main.maxTilesX * 0.15) + { + while (!Main.tile[num272, num273].active() && (double)num273 < Main.worldSurface) + { + num273++; + } + if ((double)num273 < Main.worldSurface && Main.tile[num272, num273].type == 53) + { + int num274 = Main.maxTilesX; + for (int num275 = 0; num275 < num271; num275++) + { + int num276 = Math.Abs(num272 - array3[num275]); + if (num276 < num274) + { + num274 = num276; + } + } + if (num274 >= 250) + { + num273--; + WorldGen.Pyramid(num272, num273); + } + } + } + } + } + for (int num277 = 0; num277 < Main.maxTilesX; num277++) + { + int num278 = WorldGen.genRand.Next(10, Main.maxTilesX - 10); + int num279 = WorldGen.genRand.Next(10, (int)Main.worldSurface); + if (Main.tile[num278, num279].wall == 2) + { + WorldGen.DirtyRockRunner(num278, num279); + } + } + float num280 = (float)(Main.maxTilesX / 4200); + int num281 = WorldGen.genRand.Next(0, (int)(3f * num280)); + for (int num282 = 0; num282 < num281; num282++) + { + bool flag17 = false; + int num283 = 0; + while (!flag17) + { + num283++; + if (num283 > 1000) + { + flag17 = true; + } + int num284 = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + if (num284 <= Main.maxTilesX / 2 - 100 || num284 >= Main.maxTilesX / 2 + 100) + { + int num285 = 0; + while (!Main.tile[num284, num285].active() && (double)num285 < Main.worldSurface) + { + num285++; + } + if (Main.tile[num284, num285].type == 0) + { + num285--; + if (num285 > 150) + { + bool flag18 = true; + for (int num286 = num284 - 50; num286 < num284 + 50; num286++) + { + for (int num287 = num285 - 50; num287 < num285 + 50; num287++) + { + if (Main.tile[num286, num287].active()) + { + int type13 = (int)Main.tile[num286, num287].type; + if (type13 == 41 || type13 == 43 || type13 == 44 || type13 == 189 || type13 == 196) + { + flag18 = false; + } + } + } + } + if (flag18) + { + flag17 = WorldGen.GrowLivingTree(num284, num285); + } + } + } + } + } + } + Main.tileSolid[192] = false; + for (int num288 = 25; num288 < Main.maxTilesX - 25; num288++) + { + int num289 = 25; + while ((double)num289 < Main.worldSurface) + { + if (Main.tile[num288, num289].type == 191 || Main.tile[num288, num289 - 1].type == 191 || Main.tile[num288 - 1, num289].type == 191 || Main.tile[num288 + 1, num289].type == 191 || Main.tile[num288, num289 + 1].type == 191) + { + bool flag19 = true; + for (int num290 = num288 - 1; num290 <= num288 + 1; num290++) + { + for (int num291 = num289 - 1; num291 <= num289 + 1; num291++) + { + if (num290 != num288 && num291 != num289 && Main.tile[num290, num291].type != 191 && Main.tile[num290, num291].wall != 78) + { + flag19 = false; + } + } + } + if (flag19) + { + Main.tile[num288, num289].wall = 78; + } + } + num289++; + } + } + for (int num292 = 0; num292 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05); num292++) + { + float num293 = (float)((double)num292 / ((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[26], + " ", + (int)(num293 * 100f + 1f), + "%" + }); + bool flag20 = false; + int num294 = 0; + while (!flag20) + { + int num295 = WorldGen.genRand.Next(1, Main.maxTilesX); + int num296 = (int)(num6 + 20.0); + int style = 0; + if (WorldGen.crimson) + { + style = 1; + } + WorldGen.Place3x2(num295, num296, 26, style); + if (Main.tile[num295, num296].type == 26) + { + flag20 = true; + } + else + { + num294++; + if (num294 >= 10000) + { + flag20 = true; + } + } + } + } + for (int num297 = 0; num297 < Main.maxTilesX; num297++) + { + num49 = num297; + int num298 = (int)WorldGen.worldSurfaceLow; + while ((double)num298 < Main.worldSurface - 1.0) + { + if (Main.tile[num49, num298].active()) + { + if (Main.tile[num49, num298].type == 60) + { + Main.tile[num49, num298 - 1].liquid = 255; + Main.tile[num49, num298 - 2].liquid = 255; + break; + } + break; + } + else + { + num298++; + } + } + } + for (int num299 = 400; num299 < Main.maxTilesX - 400; num299++) + { + num49 = num299; + int num300 = (int)WorldGen.worldSurfaceLow; + while ((double)num300 < Main.worldSurface - 1.0) + { + if (Main.tile[num49, num300].active()) + { + if (Main.tile[num49, num300].type == 53) + { + int num301 = num300; + while ((double)num301 > WorldGen.worldSurfaceLow) + { + num301--; + Main.tile[num49, num301].liquid = 0; + } + break; + } + break; + } + else + { + num300++; + } + } + } + Main.tileSolid[192] = true; + Main.statusText = Lang.gen[70]; + bool flag21 = true; + while (flag21) + { + int num302 = WorldGen.genRand.Next((int)Main.rockLayer, Main.maxTilesY - 500); + int num303; + if (num9 < 0) + { + num303 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.6), (int)((double)Main.maxTilesX * 0.85)); + } + else + { + num303 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.15), (int)((double)Main.maxTilesX * 0.4)); + } + if (Main.tile[num303, num302].active() && Main.tile[num303, num302].type == 60) + { + flag21 = false; + WorldGen.makeTemple(num303, num302); + } + } + int num304 = 0; + int[] array7 = new int[50]; + int[] array8 = new int[50]; + Main.statusText = Lang.gen[71]; + for (int num305 = 0; num305 < WorldGen.numHives; num305++) + { + bool flag22 = false; + int num306 = WorldGen.HiveX[num305]; + int num307 = WorldGen.HiveY[num305]; + int num308 = 150; + for (int num309 = num306 - num308; num309 < num306 + num308; num309 += 10) + { + if (num309 > 0 && num309 <= Main.maxTilesX - 1) + { + for (int num310 = num307 - num308; num310 < num307 + num308; num310 += 10) + { + if (num310 > 0 && num310 <= Main.maxTilesY - 1) + { + if (Main.tile[num309, num310].active() && Main.tile[num309, num310].type == 226) + { + flag22 = true; + break; + } + if (Main.tile[num309, num310].wall == 87 || Main.tile[num309, num310].wall == 3 || Main.tile[num309, num310].wall == 83) + { + flag22 = true; + break; + } + } + } + } + } + if (!flag22) + { + int num311 = WorldGen.HiveX[num305]; + int num312 = WorldGen.HiveY[num305]; + int num313 = 0; + int[] array9 = new int[10]; + int[] array10 = new int[10]; + Vector2 vector = new Vector2((float)num311, (float)num312); + Vector2 vector2 = vector; + int num314 = WorldGen.genRand.Next(2, 5); + for (int num315 = 0; num315 < num314; num315++) + { + int num316 = WorldGen.genRand.Next(2, 5); + for (int num317 = 0; num317 < num316; num317++) + { + vector2 = WorldGen.Hive((int)vector.X, (int)vector.Y); + } + vector = vector2; + array9[num313] = (int)vector.X; + array10[num313] = (int)vector.Y; + num313++; + } + for (int num318 = 0; num318 < num313; num318++) + { + int num319 = array9[num318]; + int num320 = array10[num318]; + bool flag23 = false; + int num321 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num321 = -1; + } + while (!Main.tile[num319, num320].active() || !Main.tile[num319, num320 + 1].active() || !Main.tile[num319 + 1, num320].active() || !Main.tile[num319 + 1, num320 + 1].active()) + { + num319 += num321; + if (Math.Abs(num319 - array9[num318]) > 50) + { + flag23 = true; + break; + } + } + if (!flag23) + { + num319 += num321; + for (int num322 = num319 - 1; num322 <= num319 + 2; num322++) + { + for (int num323 = num320 - 1; num323 <= num320 + 2; num323++) + { + if (Main.tile[num322, num323].active() && Main.tile[num322, num323].type != 225) + { + flag23 = true; + break; + } + } + } + if (!flag23) + { + for (int num324 = num319 - 1; num324 <= num319 + 2; num324++) + { + for (int num325 = num320 - 1; num325 <= num320 + 2; num325++) + { + if (num324 >= num319 && num324 <= num319 + 1 && num325 >= num320 && num325 <= num320 + 1) + { + Main.tile[num324, num325].active(false); + Main.tile[num324, num325].liquid = 255; + Main.tile[num324, num325].honey(true); + } + else + { + Main.tile[num324, num325].active(true); + Main.tile[num324, num325].type = 225; + } + } + } + num321 *= -1; + num320++; + int num326 = 0; + while ((num326 < 4 || WorldGen.SolidTile(num319, num320)) && num319 > 10 && num319 < Main.maxTilesX - 10) + { + num326++; + num319 += num321; + if (WorldGen.SolidTile(num319, num320)) + { + WorldGen.PoundTile(num319, num320); + if (!Main.tile[num319, num320 + 1].active()) + { + Main.tile[num319, num320 + 1].active(true); + Main.tile[num319, num320 + 1].type = 225; + } + } + } + } + } + } + array7[num304] = (int)vector.X; + array8[num304] = (int)vector.Y; + num304++; + int num327 = (int)vector.X; + int num328 = (int)vector.Y; + for (int num329 = num327 - 1; num329 <= num327 + 1; num329++) + { + for (int num330 = num328 - 2; num330 <= num328 + 1; num330++) + { + if (num330 != num328 + 1) + { + Main.tile[num329, num330].active(false); + } + else + { + Main.tile[num329, num330].active(true); + Main.tile[num329, num330].type = 225; + Main.tile[num329, num330].slope(0); + Main.tile[num329, num330].halfBrick(false); + } + } + } + } + } + int num331 = WorldGen.genRand.Next(40, Main.maxTilesX - 40); + int num332 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 400); + float num333 = (float)WorldGen.genRand.Next(7, 12); + num333 *= (float)(Main.maxTilesX / 4200); + int num334 = 0; + while ((float)num334 < num333) + { + bool flag24 = true; + while (flag24) + { + num331 = WorldGen.genRand.Next(40, Main.maxTilesX / 2 - 40); + if (num9 < 0) + { + num331 += Main.maxTilesX / 2; + } + num332 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 400); + if (Main.tile[num331, num332].type == 60) + { + int num335 = 30; + flag24 = false; + for (int num336 = num331 - num335; num336 < num331 + num335; num336 += 3) + { + for (int num337 = num332 - num335; num337 < num332 + num335; num337 += 3) + { + if (Main.tile[num336, num337].active() && (Main.tile[num336, num337].type == 225 || Main.tile[num336, num337].type == 229 || Main.tile[num336, num337].type == 226 || Main.tile[num336, num337].type == 119 || Main.tile[num336, num337].type == 120)) + { + flag24 = false; + } + if (Main.tile[num336, num337].wall == 86 || Main.tile[num336, num337].wall == 87) + { + flag24 = false; + } + } + } + } + if (!flag24) + { + int num338 = WorldGen.genRand.Next(2, 4); + int num339 = WorldGen.genRand.Next(2, 4); + int num340 = 0; + if (num == 119) + { + num340 = 23; + } + else + { + if (num == 120) + { + num340 = 24; + } + else + { + if (num == 158) + { + num340 = 42; + } + else + { + if (num == 175) + { + num340 = 45; + } + else + { + if (num == 45) + { + num340 = 10; + } + } + } + } + } + for (int num341 = num331 - num338 - 1; num341 <= num331 + num338 + 1; num341++) + { + for (int num342 = num332 - num339 - 1; num342 <= num332 + num339 + 1; num342++) + { + Main.tile[num341, num342].active(true); + Main.tile[num341, num342].type = (byte)num; + Main.tile[num341, num342].liquid = 0; + Main.tile[num341, num342].lava(false); + } + } + for (int num343 = num331 - num338; num343 <= num331 + num338; num343++) + { + for (int num344 = num332 - num339; num344 <= num332 + num339; num344++) + { + Main.tile[num343, num344].active(false); + Main.tile[num343, num344].wall = (byte)num340; + } + } + bool flag25 = false; + int num345 = 0; + while (!flag25 && num345 < 100) + { + num345++; + int num346 = WorldGen.genRand.Next(num331 - num338, num331 + num338 + 1); + int num347 = WorldGen.genRand.Next(num332 - num339, num332 + num339 - 2); + WorldGen.PlaceTile(num346, num347, 4, true, false, -1, 3); + if (Main.tile[num346, num347].type == 4) + { + flag25 = true; + } + } + for (int num348 = num331 - num338 - 1; num348 <= num331 + num338 + 1; num348++) + { + for (int num349 = num332 + num339 - 2; num349 <= num332 + num339; num349++) + { + Main.tile[num348, num349].active(false); + } + } + for (int num350 = num331 - num338 - 1; num350 <= num331 + num338 + 1; num350++) + { + for (int num351 = num332 + num339 - 2; num351 <= num332 + num339 - 1; num351++) + { + Main.tile[num350, num351].active(false); + } + } + for (int num352 = num331 - num338 - 1; num352 <= num331 + num338 + 1; num352++) + { + int num353 = 4; + int num354 = num332 + num339 + 2; + while (!Main.tile[num352, num354].active() && num354 < Main.maxTilesY && num353 > 0) + { + Main.tile[num352, num354].active(true); + Main.tile[num352, num354].type = 59; + num354++; + num353--; + } + } + num338 -= WorldGen.genRand.Next(1, 3); + int num355 = num332 - num339 - 2; + while (num338 > -1) + { + for (int num356 = num331 - num338 - 1; num356 <= num331 + num338 + 1; num356++) + { + Main.tile[num356, num355].active(true); + Main.tile[num356, num355].type = (byte)num; + } + num338 -= WorldGen.genRand.Next(1, 3); + num355--; + } + WorldGen.JChestX[WorldGen.numJChests] = num331; + WorldGen.JChestY[WorldGen.numJChests] = num332; + WorldGen.numJChests++; + } + } + num334++; + } + Main.tileSolid[137] = false; + for (int num357 = 20; num357 < Main.maxTilesX - 20; num357++) + { + float num358 = (float)num357 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[60], + " ", + (int)(num358 * 100f + 1f), + "%" + }); + for (int num359 = 20; num359 < Main.maxTilesY - 20; num359++) + { + if (!Main.tile[num357, num359 - 1].active() && Main.tile[num357, num359].type != 48 && Main.tile[num357, num359].type != 137 && Main.tile[num357, num359].type != 232 && Main.tile[num357, num359].type != 191 && Main.tile[num357, num359].type != 151) + { + if (WorldGen.SolidTile(num357, num359)) + { + if (!Main.tile[num357 - 1, num359].halfBrick() && !Main.tile[num357 + 1, num359].halfBrick() && Main.tile[num357 - 1, num359].slope() == 0 && Main.tile[num357 + 1, num359].slope() == 0) + { + if (WorldGen.SolidTile(num357, num359 + 1)) + { + if (!WorldGen.SolidTile(num357 - 1, num359) && !Main.tile[num357 - 1, num359 + 1].halfBrick() && WorldGen.SolidTile(num357 - 1, num359 + 1) && WorldGen.SolidTile(num357 + 1, num359) && !Main.tile[num357 + 1, num359 - 1].active()) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.SlopeTile(num357, num359, 2); + } + else + { + WorldGen.PoundTile(num357, num359); + } + } + else + { + if (!WorldGen.SolidTile(num357 + 1, num359) && !Main.tile[num357 + 1, num359 + 1].halfBrick() && WorldGen.SolidTile(num357 + 1, num359 + 1) && WorldGen.SolidTile(num357 - 1, num359) && !Main.tile[num357 - 1, num359 - 1].active()) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.SlopeTile(num357, num359, 1); + } + else + { + WorldGen.PoundTile(num357, num359); + } + } + else + { + if (WorldGen.SolidTile(num357 + 1, num359 + 1) && WorldGen.SolidTile(num357 - 1, num359 + 1) && !Main.tile[num357 + 1, num359].active() && !Main.tile[num357 - 1, num359].active()) + { + WorldGen.PoundTile(num357, num359); + } + } + } + if (WorldGen.SolidTile(num357, num359)) + { + if (WorldGen.SolidTile(num357 - 1, num359) && WorldGen.SolidTile(num357 + 1, num359 + 2) && !Main.tile[num357 + 1, num359].active() && !Main.tile[num357 + 1, num359 + 1].active() && !Main.tile[num357 - 1, num359 - 1].active()) + { + WorldGen.KillTile(num357, num359, false, false, false); + } + else + { + if (WorldGen.SolidTile(num357 + 1, num359) && WorldGen.SolidTile(num357 - 1, num359 + 2) && !Main.tile[num357 - 1, num359].active() && !Main.tile[num357 - 1, num359 + 1].active() && !Main.tile[num357 + 1, num359 - 1].active()) + { + WorldGen.KillTile(num357, num359, false, false, false); + } + else + { + if (!Main.tile[num357 - 1, num359 + 1].active() && !Main.tile[num357 - 1, num359].active() && WorldGen.SolidTile(num357 + 1, num359) && WorldGen.SolidTile(num357, num359 + 2)) + { + if (WorldGen.genRand.Next(5) == 0) + { + WorldGen.KillTile(num357, num359, false, false, false); + } + else + { + if (WorldGen.genRand.Next(5) == 0) + { + WorldGen.PoundTile(num357, num359); + } + else + { + WorldGen.SlopeTile(num357, num359, 2); + } + } + } + else + { + if (!Main.tile[num357 + 1, num359 + 1].active() && !Main.tile[num357 + 1, num359].active() && WorldGen.SolidTile(num357 - 1, num359) && WorldGen.SolidTile(num357, num359 + 2)) + { + if (WorldGen.genRand.Next(5) == 0) + { + WorldGen.KillTile(num357, num359, false, false, false); + } + else + { + if (WorldGen.genRand.Next(5) == 0) + { + WorldGen.PoundTile(num357, num359); + } + else + { + WorldGen.SlopeTile(num357, num359, 1); + } + } + } + } + } + } + } + } + if (WorldGen.SolidTile(num357, num359) && !Main.tile[num357 - 1, num359].active() && !Main.tile[num357 + 1, num359].active()) + { + WorldGen.KillTile(num357, num359, false, false, false); + } + } + } + else + { + if (!Main.tile[num357, num359].active() && Main.tile[num357, num359 + 1].type != 151) + { + if (Main.tile[num357 + 1, num359].type != 190 && Main.tile[num357 + 1, num359].type != 48 && Main.tile[num357 + 1, num359].type != 232 && WorldGen.SolidTile(num357 - 1, num359 + 1) && WorldGen.SolidTile(num357 + 1, num359) && !Main.tile[num357 - 1, num359].active() && !Main.tile[num357 + 1, num359 - 1].active()) + { + WorldGen.PlaceTile(num357, num359, (int)Main.tile[num357, num359 + 1].type, false, false, -1, 0); + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.SlopeTile(num357, num359, 2); + } + else + { + WorldGen.PoundTile(num357, num359); + } + } + if (Main.tile[num357 - 1, num359].type != 190 && Main.tile[num357 - 1, num359].type != 48 && Main.tile[num357 - 1, num359].type != 232 && WorldGen.SolidTile(num357 + 1, num359 + 1) && WorldGen.SolidTile(num357 - 1, num359) && !Main.tile[num357 + 1, num359].active() && !Main.tile[num357 - 1, num359 - 1].active()) + { + WorldGen.PlaceTile(num357, num359, (int)Main.tile[num357, num359 + 1].type, false, false, -1, 0); + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.SlopeTile(num357, num359, 1); + } + else + { + WorldGen.PoundTile(num357, num359); + } + } + } + } + } + } + } + for (int num360 = 20; num360 < Main.maxTilesX - 20; num360++) + { + for (int num361 = 20; num361 < Main.maxTilesY - 20; num361++) + { + if (WorldGen.genRand.Next(2) == 0 && !Main.tile[num360, num361 - 1].active() && Main.tile[num360, num361].type != 137 && Main.tile[num360, num361].type != 48 && Main.tile[num360, num361].type != 232 && Main.tile[num360, num361].type != 191 && Main.tile[num360, num361].type != 151 && Main.tile[num360, num361].type != 75 && Main.tile[num360, num361].type != 76 && WorldGen.SolidTile(num360, num361) && Main.tile[num360 - 1, num361].type != 137 && Main.tile[num360 + 1, num361].type != 137) + { + if (WorldGen.SolidTile(num360, num361 + 1) && WorldGen.SolidTile(num360 + 1, num361) && !Main.tile[num360 - 1, num361].active()) + { + WorldGen.SlopeTile(num360, num361, 2); + } + if (WorldGen.SolidTile(num360, num361 + 1) && WorldGen.SolidTile(num360 - 1, num361) && !Main.tile[num360 + 1, num361].active()) + { + WorldGen.SlopeTile(num360, num361, 1); + } + } + if (Main.tile[num360, num361].slope() == 1 && !WorldGen.SolidTile(num360 - 1, num361)) + { + WorldGen.SlopeTile(num360, num361, 0); + WorldGen.PoundTile(num360, num361); + } + if (Main.tile[num360, num361].slope() == 2 && !WorldGen.SolidTile(num360 + 1, num361)) + { + WorldGen.SlopeTile(num360, num361, 0); + WorldGen.PoundTile(num360, num361); + } + } + } + for (int num362 = 20; num362 < Main.maxTilesX - 20; num362++) + { + for (int num363 = 20; num363 < Main.maxTilesY - 20; num363++) + { + if (Main.tile[num362, num363].slope() != 0 || Main.tile[num362, num363].halfBrick()) + { + if (!Main.tile[num362, num363 + 1].active()) + { + Main.tile[num362, num363].active(false); + } + if (Main.tile[num362 + 1, num363].type == 137 || Main.tile[num362 - 1, num363].type == 137) + { + Main.tile[num362, num363].active(false); + } + } + } + } + Main.tileSolid[137] = true; + Main.tileSolid[190] = false; + Main.tileSolid[192] = false; + Liquid.QuickWater(3, -1, -1); + WorldGen.WaterCheck(); + int num364 = 0; + Liquid.quickSettle = true; + while (num364 < 10) + { + int num365 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + num364++; + float num366 = 0f; + while (Liquid.numLiquid > 0) + { + float num367 = (float)(num365 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float)num365; + if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num365) + { + num365 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + } + if (num367 > num366) + { + num366 = num367; + } + else + { + num367 = num366; + } + if (num364 == 1) + { + Main.statusText = string.Concat(new object[] + { + Lang.gen[27], + " ", + (int)(num367 * 100f / 3f + 33f), + "%" + }); + } + int num368 = 10; + if (num364 > num368) + { + } + Liquid.UpdateLiquid(); + } + WorldGen.WaterCheck(); + Main.statusText = string.Concat(new object[] + { + Lang.gen[27], + " ", + (int)((float)num364 * 10f / 3f + 66f), + "%" + }); + } + Liquid.quickSettle = false; + Main.tileSolid[190] = true; + for (int num369 = 20; num369 < Main.maxTilesX - 20; num369++) + { + float num370 = (float)num369 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[69], + " ", + (int)(num370 * 50f + 1f), + "%" + }); + for (int num371 = 20; num371 < Main.maxTilesY - 20; num371++) + { + if (WorldGen.SolidTile(num369, num371) && !Main.tile[num369 - 1, num371].active() && WorldGen.SolidTile(num369, num371 + 1) && !Main.tile[num369 + 1, num371].active() && (Main.tile[num369 - 1, num371].liquid > 0 || Main.tile[num369 + 1, num371].liquid > 0)) + { + bool flag26 = true; + int num372 = Main.rand.Next(8, 20); + int num373 = Main.rand.Next(8, 20); + num372 = num371 - num372; + num373 += num371; + for (int num374 = num372; num374 <= num373; num374++) + { + if (Main.tile[num369, num374].halfBrick()) + { + flag26 = false; + } + } + if ((Main.tile[num369, num371].type == 75 || Main.tile[num369, num371].type == 76) && WorldGen.genRand.Next(10) != 0) + { + flag26 = false; + } + if (flag26) + { + WorldGen.PoundTile(num369, num371); + } + } + } + } + for (int num375 = 20; num375 < Main.maxTilesX - 20; num375++) + { + float num376 = (float)num375 / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[69], + " ", + (int)(num376 * 50f + 51f), + "%" + }); + for (int num377 = 20; num377 < Main.maxTilesY - 20; num377++) + { + if (Main.tile[num375, num377].type != 48 && Main.tile[num375, num377].type != 232 && WorldGen.SolidTile(num375, num377) && WorldGen.SolidTile(num375, num377 + 1)) + { + if (!WorldGen.SolidTile(num375 + 1, num377) && Main.tile[num375 - 1, num377].halfBrick() && Main.tile[num375 - 2, num377].liquid > 0) + { + WorldGen.PoundTile(num375, num377); + } + if (!WorldGen.SolidTile(num375 - 1, num377) && Main.tile[num375 + 1, num377].halfBrick() && Main.tile[num375 + 2, num377].liquid > 0) + { + WorldGen.PoundTile(num375, num377); + } + } + } + } + for (int num378 = 10; num378 < Main.maxTilesX - 10; num378++) + { + for (int num379 = (int)Main.worldSurface; num379 < Main.maxTilesY - 100; num379++) + { + if (Main.tile[num378, num379].liquid > 0 && !Main.tile[num378, num379].lava()) + { + WorldGen.MakeWateryIceThing(num378, num379); + } + } + } + Main.tileSolid[226] = false; + Main.tileSolid[162] = false; + float num380 = (float)(Main.maxTilesX / 4200); + for (int num381 = 0; num381 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05); num381++) + { + float num382 = (float)((double)num381 / ((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[28], + " ", + (int)(num382 * 100f + 1f), + "%" + }); + bool flag27 = false; + int num383 = 0; + while (!flag27) + { + if (WorldGen.AddLifeCrystal(WorldGen.genRand.Next(1, Main.maxTilesX), WorldGen.genRand.Next((int)(num6 + 20.0), Main.maxTilesY - 300))) + { + flag27 = true; + } + else + { + num383++; + if (num383 >= 10000) + { + flag27 = true; + } + } + } + } + Main.tileSolid[225] = false; + int num384 = 0; + int num385 = 0; + while ((float)num385 < 82f * num380) + { + if (num384 > 41) + { + num384 = 0; + } + float num386 = (float)num385 / (200f * num380); + Main.statusText = string.Concat(new object[] + { + Lang.gen[29], + " ", + (int)(num386 * 100f + 1f), + "%" + }); + bool flag28 = false; + int num387 = 0; + while (!flag28) + { + int num388 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num389 = WorldGen.genRand.Next((int)(num6 + 20.0), Main.maxTilesY - 300); + while (!Main.tile[num388, num389].active()) + { + num389++; + } + num389--; + WorldGen.PlaceTile(num388, num389, 105, true, true, -1, num384); + if (Main.tile[num388, num389].active() && Main.tile[num388, num389].type == 105) + { + flag28 = true; + num384++; + } + else + { + num387++; + if (num387 >= 10000) + { + flag28 = true; + } + } + } + num385++; + } + for (int num390 = 0; num390 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 1.6E-05); num390++) + { + float num391 = (float)((double)num390 / ((double)(Main.maxTilesX * Main.maxTilesY) * 1.6E-05)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[30], + " ", + (int)(num391 * 100f + 1f), + "%" + }); + bool flag29 = false; + int num392 = 0; + while (!flag29) + { + int num393 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num394 = WorldGen.genRand.Next((int)(num6 + 20.0), Main.maxTilesY - 230); + if ((float)num390 <= 3f * num380) + { + num394 = WorldGen.genRand.Next(Main.maxTilesY - 200, Main.maxTilesY - 50); + } + int num395 = 0; + while (Main.wallDungeon[(int)Main.tile[num393, num394].wall]) + { + num395++; + num393 = WorldGen.genRand.Next(1, Main.maxTilesX); + num394 = WorldGen.genRand.Next((int)(num6 + 20.0), Main.maxTilesY - 230); + if (num395 < 1000 && (float)num390 <= 3f * num380) + { + num394 = WorldGen.genRand.Next(Main.maxTilesY - 200, Main.maxTilesY - 50); + } + } + if (WorldGen.AddBuriedChest(num393, num394, 0, false, -1)) + { + flag29 = true; + if (WorldGen.genRand.Next(2) == 0) + { + int num396 = num394; + while (Main.tile[num393, num396].type != 21 && num396 < Main.maxTilesY - 300) + { + num396++; + } + if (num394 < Main.maxTilesY - 300) + { + WorldGen.MineHouse(num393, num396); + } + } + } + num392++; + if (num392 >= 1000) + { + flag29 = true; + } + } + } + for (int num397 = 0; num397 < (int)((double)Main.maxTilesX * 0.005); num397++) + { + float num398 = (float)((double)num397 / ((double)Main.maxTilesX * 0.005)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[31], + " ", + (int)(num398 * 100f + 1f), + "%" + }); + bool flag30 = false; + int num399 = 0; + while (!flag30) + { + int num400 = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + int num401 = WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, (int)Main.worldSurface); + bool flag31 = false; + if (Main.tile[num400, num401].wall == 2 && !Main.tile[num400, num401].active()) + { + flag31 = true; + } + if (flag31 && WorldGen.AddBuriedChest(num400, num401, 0, true, -1)) + { + flag30 = true; + } + else + { + num399++; + if (num399 >= 2000) + { + flag30 = true; + } + } + } + } + int num402 = 0; + for (int num403 = 0; num403 < WorldGen.numJChests; num403++) + { + float num404 = (float)(num403 / WorldGen.numJChests); + Main.statusText = string.Concat(new object[] + { + Lang.gen[32], + " ", + (int)(num404 * 100f + 1f), + "%" + }); + num402++; + int contain = 211; + if (num402 == 1) + { + contain = 211; + } + else + { + if (num402 == 2) + { + contain = 212; + } + else + { + if (num402 == 3) + { + contain = 213; + } + else + { + if (num402 == 4) + { + contain = 964; + } + } + } + } + if (Main.rand.Next(50) == 0) + { + contain = 753; + } + if (num402 > 4) + { + num402 = 0; + } + if (!WorldGen.AddBuriedChest(WorldGen.JChestX[num403] + WorldGen.genRand.Next(2), WorldGen.JChestY[num403], contain, false, 10)) + { + for (int num405 = WorldGen.JChestX[num403]; num405 <= WorldGen.JChestX[num403] + 1; num405++) + { + for (int num406 = WorldGen.JChestY[num403]; num406 <= WorldGen.JChestY[num403] + 1; num406++) + { + WorldGen.KillTile(num405, num406, false, false, false); + } + } + for (int num407 = WorldGen.JChestX[num403]; num407 <= WorldGen.JChestX[num403] + 1; num407++) + { + for (int num408 = WorldGen.JChestY[num403]; num408 <= WorldGen.JChestY[num403] + 3; num408++) + { + if (num408 < Main.maxTilesY) + { + Main.tile[num407, num408].slope(0); + Main.tile[num407, num408].halfBrick(false); + } + } + } + WorldGen.AddBuriedChest(WorldGen.JChestX[num403], WorldGen.JChestY[num403], contain, false, 10); + } + } + int num409 = 0; + int num410 = 0; + while ((float)num410 < 9f * num380) + { + float num411 = (float)num410 / (9f * num380); + Main.statusText = string.Concat(new object[] + { + Lang.gen[33], + " ", + (int)(num411 * 100f + 1f), + "%" + }); + num409++; + int contain2; + if (WorldGen.genRand.Next(15) == 0) + { + contain2 = 863; + } + else + { + if (num409 == 1) + { + contain2 = 186; + } + else + { + if (num409 == 2) + { + contain2 = 277; + } + else + { + if (num409 == 3) + { + contain2 = 859; + } + else + { + contain2 = 187; + num409 = 0; + } + } + } + } + bool flag32 = false; + while (!flag32) + { + int num412 = WorldGen.genRand.Next(1, Main.maxTilesX); + int num413 = WorldGen.genRand.Next(1, Main.maxTilesY - 200); + while (Main.tile[num412, num413].liquid < 200 || Main.tile[num412, num413].lava()) + { + num412 = WorldGen.genRand.Next(1, Main.maxTilesX); + num413 = WorldGen.genRand.Next(1, Main.maxTilesY - 200); + } + flag32 = WorldGen.AddBuriedChest(num412, num413, contain2, false, 17); + } + flag32 = false; + while (!flag32) + { + int num414 = WorldGen.genRand.Next(1, Main.maxTilesX); + int num415 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY - 200); + while (Main.tile[num414, num415].liquid < 200 || Main.tile[num414, num415].lava()) + { + num414 = WorldGen.genRand.Next(1, Main.maxTilesX); + num415 = WorldGen.genRand.Next(1, Main.maxTilesY - 200); + } + flag32 = WorldGen.AddBuriedChest(num414, num415, contain2, false, 17); + } + num410++; + } + WorldGen.maxTileCount = 3500; + for (int num416 = 0; num416 < (int)((double)Main.maxTilesX * 0.005); num416++) + { + float num417 = (float)((double)num416 / ((double)Main.maxTilesX * 0.005)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[64], + " ", + (int)(num417 * 100f + 1f), + "%" + }); + int num418 = 0; + int x2 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + int y2 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 230); + int num419 = WorldGen.countTiles(x2, y2, false, true); + while ((num419 >= 3500 || num419 < 500) && num418 < 500) + { + num418++; + x2 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + y2 = WorldGen.genRand.Next((int)Main.rockLayer + 30, Main.maxTilesY - 230); + num419 = WorldGen.countTiles(x2, y2, false, true); + } + if (num418 < 500) + { + WorldGen.spiderOut(x2, y2); + } + } + Main.tileSolid[162] = true; + WorldGen.maxTileCount = 300; + for (int num420 = 0; num420 < (int)((double)Main.maxTilesX * 0.003); num420++) + { + float num421 = (float)((double)num420 / ((double)Main.maxTilesX * 0.003)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[62], + " ", + (int)(num421 * 100f + 1f), + "%" + }); + int num422 = 0; + int x3 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + int y3 = WorldGen.genRand.Next((int)Main.rockLayer + 30, Main.maxTilesY - 230); + int num423 = WorldGen.countTiles(x3, y3, false, false); + while ((num423 >= 300 || num423 < 50 || WorldGen.lavaCount > 0 || WorldGen.iceCount > 0 || WorldGen.rockCount == 0) && num422 < 1000) + { + num422++; + x3 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + y3 = WorldGen.genRand.Next((int)Main.rockLayer + 30, Main.maxTilesY - 230); + num423 = WorldGen.countTiles(x3, y3, false, false); + } + if (num422 < 1000) + { + WorldGen.gemCave(x3, y3); + } + } + WorldGen.randMoss(); + WorldGen.maxTileCount = 2500; + for (int num424 = 0; num424 < (int)((double)Main.maxTilesX * 0.01); num424++) + { + float num425 = (float)((double)num424 / ((double)Main.maxTilesX * 0.01)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[61], + " ", + (int)(num425 * 100f + 1f), + "%" + }); + int num426 = 0; + int x4 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + int y4 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, WorldGen.waterLine); + int num427 = WorldGen.countTiles(x4, y4, false, false); + while ((num427 >= 2500 || num427 < 10 || WorldGen.lavaCount > 0 || WorldGen.iceCount > 0 || WorldGen.rockCount == 0) && num426 < 1000) + { + num426++; + x4 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + y4 = WorldGen.genRand.Next((int)Main.rockLayer + 30, Main.maxTilesY - 230); + num427 = WorldGen.countTiles(x4, y4, false, false); + } + if (num426 < 1000) + { + WorldGen.setMoss(x4, y4); + WorldGen.mossCave(x4, y4); + } + } + for (int num428 = 0; num428 < Main.maxTilesX; num428++) + { + int num429 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); + int num430 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, WorldGen.lavaLine); + if (Main.tile[num429, num430].type == 1) + { + WorldGen.setMoss(num429, num430); + Main.tile[num429, num430].type = WorldGen.mossTile; + } + } + int num431 = (int)((double)Main.maxTilesX * 0.05); + while (num431 > 0) + { + int num432 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); + int num433 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, WorldGen.lavaLine); + if (Main.tile[num432, num433].type == 1 && (!Main.tile[num432 - 1, num433].active() || !Main.tile[num432 + 1, num433].active() || !Main.tile[num432, num433 - 1].active() || !Main.tile[num432, num433 + 1].active())) + { + WorldGen.setMoss(num432, num433); + Main.tile[num432, num433].type = WorldGen.mossTile; + num431--; + } + } + for (int num434 = 0; num434 < Main.maxTilesX; num434++) + { + for (int num435 = 0; num435 < Main.maxTilesY; num435++) + { + if (Main.tile[num434, num435].active() && Main.tileMoss[(int)Main.tile[num434, num435].type]) + { + for (int num436 = 0; num436 < 4; num436++) + { + int num437 = num434; + int num438 = num435; + if (num436 == 0) + { + num437--; + } + if (num436 == 1) + { + num437++; + } + if (num436 == 2) + { + num438--; + } + if (num436 == 3) + { + num438++; + } + try + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num437, num438, 1, (int)Main.tile[num434, num435].type, true, 0); + } + catch + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num437, num438, 1, (int)Main.tile[num434, num435].type, false, 0); + } + } + } + } + } + Main.tileSolid[162] = false; + Main.tileSolid[226] = true; + WorldGen.templePart2(); + Main.tileSolid[232] = false; + WorldGen.maxTileCount = 1500; + for (int num439 = 0; num439 < (int)((double)Main.maxTilesX * 0.04); num439++) + { + float num440 = (float)((double)num439 / ((double)Main.maxTilesX * 0.04)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[63], + " ", + (int)(num440 * 66f + 1f), + "%" + }); + int num441 = 0; + int x5 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + int y5 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 220); + int num442 = WorldGen.countTiles(x5, y5, false, true); + while ((num442 >= 1500 || num442 < 10) && num441 < 500) + { + num441++; + x5 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + y5 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 220); + num442 = WorldGen.countTiles(x5, y5, false, true); + } + if (num441 < 500) + { + int num443 = WorldGen.genRand.Next(2); + if (WorldGen.iceCount > 0) + { + if (num443 == 0) + { + num443 = 40; + } + else + { + if (num443 == 1) + { + num443 = 71; + } + } + } + else + { + if (WorldGen.lavaCount > 0) + { + num443 = 79; + } + else + { + if (num443 == 0) + { + num443 = 59; + } + else + { + if (num443 == 1) + { + num443 = 61; + } + } + } + } + WorldGen.wallOut(x5, y5, num443); + } + } + WorldGen.maxTileCount = 1500; + for (int num444 = 0; num444 < (int)((double)Main.maxTilesX * 0.02); num444++) + { + float num445 = (float)((double)num444 / ((double)Main.maxTilesX * 0.02)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[63], + " ", + (int)(num445 * 33f + 67f), + "%" + }); + int num446 = 0; + int num447 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + int num448 = WorldGen.genRand.Next((int)Main.worldSurface, WorldGen.lavaLine); + int num449 = 0; + if (Main.tile[num447, num448].wall == 64) + { + num449 = WorldGen.countTiles(num447, num448, true, false); + } + while ((num449 >= 1500 || num449 < 10) && num446 < 1000) + { + num446++; + num447 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + num448 = WorldGen.genRand.Next((int)Main.worldSurface, WorldGen.lavaLine); + if (!Main.wallHouse[(int)Main.tile[num447, num448].wall]) + { + if (Main.tile[num447, num448].wall == 64) + { + num449 = WorldGen.countTiles(num447, num448, true, false); + } + else + { + num449 = 0; + } + } + } + if (num446 < 1000) + { + WorldGen.numWallOut2 = 0; + WorldGen.wallOut2(num447, num448, 15); + } + } + for (int num450 = 0; num450 < Main.maxTilesX; num450++) + { + for (int num451 = (int)Main.worldSurface - 1; num451 < Main.maxTilesY - 350; num451++) + { + if (WorldGen.genRand.Next(10) == 0) + { + WorldGen.GrowUndergroundTree(num450, num451); + } + } + } + for (int num452 = 0; num452 < WorldGen.numIslandHouses; num452++) + { + WorldGen.IslandHouse(WorldGen.fihX[num452], WorldGen.fihY[num452]); + } + for (int num453 = 0; num453 < (int)((double)Main.maxTilesX * 0.05); num453++) + { + float num454 = (float)((double)num453 / ((double)Main.maxTilesX * 0.05)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[34], + " ", + (int)(num454 * 100f + 1f), + "%" + }); + for (int num455 = 0; num455 < 1000; num455++) + { + int num456 = Main.rand.Next(200, Main.maxTilesX - 200); + int num457 = Main.rand.Next((int)Main.worldSurface, Main.maxTilesY - 300); + if (Main.tile[num456, num457].wall == 0 && WorldGen.placeTrap(num456, num457, -1)) + { + break; + } + } + } + for (int num458 = 0; num458 < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008); num458++) + { + float num459 = (float)((double)num458 / ((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[35], + " ", + (int)(num459 * 100f + 1f), + "%" + }); + bool flag33 = false; + int num460 = 0; + while (!flag33) + { + int num461 = WorldGen.genRand.Next((int)num6, Main.maxTilesY - 10); + if ((double)num459 > 0.93) + { + num461 = Main.maxTilesY - 150; + } + else + { + if ((double)num459 > 0.75) + { + num461 = (int)WorldGen.worldSurfaceLow; + } + } + int num462 = WorldGen.genRand.Next(1, Main.maxTilesX); + bool flag34 = false; + for (int num463 = num461; num463 < Main.maxTilesY; num463++) + { + if (!flag34) + { + if (Main.tile[num462, num463].active() && Main.tileSolid[(int)Main.tile[num462, num463].type] && !Main.tile[num462, num463 - 1].lava()) + { + flag34 = true; + } + } + else + { + int style2 = WorldGen.genRand.Next(0, 4); + int num464 = 0; + if (num463 < Main.maxTilesY - 5) + { + num464 = (int)Main.tile[num462, num463 + 1].type; + } + if (num464 == 147 || num464 == 161 || num464 == 162) + { + style2 = WorldGen.genRand.Next(4, 7); + } + if (num464 == 60) + { + style2 = WorldGen.genRand.Next(7, 10); + } + if (Main.wallDungeon[(int)Main.tile[num462, num463].wall]) + { + style2 = WorldGen.genRand.Next(10, 13); + } + if (num464 == 41 || num464 == 43 || num464 == 44) + { + style2 = WorldGen.genRand.Next(10, 13); + } + if (num464 == 22 || num464 == 23 || num464 == 25) + { + style2 = WorldGen.genRand.Next(16, 19); + } + if (num464 == 199 || num464 == 203 || num464 == 204 || num464 == 200) + { + style2 = WorldGen.genRand.Next(22, 25); + } + if (num464 == 226) + { + style2 = WorldGen.genRand.Next(28, 31); + } + if (num463 > Main.maxTilesY - 200) + { + style2 = WorldGen.genRand.Next(13, 16); + } + if (WorldGen.PlacePot(num462, num463, 28, style2)) + { + flag33 = true; + break; + } + num460++; + if (num460 >= 10000) + { + flag33 = true; + break; + } + } + } + } + } + for (int num465 = 0; num465 < Main.maxTilesX / 200; num465++) + { + float num466 = (float)(num465 / (Main.maxTilesX / 200)); + Main.statusText = string.Concat(new object[] + { + Lang.gen[36], + " ", + (int)(num466 * 100f + 1f), + "%" + }); + bool flag35 = false; + int num467 = 0; + while (!flag35) + { + int num468 = WorldGen.genRand.Next(1, Main.maxTilesX); + int num469 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 5); + try + { + if (Main.tile[num468, num469].wall != 13) + { + if (Main.tile[num468, num469].wall != 14) + { + continue; + } + } + while (!Main.tile[num468, num469].active()) + { + num469++; + } + num469--; + WorldGen.PlaceTile(num468, num469, 77, false, false, -1, 0); + if (Main.tile[num468, num469].type == 77) + { + flag35 = true; + } + else + { + num467++; + if (num467 >= 10000) + { + flag35 = true; + } + } + } + catch + { + } + } + } + Main.statusText = Lang.gen[37]; + for (int num470 = 0; num470 < Main.maxTilesX; num470++) + { + num49 = num470; + bool flag36 = true; + int num471 = 0; + while ((double)num471 < Main.worldSurface - 1.0) + { + if (Main.tile[num49, num471].active()) + { + if (flag36 && Main.tile[num49, num471].type == 0) + { + try + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num49, num471, 0, 2, true, 0); + } + catch + { + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(num49, num471, 0, 2, false, 0); + } + } + if ((double)num471 > num6) + { + break; + } + flag36 = false; + } + else + { + if (Main.tile[num49, num471].wall == 0) + { + flag36 = true; + } + } + num471++; + } + } + Main.tileSolid[190] = false; + Main.tileSolid[196] = false; + Main.tileSolid[189] = false; + Main.tileSolid[202] = false; + int num472 = 0; + while ((double)num472 < (double)Main.maxTilesX * 0.06) + { + bool flag37 = false; + while (!flag37) + { + int num473 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num474 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY - 300); + if (!Main.tile[num473, num474].active()) + { + int num475 = 186; + while (!Main.tile[num473, num474 + 1].active() && num474 < Main.maxTilesY - 5) + { + num474++; + } + int num476 = WorldGen.genRand.Next(22); + if (num476 >= 16 && num476 <= 22) + { + num476 = WorldGen.genRand.Next(22); + } + if ((Main.tile[num473, num474 + 1].type == 0 || Main.tile[num473, num474 + 1].type == 1 || Main.tileMoss[(int)Main.tile[num473, num474 + 1].type]) && WorldGen.genRand.Next(5) == 0) + { + num476 = WorldGen.genRand.Next(23, 29); + num475 = 187; + } + if (num474 > Main.maxTilesY - 300 || Main.wallDungeon[(int)Main.tile[num473, num474].wall] || Main.tile[num473, num474 + 1].type == 30 || Main.tile[num473, num474 + 1].type == 19 || Main.tile[num473, num474 + 1].type == 25 || Main.tile[num473, num474 + 1].type == 203) + { + num476 = WorldGen.genRand.Next(7); + num475 = 186; + } + if (Main.tile[num473, num474 + 1].type == 147 || Main.tile[num473, num474 + 1].type == 161 || Main.tile[num473, num474 + 1].type == 162) + { + num476 = WorldGen.genRand.Next(26, 32); + num475 = 186; + } + if (Main.tile[num473, num474 + 1].type == 60) + { + num475 = 187; + num476 = WorldGen.genRand.Next(6); + } + if ((Main.tile[num473, num474 + 1].type == 57 || Main.tile[num473, num474 + 1].type == 58) && WorldGen.genRand.Next(3) < 2) + { + num475 = 187; + num476 = WorldGen.genRand.Next(6, 9); + } + if (Main.tile[num473, num474 + 1].type == 226) + { + num475 = 187; + num476 = WorldGen.genRand.Next(18, 23); + } + if (Main.tile[num473, num474 + 1].type == 70) + { + num476 = WorldGen.genRand.Next(32, 35); + num475 = 186; + } + if (num475 == 186 && num476 >= 7 && num476 <= 15 && WorldGen.genRand.Next(100) == 0) + { + num475 = 187; + num476 = 17; + } + if (Main.wallDungeon[(int)Main.tile[num473, num474].wall] && WorldGen.genRand.Next(3) != 0) + { + flag37 = true; + } + else + { + WorldGen.PlaceTile(num473, num474, num475, true, false, -1, num476); + if (Main.tile[num473, num474].type == 186 || Main.tile[num473, num474].type == 187) + { + flag37 = true; + } + if (flag37 && num475 == 186 && num476 <= 7) + { + int num477 = WorldGen.genRand.Next(1, 5); + for (int num478 = 0; num478 < num477; num478++) + { + int num479 = num473 + WorldGen.genRand.Next(-10, 11); + int num480 = num474 - WorldGen.genRand.Next(5); + if (!Main.tile[num479, num480].active()) + { + while (!Main.tile[num479, num480 + 1].active() && num480 < Main.maxTilesY - 5) + { + num480++; + } + int x6 = WorldGen.genRand.Next(12, 36); + WorldGen.PlaceSmallPile(num479, num480, x6, 0, 185); + } + } + } + } + } + } + num472++; + } + int num481 = 0; + while ((double)num481 < (double)Main.maxTilesX * 0.01) + { + bool flag38 = false; + while (!flag38) + { + int num482 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num483 = WorldGen.genRand.Next(Main.maxTilesY - 300, Main.maxTilesY - 10); + if (!Main.tile[num482, num483].active()) + { + int num484 = 186; + while (!Main.tile[num482, num483 + 1].active() && num483 < Main.maxTilesY - 5) + { + num483++; + } + int num485 = WorldGen.genRand.Next(22); + if (num485 >= 16 && num485 <= 22) + { + num485 = WorldGen.genRand.Next(22); + } + if (num483 > Main.maxTilesY - 300 || Main.wallDungeon[(int)Main.tile[num482, num483].wall] || Main.tile[num482, num483 + 1].type == 30 || Main.tile[num482, num483 + 1].type == 19) + { + num485 = WorldGen.genRand.Next(7); + } + if ((Main.tile[num482, num483 + 1].type == 57 || Main.tile[num482, num483 + 1].type == 58) && WorldGen.genRand.Next(3) < 2) + { + num484 = 187; + num485 = WorldGen.genRand.Next(6, 9); + } + if (Main.tile[num482, num483 + 1].type == 147 || Main.tile[num482, num483 + 1].type == 161 || Main.tile[num482, num483 + 1].type == 162) + { + num485 = WorldGen.genRand.Next(26, 32); + } + WorldGen.PlaceTile(num482, num483, num484, true, false, -1, num485); + if (Main.tile[num482, num483].type == 186 || Main.tile[num482, num483].type == 187) + { + flag38 = true; + } + if (flag38 && num484 == 186 && num485 <= 7) + { + int num486 = WorldGen.genRand.Next(1, 5); + for (int num487 = 0; num487 < num486; num487++) + { + int num488 = num482 + WorldGen.genRand.Next(-10, 11); + int num489 = num483 - WorldGen.genRand.Next(5); + if (!Main.tile[num488, num489].active()) + { + while (!Main.tile[num488, num489 + 1].active() && num489 < Main.maxTilesY - 5) + { + num489++; + } + int x7 = WorldGen.genRand.Next(12, 36); + WorldGen.PlaceSmallPile(num488, num489, x7, 0, 185); + } + } + } + } + } + num481++; + } + int num490 = 0; + while ((double)num490 < (double)Main.maxTilesX * 0.003) + { + bool flag39 = false; + while (!flag39) + { + int num491 = 186; + int num492 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num493 = WorldGen.genRand.Next(10, (int)Main.worldSurface); + if (!Main.tile[num492, num493].active()) + { + while (!Main.tile[num492, num493 + 1].active() && num493 < Main.maxTilesY - 5) + { + num493++; + } + int num494 = WorldGen.genRand.Next(7, 13); + if (num493 > Main.maxTilesY - 300 || Main.wallDungeon[(int)Main.tile[num492, num493].wall] || Main.tile[num492, num493 + 1].type == 30 || Main.tile[num492, num493 + 1].type == 19 || Main.tile[num492, num493 + 1].type == 53 || Main.tile[num492, num493 + 1].type == 25 || Main.tile[num492, num493 + 1].type == 203) + { + num494 = -1; + } + if (Main.tile[num492, num493 + 1].type == 147 || Main.tile[num492, num493 + 1].type == 161 || Main.tile[num492, num493 + 1].type == 162) + { + num494 = WorldGen.genRand.Next(26, 32); + } + if (Main.tile[num492, num493 + 1].type == 2 || Main.tile[num492 - 1, num493 + 1].type == 2 || Main.tile[num492 + 1, num493 + 1].type == 2) + { + num491 = 187; + num494 = WorldGen.genRand.Next(14, 17); + } + if (Main.tile[num492, num493 + 1].type == 151) + { + num491 = 186; + num494 = WorldGen.genRand.Next(7); + } + if (num494 >= 0) + { + WorldGen.PlaceTile(num492, num493, num491, true, false, -1, num494); + } + if ((int)Main.tile[num492, num493].type == num491) + { + flag39 = true; + } + } + } + num490++; + } + int num495 = 0; + while ((double)num495 < (double)Main.maxTilesX * 0.0035) + { + bool flag40 = false; + while (!flag40) + { + int num496 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num497 = WorldGen.genRand.Next(10, (int)Main.worldSurface); + if (!Main.tile[num496, num497].active() && Main.tile[num496, num497].wall > 0) + { + int num498 = 186; + while (!Main.tile[num496, num497 + 1].active() && num497 < Main.maxTilesY - 5) + { + num497++; + } + int num499 = WorldGen.genRand.Next(7, 13); + if (num497 > Main.maxTilesY - 300 || Main.wallDungeon[(int)Main.tile[num496, num497].wall] || Main.tile[num496, num497 + 1].type == 30 || Main.tile[num496, num497 + 1].type == 19) + { + num499 = -1; + } + if (Main.tile[num496, num497 + 1].type == 25) + { + num499 = WorldGen.genRand.Next(7); + } + if (Main.tile[num496, num497 + 1].type == 147 || Main.tile[num496, num497 + 1].type == 161 || Main.tile[num496, num497 + 1].type == 162) + { + num499 = WorldGen.genRand.Next(26, 32); + } + if (Main.tile[num496, num497 + 1].type == 2 || Main.tile[num496 - 1, num497 + 1].type == 2 || Main.tile[num496 + 1, num497 + 1].type == 2) + { + num498 = 187; + num499 = WorldGen.genRand.Next(14, 17); + } + if (Main.tile[num496, num497 + 1].type == 151) + { + num498 = 186; + num499 = WorldGen.genRand.Next(7); + } + if (num499 >= 0) + { + WorldGen.PlaceTile(num496, num497, num498, true, false, -1, num499); + } + if ((int)Main.tile[num496, num497].type == num498) + { + flag40 = true; + } + if (flag40 && num499 <= 7) + { + int num500 = WorldGen.genRand.Next(1, 5); + for (int num501 = 0; num501 < num500; num501++) + { + int num502 = num496 + WorldGen.genRand.Next(-10, 11); + int num503 = num497 - WorldGen.genRand.Next(5); + if (!Main.tile[num502, num503].active()) + { + while (!Main.tile[num502, num503 + 1].active() && num503 < Main.maxTilesY - 5) + { + num503++; + } + int x8 = WorldGen.genRand.Next(12, 36); + WorldGen.PlaceSmallPile(num502, num503, x8, 0, 185); + } + } + } + } + } + num495++; + } + int num504 = 0; + while ((double)num504 < (double)Main.maxTilesX * 0.6) + { + bool flag41 = false; + while (!flag41) + { + int num505 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num506 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY - 20); + if (Main.tile[num505, num506].wall == 87 && WorldGen.genRand.Next(2) == 0) + { + num505 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + num506 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY - 20); + } + if (!Main.tile[num505, num506].active()) + { + while (!Main.tile[num505, num506 + 1].active() && num506 < Main.maxTilesY - 5) + { + num506++; + } + int num507 = WorldGen.genRand.Next(2); + int num508 = WorldGen.genRand.Next(36); + if (num508 >= 28 && num508 <= 35) + { + num508 = WorldGen.genRand.Next(36); + } + if (num507 == 1) + { + num508 = WorldGen.genRand.Next(25); + if (num508 >= 16 && num508 <= 24) + { + num508 = WorldGen.genRand.Next(25); + } + } + if (num506 > Main.maxTilesY - 300) + { + if (num507 == 0) + { + num508 = WorldGen.genRand.Next(12, 28); + } + if (num507 == 1) + { + num508 = WorldGen.genRand.Next(6, 16); + } + } + if (Main.wallDungeon[(int)Main.tile[num505, num506].wall] || Main.tile[num505, num506 + 1].type == 30 || Main.tile[num505, num506 + 1].type == 19 || Main.tile[num505, num506 + 1].type == 25 || Main.tile[num505, num506 + 1].type == 203 || Main.tile[num505, num506].wall == 87) + { + if (num507 == 0 && num508 < 12) + { + num508 += 12; + } + if (num507 == 1 && num508 < 6) + { + num508 += 6; + } + if (num507 == 1 && num508 >= 17) + { + num508 -= 10; + } + } + if (Main.tile[num505, num506 + 1].type == 147 || Main.tile[num505, num506 + 1].type == 161 || Main.tile[num505, num506 + 1].type == 162) + { + if (num507 == 0 && num508 < 12) + { + num508 += 36; + } + if (num507 == 1 && num508 >= 20) + { + num508 += 6; + } + if (num507 == 1 && num508 < 6) + { + num508 += 25; + } + } + if (Main.tile[num505, num506 + 1].type == 151) + { + if (num507 == 0) + { + num508 = WorldGen.genRand.Next(12, 28); + } + if (num507 == 1) + { + num508 = WorldGen.genRand.Next(12, 19); + } + } + flag41 = ((Main.wallDungeon[(int)Main.tile[num505, num506].wall] && WorldGen.genRand.Next(3) != 0) || WorldGen.PlaceSmallPile(num505, num506, num508, num507, 185)); + if (flag41 && num507 == 1 && num508 >= 6 && num508 <= 15) + { + int num509 = WorldGen.genRand.Next(1, 5); + for (int num510 = 0; num510 < num509; num510++) + { + int num511 = num505 + WorldGen.genRand.Next(-10, 11); + int num512 = num506 - WorldGen.genRand.Next(5); + if (!Main.tile[num511, num512].active()) + { + while (!Main.tile[num511, num512 + 1].active() && num512 < Main.maxTilesY - 5) + { + num512++; + } + int x9 = WorldGen.genRand.Next(12, 36); + WorldGen.PlaceSmallPile(num511, num512, x9, 0, 185); + } + } + } + } + } + num504++; + } + int num513 = 0; + while ((float)num513 < (float)Main.maxTilesX * 0.02f) + { + bool flag42 = false; + while (!flag42) + { + int num514 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num515 = WorldGen.genRand.Next(15, (int)Main.worldSurface); + if (!Main.tile[num514, num515].active()) + { + while (!Main.tile[num514, num515 + 1].active() && num515 < Main.maxTilesY - 5) + { + num515++; + } + int num516 = WorldGen.genRand.Next(2); + int num517 = WorldGen.genRand.Next(11); + if (num516 == 1) + { + num517 = WorldGen.genRand.Next(5); + } + if (Main.tile[num514, num515 + 1].type == 147 || Main.tile[num514, num515 + 1].type == 161 || Main.tile[num514, num515 + 1].type == 162) + { + if (num516 == 0 && num517 < 12) + { + num517 += 36; + } + if (num516 == 1 && num517 >= 20) + { + num517 += 6; + } + if (num516 == 1 && num517 < 6) + { + num517 += 25; + } + } + if (Main.tile[num514, num515 + 1].type == 2 && num516 == 1) + { + num517 = WorldGen.genRand.Next(38, 41); + } + if (Main.tile[num514, num515 + 1].type == 151) + { + if (num516 == 0) + { + num517 = WorldGen.genRand.Next(12, 28); + } + if (num516 == 1) + { + num517 = WorldGen.genRand.Next(12, 19); + } + } + if (!Main.wallDungeon[(int)Main.tile[num514, num515].wall] && Main.tile[num514, num515 + 1].type != 30 && Main.tile[num514, num515 + 1].type != 19 && Main.tile[num514, num515 + 1].type != 41 && Main.tile[num514, num515 + 1].type != 43 && Main.tile[num514, num515 + 1].type != 44 && Main.tile[num514, num515 + 1].type != 45 && Main.tile[num514, num515 + 1].type != 46 && Main.tile[num514, num515 + 1].type != 47 && Main.tile[num514, num515 + 1].type != 175 && Main.tile[num514, num515 + 1].type != 176 && Main.tile[num514, num515 + 1].type != 177 && Main.tile[num514, num515 + 1].type != 53 && Main.tile[num514, num515 + 1].type != 25 && Main.tile[num514, num515 + 1].type != 203) + { + flag42 = WorldGen.PlaceSmallPile(num514, num515, num517, num516, 185); + } + } + } + num513++; + } + int num518 = 0; + while ((float)num518 < (float)Main.maxTilesX * 0.15f) + { + bool flag43 = false; + while (!flag43) + { + int num519 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int num520 = WorldGen.genRand.Next(15, (int)Main.worldSurface); + if (!Main.tile[num519, num520].active()) + { + if (Main.tile[num519, num520].wall != 2) + { + if (Main.tile[num519, num520].wall != 40) + { + continue; + } + } + while (!Main.tile[num519, num520 + 1].active() && num520 < Main.maxTilesY - 5) + { + num520++; + } + int num521 = WorldGen.genRand.Next(2); + int num522 = WorldGen.genRand.Next(11); + if (num521 == 1) + { + num522 = WorldGen.genRand.Next(5); + } + if (Main.tile[num519, num520 + 1].type == 147 || Main.tile[num519, num520 + 1].type == 161 || Main.tile[num519, num520 + 1].type == 162) + { + if (num521 == 0 && num522 < 12) + { + num522 += 36; + } + if (num521 == 1 && num522 >= 20) + { + num522 += 6; + } + if (num521 == 1 && num522 < 6) + { + num522 += 25; + } + } + if (Main.tile[num519, num520 + 1].type == 2 && num521 == 1) + { + num522 = WorldGen.genRand.Next(38, 41); + } + if (Main.tile[num519, num520 + 1].type == 151) + { + if (num521 == 0) + { + num522 = WorldGen.genRand.Next(12, 28); + } + if (num521 == 1) + { + num522 = WorldGen.genRand.Next(12, 19); + } + } + if (!Main.wallDungeon[(int)Main.tile[num519, num520].wall] && Main.tile[num519, num520 + 1].type != 30 && Main.tile[num519, num520 + 1].type != 19 && Main.tile[num519, num520 + 1].type != 41 && Main.tile[num519, num520 + 1].type != 43 && Main.tile[num519, num520 + 1].type != 44 && Main.tile[num519, num520 + 1].type != 45 && Main.tile[num519, num520 + 1].type != 46 && Main.tile[num519, num520 + 1].type != 47 && Main.tile[num519, num520 + 1].type != 175 && Main.tile[num519, num520 + 1].type != 176 && Main.tile[num519, num520 + 1].type != 177 && Main.tile[num519, num520 + 1].type != 25 && Main.tile[num519, num520 + 1].type != 203) + { + flag43 = WorldGen.PlaceSmallPile(num519, num520, num522, num521, 185); + } + } + } + num518++; + } + Main.tileSolid[190] = true; + Main.tileSolid[192] = true; + Main.tileSolid[196] = true; + Main.tileSolid[189] = true; + Main.tileSolid[202] = true; + Main.tileSolid[225] = true; + Main.statusText = Lang.gen[38]; + for (int num523 = 5; num523 < Main.maxTilesX - 5; num523++) + { + if (WorldGen.genRand.Next(8) == 0) + { + int num524 = 0; + while ((double)num524 < Main.worldSurface - 1.0) + { + if (Main.tile[num523, num524].active() && Main.tile[num523, num524].type == 53 && !Main.tile[num523, num524 - 1].active() && Main.tile[num523, num524 - 1].wall == 0) + { + if (num523 < 250 || num523 > Main.maxTilesX - 250) + { + if (Main.tile[num523, num524 - 2].liquid == 255 && Main.tile[num523, num524 - 3].liquid == 255 && Main.tile[num523, num524 - 4].liquid == 255) + { + WorldGen.PlaceTile(num523, num524 - 1, 81, true, false, -1, 0); + } + } + else + { + if (num523 > 400 && num523 < Main.maxTilesX - 400) + { + WorldGen.PlantCactus(num523, num524); + } + } + } + num524++; + } + } + } + int num525 = 5; + bool flag44 = true; + while (flag44) + { + int num526 = Main.maxTilesX / 2 + WorldGen.genRand.Next(-num525, num525 + 1); + for (int num527 = 0; num527 < Main.maxTilesY; num527++) + { + if (Main.tile[num526, num527].active()) + { + Main.spawnTileX = num526; + Main.spawnTileY = num527; + break; + } + } + flag44 = false; + num525++; + if ((double)Main.spawnTileY > Main.worldSurface) + { + flag44 = true; + } + if (Main.tile[Main.spawnTileX, Main.spawnTileY - 1].liquid > 0) + { + flag44 = true; + } + } + int num528 = 10; + while ((double)Main.spawnTileY > Main.worldSurface) + { + int num529 = WorldGen.genRand.Next(Main.maxTilesX / 2 - num528, Main.maxTilesX / 2 + num528); + for (int num530 = 0; num530 < Main.maxTilesY; num530++) + { + if (Main.tile[num529, num530].active()) + { + Main.spawnTileX = num529; + Main.spawnTileY = num530; + break; + } + } + num528++; + } + WorldGen.maxTileCount = 3500; + for (int num531 = 50; num531 < Main.maxTilesX - 50; num531++) + { + int num532 = 0; + while ((double)num532 < Main.worldSurface - 10.0) + { + if (WorldGen.genRand.Next(4) == 0) + { + bool flag45 = false; + int num533 = -1; + int num534 = -1; + if (Main.tile[num531, num532].active() && Main.tile[num531, num532].type == 2 && (Main.tile[num531, num532].wall == 2 || Main.tile[num531, num532].wall == 63)) + { + for (int num535 = num531 - 1; num535 <= num531 + 1; num535++) + { + for (int num536 = num532 - 1; num536 <= num532 + 1; num536++) + { + if (Main.tile[num535, num536].wall == 0 && !WorldGen.SolidTile(num535, num536)) + { + flag45 = true; + } + } + } + if (flag45) + { + for (int num537 = num531 - 1; num537 <= num531 + 1; num537++) + { + for (int num538 = num532 - 1; num538 <= num532 + 1; num538++) + { + if ((Main.tile[num537, num538].wall == 2 || Main.tile[num537, num538].wall == 15) && !WorldGen.SolidTile(num537, num538)) + { + num533 = num537; + num534 = num538; + } + } + } + } + } + if (flag45 && num533 > -1 && num534 > -1) + { + WorldGen.countDirtTiles(num533, num534); + if (WorldGen.numTileCount < 3500) + { + try + { + WorldGen.numWallOut2 = 0; + WorldGen.wallOut2(num533, num534, 63); + } + catch + { + } + } + } + } + num532++; + } + } + for (int num539 = 5; num539 < Main.maxTilesX - 5; num539++) + { + int num540 = 10; + while ((double)num540 < Main.worldSurface - 1.0) + { + if (Main.tile[num539, num540].wall == 63 && WorldGen.genRand.Next(10) == 0) + { + Main.tile[num539, num540].wall = 65; + } + if (Main.tile[num539, num540].active() && Main.tile[num539, num540].type == 0) + { + bool flag46 = false; + for (int num541 = num539 - 1; num541 <= num539 + 1; num541++) + { + for (int num542 = num540 - 1; num542 <= num540 + 1; num542++) + { + if (Main.tile[num539, num540].wall == 63 || Main.tile[num539, num540].wall == 65) + { + flag46 = true; + break; + } + } + } + if (flag46) + { + WorldGen.SpreadGrass(num539, num540, 0, 2, true, 0); + } + } + num540++; + } + } + int num543 = NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, 22, 0); + Main.npc[num543].homeTileX = Main.spawnTileX; + Main.npc[num543].homeTileY = Main.spawnTileY; + Main.npc[num543].direction = 1; + Main.npc[num543].homeless = true; + Main.statusText = Lang.gen[39]; + int num544 = 0; + while ((double)num544 < (double)Main.maxTilesX * 0.002) + { + int arg_E465_0 = Main.maxTilesX / 2; + int num545 = WorldGen.genRand.Next(Main.maxTilesX); + int num546 = num545 - WorldGen.genRand.Next(10) - 7; + int num547 = num545 + WorldGen.genRand.Next(10) + 7; + if (num546 < 0) + { + num546 = 0; + } + if (num547 > Main.maxTilesX - 1) + { + num547 = Main.maxTilesX - 1; + } + for (int num548 = num546; num548 < num547; num548++) + { + int num549 = 1; + while ((double)num549 < Main.worldSurface - 1.0) + { + if (Main.tile[num548, num549].type == 2 && Main.tile[num548, num549].active() && !Main.tile[num548, num549 - 1].active()) + { + WorldGen.PlaceTile(num548, num549 - 1, 27, true, false, -1, 0); + } + if (Main.tile[num548, num549].active()) + { + break; + } + num549++; + } + } + num544++; + } + Main.statusText = Lang.gen[40]; + int num550 = 0; + while ((double)num550 < (double)Main.maxTilesX * 0.003) + { + int num551 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); + int num552 = WorldGen.genRand.Next(25, 50); + for (int num553 = num551 - num552; num553 < num551 + num552; num553++) + { + int num554 = 20; + while ((double)num554 < Main.worldSurface) + { + WorldGen.GrowEpicTree(num553, num554); + num554++; + } + } + num550++; + } + WorldGen.AddTrees(); + Main.statusText = Lang.gen[41]; + int num555 = 0; + while ((double)num555 < (double)Main.maxTilesX * 1.7) + { + WorldGen.PlantAlch(); + num555++; + } + for (int num556 = 0; num556 < Main.maxTilesX * 2; num556++) + { + WorldGen.plantDye(WorldGen.genRand.Next(100, Main.maxTilesX - 100), WorldGen.genRand.Next(100, Main.maxTilesY - 200)); + } + for (int num557 = 100; num557 < Main.maxTilesX - 100; num557++) + { + for (int num558 = (int)Main.worldSurface; num558 < Main.maxTilesY - 100; num558++) + { + if (Main.tile[num557, num558].wall == 86) + { + if (Main.tile[num557, num558].liquid > 0) + { + Main.tile[num557, num558].honey(true); + } + if (WorldGen.genRand.Next(3) == 0) + { + WorldGen.PlaceTight(num557, num558, 165, false); + } + } + if (Main.tile[num557, num558].wall == 62) + { + Main.tile[num557, num558].liquid = 0; + Main.tile[num557, num558].lava(false); + } + if (Main.tile[num557, num558].wall == 62 && !Main.tile[num557, num558].active() && WorldGen.genRand.Next(10) != 0) + { + int num559 = WorldGen.genRand.Next(2, 5); + int num560 = num557 - num559; + int num561 = num557 + num559; + int num562 = num558 - num559; + int num563 = num558 + num559; + bool flag47 = false; + for (int num564 = num560; num564 <= num561; num564++) + { + for (int num565 = num562; num565 <= num563; num565++) + { + if (WorldGen.SolidTile(num564, num565)) + { + flag47 = true; + break; + } + } + } + if (flag47) + { + WorldGen.PlaceTile(num557, num558, 51, true, false, -1, 0); + WorldGen.TileFrame(num557, num558, false, false); + } + } + } + } + Main.statusText = Lang.gen[42]; + WorldGen.AddPlants(); + for (int num566 = 0; num566 < Main.maxTilesX; num566++) + { + for (int num567 = 0; num567 < Main.maxTilesY; num567++) + { + if (Main.tile[num566, num567].active()) + { + if (num567 >= (int)Main.worldSurface && Main.tile[num566, num567].type == 70 && !Main.tile[num566, num567 - 1].active()) + { + WorldGen.GrowShroom(num566, num567); + if (!Main.tile[num566, num567 - 1].active()) + { + WorldGen.PlaceTile(num566, num567 - 1, 71, true, false, -1, 0); + } + } + if (Main.tile[num566, num567].type == 60 && !Main.tile[num566, num567 - 1].active()) + { + WorldGen.PlaceTile(num566, num567 - 1, 61, true, false, -1, 0); + } + } + } + } + for (int num568 = 0; num568 < Main.maxTilesX * 100; num568++) + { + int num569 = WorldGen.genRand.Next(40, Main.maxTilesX / 2 - 40); + if (num9 < 0) + { + num569 += Main.maxTilesX / 2; + } + int num570 = WorldGen.genRand.Next(Main.maxTilesY - 300); + while (!Main.tile[num569, num570].active() && num570 < Main.maxTilesY - 300) + { + num570++; + } + if (Main.tile[num569, num570].active() && Main.tile[num569, num570].type == 60) + { + num570--; + WorldGen.PlaceJunglePlant(num569, num570, 233, WorldGen.genRand.Next(8), 0); + if (Main.tile[num569, num570].type != 233) + { + WorldGen.PlaceJunglePlant(num569, num570, 233, WorldGen.genRand.Next(12), 1); + } + } + } + Main.statusText = Lang.gen[43]; + for (int num571 = 0; num571 < Main.maxTilesX; num571++) + { + int num572 = 0; + int num573 = 0; + while ((double)num573 < Main.worldSurface) + { + if (num572 > 0 && !Main.tile[num571, num573].active()) + { + Main.tile[num571, num573].active(true); + Main.tile[num571, num573].type = 52; + num572--; + } + else + { + num572 = 0; + } + if (Main.tile[num571, num573].active() && (Main.tile[num571, num573].type == 2 || (Main.tile[num571, num573].type == 192 && WorldGen.genRand.Next(4) == 0)) && WorldGen.genRand.Next(5) < 3) + { + num572 = WorldGen.genRand.Next(1, 10); + } + num573++; + } + num572 = 0; + for (int num574 = 0; num574 < Main.maxTilesY; num574++) + { + if (num572 > 0 && !Main.tile[num571, num574].active()) + { + Main.tile[num571, num574].active(true); + Main.tile[num571, num574].type = 62; + num572--; + } + else + { + num572 = 0; + } + if (Main.tile[num571, num574].active() && Main.tile[num571, num574].type == 60 && WorldGen.genRand.Next(5) < 3) + { + num572 = WorldGen.genRand.Next(1, 10); + } + } + num572 = 0; + for (int num575 = 0; num575 < Main.maxTilesY; num575++) + { + if (num572 > 0 && !Main.tile[num571, num575].active()) + { + Main.tile[num571, num575].active(true); + Main.tile[num571, num575].type = 205; + num572--; + } + else + { + num572 = 0; + } + if (Main.tile[num571, num575].active() && Main.tile[num571, num575].type == 199 && WorldGen.genRand.Next(5) < 3) + { + num572 = WorldGen.genRand.Next(1, 10); + } + } + } + Main.statusText = Lang.gen[44]; + int num576 = 0; + while ((double)num576 < (double)Main.maxTilesX * 0.005) + { + int num577 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num578 = WorldGen.genRand.Next(5, 15); + int num579 = WorldGen.genRand.Next(15, 30); + int num580 = 1; + while ((double)num580 < Main.worldSurface - 1.0) + { + if (Main.tile[num577, num580].active()) + { + for (int num581 = num577 - num578; num581 < num577 + num578; num581++) + { + for (int num582 = num580 - num579; num582 < num580 + num579; num582++) + { + if (Main.tile[num581, num582].type == 3 || Main.tile[num581, num582].type == 24) + { + Main.tile[num581, num582].frameX = (short)(WorldGen.genRand.Next(6, 8) * 18); + if (Main.tile[num581, num582].type == 3 && WorldGen.genRand.Next(2) == 0) + { + Main.tile[num581, num582].frameX = (short)(WorldGen.genRand.Next(9, 11) * 18); + } + } + } + } + break; + } + num580++; + } + num576++; + } + Main.statusText = Lang.gen[45]; + int num583 = 0; + while ((double)num583 < (double)Main.maxTilesX * 0.002) + { + int num584 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num585 = WorldGen.genRand.Next(4, 10); + int num586 = WorldGen.genRand.Next(15, 30); + int num587 = 1; + while ((double)num587 < Main.worldSurface - 1.0) + { + if (Main.tile[num584, num587].active()) + { + for (int num588 = num584 - num585; num588 < num584 + num585; num588++) + { + for (int num589 = num587 - num586; num589 < num587 + num586; num589++) + { + if (Main.tile[num588, num589].type == 3 || Main.tile[num588, num589].type == 24) + { + Main.tile[num588, num589].frameX = 144; + } + } + } + break; + } + num587++; + } + num583++; + } + for (int num590 = 20; num590 < Main.maxTilesX - 20; num590++) + { + for (int num591 = (int)Main.worldSurface; num591 < Main.maxTilesY - 20; num591++) + { + if (!Main.tile[num590, num591].active() && Main.rand.Next(5) == 0) + { + WorldGen.PlaceTight(num590, num591, 165, false); + } + } + for (int num592 = 5; num592 < (int)Main.worldSurface; num592++) + { + if ((Main.tile[num590, num592 - 1].type == 147 || Main.tile[num590, num592 - 1].type == 161) && Main.rand.Next(5) == 0) + { + WorldGen.PlaceTight(num590, num592, 165, false); + } + } + } + int num593 = 0; + while ((double)num593 < (double)Main.maxTilesX * 0.25) + { + int num594 = WorldGen.genRand.Next((int)(Main.worldSurface + Main.rockLayer) / 2, WorldGen.lavaLine); + int num595 = WorldGen.genRand.Next(array5[num594], array6[num594]); + if (Main.tile[num595, num594].active() && (Main.tile[num595, num594].type == 147 || Main.tile[num595, num594].type == 161 || Main.tile[num595, num594].type == 162 || Main.tile[num595, num594].type == 224)) + { + int num596 = WorldGen.genRand.Next(1, 4); + int num597 = WorldGen.genRand.Next(1, 4); + int num598 = WorldGen.genRand.Next(1, 4); + int num599 = WorldGen.genRand.Next(1, 4); + int num600 = WorldGen.genRand.Next(12); + int style3; + if (num600 < 3) + { + style3 = 0; + } + else + { + if (num600 < 6) + { + style3 = 1; + } + else + { + if (num600 < 8) + { + style3 = 2; + } + else + { + if (num600 < 10) + { + style3 = 3; + } + else + { + if (num600 < 11) + { + style3 = 4; + } + else + { + style3 = 5; + } + } + } + } + } + for (int num601 = num595 - num596; num601 < num595 + num597; num601++) + { + for (int num602 = num594 - num598; num602 < num594 + num599; num602++) + { + if (!Main.tile[num601, num602].active()) + { + WorldGen.PlaceTile(num601, num602, 178, true, false, -1, style3); + } + } + } + } + num593++; + } + for (int num603 = 0; num603 < Main.maxTilesX; num603++) + { + int num604 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num605 = WorldGen.genRand.Next((int)Main.rockLayer, Main.maxTilesY - 300); + if (!Main.tile[num604, num605].active() && !Main.tile[num604, num605].lava() && !Main.wallDungeon[(int)Main.tile[num604, num605].wall] && Main.tile[num604, num605].wall != 27) + { + int num606 = WorldGen.genRand.Next(12); + int style4; + if (num606 < 3) + { + style4 = 0; + } + else + { + if (num606 < 6) + { + style4 = 1; + } + else + { + if (num606 < 8) + { + style4 = 2; + } + else + { + if (num606 < 10) + { + style4 = 3; + } + else + { + if (num606 < 11) + { + style4 = 4; + } + else + { + style4 = 5; + } + } + } + } + } + WorldGen.PlaceTile(num604, num605, 178, true, false, -1, style4); + } + } + for (int num607 = 5; num607 < Main.maxTilesX - 5; num607++) + { + for (int num608 = 5; num608 < Main.maxTilesY - 5; num608++) + { + if (Main.tile[num607, num608].active() && Main.tileMoss[(int)Main.tile[num607, num608].type]) + { + for (int num609 = 0; num609 < 4; num609++) + { + int num610 = num607; + int num611 = num608; + if (num609 == 0) + { + num610--; + } + if (num609 == 1) + { + num610++; + } + if (num609 == 2) + { + num611--; + } + if (num609 == 3) + { + num611++; + } + if (!Main.tile[num610, num611].active()) + { + WorldGen.PlaceTile(num610, num611, 184, true, false, -1, 0); + } + } + } + } + } + int num612 = 0; + int num613 = 0; + bool flag48 = false; + for (int num614 = 5; num614 < Main.maxTilesX - 5; num614++) + { + int num615 = 0; + while ((double)num615 < Main.worldSurface + 20.0) + { + if (Main.tile[num614, num615].active() && Main.tile[num614, num615].type == 60) + { + num612 = num614; + flag48 = true; + break; + } + num615++; + } + if (flag48) + { + break; + } + } + flag48 = false; + for (int num616 = Main.maxTilesX - 5; num616 > 5; num616--) + { + int num617 = 0; + while ((double)num617 < Main.worldSurface + 20.0) + { + if (Main.tile[num616, num617].active() && Main.tile[num616, num617].type == 60) + { + num613 = num616; + flag48 = true; + break; + } + num617++; + } + if (flag48) + { + break; + } + } + for (int num618 = num612; num618 <= num613; num618++) + { + int num619 = 0; + while ((double)num619 < Main.worldSurface + 20.0) + { + if (((num618 >= num612 + 2 && num618 <= num613 - 2) || WorldGen.genRand.Next(2) != 0) && ((num618 >= num612 + 3 && num618 <= num613 - 3) || WorldGen.genRand.Next(3) != 0) && (Main.tile[num618, num619].wall == 2 || Main.tile[num618, num619].wall == 59)) + { + Main.tile[num618, num619].wall = 15; + } + num619++; + } + } + for (int num620 = 0; num620 < num304; num620++) + { + int num621 = array7[num620]; + int num622 = array8[num620]; + for (int num623 = num621 - 1; num623 <= num621 + 1; num623++) + { + for (int num624 = num622 - 2; num624 <= num622 + 1; num624++) + { + if (num624 != num622 + 1) + { + Main.tile[num623, num624].active(false); + } + else + { + Main.tile[num623, num624].active(true); + Main.tile[num623, num624].type = 225; + Main.tile[num623, num624].slope(0); + Main.tile[num623, num624].halfBrick(false); + } + } + } + WorldGen.PlaceTile(num621, num622, 231, true, false, -1, 0); + } + Main.tileSolid[232] = true; + Main.tileSolid[162] = true; + for (int num625 = 5; num625 < Main.maxTilesX - 5; num625++) + { + for (int num626 = 5; num626 < Main.maxTilesY - 5; num626++) + { + if (Main.tile[num625, num626].type == 137) + { + if (Main.tile[num625, num626].frameY <= 52) + { + int num627 = -1; + if (Main.tile[num625, num626].frameX >= 18) + { + num627 = 1; + } + if (Main.tile[num625 + num627, num626].halfBrick() || Main.tile[num625 + num627, num626].slope() != 0) + { + Main.tile[num625 + num627, num626].active(false); + } + } + } + else + { + if (Main.tile[num625, num626].type == 162 && Main.tile[num625, num626 + 1].liquid == 0) + { + Main.tile[num625, num626].active(false); + } + } + if (Main.tile[num625, num626].wall == 13 || Main.tile[num625, num626].wall == 14) + { + Main.tile[num625, num626].liquid = 0; + } + } + } + WorldGen.gen = false; + } + public static bool GrowEpicTree(int i, int y) + { + int num = y; + while (Main.tile[i, num].type == 20) + { + num++; + } + if (Main.tile[i, num].active() && !Main.tile[i, num].halfBrick() && Main.tile[i, num].slope() == 0 && Main.tile[i, num].type == 2 && Main.tile[i, num - 1].wall == 0 && Main.tile[i, num - 1].liquid == 0 && ((Main.tile[i - 1, num].active() && (Main.tile[i - 1, num].type == 2 || Main.tile[i - 1, num].type == 23 || Main.tile[i - 1, num].type == 60 || Main.tile[i - 1, num].type == 109)) || (Main.tile[i + 1, num].active() && (Main.tile[i + 1, num].type == 2 || Main.tile[i + 1, num].type == 23 || Main.tile[i + 1, num].type == 60 || Main.tile[i + 1, num].type == 109)))) + { + int num2 = 2; + if (WorldGen.EmptyTileCheck(i - num2, i + num2, num - 55, num - 1, 20)) + { + bool flag = false; + bool flag2 = false; + int num3 = WorldGen.genRand.Next(20, 30); + int num4; + for (int j = num - num3; j < num; j++) + { + Main.tile[i, j].frameNumber((byte)WorldGen.genRand.Next(3)); + Main.tile[i, j].active(true); + Main.tile[i, j].type = 5; + num4 = WorldGen.genRand.Next(3); + int num5 = WorldGen.genRand.Next(10); + if (j == num - 1 || j == num - num3) + { + num5 = 0; + } + while (((num5 == 5 || num5 == 7) && flag) || ((num5 == 6 || num5 == 7) && flag2)) + { + num5 = WorldGen.genRand.Next(10); + } + flag = false; + flag2 = false; + if (num5 == 5 || num5 == 7) + { + flag = true; + } + if (num5 == 6 || num5 == 7) + { + flag2 = true; + } + if (num5 == 1) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 2) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num5 == 3) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 4) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 5) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num5 == 6) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 7) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 44; + } + } + } + } + } + } + } + } + if (num5 == 5 || num5 == 7) + { + Main.tile[i - 1, j].active(true); + Main.tile[i - 1, j].type = 5; + num4 = WorldGen.genRand.Next(3); + if (WorldGen.genRand.Next(3) < 2) + { + if (num4 == 0) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 242; + } + } + else + { + if (num4 == 0) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 44; + } + } + } + if (num5 == 6 || num5 == 7) + { + Main.tile[i + 1, j].active(true); + Main.tile[i + 1, j].type = 5; + num4 = WorldGen.genRand.Next(3); + if (WorldGen.genRand.Next(3) < 2) + { + if (num4 == 0) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 242; + } + } + else + { + if (num4 == 0) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 110; + } + } + } + } + int num6 = WorldGen.genRand.Next(3); + bool flag3 = false; + bool flag4 = false; + if (Main.tile[i - 1, num].active() && !Main.tile[i - 1, num].halfBrick() && Main.tile[i - 1, num].slope() == 0 && (Main.tile[i - 1, num].type == 2 || Main.tile[i - 1, num].type == 23 || Main.tile[i - 1, num].type == 60 || Main.tile[i - 1, num].type == 109)) + { + flag3 = true; + } + if (Main.tile[i + 1, num].active() && !Main.tile[i + 1, num].halfBrick() && Main.tile[i + 1, num].slope() == 0 && (Main.tile[i + 1, num].type == 2 || Main.tile[i + 1, num].type == 23 || Main.tile[i + 1, num].type == 60 || Main.tile[i + 1, num].type == 109)) + { + flag4 = true; + } + if (!flag3) + { + if (num6 == 0) + { + num6 = 2; + } + if (num6 == 1) + { + num6 = 3; + } + } + if (!flag4) + { + if (num6 == 0) + { + num6 = 1; + } + if (num6 == 2) + { + num6 = 3; + } + } + if (flag3 && !flag4) + { + num6 = 2; + } + if (flag4 && !flag3) + { + num6 = 1; + } + if (num6 == 0 || num6 == 1) + { + Main.tile[i + 1, num - 1].active(true); + Main.tile[i + 1, num - 1].type = 5; + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i + 1, num - 1].frameX = 22; + Main.tile[i + 1, num - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i + 1, num - 1].frameX = 22; + Main.tile[i + 1, num - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i + 1, num - 1].frameX = 22; + Main.tile[i + 1, num - 1].frameY = 176; + } + } + if (num6 == 0 || num6 == 2) + { + Main.tile[i - 1, num - 1].active(true); + Main.tile[i - 1, num - 1].type = 5; + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i - 1, num - 1].frameX = 44; + Main.tile[i - 1, num - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i - 1, num - 1].frameX = 44; + Main.tile[i - 1, num - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i - 1, num - 1].frameX = 44; + Main.tile[i - 1, num - 1].frameY = 176; + } + } + num4 = WorldGen.genRand.Next(3); + if (num6 == 0) + { + if (num4 == 0) + { + Main.tile[i, num - 1].frameX = 88; + Main.tile[i, num - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i, num - 1].frameX = 88; + Main.tile[i, num - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i, num - 1].frameX = 88; + Main.tile[i, num - 1].frameY = 176; + } + } + else + { + if (num6 == 1) + { + if (num4 == 0) + { + Main.tile[i, num - 1].frameX = 0; + Main.tile[i, num - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i, num - 1].frameX = 0; + Main.tile[i, num - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i, num - 1].frameX = 0; + Main.tile[i, num - 1].frameY = 176; + } + } + else + { + if (num6 == 2) + { + if (num4 == 0) + { + Main.tile[i, num - 1].frameX = 66; + Main.tile[i, num - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i, num - 1].frameX = 66; + Main.tile[i, num - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i, num - 1].frameX = 66; + Main.tile[i, num - 1].frameY = 176; + } + } + } + } + if (WorldGen.genRand.Next(8) != 0) + { + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i, num - num3].frameX = 22; + Main.tile[i, num - num3].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i, num - num3].frameX = 22; + Main.tile[i, num - num3].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i, num - num3].frameX = 22; + Main.tile[i, num - num3].frameY = 242; + } + } + else + { + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i, num - num3].frameX = 0; + Main.tile[i, num - num3].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i, num - num3].frameX = 0; + Main.tile[i, num - num3].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i, num - num3].frameX = 0; + Main.tile[i, num - num3].frameY = 242; + } + } + WorldGen.RangeFrame(i - 2, num - num3 - 1, i + 2, num + 1); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, (int)((double)num - (double)num3 * 0.5), num3 + 1); + } + return true; + } + } + return false; + } + public static bool Pyramid(int i, int j) + { + int num = j - WorldGen.genRand.Next(0, 7); + int num2 = WorldGen.genRand.Next(9, 13); + int num3 = 1; + int num4 = j + WorldGen.genRand.Next(75, 125); + for (int k = num; k < num4; k++) + { + for (int l = i - num3; l < i + num3 - 1; l++) + { + Main.tile[l, k].type = 151; + Main.tile[l, k].active(true); + Main.tile[l, k].halfBrick(false); + } + num3++; + } + for (int m = i - num3 - 5; m <= i + num3 + 5; m++) + { + for (int n = j - 1; n <= num4 + 1; n++) + { + bool flag = true; + for (int num5 = m - 1; num5 <= m + 1; num5++) + { + for (int num6 = n - 1; num6 <= n + 1; num6++) + { + if (Main.tile[num5, num6].type != 151) + { + flag = false; + } + } + } + if (flag) + { + Main.tile[m, n].wall = 34; + WorldGen.SquareWallFrame(m, n, true); + } + } + } + int num7 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num7 = -1; + } + int num8 = i - num2 * num7; + int num9 = j + num2; + int num10 = WorldGen.genRand.Next(5, 8); + bool flag2 = true; + int num11 = WorldGen.genRand.Next(20, 30); + while (flag2) + { + flag2 = false; + bool flag3 = false; + for (int num12 = num9; num12 <= num9 + num10; num12++) + { + int num13 = num8; + if (Main.tile[num13, num12 - 1].type == 53) + { + flag3 = true; + } + if (Main.tile[num13, num12].type == 151) + { + Main.tile[num13, num12 + 1].wall = 34; + Main.tile[num13 + num7, num12].wall = 34; + Main.tile[num13, num12].active(false); + flag2 = true; + } + if (flag3) + { + Main.tile[num13, num12].type = 53; + Main.tile[num13, num12].active(true); + Main.tile[num13, num12].halfBrick(false); + } + } + num8 -= num7; + } + num8 = i - num2 * num7; + bool flag4 = true; + bool flag5 = false; + flag2 = true; + while (flag2) + { + for (int num14 = num9; num14 <= num9 + num10; num14++) + { + int num15 = num8; + Main.tile[num15, num14].active(false); + } + num8 += num7; + num9++; + num11--; + if (num9 >= num4 - num10 * 2) + { + num11 = 10; + } + if (num11 <= 0) + { + bool flag6 = false; + if (!flag4 && !flag5) + { + flag5 = true; + flag6 = true; + int num16 = WorldGen.genRand.Next(7, 13); + int num17 = WorldGen.genRand.Next(23, 28); + int num18 = num17; + int num19 = num8; + while (num17 > 0) + { + for (int num20 = num9 - num16 + num10; num20 <= num9 + num10; num20++) + { + if (num17 == num18 || num17 == 1) + { + if (num20 >= num9 - num16 + num10 + 2) + { + Main.tile[num8, num20].active(false); + } + } + else + { + if (num17 == num18 - 1 || num17 == 2 || num17 == num18 - 2 || num17 == 3) + { + if (num20 >= num9 - num16 + num10 + 1) + { + Main.tile[num8, num20].active(false); + } + } + else + { + Main.tile[num8, num20].active(false); + } + } + } + num17--; + num8 += num7; + } + int num21 = num8 - num7; + int num22 = num21; + int num23 = num19; + if (num21 > num19) + { + num22 = num19; + num23 = num21; + } + int num24 = WorldGen.genRand.Next(3); + if (num24 == 0) + { + num24 = 857; + } + else + { + if (num24 == 1) + { + num24 = 848; + } + else + { + if (num24 == 2) + { + num24 = 934; + } + } + } + WorldGen.AddBuriedChest((num22 + num23) / 2, num9, num24, false, 1); + int num25 = WorldGen.genRand.Next(1, 10); + for (int num26 = 0; num26 < num25; num26++) + { + int i2 = WorldGen.genRand.Next(num22, num23); + int j2 = num9 + num10; + WorldGen.PlaceSmallPile(i2, j2, WorldGen.genRand.Next(16, 19), 1, 185); + } + WorldGen.PlaceTile(num22 + 2, num9 - num16 + num10 + 1, 91, true, false, -1, WorldGen.genRand.Next(4, 7)); + WorldGen.PlaceTile(num22 + 3, num9 - num16 + num10, 91, true, false, -1, WorldGen.genRand.Next(4, 7)); + WorldGen.PlaceTile(num23 - 2, num9 - num16 + num10 + 1, 91, true, false, -1, WorldGen.genRand.Next(4, 7)); + WorldGen.PlaceTile(num23 - 3, num9 - num16 + num10, 91, true, false, -1, WorldGen.genRand.Next(4, 7)); + for (int num27 = num22; num27 <= num23; num27++) + { + WorldGen.PlacePot(num27, num9 + num10, 28, WorldGen.genRand.Next(25, 28)); + } + } + if (flag4) + { + flag4 = false; + num7 *= -1; + num11 = WorldGen.genRand.Next(15, 20); + } + else + { + if (flag6) + { + num11 = WorldGen.genRand.Next(10, 15); + } + else + { + num7 *= -1; + num11 = WorldGen.genRand.Next(20, 40); + } + } + } + if (num9 >= num4 - num10) + { + flag2 = false; + } + } + int num28 = WorldGen.genRand.Next(100, 200); + int num29 = WorldGen.genRand.Next(500, 800); + flag2 = true; + int num30 = num10; + num11 = WorldGen.genRand.Next(10, 50); + if (num7 == 1) + { + num8 -= num30; + } + int num31 = WorldGen.genRand.Next(5, 10); + while (flag2) + { + num28--; + num29--; + num11--; + for (int num32 = num8 - num31 - WorldGen.genRand.Next(0, 2); num32 <= num8 + num30 + num31 + WorldGen.genRand.Next(0, 2); num32++) + { + int num33 = num9; + if (num32 >= num8 && num32 <= num8 + num30) + { + Main.tile[num32, num33].active(false); + } + else + { + Main.tile[num32, num33].type = 151; + Main.tile[num32, num33].active(true); + Main.tile[num32, num33].halfBrick(false); + } + if (num32 >= num8 - 1 && num32 <= num8 + 1 + num30) + { + Main.tile[num32, num33].wall = 34; + } + } + num9++; + num8 += num7; + if (num28 <= 0) + { + flag2 = false; + for (int num34 = num8 + 1; num34 <= num8 + num30 - 1; num34++) + { + if (Main.tile[num34, num9].active()) + { + flag2 = true; + } + } + } + if (num11 < 0) + { + num11 = WorldGen.genRand.Next(10, 50); + num7 *= -1; + } + if (num29 <= 0) + { + flag2 = false; + } + } + return true; + } + public static bool GrowLivingTree(int i, int j) + { + int num = 0; + int[] array = new int[1000]; + int[] array2 = new int[1000]; + int[] array3 = new int[1000]; + int[] array4 = new int[1000]; + int num2 = 0; + int[] array5 = new int[2000]; + int[] array6 = new int[2000]; + bool[] array7 = new bool[2000]; + if (!WorldGen.SolidTile(i, j + 1)) + { + return false; + } + if (Main.tile[i, j].active()) + { + return false; + } + int num3 = i - WorldGen.genRand.Next(1, 4); + int num4 = i + WorldGen.genRand.Next(1, 4); + if (j < 150) + { + return false; + } + int num5 = i - 50; + int num6 = i + 50; + for (int k = num5; k <= num6; k++) + { + for (int l = 5; l < j - 5; l++) + { + if (Main.tile[k, l].active()) + { + return false; + } + } + } + int num7 = num3; + int num8 = num4; + int num9 = num3; + int num10 = num4; + int num11 = num4 - num3; + bool flag = true; + int num12 = WorldGen.genRand.Next(-10, -5); + int num13 = WorldGen.genRand.Next(2); + int num14 = j; + while (flag) + { + num12++; + if (num12 > WorldGen.genRand.Next(5, 30)) + { + num12 = 0; + array2[num] = num14 + WorldGen.genRand.Next(5); + if (WorldGen.genRand.Next(5) == 0) + { + if (num13 == 0) + { + num13 = 1; + } + else + { + num13 = 0; + } + } + if (num13 == 0) + { + array3[num] = -1; + array[num] = num3; + array4[num] = num4 - num3; + if (WorldGen.genRand.Next(2) == 0) + { + num3++; + } + num7++; + num13 = 1; + } + else + { + array3[num] = 1; + array[num] = num4; + array4[num] = num4 - num3; + if (WorldGen.genRand.Next(2) == 0) + { + num4--; + } + num8--; + num13 = 0; + } + if (num7 == num8) + { + flag = false; + } + num++; + } + for (int m = num3; m <= num4; m++) + { + Main.tile[m, num14].type = 191; + Main.tile[m, num14].active(true); + Main.tile[m, num14].halfBrick(false); + } + num14--; + } + for (int n = 0; n < num; n++) + { + int num15 = array[n] + array3[n]; + int num16 = array2[n]; + int num17 = (int)((float)array4[n] * (1f + (float)WorldGen.genRand.Next(20, 30) * 0.1f)); + Main.tile[num15, num16 + 1].type = 191; + Main.tile[num15, num16 + 1].active(true); + Main.tile[num15, num16 + 1].halfBrick(false); + int num18 = WorldGen.genRand.Next(3, 5); + while (num17 > 0) + { + num17--; + Main.tile[num15, num16].type = 191; + Main.tile[num15, num16].active(true); + Main.tile[num15, num16].halfBrick(false); + if (WorldGen.genRand.Next(10) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + num16--; + } + else + { + num16++; + } + } + else + { + num15 += array3[n]; + } + if (num18 > 0) + { + num18--; + } + else + { + if (WorldGen.genRand.Next(2) == 0) + { + num18 = WorldGen.genRand.Next(2, 5); + if (WorldGen.genRand.Next(2) == 0) + { + Main.tile[num15, num16].type = 191; + Main.tile[num15, num16].active(true); + Main.tile[num15, num16].halfBrick(false); + Main.tile[num15, num16 - 1].type = 191; + Main.tile[num15, num16 - 1].active(true); + Main.tile[num15, num16 - 1].halfBrick(false); + array5[num2] = num15; + array6[num2] = num16; + num2++; + } + else + { + Main.tile[num15, num16].type = 191; + Main.tile[num15, num16].active(true); + Main.tile[num15, num16].halfBrick(false); + Main.tile[num15, num16 + 1].type = 191; + Main.tile[num15, num16 + 1].active(true); + Main.tile[num15, num16 + 1].halfBrick(false); + array5[num2] = num15; + array6[num2] = num16; + num2++; + } + } + } + if (num17 == 0) + { + array5[num2] = num15; + array6[num2] = num16; + num2++; + } + } + } + int num19 = (num3 + num4) / 2; + int num20 = num14; + int num21 = WorldGen.genRand.Next(num11 * 3, num11 * 5); + int num22 = 0; + int num23 = 0; + while (num21 > 0) + { + Main.tile[num19, num20].type = 191; + Main.tile[num19, num20].active(true); + Main.tile[num19, num20].halfBrick(false); + if (num22 > 0) + { + num22--; + } + if (num23 > 0) + { + num23--; + } + for (int num24 = -1; num24 < 2; num24++) + { + if (num24 != 0 && ((num24 < 0 && num22 == 0) || (num24 > 0 && num23 == 0)) && WorldGen.genRand.Next(2) == 0) + { + int num25 = num19; + int num26 = num20; + int num27 = WorldGen.genRand.Next(num11, num11 * 3); + if (num24 < 0) + { + num22 = WorldGen.genRand.Next(3, 5); + } + if (num24 > 0) + { + num23 = WorldGen.genRand.Next(3, 5); + } + int num28 = 0; + while (num27 > 0) + { + num27--; + num25 += num24; + Main.tile[num25, num26].type = 191; + Main.tile[num25, num26].active(true); + Main.tile[num25, num26].halfBrick(false); + if (num27 == 0) + { + array5[num2] = num25; + array6[num2] = num26; + array7[num2] = true; + num2++; + } + if (WorldGen.genRand.Next(5) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + num26--; + } + else + { + num26++; + } + Main.tile[num25, num26].type = 191; + Main.tile[num25, num26].active(true); + Main.tile[num25, num26].halfBrick(false); + } + if (num28 > 0) + { + num28--; + } + else + { + if (WorldGen.genRand.Next(3) == 0) + { + num28 = WorldGen.genRand.Next(2, 4); + int num29 = num25; + int num30 = num26; + if (WorldGen.genRand.Next(2) == 0) + { + num30--; + } + else + { + num30++; + } + Main.tile[num29, num30].type = 191; + Main.tile[num29, num30].active(true); + Main.tile[num29, num30].halfBrick(false); + array5[num2] = num29; + array6[num2] = num30; + array7[num2] = true; + num2++; + } + } + } + } + } + array5[num2] = num19; + array6[num2] = num20; + num2++; + if (WorldGen.genRand.Next(4) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + num19--; + } + else + { + num19++; + } + Main.tile[num19, num20].type = 191; + Main.tile[num19, num20].active(true); + Main.tile[num19, num20].halfBrick(false); + } + num20--; + num21--; + } + for (int num31 = num9; num31 <= num10; num31++) + { + int num32 = WorldGen.genRand.Next(1, 6); + int num33 = j + 1; + while (num32 > 0) + { + if (WorldGen.SolidTile(num31, num33)) + { + num32--; + } + Main.tile[num31, num33].type = 191; + Main.tile[num31, num33].active(true); + Main.tile[num31, num33].halfBrick(false); + num33++; + } + int num34 = num33; + for (int num35 = 0; num35 < 2; num35++) + { + num33 = num34; + int num36 = (num9 + num10) / 2; + int num37 = 1; + int num38; + if (num31 < num36) + { + num38 = -1; + } + else + { + num38 = 1; + } + if (num31 == num36 || (num11 > 6 && (num31 == num36 - 1 || num31 == num36 + 1))) + { + num38 = 0; + } + int num39 = num38; + int num40 = num31; + num32 = WorldGen.genRand.Next((int)((double)num11 * 2.5), num11 * 4); + while (num32 > 0) + { + num32--; + num40 += num38; + Main.tile[num40, num33].type = 191; + Main.tile[num40, num33].active(true); + Main.tile[num40, num33].halfBrick(false); + num33 += num37; + Main.tile[num40, num33].type = 191; + Main.tile[num40, num33].active(true); + Main.tile[num40, num33].halfBrick(false); + if (!Main.tile[num40, num33 + 1].active()) + { + num38 = 0; + num37 = 1; + } + if (WorldGen.genRand.Next(3) == 0) + { + if (num39 < 0) + { + if (num38 == 0) + { + num38 = -1; + } + else + { + num38 = 0; + } + } + else + { + if (num39 > 0) + { + if (num38 == 0) + { + num38 = 1; + } + else + { + num38 = 0; + } + } + else + { + num38 = WorldGen.genRand.Next(-1, 2); + } + } + } + if (WorldGen.genRand.Next(3) == 0) + { + if (num37 == 0) + { + num37 = 1; + } + else + { + num37 = 0; + } + } + } + } + } + for (int num41 = 0; num41 < num2; num41++) + { + int num42 = WorldGen.genRand.Next(5, 8); + num42 = (int)((float)num42 * (1f + (float)num11 * 0.05f)); + if (array7[num41]) + { + num42 = WorldGen.genRand.Next(7, 13); + } + int num43 = array5[num41] - num42; + int num44 = array5[num41] + num42; + int num45 = array6[num41] - num42; + int num46 = array6[num41] + num42; + float num47 = 2f - (float)WorldGen.genRand.Next(5) * 0.1f; + for (int num48 = num43; num48 <= num44; num48++) + { + for (int num49 = num45; num49 <= num46; num49++) + { + if (Main.tile[num48, num49].type != 191 && (float)Math.Abs(array5[num41] - num48) + (float)Math.Abs(array6[num41] - num49) * num47 < (float)num42) + { + Main.tile[num48, num49].type = 192; + Main.tile[num48, num49].active(true); + Main.tile[num48, num49].halfBrick(false); + } + } + } + } + if (num11 >= 4 && WorldGen.genRand.Next(3) != 0) + { + bool flag2 = false; + int num50 = num9; + int num51 = num10; + int num52 = j - 5; + int num53 = 50; + int num54 = WorldGen.genRand.Next(400, 700); + int num55 = 1; + bool flag3 = true; + while (num54 > 0) + { + num52++; + num54--; + num53--; + int num56 = (num9 + num10) / 2; + int num57 = 0; + if (num52 > j && num11 == 4) + { + num57 = 1; + } + for (int num58 = num9 - num57; num58 <= num10 + num57; num58++) + { + if (num58 > num56 - 2 && num58 <= num56 + 1) + { + if (Main.tile[num58, num52].type != 19) + { + Main.tile[num58, num52].active(false); + } + Main.tile[num58, num52].wall = 78; + if (Main.tile[num58 - 1, num52].wall > 0 || (double)num52 >= Main.worldSurface) + { + Main.tile[num58 - 1, num52].wall = 78; + } + if (Main.tile[num58 + 1, num52].wall > 0 || (double)num52 >= Main.worldSurface) + { + Main.tile[num58 + 1, num52].wall = 78; + } + } + else + { + Main.tile[num58, num52].type = 191; + Main.tile[num58, num52].active(true); + Main.tile[num58, num52].halfBrick(false); + } + } + num55++; + if (num55 >= 6) + { + num55 = 0; + int num59 = WorldGen.genRand.Next(3); + if (num59 == 0) + { + num59 = -1; + } + if (flag3) + { + num59 = 2; + } + if (num59 == 2) + { + flag3 = false; + for (int num60 = num9; num60 <= num10; num60++) + { + if (num60 > num56 - 2 && num60 <= num56 + 1) + { + Main.tile[num60, num52 + 1].active(false); + WorldGen.PlaceTile(num60, num52 + 1, 19, true, false, -1, 0); + } + } + } + else + { + num9 += num59; + num10 += num59; + } + if (num53 <= 0 && !flag2) + { + flag2 = true; + int num61 = WorldGen.genRand.Next(2); + if (num61 == 0) + { + num61 = -1; + } + int num62 = num52 - 2; + int num63 = num52; + int num64 = (num9 + num10) / 2; + if (num61 < 0) + { + num64--; + } + if (num61 > 0) + { + num64++; + } + int num65 = WorldGen.genRand.Next(15, 30); + int num66 = num64 + num65; + if (num61 < 0) + { + num66 = num64; + num64 -= num65; + } + WorldGen.dMinX = num64; + WorldGen.dMaxX = num66; + if (num61 < 0) + { + WorldGen.dMinX -= 40; + } + else + { + WorldGen.dMaxX += 40; + } + bool flag4 = false; + for (int num67 = num64; num67 < num66; num67++) + { + for (int num68 = num52 - 20; num68 < num52 + 10; num68++) + { + if (Main.tile[num67, num68].wall == 0 && !Main.tile[num67, num68].active() && (double)num68 < Main.worldSurface) + { + flag4 = true; + } + } + } + if (!flag4) + { + for (int num69 = num64; num69 <= num66; num69++) + { + for (int num70 = num62 - 2; num70 <= num63 + 2; num70++) + { + if (Main.tile[num69, num70].wall != 78 && Main.tile[num69, num70].type != 19) + { + Main.tile[num69, num70].active(true); + Main.tile[num69, num70].type = 191; + Main.tile[num69, num70].halfBrick(false); + } + if (num70 >= num62 && num70 <= num63) + { + Main.tile[num69, num70].liquid = 0; + Main.tile[num69, num70].wall = 78; + Main.tile[num69, num70].active(false); + } + } + } + int i2 = (num9 + num10) / 2 + 3 * num61; + int j2 = num52; + WorldGen.PlaceTile(i2, j2, 10, true, false, -1, 7); + int num71 = WorldGen.genRand.Next(5, 9); + int num72 = WorldGen.genRand.Next(4, 6); + if (num61 < 0) + { + num66 = num64 + num71; + num64 -= num71; + } + else + { + num64 = num66 - num71; + num66 += num71; + } + num62 = num63 - num72; + for (int num73 = num64 - 2; num73 <= num66 + 2; num73++) + { + for (int num74 = num62 - 2; num74 <= num63 + 2; num74++) + { + if (Main.tile[num73, num74].wall != 78 && Main.tile[num73, num74].type != 19) + { + Main.tile[num73, num74].active(true); + Main.tile[num73, num74].type = 191; + Main.tile[num73, num74].halfBrick(false); + } + if (num74 >= num62 && num74 <= num63 && num73 >= num64 && num73 <= num66) + { + Main.tile[num73, num74].liquid = 0; + Main.tile[num73, num74].wall = 78; + Main.tile[num73, num74].active(false); + } + } + } + i2 = num64 - 2; + if (num61 < 0) + { + i2 = num66 + 2; + } + WorldGen.PlaceTile(i2, j2, 10, true, false, -1, 7); + int num75 = num66; + if (num61 < 0) + { + num75 = num64; + } + WorldGen.PlaceTile(num75, num52, 15, true, false, -1, 5); + if (num61 < 0) + { + Tile expr_115A = Main.tile[num75, num52 - 1]; + expr_115A.frameX += 18; + Tile expr_1177 = Main.tile[num75, num52]; + expr_1177.frameX += 18; + } + num75 = num66 - 2; + if (num61 < 0) + { + num75 = num64 + 2; + } + WorldGen.PlaceTile(num75, num52, 14, true, false, -1, 6); + num75 = num66 - 4; + if (num61 < 0) + { + num75 = num64 + 4; + } + WorldGen.PlaceTile(num75, num52, 15, true, false, -1, 5); + if (num61 > 0) + { + Tile expr_11DD = Main.tile[num75, num52 - 1]; + expr_11DD.frameX += 18; + Tile expr_11FA = Main.tile[num75, num52]; + expr_11FA.frameX += 18; + } + num75 = num66 - 7; + if (num61 < 0) + { + num75 = num64 + 8; + } + int contain; + if (WorldGen.genRand.Next(2) == 0) + { + contain = 832; + } + else + { + contain = 933; + } + WorldGen.AddBuriedChest(num75, num52, contain, false, 12); + } + } + } + if (num53 <= 0) + { + bool flag5 = true; + for (int num76 = num9; num76 <= num10; num76++) + { + for (int num77 = num52 + 1; num77 <= num52 + 4; num77++) + { + if (WorldGen.SolidTile(num76, num77)) + { + flag5 = false; + } + } + } + if (flag5) + { + num54 = 0; + } + } + } + num9 = num50; + num10 = num51; + int num78 = (num9 + num10) / 2; + if (WorldGen.genRand.Next(2) == 0) + { + num10 = num78; + } + else + { + num9 = num78; + } + for (int num79 = num9; num79 <= num10; num79++) + { + for (int num80 = j - 3; num80 <= j; num80++) + { + Main.tile[num79, num80].active(false); + bool flag6 = true; + for (int num81 = num79 - 1; num81 <= num79 + 1; num81++) + { + for (int num82 = num80 - 1; num82 <= num80 + 1; num82++) + { + if (!Main.tile[num81, num82].active() && Main.tile[num81, num82].wall == 0) + { + flag6 = false; + } + } + } + if (flag6) + { + Main.tile[num79, num80].wall = 78; + } + } + } + } + return true; + } + public static void GrowTree(int i, int y) + { + int num = y; + while (Main.tile[i, num].type == 20) + { + num++; + } + if ((Main.tile[i - 1, num - 1].liquid != 0 || Main.tile[i - 1, num - 1].liquid != 0 || Main.tile[i + 1, num - 1].liquid != 0) && Main.tile[i, num].type != 60) + { + return; + } + if (Main.tile[i, num].nactive() && !Main.tile[i, num].halfBrick() && Main.tile[i, num].slope() == 0 && (((Main.tile[i, num].type == 2 || Main.tile[i, num].type == 23 || Main.tile[i, num].type == 60 || Main.tile[i, num].type == 109 || Main.tile[i, num].type == 147 || Main.tile[i, num].type == 199 || Main.tile[i, num].type == 70) && Main.tile[i, num - 1].wall == 0) || Main.tile[i, num - 1].wall == 106 || Main.tile[i, num - 1].wall == 107) && ((Main.tile[i - 1, num].active() && (Main.tile[i - 1, num].type == 2 || Main.tile[i - 1, num].type == 23 || Main.tile[i - 1, num].type == 60 || Main.tile[i - 1, num].type == 109 || Main.tile[i - 1, num].type == 147 || Main.tile[i - 1, num].type == 199 || Main.tile[i - 1, num].type == 70)) || (Main.tile[i + 1, num].active() && (Main.tile[i + 1, num].type == 2 || Main.tile[i + 1, num].type == 23 || Main.tile[i + 1, num].type == 60 || Main.tile[i + 1, num].type == 109 || Main.tile[i + 1, num].type == 147 || Main.tile[i + 1, num].type == 199 || Main.tile[i + 1, num].type == 70)))) + { + int num2 = 2; + int num3 = 16; + if (Main.tile[i, num].type == 60) + { + num3 += 5; + } + if (WorldGen.EmptyTileCheck(i - num2, i + num2, num - num3, num - 1, 20)) + { + bool flag = false; + bool flag2 = false; + int num4 = WorldGen.genRand.Next(5, num3 + 1); + int num5; + for (int j = num - num4; j < num; j++) + { + Main.tile[i, j].frameNumber((byte)WorldGen.genRand.Next(3)); + Main.tile[i, j].active(true); + Main.tile[i, j].type = 5; + num5 = WorldGen.genRand.Next(3); + int num6 = WorldGen.genRand.Next(10); + if (j == num - 1 || j == num - num4) + { + num6 = 0; + } + while (((num6 == 5 || num6 == 7) && flag) || ((num6 == 6 || num6 == 7) && flag2)) + { + num6 = WorldGen.genRand.Next(10); + } + flag = false; + flag2 = false; + if (num6 == 5 || num6 == 7) + { + flag = true; + } + if (num6 == 6 || num6 == 7) + { + flag2 = true; + } + if (num6 == 1) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 66; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 88; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num6 == 2) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 0; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 22; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num6 == 3) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 66; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 88; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num6 == 4) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 66; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 88; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num6 == 5) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 0; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 22; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num6 == 6) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 66; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 88; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num6 == 7) + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 66; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 88; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + if (num5 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 22; + } + if (num5 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 44; + } + } + } + } + } + } + } + } + if (num6 == 5 || num6 == 7) + { + Main.tile[i - 1, j].active(true); + Main.tile[i - 1, j].type = 5; + num5 = WorldGen.genRand.Next(3); + if (WorldGen.genRand.Next(3) < 2) + { + if (num5 == 0) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 198; + } + if (num5 == 1) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 220; + } + if (num5 == 2) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 242; + } + } + else + { + if (num5 == 0) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 0; + } + if (num5 == 1) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 22; + } + if (num5 == 2) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 44; + } + } + } + if (num6 == 6 || num6 == 7) + { + Main.tile[i + 1, j].active(true); + Main.tile[i + 1, j].type = 5; + num5 = WorldGen.genRand.Next(3); + if (WorldGen.genRand.Next(3) < 2) + { + if (num5 == 0) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 198; + } + if (num5 == 1) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 220; + } + if (num5 == 2) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 242; + } + } + else + { + if (num5 == 0) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 66; + } + if (num5 == 1) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 88; + } + if (num5 == 2) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 110; + } + } + } + } + int num7 = WorldGen.genRand.Next(3); + bool flag3 = false; + bool flag4 = false; + if (Main.tile[i - 1, num].nactive() && !Main.tile[i - 1, num].halfBrick() && Main.tile[i - 1, num].slope() == 0 && (Main.tile[i - 1, num].type == 2 || Main.tile[i - 1, num].type == 23 || Main.tile[i - 1, num].type == 60 || Main.tile[i - 1, num].type == 109 || Main.tile[i - 1, num].type == 147)) + { + flag3 = true; + } + if (Main.tile[i + 1, num].nactive() && !Main.tile[i + 1, num].halfBrick() && Main.tile[i + 1, num].slope() == 0 && (Main.tile[i + 1, num].type == 2 || Main.tile[i + 1, num].type == 23 || Main.tile[i + 1, num].type == 60 || Main.tile[i + 1, num].type == 109 || Main.tile[i + 1, num].type == 147)) + { + flag4 = true; + } + if (!flag3) + { + if (num7 == 0) + { + num7 = 2; + } + if (num7 == 1) + { + num7 = 3; + } + } + if (!flag4) + { + if (num7 == 0) + { + num7 = 1; + } + if (num7 == 2) + { + num7 = 3; + } + } + if (flag3 && !flag4) + { + num7 = 2; + } + if (flag4 && !flag3) + { + num7 = 1; + } + if (num7 == 0 || num7 == 1) + { + Main.tile[i + 1, num - 1].active(true); + Main.tile[i + 1, num - 1].type = 5; + num5 = WorldGen.genRand.Next(3); + if (num5 == 0) + { + Main.tile[i + 1, num - 1].frameX = 22; + Main.tile[i + 1, num - 1].frameY = 132; + } + if (num5 == 1) + { + Main.tile[i + 1, num - 1].frameX = 22; + Main.tile[i + 1, num - 1].frameY = 154; + } + if (num5 == 2) + { + Main.tile[i + 1, num - 1].frameX = 22; + Main.tile[i + 1, num - 1].frameY = 176; + } + } + if (num7 == 0 || num7 == 2) + { + Main.tile[i - 1, num - 1].active(true); + Main.tile[i - 1, num - 1].type = 5; + num5 = WorldGen.genRand.Next(3); + if (num5 == 0) + { + Main.tile[i - 1, num - 1].frameX = 44; + Main.tile[i - 1, num - 1].frameY = 132; + } + if (num5 == 1) + { + Main.tile[i - 1, num - 1].frameX = 44; + Main.tile[i - 1, num - 1].frameY = 154; + } + if (num5 == 2) + { + Main.tile[i - 1, num - 1].frameX = 44; + Main.tile[i - 1, num - 1].frameY = 176; + } + } + num5 = WorldGen.genRand.Next(3); + if (num7 == 0) + { + if (num5 == 0) + { + Main.tile[i, num - 1].frameX = 88; + Main.tile[i, num - 1].frameY = 132; + } + if (num5 == 1) + { + Main.tile[i, num - 1].frameX = 88; + Main.tile[i, num - 1].frameY = 154; + } + if (num5 == 2) + { + Main.tile[i, num - 1].frameX = 88; + Main.tile[i, num - 1].frameY = 176; + } + } + else + { + if (num7 == 1) + { + if (num5 == 0) + { + Main.tile[i, num - 1].frameX = 0; + Main.tile[i, num - 1].frameY = 132; + } + if (num5 == 1) + { + Main.tile[i, num - 1].frameX = 0; + Main.tile[i, num - 1].frameY = 154; + } + if (num5 == 2) + { + Main.tile[i, num - 1].frameX = 0; + Main.tile[i, num - 1].frameY = 176; + } + } + else + { + if (num7 == 2) + { + if (num5 == 0) + { + Main.tile[i, num - 1].frameX = 66; + Main.tile[i, num - 1].frameY = 132; + } + if (num5 == 1) + { + Main.tile[i, num - 1].frameX = 66; + Main.tile[i, num - 1].frameY = 154; + } + if (num5 == 2) + { + Main.tile[i, num - 1].frameX = 66; + Main.tile[i, num - 1].frameY = 176; + } + } + } + } + if (WorldGen.genRand.Next(8) != 0) + { + num5 = WorldGen.genRand.Next(3); + if (num5 == 0) + { + Main.tile[i, num - num4].frameX = 22; + Main.tile[i, num - num4].frameY = 198; + } + if (num5 == 1) + { + Main.tile[i, num - num4].frameX = 22; + Main.tile[i, num - num4].frameY = 220; + } + if (num5 == 2) + { + Main.tile[i, num - num4].frameX = 22; + Main.tile[i, num - num4].frameY = 242; + } + } + else + { + num5 = WorldGen.genRand.Next(3); + if (num5 == 0) + { + Main.tile[i, num - num4].frameX = 0; + Main.tile[i, num - num4].frameY = 198; + } + if (num5 == 1) + { + Main.tile[i, num - num4].frameX = 0; + Main.tile[i, num - num4].frameY = 220; + } + if (num5 == 2) + { + Main.tile[i, num - num4].frameX = 0; + Main.tile[i, num - num4].frameY = 242; + } + } + WorldGen.RangeFrame(i - 2, num - num4 - 1, i + 2, num + 1); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, (int)((double)num - (double)num4 * 0.5), num4 + 1); + } + } + } + } + public static void GrowUndergroundTree(int i, int y) + { + if (Main.tile[i, y].type != 60) + { + return; + } + if (Main.tile[i, y].nactive() && !Main.tile[i, y].halfBrick() && Main.tile[i, y].slope() == 0 && Main.tile[i, y].type == 60 && ((Main.tile[i - 1, y].active() && Main.tile[i - 1, y].type == 60) || (Main.tile[i + 1, y].active() && Main.tile[i + 1, y].type == 60))) + { + int num = 1; + int num2 = WorldGen.genRand.Next(5, 15); + int num3 = num2 + 2; + if (Main.tile[i, y].type == 60) + { + num3 += 5; + } + if (WorldGen.EmptyTileCheck(i - num, i + num, y - num3, y - 1, 20)) + { + bool flag = false; + bool flag2 = false; + int num4; + for (int j = y - num2; j < y; j++) + { + Main.tile[i, j].frameNumber((byte)WorldGen.genRand.Next(3)); + Main.tile[i, j].active(true); + Main.tile[i, j].type = 5; + num4 = WorldGen.genRand.Next(3); + int num5 = WorldGen.genRand.Next(10); + if (j == y - 1 || j == y - num2) + { + num5 = 0; + } + while (((num5 == 5 || num5 == 7) && flag) || ((num5 == 6 || num5 == 7) && flag2)) + { + num5 = WorldGen.genRand.Next(10); + } + flag = false; + flag2 = false; + if (num5 == 5 || num5 == 7) + { + flag = true; + } + if (num5 == 6 || num5 == 7) + { + flag2 = true; + } + if (num5 == 1) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 2) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num5 == 3) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 44; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 4) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 22; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 5) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num5 == 6) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num5 == 7) + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num4 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 44; + } + } + } + } + } + } + } + } + if (num5 == 5 || num5 == 7) + { + Main.tile[i - 1, j].active(true); + Main.tile[i - 1, j].type = 5; + num4 = WorldGen.genRand.Next(3); + if (WorldGen.genRand.Next(3) < 2) + { + if (num4 == 0) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i - 1, j].frameX = 44; + Main.tile[i - 1, j].frameY = 242; + } + } + else + { + if (num4 == 0) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 0; + } + if (num4 == 1) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 22; + } + if (num4 == 2) + { + Main.tile[i - 1, j].frameX = 66; + Main.tile[i - 1, j].frameY = 44; + } + } + } + if (num5 == 6 || num5 == 7) + { + Main.tile[i + 1, j].active(true); + Main.tile[i + 1, j].type = 5; + num4 = WorldGen.genRand.Next(3); + if (WorldGen.genRand.Next(3) < 2) + { + if (num4 == 0) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i + 1, j].frameX = 66; + Main.tile[i + 1, j].frameY = 242; + } + } + else + { + if (num4 == 0) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 66; + } + if (num4 == 1) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 88; + } + if (num4 == 2) + { + Main.tile[i + 1, j].frameX = 88; + Main.tile[i + 1, j].frameY = 110; + } + } + } + } + int num6 = WorldGen.genRand.Next(3); + bool flag3 = false; + bool flag4 = false; + if (Main.tile[i - 1, y].nactive() && !Main.tile[i - 1, y].halfBrick() && Main.tile[i - 1, y].slope() == 0 && (Main.tile[i - 1, y].type == 2 || Main.tile[i - 1, y].type == 23 || Main.tile[i - 1, y].type == 60 || Main.tile[i - 1, y].type == 109 || Main.tile[i - 1, y].type == 147)) + { + flag3 = true; + } + if (Main.tile[i + 1, y].nactive() && !Main.tile[i + 1, y].halfBrick() && Main.tile[i + 1, y].slope() == 0 && (Main.tile[i + 1, y].type == 2 || Main.tile[i + 1, y].type == 23 || Main.tile[i + 1, y].type == 60 || Main.tile[i + 1, y].type == 109 || Main.tile[i + 1, y].type == 147)) + { + flag4 = true; + } + if (!flag3) + { + if (num6 == 0) + { + num6 = 2; + } + if (num6 == 1) + { + num6 = 3; + } + } + if (!flag4) + { + if (num6 == 0) + { + num6 = 1; + } + if (num6 == 2) + { + num6 = 3; + } + } + if (flag3 && !flag4) + { + num6 = 2; + } + if (flag4 && !flag3) + { + num6 = 1; + } + if (num6 == 0 || num6 == 1) + { + Main.tile[i + 1, y - 1].active(true); + Main.tile[i + 1, y - 1].type = 5; + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i + 1, y - 1].frameX = 22; + Main.tile[i + 1, y - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i + 1, y - 1].frameX = 22; + Main.tile[i + 1, y - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i + 1, y - 1].frameX = 22; + Main.tile[i + 1, y - 1].frameY = 176; + } + } + if (num6 == 0 || num6 == 2) + { + Main.tile[i - 1, y - 1].active(true); + Main.tile[i - 1, y - 1].type = 5; + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i - 1, y - 1].frameX = 44; + Main.tile[i - 1, y - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i - 1, y - 1].frameX = 44; + Main.tile[i - 1, y - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i - 1, y - 1].frameX = 44; + Main.tile[i - 1, y - 1].frameY = 176; + } + } + num4 = WorldGen.genRand.Next(3); + if (num6 == 0) + { + if (num4 == 0) + { + Main.tile[i, y - 1].frameX = 88; + Main.tile[i, y - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i, y - 1].frameX = 88; + Main.tile[i, y - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i, y - 1].frameX = 88; + Main.tile[i, y - 1].frameY = 176; + } + } + else + { + if (num6 == 1) + { + if (num4 == 0) + { + Main.tile[i, y - 1].frameX = 0; + Main.tile[i, y - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i, y - 1].frameX = 0; + Main.tile[i, y - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i, y - 1].frameX = 0; + Main.tile[i, y - 1].frameY = 176; + } + } + else + { + if (num6 == 2) + { + if (num4 == 0) + { + Main.tile[i, y - 1].frameX = 66; + Main.tile[i, y - 1].frameY = 132; + } + if (num4 == 1) + { + Main.tile[i, y - 1].frameX = 66; + Main.tile[i, y - 1].frameY = 154; + } + if (num4 == 2) + { + Main.tile[i, y - 1].frameX = 66; + Main.tile[i, y - 1].frameY = 176; + } + } + } + } + if (WorldGen.genRand.Next(8) != 0) + { + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i, y - num2].frameX = 22; + Main.tile[i, y - num2].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i, y - num2].frameX = 22; + Main.tile[i, y - num2].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i, y - num2].frameX = 22; + Main.tile[i, y - num2].frameY = 242; + } + } + else + { + num4 = WorldGen.genRand.Next(3); + if (num4 == 0) + { + Main.tile[i, y - num2].frameX = 0; + Main.tile[i, y - num2].frameY = 198; + } + if (num4 == 1) + { + Main.tile[i, y - num2].frameX = 0; + Main.tile[i, y - num2].frameY = 220; + } + if (num4 == 2) + { + Main.tile[i, y - num2].frameX = 0; + Main.tile[i, y - num2].frameY = 242; + } + } + WorldGen.RangeFrame(i - 2, y - num2 - 1, i + 2, y + 1); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, (int)((double)y - (double)num2 * 0.5), num2 + 1); + } + } + } + } + public static void GrowShroom(int i, int y) + { + if (Main.tile[i - 1, y - 1].lava() || Main.tile[i - 1, y - 1].lava() || Main.tile[i + 1, y - 1].lava()) + { + return; + } + if (Main.tile[i, y].nactive() && !Main.tile[i, y].halfBrick() && Main.tile[i, y].slope() == 0 && Main.tile[i, y].type == 70 && Main.tile[i, y - 1].wall == 0 && Main.tile[i - 1, y].active() && Main.tile[i - 1, y].type == 70 && Main.tile[i + 1, y].active() && Main.tile[i + 1, y].type == 70 && WorldGen.EmptyTileCheck(i - 2, i + 2, y - 13, y - 1, 71)) + { + int num = WorldGen.genRand.Next(4, 11); + int num2; + for (int j = y - num; j < y; j++) + { + Main.tile[i, j].frameNumber((byte)WorldGen.genRand.Next(3)); + Main.tile[i, j].active(true); + Main.tile[i, j].type = 72; + num2 = WorldGen.genRand.Next(3); + if (num2 == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + if (num2 == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 18; + } + if (num2 == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 36; + } + } + num2 = WorldGen.genRand.Next(3); + if (num2 == 0) + { + Main.tile[i, y - num].frameX = 36; + Main.tile[i, y - num].frameY = 0; + } + if (num2 == 1) + { + Main.tile[i, y - num].frameX = 36; + Main.tile[i, y - num].frameY = 18; + } + if (num2 == 2) + { + Main.tile[i, y - num].frameX = 36; + Main.tile[i, y - num].frameY = 36; + } + WorldGen.RangeFrame(i - 2, y - num - 1, i + 2, y + 1); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, (int)((double)y - (double)num * 0.5), num + 1); + } + } + } + public static void AddTrees() + { + for (int i = 1; i < Main.maxTilesX - 1; i++) + { + int num = 20; + while ((double)num < Main.worldSurface) + { + WorldGen.GrowTree(i, num); + num++; + } + if (WorldGen.genRand.Next(3) == 0) + { + i++; + } + if (WorldGen.genRand.Next(4) == 0) + { + i++; + } + } + } + public static void ExplodeMine(int i, int j) + { + byte arg_11_0 = Main.tile[i, j].type; + WorldGen.KillTile(i, j, false, false, true); + NetMessage.SendTileSquare(-1, i, j, 1); + Projectile.NewProjectile((float)(i * 16 + 8), (float)(j * 16 + 8), 0f, 0f, 164, 250, 10f, Main.myPlayer, 0f, 0f); + } + public static bool EmptyTileCheck(int startX, int endX, int startY, int endY, int ignoreStyle = -1) + { + if (startX < 0) + { + return false; + } + if (endX >= Main.maxTilesX) + { + return false; + } + if (startY < 0) + { + return false; + } + if (endY >= Main.maxTilesY) + { + return false; + } + for (int i = startX; i < endX + 1; i++) + { + for (int j = startY; j < endY + 1; j++) + { + if (Main.tile[i, j].active()) + { + if (ignoreStyle == -1) + { + return false; + } + if (ignoreStyle == 11 && Main.tile[i, j].type != 11) + { + return false; + } + if (ignoreStyle == 20 && Main.tile[i, j].type != 20 && Main.tile[i, j].type != 3 && Main.tile[i, j].type != 62 && Main.tile[i, j].type != 24 && Main.tile[i, j].type != 61 && Main.tile[i, j].type != 32 && Main.tile[i, j].type != 69 && Main.tile[i, j].type != 71 && Main.tile[i, j].type != 73 && Main.tile[i, j].type != 74 && Main.tile[i, j].type != 110 && Main.tile[i, j].type != 113 && Main.tile[i, j].type != 82 && Main.tile[i, j].type != 83 && Main.tile[i, j].type != 84) + { + return false; + } + if (ignoreStyle == 71 && Main.tile[i, j].type != 71) + { + return false; + } + } + } + } + return true; + } + public static void smCallBack(object threadContext) + { + if (Main.hardMode) + { + return; + } + WorldGen.hardLock = true; + Main.hardMode = true; + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + float num = (float)WorldGen.genRand.Next(300, 400) * 0.001f; + float num2 = (float)WorldGen.genRand.Next(200, 300) * 0.001f; + int num3 = (int)((float)Main.maxTilesX * num); + int num4 = (int)((float)Main.maxTilesX * (1f - num)); + int num5 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num4 = (int)((float)Main.maxTilesX * num); + num3 = (int)((float)Main.maxTilesX * (1f - num)); + num5 = -1; + } + int num6 = 1; + if (WorldGen.dungeonX < Main.maxTilesX / 2) + { + num6 = -1; + } + if (num6 < 0) + { + if (num4 < num3) + { + num4 = (int)((float)Main.maxTilesX * num2); + } + else + { + num3 = (int)((float)Main.maxTilesX * num2); + } + } + else + { + if (num4 > num3) + { + num4 = (int)((float)Main.maxTilesX * (1f - num2)); + } + else + { + num3 = (int)((float)Main.maxTilesX * (1f - num2)); + } + } + WorldGen.GERunner(num3, 0, (float)(3 * num5), 5f, true); + WorldGen.GERunner(num4, 0, (float)(3 * -(float)num5), 5f, false); + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[15], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[15], 255, 50f, 255f, 130f, 0); + } + } + if (Main.netMode == 2) + { + Netplay.ResetSections(); + } + WorldGen.hardLock = false; + } + public static void StartHardmode() + { + if (Main.netMode == 1) + { + return; + } + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.smCallBack), 1); + } + public static bool PlaceDoor(int i, int j, int type, int style = 0) + { + int num = 54 * style; + bool result; + try + { + if (Main.tile[i, j - 2].nactive() && Main.tileSolid[(int)Main.tile[i, j - 2].type] && WorldGen.SolidTile(i, j + 2)) + { + Main.tile[i, j - 1].active(true); + Main.tile[i, j - 1].type = 10; + Main.tile[i, j - 1].frameY = (short)num; + Main.tile[i, j - 1].frameX = (short)(WorldGen.genRand.Next(3) * 18); + Main.tile[i, j].active(true); + Main.tile[i, j].type = 10; + Main.tile[i, j].frameY = (short)(num + 18); + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(3) * 18); + Main.tile[i, j + 1].active(true); + Main.tile[i, j + 1].type = 10; + Main.tile[i, j + 1].frameY = (short)(num + 36); + Main.tile[i, j + 1].frameX = (short)(WorldGen.genRand.Next(3) * 18); + result = true; + } + else + { + result = false; + } + } + catch + { + result = false; + } + return result; + } + public static bool CloseDoor(int i, int j, bool forced = false) + { + int num = 0; + int num2 = i; + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + int frameX = (int)Main.tile[i, j].frameX; + int k = (int)Main.tile[i, j].frameY; + int num3 = 0; + while (k >= 54) + { + k -= 54; + num3++; + } + int num4 = j - k / 18; + if (frameX == 0) + { + num2 = i; + num = 1; + } + else + { + if (frameX == 18) + { + num2 = i - 1; + num = 1; + } + else + { + if (frameX == 36) + { + num2 = i + 1; + num = -1; + } + else + { + if (frameX == 54) + { + num2 = i; + num = -1; + } + } + } + } + int num5 = num2; + if (num == -1) + { + num5 = num2 - 1; + } + if (!forced) + { + for (int l = num4; l < num4 + 3; l++) + { + if (!Collision.EmptyTile(num2, l, true)) + { + return false; + } + } + } + for (int m = num5; m < num5 + 2; m++) + { + for (int n = num4; n < num4 + 3; n++) + { + if (m == num2) + { + if (Main.tile[m, n] == null) + { + Main.tile[m, n] = new Tile(); + } + Main.tile[m, n].type = 10; + Main.tile[m, n].frameX = (short)(WorldGen.genRand.Next(3) * 18); + } + else + { + if (Main.tile[m, n] == null) + { + Main.tile[m, n] = new Tile(); + } + Main.tile[m, n].active(false); + } + } + } + if (Main.netMode != 1) + { + int num6 = num2; + for (int num7 = num4; num7 <= num4 + 2; num7++) + { + if (WorldGen.numNoWire < WorldGen.maxWire - 1) + { + WorldGen.noWireX[WorldGen.numNoWire] = num6; + WorldGen.noWireY[WorldGen.numNoWire] = num7; + WorldGen.numNoWire++; + } + } + } + for (int num8 = num2 - 1; num8 <= num2 + 1; num8++) + { + for (int num9 = num4 - 1; num9 <= num4 + 2; num9++) + { + WorldGen.TileFrame(num8, num9, false, false); + } + } + Main.PlaySound(9, i * 16, j * 16, 1); + return true; + } + public static bool AddLifeCrystal(int i, int j) + { + int k = j; + while (k < Main.maxTilesY) + { + if (Main.tile[i, k].active() && Main.tileSolid[(int)Main.tile[i, k].type]) + { + int num = k - 1; + if (Main.tile[i, num - 1].lava() || Main.tile[i - 1, num - 1].lava()) + { + return false; + } + if (!WorldGen.EmptyTileCheck(i - 1, i, num - 1, num, -1)) + { + return false; + } + Main.tile[i - 1, num - 1].active(true); + Main.tile[i - 1, num - 1].type = 12; + Main.tile[i - 1, num - 1].frameX = 0; + Main.tile[i - 1, num - 1].frameY = 0; + Main.tile[i, num - 1].active(true); + Main.tile[i, num - 1].type = 12; + Main.tile[i, num - 1].frameX = 18; + Main.tile[i, num - 1].frameY = 0; + Main.tile[i - 1, num].active(true); + Main.tile[i - 1, num].type = 12; + Main.tile[i - 1, num].frameX = 0; + Main.tile[i - 1, num].frameY = 18; + Main.tile[i, num].active(true); + Main.tile[i, num].type = 12; + Main.tile[i, num].frameX = 18; + Main.tile[i, num].frameY = 18; + return true; + } + else + { + k++; + } + } + return false; + } + public static void AddShadowOrb(int x, int y) + { + if (x < 10 || x > Main.maxTilesX - 10) + { + return; + } + if (y < 10 || y > Main.maxTilesY - 10) + { + return; + } + for (int i = x - 1; i < x + 1; i++) + { + for (int j = y - 1; j < y + 1; j++) + { + if (Main.tile[i, j].active() && Main.tile[i, j].type == 31) + { + return; + } + } + } + short num = 0; + if (WorldGen.crimson) + { + num += 36; + } + Main.tile[x - 1, y - 1].active(true); + Main.tile[x - 1, y - 1].type = 31; + Main.tile[x - 1, y - 1].frameX = num; + Main.tile[x - 1, y - 1].frameY = 0; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].type = 31; + Main.tile[x, y - 1].frameX = (short)(18 + num); + Main.tile[x, y - 1].frameY = 0; + Main.tile[x - 1, y].active(true); + Main.tile[x - 1, y].type = 31; + Main.tile[x - 1, y].frameX = num; + Main.tile[x - 1, y].frameY = 18; + Main.tile[x, y].active(true); + Main.tile[x, y].type = 31; + Main.tile[x, y].frameX = (short)(18 + num); + Main.tile[x, y].frameY = 18; + } + public static void AddHellHouses() + { + int num = (int)((double)Main.maxTilesX * 0.25); + for (int i = num; i < Main.maxTilesX - num; i++) + { + int num2 = Main.maxTilesY - 40; + while (Main.tile[i, num2].active() || Main.tile[i, num2].liquid > 0) + { + num2--; + } + if (Main.tile[i, num2 + 1].active()) + { + byte b = (byte)WorldGen.genRand.Next(75, 77); + byte wallType = 13; + if (WorldGen.genRand.Next(5) > 0) + { + b = 75; + } + if (b == 75) + { + wallType = 14; + } + WorldGen.HellFort(i, num2, b, wallType); + i += WorldGen.genRand.Next(30, 130); + if (WorldGen.genRand.Next(10) == 0) + { + i += WorldGen.genRand.Next(0, 200); + } + } + } + float num3 = (float)(Main.maxTilesX / 4200); + int num4 = 0; + while ((float)num4 < 200f * num3) + { + int num5 = 0; + bool flag = false; + while (!flag) + { + num5++; + int num6 = WorldGen.genRand.Next((int)((double)Main.maxTilesX * 0.2), (int)((double)Main.maxTilesX * 0.8)); + int num7 = WorldGen.genRand.Next(Main.maxTilesY - 300, Main.maxTilesY - 20); + if (Main.tile[num6, num7].active() && (Main.tile[num6, num7].type == 75 || Main.tile[num6, num7].type == 76)) + { + int num8 = 0; + if (Main.tile[num6 - 1, num7].wall > 0) + { + num8 = -1; + } + else + { + if (Main.tile[num6 + 1, num7].wall > 0) + { + num8 = 1; + } + } + if (!Main.tile[num6 + num8, num7].active() && !Main.tile[num6 + num8, num7 + 1].active()) + { + bool flag2 = false; + for (int j = num6 - 8; j < num6 + 8; j++) + { + for (int k = num7 - 8; k < num7 + 8; k++) + { + if (Main.tile[j, k].active() && Main.tile[j, k].type == 4) + { + flag2 = true; + break; + } + } + } + if (!flag2) + { + WorldGen.PlaceTile(num6 + num8, num7, 4, true, true, -1, 7); + flag = true; + } + } + } + if (num5 > 1000) + { + flag = true; + } + } + num4++; + } + float num9 = 4200000f / (float)Main.maxTilesX; + int num10 = 0; + while ((float)num10 < num9) + { + int num11 = WorldGen.genRand.Next(num, Main.maxTilesX - num); + int num12 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); + while ((Main.tile[num11, num12].wall != 13 && Main.tile[num11, num12].wall != 14) || Main.tile[num11, num12].active()) + { + num11 = WorldGen.genRand.Next(num, Main.maxTilesX - num); + num12 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); + } + if ((Main.tile[num11, num12].wall == 13 || Main.tile[num11, num12].wall == 14) && !Main.tile[num11, num12].active()) + { + while (!WorldGen.SolidTile(num11, num12) && num12 < Main.maxTilesY - 20) + { + num12++; + } + num12--; + int num13 = num11; + int num14 = num11; + while (!Main.tile[num13, num12].active() && WorldGen.SolidTile(num13, num12 + 1)) + { + num13--; + } + num13++; + while (!Main.tile[num14, num12].active() && WorldGen.SolidTile(num14, num12 + 1)) + { + num14++; + } + num14--; + int num15 = num14 - num13; + int num16 = (num14 + num13) / 2; + if (!Main.tile[num16, num12].active() && (Main.tile[num16, num12].wall == 13 || Main.tile[num16, num12].wall == 14) && WorldGen.SolidTile(num16, num12 + 1)) + { + int style = 16; + int style2 = 13; + int style3 = 14; + int style4 = 49; + int style5 = 4; + int style6 = 8; + int num17 = WorldGen.genRand.Next(6); + int num18 = 0; + int num19 = 0; + if (num17 == 0) + { + num18 = 5; + num19 = 4; + } + if (num17 == 1) + { + num18 = 4; + num19 = 3; + } + if (num17 == 2) + { + num18 = 3; + num19 = 5; + } + if (num17 == 3) + { + num18 = 4; + num19 = 6; + } + if (num17 == 4) + { + num18 = 3; + num19 = 3; + } + if (num17 == 5) + { + num18 = 5; + num19 = 3; + } + for (int l = num16 - num18; l <= num16 + num18; l++) + { + for (int m = num12 - num19; m <= num12; m++) + { + if (Main.tile[l, m].active()) + { + num17 = -1; + break; + } + } + } + if ((double)num15 < (double)num18 * 1.75) + { + num17 = -1; + } + if (num17 == 0) + { + WorldGen.PlaceTile(num16, num12, 14, true, false, -1, style2); + if (Main.tile[num16, num12].active()) + { + if (!Main.tile[num16 - 2, num12].active()) + { + WorldGen.PlaceTile(num16 - 2, num12, 15, true, false, -1, style); + if (Main.tile[num16 - 2, num12].active()) + { + Tile expr_5F7 = Main.tile[num16 - 2, num12]; + expr_5F7.frameX += 18; + Tile expr_618 = Main.tile[num16 - 2, num12 - 1]; + expr_618.frameX += 18; + } + } + if (!Main.tile[num16 + 2, num12].active()) + { + WorldGen.PlaceTile(num16 + 2, num12, 15, true, false, -1, style); + } + } + } + else + { + if (num17 == 1) + { + WorldGen.PlaceTile(num16, num12, 18, true, false, -1, style3); + if (Main.tile[num16, num12].active()) + { + if (WorldGen.genRand.Next(2) == 0) + { + if (!Main.tile[num16 - 1, num12].active()) + { + WorldGen.PlaceTile(num16 - 1, num12, 15, true, false, -1, style); + if (Main.tile[num16 - 1, num12].active()) + { + Tile expr_6F1 = Main.tile[num16 - 1, num12]; + expr_6F1.frameX += 18; + Tile expr_712 = Main.tile[num16 - 1, num12 - 1]; + expr_712.frameX += 18; + } + } + } + else + { + if (!Main.tile[num16 + 2, num12].active()) + { + WorldGen.PlaceTile(num16 + 2, num12, 15, true, false, -1, style); + } + } + } + } + else + { + if (num17 == 2) + { + WorldGen.PlaceTile(num16, num12, 105, true, false, -1, style4); + } + else + { + if (num17 == 3) + { + WorldGen.PlaceTile(num16, num12, 101, true, false, -1, style5); + } + else + { + if (num17 == 4) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.PlaceTile(num16, num12, 15, true, false, -1, style); + Tile expr_7BF = Main.tile[num16, num12]; + expr_7BF.frameX += 18; + Tile expr_7DE = Main.tile[num16, num12 - 1]; + expr_7DE.frameX += 18; + } + else + { + WorldGen.PlaceTile(num16, num12, 15, true, false, -1, style); + } + } + else + { + if (num17 == 5) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.Place4x2(num16, num12, 79, 1, style6); + } + else + { + WorldGen.Place4x2(num16, num12, 79, -1, style6); + } + } + } + } + } + } + } + } + } + num10++; + } + num9 = 420000f / (float)Main.maxTilesX; + int num20 = 0; + while ((float)num20 < num9) + { + int num21 = WorldGen.genRand.Next(num, Main.maxTilesX - num); + int num22 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); + while ((Main.tile[num21, num22].wall != 13 && Main.tile[num21, num22].wall != 14) || Main.tile[num21, num22].active()) + { + num21 = WorldGen.genRand.Next(num, Main.maxTilesX - num); + num22 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); + } + int num23; + int num24; + int num25; + int num26; + for (int n = 0; n < 2; n++) + { + num23 = num21; + num24 = num21; + while (!Main.tile[num23, num22].active() && (Main.tile[num23, num22].wall == 13 || Main.tile[num23, num22].wall == 14)) + { + num23--; + } + num23++; + while (!Main.tile[num24, num22].active() && (Main.tile[num24, num22].wall == 13 || Main.tile[num24, num22].wall == 14)) + { + num24++; + } + num24--; + num21 = (num23 + num24) / 2; + num25 = num22; + num26 = num22; + while (!Main.tile[num21, num25].active() && (Main.tile[num21, num25].wall == 13 || Main.tile[num21, num25].wall == 14)) + { + num25--; + } + num25++; + while (!Main.tile[num21, num26].active() && (Main.tile[num21, num26].wall == 13 || Main.tile[num21, num26].wall == 14)) + { + num26++; + } + num26--; + num22 = (num25 + num26) / 2; + } + num23 = num21; + num24 = num21; + while (!Main.tile[num23, num22].active() && !Main.tile[num23, num22 - 1].active() && !Main.tile[num23, num22 + 1].active()) + { + num23--; + } + num23++; + while (!Main.tile[num24, num22].active() && !Main.tile[num24, num22 - 1].active() && !Main.tile[num24, num22 + 1].active()) + { + num24++; + } + num24--; + num25 = num22; + num26 = num22; + while (!Main.tile[num21, num25].active() && !Main.tile[num21 - 1, num25].active() && !Main.tile[num21 + 1, num25].active()) + { + num25--; + } + num25++; + while (!Main.tile[num21, num26].active() && !Main.tile[num21 - 1, num26].active() && !Main.tile[num21 + 1, num26].active()) + { + num26++; + } + num26--; + num21 = (num23 + num24) / 2; + num22 = (num25 + num26) / 2; + int num27 = num24 - num23; + int num28 = num26 - num25; + if (num27 > 7 && num28 > 5) + { + int num29 = 0; + if (WorldGen.nearPicture2(num21, num22)) + { + num29 = -1; + } + if (num29 == 0) + { + Vector2 vector = WorldGen.randHellPicture(); + int type = (int)vector.X; + int style7 = (int)vector.Y; + if (!WorldGen.nearPicture(num21, num22)) + { + WorldGen.PlaceTile(num21, num22, type, true, false, -1, style7); + } + } + } + num20++; + } + int[] array = new int[] + { + WorldGen.genRand.Next(16, 22), + WorldGen.genRand.Next(16, 22), + WorldGen.genRand.Next(16, 22) + }; + while (array[1] == array[0]) + { + array[1] = WorldGen.genRand.Next(16, 22); + } + while (array[2] == array[0] || array[2] == array[1]) + { + array[2] = WorldGen.genRand.Next(16, 22); + } + num9 = 420000f / (float)Main.maxTilesX; + int num30 = 0; + while ((float)num30 < num9) + { + int num31 = WorldGen.genRand.Next(num, Main.maxTilesX - num); + int num32 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); + while ((Main.tile[num31, num32].wall != 13 && Main.tile[num31, num32].wall != 14) || Main.tile[num31, num32].active()) + { + num31 = WorldGen.genRand.Next(num, Main.maxTilesX - num); + num32 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); + } + while (!WorldGen.SolidTile(num31, num32) && num32 > 10) + { + num32--; + } + num32++; + if ((Main.tile[num31, num32].wall == 13 || Main.tile[num31, num32].wall == 14) && !Main.tile[num31, num32].active() && !Main.tile[num31, num32 + 1].active() && !Main.tile[num31, num32 + 2].active() && !Main.tile[num31, num32 + 3].active()) + { + bool flag3 = true; + for (int num33 = num31 - 1; num33 <= num31 + 1; num33++) + { + for (int num34 = num32; num34 <= num32 + 3; num34++) + { + if (Main.tile[num33, num34].active() && (Main.tile[num33, num34].type == 10 || Main.tile[num33, num34].type == 11 || Main.tile[num33, num34].type == 91)) + { + flag3 = false; + } + } + } + if (flag3) + { + int style8 = array[WorldGen.genRand.Next(3)]; + WorldGen.PlaceTile(num31, num32, 91, true, false, -1, style8); + } + } + num30++; + } + } + public static void HellFort(int i, int j, byte tileType = 75, byte wallType = 14) + { + int[] array = new int[5]; + int[] array2 = new int[5]; + int[] array3 = new int[10]; + int[] array4 = new int[10]; + int num = 8; + int num2 = 20; + array[2] = i - WorldGen.genRand.Next(num / 2, num2 / 2); + array2[2] = i + WorldGen.genRand.Next(num / 2, num2 / 2); + array[3] = array2[2]; + array2[3] = array[3] + WorldGen.genRand.Next(num, num2); + array[4] = array2[3]; + array2[4] = array[4] + WorldGen.genRand.Next(num, num2); + array2[1] = array[2]; + array[1] = array2[1] - WorldGen.genRand.Next(num, num2); + array2[0] = array[1]; + array[0] = array2[0] - WorldGen.genRand.Next(num, num2); + num = 6; + num2 = 12; + array3[3] = j - WorldGen.genRand.Next(num, num2); + array4[3] = j; + for (int k = 4; k < 10; k++) + { + array3[k] = array4[k - 1]; + array4[k] = array3[k] + WorldGen.genRand.Next(num, num2); + } + for (int l = 2; l >= 0; l--) + { + array4[l] = array3[l + 1]; + array3[l] = array4[l] - WorldGen.genRand.Next(num, num2); + } + bool flag = false; + bool flag2 = false; + bool[,] array5 = new bool[5, 10]; + int num3 = 3; + int num4 = 3; + for (int m = 0; m < 2; m++) + { + if (WorldGen.genRand.Next(3) == 0) + { + flag = true; + int num5 = WorldGen.genRand.Next(10); + if (num5 < num3) + { + num3 = num5; + } + if (num5 > num4) + { + num4 = num5; + } + int num6 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + array5[0, num5] = true; + array5[1, num5] = true; + num6 = 0; + } + else + { + array5[1, num5] = true; + } + int num7 = WorldGen.genRand.Next(2); + if (num7 == 0) + { + num7 = -1; + } + int num8 = WorldGen.genRand.Next(10); + while (num8 > 0 && num5 >= 0 && num5 < 10) + { + array5[num6, num5] = true; + num5 += num7; + } + } + if (WorldGen.genRand.Next(3) == 0) + { + flag2 = true; + int num9 = WorldGen.genRand.Next(10); + if (num9 < num3) + { + num3 = num9; + } + if (num9 > num4) + { + num4 = num9; + } + int num10 = 3; + if (WorldGen.genRand.Next(2) == 0) + { + array5[3, num9] = true; + array5[4, num9] = true; + num10 = 4; + } + else + { + array5[3, num9] = true; + } + int num11 = WorldGen.genRand.Next(2); + if (num11 == 0) + { + num11 = -1; + } + int num12 = WorldGen.genRand.Next(10); + while (num12 > 0 && num9 >= 0 && num9 < 10) + { + array5[num10, num9] = true; + num9 += num11; + } + } + } + for (int n = 0; n < 5; n++) + { + int num13 = array[n]; + bool flag3 = false; + for (int num14 = Main.maxTilesY - 200; num14 < Main.maxTilesY; num14++) + { + if (Main.tile[num13, num14].wall > 0) + { + flag3 = true; + } + } + if (flag3) + { + for (int num15 = 0; num15 < 10; num15++) + { + array5[n, num15] = false; + } + } + } + int num16 = WorldGen.genRand.Next(10); + if (num16 < num3) + { + num3 = num16; + } + num16 = WorldGen.genRand.Next(10); + if (num16 > num4) + { + num4 = num16; + } + if (!flag && !flag2) + { + while (num4 - num3 < 5) + { + num16 = WorldGen.genRand.Next(10); + if (num16 < num3) + { + num3 = num16; + } + num16 = WorldGen.genRand.Next(10); + if (num16 > num4) + { + num4 = num16; + } + } + } + for (int num17 = num3; num17 <= num4; num17++) + { + array5[2, num17] = true; + } + for (int num18 = 0; num18 < 5; num18++) + { + for (int num19 = 0; num19 < 10; num19++) + { + if (array5[num18, num19] && (array3[num19] < Main.maxTilesY - 200 || array4[num19] > Main.maxTilesY - 20)) + { + array5[num18, num19] = false; + } + } + } + for (int num20 = 0; num20 < 5; num20++) + { + for (int num21 = 0; num21 < 10; num21++) + { + if (array5[num20, num21]) + { + for (int num22 = array[num20]; num22 <= array2[num20]; num22++) + { + for (int num23 = array3[num21]; num23 <= array4[num21]; num23++) + { + Main.tile[num22, num23].liquid = 0; + if (num22 == array[num20] || num22 == array2[num20] || num23 == array3[num21] || num23 == array4[num21]) + { + Main.tile[num22, num23].active(true); + Main.tile[num22, num23].type = tileType; + Main.tile[num22, num23].halfBrick(false); + Main.tile[num22, num23].slope(0); + } + else + { + Main.tile[num22, num23].wall = wallType; + Main.tile[num22, num23].active(false); + } + } + } + } + } + } + int style = 19; + int style2 = 13; + for (int num24 = 0; num24 < 4; num24++) + { + bool[] array6 = new bool[10]; + bool flag4 = false; + for (int num25 = 0; num25 < 10; num25++) + { + if (array5[num24, num25] && array5[num24 + 1, num25]) + { + array6[num25] = true; + flag4 = true; + } + } + while (flag4) + { + int num26 = WorldGen.genRand.Next(10); + if (array6[num26]) + { + flag4 = false; + Main.tile[array2[num24], array4[num26] - 1].active(false); + Main.tile[array2[num24], array4[num26] - 2].active(false); + Main.tile[array2[num24], array4[num26] - 3].active(false); + Main.tile[array2[num24], array4[num26] - 1].wall = wallType; + Main.tile[array2[num24], array4[num26] - 2].wall = wallType; + Main.tile[array2[num24], array4[num26] - 3].wall = wallType; + WorldGen.PlaceTile(array2[num24], array4[num26] - 1, 10, true, false, -1, style); + } + } + } + for (int num27 = 0; num27 < 5; num27++) + { + for (int num28 = 0; num28 < 10; num28++) + { + if (array5[num27, num28]) + { + if (num28 > 0 && array5[num27, num28 - 1]) + { + int num29 = WorldGen.genRand.Next(array[num27] + 2, array2[num27] - 1); + int num30 = WorldGen.genRand.Next(array[num27] + 2, array2[num27] - 1); + while (num30 - num29 < 2 || num30 - num29 > 5) + { + num29 = WorldGen.genRand.Next(array[num27] + 2, array2[num27] - 1); + num30 = WorldGen.genRand.Next(array[num27] + 2, array2[num27] - 1); + } + for (int num31 = num29; num31 <= num30; num31++) + { + Main.tile[num31, array3[num28]].active(false); + WorldGen.PlaceTile(num31, array3[num28], 19, true, true, -1, style2); + Main.tile[num31, array3[num28]].wall = wallType; + } + } + if (num27 < 4 && array5[num27 + 1, num28] && WorldGen.genRand.Next(3) == 0) + { + Main.tile[array2[num27], array4[num28] - 1].active(false); + Main.tile[array2[num27], array4[num28] - 2].active(false); + Main.tile[array2[num27], array4[num28] - 3].active(false); + Main.tile[array2[num27], array4[num28] - 1].wall = wallType; + Main.tile[array2[num27], array4[num28] - 2].wall = wallType; + Main.tile[array2[num27], array4[num28] - 3].wall = wallType; + WorldGen.PlaceTile(array2[num27], array4[num28] - 1, 10, true, false, -1, style); + } + } + } + } + bool flag5 = false; + for (int num32 = 0; num32 < 5; num32++) + { + bool[] array7 = new bool[10]; + for (int num33 = 0; num33 < 10; num33++) + { + if (array5[num32, num33]) + { + flag5 = true; + array7[num33] = true; + } + } + if (flag5) + { + bool flag6 = false; + for (int num34 = 0; num34 < 10; num34++) + { + if (array7[num34]) + { + if (!Main.tile[array[num32] - 1, array4[num34] - 1].active() && !Main.tile[array[num32] - 1, array4[num34] - 2].active() && !Main.tile[array[num32] - 1, array4[num34] - 3].active() && Main.tile[array[num32] - 1, array4[num34] - 1].liquid == 0 && Main.tile[array[num32] - 1, array4[num34] - 2].liquid == 0 && Main.tile[array[num32] - 1, array4[num34] - 3].liquid == 0) + { + flag6 = true; + } + else + { + array7[num34] = false; + } + } + } + while (flag6) + { + int num35 = WorldGen.genRand.Next(10); + if (array7[num35]) + { + flag6 = false; + Main.tile[array[num32], array4[num35] - 1].active(false); + Main.tile[array[num32], array4[num35] - 2].active(false); + Main.tile[array[num32], array4[num35] - 3].active(false); + WorldGen.PlaceTile(array[num32], array4[num35] - 1, 10, true, false, -1, style); + } + } + break; + } + } + bool flag7 = false; + for (int num36 = 4; num36 >= 0; num36--) + { + bool[] array8 = new bool[10]; + for (int num37 = 0; num37 < 10; num37++) + { + if (array5[num36, num37]) + { + flag7 = true; + array8[num37] = true; + } + } + if (flag7) + { + bool flag8 = false; + for (int num38 = 0; num38 < 10; num38++) + { + if (array8[num38]) + { + if (!Main.tile[array2[num36] + 1, array4[num38] - 1].active() && !Main.tile[array2[num36] + 1, array4[num38] - 2].active() && !Main.tile[array2[num36] + 1, array4[num38] - 3].active() && Main.tile[array2[num36] + 1, array4[num38] - 1].liquid == 0 && Main.tile[array2[num36] + 1, array4[num38] - 2].liquid == 0 && Main.tile[array2[num36] + 1, array4[num38] - 3].liquid == 0) + { + flag8 = true; + } + else + { + array8[num38] = false; + } + } + } + while (flag8) + { + int num39 = WorldGen.genRand.Next(10); + if (array8[num39]) + { + flag8 = false; + Main.tile[array2[num36], array4[num39] - 1].active(false); + Main.tile[array2[num36], array4[num39] - 2].active(false); + Main.tile[array2[num36], array4[num39] - 3].active(false); + WorldGen.PlaceTile(array2[num36], array4[num39] - 1, 10, true, false, -1, style); + } + } + break; + } + } + bool flag9 = false; + for (int num40 = 0; num40 < 10; num40++) + { + bool[] array9 = new bool[10]; + for (int num41 = 0; num41 < 5; num41++) + { + if (array5[num41, num40]) + { + flag9 = true; + array9[num41] = true; + } + } + if (flag9) + { + bool flag10 = true; + while (flag10) + { + int num42 = WorldGen.genRand.Next(5); + if (array9[num42]) + { + int num43 = WorldGen.genRand.Next(array[num42] + 2, array2[num42] - 1); + int num44 = WorldGen.genRand.Next(array[num42] + 2, array2[num42] - 1); + while (num44 - num43 < 2 || num44 - num43 > 5) + { + num43 = WorldGen.genRand.Next(array[num42] + 2, array2[num42] - 1); + num44 = WorldGen.genRand.Next(array[num42] + 2, array2[num42] - 1); + } + for (int num45 = num43; num45 <= num44; num45++) + { + if (Main.tile[num45, array3[num40] - 1].active() || Main.tile[num45, array3[num40] - 1].liquid > 0) + { + flag10 = false; + } + } + if (flag10) + { + for (int num46 = num43; num46 <= num44; num46++) + { + Main.tile[num46, array3[num40]].active(false); + WorldGen.PlaceTile(num46, array3[num40], 19, true, true, -1, style2); + } + } + flag10 = false; + } + } + return; + } + } + } + public static void HellHouse(int i, int j, byte type = 76, byte wall = 13) + { + int num = WorldGen.genRand.Next(8, 20); + int num2 = WorldGen.genRand.Next(1, 3); + int num3 = WorldGen.genRand.Next(4, 13); + int num4 = j; + for (int k = 0; k < num2; k++) + { + int num5 = WorldGen.genRand.Next(5, 9); + WorldGen.HellRoom(i, num4, num, num5, type, wall); + num4 -= num5; + } + num4 = j; + for (int l = 0; l < num3; l++) + { + int num6 = WorldGen.genRand.Next(5, 9); + num4 += num6; + WorldGen.HellRoom(i, num4, num, num6, type, wall); + } + for (int m = i - num / 2; m <= i + num / 2; m++) + { + num4 = j; + while (num4 < Main.maxTilesY && ((Main.tile[m, num4].active() && (Main.tile[m, num4].type == 76 || Main.tile[m, num4].type == 75)) || Main.tile[i, num4].wall == 13 || Main.tile[i, num4].wall == 14)) + { + num4++; + } + int num7 = 6 + WorldGen.genRand.Next(3); + while (num4 < Main.maxTilesY && !Main.tile[m, num4].active()) + { + num7--; + Main.tile[m, num4].active(true); + Main.tile[m, num4].type = 57; + num4++; + if (num7 <= 0) + { + break; + } + } + } + int num8 = 0; + int num9 = 0; + num4 = j; + while (num4 < Main.maxTilesY && ((Main.tile[i, num4].active() && (Main.tile[i, num4].type == 76 || Main.tile[i, num4].type == 75)) || Main.tile[i, num4].wall == 13 || Main.tile[i, num4].wall == 14)) + { + num4++; + } + num4--; + num9 = num4; + while ((Main.tile[i, num4].active() && (Main.tile[i, num4].type == 76 || Main.tile[i, num4].type == 75)) || Main.tile[i, num4].wall == 13 || Main.tile[i, num4].wall == 14) + { + num4--; + if (Main.tile[i, num4].active() && (Main.tile[i, num4].type == 76 || Main.tile[i, num4].type == 75)) + { + int num10 = WorldGen.genRand.Next(i - num / 2 + 1, i + num / 2 - 1); + int num11 = WorldGen.genRand.Next(i - num / 2 + 1, i + num / 2 - 1); + if (num10 > num11) + { + int num12 = num10; + num10 = num11; + num11 = num12; + } + if (num10 == num11) + { + if (num10 < i) + { + num11++; + } + else + { + num10--; + } + } + for (int n = num10; n <= num11; n++) + { + if (Main.tile[n, num4 - 1].wall == 13) + { + Main.tile[n, num4].wall = 13; + } + if (Main.tile[n, num4 - 1].wall == 14) + { + Main.tile[n, num4].wall = 14; + } + Main.tile[n, num4].type = 19; + Main.tile[n, num4].active(true); + } + num4--; + } + } + num8 = num4; + float num13 = (float)((num9 - num8) * num); + float num14 = num13 * 0.02f; + int num15 = 0; + while ((float)num15 < num14) + { + int num16 = WorldGen.genRand.Next(i - num / 2, i + num / 2 + 1); + int num17 = WorldGen.genRand.Next(num8, num9); + int num18 = WorldGen.genRand.Next(3, 8); + for (int num19 = num16 - num18; num19 <= num16 + num18; num19++) + { + for (int num20 = num17 - num18; num20 <= num17 + num18; num20++) + { + float num21 = (float)Math.Abs(num19 - num16); + float num22 = (float)Math.Abs(num20 - num17); + double num23 = Math.Sqrt((double)(num21 * num21 + num22 * num22)); + if (num23 < (double)num18 * 0.4) + { + try + { + if (Main.tile[num19, num20].type == 76 || Main.tile[num19, num20].type == 19) + { + Main.tile[num19, num20].active(false); + } + Main.tile[num19, num20].wall = 0; + } + catch + { + } + } + } + } + num15++; + } + } + public static void HellRoom(int i, int j, int width, int height, byte type = 76, byte wall = 13) + { + if (j > Main.maxTilesY - 40) + { + return; + } + for (int k = i - width / 2; k <= i + width / 2; k++) + { + for (int l = j - height; l <= j; l++) + { + try + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = type; + Main.tile[k, l].liquid = 0; + Main.tile[k, l].lava(false); + } + catch + { + } + } + } + for (int m = i - width / 2 + 1; m <= i + width / 2 - 1; m++) + { + for (int n = j - height + 1; n <= j - 1; n++) + { + try + { + Main.tile[m, n].active(false); + Main.tile[m, n].wall = wall; + Main.tile[m, n].liquid = 0; + Main.tile[m, n].lava(false); + } + catch + { + } + } + } + } + public static void templeCleaner(int x, int y) + { + int num = 0; + if (Main.tile[x + 1, y].active() && Main.tile[x + 1, y].type == 226) + { + num++; + } + if (Main.tile[x - 1, y].active() && Main.tile[x - 1, y].type == 226) + { + num++; + } + if (Main.tile[x, y + 1].active() && Main.tile[x, y + 1].type == 226) + { + num++; + } + if (Main.tile[x, y - 1].active() && Main.tile[x, y - 1].type == 226) + { + num++; + } + if (Main.tile[x, y].active() && Main.tile[x, y].type == 226) + { + if (num <= 1) + { + Main.tile[x, y].active(false); + Main.tile[x, y].wall = 87; + return; + } + } + else + { + if (!Main.tile[x, y].active() && num == 3) + { + Main.tile[x, y].active(true); + Main.tile[x, y].type = 226; + Main.tile[x, y].liquid = 0; + Main.tile[x, y].slope(0); + Main.tile[x, y].halfBrick(false); + } + } + } + public static Vector2 templePather(Vector2 templePath, int destX, int destY) + { + int num = (int)templePath.X; + int num2 = (int)templePath.Y; + int num3 = WorldGen.genRand.Next(5, 20); + int num4 = WorldGen.genRand.Next(2, 5); + while (num3 > 0 && (num != destX || num2 != destY)) + { + num3--; + if (num > destX) + { + num--; + } + if (num < destX) + { + num++; + } + if (num2 > destY) + { + num2--; + } + if (num2 < destY) + { + num2++; + } + for (int i = num - num4; i < num + num4; i++) + { + for (int j = num2 - num4; j < num2 + num4; j++) + { + Main.tile[i, j].active(false); + Main.tile[i, j].wall = 87; + } + } + } + return new Vector2((float)num, (float)num2); + } + public static void outerTempled(int x, int y) + { + if (Main.tile[x, y].active() & Main.tile[x, y].type == 226) + { + return; + } + if (Main.tile[x, y].wall == 87) + { + return; + } + int num = 6; + for (int i = x - num; i <= x + num; i++) + { + for (int j = y - num; j <= y + num; j++) + { + if (!Main.tile[i, j].active() && Main.tile[i, j].wall == 87) + { + Main.tile[x, y].active(true); + Main.tile[x, y].type = 226; + Main.tile[x, y].liquid = 0; + Main.tile[x, y].slope(0); + Main.tile[x, y].halfBrick(false); + return; + } + } + } + } + public static void makeTemple(int x, int y) + { + Rectangle[] array = new Rectangle[40]; + float num = (float)(Main.maxTilesX / 4200); + int num2 = WorldGen.genRand.Next((int)(num * 10f), (int)(num * 16f)); + int num3 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num3 = -1; + } + int num4 = num3; + int num5 = x; + int num6 = y; + int num7 = x; + int num8 = y; + int num9 = WorldGen.genRand.Next(1, 3); + int num10 = 0; + for (int i = 0; i < num2; i++) + { + num10++; + int num11 = num3; + int num12 = num7; + int num13 = num8; + bool flag = true; + int num14 = 0; + int num15 = 0; + int num16 = -10; + Rectangle rectangle = new Rectangle(num12 - num14 / 2, num13 - num15 / 2, num14, num15); + while (flag) + { + num12 = num7; + num13 = num8; + num14 = WorldGen.genRand.Next(25, 50); + num15 = WorldGen.genRand.Next(20, 35); + if (num15 > num14) + { + num15 = num14; + } + if (i == num2 - 1) + { + num14 = WorldGen.genRand.Next(50, 60); + num15 = WorldGen.genRand.Next(40, 45); + if (num15 > num14) + { + num15 = num14; + } + num14 = (int)((double)((float)num14) * 1.5); + num15 = (int)((double)((float)num15) * 1.25); + num13 += WorldGen.genRand.Next(5, 10); + } + if (num10 > num9) + { + num13 += WorldGen.genRand.Next(num15 + 1, num15 + 3) + num16; + num12 += WorldGen.genRand.Next(-5, 6); + num11 = num3 * -1; + } + else + { + num12 += (WorldGen.genRand.Next(num14 + 1, num14 + 3) + num16) * num11; + num13 += WorldGen.genRand.Next(-5, 6); + } + flag = false; + rectangle = new Rectangle(num12 - num14 / 2, num13 - num15 / 2, num14, num15); + for (int j = 0; j < i; j++) + { + if (rectangle.Intersects(array[j])) + { + flag = true; + } + if (WorldGen.genRand.Next(100) == 0) + { + num16++; + } + } + } + if (num10 > num9) + { + num9++; + num10 = 1; + } + array[i] = rectangle; + num3 = num11; + num7 = num12; + num8 = num13; + } + for (int k = 0; k < num2; k++) + { + for (int l = 0; l < 2; l++) + { + for (int m = 0; m < num2; m++) + { + for (int n = 0; n < 2; n++) + { + int num17 = array[k].X; + if (l == 1) + { + num17 += array[k].Width - 1; + } + int num18 = array[k].Y; + int num19 = num18 + array[k].Height; + int num20 = array[m].X; + if (n == 1) + { + num20 += array[m].Width - 1; + } + int y2 = array[m].Y; + int num21 = y2 + array[m].Height; + while (num17 != num20 || num18 != y2 || num19 != num21) + { + if (num17 < num20) + { + num17++; + } + if (num17 > num20) + { + num17--; + } + if (num18 < y2) + { + num18++; + } + if (num18 > y2) + { + num18--; + } + if (num19 < num21) + { + num19++; + } + if (num19 > num21) + { + num19--; + } + int num22 = num17; + for (int num23 = num18; num23 < num19; num23++) + { + Main.tile[num22, num23].active(true); + Main.tile[num22, num23].type = 226; + Main.tile[num22, num23].liquid = 0; + Main.tile[num22, num23].slope(0); + Main.tile[num22, num23].halfBrick(false); + } + } + } + } + } + } + for (int num24 = 0; num24 < num2; num24++) + { + if (WorldGen.genRand.Next(1) == 0) + { + for (int num25 = array[num24].X; num25 < array[num24].X + array[num24].Width; num25++) + { + for (int num26 = array[num24].Y; num26 < array[num24].Y + array[num24].Height; num26++) + { + Main.tile[num25, num26].active(true); + Main.tile[num25, num26].type = 226; + Main.tile[num25, num26].liquid = 0; + Main.tile[num25, num26].slope(0); + Main.tile[num25, num26].halfBrick(false); + } + } + int num27 = array[num24].X; + int num28 = num27 + array[num24].Width; + int num29 = array[num24].Y; + int num30 = num29 + array[num24].Height; + num27 += WorldGen.genRand.Next(3, 8); + num28 -= WorldGen.genRand.Next(3, 8); + num29 += WorldGen.genRand.Next(3, 8); + num30 -= WorldGen.genRand.Next(3, 8); + int num31 = num27; + int num32 = num28; + int num33 = num29; + int num34 = num30; + int num35 = (num27 + num28) / 2; + int num36 = (num29 + num30) / 2; + for (int num37 = num27; num37 < num28; num37++) + { + for (int num38 = num29; num38 < num30; num38++) + { + if (WorldGen.genRand.Next(20) == 0) + { + num33 += WorldGen.genRand.Next(-1, 2); + } + if (WorldGen.genRand.Next(20) == 0) + { + num34 += WorldGen.genRand.Next(-1, 2); + } + if (WorldGen.genRand.Next(20) == 0) + { + num31 += WorldGen.genRand.Next(-1, 2); + } + if (WorldGen.genRand.Next(20) == 0) + { + num32 += WorldGen.genRand.Next(-1, 2); + } + if (num31 < num27) + { + num31 = num27; + } + if (num32 > num28) + { + num32 = num28; + } + if (num33 < num29) + { + num33 = num29; + } + if (num34 > num30) + { + num34 = num30; + } + if (num31 > num35) + { + num31 = num35; + } + if (num32 < num35) + { + num32 = num35; + } + if (num33 > num36) + { + num33 = num36; + } + if (num34 < num36) + { + num34 = num36; + } + if (num37 >= num31 && (num37 < num32 & num38 >= num33) && num38 <= num34) + { + Main.tile[num37, num38].active(false); + Main.tile[num37, num38].wall = 87; + } + } + } + for (int num39 = num30; num39 > num29; num39--) + { + for (int num40 = num28; num40 > num27; num40--) + { + if (WorldGen.genRand.Next(20) == 0) + { + num33 += WorldGen.genRand.Next(-1, 2); + } + if (WorldGen.genRand.Next(20) == 0) + { + num34 += WorldGen.genRand.Next(-1, 2); + } + if (WorldGen.genRand.Next(20) == 0) + { + num31 += WorldGen.genRand.Next(-1, 2); + } + if (WorldGen.genRand.Next(20) == 0) + { + num32 += WorldGen.genRand.Next(-1, 2); + } + if (num31 < num27) + { + num31 = num27; + } + if (num32 > num28) + { + num32 = num28; + } + if (num33 < num29) + { + num33 = num29; + } + if (num34 > num30) + { + num34 = num30; + } + if (num31 > num35) + { + num31 = num35; + } + if (num32 < num35) + { + num32 = num35; + } + if (num33 > num36) + { + num33 = num36; + } + if (num34 < num36) + { + num34 = num36; + } + if (num40 >= num31 && (num40 < num32 & num39 >= num33) && num39 <= num34) + { + Main.tile[num40, num39].active(false); + Main.tile[num40, num39].wall = 87; + } + } + } + } + } + Vector2 templePath = new Vector2((float)num5, (float)num6); + for (int num41 = 0; num41 < num2; num41++) + { + Rectangle rectangle2 = array[num41]; + rectangle2.X += 8; + rectangle2.Y += 8; + rectangle2.Width -= 16; + rectangle2.Height -= 16; + bool flag2 = true; + while (flag2) + { + int num42 = WorldGen.genRand.Next(rectangle2.X, rectangle2.X + rectangle2.Width); + int num43 = WorldGen.genRand.Next(rectangle2.Y, rectangle2.Y + rectangle2.Height); + templePath = WorldGen.templePather(templePath, num42, num43); + if (templePath.X == (float)num42 && templePath.Y == (float)num43) + { + flag2 = false; + } + } + if (num41 < num2 - 1) + { + if (WorldGen.genRand.Next(3) != 0) + { + int num44 = num41 + 1; + if (array[num44].Y >= array[num41].Y + array[num41].Height) + { + rectangle2.X = array[num44].X; + if (array[num44].X < array[num41].X) + { + rectangle2.X += (int)((double)((float)array[num44].Width) * 0.2); + } + else + { + rectangle2.X += (int)((double)((float)array[num44].Width) * 0.8); + } + rectangle2.Y = array[num44].Y; + } + else + { + rectangle2.X = (array[num41].X + array[num41].Width / 2 + (array[num44].X + array[num44].Width / 2)) / 2; + rectangle2.Y = (int)((double)array[num44].Y + (double)array[num44].Height * 0.8); + } + int x2 = rectangle2.X; + int y3 = rectangle2.Y; + flag2 = true; + while (flag2) + { + int num45 = WorldGen.genRand.Next(x2 - 6, x2 + 7); + int num46 = WorldGen.genRand.Next(y3 - 6, y3 + 7); + templePath = WorldGen.templePather(templePath, num45, num46); + if (templePath.X == (float)num45 && templePath.Y == (float)num46) + { + flag2 = false; + } + } + } + else + { + int num47 = num41 + 1; + int num48 = (array[num41].X + array[num41].Width / 2 + (array[num47].X + array[num47].Width / 2)) / 2; + int num49 = (array[num41].Y + array[num41].Height / 2 + (array[num47].Y + array[num47].Height / 2)) / 2; + flag2 = true; + while (flag2) + { + int num50 = WorldGen.genRand.Next(num48 - 6, num48 + 7); + int num51 = WorldGen.genRand.Next(num49 - 6, num49 + 7); + templePath = WorldGen.templePather(templePath, num50, num51); + if (templePath.X == (float)num50 && templePath.Y == (float)num51) + { + flag2 = false; + } + } + } + } + } + int num52 = Main.maxTilesX - 20; + int num53 = 20; + int num54 = Main.maxTilesY - 20; + int num55 = 20; + for (int num56 = 0; num56 < num2; num56++) + { + if (array[num56].X < num52) + { + num52 = array[num56].X; + } + if (array[num56].X + array[num56].Width > num53) + { + num53 = array[num56].X + array[num56].Width; + } + if (array[num56].Y < num54) + { + num54 = array[num56].Y; + } + if (array[num56].Y + array[num56].Height > num55) + { + num55 = array[num56].Y + array[num56].Height; + } + } + num52 -= 10; + num53 += 10; + num54 -= 10; + num55 += 10; + for (int num57 = num52; num57 < num53; num57++) + { + for (int num58 = num54; num58 < num55; num58++) + { + WorldGen.outerTempled(num57, num58); + } + } + for (int num59 = num53; num59 >= num52; num59--) + { + for (int num60 = num54; num60 < num55 / 2; num60++) + { + WorldGen.outerTempled(num59, num60); + } + } + for (int num61 = num54; num61 < num55; num61++) + { + for (int num62 = num52; num62 < num53; num62++) + { + WorldGen.outerTempled(num62, num61); + } + } + for (int num63 = num55; num63 >= num54; num63--) + { + for (int num64 = num52; num64 < num53; num64++) + { + WorldGen.outerTempled(num64, num63); + } + } + num3 = -num4; + Vector2 vector = new Vector2((float)num5, (float)num6); + int num65 = WorldGen.genRand.Next(2, 5); + bool flag3 = true; + int num66 = 0; + int num67 = WorldGen.genRand.Next(9, 14); + while (flag3) + { + num66++; + if (num66 >= num67) + { + num66 = 0; + vector.Y -= 1f; + } + vector.X += (float)num3; + int num68 = (int)vector.X; + flag3 = false; + int num69 = (int)vector.Y - num65; + while ((float)num69 < vector.Y + (float)num65) + { + if (Main.tile[num68, num69].wall == 87 || (Main.tile[num68, num69].active() && Main.tile[num68, num69].type == 226)) + { + flag3 = true; + } + if (Main.tile[num68, num69].active() && Main.tile[num68, num69].type == 226) + { + Main.tile[num68, num69].active(false); + Main.tile[num68, num69].wall = 87; + } + num69++; + } + } + int num70 = num5; + int num71 = num6; + while (!Main.tile[num70, num71].active()) + { + num71++; + } + num71 -= 4; + int num72 = num71; + while ((Main.tile[num70, num72].active() && Main.tile[num70, num72].type == 226) || Main.tile[num70, num72].wall == 87) + { + num72--; + } + num72 += 2; + for (int num73 = num70 - 1; num73 <= num70 + 1; num73++) + { + for (int num74 = num72; num74 <= num71; num74++) + { + Main.tile[num73, num74].active(true); + Main.tile[num73, num74].type = 226; + Main.tile[num73, num74].liquid = 0; + Main.tile[num73, num74].slope(0); + Main.tile[num73, num74].halfBrick(false); + } + } + for (int num75 = num70 - 4; num75 <= num70 + 4; num75++) + { + for (int num76 = num71 - 1; num76 < num71 + 3; num76++) + { + Main.tile[num75, num76].active(false); + Main.tile[num75, num76].wall = 87; + } + } + for (int num77 = num70 - 1; num77 <= num70 + 1; num77++) + { + for (int num78 = num71 - 5; num78 <= num71 + 8; num78++) + { + Main.tile[num77, num78].active(true); + Main.tile[num77, num78].type = 226; + Main.tile[num77, num78].liquid = 0; + Main.tile[num77, num78].slope(0); + Main.tile[num77, num78].halfBrick(false); + } + } + for (int num79 = num70 - 1; num79 <= num70 + 1; num79++) + { + for (int num80 = num71; num80 < num71 + 3; num80++) + { + Main.tile[num79, num80].active(false); + Main.tile[num79, num80].wall = 87; + } + } + WorldGen.PlaceTile(num70, num71, 10, true, false, -1, 11); + for (int num81 = num52; num81 < num53; num81++) + { + for (int num82 = num54; num82 < num55; num82++) + { + WorldGen.templeCleaner(num81, num82); + } + } + for (int num83 = num55; num83 >= num54; num83--) + { + for (int num84 = num53; num84 >= num52; num84--) + { + WorldGen.templeCleaner(num84, num83); + } + } + for (int num85 = num52; num85 < num53; num85++) + { + for (int num86 = num54; num86 < num55; num86++) + { + bool flag4 = true; + for (int num87 = num85 - 1; num87 <= num85 + 1; num87++) + { + for (int num88 = num86 - 1; num88 <= num86 + 1; num88++) + { + if ((!Main.tile[num87, num88].active() || Main.tile[num87, num88].type != 226) && Main.tile[num87, num88].wall != 87) + { + flag4 = false; + break; + } + } + } + if (flag4) + { + Main.tile[num85, num86].wall = 87; + } + } + } + int num89 = 0; + Rectangle rectangle3; + int num90; + int num91; + do + { + num89++; + rectangle3 = array[num2 - 1]; + num90 = rectangle3.X + WorldGen.genRand.Next(rectangle3.Width); + num91 = rectangle3.Y + WorldGen.genRand.Next(rectangle3.Height); + WorldGen.PlaceTile(num90, num91, 237, false, false, -1, 0); + if (Main.tile[num90, num91].type == 237) + { + goto IL_14EC; + } + } + while (num89 < 1000); + num90 = rectangle3.X + rectangle3.Width / 2; + num91 = rectangle3.Y + rectangle3.Height / 2; + num90 += WorldGen.genRand.Next(-10, 11); + num91 += WorldGen.genRand.Next(-10, 11); + while (!Main.tile[num90, num91].active()) + { + num91++; + } + Main.tile[num90 - 1, num91].active(true); + Main.tile[num90 - 1, num91].slope(0); + Main.tile[num90 - 1, num91].halfBrick(false); + Main.tile[num90 - 1, num91].type = 226; + Main.tile[num90, num91].active(true); + Main.tile[num90, num91].slope(0); + Main.tile[num90, num91].halfBrick(false); + Main.tile[num90, num91].type = 226; + Main.tile[num90 + 1, num91].active(true); + Main.tile[num90 + 1, num91].slope(0); + Main.tile[num90 + 1, num91].halfBrick(false); + Main.tile[num90 + 1, num91].type = 226; + num91 -= 2; + num90--; + for (int num92 = 0; num92 <= 2; num92++) + { + for (int num93 = 0; num93 <= 1; num93++) + { + x = num90 + num92; + y = num91 + num93; + Main.tile[x, y].active(true); + Main.tile[x, y].type = 237; + Main.tile[x, y].frameX = (short)(num92 * 18); + Main.tile[x, y].frameY = (short)(num93 * 18); + } + } + IL_14EC: + float num94 = (float)num2 * 1.1f; + num94 *= 1f + (float)WorldGen.genRand.Next(-25, 26) * 0.01f; + int num95 = 0; + while (num94 > 0f) + { + num95++; + int num96 = WorldGen.genRand.Next(num2); + int num97 = WorldGen.genRand.Next(array[num96].X, array[num96].X + array[num96].Width); + int num98 = WorldGen.genRand.Next(array[num96].Y, array[num96].Y + array[num96].Height); + if (Main.tile[num97, num98].wall == 87 && !Main.tile[num97, num98].active()) + { + bool flag5 = false; + if (WorldGen.genRand.Next(2) == 0) + { + int num99 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num99 = -1; + } + while (!Main.tile[num97, num98].active()) + { + num98 += num99; + } + num98 -= num99; + int num100 = WorldGen.genRand.Next(2); + int num101 = WorldGen.genRand.Next(3, 10); + bool flag6 = true; + for (int num102 = num97 - num101; num102 < num97 + num101; num102++) + { + for (int num103 = num98 - num101; num103 < num98 + num101; num103++) + { + if (Main.tile[num102, num103].active() && Main.tile[num102, num103].type == 10) + { + flag6 = false; + break; + } + } + } + if (flag6) + { + for (int num104 = num97 - num101; num104 < num97 + num101; num104++) + { + for (int num105 = num98 - num101; num105 < num98 + num101; num105++) + { + if (WorldGen.SolidTile(num104, num105) && Main.tile[num104, num105].type != 232 && !WorldGen.SolidTile(num104, num105 - num99)) + { + Main.tile[num104, num105].type = 232; + flag5 = true; + if (num100 == 0) + { + Main.tile[num104, num105 - 1].type = 232; + Main.tile[num104, num105 - 1].active(true); + } + else + { + Main.tile[num104, num105 + 1].type = 232; + Main.tile[num104, num105 + 1].active(true); + } + num100++; + if (num100 > 1) + { + num100 = 0; + } + } + } + } + } + if (flag5) + { + num95 = 0; + num94 -= 1f; + } + } + else + { + int num106 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num106 = -1; + } + while (!Main.tile[num97, num98].active()) + { + num97 += num106; + } + num97 -= num106; + int num107 = WorldGen.genRand.Next(2); + int num108 = WorldGen.genRand.Next(3, 10); + bool flag7 = true; + for (int num109 = num97 - num108; num109 < num97 + num108; num109++) + { + for (int num110 = num98 - num108; num110 < num98 + num108; num110++) + { + if (Main.tile[num109, num110].active() && Main.tile[num109, num110].type == 10) + { + flag7 = false; + break; + } + } + } + if (flag7) + { + for (int num111 = num97 - num108; num111 < num97 + num108; num111++) + { + for (int num112 = num98 - num108; num112 < num98 + num108; num112++) + { + if (WorldGen.SolidTile(num111, num112) && Main.tile[num111, num112].type != 232 && !WorldGen.SolidTile(num111 - num106, num112)) + { + Main.tile[num111, num112].type = 232; + flag5 = true; + if (num107 == 0) + { + Main.tile[num111 - 1, num112].type = 232; + Main.tile[num111 - 1, num112].active(true); + } + else + { + Main.tile[num111 + 1, num112].type = 232; + Main.tile[num111 + 1, num112].active(true); + } + num107++; + if (num107 > 1) + { + num107 = 0; + } + } + } + } + } + if (flag5) + { + num95 = 0; + num94 -= 1f; + } + } + } + if (num95 > 1000) + { + num95 = 0; + num94 -= 1f; + } + } + WorldGen.tLeft = num52; + WorldGen.tRight = num53; + WorldGen.tTop = num54; + WorldGen.tBottom = num55; + WorldGen.tRooms = num2; + } + public static void templePart2() + { + int minValue = WorldGen.tLeft; + int maxValue = WorldGen.tRight; + int minValue2 = WorldGen.tTop; + int num = WorldGen.tBottom; + int num2 = WorldGen.tRooms; + float num3 = (float)num2 * 1.9f; + num3 *= 1f + (float)WorldGen.genRand.Next(-15, 16) * 0.01f; + int num4 = 0; + while (num3 > 0f) + { + int num5 = WorldGen.genRand.Next(minValue, maxValue); + int num6 = WorldGen.genRand.Next(minValue2, num); + if (Main.tile[num5, num6].wall == 87 && !Main.tile[num5, num6].active()) + { + if (WorldGen.mayanTrap(num5, num6)) + { + num3 -= 1f; + num4 = 0; + } + else + { + num4++; + } + } + else + { + num4++; + } + if (num4 > 100) + { + num4 = 0; + num3 -= 1f; + } + } + Main.tileSolid[232] = false; + float num7 = (float)num2 * 0.35f; + num7 *= 1f + (float)WorldGen.genRand.Next(-15, 16) * 0.01f; + int contain = 1293; + num4 = 0; + while (num7 > 0f) + { + int num8 = WorldGen.genRand.Next(minValue, maxValue); + int num9 = WorldGen.genRand.Next(minValue2, num); + if (Main.tile[num8, num9].wall == 87 && !Main.tile[num8, num9].active() && WorldGen.AddBuriedChest(num8, num9, contain, true, 16)) + { + num7 -= 1f; + num4 = 0; + } + num4++; + if (num4 > 10000) + { + break; + } + } + float num10 = (float)num2 * 1.25f; + num10 *= 1f + (float)WorldGen.genRand.Next(-25, 36) * 0.01f; + num4 = 0; + while (num10 > 0f) + { + num4++; + int num11 = WorldGen.genRand.Next(minValue, maxValue); + int num12 = WorldGen.genRand.Next(minValue2, num); + if (Main.tile[num11, num12].wall == 87 && !Main.tile[num11, num12].active()) + { + int num13 = num11; + int num14 = num12; + while (!Main.tile[num13, num14].active()) + { + num14++; + if (num14 > num) + { + break; + } + } + num14--; + if (num14 <= num) + { + WorldGen.PlaceTile(num13, num14, 105, true, false, -1, WorldGen.genRand.Next(43, 46)); + if (Main.tile[num13, num14].type == 105) + { + num10 -= 1f; + } + } + } + } + float num15 = (float)num2 * 1.35f; + num15 *= 1f + (float)WorldGen.genRand.Next(-15, 26) * 0.01f; + num4 = 0; + while (num15 > 0f) + { + num4++; + int num16 = WorldGen.genRand.Next(minValue, maxValue); + int num17 = WorldGen.genRand.Next(minValue2, num); + if (Main.tile[num16, num17].wall == 87 && !Main.tile[num16, num17].active()) + { + int num18 = num16; + int num19 = num17; + while (!Main.tile[num18, num19].active()) + { + num19++; + if (num19 > num) + { + break; + } + } + num19--; + if (num19 <= num) + { + int num20 = WorldGen.genRand.Next(3); + if (num20 == 0) + { + WorldGen.PlaceTile(num18, num19, 18, true, false, -1, 10); + if (Main.tile[num18, num19].type == 18) + { + num15 -= 1f; + } + } + else + { + if (num20 == 1) + { + WorldGen.PlaceTile(num18, num19, 14, true, false, -1, 9); + if (Main.tile[num18, num19].type == 14) + { + num15 -= 1f; + } + } + else + { + if (num20 == 2) + { + WorldGen.PlaceTile(num18, num19, 15, true, false, -1, 12); + if (Main.tile[num18, num19].type == 15) + { + num15 -= 1f; + } + } + } + } + } + } + if (num4 > 10000) + { + break; + } + } + Main.tileSolid[232] = true; + } + public static void dWallOut(int x, int y, int wall) + { + if (!WorldGen.SolidTile(x, y) && (int)Main.tile[x, y].wall != wall && Main.tile[x, y].wall > 0) + { + WorldGen.dWallCount++; + if (WorldGen.dWallCount > 1000) + { + Main.tile[x, y].wall = 17; + WorldGen.dWallBroke = true; + return; + } + Main.tile[x, y].wall = (byte)wall; + if ((int)Main.tile[x - 1, y].wall != wall) + { + WorldGen.dWallOut(x - 1, y, wall); + } + if ((int)Main.tile[x + 1, y].wall != wall) + { + WorldGen.dWallOut(x + 1, y, wall); + } + if ((int)Main.tile[x, y - 1].wall != wall) + { + WorldGen.dWallOut(x, y - 1, wall); + } + if ((int)Main.tile[x, y + 1].wall != wall) + { + WorldGen.dWallOut(x, y + 1, wall); + return; + } + } + else + { + if (Main.tile[x, y].active()) + { + Main.tile[x, y].wall = (byte)wall; + } + } + } + public static bool nearPicture(int x, int y) + { + for (int i = x - 4; i <= x + 3; i++) + { + for (int j = y - 3; j <= y + 2; j++) + { + if (Main.tile[i, j].active()) + { + return true; + } + } + } + return false; + } + public static bool nearPicture2(int x, int y) + { + if (Main.tile[x, y].wall != 7 && Main.tile[x, y].wall != 8 && Main.tile[x, y].wall != 9) + { + for (int i = x - 8; i <= x + 8; i++) + { + for (int j = y - 5; j <= y + 5; j++) + { + if (Main.tile[i, j].active() && (Main.tile[i, j].type == 240 || Main.tile[i, j].type == 241 || Main.tile[i, j].type == 242)) + { + return true; + } + } + } + } + else + { + for (int k = x - 15; k <= x + 15; k++) + { + for (int l = y - 10; l <= y + 10; l++) + { + if (Main.tile[k, l].active() && (Main.tile[k, l].type == 240 || Main.tile[k, l].type == 241 || Main.tile[k, l].type == 242)) + { + return true; + } + } + } + } + return false; + } + public static void MakeDungeon(int x, int y, int tileType = 41, int wallType = 7) + { + int num = WorldGen.genRand.Next(3); + int num2 = WorldGen.genRand.Next(3); + num2 = num; + if (num == 1) + { + tileType = 43; + } + else + { + if (num == 2) + { + tileType = 44; + } + } + if (num2 == 1) + { + wallType = 8; + } + else + { + if (num2 == 2) + { + wallType = 9; + } + } + WorldGen.numDDoors = 0; + WorldGen.numDPlats = 0; + WorldGen.numDRooms = 0; + WorldGen.dungeonX = x; + WorldGen.dungeonY = y; + WorldGen.dMinX = x; + WorldGen.dMaxX = x; + WorldGen.dMinY = y; + WorldGen.dMaxY = y; + WorldGen.dxStrength1 = (double)WorldGen.genRand.Next(25, 30); + WorldGen.dyStrength1 = (double)WorldGen.genRand.Next(20, 25); + WorldGen.dxStrength2 = (double)WorldGen.genRand.Next(35, 50); + WorldGen.dyStrength2 = (double)WorldGen.genRand.Next(10, 15); + float num3 = (float)(Main.maxTilesX / 60); + num3 += (float)WorldGen.genRand.Next(0, (int)(num3 / 3f)); + float num4 = num3; + int num5 = 5; + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + while (num3 > 0f) + { + if (WorldGen.dungeonX < WorldGen.dMinX) + { + WorldGen.dMinX = WorldGen.dungeonX; + } + if (WorldGen.dungeonX > WorldGen.dMaxX) + { + WorldGen.dMaxX = WorldGen.dungeonX; + } + if (WorldGen.dungeonY > WorldGen.dMaxY) + { + WorldGen.dMaxY = WorldGen.dungeonY; + } + num3 -= 1f; + Main.statusText = string.Concat(new object[] + { + Lang.gen[58], + " ", + (int)((num4 - num3) / num4 * 60f), + "%" + }); + if (num5 > 0) + { + num5--; + } + if (num5 == 0 & WorldGen.genRand.Next(3) == 0) + { + num5 = 5; + if (WorldGen.genRand.Next(2) == 0) + { + int num6 = WorldGen.dungeonX; + int num7 = WorldGen.dungeonY; + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType, false); + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType, false); + } + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + WorldGen.dungeonX = num6; + WorldGen.dungeonY = num7; + } + else + { + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + } + } + else + { + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType, false); + } + } + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + int num8 = WorldGen.dRoomX[0]; + int num9 = WorldGen.dRoomY[0]; + for (int i = 0; i < WorldGen.numDRooms; i++) + { + if (WorldGen.dRoomY[i] < num9) + { + num8 = WorldGen.dRoomX[i]; + num9 = WorldGen.dRoomY[i]; + } + } + WorldGen.dungeonX = num8; + WorldGen.dungeonY = num9; + WorldGen.dEnteranceX = num8; + WorldGen.dSurface = false; + num5 = 5; + while (!WorldGen.dSurface) + { + if (num5 > 0) + { + num5--; + } + if (num5 == 0 && WorldGen.genRand.Next(5) == 0 && (double)WorldGen.dungeonY > Main.worldSurface + 100.0) + { + num5 = 10; + int num10 = WorldGen.dungeonX; + int num11 = WorldGen.dungeonY; + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType, true); + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + WorldGen.dungeonX = num10; + WorldGen.dungeonY = num11; + } + WorldGen.DungeonStairs(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + } + WorldGen.DungeonEnt(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + Main.statusText = Lang.gen[58] + " 65%"; + for (int j = 0; j < WorldGen.numDRooms; j++) + { + for (int k = WorldGen.dRoomL[j]; k <= WorldGen.dRoomR[j]; k++) + { + if (!Main.tile[k, WorldGen.dRoomT[j] - 1].active()) + { + WorldGen.DPlatX[WorldGen.numDPlats] = k; + WorldGen.DPlatY[WorldGen.numDPlats] = WorldGen.dRoomT[j] - 1; + WorldGen.numDPlats++; + break; + } + } + for (int l = WorldGen.dRoomL[j]; l <= WorldGen.dRoomR[j]; l++) + { + if (!Main.tile[l, WorldGen.dRoomB[j] + 1].active()) + { + WorldGen.DPlatX[WorldGen.numDPlats] = l; + WorldGen.DPlatY[WorldGen.numDPlats] = WorldGen.dRoomB[j] + 1; + WorldGen.numDPlats++; + break; + } + } + for (int m = WorldGen.dRoomT[j]; m <= WorldGen.dRoomB[j]; m++) + { + if (!Main.tile[WorldGen.dRoomL[j] - 1, m].active()) + { + WorldGen.DDoorX[WorldGen.numDDoors] = WorldGen.dRoomL[j] - 1; + WorldGen.DDoorY[WorldGen.numDDoors] = m; + WorldGen.DDoorPos[WorldGen.numDDoors] = -1; + WorldGen.numDDoors++; + break; + } + } + for (int n = WorldGen.dRoomT[j]; n <= WorldGen.dRoomB[j]; n++) + { + if (!Main.tile[WorldGen.dRoomR[j] + 1, n].active()) + { + WorldGen.DDoorX[WorldGen.numDDoors] = WorldGen.dRoomR[j] + 1; + WorldGen.DDoorY[WorldGen.numDDoors] = n; + WorldGen.DDoorPos[WorldGen.numDDoors] = 1; + WorldGen.numDDoors++; + break; + } + } + } + Main.statusText = Lang.gen[58] + " 70%"; + int num12 = 0; + int num13 = 1000; + int num14 = 0; + while (num14 < Main.maxTilesX / 100) + { + num12++; + int num15 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num16 = WorldGen.genRand.Next((int)Main.worldSurface + 25, WorldGen.dMaxY); + int num17 = num15; + if ((int)Main.tile[num15, num16].wall == wallType && !Main.tile[num15, num16].active()) + { + int num18 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num18 = -1; + } + while (!Main.tile[num15, num16].active()) + { + num16 += num18; + } + if (Main.tile[num15 - 1, num16].active() && Main.tile[num15 + 1, num16].active() && !Main.tile[num15 - 1, num16 - num18].active() && !Main.tile[num15 + 1, num16 - num18].active()) + { + num14++; + int num19 = WorldGen.genRand.Next(5, 13); + while (Main.tile[num15 - 1, num16].active() && Main.tile[num15, num16 + num18].active() && Main.tile[num15, num16].active() && !Main.tile[num15, num16 - num18].active() && num19 > 0) + { + Main.tile[num15, num16].type = 48; + if (!Main.tile[num15 - 1, num16 - num18].active() && !Main.tile[num15 + 1, num16 - num18].active()) + { + Main.tile[num15, num16 - num18].type = 48; + Main.tile[num15, num16 - num18].active(true); + } + num15--; + num19--; + } + num19 = WorldGen.genRand.Next(5, 13); + num15 = num17 + 1; + while (Main.tile[num15 + 1, num16].active() && Main.tile[num15, num16 + num18].active() && Main.tile[num15, num16].active() && !Main.tile[num15, num16 - num18].active() && num19 > 0) + { + Main.tile[num15, num16].type = 48; + if (!Main.tile[num15 - 1, num16 - num18].active() && !Main.tile[num15 + 1, num16 - num18].active()) + { + Main.tile[num15, num16 - num18].type = 48; + Main.tile[num15, num16 - num18].active(true); + } + num15++; + num19--; + } + } + } + if (num12 > num13) + { + num12 = 0; + num14++; + } + } + num12 = 0; + num13 = 1000; + num14 = 0; + Main.statusText = Lang.gen[58] + " 75%"; + while (num14 < Main.maxTilesX / 100) + { + num12++; + int num20 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num21 = WorldGen.genRand.Next((int)Main.worldSurface + 25, WorldGen.dMaxY); + int num22 = num21; + if ((int)Main.tile[num20, num21].wall == wallType && !Main.tile[num20, num21].active()) + { + int num23 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num23 = -1; + } + while (num20 > 5 && num20 < Main.maxTilesX - 5 && !Main.tile[num20, num21].active()) + { + num20 += num23; + } + if (Main.tile[num20, num21 - 1].active() && Main.tile[num20, num21 + 1].active() && !Main.tile[num20 - num23, num21 - 1].active() && !Main.tile[num20 - num23, num21 + 1].active()) + { + num14++; + int num24 = WorldGen.genRand.Next(5, 13); + while (Main.tile[num20, num21 - 1].active() && Main.tile[num20 + num23, num21].active() && Main.tile[num20, num21].active() && !Main.tile[num20 - num23, num21].active() && num24 > 0) + { + Main.tile[num20, num21].type = 48; + if (!Main.tile[num20 - num23, num21 - 1].active() && !Main.tile[num20 - num23, num21 + 1].active()) + { + Main.tile[num20 - num23, num21].type = 48; + Main.tile[num20 - num23, num21].active(true); + } + num21--; + num24--; + } + num24 = WorldGen.genRand.Next(5, 13); + num21 = num22 + 1; + while (Main.tile[num20, num21 + 1].active() && Main.tile[num20 + num23, num21].active() && Main.tile[num20, num21].active() && !Main.tile[num20 - num23, num21].active() && num24 > 0) + { + Main.tile[num20, num21].type = 48; + if (!Main.tile[num20 - num23, num21 - 1].active() && !Main.tile[num20 - num23, num21 + 1].active()) + { + Main.tile[num20 - num23, num21].type = 48; + Main.tile[num20 - num23, num21].active(true); + } + num21++; + num24--; + } + } + } + if (num12 > num13) + { + num12 = 0; + num14++; + } + } + Main.statusText = Lang.gen[58] + " 80%"; + for (int num25 = 0; num25 < WorldGen.numDDoors; num25++) + { + int num26 = WorldGen.DDoorX[num25] - 10; + int num27 = WorldGen.DDoorX[num25] + 10; + int num28 = 100; + int num29 = 0; + for (int num30 = num26; num30 < num27; num30++) + { + bool flag = true; + int num31 = WorldGen.DDoorY[num25]; + while (num31 > 10 && !Main.tile[num30, num31].active()) + { + num31--; + } + if (!Main.tileDungeon[(int)Main.tile[num30, num31].type]) + { + flag = false; + } + int num32 = num31; + num31 = WorldGen.DDoorY[num25]; + while (!Main.tile[num30, num31].active()) + { + num31++; + } + if (!Main.tileDungeon[(int)Main.tile[num30, num31].type]) + { + flag = false; + } + int num33 = num31; + if (num33 - num32 >= 3) + { + int num34 = num30 - 20; + int num35 = num30 + 20; + int num36 = num33 - 10; + int num37 = num33 + 10; + for (int num38 = num34; num38 < num35; num38++) + { + for (int num39 = num36; num39 < num37; num39++) + { + if (Main.tile[num38, num39].active() && Main.tile[num38, num39].type == 10) + { + flag = false; + break; + } + } + } + if (flag) + { + for (int num40 = num33 - 3; num40 < num33; num40++) + { + for (int num41 = num30 - 3; num41 <= num30 + 3; num41++) + { + if (Main.tile[num41, num40].active()) + { + flag = false; + break; + } + } + } + } + if (flag && num33 - num32 < 20) + { + bool flag2 = false; + if (WorldGen.DDoorPos[num25] == 0 && num33 - num32 < num28) + { + flag2 = true; + } + if (WorldGen.DDoorPos[num25] == -1 && num30 > num29) + { + flag2 = true; + } + if (WorldGen.DDoorPos[num25] == 1 && (num30 < num29 || num29 == 0)) + { + flag2 = true; + } + if (flag2) + { + num29 = num30; + num28 = num33 - num32; + } + } + } + } + if (num28 < 20) + { + int num42 = num29; + int num43 = WorldGen.DDoorY[num25]; + int num44 = num43; + while (!Main.tile[num42, num43].active()) + { + Main.tile[num42, num43].active(false); + num43++; + } + while (!Main.tile[num42, num44].active()) + { + num44--; + } + num43--; + num44++; + for (int num45 = num44; num45 < num43 - 2; num45++) + { + Main.tile[num42, num45].active(true); + Main.tile[num42, num45].type = (byte)tileType; + } + int style = 13; + if (WorldGen.genRand.Next(3) == 0) + { + if (wallType == 7) + { + style = 16; + } + else + { + if (wallType == 8) + { + style = 17; + } + else + { + if (wallType == 9) + { + style = 18; + } + } + } + } + WorldGen.PlaceTile(num42, num43, 10, true, false, -1, style); + num42--; + int num46 = num43 - 3; + while (!Main.tile[num42, num46].active()) + { + num46--; + } + if (num43 - num46 < num43 - num44 + 5 && Main.tileDungeon[(int)Main.tile[num42, num46].type]) + { + for (int num47 = num43 - 4 - WorldGen.genRand.Next(3); num47 > num46; num47--) + { + Main.tile[num42, num47].active(true); + Main.tile[num42, num47].type = (byte)tileType; + } + } + num42 += 2; + num46 = num43 - 3; + while (!Main.tile[num42, num46].active()) + { + num46--; + } + if (num43 - num46 < num43 - num44 + 5 && Main.tileDungeon[(int)Main.tile[num42, num46].type]) + { + for (int num48 = num43 - 4 - WorldGen.genRand.Next(3); num48 > num46; num48--) + { + Main.tile[num42, num48].active(true); + Main.tile[num42, num48].type = (byte)tileType; + } + } + num43++; + num42--; + Main.tile[num42 - 1, num43].active(true); + Main.tile[num42 - 1, num43].type = (byte)tileType; + Main.tile[num42 + 1, num43].active(true); + Main.tile[num42 + 1, num43].type = (byte)tileType; + } + } + int[] array = new int[3]; + if (wallType == 7) + { + array[0] = 7; + array[1] = 94; + array[2] = 95; + } + else + { + if (wallType == 9) + { + array[0] = 9; + array[1] = 96; + array[2] = 97; + } + else + { + array[0] = 8; + array[1] = 98; + array[2] = 99; + } + } + for (int num49 = 0; num49 < 5; num49++) + { + for (int num50 = 0; num50 < 3; num50++) + { + int num51 = WorldGen.genRand.Next(40, 240); + int num52 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num53 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + for (int num54 = num52 - num51; num54 < num52 + num51; num54++) + { + for (int num55 = num53 - num51; num55 < num53 + num51; num55++) + { + if ((double)num55 > Main.worldSurface) + { + float num56 = (float)Math.Abs(num52 - num54); + float num57 = (float)Math.Abs(num53 - num55); + double num58 = Math.Sqrt((double)(num56 * num56 + num57 * num57)); + if (num58 < (double)num51 * 0.4 && Main.wallDungeon[(int)Main.tile[num54, num55].wall]) + { + WorldGen.dWallCount = 0; + WorldGen.dWallOut(num54, num55, array[num50]); + while (WorldGen.dWallBroke) + { + WorldGen.dWallBroke = false; + for (int num59 = WorldGen.dMinX; num59 < WorldGen.dMaxX; num59++) + { + for (int num60 = 10; num60 < WorldGen.dMaxY; num60++) + { + if (Main.tile[num59, num60].wall == 17) + { + WorldGen.dWallCount = 0; + WorldGen.dWallOut(num59, num60, array[num50]); + } + } + } + } + } + } + } + } + } + } + Main.statusText = Lang.gen[58] + " 85%"; + for (int num61 = 0; num61 < WorldGen.numDPlats; num61++) + { + int num62 = WorldGen.DPlatX[num61]; + int num63 = WorldGen.DPlatY[num61]; + int num64 = Main.maxTilesX; + int num65 = 10; + if ((double)num63 < Main.worldSurface + 50.0) + { + num65 = 20; + } + for (int num66 = num63 - 5; num66 <= num63 + 5; num66++) + { + int num67 = num62; + int num68 = num62; + bool flag3 = false; + if (Main.tile[num67, num66].active()) + { + flag3 = true; + } + else + { + while (!Main.tile[num67, num66].active()) + { + num67--; + if (!Main.tileDungeon[(int)Main.tile[num67, num66].type]) + { + flag3 = true; + } + } + while (!Main.tile[num68, num66].active()) + { + num68++; + if (!Main.tileDungeon[(int)Main.tile[num68, num66].type]) + { + flag3 = true; + } + } + } + if (!flag3 && num68 - num67 <= num65) + { + bool flag4 = true; + int num69 = num62 - num65 / 2 - 2; + int num70 = num62 + num65 / 2 + 2; + int num71 = num66 - 5; + int num72 = num66 + 5; + for (int num73 = num69; num73 <= num70; num73++) + { + for (int num74 = num71; num74 <= num72; num74++) + { + if (Main.tile[num73, num74].active() && Main.tile[num73, num74].type == 19) + { + flag4 = false; + break; + } + } + } + for (int num75 = num66 + 3; num75 >= num66 - 5; num75--) + { + if (Main.tile[num62, num75].active()) + { + flag4 = false; + break; + } + } + if (flag4) + { + num64 = num66; + break; + } + } + } + if (num64 > num63 - 10 && num64 < num63 + 10) + { + int num76 = num62; + int num77 = num64; + int num78 = num62 + 1; + while (!Main.tile[num76, num77].active()) + { + Main.tile[num76, num77].active(true); + Main.tile[num76, num77].type = 19; + if (wallType == 7) + { + Main.tile[num76, num77].frameY = 108; + } + if (wallType == 8) + { + Main.tile[num76, num77].frameY = 144; + } + if (wallType == 9) + { + Main.tile[num76, num77].frameY = 126; + } + num76--; + } + while (!Main.tile[num78, num77].active()) + { + Main.tile[num78, num77].active(true); + Main.tile[num78, num77].type = 19; + if (wallType == 7) + { + Main.tile[num78, num77].frameY = 108; + } + if (wallType == 8) + { + Main.tile[num78, num77].frameY = 144; + } + if (wallType == 9) + { + Main.tile[num78, num77].frameY = 126; + } + num78++; + } + } + } + for (int num79 = 0; num79 < 4; num79++) + { + bool flag5 = false; + while (!flag5) + { + int num80 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num81 = WorldGen.genRand.Next((int)Main.worldSurface, WorldGen.dMaxY); + if (Main.wallDungeon[(int)Main.tile[num80, num81].wall] && !Main.tile[num80, num81].active()) + { + int contain = 0; + int style2 = 0; + if (num79 == 0) + { + style2 = 23; + contain = 1156; + } + else + { + if (num79 == 1) + { + if (!WorldGen.crimson) + { + style2 = 24; + contain = 1571; + } + else + { + style2 = 25; + contain = 1569; + } + } + else + { + if (num79 == 2) + { + style2 = 26; + contain = 1260; + } + else + { + if (num79 == 3) + { + style2 = 27; + contain = 1572; + } + } + } + } + flag5 = WorldGen.AddBuriedChest(num80, num81, contain, false, style2); + } + } + } + int[] array2 = new int[3]; + array2[0] = WorldGen.genRand.Next(9, 13); + array2[1] = WorldGen.genRand.Next(9, 13); + while (array2[1] == array2[0]) + { + array2[1] = WorldGen.genRand.Next(9, 13); + } + array2[2] = WorldGen.genRand.Next(9, 13); + while (array2[2] == array2[0] || array2[2] == array2[1]) + { + array2[2] = WorldGen.genRand.Next(9, 13); + } + Main.statusText = Lang.gen[58] + " 90%"; + num12 = 0; + num13 = 1000; + num14 = 0; + while (num14 < Main.maxTilesX / 20) + { + num12++; + int num82 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num83 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + bool flag6 = true; + if (Main.wallDungeon[(int)Main.tile[num82, num83].wall] && !Main.tile[num82, num83].active()) + { + int num84 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num84 = -1; + } + while (flag6 && !Main.tile[num82, num83].active()) + { + num82 -= num84; + if (num82 < 5 || num82 > Main.maxTilesX - 5) + { + flag6 = false; + } + else + { + if (Main.tile[num82, num83].active() && !Main.tileDungeon[(int)Main.tile[num82, num83].type]) + { + flag6 = false; + } + } + } + if (flag6 && Main.tile[num82, num83].active() && Main.tileDungeon[(int)Main.tile[num82, num83].type] && Main.tile[num82, num83 - 1].active() && Main.tileDungeon[(int)Main.tile[num82, num83 - 1].type] && Main.tile[num82, num83 + 1].active() && Main.tileDungeon[(int)Main.tile[num82, num83 + 1].type]) + { + num82 += num84; + for (int num85 = num82 - 3; num85 <= num82 + 3; num85++) + { + for (int num86 = num83 - 3; num86 <= num83 + 3; num86++) + { + if (Main.tile[num85, num86].active() && Main.tile[num85, num86].type == 19) + { + flag6 = false; + break; + } + } + } + if (flag6 && (!Main.tile[num82, num83 - 1].active() & !Main.tile[num82, num83 - 2].active() & !Main.tile[num82, num83 - 3].active())) + { + int num87 = num82; + int num88 = num82; + while (num87 > WorldGen.dMinX && num87 < WorldGen.dMaxX && !Main.tile[num87, num83].active() && !Main.tile[num87, num83 - 1].active() && !Main.tile[num87, num83 + 1].active()) + { + num87 += num84; + } + num87 = Math.Abs(num82 - num87); + bool flag7 = false; + if (WorldGen.genRand.Next(2) == 0) + { + flag7 = true; + } + if (num87 > 5) + { + for (int num89 = WorldGen.genRand.Next(1, 4); num89 > 0; num89--) + { + Main.tile[num82, num83].active(true); + Main.tile[num82, num83].type = 19; + if ((int)Main.tile[num82, num83].wall == array[0]) + { + Main.tile[num82, num83].frameY = (short)(18 * array2[0]); + } + if ((int)Main.tile[num82, num83].wall == array[1]) + { + Main.tile[num82, num83].frameY = (short)(18 * array2[1]); + } + if ((int)Main.tile[num82, num83].wall == array[2]) + { + Main.tile[num82, num83].frameY = (short)(18 * array2[2]); + } + if (flag7) + { + WorldGen.PlaceTile(num82, num83 - 1, 50, true, false, -1, 0); + if (WorldGen.genRand.Next(50) == 0 && Main.tile[num82, num83 - 1].type == 50) + { + Main.tile[num82, num83 - 1].frameX = 90; + } + } + num82 += num84; + } + num12 = 0; + num14++; + if (!flag7 && WorldGen.genRand.Next(2) == 0) + { + num82 = num88; + num83--; + int num90 = 0; + if (WorldGen.genRand.Next(4) == 0) + { + num90 = 1; + } + if (num90 == 0) + { + num90 = 13; + } + else + { + if (num90 == 1) + { + num90 = 49; + } + } + WorldGen.PlaceTile(num82, num83, num90, true, false, -1, 0); + if (Main.tile[num82, num83].type == 13) + { + if (WorldGen.genRand.Next(2) == 0) + { + Main.tile[num82, num83].frameX = 18; + } + else + { + Main.tile[num82, num83].frameX = 36; + } + } + } + } + } + } + } + if (num12 > num13) + { + num12 = 0; + num14++; + } + } + Main.statusText = Lang.gen[58] + " 95%"; + int num91 = 1; + for (int num92 = 0; num92 < WorldGen.numDRooms; num92++) + { + int num93 = 0; + while (num93 < 1000) + { + int num94 = (int)((double)WorldGen.dRoomSize[num92] * 0.4); + int i2 = WorldGen.dRoomX[num92] + WorldGen.genRand.Next(-num94, num94 + 1); + int num95 = WorldGen.dRoomY[num92] + WorldGen.genRand.Next(-num94, num94 + 1); + int style3 = 2; + int num96; + if (num91 == 1) + { + num96 = 329; + } + else + { + if (num91 == 2) + { + num96 = 155; + } + else + { + if (num91 == 3) + { + num96 = 156; + } + else + { + if (num91 == 4) + { + num96 = 157; + } + else + { + if (num91 == 5) + { + num96 = 163; + } + else + { + if (num91 == 6) + { + num96 = 113; + } + else + { + if (num91 == 7) + { + num96 = 327; + style3 = 0; + } + else + { + num96 = 164; + num91 = 0; + } + } + } + } + } + } + } + if ((double)num95 < Main.worldSurface + 50.0) + { + num96 = 327; + style3 = 0; + } + if (num96 == 0 && WorldGen.genRand.Next(2) == 0) + { + num93 = 1000; + } + else + { + if (WorldGen.AddBuriedChest(i2, num95, num96, false, style3)) + { + num93 += 1000; + num91++; + } + num93++; + } + } + } + WorldGen.dMinX -= 25; + WorldGen.dMaxX += 25; + WorldGen.dMinY -= 25; + WorldGen.dMaxY += 25; + if (WorldGen.dMinX < 0) + { + WorldGen.dMinX = 0; + } + if (WorldGen.dMaxX > Main.maxTilesX) + { + WorldGen.dMaxX = Main.maxTilesX; + } + if (WorldGen.dMinY < 0) + { + WorldGen.dMinY = 0; + } + if (WorldGen.dMaxY > Main.maxTilesY) + { + WorldGen.dMaxY = Main.maxTilesY; + } + num12 = 0; + num13 = 1000; + num14 = 0; + int[] array3 = new int[3]; + array3[0] = WorldGen.genRand.Next(7); + array3[1] = WorldGen.genRand.Next(7); + while (array3[1] == array3[0]) + { + array3[1] = WorldGen.genRand.Next(7); + } + array3[2] = WorldGen.genRand.Next(7); + while (array3[2] == array3[0] || array3[2] == array3[1]) + { + array3[2] = WorldGen.genRand.Next(7); + } + while (num14 < Main.maxTilesX / 150) + { + num12++; + int num97 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num98 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + if (Main.wallDungeon[(int)Main.tile[num97, num98].wall]) + { + int num99 = num98; + while (num99 > WorldGen.dMinY) + { + if (Main.tile[num97, num99 - 1].active() && (int)Main.tile[num97, num99 - 1].type == tileType) + { + bool flag8 = false; + for (int num100 = num97 - 15; num100 < num97 + 15; num100++) + { + for (int num101 = num99 - 15; num101 < num99 + 15; num101++) + { + if (num100 > 0 && num100 < Main.maxTilesX && num101 > 0 && num101 < Main.maxTilesY && Main.tile[num100, num101].type == 42) + { + flag8 = true; + break; + } + } + } + if (Main.tile[num97 - 1, num99].active() || Main.tile[num97 + 1, num99].active() || Main.tile[num97 - 1, num99 + 1].active() || Main.tile[num97 + 1, num99 + 1].active() || Main.tile[num97, num99 + 2].active()) + { + flag8 = true; + } + if (flag8) + { + break; + } + int style4 = array3[0]; + if ((int)Main.tile[num97, num99].wall == array[1]) + { + style4 = array3[1]; + } + if ((int)Main.tile[num97, num99].wall == array[2]) + { + style4 = array3[2]; + } + WorldGen.Place1x2Top(num97, num99, 42, style4); + if (Main.tile[num97, num99].type == 42) + { + num12 = 0; + num14++; + for (int num102 = 0; num102 < 1000; num102++) + { + int num103 = num97 + WorldGen.genRand.Next(-12, 13); + int num104 = num99 + WorldGen.genRand.Next(3, 21); + if (!Main.tile[num103, num104].active() && !Main.tile[num103, num104 + 1].active() && Main.tile[num103 - 1, num104].type != 48 && Main.tile[num103 + 1, num104].type != 48 && Collision.CanHit(new Vector2((float)(num103 * 16), (float)(num104 * 16)), 16, 16, new Vector2((float)(num97 * 16), (float)(num99 * 16 + 1)), 16, 16)) + { + WorldGen.PlaceTile(num103, num104, 136, true, false, -1, 0); + if (Main.tile[num103, num104].active()) + { + while (num103 != num97 || num104 != num99) + { + Main.tile[num103, num104].wire(true); + if (num103 > num97) + { + num103--; + } + if (num103 < num97) + { + num103++; + } + Main.tile[num103, num104].wire(true); + if (num104 > num99) + { + num104--; + } + if (num104 < num99) + { + num104++; + } + Main.tile[num103, num104].wire(true); + } + if (Main.rand.Next(3) > 0) + { + Main.tile[num97, num99].frameX = 18; + Main.tile[num97, num99 + 1].frameX = 18; + break; + } + break; + } + } + } + break; + } + break; + } + else + { + num99--; + } + } + } + if (num12 > num13) + { + num14++; + num12 = 0; + } + } + num12 = 0; + num13 = 1000; + num14 = 0; + while (num14 < Main.maxTilesX / 500) + { + num12++; + int num105 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num106 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + while ((double)num106 < Main.worldSurface) + { + num106 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + } + if (Main.wallDungeon[(int)Main.tile[num105, num106].wall] && WorldGen.placeTrap(num105, num106, 0)) + { + num12 = num13; + } + if (num12 > num13) + { + num14++; + num12 = 0; + } + } + float num107 = 8400000f / (float)Main.maxTilesX; + int num108 = 0; + while ((float)num108 < num107) + { + int num109 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num110 = WorldGen.genRand.Next(50, WorldGen.dMaxY); + while (!Main.wallDungeon[(int)Main.tile[num109, num110].wall] || Main.tile[num109, num110].active()) + { + num109 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + num110 = WorldGen.genRand.Next(50, WorldGen.dMaxY); + } + if (Main.wallDungeon[(int)Main.tile[num109, num110].wall] && !Main.tile[num109, num110].active()) + { + while (!WorldGen.SolidTile(num109, num110) && num110 < Main.maxTilesY - 200) + { + num110++; + } + num110--; + int num111 = num109; + int num112 = num109; + while (!Main.tile[num111, num110].active() && WorldGen.SolidTile(num111, num110 + 1)) + { + num111--; + } + num111++; + while (!Main.tile[num112, num110].active() && WorldGen.SolidTile(num112, num110 + 1)) + { + num112++; + } + num112--; + int num113 = num112 - num111; + int num114 = (num112 + num111) / 2; + if (!Main.tile[num114, num110].active() && Main.wallDungeon[(int)Main.tile[num114, num110].wall] && WorldGen.SolidTile(num114, num110 + 1) && Main.tile[num114, num110 + 1].type != 48) + { + int style5 = 13; + int style6 = 10; + int style7 = 11; + int num115 = 1; + int num116 = 46; + int style8 = 1; + int num117 = 5; + if (wallType == 8) + { + style5 = 14; + style6 = 11; + style7 = 12; + num115 = 2; + num116 = 47; + style8 = 2; + num117 = 6; + } + else + { + if (wallType == 9) + { + style5 = 15; + style6 = 12; + style7 = 13; + num115 = 3; + num116 = 48; + style8 = 3; + num117 = 7; + } + } + if (Main.tile[num114, num110].wall >= 94 && Main.tile[num114, num110].wall <= 105) + { + style5 = 17; + style6 = 14; + style7 = 15; + num115 = -1; + num116 = -1; + style8 = 5; + num117 = -1; + } + int num118 = WorldGen.genRand.Next(6); + while ((num118 == 2 && num116 == -1) || (num118 == 5 && num117 == -1)) + { + num118 = WorldGen.genRand.Next(6); + } + int num119 = 0; + int num120 = 0; + if (num118 == 0) + { + num119 = 5; + num120 = 4; + } + if (num118 == 1) + { + num119 = 4; + num120 = 3; + } + if (num118 == 2) + { + num119 = 3; + num120 = 5; + } + if (num118 == 3) + { + num119 = 4; + num120 = 6; + } + if (num118 == 4) + { + num119 = 3; + num120 = 3; + } + if (num118 == 5) + { + num119 = 5; + num120 = 3; + } + for (int num121 = num114 - num119; num121 <= num114 + num119; num121++) + { + for (int num122 = num110 - num120; num122 <= num110; num122++) + { + if (Main.tile[num121, num122].active()) + { + num118 = -1; + break; + } + } + } + if ((double)num113 < (double)num119 * 1.75) + { + num118 = -1; + } + if (num118 == 0) + { + WorldGen.PlaceTile(num114, num110, 14, true, false, -1, style6); + if (Main.tile[num114, num110].active()) + { + if (!Main.tile[num114 - 2, num110].active()) + { + WorldGen.PlaceTile(num114 - 2, num110, 15, true, false, -1, style5); + if (Main.tile[num114 - 2, num110].active()) + { + Tile expr_273A = Main.tile[num114 - 2, num110]; + expr_273A.frameX += 18; + Tile expr_275B = Main.tile[num114 - 2, num110 - 1]; + expr_275B.frameX += 18; + } + } + if (!Main.tile[num114 + 2, num110].active()) + { + WorldGen.PlaceTile(num114 + 2, num110, 15, true, false, -1, style5); + } + } + for (int num123 = num114 - 1; num123 <= num114 + 1; num123++) + { + if (WorldGen.genRand.Next(2) == 0 && !Main.tile[num123, num110 - 2].active()) + { + int num124 = WorldGen.genRand.Next(5); + if (num115 != -1 && num124 <= 1 && !Main.tileLighted[(int)Main.tile[num123 - 1, num110 - 2].type]) + { + WorldGen.PlaceTile(num123, num110 - 2, 33, true, false, -1, num115); + } + if (num124 == 2 && !Main.tileLighted[(int)Main.tile[num123 - 1, num110 - 2].type]) + { + WorldGen.PlaceTile(num123, num110 - 2, 49, true, false, -1, 0); + } + if (num124 == 3) + { + WorldGen.PlaceTile(num123, num110 - 2, 50, true, false, -1, 0); + } + if (num124 == 4) + { + WorldGen.PlaceTile(num123, num110 - 2, 103, true, false, -1, 0); + } + } + } + } + else + { + if (num118 == 1) + { + WorldGen.PlaceTile(num114, num110, 18, true, false, -1, style7); + if (Main.tile[num114, num110].active()) + { + if (WorldGen.genRand.Next(2) == 0) + { + if (!Main.tile[num114 - 1, num110].active()) + { + WorldGen.PlaceTile(num114 - 1, num110, 15, true, false, -1, style5); + if (Main.tile[num114 - 1, num110].active()) + { + Tile expr_2921 = Main.tile[num114 - 1, num110]; + expr_2921.frameX += 18; + Tile expr_2942 = Main.tile[num114 - 1, num110 - 1]; + expr_2942.frameX += 18; + } + } + } + else + { + if (!Main.tile[num114 + 2, num110].active()) + { + WorldGen.PlaceTile(num114 + 2, num110, 15, true, false, -1, style5); + } + } + for (int num125 = num114; num125 <= num114 + 1; num125++) + { + if (WorldGen.genRand.Next(2) == 0 && !Main.tile[num125, num110 - 1].active()) + { + int num126 = WorldGen.genRand.Next(5); + if (num115 != -1 && num126 <= 1 && !Main.tileLighted[(int)Main.tile[num125 - 1, num110 - 1].type]) + { + WorldGen.PlaceTile(num125, num110 - 1, 33, true, false, -1, num115); + } + if (num126 == 2 && !Main.tileLighted[(int)Main.tile[num125 - 1, num110 - 1].type]) + { + WorldGen.PlaceTile(num125, num110 - 1, 49, true, false, -1, 0); + } + if (num126 == 3) + { + WorldGen.PlaceTile(num125, num110 - 1, 50, true, false, -1, 0); + } + if (num126 == 4) + { + WorldGen.PlaceTile(num125, num110 - 1, 103, true, false, -1, 0); + } + } + } + } + } + else + { + if (num118 == 2) + { + WorldGen.PlaceTile(num114, num110, 105, true, false, -1, num116); + } + else + { + if (num118 == 3) + { + WorldGen.PlaceTile(num114, num110, 101, true, false, -1, style8); + } + else + { + if (num118 == 4) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.PlaceTile(num114, num110, 15, true, false, -1, style5); + Tile expr_2ADA = Main.tile[num114, num110]; + expr_2ADA.frameX += 18; + Tile expr_2AF9 = Main.tile[num114, num110 - 1]; + expr_2AF9.frameX += 18; + } + else + { + WorldGen.PlaceTile(num114, num110, 15, true, false, -1, style5); + } + } + else + { + if (num118 == 5) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.Place4x2(num114, num110, 79, 1, num117); + } + else + { + WorldGen.Place4x2(num114, num110, 79, -1, num117); + } + } + } + } + } + } + } + } + } + num108++; + } + num107 = 420000f / (float)Main.maxTilesX; + int num127 = 0; + while ((float)num127 < num107) + { + int num128 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num129 = WorldGen.genRand.Next((int)Main.worldSurface, WorldGen.dMaxY); + while (!Main.wallDungeon[(int)Main.tile[num128, num129].wall] || Main.tile[num128, num129].active()) + { + num128 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + num129 = WorldGen.genRand.Next((int)Main.worldSurface, WorldGen.dMaxY); + } + int num131; + int num132; + int num133; + int num134; + for (int num130 = 0; num130 < 2; num130++) + { + num131 = num128; + num132 = num128; + while (!Main.tile[num131, num129].active() && Main.wallDungeon[(int)Main.tile[num131, num129].wall]) + { + num131--; + } + num131++; + while (!Main.tile[num132, num129].active() && Main.wallDungeon[(int)Main.tile[num132, num129].wall]) + { + num132++; + } + num132--; + num128 = (num131 + num132) / 2; + num133 = num129; + num134 = num129; + while (!Main.tile[num128, num133].active() && Main.wallDungeon[(int)Main.tile[num128, num133].wall]) + { + num133--; + } + num133++; + while (!Main.tile[num128, num134].active() && Main.wallDungeon[(int)Main.tile[num128, num134].wall]) + { + num134++; + } + num134--; + num129 = (num133 + num134) / 2; + } + num131 = num128; + num132 = num128; + while (!Main.tile[num131, num129].active() && !Main.tile[num131, num129 - 1].active() && !Main.tile[num131, num129 + 1].active()) + { + num131--; + } + num131++; + while (!Main.tile[num132, num129].active() && !Main.tile[num132, num129 - 1].active() && !Main.tile[num132, num129 + 1].active()) + { + num132++; + } + num132--; + num133 = num129; + num134 = num129; + while (!Main.tile[num128, num133].active() && !Main.tile[num128 - 1, num133].active() && !Main.tile[num128 + 1, num133].active()) + { + num133--; + } + num133++; + while (!Main.tile[num128, num134].active() && !Main.tile[num128 - 1, num134].active() && !Main.tile[num128 + 1, num134].active()) + { + num134++; + } + num134--; + num128 = (num131 + num132) / 2; + num129 = (num133 + num134) / 2; + int num135 = num132 - num131; + int num136 = num134 - num133; + if (num135 > 7 && num136 > 5) + { + bool[] array4 = new bool[3]; + array4[0] = true; + if (num135 > num136 * 3 && num135 > 21) + { + array4[1] = true; + } + if (num136 > num135 * 3 && num136 > 21) + { + array4[2] = true; + } + int num137 = WorldGen.genRand.Next(3); + if ((int)Main.tile[num128, num129].wall == array[0]) + { + num137 = 0; + } + while (!array4[num137]) + { + num137 = WorldGen.genRand.Next(3); + } + if (WorldGen.nearPicture2(num128, num129)) + { + num137 = -1; + } + if (num137 == 0) + { + Vector2 vector = WorldGen.randPictureTile(); + if ((int)Main.tile[num128, num129].wall != array[0]) + { + vector = WorldGen.randBoneTile(); + } + int type = (int)vector.X; + int style9 = (int)vector.Y; + if (!WorldGen.nearPicture(num128, num129)) + { + WorldGen.PlaceTile(num128, num129, type, true, false, -1, style9); + } + } + else + { + if (num137 == 1) + { + Vector2 vector2 = WorldGen.randPictureTile(); + if ((int)Main.tile[num128, num129].wall != array[0]) + { + vector2 = WorldGen.randBoneTile(); + } + int type2 = (int)vector2.X; + int style10 = (int)vector2.Y; + if (!Main.tile[num128, num129].active()) + { + WorldGen.PlaceTile(num128, num129, type2, true, false, -1, style10); + } + int num138 = num128; + int num139 = num129; + int num140 = num129; + for (int num141 = 0; num141 < 2; num141++) + { + num128 += 7; + num133 = num140; + num134 = num140; + while (!Main.tile[num128, num133].active() && !Main.tile[num128 - 1, num133].active() && !Main.tile[num128 + 1, num133].active()) + { + num133--; + } + num133++; + while (!Main.tile[num128, num134].active() && !Main.tile[num128 - 1, num134].active() && !Main.tile[num128 + 1, num134].active()) + { + num134++; + } + num134--; + num140 = (num133 + num134) / 2; + vector2 = WorldGen.randPictureTile(); + if ((int)Main.tile[num128, num140].wall != array[0]) + { + vector2 = WorldGen.randBoneTile(); + } + type2 = (int)vector2.X; + style10 = (int)vector2.Y; + if (Math.Abs(num139 - num140) >= 4 || WorldGen.nearPicture(num128, num140)) + { + break; + } + WorldGen.PlaceTile(num128, num140, type2, true, false, -1, style10); + } + num140 = num129; + num128 = num138; + for (int num142 = 0; num142 < 2; num142++) + { + num128 -= 7; + num133 = num140; + num134 = num140; + while (!Main.tile[num128, num133].active() && !Main.tile[num128 - 1, num133].active() && !Main.tile[num128 + 1, num133].active()) + { + num133--; + } + num133++; + while (!Main.tile[num128, num134].active() && !Main.tile[num128 - 1, num134].active() && !Main.tile[num128 + 1, num134].active()) + { + num134++; + } + num134--; + num140 = (num133 + num134) / 2; + vector2 = WorldGen.randPictureTile(); + if ((int)Main.tile[num128, num140].wall != array[0]) + { + vector2 = WorldGen.randBoneTile(); + } + type2 = (int)vector2.X; + style10 = (int)vector2.Y; + if (Math.Abs(num139 - num140) >= 4 || WorldGen.nearPicture(num128, num140)) + { + break; + } + WorldGen.PlaceTile(num128, num140, type2, true, false, -1, style10); + } + } + else + { + if (num137 == 2) + { + Vector2 vector3 = WorldGen.randPictureTile(); + if ((int)Main.tile[num128, num129].wall != array[0]) + { + vector3 = WorldGen.randBoneTile(); + } + int type3 = (int)vector3.X; + int style11 = (int)vector3.Y; + if (!Main.tile[num128, num129].active()) + { + WorldGen.PlaceTile(num128, num129, type3, true, false, -1, style11); + } + int num143 = num129; + int num144 = num128; + int num145 = num128; + for (int num146 = 0; num146 < 3; num146++) + { + num129 += 7; + num131 = num145; + num132 = num145; + while (!Main.tile[num131, num129].active() && !Main.tile[num131, num129 - 1].active() && !Main.tile[num131, num129 + 1].active()) + { + num131--; + } + num131++; + while (!Main.tile[num132, num129].active() && !Main.tile[num132, num129 - 1].active() && !Main.tile[num132, num129 + 1].active()) + { + num132++; + } + num132--; + num145 = (num131 + num132) / 2; + vector3 = WorldGen.randPictureTile(); + if ((int)Main.tile[num145, num129].wall != array[0]) + { + vector3 = WorldGen.randBoneTile(); + } + type3 = (int)vector3.X; + style11 = (int)vector3.Y; + if (Math.Abs(num144 - num145) >= 4 || WorldGen.nearPicture(num145, num129)) + { + break; + } + WorldGen.PlaceTile(num145, num129, type3, true, false, -1, style11); + } + num145 = num128; + num129 = num143; + for (int num147 = 0; num147 < 3; num147++) + { + num129 -= 7; + num131 = num145; + num132 = num145; + while (!Main.tile[num131, num129].active() && !Main.tile[num131, num129 - 1].active() && !Main.tile[num131, num129 + 1].active()) + { + num131--; + } + num131++; + while (!Main.tile[num132, num129].active() && !Main.tile[num132, num129 - 1].active() && !Main.tile[num132, num129 + 1].active()) + { + num132++; + } + num132--; + num145 = (num131 + num132) / 2; + vector3 = WorldGen.randPictureTile(); + if ((int)Main.tile[num145, num129].wall != array[0]) + { + vector3 = WorldGen.randBoneTile(); + } + type3 = (int)vector3.X; + style11 = (int)vector3.Y; + if (Math.Abs(num144 - num145) >= 4 || WorldGen.nearPicture(num145, num129)) + { + break; + } + WorldGen.PlaceTile(num145, num129, type3, true, false, -1, style11); + } + } + } + } + } + num127++; + } + num107 = 840000f / (float)Main.maxTilesX; + int num148 = 0; + while ((float)num148 < num107) + { + int num149 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num150 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + while (!Main.wallDungeon[(int)Main.tile[num149, num150].wall] || Main.tile[num149, num150].active()) + { + num149 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + num150 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + } + while (!WorldGen.SolidTile(num149, num150) && num150 > 10) + { + num150--; + } + num150++; + if (Main.wallDungeon[(int)Main.tile[num149, num150].wall] && Main.tile[num149, num150 - 1].type != 48 && !Main.tile[num149, num150].active() && !Main.tile[num149, num150 + 1].active() && !Main.tile[num149, num150 + 2].active() && !Main.tile[num149, num150 + 3].active()) + { + bool flag9 = true; + for (int num151 = num149 - 1; num151 <= num149 + 1; num151++) + { + for (int num152 = num150; num152 <= num150 + 3; num152++) + { + if (Main.tile[num151, num152].active() && (Main.tile[num151, num152].type == 10 || Main.tile[num151, num152].type == 11 || Main.tile[num151, num152].type == 91)) + { + flag9 = false; + } + } + } + if (flag9) + { + int num153 = 10; + if ((int)Main.tile[num149, num150].wall == array[1]) + { + num153 = 12; + } + if ((int)Main.tile[num149, num150].wall == array[2]) + { + num153 = 14; + } + num153 += WorldGen.genRand.Next(2); + WorldGen.PlaceTile(num149, num150, 91, true, false, -1, num153); + } + } + num148++; + } + } + public static Vector2 randBoneTile() + { + int num = WorldGen.genRand.Next(2); + int num2 = 0; + if (num == 0) + { + num = 240; + num2 = WorldGen.genRand.Next(2); + if (num2 == 0) + { + num2 = 16; + } + else + { + if (num2 == 1) + { + num2 = 17; + } + } + } + else + { + if (num == 1) + { + num = 241; + num2 = WorldGen.genRand.Next(9); + } + } + return new Vector2((float)num, (float)num2); + } + public static Vector2 randHellPicture() + { + int num = WorldGen.genRand.Next(4); + if (num == 1) + { + num = WorldGen.genRand.Next(4); + } + int num2; + if (num == 0) + { + num = 240; + num2 = WorldGen.genRand.Next(5); + if (num2 == 0) + { + num2 = 27; + } + else + { + if (num2 == 1) + { + num2 = 29; + } + else + { + if (num2 == 2) + { + num2 = 30; + } + else + { + if (num2 == 3) + { + num2 = 31; + } + else + { + if (num2 == 4) + { + num2 = 32; + } + } + } + } + } + } + else + { + if (num == 1) + { + num = 242; + num2 = 14; + } + else + { + if (num == 2) + { + num = 245; + num2 = WorldGen.genRand.Next(3); + if (num2 == 0) + { + num2 = 1; + } + else + { + if (num2 == 1) + { + num2 = 2; + } + else + { + if (num2 == 2) + { + num2 = 4; + } + } + } + } + else + { + num = 246; + num2 = WorldGen.genRand.Next(3); + if (num2 == 0) + { + num2 = 0; + } + else + { + if (num2 == 1) + { + num2 = 16; + } + else + { + if (num2 == 2) + { + num2 = 17; + } + } + } + } + } + } + return new Vector2((float)num, (float)num2); + } + public static Vector2 randHousePicture() + { + int num = WorldGen.genRand.Next(4); + int num2; + if (num <= 1) + { + num = 240; + int maxValue = 10; + num2 = WorldGen.genRand.Next(maxValue); + if (num2 == 9) + { + num2 = WorldGen.genRand.Next(maxValue); + } + if (num2 == 5) + { + num2 = WorldGen.genRand.Next(maxValue); + } + if (num2 == 6) + { + num2 = WorldGen.genRand.Next(maxValue); + } + if (num2 == 0) + { + num2 = 26; + } + else + { + if (num2 == 1) + { + num2 = 28; + } + else + { + if (num2 == 2) + { + num2 = 20; + } + else + { + if (num2 == 3) + { + num2 = 21; + } + else + { + if (num2 == 4) + { + num2 = 22; + } + else + { + if (num2 == 5) + { + num2 = 24; + } + else + { + if (num2 == 6) + { + num2 = 25; + } + else + { + if (num2 == 7) + { + num2 = 33; + } + else + { + if (num2 == 8) + { + num2 = 34; + } + else + { + if (num2 == 9) + { + num2 = 35; + } + } + } + } + } + } + } + } + } + } + } + else + { + if (num == 2) + { + int maxValue2 = 4; + num = 245; + num2 = WorldGen.genRand.Next(maxValue2); + if (num2 == 2) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 0) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 0) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 0) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 0) + { + num2 = 0; + } + else + { + if (num2 == 1) + { + num2 = 3; + } + else + { + if (num2 == 2) + { + num2 = 5; + } + else + { + if (num2 == 3) + { + num2 = 6; + } + } + } + } + } + else + { + num = 246; + num2 = 1; + } + } + return new Vector2((float)num, (float)num2); + } + public static Vector2 randPictureTile() + { + int num = WorldGen.genRand.Next(3); + int num2 = 0; + if (num <= 1) + { + int maxValue = 7; + num = 240; + num2 = WorldGen.genRand.Next(maxValue); + if (num2 == 6) + { + num2 = WorldGen.genRand.Next(maxValue); + } + if (num2 == 0) + { + num2 = 12; + } + else + { + if (num2 == 1) + { + num2 = 13; + } + else + { + if (num2 == 2) + { + num2 = 14; + } + else + { + if (num2 == 3) + { + num2 = 15; + } + else + { + if (num2 == 4) + { + num2 = 18; + } + else + { + if (num2 == 5) + { + num2 = 19; + } + else + { + if (num2 == 6) + { + num2 = 23; + } + } + } + } + } + } + } + } + else + { + if (num == 2) + { + num = 242; + int maxValue2 = 16; + num2 = WorldGen.genRand.Next(maxValue2); + for (int i = 0; i < 2; i++) + { + if (num2 == 6) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 13) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 14) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + if (num2 == 15) + { + num2 = WorldGen.genRand.Next(maxValue2); + } + } + if (num2 == 14) + { + num2 = 15; + } + if (num2 == 15) + { + num2 = 16; + } + } + } + return new Vector2((float)num, (float)num2); + } + public static void DungeonStairs(int i, int j, int tileType, int wallType) + { + Vector2 value = default(Vector2); + double num = (double)WorldGen.genRand.Next(5, 9); + Vector2 value2; + value2.X = (float)i; + value2.Y = (float)j; + int k = WorldGen.genRand.Next(10, 30); + int num2; + if (i > WorldGen.dEnteranceX) + { + num2 = -1; + } + else + { + num2 = 1; + } + if (i > Main.maxTilesX - 400) + { + num2 = -1; + } + else + { + if (i < 400) + { + num2 = 1; + } + } + value.Y = -1f; + value.X = (float)num2; + if (WorldGen.genRand.Next(3) != 0) + { + value.X *= 1f + (float)WorldGen.genRand.Next(0, 200) * 0.01f; + } + else + { + if (WorldGen.genRand.Next(3) == 0) + { + value.X *= (float)WorldGen.genRand.Next(50, 76) * 0.01f; + } + else + { + if (WorldGen.genRand.Next(6) == 0) + { + value.Y *= 2f; + } + } + } + if (WorldGen.dungeonX < Main.maxTilesX / 2 && value.X < 0f && (double)value.X < 0.5) + { + value.X = -0.5f; + } + if (WorldGen.dungeonX > Main.maxTilesX / 2 && value.X > 0f && (double)value.X > 0.5) + { + value.X = -0.5f; + } + while (k > 0) + { + k--; + int num3 = (int)((double)value2.X - num - 4.0 - (double)WorldGen.genRand.Next(6)); + int num4 = (int)((double)value2.X + num + 4.0 + (double)WorldGen.genRand.Next(6)); + int num5 = (int)((double)value2.Y - num - 4.0); + int num6 = (int)((double)value2.Y + num + 4.0 + (double)WorldGen.genRand.Next(6)); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + int num7 = 1; + if (value2.X > (float)(Main.maxTilesX / 2)) + { + num7 = -1; + } + int num8 = (int)(value2.X + (float)WorldGen.dxStrength1 * 0.6f * (float)num7 + (float)WorldGen.dxStrength2 * (float)num7); + int num9 = (int)(WorldGen.dyStrength2 * 0.5); + if ((double)value2.Y < Main.worldSurface - 5.0 && Main.tile[num8, (int)((double)value2.Y - num - 6.0 + (double)num9)].wall == 0 && Main.tile[num8, (int)((double)value2.Y - num - 7.0 + (double)num9)].wall == 0 && Main.tile[num8, (int)((double)value2.Y - num - 8.0 + (double)num9)].wall == 0) + { + WorldGen.dSurface = true; + WorldGen.TileRunner(num8, (int)((double)value2.Y - num - 6.0 + (double)num9), (double)WorldGen.genRand.Next(25, 35), WorldGen.genRand.Next(10, 20), -1, false, 0f, -1f, false, true); + } + for (int l = num3; l < num4; l++) + { + for (int m = num5; m < num6; m++) + { + Main.tile[l, m].liquid = 0; + if (!Main.wallDungeon[(int)Main.tile[l, m].wall]) + { + Main.tile[l, m].wall = 0; + Main.tile[l, m].active(true); + Main.tile[l, m].type = (byte)tileType; + } + } + } + for (int n = num3 + 1; n < num4 - 1; n++) + { + for (int num10 = num5 + 1; num10 < num6 - 1; num10++) + { + Main.tile[n, num10].wall = (byte)wallType; + } + } + int num11 = 0; + if (WorldGen.genRand.Next((int)num) == 0) + { + num11 = WorldGen.genRand.Next(1, 3); + } + num3 = (int)((double)value2.X - num * 0.5 - (double)num11); + num4 = (int)((double)value2.X + num * 0.5 + (double)num11); + num5 = (int)((double)value2.Y - num * 0.5 - (double)num11); + num6 = (int)((double)value2.Y + num * 0.5 + (double)num11); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int num12 = num3; num12 < num4; num12++) + { + for (int num13 = num5; num13 < num6; num13++) + { + Main.tile[num12, num13].active(false); + WorldGen.PlaceWall(num12, num13, wallType, true); + } + } + if (WorldGen.dSurface) + { + k = 0; + } + value2 += value; + if ((double)value2.Y < Main.worldSurface) + { + value.Y *= 0.98f; + } + } + WorldGen.dungeonX = (int)value2.X; + WorldGen.dungeonY = (int)value2.Y; + } + public static void DungeonHalls(int i, int j, int tileType, int wallType, bool forceX = false) + { + Vector2 value = default(Vector2); + double num = (double)WorldGen.genRand.Next(4, 6); + double num2 = num; + Vector2 vector = default(Vector2); + Vector2 value2 = default(Vector2); + Vector2 value3; + value3.X = (float)i; + value3.Y = (float)j; + int k = WorldGen.genRand.Next(35, 80); + if (forceX) + { + k += 20; + WorldGen.lastDungeonHall = default(Vector2); + } + else + { + if (WorldGen.genRand.Next(5) == 0) + { + num *= 2.0; + k /= 2; + } + } + bool flag = false; + bool flag2 = false; + bool flag3 = true; + while (!flag) + { + bool flag4 = false; + int num5; + if (flag3 && !forceX) + { + bool flag5 = true; + bool flag6 = true; + bool flag7 = true; + bool flag8 = true; + int num3 = k; + bool flag9 = false; + for (int l = j; l > j - num3; l--) + { + if ((int)Main.tile[i, l].wall == wallType) + { + if (flag9) + { + flag5 = false; + break; + } + } + else + { + flag9 = true; + } + } + flag9 = false; + for (int m = j; m < j + num3; m++) + { + if ((int)Main.tile[i, m].wall == wallType) + { + if (flag9) + { + flag6 = false; + break; + } + } + else + { + flag9 = true; + } + } + flag9 = false; + for (int n = i; n > i - num3; n--) + { + if ((int)Main.tile[n, j].wall == wallType) + { + if (flag9) + { + flag7 = false; + break; + } + } + else + { + flag9 = true; + } + } + flag9 = false; + for (int num4 = i; num4 < i + num3; num4++) + { + if ((int)Main.tile[num4, j].wall == wallType) + { + if (flag9) + { + flag8 = false; + break; + } + } + else + { + flag9 = true; + } + } + if (!flag7 && !flag8 && !flag5 && !flag6) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = -1; + } + else + { + num5 = 1; + } + if (WorldGen.genRand.Next(2) == 0) + { + flag4 = true; + } + } + else + { + int num6 = WorldGen.genRand.Next(4); + do + { + num6 = WorldGen.genRand.Next(4); + } + while ((num6 != 0 || !flag5) && (num6 != 1 || !flag6) && (num6 != 2 || !flag7) && (num6 != 3 || !flag8)); + if (num6 == 0) + { + num5 = -1; + } + else + { + if (num6 == 1) + { + num5 = 1; + } + else + { + flag4 = true; + if (num6 == 2) + { + num5 = -1; + } + else + { + num5 = 1; + } + } + } + } + } + else + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = -1; + } + else + { + num5 = 1; + } + if (WorldGen.genRand.Next(2) == 0) + { + flag4 = true; + } + } + flag3 = false; + if (forceX) + { + flag4 = true; + } + if (flag4) + { + vector.Y = 0f; + vector.X = (float)num5; + value2.Y = 0f; + value2.X = (float)(-(float)num5); + value.Y = 0f; + value.X = (float)num5; + if (WorldGen.genRand.Next(3) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.Y = -0.2f; + } + else + { + value.Y = 0.2f; + } + } + } + else + { + num += 1.0; + value.Y = (float)num5; + value.X = 0f; + vector.X = 0f; + vector.Y = (float)num5; + value2.X = 0f; + value2.Y = (float)(-(float)num5); + if (WorldGen.genRand.Next(3) != 0) + { + flag2 = true; + if (WorldGen.genRand.Next(2) == 0) + { + value.X = (float)WorldGen.genRand.Next(10, 20) * 0.1f; + } + else + { + value.X = (float)(-(float)WorldGen.genRand.Next(10, 20)) * 0.1f; + } + } + else + { + if (WorldGen.genRand.Next(2) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.X = (float)WorldGen.genRand.Next(20, 40) * 0.01f; + } + else + { + value.X = (float)(-(float)WorldGen.genRand.Next(20, 40)) * 0.01f; + } + } + else + { + k /= 2; + } + } + } + if (WorldGen.lastDungeonHall != value2) + { + flag = true; + } + } + int num7 = 0; + if (!forceX) + { + if (value3.X > (float)(WorldGen.lastMaxTilesX - 200)) + { + int num5 = -1; + vector.Y = 0f; + vector.X = (float)num5; + value.Y = 0f; + value.X = (float)num5; + if (WorldGen.genRand.Next(3) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.Y = -0.2f; + } + else + { + value.Y = 0.2f; + } + } + } + else + { + if (value3.X < 200f) + { + int num5 = 1; + vector.Y = 0f; + vector.X = (float)num5; + value.Y = 0f; + value.X = (float)num5; + if (WorldGen.genRand.Next(3) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.Y = -0.2f; + } + else + { + value.Y = 0.2f; + } + } + } + else + { + if (value3.Y > (float)(WorldGen.lastMaxTilesY - 300)) + { + int num5 = -1; + num += 1.0; + value.Y = (float)num5; + value.X = 0f; + vector.X = 0f; + vector.Y = (float)num5; + if (WorldGen.genRand.Next(2) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.X = (float)WorldGen.genRand.Next(20, 50) * 0.01f; + } + else + { + value.X = (float)(-(float)WorldGen.genRand.Next(20, 50)) * 0.01f; + } + } + } + else + { + if ((double)value3.Y < Main.rockLayer + 100.0) + { + int num5 = 1; + num += 1.0; + value.Y = (float)num5; + value.X = 0f; + vector.X = 0f; + vector.Y = (float)num5; + if (WorldGen.genRand.Next(3) != 0) + { + flag2 = true; + if (WorldGen.genRand.Next(2) == 0) + { + value.X = (float)WorldGen.genRand.Next(10, 20) * 0.1f; + } + else + { + value.X = (float)(-(float)WorldGen.genRand.Next(10, 20)) * 0.1f; + } + } + else + { + if (WorldGen.genRand.Next(2) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.X = (float)WorldGen.genRand.Next(20, 50) * 0.01f; + } + else + { + value.X = (float)WorldGen.genRand.Next(20, 50) * 0.01f; + } + } + } + } + else + { + if (value3.X < (float)(Main.maxTilesX / 2) && (double)value3.X > (double)Main.maxTilesX * 0.25) + { + int num5 = -1; + vector.Y = 0f; + vector.X = (float)num5; + value.Y = 0f; + value.X = (float)num5; + if (WorldGen.genRand.Next(3) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.Y = -0.2f; + } + else + { + value.Y = 0.2f; + } + } + } + else + { + if (value3.X > (float)(Main.maxTilesX / 2) && (double)value3.X < (double)Main.maxTilesX * 0.75) + { + int num5 = 1; + vector.Y = 0f; + vector.X = (float)num5; + value.Y = 0f; + value.X = (float)num5; + if (WorldGen.genRand.Next(3) == 0) + { + if (WorldGen.genRand.Next(2) == 0) + { + value.Y = -0.2f; + } + else + { + value.Y = 0.2f; + } + } + } + } + } + } + } + } + } + if (vector.Y == 0f) + { + WorldGen.DDoorX[WorldGen.numDDoors] = (int)value3.X; + WorldGen.DDoorY[WorldGen.numDDoors] = (int)value3.Y; + WorldGen.DDoorPos[WorldGen.numDDoors] = 0; + WorldGen.numDDoors++; + } + else + { + WorldGen.DPlatX[WorldGen.numDPlats] = (int)value3.X; + WorldGen.DPlatY[WorldGen.numDPlats] = (int)value3.Y; + WorldGen.numDPlats++; + } + WorldGen.lastDungeonHall = vector; + if (Math.Abs(value.X) > Math.Abs(value.Y) && WorldGen.genRand.Next(3) != 0) + { + num = (double)((int)((double)((float)num2) * ((double)WorldGen.genRand.Next(110, 150) * 0.01))); + } + while (k > 0) + { + num7++; + if (vector.X > 0f && value3.X > (float)(Main.maxTilesX - 100)) + { + k = 0; + } + else + { + if (vector.X < 0f && value3.X < 100f) + { + k = 0; + } + else + { + if (vector.Y > 0f && value3.Y > (float)(Main.maxTilesY - 100)) + { + k = 0; + } + else + { + if (vector.Y < 0f && (double)value3.Y < Main.rockLayer + 50.0) + { + k = 0; + } + } + } + } + k--; + int num8 = (int)((double)value3.X - num - 4.0 - (double)WorldGen.genRand.Next(6)); + int num9 = (int)((double)value3.X + num + 4.0 + (double)WorldGen.genRand.Next(6)); + int num10 = (int)((double)value3.Y - num - 4.0 - (double)WorldGen.genRand.Next(6)); + int num11 = (int)((double)value3.Y + num + 4.0 + (double)WorldGen.genRand.Next(6)); + if (num8 < 0) + { + num8 = 0; + } + if (num9 > Main.maxTilesX) + { + num9 = Main.maxTilesX; + } + if (num10 < 0) + { + num10 = 0; + } + if (num11 > Main.maxTilesY) + { + num11 = Main.maxTilesY; + } + for (int num12 = num8; num12 < num9; num12++) + { + for (int num13 = num10; num13 < num11; num13++) + { + if (num12 < WorldGen.dMinX) + { + WorldGen.dMinX = num12; + } + if (num12 > WorldGen.dMaxX) + { + WorldGen.dMaxX = num12; + } + if (num13 > WorldGen.dMaxY) + { + WorldGen.dMaxY = num13; + } + Main.tile[num12, num13].liquid = 0; + if (!Main.wallDungeon[(int)Main.tile[num12, num13].wall]) + { + Main.tile[num12, num13].active(true); + Main.tile[num12, num13].type = (byte)tileType; + } + } + } + for (int num14 = num8 + 1; num14 < num9 - 1; num14++) + { + for (int num15 = num10 + 1; num15 < num11 - 1; num15++) + { + Main.tile[num14, num15].wall = (byte)wallType; + } + } + int num16 = 0; + if (value.Y == 0f && WorldGen.genRand.Next((int)num + 1) == 0) + { + num16 = WorldGen.genRand.Next(1, 3); + } + else + { + if (value.X == 0f && WorldGen.genRand.Next((int)num - 1) == 0) + { + num16 = WorldGen.genRand.Next(1, 3); + } + else + { + if (WorldGen.genRand.Next((int)num * 3) == 0) + { + num16 = WorldGen.genRand.Next(1, 3); + } + } + } + num8 = (int)((double)value3.X - num * 0.5 - (double)num16); + num9 = (int)((double)value3.X + num * 0.5 + (double)num16); + num10 = (int)((double)value3.Y - num * 0.5 - (double)num16); + num11 = (int)((double)value3.Y + num * 0.5 + (double)num16); + if (num8 < 0) + { + num8 = 0; + } + if (num9 > Main.maxTilesX) + { + num9 = Main.maxTilesX; + } + if (num10 < 0) + { + num10 = 0; + } + if (num11 > Main.maxTilesY) + { + num11 = Main.maxTilesY; + } + for (int num17 = num8; num17 < num9; num17++) + { + for (int num18 = num10; num18 < num11; num18++) + { + Main.tile[num17, num18].active(false); + Main.tile[num17, num18].wall = (byte)wallType; + } + } + value3 += value; + if (flag2 && num7 > WorldGen.genRand.Next(10, 20)) + { + num7 = 0; + value.X *= -1f; + } + } + WorldGen.dungeonX = (int)value3.X; + WorldGen.dungeonY = (int)value3.Y; + if (vector.Y == 0f) + { + WorldGen.DDoorX[WorldGen.numDDoors] = (int)value3.X; + WorldGen.DDoorY[WorldGen.numDDoors] = (int)value3.Y; + WorldGen.DDoorPos[WorldGen.numDDoors] = 0; + WorldGen.numDDoors++; + return; + } + WorldGen.DPlatX[WorldGen.numDPlats] = (int)value3.X; + WorldGen.DPlatY[WorldGen.numDPlats] = (int)value3.Y; + WorldGen.numDPlats++; + } + public static void DungeonRoom(int i, int j, int tileType, int wallType) + { + double num = (double)WorldGen.genRand.Next(15, 30); + Vector2 value; + value.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + Vector2 value2; + value2.X = (float)i; + value2.Y = (float)j - (float)num / 2f; + int k = WorldGen.genRand.Next(10, 20); + double num2 = (double)value2.X; + double num3 = (double)value2.X; + double num4 = (double)value2.Y; + double num5 = (double)value2.Y; + while (k > 0) + { + k--; + int num6 = (int)((double)value2.X - num * 0.800000011920929 - 5.0); + int num7 = (int)((double)value2.X + num * 0.800000011920929 + 5.0); + int num8 = (int)((double)value2.Y - num * 0.800000011920929 - 5.0); + int num9 = (int)((double)value2.Y + num * 0.800000011920929 + 5.0); + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesX) + { + num7 = Main.maxTilesX; + } + if (num8 < 0) + { + num8 = 0; + } + if (num9 > Main.maxTilesY) + { + num9 = Main.maxTilesY; + } + for (int l = num6; l < num7; l++) + { + for (int m = num8; m < num9; m++) + { + if (l < WorldGen.dMinX) + { + WorldGen.dMinX = l; + } + if (l > WorldGen.dMaxX) + { + WorldGen.dMaxX = l; + } + if (m > WorldGen.dMaxY) + { + WorldGen.dMaxY = m; + } + Main.tile[l, m].liquid = 0; + if (!Main.wallDungeon[(int)Main.tile[l, m].wall]) + { + Main.tile[l, m].active(true); + Main.tile[l, m].type = (byte)tileType; + } + } + } + for (int n = num6 + 1; n < num7 - 1; n++) + { + for (int num10 = num8 + 1; num10 < num9 - 1; num10++) + { + Main.tile[n, num10].wall = (byte)wallType; + } + } + num6 = (int)((double)value2.X - num * 0.5); + num7 = (int)((double)value2.X + num * 0.5); + num8 = (int)((double)value2.Y - num * 0.5); + num9 = (int)((double)value2.Y + num * 0.5); + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesX) + { + num7 = Main.maxTilesX; + } + if (num8 < 0) + { + num8 = 0; + } + if (num9 > Main.maxTilesY) + { + num9 = Main.maxTilesY; + } + if ((double)num6 < num2) + { + num2 = (double)num6; + } + if ((double)num7 > num3) + { + num3 = (double)num7; + } + if ((double)num8 < num4) + { + num4 = (double)num8; + } + if ((double)num9 > num5) + { + num5 = (double)num9; + } + for (int num11 = num6; num11 < num7; num11++) + { + for (int num12 = num8; num12 < num9; num12++) + { + Main.tile[num11, num12].active(false); + Main.tile[num11, num12].wall = (byte)wallType; + } + } + value2 += value; + value.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value.X > 1f) + { + value.X = 1f; + } + if (value.X < -1f) + { + value.X = -1f; + } + if (value.Y > 1f) + { + value.Y = 1f; + } + if (value.Y < -1f) + { + value.Y = -1f; + } + } + WorldGen.dRoomX[WorldGen.numDRooms] = (int)value2.X; + WorldGen.dRoomY[WorldGen.numDRooms] = (int)value2.Y; + WorldGen.dRoomSize[WorldGen.numDRooms] = (int)num; + WorldGen.dRoomL[WorldGen.numDRooms] = (int)num2; + WorldGen.dRoomR[WorldGen.numDRooms] = (int)num3; + WorldGen.dRoomT[WorldGen.numDRooms] = (int)num4; + WorldGen.dRoomB[WorldGen.numDRooms] = (int)num5; + WorldGen.dRoomTreasure[WorldGen.numDRooms] = false; + WorldGen.numDRooms++; + } + public static void DungeonEnt(int i, int j, int tileType, int wallType) + { + int num = 60; + for (int k = i - num; k < i + num; k++) + { + for (int l = j - num; l < j + num; l++) + { + Main.tile[k, l].liquid = 0; + Main.tile[k, l].lava(false); + } + } + double num2 = WorldGen.dxStrength1; + double num3 = WorldGen.dyStrength1; + Vector2 vector; + vector.X = (float)i; + vector.Y = (float)j - (float)num3 / 2f; + WorldGen.dMinY = (int)vector.Y; + int num4 = 1; + if (i > Main.maxTilesX / 2) + { + num4 = -1; + } + int num5 = (int)((double)vector.X - num2 * 0.60000002384185791 - (double)WorldGen.genRand.Next(2, 5)); + int num6 = (int)((double)vector.X + num2 * 0.60000002384185791 + (double)WorldGen.genRand.Next(2, 5)); + int num7 = (int)((double)vector.Y - num3 * 0.60000002384185791 - (double)WorldGen.genRand.Next(2, 5)); + int num8 = (int)((double)vector.Y + num3 * 0.60000002384185791 + (double)WorldGen.genRand.Next(8, 16)); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int m = num5; m < num6; m++) + { + for (int n = num7; n < num8; n++) + { + Main.tile[m, n].liquid = 0; + if ((int)Main.tile[m, n].wall != wallType) + { + Main.tile[m, n].wall = 0; + if (m > num5 + 1 && m < num6 - 2 && n > num7 + 1 && n < num8 - 2) + { + Main.tile[m, n].wall = (byte)wallType; + } + Main.tile[m, n].active(true); + Main.tile[m, n].type = (byte)tileType; + } + } + } + int num9 = num5; + int num10 = num5 + 5 + WorldGen.genRand.Next(4); + int num11 = num7 - 3 - WorldGen.genRand.Next(3); + int num12 = num7; + for (int num13 = num9; num13 < num10; num13++) + { + for (int num14 = num11; num14 < num12; num14++) + { + if ((int)Main.tile[num13, num14].wall != wallType) + { + Main.tile[num13, num14].active(true); + Main.tile[num13, num14].type = (byte)tileType; + } + } + } + num9 = num6 - 5 - WorldGen.genRand.Next(4); + num10 = num6; + num11 = num7 - 3 - WorldGen.genRand.Next(3); + num12 = num7; + for (int num15 = num9; num15 < num10; num15++) + { + for (int num16 = num11; num16 < num12; num16++) + { + if ((int)Main.tile[num15, num16].wall != wallType) + { + Main.tile[num15, num16].active(true); + Main.tile[num15, num16].type = (byte)tileType; + } + } + } + int num17 = 1 + WorldGen.genRand.Next(2); + int num18 = 2 + WorldGen.genRand.Next(4); + int num19 = 0; + for (int num20 = num5; num20 < num6; num20++) + { + for (int num21 = num7 - num17; num21 < num7; num21++) + { + if ((int)Main.tile[num20, num21].wall != wallType) + { + Main.tile[num20, num21].active(true); + Main.tile[num20, num21].type = (byte)tileType; + } + } + num19++; + if (num19 >= num18) + { + num20 += num18; + num19 = 0; + } + } + for (int num22 = num5; num22 < num6; num22++) + { + int num23 = num8; + while ((double)num23 < Main.worldSurface) + { + if (!Main.wallDungeon[(int)Main.tile[num22, num23].wall]) + { + Main.tile[num22, num23].active(true); + Main.tile[num22, num23].type = (byte)tileType; + } + Main.tile[num22, num23].wall = (byte)wallType; + num23++; + } + } + num5 = (int)((double)vector.X - num2 * 0.60000002384185791); + num6 = (int)((double)vector.X + num2 * 0.60000002384185791); + num7 = (int)((double)vector.Y - num3 * 0.60000002384185791); + num8 = (int)((double)vector.Y + num3 * 0.60000002384185791); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num24 = num5; num24 < num6; num24++) + { + for (int num25 = num7; num25 < num8; num25++) + { + Main.tile[num24, num25].wall = (byte)wallType; + } + } + num5 = (int)((double)vector.X - num2 * 0.6 - 1.0); + num6 = (int)((double)vector.X + num2 * 0.6 + 1.0); + num7 = (int)((double)vector.Y - num3 * 0.6 - 1.0); + num8 = (int)((double)vector.Y + num3 * 0.6 + 1.0); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num26 = num5; num26 < num6; num26++) + { + for (int num27 = num7; num27 < num8; num27++) + { + Main.tile[num26, num27].wall = (byte)wallType; + } + } + num5 = (int)((double)vector.X - num2 * 0.5); + num6 = (int)((double)vector.X + num2 * 0.5); + num7 = (int)((double)vector.Y - num3 * 0.5); + num8 = (int)((double)vector.Y + num3 * 0.5); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num28 = num5; num28 < num6; num28++) + { + for (int num29 = num7; num29 < num8; num29++) + { + Main.tile[num28, num29].active(false); + Main.tile[num28, num29].wall = (byte)wallType; + } + } + int num30 = (int)vector.X; + int num31 = num8; + for (int num32 = 0; num32 < 20; num32++) + { + num30 = (int)vector.X - num32; + if (!Main.tile[num30, num31].active() && Main.wallDungeon[(int)Main.tile[num30, num31].wall]) + { + WorldGen.DPlatX[WorldGen.numDPlats] = num30; + WorldGen.DPlatY[WorldGen.numDPlats] = num31; + WorldGen.numDPlats++; + break; + } + num30 = (int)vector.X + num32; + if (!Main.tile[num30, num31].active() && Main.wallDungeon[(int)Main.tile[num30, num31].wall]) + { + WorldGen.DPlatX[WorldGen.numDPlats] = num30; + WorldGen.DPlatY[WorldGen.numDPlats] = num31; + WorldGen.numDPlats++; + break; + } + } + vector.X += (float)num2 * 0.6f * (float)num4; + vector.Y += (float)num3 * 0.5f; + num2 = WorldGen.dxStrength2; + num3 = WorldGen.dyStrength2; + vector.X += (float)num2 * 0.55f * (float)num4; + vector.Y -= (float)num3 * 0.5f; + num5 = (int)((double)vector.X - num2 * 0.60000002384185791 - (double)WorldGen.genRand.Next(1, 3)); + num6 = (int)((double)vector.X + num2 * 0.60000002384185791 + (double)WorldGen.genRand.Next(1, 3)); + num7 = (int)((double)vector.Y - num3 * 0.60000002384185791 - (double)WorldGen.genRand.Next(1, 3)); + num8 = (int)((double)vector.Y + num3 * 0.60000002384185791 + (double)WorldGen.genRand.Next(6, 16)); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num33 = num5; num33 < num6; num33++) + { + for (int num34 = num7; num34 < num8; num34++) + { + if ((int)Main.tile[num33, num34].wall != wallType) + { + bool flag = true; + if (num4 < 0) + { + if ((double)num33 < (double)vector.X - num2 * 0.5) + { + flag = false; + } + } + else + { + if ((double)num33 > (double)vector.X + num2 * 0.5 - 1.0) + { + flag = false; + } + } + if (flag) + { + Main.tile[num33, num34].wall = 0; + Main.tile[num33, num34].active(true); + Main.tile[num33, num34].type = (byte)tileType; + } + } + } + } + for (int num35 = num5; num35 < num6; num35++) + { + int num36 = num8; + while ((double)num36 < Main.worldSurface) + { + if (!Main.wallDungeon[(int)Main.tile[num35, num36].wall]) + { + Main.tile[num35, num36].active(true); + Main.tile[num35, num36].type = (byte)tileType; + } + Main.tile[num35, num36].wall = (byte)wallType; + num36++; + } + } + num5 = (int)((double)vector.X - num2 * 0.5); + num6 = (int)((double)vector.X + num2 * 0.5); + num9 = num5; + if (num4 < 0) + { + num9++; + } + num10 = num9 + 5 + WorldGen.genRand.Next(4); + num11 = num7 - 3 - WorldGen.genRand.Next(3); + num12 = num7; + for (int num37 = num9; num37 < num10; num37++) + { + for (int num38 = num11; num38 < num12; num38++) + { + if ((int)Main.tile[num37, num38].wall != wallType) + { + Main.tile[num37, num38].active(true); + Main.tile[num37, num38].type = (byte)tileType; + } + } + } + num9 = num6 - 5 - WorldGen.genRand.Next(4); + num10 = num6; + num11 = num7 - 3 - WorldGen.genRand.Next(3); + num12 = num7; + for (int num39 = num9; num39 < num10; num39++) + { + for (int num40 = num11; num40 < num12; num40++) + { + if ((int)Main.tile[num39, num40].wall != wallType) + { + Main.tile[num39, num40].active(true); + Main.tile[num39, num40].type = (byte)tileType; + } + } + } + num17 = 1 + WorldGen.genRand.Next(2); + num18 = 2 + WorldGen.genRand.Next(4); + num19 = 0; + if (num4 < 0) + { + num6++; + } + for (int num41 = num5 + 1; num41 < num6 - 1; num41++) + { + for (int num42 = num7 - num17; num42 < num7; num42++) + { + if ((int)Main.tile[num41, num42].wall != wallType) + { + Main.tile[num41, num42].active(true); + Main.tile[num41, num42].type = (byte)tileType; + } + } + num19++; + if (num19 >= num18) + { + num41 += num18; + num19 = 0; + } + } + num5 = (int)((double)vector.X - num2 * 0.6); + num6 = (int)((double)vector.X + num2 * 0.6); + num7 = (int)((double)vector.Y - num3 * 0.6); + num8 = (int)((double)vector.Y + num3 * 0.6); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num43 = num5; num43 < num6; num43++) + { + for (int num44 = num7; num44 < num8; num44++) + { + Main.tile[num43, num44].wall = 0; + } + } + num5 = (int)((double)vector.X - num2 * 0.5); + num6 = (int)((double)vector.X + num2 * 0.5); + num7 = (int)((double)vector.Y - num3 * 0.5); + num8 = (int)((double)vector.Y + num3 * 0.5); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num45 = num5; num45 < num6; num45++) + { + for (int num46 = num7; num46 < num8; num46++) + { + Main.tile[num45, num46].active(false); + Main.tile[num45, num46].wall = 0; + } + } + for (int num47 = num5; num47 < num6; num47++) + { + if (!Main.tile[num47, num8].active()) + { + Main.tile[num47, num8].active(true); + Main.tile[num47, num8].type = 19; + if (wallType == 7) + { + Main.tile[num47, num8].frameY = 108; + } + if (wallType == 8) + { + Main.tile[num47, num8].frameY = 144; + } + if (wallType == 9) + { + Main.tile[num47, num8].frameY = 126; + } + } + } + Main.dungeonX = (int)vector.X; + Main.dungeonY = num8; + int num48 = NPC.NewNPC(Main.dungeonX * 16 + 8, Main.dungeonY * 16, 37, 0); + Main.npc[num48].homeless = false; + Main.npc[num48].homeTileX = Main.dungeonX; + Main.npc[num48].homeTileY = Main.dungeonY; + if (num4 == 1) + { + int num49 = 0; + for (int num50 = num6; num50 < num6 + 50; num50++) + { + num49++; + for (int num51 = num8 + num49; num51 < num8 + 50; num51++) + { + if (!Main.wallDungeon[(int)Main.tile[num50, num51].wall]) + { + Main.tile[num50, num51].active(true); + Main.tile[num50, num51].type = (byte)tileType; + } + } + } + } + else + { + int num52 = 0; + for (int num53 = num5; num53 > num5 - 50; num53--) + { + num52++; + for (int num54 = num8 + num52; num54 < num8 + 50; num54++) + { + if (!Main.wallDungeon[(int)Main.tile[num53, num54].wall]) + { + Main.tile[num53, num54].active(true); + Main.tile[num53, num54].type = (byte)tileType; + } + } + } + } + num17 = 1 + WorldGen.genRand.Next(2); + num18 = 2 + WorldGen.genRand.Next(4); + num19 = 0; + num5 = (int)((double)vector.X - num2 * 0.5); + num6 = (int)((double)vector.X + num2 * 0.5); + num5 += 2; + num6 -= 2; + for (int num55 = num5; num55 < num6; num55++) + { + for (int num56 = num7; num56 < num8; num56++) + { + WorldGen.PlaceWall(num55, num56, wallType, true); + } + num19++; + if (num19 >= num18) + { + num55 += num18 * 2; + num19 = 0; + } + } + vector.X -= (float)num2 * 0.6f * (float)num4; + vector.Y += (float)num3 * 0.5f; + num2 = 15.0; + num3 = 3.0; + vector.Y -= (float)num3 * 0.5f; + num5 = (int)((double)vector.X - num2 * 0.5); + num6 = (int)((double)vector.X + num2 * 0.5); + num7 = (int)((double)vector.Y - num3 * 0.5); + num8 = (int)((double)vector.Y + num3 * 0.5); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int num57 = num5; num57 < num6; num57++) + { + for (int num58 = num7; num58 < num8; num58++) + { + Main.tile[num57, num58].active(false); + } + } + if (num4 < 0) + { + vector.X -= 1f; + } + WorldGen.PlaceTile((int)vector.X, (int)vector.Y + 1, 10, true, false, -1, 13); + } + public static bool AddBuriedChest(int i, int j, int contain = 0, bool notNearOtherChests = false, int Style = -1) + { + if (WorldGen.genRand == null) + { + WorldGen.genRand = new Random((int)DateTime.Now.Ticks); + } + int k = j; + while (k < Main.maxTilesY) + { + if (WorldGen.SolidTile(i, k)) + { + bool flag = false; + int num = k; + int num2 = 0; + if ((double)num >= Main.worldSurface + 25.0 || contain > 0) + { + num2 = 1; + if (contain == 211 || contain == 212 || contain == 213 || contain == 753) + { + num2 = 10; + } + } + if (Style >= 0) + { + num2 = Style; + } + if (contain == 0 && (double)num >= Main.worldSurface + 25.0 && num <= Main.maxTilesY - 205 && (Main.tile[i, k].type == 147 || Main.tile[i, k].type == 161 || Main.tile[i, k].type == 162)) + { + num2 = 11; + int num3 = WorldGen.genRand.Next(6); + if (num3 == 0) + { + contain = 670; + } + else + { + if (num3 == 1) + { + contain = 724; + } + else + { + if (num3 == 2) + { + contain = 950; + } + else + { + if (num3 == 3) + { + contain = 1319; + } + else + { + if (num3 == 4) + { + contain = 987; + } + else + { + if (num3 == 5) + { + contain = 1579; + } + } + } + } + } + } + if (WorldGen.genRand.Next(20) == 0) + { + contain = 997; + } + if (WorldGen.genRand.Next(50) == 0) + { + contain = 669; + } + } + if (num > Main.maxTilesY - 205 && contain == 0) + { + if (WorldGen.hellChest == 0) + { + contain = 274; + num2 = 4; + flag = true; + } + else + { + if (WorldGen.hellChest == 1) + { + contain = 220; + num2 = 4; + flag = true; + } + else + { + if (WorldGen.hellChest == 2) + { + contain = 112; + num2 = 4; + flag = true; + } + else + { + if (WorldGen.hellChest == 3) + { + contain = 218; + num2 = 4; + flag = true; + } + } + } + } + } + int num4 = WorldGen.PlaceChest(i - 1, num - 1, 21, notNearOtherChests, num2); + if (num4 >= 0) + { + if (flag) + { + WorldGen.hellChest++; + if (WorldGen.hellChest > 3) + { + WorldGen.hellChest = 0; + } + } + int num5 = 0; + while (num5 == 0) + { + if ((double)num < Main.worldSurface + 25.0 || contain == 848) + { + if (contain > 0) + { + Main.chest[num4].item[num5].SetDefaults(contain, false); + Main.chest[num4].item[num5].Prefix(-1); + if (contain == 848) + { + num5++; + Main.chest[num4].item[num5].SetDefaults(866, false); + } + num5++; + } + else + { + int num6 = WorldGen.genRand.Next(8); + if (num6 == 0) + { + Main.chest[num4].item[num5].SetDefaults(280, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num6 == 1) + { + Main.chest[num4].item[num5].SetDefaults(281, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num6 == 2) + { + Main.chest[num4].item[num5].SetDefaults(284, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num6 == 3) + { + Main.chest[num4].item[num5].SetDefaults(282, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(50, 75); + } + if (num6 == 4) + { + Main.chest[num4].item[num5].SetDefaults(279, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(25, 50); + } + if (num6 == 5) + { + Main.chest[num4].item[num5].SetDefaults(285, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num6 == 6) + { + Main.chest[num4].item[num5].SetDefaults(953, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num6 == 7) + { + Main.chest[num4].item[num5].SetDefaults(946, false); + Main.chest[num4].item[num5].Prefix(-1); + } + num5++; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[num4].item[num5].SetDefaults(168, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(3, 6); + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num7 = WorldGen.genRand.Next(2); + int stack = WorldGen.genRand.Next(8) + 3; + if (num7 == 0) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.copperBar, false); + } + if (num7 == 1) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.ironBar, false); + } + Main.chest[num4].item[num5].stack = stack; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int stack2 = WorldGen.genRand.Next(50, 101); + Main.chest[num4].item[num5].SetDefaults(965, false); + Main.chest[num4].item[num5].stack = stack2; + num5++; + } + if (WorldGen.genRand.Next(3) != 0) + { + int num8 = WorldGen.genRand.Next(2); + int stack3 = WorldGen.genRand.Next(26) + 25; + if (num8 == 0) + { + Main.chest[num4].item[num5].SetDefaults(40, false); + } + if (num8 == 1) + { + Main.chest[num4].item[num5].SetDefaults(42, false); + } + Main.chest[num4].item[num5].stack = stack3; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num9 = WorldGen.genRand.Next(1); + int stack4 = WorldGen.genRand.Next(3) + 3; + if (num9 == 0) + { + Main.chest[num4].item[num5].SetDefaults(28, false); + } + Main.chest[num4].item[num5].stack = stack4; + num5++; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num10 = WorldGen.genRand.Next(4); + int stack5 = WorldGen.genRand.Next(1, 3); + if (num10 == 0) + { + Main.chest[num4].item[num5].SetDefaults(292, false); + } + if (num10 == 1) + { + Main.chest[num4].item[num5].SetDefaults(298, false); + } + if (num10 == 2) + { + Main.chest[num4].item[num5].SetDefaults(299, false); + } + if (num10 == 3) + { + Main.chest[num4].item[num5].SetDefaults(290, false); + } + Main.chest[num4].item[num5].stack = stack5; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num11 = WorldGen.genRand.Next(2); + int stack6 = WorldGen.genRand.Next(11) + 10; + if (num11 == 0) + { + Main.chest[num4].item[num5].SetDefaults(8, false); + } + if (num11 == 1) + { + Main.chest[num4].item[num5].SetDefaults(31, false); + } + Main.chest[num4].item[num5].stack = stack6; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[num4].item[num5].SetDefaults(72, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(10, 30); + num5++; + } + } + else + { + if ((double)num < Main.rockLayer) + { + if (contain > 0) + { + Main.chest[num4].item[num5].SetDefaults(contain, false); + Main.chest[num4].item[num5].Prefix(-1); + num5++; + } + else + { + int num12 = WorldGen.genRand.Next(7); + if (WorldGen.genRand.Next(20) == 0) + { + Main.chest[num4].item[num5].SetDefaults(997, false); + Main.chest[num4].item[num5].Prefix(-1); + } + else + { + if (num12 == 0) + { + Main.chest[num4].item[num5].SetDefaults(49, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num12 == 1) + { + Main.chest[num4].item[num5].SetDefaults(50, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num12 == 2) + { + Main.chest[num4].item[num5].SetDefaults(53, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num12 == 3) + { + Main.chest[num4].item[num5].SetDefaults(54, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num12 == 4) + { + Main.chest[num4].item[num5].SetDefaults(55, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num12 == 5) + { + Main.chest[num4].item[num5].SetDefaults(975, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num12 == 6) + { + Main.chest[num4].item[num5].SetDefaults(930, false); + Main.chest[num4].item[num5].Prefix(-1); + num5++; + Main.chest[num4].item[num5].SetDefaults(931, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(26) + 25; + } + } + num5++; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[num4].item[num5].SetDefaults(166, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(10, 20); + num5++; + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.chest[num4].item[num5].SetDefaults(52, false); + num5++; + } + if (WorldGen.genRand.Next(3) == 0) + { + int stack7 = WorldGen.genRand.Next(50, 101); + Main.chest[num4].item[num5].SetDefaults(965, false); + Main.chest[num4].item[num5].stack = stack7; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num13 = WorldGen.genRand.Next(2); + int stack8 = WorldGen.genRand.Next(10) + 5; + if (num13 == 0) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.ironBar, false); + } + if (num13 == 1) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.silverBar, false); + } + Main.chest[num4].item[num5].stack = stack8; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num14 = WorldGen.genRand.Next(2); + int stack9 = WorldGen.genRand.Next(25) + 25; + if (num14 == 0) + { + Main.chest[num4].item[num5].SetDefaults(40, false); + } + if (num14 == 1) + { + Main.chest[num4].item[num5].SetDefaults(42, false); + } + Main.chest[num4].item[num5].stack = stack9; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num15 = WorldGen.genRand.Next(1); + int stack10 = WorldGen.genRand.Next(3) + 3; + if (num15 == 0) + { + Main.chest[num4].item[num5].SetDefaults(28, false); + } + Main.chest[num4].item[num5].stack = stack10; + num5++; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num16 = WorldGen.genRand.Next(7); + int stack11 = WorldGen.genRand.Next(1, 3); + if (num16 == 0) + { + Main.chest[num4].item[num5].SetDefaults(289, false); + } + if (num16 == 1) + { + Main.chest[num4].item[num5].SetDefaults(298, false); + } + if (num16 == 2) + { + Main.chest[num4].item[num5].SetDefaults(299, false); + } + if (num16 == 3) + { + Main.chest[num4].item[num5].SetDefaults(290, false); + } + if (num16 == 4) + { + Main.chest[num4].item[num5].SetDefaults(303, false); + } + if (num16 == 5) + { + Main.chest[num4].item[num5].SetDefaults(291, false); + } + if (num16 == 6) + { + Main.chest[num4].item[num5].SetDefaults(304, false); + } + Main.chest[num4].item[num5].stack = stack11; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int stack12 = WorldGen.genRand.Next(11) + 10; + if (num2 == 11) + { + Main.chest[num4].item[num5].SetDefaults(974, false); + } + else + { + Main.chest[num4].item[num5].SetDefaults(8, false); + } + Main.chest[num4].item[num5].stack = stack12; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[num4].item[num5].SetDefaults(72, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(50, 90); + num5++; + } + } + else + { + if (num < Main.maxTilesY - 250) + { + if (contain > 0) + { + Main.chest[num4].item[num5].SetDefaults(contain, false); + Main.chest[num4].item[num5].Prefix(-1); + num5++; + } + else + { + int num17 = WorldGen.genRand.Next(7); + if (WorldGen.genRand.Next(40) == 0) + { + Main.chest[num4].item[num5].SetDefaults(906, false); + Main.chest[num4].item[num5].Prefix(-1); + } + else + { + if (WorldGen.genRand.Next(15) == 0) + { + Main.chest[num4].item[num5].SetDefaults(997, false); + Main.chest[num4].item[num5].Prefix(-1); + } + else + { + if (num17 == 0) + { + Main.chest[num4].item[num5].SetDefaults(49, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num17 == 1) + { + Main.chest[num4].item[num5].SetDefaults(50, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num17 == 2) + { + Main.chest[num4].item[num5].SetDefaults(53, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num17 == 3) + { + Main.chest[num4].item[num5].SetDefaults(54, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num17 == 4) + { + Main.chest[num4].item[num5].SetDefaults(55, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num17 == 5) + { + Main.chest[num4].item[num5].SetDefaults(975, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num17 == 6) + { + Main.chest[num4].item[num5].SetDefaults(930, false); + Main.chest[num4].item[num5].Prefix(-1); + num5++; + Main.chest[num4].item[num5].SetDefaults(931, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(26) + 25; + } + } + } + num5++; + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.chest[num4].item[num5].SetDefaults(43, false); + num5++; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[num4].item[num5].SetDefaults(167, false); + num5++; + } + if (WorldGen.genRand.Next(4) == 0) + { + Main.chest[num4].item[num5].SetDefaults(51, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(26) + 25; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num18 = WorldGen.genRand.Next(2); + int stack13 = WorldGen.genRand.Next(8) + 3; + if (num18 == 0) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.goldBar, false); + } + if (num18 == 1) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.silverBar, false); + } + Main.chest[num4].item[num5].stack = stack13; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num19 = WorldGen.genRand.Next(2); + int stack14 = WorldGen.genRand.Next(26) + 25; + if (num19 == 0) + { + Main.chest[num4].item[num5].SetDefaults(41, false); + } + if (num19 == 1) + { + Main.chest[num4].item[num5].SetDefaults(279, false); + } + Main.chest[num4].item[num5].stack = stack14; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num20 = WorldGen.genRand.Next(1); + int stack15 = WorldGen.genRand.Next(3) + 3; + if (num20 == 0) + { + Main.chest[num4].item[num5].SetDefaults(188, false); + } + Main.chest[num4].item[num5].stack = stack15; + num5++; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num21 = WorldGen.genRand.Next(6); + int stack16 = WorldGen.genRand.Next(1, 3); + if (num21 == 0) + { + Main.chest[num4].item[num5].SetDefaults(296, false); + } + if (num21 == 1) + { + Main.chest[num4].item[num5].SetDefaults(295, false); + } + if (num21 == 2) + { + Main.chest[num4].item[num5].SetDefaults(299, false); + } + if (num21 == 3) + { + Main.chest[num4].item[num5].SetDefaults(302, false); + } + if (num21 == 4) + { + Main.chest[num4].item[num5].SetDefaults(303, false); + } + if (num21 == 5) + { + Main.chest[num4].item[num5].SetDefaults(305, false); + } + Main.chest[num4].item[num5].stack = stack16; + num5++; + } + if (WorldGen.genRand.Next(3) > 1) + { + int num22 = WorldGen.genRand.Next(4); + int stack17 = WorldGen.genRand.Next(1, 3); + if (num22 == 0) + { + Main.chest[num4].item[num5].SetDefaults(301, false); + } + if (num22 == 1) + { + Main.chest[num4].item[num5].SetDefaults(302, false); + } + if (num22 == 2) + { + Main.chest[num4].item[num5].SetDefaults(297, false); + } + if (num22 == 3) + { + Main.chest[num4].item[num5].SetDefaults(304, false); + } + Main.chest[num4].item[num5].stack = stack17; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num23 = WorldGen.genRand.Next(2); + int stack18 = WorldGen.genRand.Next(15) + 15; + if (num23 == 0) + { + if (num2 == 11) + { + Main.chest[num4].item[num5].SetDefaults(974, false); + } + else + { + Main.chest[num4].item[num5].SetDefaults(8, false); + } + } + if (num23 == 1) + { + Main.chest[num4].item[num5].SetDefaults(282, false); + } + Main.chest[num4].item[num5].stack = stack18; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[num4].item[num5].SetDefaults(73, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(1, 3); + num5++; + } + } + else + { + if (contain > 0) + { + Main.chest[num4].item[num5].SetDefaults(contain, false); + Main.chest[num4].item[num5].Prefix(-1); + num5++; + } + else + { + int num24 = WorldGen.genRand.Next(4); + if (num24 == 0) + { + Main.chest[num4].item[num5].SetDefaults(49, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num24 == 1) + { + Main.chest[num4].item[num5].SetDefaults(50, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num24 == 2) + { + Main.chest[num4].item[num5].SetDefaults(53, false); + Main.chest[num4].item[num5].Prefix(-1); + } + if (num24 == 3) + { + Main.chest[num4].item[num5].SetDefaults(54, false); + Main.chest[num4].item[num5].Prefix(-1); + } + num5++; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[num4].item[num5].SetDefaults(167, false); + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num25 = WorldGen.genRand.Next(2); + int stack19 = WorldGen.genRand.Next(15) + 15; + if (num25 == 0) + { + Main.chest[num4].item[num5].SetDefaults(117, false); + } + if (num25 == 1) + { + Main.chest[num4].item[num5].SetDefaults(WorldGen.goldBar, false); + } + Main.chest[num4].item[num5].stack = stack19; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num26 = WorldGen.genRand.Next(2); + int stack20 = WorldGen.genRand.Next(25) + 50; + if (num26 == 0) + { + Main.chest[num4].item[num5].SetDefaults(265, false); + } + if (num26 == 1) + { + Main.chest[num4].item[num5].SetDefaults(278, false); + } + Main.chest[num4].item[num5].stack = stack20; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num27 = WorldGen.genRand.Next(2); + int stack21 = WorldGen.genRand.Next(15) + 15; + if (num27 == 0) + { + Main.chest[num4].item[num5].SetDefaults(226, false); + } + if (num27 == 1) + { + Main.chest[num4].item[num5].SetDefaults(227, false); + } + Main.chest[num4].item[num5].stack = stack21; + num5++; + } + if (WorldGen.genRand.Next(4) > 0) + { + int num28 = WorldGen.genRand.Next(7); + int stack22 = WorldGen.genRand.Next(1, 3); + if (num28 == 0) + { + Main.chest[num4].item[num5].SetDefaults(296, false); + } + if (num28 == 1) + { + Main.chest[num4].item[num5].SetDefaults(295, false); + } + if (num28 == 2) + { + Main.chest[num4].item[num5].SetDefaults(293, false); + } + if (num28 == 3) + { + Main.chest[num4].item[num5].SetDefaults(288, false); + } + if (num28 == 4) + { + Main.chest[num4].item[num5].SetDefaults(294, false); + } + if (num28 == 5) + { + Main.chest[num4].item[num5].SetDefaults(297, false); + } + if (num28 == 6) + { + Main.chest[num4].item[num5].SetDefaults(304, false); + } + Main.chest[num4].item[num5].stack = stack22; + num5++; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num29 = WorldGen.genRand.Next(5); + int stack23 = WorldGen.genRand.Next(1, 3); + if (num29 == 0) + { + Main.chest[num4].item[num5].SetDefaults(305, false); + } + if (num29 == 1) + { + Main.chest[num4].item[num5].SetDefaults(301, false); + } + if (num29 == 2) + { + Main.chest[num4].item[num5].SetDefaults(302, false); + } + if (num29 == 3) + { + Main.chest[num4].item[num5].SetDefaults(288, false); + } + if (num29 == 4) + { + Main.chest[num4].item[num5].SetDefaults(300, false); + } + Main.chest[num4].item[num5].stack = stack23; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num30 = WorldGen.genRand.Next(2); + int stack24 = WorldGen.genRand.Next(15) + 15; + if (num30 == 0) + { + Main.chest[num4].item[num5].SetDefaults(8, false); + } + if (num30 == 1) + { + Main.chest[num4].item[num5].SetDefaults(282, false); + } + Main.chest[num4].item[num5].stack = stack24; + num5++; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[num4].item[num5].SetDefaults(73, false); + Main.chest[num4].item[num5].stack = WorldGen.genRand.Next(2, 5); + num5++; + } + } + } + } + } + return true; + } + return false; + } + else + { + k++; + } + } + return false; + } + public static void UnlockDoor(int i, int j) + { + int num = j; + while (Main.tile[i, num].frameY != 594) + { + num--; + if (Main.tile[i, num].frameY < 594 || num <= 0) + { + return; + } + } + Main.PlaySound(22, i * 16, num * 16 + 16, 1); + for (int k = num; k <= num + 2; k++) + { + if (Main.tile[i, k] == null) + { + Main.tile[i, k] = new Tile(); + } + Tile expr_81 = Main.tile[i, k]; + expr_81.frameY += 54; + for (int l = 0; l < 4; l++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(k * 16)), 16, 16, 11, 0f, 0f, 0, default(Color), 1f); + } + } + } + public static bool OpenDoor(int i, int j, int direction) + { + if (Main.tile[i, j - 1] == null) + { + Main.tile[i, j - 1] = new Tile(); + } + if (Main.tile[i, j - 2] == null) + { + Main.tile[i, j - 2] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].type != 10) + { + return false; + } + if (Main.tile[i, j].frameY >= 594 && Main.tile[i, j].frameY <= 646) + { + return false; + } + int k = (int)Main.tile[i, j].frameY; + int num = 0; + while (k >= 54) + { + k -= 54; + num++; + } + int num2 = j - k / 18; + byte color = Main.tile[i, num2].color(); + if (Main.tile[i, num2 + 1] == null) + { + Main.tile[i, num2 + 1] = new Tile(); + } + Main.tile[i, num2 + 1].color(); + if (Main.tile[i, num2 + 2] == null) + { + Main.tile[i, num2 + 2] = new Tile(); + } + Main.tile[i, num2 + 2].color(); + short num3 = 0; + int num4; + int num5; + if (direction == -1) + { + num4 = i - 1; + num3 = 36; + num5 = i - 1; + } + else + { + num4 = i; + num5 = i + 1; + } + bool flag = true; + for (int l = num2; l < num2 + 3; l++) + { + if (Main.tile[num5, l] == null) + { + Main.tile[num5, l] = new Tile(); + } + if (Main.tile[num5, l].active()) + { + if (!Main.tileCut[(int)Main.tile[num5, l].type] && Main.tile[num5, l].type != 3 && Main.tile[num5, l].type != 24 && Main.tile[num5, l].type != 52 && Main.tile[num5, l].type != 61 && Main.tile[num5, l].type != 62 && Main.tile[num5, l].type != 69 && Main.tile[num5, l].type != 71 && Main.tile[num5, l].type != 73 && Main.tile[num5, l].type != 74 && Main.tile[num5, l].type != 110 && Main.tile[num5, l].type != 113 && Main.tile[num5, l].type != 115) + { + flag = false; + break; + } + WorldGen.KillTile(num5, l, false, false, false); + } + } + if (flag) + { + if (Main.netMode != 1) + { + for (int m = num4; m <= num4 + 1; m++) + { + for (int n = num2; n <= num2 + 2; n++) + { + if (WorldGen.numNoWire < WorldGen.maxWire - 1) + { + WorldGen.noWireX[WorldGen.numNoWire] = m; + WorldGen.noWireY[WorldGen.numNoWire] = n; + WorldGen.numNoWire++; + } + } + } + } + int num6 = num * 54; + Main.PlaySound(8, i * 16, j * 16, 1); + Main.tile[num4, num2].active(true); + Main.tile[num4, num2].type = 11; + Main.tile[num4, num2].frameY = (short)num6; + Main.tile[num4, num2].frameX = num3; + Main.tile[num4, num2].color(color); + if (Main.tile[num4 + 1, num2] == null) + { + Main.tile[num4 + 1, num2] = new Tile(); + } + Main.tile[num4 + 1, num2].active(true); + Main.tile[num4 + 1, num2].type = 11; + Main.tile[num4 + 1, num2].frameY = (short)num6; + Main.tile[num4 + 1, num2].frameX = (short)(num3 + 18); + Main.tile[num4 + 1, num2].color(color); + if (Main.tile[num4, num2 + 1] == null) + { + Main.tile[num4, num2 + 1] = new Tile(); + } + Main.tile[num4, num2 + 1].active(true); + Main.tile[num4, num2 + 1].type = 11; + Main.tile[num4, num2 + 1].frameY = (short)(num6 + 18); + Main.tile[num4, num2 + 1].frameX = num3; + Main.tile[num4, num2 + 1].color(color); + if (Main.tile[num4 + 1, num2 + 1] == null) + { + Main.tile[num4 + 1, num2 + 1] = new Tile(); + } + Main.tile[num4 + 1, num2 + 1].active(true); + Main.tile[num4 + 1, num2 + 1].type = 11; + Main.tile[num4 + 1, num2 + 1].frameY = (short)(num6 + 18); + Main.tile[num4 + 1, num2 + 1].frameX = (short)(num3 + 18); + Main.tile[num4 + 1, num2 + 1].color(color); + if (Main.tile[num4, num2 + 2] == null) + { + Main.tile[num4, num2 + 2] = new Tile(); + } + Main.tile[num4, num2 + 2].active(true); + Main.tile[num4, num2 + 2].type = 11; + Main.tile[num4, num2 + 2].frameY = (short)(num6 + 36); + Main.tile[num4, num2 + 2].frameX = num3; + Main.tile[num4, num2 + 2].color(color); + if (Main.tile[num4 + 1, num2 + 2] == null) + { + Main.tile[num4 + 1, num2 + 2] = new Tile(); + } + Main.tile[num4 + 1, num2 + 2].active(true); + Main.tile[num4 + 1, num2 + 2].type = 11; + Main.tile[num4 + 1, num2 + 2].frameY = (short)(num6 + 36); + Main.tile[num4 + 1, num2 + 2].frameX = (short)(num3 + 18); + Main.tile[num4 + 1, num2 + 2].color(color); + for (int num7 = num4 - 1; num7 <= num4 + 2; num7++) + { + for (int num8 = num2 - 1; num8 <= num2 + 2; num8++) + { + WorldGen.TileFrame(num7, num8, false, false); + } + } + } + return flag; + } + public static void Check1xX(int x, int j, byte type) + { + if (WorldGen.destroyObject) + { + return; + } + int num = j - (int)(Main.tile[x, j].frameY / 18); + int frameX = (int)Main.tile[x, j].frameX; + int num2 = 3; + if (type == 92) + { + num2 = 6; + } + bool flag = false; + for (int i = 0; i < num2; i++) + { + if (Main.tile[x, num + i] == null) + { + Main.tile[x, num + i] = new Tile(); + } + if (!Main.tile[x, num + i].active()) + { + flag = true; + } + else + { + if (Main.tile[x, num + i].type != type) + { + flag = true; + } + else + { + if ((int)Main.tile[x, num + i].frameY != i * 18) + { + flag = true; + } + else + { + if ((int)Main.tile[x, num + i].frameX != frameX) + { + flag = true; + } + } + } + } + } + if (Main.tile[x, num + num2] == null) + { + Main.tile[x, num + num2] = new Tile(); + } + if (!WorldGen.SolidTile2(x, num + num2)) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + for (int k = 0; k < num2; k++) + { + if (Main.tile[x, num + k].type == type) + { + WorldGen.KillTile(x, num + k, false, false, false); + } + } + if (type == 92) + { + Item.NewItem(x * 16, j * 16, 32, 32, 341, 1, false, 0, false); + } + if (type == 93) + { + Item.NewItem(x * 16, j * 16, 32, 32, 342, 1, false, 0, false); + } + WorldGen.destroyObject = false; + } + } + public static void Check2xX(int i, int j, byte type) + { + if (WorldGen.destroyObject) + { + return; + } + int num = i; + int k; + for (k = (int)Main.tile[i, j].frameX; k >= 36; k -= 36) + { + } + if (k == 18) + { + num--; + } + if (Main.tile[num, j] == null) + { + Main.tile[num, j] = new Tile(); + } + int l = (int)(Main.tile[num, j].frameY / 18); + int num2 = 3; + if (type == 104) + { + num2 = 5; + } + if (type == 207) + { + num2 = 4; + } + int num3 = 0; + while (l >= num2) + { + l -= num2; + num3 += num2 * 18; + } + int num4 = j - l; + if (Main.tile[num, num4] == null) + { + Main.tile[num, num4] = new Tile(); + } + int frameX = (int)Main.tile[num, j].frameX; + bool flag = false; + for (int m = 0; m < num2; m++) + { + if (Main.tile[num, num4 + m] == null) + { + Main.tile[num, num4 + m] = new Tile(); + } + if (!Main.tile[num, num4 + m].active()) + { + flag = true; + } + else + { + if (Main.tile[num, num4 + m].type != type) + { + flag = true; + } + else + { + if ((int)Main.tile[num, num4 + m].frameY != m * 18 + num3) + { + flag = true; + } + else + { + if ((int)Main.tile[num, num4 + m].frameX != frameX) + { + flag = true; + } + } + } + } + if (Main.tile[num + 1, num4 + m] == null) + { + Main.tile[num + 1, num4 + m] = new Tile(); + } + if (!Main.tile[num + 1, num4 + m].active()) + { + flag = true; + } + else + { + if (Main.tile[num + 1, num4 + m].type != type) + { + flag = true; + } + else + { + if ((int)Main.tile[num + 1, num4 + m].frameY != m * 18 + num3) + { + flag = true; + } + else + { + if ((int)Main.tile[num + 1, num4 + m].frameX != frameX + 18) + { + flag = true; + } + } + } + } + } + if (!WorldGen.SolidTile2(num, num4 + num2)) + { + flag = true; + } + if (!WorldGen.SolidTile2(num + 1, num4 + num2)) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + for (int n = 0; n < num2; n++) + { + if (Main.tile[num, num4 + n].type == type) + { + WorldGen.KillTile(num, num4 + n, false, false, false); + } + if (Main.tile[num + 1, num4 + n].type == type) + { + WorldGen.KillTile(num + 1, num4 + n, false, false, false); + } + } + if (type == 104) + { + Item.NewItem(num * 16, j * 16, 32, 32, 359, 1, false, 0, false); + } + if (type == 105) + { + int num5 = frameX / 36; + if (num5 == 0) + { + num5 = 360; + } + else + { + if (num5 == 1) + { + num5 = 52; + } + else + { + if (num5 == 43) + { + num5 = 1152; + } + else + { + if (num5 == 44) + { + num5 = 1153; + } + else + { + if (num5 == 45) + { + num5 = 1154; + } + else + { + if (num5 == 46) + { + num5 = 1408; + } + else + { + if (num5 == 47) + { + num5 = 1409; + } + else + { + if (num5 == 48) + { + num5 = 1410; + } + else + { + if (num5 == 49) + { + num5 = 1462; + } + else + { + num5 = 438 + num5 - 2; + } + } + } + } + } + } + } + } + } + Item.NewItem(num * 16, j * 16, 32, 32, num5, 1, false, 0, false); + } + if (type == 207) + { + int num6 = frameX / 36; + if (num6 == 0) + { + num6 = 909; + } + else + { + if (num6 == 1) + { + num6 = 910; + } + else + { + if (num6 >= 2 && num6 <= 7) + { + num6 = 938 + num6; + } + } + } + Item.NewItem(num * 16, j * 16, 32, 32, num6, 1, false, 0, false); + } + WorldGen.destroyObject = false; + } + } + public static void PlaceTight(int x, int y, int type = 165, bool spiders = false) + { + if (Main.tile[x, y - 1] == null) + { + Main.tile[x, y - 1] = new Tile(); + } + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (WorldGen.SolidTile(x, y - 1) && !Main.tile[x, y].active() && !Main.tile[x, y + 1].active()) + { + if (spiders) + { + int num = 108 + Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num; + Main.tile[x, y].frameY = 0; + Main.tile[x, y + 1].type = (byte)type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameX = (short)num; + Main.tile[x, y + 1].frameY = 18; + return; + } + if (Main.tile[x, y - 1].type == 147 || Main.tile[x, y - 1].type == 161 || Main.tile[x, y - 1].type == 163 || Main.tile[x, y - 1].type == 164) + { + if (WorldGen.genRand.Next(2) == 0) + { + int num2 = Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num2; + Main.tile[x, y].frameY = 72; + } + else + { + int num3 = Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num3; + Main.tile[x, y].frameY = 0; + Main.tile[x, y + 1].type = (byte)type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameX = (short)num3; + Main.tile[x, y + 1].frameY = 18; + } + } + if (Main.tile[x, y - 1].type == 1 || Main.tileMoss[(int)Main.tile[x, y - 1].type]) + { + if (WorldGen.genRand.Next(2) == 0) + { + int num4 = 54 + Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num4; + Main.tile[x, y].frameY = 72; + } + else + { + int num5 = 54 + Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num5; + Main.tile[x, y].frameY = 0; + Main.tile[x, y + 1].type = (byte)type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameX = (short)num5; + Main.tile[x, y + 1].frameY = 18; + } + } + if (Main.tile[x, y - 1].type == 225) + { + int num6 = 162 + Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num6; + Main.tile[x, y].frameY = 72; + return; + } + } + else + { + if (spiders) + { + return; + } + if (WorldGen.SolidTile(x, y + 1) && !Main.tile[x, y].active() && !Main.tile[x, y - 1].active()) + { + if (Main.tile[x, y + 1].type == 1 || Main.tileMoss[(int)Main.tile[x, y + 1].type]) + { + if (WorldGen.genRand.Next(2) == 0) + { + int num7 = 54 + Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num7; + Main.tile[x, y].frameY = 90; + } + else + { + int num8 = 54 + Main.rand.Next(3) * 18; + Main.tile[x, y - 1].type = (byte)type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameX = (short)num8; + Main.tile[x, y - 1].frameY = 36; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num8; + Main.tile[x, y].frameY = 54; + } + } + if (Main.tile[x, y + 1].type == 225) + { + int num9 = 162 + Main.rand.Next(3) * 18; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num9; + Main.tile[x, y].frameY = 90; + } + } + } + } + public static void CheckTight(int x, int j) + { + if (Main.tile[x, j] == null) + { + return; + } + int num = j; + if (Main.tile[x, num].frameY == 72) + { + if (Main.tile[x, num - 1] == null) + { + Main.tile[x, num - 1] = new Tile(); + } + if (Main.tile[x, num] == null) + { + Main.tile[x, num] = new Tile(); + } + if (Main.tile[x, num + 1] == null) + { + Main.tile[x, num + 1] = new Tile(); + } + bool flag = false; + if (!WorldGen.SolidTile(x, num - 1)) + { + flag = true; + } + if (flag && Main.tile[x, num].type == Main.tile[x, j].type) + { + WorldGen.KillTile(x, num, false, false, false); + return; + } + } + else + { + if (Main.tile[x, num].frameY == 90) + { + if (Main.tile[x, num - 1] == null) + { + Main.tile[x, num - 1] = new Tile(); + } + if (Main.tile[x, num] == null) + { + Main.tile[x, num] = new Tile(); + } + if (Main.tile[x, num + 1] == null) + { + Main.tile[x, num + 1] = new Tile(); + } + bool flag2 = false; + if (!WorldGen.SolidTile(x, num + 1)) + { + flag2 = true; + } + if (flag2 && Main.tile[x, num].type == Main.tile[x, j].type) + { + WorldGen.KillTile(x, num, false, false, false); + return; + } + } + else + { + if (Main.tile[x, num].frameY >= 36) + { + if (Main.tile[x, num].frameY == 54) + { + num--; + } + if (Main.tile[x, num] == null) + { + Main.tile[x, num] = new Tile(); + } + if (Main.tile[x, num + 1] == null) + { + Main.tile[x, num + 1] = new Tile(); + } + if (Main.tile[x, num + 2] == null) + { + Main.tile[x, num + 2] = new Tile(); + } + bool flag3 = false; + if (!WorldGen.SolidTile(x, num + 2)) + { + flag3 = true; + } + if (Main.tile[x, num + 1].type != Main.tile[x, num].type) + { + flag3 = true; + } + if (Main.tile[x, num + 1].frameX != Main.tile[x, num].frameX) + { + flag3 = true; + } + if (flag3) + { + if (Main.tile[x, num].type == Main.tile[x, j].type) + { + WorldGen.KillTile(x, num, false, false, false); + } + if (Main.tile[x, num + 1].type == Main.tile[x, j].type) + { + WorldGen.KillTile(x, num + 1, false, false, false); + return; + } + } + } + else + { + if (Main.tile[x, num].frameY == 18) + { + num--; + } + if (Main.tile[x, num - 1] == null) + { + Main.tile[x, num - 1] = new Tile(); + } + if (Main.tile[x, num] == null) + { + Main.tile[x, num] = new Tile(); + } + if (Main.tile[x, num + 1] == null) + { + Main.tile[x, num + 1] = new Tile(); + } + bool flag4 = false; + if (!WorldGen.SolidTile(x, num - 1)) + { + flag4 = true; + } + if (Main.tile[x, num + 1].type != Main.tile[x, num].type) + { + flag4 = true; + } + if (Main.tile[x, num + 1].frameX != Main.tile[x, num].frameX) + { + flag4 = true; + } + if (flag4) + { + if (Main.tile[x, num].type == Main.tile[x, j].type) + { + WorldGen.KillTile(x, num, false, false, false); + } + if (Main.tile[x, num + 1].type == Main.tile[x, j].type) + { + WorldGen.KillTile(x, num + 1, false, false, false); + } + } + } + } + } + } + public static void Place1xX(int x, int y, int type, int style = 0) + { + int num = style * 18; + int num2 = 3; + if (type == 92) + { + num2 = 6; + } + bool flag = true; + for (int i = y - num2 + 1; i < y + 1; i++) + { + if (Main.tile[x, i] == null) + { + Main.tile[x, i] = new Tile(); + } + if (Main.tile[x, i].active()) + { + flag = false; + } + if (type == 93 && Main.tile[x, i].liquid > 0) + { + flag = false; + } + } + if (flag && WorldGen.SolidTile2(x, y + 1)) + { + for (int j = 0; j < num2; j++) + { + Main.tile[x, y - num2 + 1 + j].active(true); + Main.tile[x, y - num2 + 1 + j].frameY = (short)(j * 18); + Main.tile[x, y - num2 + 1 + j].frameX = (short)num; + Main.tile[x, y - num2 + 1 + j].type = (byte)type; + } + } + } + public static void Place2xX(int x, int y, int type, int style = 0) + { + int num = style * 36; + int num2 = 3; + if (type == 104) + { + num2 = 5; + } + if (type == 207) + { + num2 = 4; + } + bool flag = true; + for (int i = y - num2 + 1; i < y + 1; i++) + { + if (Main.tile[x, i] == null) + { + Main.tile[x, i] = new Tile(); + } + if (Main.tile[x, i].active()) + { + flag = false; + } + if (Main.tile[x + 1, i] == null) + { + Main.tile[x + 1, i] = new Tile(); + } + if (Main.tile[x + 1, i].active()) + { + flag = false; + } + } + if (flag && WorldGen.SolidTile2(x, y + 1) && WorldGen.SolidTile2(x + 1, y + 1)) + { + for (int j = 0; j < num2; j++) + { + Main.tile[x, y - num2 + 1 + j].active(true); + Main.tile[x, y - num2 + 1 + j].frameY = (short)(j * 18); + Main.tile[x, y - num2 + 1 + j].frameX = (short)num; + Main.tile[x, y - num2 + 1 + j].type = (byte)type; + Main.tile[x + 1, y - num2 + 1 + j].active(true); + Main.tile[x + 1, y - num2 + 1 + j].frameY = (short)(j * 18); + Main.tile[x + 1, y - num2 + 1 + j].frameX = (short)(num + 18); + Main.tile[x + 1, y - num2 + 1 + j].type = (byte)type; + } + } + } + public static void Check1x2(int x, int j, byte type) + { + if (WorldGen.destroyObject) + { + return; + } + int num = j; + bool flag = true; + if (Main.tile[x, num] == null) + { + Main.tile[x, num] = new Tile(); + } + if (Main.tile[x, num + 1] == null) + { + Main.tile[x, num + 1] = new Tile(); + } + int i = (int)Main.tile[x, num].frameY; + int num2 = 0; + while (i >= 40) + { + i -= 40; + num2++; + } + if (i == 18) + { + num--; + } + if (Main.tile[x, num] == null) + { + Main.tile[x, num] = new Tile(); + } + if ((int)Main.tile[x, num].frameY == 40 * num2 && (int)Main.tile[x, num + 1].frameY == 40 * num2 + 18 && Main.tile[x, num].type == type && Main.tile[x, num + 1].type == type) + { + flag = false; + } + if (Main.tile[x, num + 2] == null) + { + Main.tile[x, num + 2] = new Tile(); + } + if (!WorldGen.SolidTile2(x, num + 2)) + { + flag = true; + } + if (Main.tile[x, num + 2].type != 2 && Main.tile[x, num + 2].type != 109 && Main.tile[x, num + 2].type != 147 && Main.tile[x, num].type == 20) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + if (Main.tile[x, num].type == type) + { + WorldGen.KillTile(x, num, false, false, false); + } + if (Main.tile[x, num + 1].type == type) + { + WorldGen.KillTile(x, num + 1, false, false, false); + } + if (type == 216) + { + Item.NewItem(x * 16, num * 16, 32, 32, 970 + num2, 1, false, 0, false); + } + if (type == 15) + { + if (num2 >= 18 && num2 <= 23) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1703 + num2 - 18, 1, false, 0, false); + } + else + { + if (num2 == 5) + { + Item.NewItem(x * 16, num * 16, 32, 32, 806, 1, false, 0, false); + } + else + { + if (num2 == 6) + { + Item.NewItem(x * 16, num * 16, 32, 32, 807, 1, false, 0, false); + } + else + { + if (num2 == 7) + { + Item.NewItem(x * 16, num * 16, 32, 32, 808, 1, false, 0, false); + } + else + { + if (num2 == 8) + { + Item.NewItem(x * 16, num * 16, 32, 32, 809, 1, false, 0, false); + } + else + { + if (num2 == 9) + { + Item.NewItem(x * 16, num * 16, 32, 32, 810, 1, false, 0, false); + } + else + { + if (num2 == 10) + { + Item.NewItem(x * 16, num * 16, 32, 32, 826, 1, false, 0, false); + } + else + { + if (num2 == 11) + { + Item.NewItem(x * 16, num * 16, 32, 32, 915, 1, false, 0, false); + } + else + { + if (num2 == 13) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1396, 1, false, 0, false); + } + else + { + if (num2 == 14) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1399, 1, false, 0, false); + } + else + { + if (num2 == 15) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1402, 1, false, 0, false); + } + else + { + if (num2 == 12) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1143, 1, false, 0, false); + } + else + { + if (num2 == 4) + { + Item.NewItem(x * 16, num * 16, 32, 32, 630, 1, false, 0, false); + } + else + { + if (num2 == 3) + { + Item.NewItem(x * 16, num * 16, 32, 32, 629, 1, false, 0, false); + } + else + { + if (num2 == 2) + { + Item.NewItem(x * 16, num * 16, 32, 32, 628, 1, false, 0, false); + } + else + { + if (num2 == 17) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1509, 1, false, 0, false); + } + else + { + if (num2 == 1) + { + Item.NewItem(x * 16, num * 16, 32, 32, 358, 1, false, 0, false); + } + else + { + if (num2 == 16) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1459, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, num * 16, 32, 32, 34, 1, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (type == 134) + { + if (num2 == 1) + { + Item.NewItem(x * 16, num * 16, 32, 32, 1220, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, num * 16, 32, 32, 525, 1, false, 0, false); + } + } + } + WorldGen.destroyObject = false; + } + } + public static void CheckOnTable1x1(int x, int y, int type) + { + if (Main.tile[x, y + 1] != null && (!Main.tile[x, y + 1].active() || !Main.tileTable[(int)Main.tile[x, y + 1].type])) + { + if (type == 78) + { + if (!WorldGen.SolidTile2(x, y + 1)) + { + WorldGen.KillTile(x, y, false, false, false); + return; + } + } + else + { + WorldGen.KillTile(x, y, false, false, false); + } + } + } + public static void CheckSign(int x, int y, int type) + { + if (WorldGen.destroyObject) + { + return; + } + int num = x - 2; + int num2 = x + 3; + int num3 = y - 2; + int num4 = y + 3; + if (num < 0) + { + return; + } + if (num2 > Main.maxTilesX) + { + return; + } + if (num3 < 0) + { + return; + } + if (num4 > Main.maxTilesY) + { + return; + } + bool flag = false; + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + } + } + int k = (int)(Main.tile[x, y].frameX / 18); + int num5 = (int)(Main.tile[x, y].frameY / 18); + while (k > 1) + { + k -= 2; + } + int num6 = x - k; + int num7 = y - num5; + int num8 = (int)(Main.tile[num6, num7].frameX / 18 / 2); + int l = (int)(Main.tile[x, y].frameX / 18); + int num9 = 0; + while (l > 1) + { + l -= 2; + num9++; + } + num = num6; + num2 = num6 + 2; + num3 = num7; + num4 = num7 + 2; + k = 0; + for (int m = num; m < num2; m++) + { + num5 = 0; + for (int n = num3; n < num4; n++) + { + if (!Main.tile[m, n].active() || (int)Main.tile[m, n].type != type) + { + flag = true; + break; + } + if ((int)(Main.tile[m, n].frameX / 18) != k + num8 * 2 || (int)(Main.tile[m, n].frameY / 18) != num5) + { + flag = true; + break; + } + num5++; + } + k++; + } + if (!flag) + { + if (type == 85) + { + if (WorldGen.SolidTile2(num6, num7 + 2) && WorldGen.SolidTile2(num6 + 1, num7 + 2)) + { + num8 = num9; + } + else + { + flag = true; + } + } + else + { + if (WorldGen.SolidTile2(num6, num7 + 2) && WorldGen.SolidTile2(num6 + 1, num7 + 2)) + { + num8 = 0; + } + else + { + if (Main.tile[num6, num7 - 1].nactive() && Main.tileSolid[(int)Main.tile[num6, num7 - 1].type] && !Main.tileSolidTop[(int)Main.tile[num6, num7 - 1].type] && Main.tile[num6 + 1, num7 - 1].nactive() && Main.tileSolid[(int)Main.tile[num6 + 1, num7 - 1].type] && !Main.tileSolidTop[(int)Main.tile[num6 + 1, num7 - 1].type]) + { + num8 = 1; + } + else + { + if (Main.tile[num6 - 1, num7].nactive() && Main.tileSolid[(int)Main.tile[num6 - 1, num7].type] && !Main.tileSolidTop[(int)Main.tile[num6 - 1, num7].type] && Main.tile[num6 - 1, num7 + 1].nactive() && Main.tileSolid[(int)Main.tile[num6 - 1, num7 + 1].type] && !Main.tileSolidTop[(int)Main.tile[num6 - 1, num7 + 1].type]) + { + num8 = 2; + } + else + { + if (Main.tile[num6 + 2, num7].nactive() && Main.tileSolid[(int)Main.tile[num6 + 2, num7].type] && !Main.tileSolidTop[(int)Main.tile[num6 + 2, num7].type] && Main.tile[num6 + 2, num7 + 1].nactive() && Main.tileSolid[(int)Main.tile[num6 + 2, num7 + 1].type] && !Main.tileSolidTop[(int)Main.tile[num6 + 2, num7 + 1].type]) + { + num8 = 3; + } + else + { + flag = true; + } + } + } + } + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int num10 = num; num10 < num2; num10++) + { + for (int num11 = num3; num11 < num4; num11++) + { + if ((int)Main.tile[num10, num11].type == type) + { + WorldGen.KillTile(num10, num11, false, false, false); + } + } + } + Sign.KillSign(num6, num7); + if (type == 85) + { + if (num9 == 0) + { + Item.NewItem(x * 16, y * 16, 32, 32, 321, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, y * 16, 32, 32, 1172 + num9, 1, false, 0, false); + } + } + else + { + Item.NewItem(x * 16, y * 16, 32, 32, 171, 1, false, 0, false); + } + WorldGen.destroyObject = false; + return; + } + int num12 = 36 * num8; + for (int num13 = 0; num13 < 2; num13++) + { + for (int num14 = 0; num14 < 2; num14++) + { + Main.tile[num6 + num13, num7 + num14].active(true); + Main.tile[num6 + num13, num7 + num14].type = (byte)type; + Main.tile[num6 + num13, num7 + num14].frameX = (short)(num12 + 18 * num13); + Main.tile[num6 + num13, num7 + num14].frameY = (short)(18 * num14); + } + } + } + public static bool PlaceSign(int x, int y, int type, int Style = 0) + { + int num = x - 2; + int num2 = x + 3; + int num3 = y - 2; + int num4 = y + 3; + if (num < 0) + { + return false; + } + if (num2 > Main.maxTilesX) + { + return false; + } + if (num3 < 0) + { + return false; + } + if (num4 > Main.maxTilesY) + { + return false; + } + for (int i = num; i < num2; i++) + { + for (int j = num3; j < num4; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + } + } + int num5 = x; + int num6 = y; + int num7 = 0; + if (type == 55) + { + if (WorldGen.SolidTile2(x, y + 1) && WorldGen.SolidTile2(x + 1, y + 1)) + { + num6--; + num7 = 0; + } + else + { + if (Main.tile[x, y - 1].nactive() && Main.tileSolid[(int)Main.tile[x, y - 1].type] && !Main.tileSolidTop[(int)Main.tile[x, y - 1].type] && Main.tile[x + 1, y - 1].nactive() && Main.tileSolid[(int)Main.tile[x + 1, y - 1].type] && !Main.tileSolidTop[(int)Main.tile[x + 1, y - 1].type]) + { + num7 = 1; + } + else + { + if (Main.tile[x - 1, y].nactive() && Main.tileSolid[(int)Main.tile[x - 1, y].type] && !Main.tileSolidTop[(int)Main.tile[x - 1, y].type] && !Main.tileNoAttach[(int)Main.tile[x - 1, y].type] && Main.tile[x - 1, y + 1].nactive() && Main.tileSolid[(int)Main.tile[x - 1, y + 1].type] && !Main.tileSolidTop[(int)Main.tile[x - 1, y + 1].type] && !Main.tileNoAttach[(int)Main.tile[x - 1, y + 1].type]) + { + num7 = 2; + } + else + { + if (!Main.tile[x + 1, y].nactive() || !Main.tileSolid[(int)Main.tile[x + 1, y].type] || Main.tileSolidTop[(int)Main.tile[x + 1, y].type] || Main.tileNoAttach[(int)Main.tile[x + 1, y].type] || !Main.tile[x + 1, y + 1].nactive() || !Main.tileSolid[(int)Main.tile[x + 1, y + 1].type] || Main.tileSolidTop[(int)Main.tile[x + 1, y + 1].type] || Main.tileNoAttach[(int)Main.tile[x + 1, y + 1].type]) + { + return false; + } + num5--; + num7 = 3; + } + } + } + } + else + { + if (type == 85) + { + if (!WorldGen.SolidTile2(x, y + 1) || !WorldGen.SolidTile2(x + 1, y + 1)) + { + return false; + } + num6--; + num7 = Style; + } + } + if (Main.tile[num5, num6].active() || Main.tile[num5 + 1, num6].active() || Main.tile[num5, num6 + 1].active() || Main.tile[num5 + 1, num6 + 1].active()) + { + return false; + } + int num8 = 36 * num7; + for (int k = 0; k < 2; k++) + { + for (int l = 0; l < 2; l++) + { + Main.tile[num5 + k, num6 + l].active(true); + Main.tile[num5 + k, num6 + l].type = (byte)type; + Main.tile[num5 + k, num6 + l].frameX = (short)(num8 + 18 * k); + Main.tile[num5 + k, num6 + l].frameY = (short)(18 * l); + } + } + return true; + } + public static Color paintColor(int color) + { + Color white = Color.White; + if (color == 1 || color == 13) + { + white.R = 255; + white.G = 0; + white.B = 0; + } + if (color == 2 || color == 14) + { + white.R = 255; + white.G = 127; + white.B = 0; + } + if (color == 3 || color == 15) + { + white.R = 255; + white.G = 255; + white.B = 0; + } + if (color == 4 || color == 16) + { + white.R = 127; + white.G = 255; + white.B = 0; + } + if (color == 5 || color == 17) + { + white.R = 0; + white.G = 255; + white.B = 0; + } + if (color == 6 || color == 18) + { + white.R = 0; + white.G = 255; + white.B = 127; + } + if (color == 7 || color == 19) + { + white.R = 0; + white.G = 255; + white.B = 255; + } + if (color == 8 || color == 20) + { + white.R = 0; + white.G = 127; + white.B = 255; + } + if (color == 9 || color == 21) + { + white.R = 0; + white.G = 0; + white.B = 255; + } + if (color == 10 || color == 22) + { + white.R = 127; + white.G = 0; + white.B = 255; + } + if (color == 11 || color == 23) + { + white.R = 255; + white.G = 0; + white.B = 255; + } + if (color == 12 || color == 24) + { + white.R = 255; + white.G = 0; + white.B = 127; + } + if (color == 25) + { + white.R = 75; + white.G = 75; + white.B = 75; + } + if (color == 26) + { + white.R = 255; + white.G = 255; + white.B = 255; + } + if (color == 27) + { + white.R = 175; + white.G = 175; + white.B = 175; + } + return white; + } + public static void paintEffect(int x, int y, byte color, byte oldColor) + { + int color2 = (int)((color != null) ? color : oldColor); + Color newColor = WorldGen.paintColor(color2); + for (int i = 0; i < 10; i++) + { + int num = Dust.NewDust(new Vector2((float)(x * 16), (float)(y * 16)), 16, 16, 143, 0f, 0f, 50, newColor, 1f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num].noGravity = true; + Main.dust[num].scale *= 1.2f; + } + else + { + Main.dust[num].scale *= 0.5f; + } + } + } + public static bool paintTile(int x, int y, byte color, bool broadCast = false) + { + if (Main.tile[x, y] == null || !Main.tile[x, y].active()) + { + return false; + } + byte oldColor = Main.tile[x, y].color(); + Main.tile[x, y].color(color); + if (broadCast) + { + NetMessage.SendData(63, -1, -1, "", x, (float)y, (float)color, 0f, 0); + } + WorldGen.paintEffect(x, y, color, oldColor); + return true; + } + public static bool paintWall(int x, int y, byte color, bool broadCast = false) + { + if (Main.tile[x, y] == null || Main.tile[x, y].wall == 0) + { + return false; + } + byte oldColor = Main.tile[x, y].wallColor(); + Main.tile[x, y].wallColor(color); + if (broadCast) + { + NetMessage.SendData(64, -1, -1, "", x, (float)y, (float)color, 0f, 0); + } + WorldGen.paintEffect(x, y, color, oldColor); + return true; + } + public static void Place3x3Wall(int x, int y, int type, int style) + { + int num = x - 1; + int num2 = y - 1; + bool flag = true; + for (int i = num; i < num + 3; i++) + { + for (int j = num2; j < num2 + 3; j++) + { + if (Main.tile[i, j].active() || Main.tile[i, j].wall == 0) + { + flag = false; + break; + } + } + } + if (flag) + { + int num3 = style * 54; + int num4 = 0; + for (int k = num; k < num + 3; k++) + { + for (int l = num2; l < num2 + 3; l++) + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = (byte)type; + Main.tile[k, l].frameX = (short)(num3 + 18 * (k - num)); + Main.tile[k, l].frameY = (short)(num4 + 18 * (l - num2)); + } + } + } + } + public static void Check3x3Wall(int x, int y) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int type = (int)Main.tile[x, y].type; + int num = 0; + int i = (int)(Main.tile[x, y].frameX / 18); + while (i >= 3) + { + i -= 3; + num++; + } + int num2 = x - i; + int num3 = y - (int)(Main.tile[x, y].frameY / 18); + i = num * 54; + for (int j = num2; j < num2 + 3; j++) + { + for (int k = num3; k < num3 + 3; k++) + { + if ((int)Main.tile[j, k].type != type || !Main.tile[j, k].active() || Main.tile[j, k].wall <= 0 || (int)Main.tile[j, k].frameX != i + (j - num2) * 18 || (int)Main.tile[j, k].frameY != (k - num3) * 18) + { + flag = true; + break; + } + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int l = num2; l < num2 + 3; l++) + { + for (int m = num3; m < num3 + 3; m++) + { + if ((int)Main.tile[l, m].type == type && Main.tile[l, m].active()) + { + WorldGen.KillTile(l, m, false, false, false); + } + } + } + if (type == 240) + { + if (num == 33) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1574, 1, false, 0, false); + } + else + { + if (num == 34) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1575, 1, false, 0, false); + } + else + { + if (num == 35) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1576, 1, false, 0, false); + } + else + { + if (num == 18) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1419, 1, false, 0, false); + } + else + { + if (num == 19) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1420, 1, false, 0, false); + } + else + { + if (num == 20) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1427, 1, false, 0, false); + } + else + { + if (num == 21) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1428, 1, false, 0, false); + } + else + { + if (num >= 22 && num <= 25) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1440 + num - 22, 1, false, 0, false); + } + else + { + if (num >= 26 && num <= 29) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1496 + num - 26, 1, false, 0, false); + } + else + { + if (num >= 30 && num <= 32) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1538 + num - 30, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, y * 16, 32, 32, 1360 + num, 1, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + WorldGen.destroyObject = false; + } + } + public static void Place2x3Wall(int x, int y, int type, int style) + { + int num = y - 1; + bool flag = true; + for (int i = x; i < x + 2; i++) + { + for (int j = num; j < num + 3; j++) + { + if (Main.tile[i, j].active() || Main.tile[i, j].wall == 0) + { + flag = false; + break; + } + } + } + if (flag) + { + int num2 = style * 36; + int num3 = 0; + for (int k = x; k < x + 2; k++) + { + for (int l = num; l < num + 3; l++) + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = (byte)type; + Main.tile[k, l].frameX = (short)(num2 + 18 * (k - x)); + Main.tile[k, l].frameY = (short)(num3 + 18 * (l - num)); + } + } + } + } + public static void Check2x3Wall(int x, int y) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int type = (int)Main.tile[x, y].type; + int num = 0; + int i = (int)(Main.tile[x, y].frameX / 18); + while (i >= 2) + { + i -= 2; + num++; + } + int num2 = x - i; + int num3 = y - (int)(Main.tile[x, y].frameY / 18); + i = num * 36; + for (int j = num2; j < num2 + 2; j++) + { + for (int k = num3; k < num3 + 3; k++) + { + if ((int)Main.tile[j, k].type != type || !Main.tile[j, k].active() || Main.tile[j, k].wall <= 0 || (int)Main.tile[j, k].frameX != i + (j - num2) * 18 || (int)Main.tile[j, k].frameY != (k - num3) * 18) + { + flag = true; + break; + } + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int l = num2; l < num2 + 2; l++) + { + for (int m = num3; m < num3 + 3; m++) + { + if ((int)Main.tile[l, m].type == type && Main.tile[l, m].active()) + { + WorldGen.KillTile(l, m, false, false, false); + } + } + } + if (type == 245) + { + if (num == 6) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1577, 1, false, 0, false); + } + else + { + if (num == 5) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1495, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, y * 16, 32, 32, 1474 + num, 1, false, 0, false); + } + } + } + WorldGen.destroyObject = false; + } + } + public static void Place3x2Wall(int x, int y, int type, int style) + { + int num = x - 1; + bool flag = true; + for (int i = num; i < num + 3; i++) + { + for (int j = y; j < y + 2; j++) + { + if (Main.tile[i, j].active() || Main.tile[i, j].wall == 0) + { + flag = false; + break; + } + } + } + if (flag) + { + int num2 = 0; + int num3 = style * 36; + for (int k = num; k < num + 3; k++) + { + for (int l = y; l < y + 2; l++) + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = (byte)type; + Main.tile[k, l].frameX = (short)(num2 + 18 * (k - num)); + Main.tile[k, l].frameY = (short)(num3 + 18 * (l - y)); + } + } + } + } + public static void Check3x2Wall(int x, int y) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int type = (int)Main.tile[x, y].type; + int num = 0; + int i = (int)(Main.tile[x, y].frameY / 18); + while (i >= 2) + { + i -= 2; + num++; + } + int num2 = y - i; + int num3 = x - (int)(Main.tile[x, y].frameX / 18); + i = num * 36; + for (int j = num3; j < num3 + 3; j++) + { + for (int k = num2; k < num2 + 2; k++) + { + if ((int)Main.tile[j, k].type != type || !Main.tile[j, k].active() || Main.tile[j, k].wall <= 0 || (int)Main.tile[j, k].frameY != i + (k - num2) * 18 || (int)Main.tile[j, k].frameX != (j - num3) * 18) + { + flag = true; + break; + } + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int l = num3; l < num3 + 3; l++) + { + for (int m = num2; m < num2 + 2; m++) + { + if ((int)Main.tile[l, m].type == type && Main.tile[l, m].active()) + { + WorldGen.KillTile(l, m, false, false, false); + } + } + } + if (type == 246) + { + if (num == 16) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1541, 1, false, 0, false); + } + else + { + if (num == 17) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1542, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, y * 16, 32, 32, 1479 + num, 1, false, 0, false); + } + } + } + WorldGen.destroyObject = false; + } + } + public static void Place4x3Wall(int x, int y, int type, int style) + { + int num = x - 1; + int num2 = y - 1; + bool flag = true; + for (int i = num; i < num + 4; i++) + { + for (int j = num2; j < num2 + 3; j++) + { + if (Main.tile[i, j].active() || Main.tile[i, j].wall == 0) + { + flag = false; + break; + } + } + } + if (flag) + { + int num3 = 0; + int num4 = style * 54; + for (int k = num; k < num + 4; k++) + { + for (int l = num2; l < num2 + 3; l++) + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = (byte)type; + Main.tile[k, l].frameX = (short)(num3 + 18 * (k - num)); + Main.tile[k, l].frameY = (short)(num4 + 18 * (l - num2)); + } + } + } + } + public static void Check4x3Wall(int x, int y) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int type = (int)Main.tile[x, y].type; + int num = 0; + int i = (int)(Main.tile[x, y].frameY / 18); + while (i >= 3) + { + i -= 3; + num++; + } + int num2 = y - i; + int num3 = x - (int)(Main.tile[x, y].frameX / 18); + i = num * 54; + for (int j = num3; j < num3 + 4; j++) + { + for (int k = num2; k < num2 + 3; k++) + { + if ((int)Main.tile[j, k].type != type || !Main.tile[j, k].active() || Main.tile[j, k].wall <= 0 || (int)Main.tile[j, k].frameY != i + (k - num2) * 18 || (int)Main.tile[j, k].frameX != (j - num3) * 18) + { + flag = true; + break; + } + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int l = num3; l < num3 + 4; l++) + { + for (int m = num2; m < num2 + 3; m++) + { + if ((int)Main.tile[l, m].type == type && Main.tile[l, m].active()) + { + WorldGen.KillTile(l, m, false, false, false); + } + } + } + if (type == 241) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1417, 1, false, 0, false); + } + WorldGen.destroyObject = false; + } + } + public static void Place6x4Wall(int x, int y, int type, int style) + { + int num = x - 2; + int num2 = y - 2; + bool flag = true; + for (int i = num; i < num + 6; i++) + { + for (int j = num2; j < num2 + 4; j++) + { + if (Main.tile[i, j].active() || Main.tile[i, j].wall == 0) + { + flag = false; + break; + } + } + } + if (flag) + { + int num3 = 0; + int num4 = style * 72; + for (int k = num; k < num + 6; k++) + { + for (int l = num2; l < num2 + 4; l++) + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = (byte)type; + Main.tile[k, l].frameX = (short)(num3 + 18 * (k - num)); + Main.tile[k, l].frameY = (short)(num4 + 18 * (l - num2)); + } + } + } + } + public static void Check6x4Wall(int x, int y) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int type = (int)Main.tile[x, y].type; + int num = 0; + int i = (int)(Main.tile[x, y].frameY / 18); + while (i >= 4) + { + i -= 4; + num++; + } + int num2 = y - i; + int num3 = x - (int)(Main.tile[x, y].frameX / 18); + i = num * 72; + for (int j = num3; j < num3 + 6; j++) + { + for (int k = num2; k < num2 + 4; k++) + { + if ((int)Main.tile[j, k].type != type || !Main.tile[j, k].active() || Main.tile[j, k].wall <= 0 || (int)Main.tile[j, k].frameY != i + (k - num2) * 18 || (int)Main.tile[j, k].frameX != (j - num3) * 18) + { + flag = true; + break; + } + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int l = num3; l < num3 + 6; l++) + { + for (int m = num2; m < num2 + 4; m++) + { + if ((int)Main.tile[l, m].type == type && Main.tile[l, m].active()) + { + WorldGen.KillTile(l, m, false, false, false); + } + } + } + if (type == 242) + { + if (num == 16) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1573, 1, false, 0, false); + } + else + { + if (num >= 13) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1500 + num - 13, 1, false, 0, false); + } + else + { + if (num >= 6) + { + Item.NewItem(x * 16, y * 16, 32, 32, 1433 + num - 6, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, y * 16, 32, 32, 1421 + num, 1, false, 0, false); + } + } + } + } + WorldGen.destroyObject = false; + } + } + public static void Place1x1(int x, int y, int type, int style = 0) + { + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (WorldGen.SolidTile2(x, y + 1) && !Main.tile[x, y].active()) + { + Main.tile[x, y].active(true); + Main.tile[x, y].type = (byte)type; + if (type == 144 || type == 239) + { + Main.tile[x, y].frameX = (short)(style * 18); + Main.tile[x, y].frameY = 0; + return; + } + Main.tile[x, y].frameY = (short)(style * 18); + } + } + public static void Check1x1(int x, int y, int type) + { + if (Main.tile[x, y + 1] != null && !WorldGen.SolidTile2(x, y + 1)) + { + WorldGen.KillTile(x, y, false, false, false); + } + } + public static void PlaceOnTable1x1(int x, int y, int type, int style = 0) + { + bool flag = false; + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (!Main.tile[x, y].active() && Main.tile[x, y + 1].nactive() && Main.tileTable[(int)Main.tile[x, y + 1].type]) + { + flag = true; + } + if (type == 78 && !Main.tile[x, y].active() && Main.tile[x, y + 1].nactive() && Main.tileSolid[(int)Main.tile[x, y + 1].type] && !Main.tile[x, y + 1].halfBrick() && Main.tile[x, y + 1].slope() == 0) + { + flag = true; + } + if (flag) + { + Main.tile[x, y].active(true); + Main.tile[x, y].type = (byte)type; + if (type == 33) + { + Main.tile[x, y].frameX = 0; + Main.tile[x, y].frameY = (short)(style * 22); + } + else + { + Main.tile[x, y].frameX = (short)(style * 18); + Main.tile[x, y].frameY = 0; + } + if (type == 50) + { + Main.tile[x, y].frameX = (short)(18 * WorldGen.genRand.Next(5)); + } + } + } + public static bool PlaceAlch(int x, int y, int style) + { + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (!Main.tile[x, y].active() && Main.tile[x, y + 1].nactive() && !Main.tile[x, y + 1].halfBrick() && Main.tile[x, y + 1].slope() == 0) + { + bool flag = false; + if (style == 0) + { + if (Main.tile[x, y + 1].type != 2 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 109) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0) + { + flag = true; + } + } + else + { + if (style == 1) + { + if (Main.tile[x, y + 1].type != 60 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0) + { + flag = true; + } + } + else + { + if (style == 2) + { + if (Main.tile[x, y + 1].type != 0 && Main.tile[x, y + 1].type != 59 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0) + { + flag = true; + } + } + else + { + if (style == 3) + { + if (Main.tile[x, y + 1].type != 203 && Main.tile[x, y + 1].type != 199 && Main.tile[x, y + 1].type != 23 && Main.tile[x, y + 1].type != 25 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0) + { + flag = true; + } + } + else + { + if (style == 4) + { + if (Main.tile[x, y + 1].type != 53 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 116) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava()) + { + flag = true; + } + } + else + { + if (style == 5) + { + if (Main.tile[x, y + 1].type != 57 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && !Main.tile[x, y].lava()) + { + flag = true; + } + } + } + } + } + } + } + if (!flag) + { + Main.tile[x, y].active(true); + Main.tile[x, y].type = 82; + Main.tile[x, y].frameX = (short)(18 * style); + Main.tile[x, y].frameY = 0; + return true; + } + } + return false; + } + public static void GrowAlch(int x, int y) + { + if (Main.tile[x, y].active()) + { + if (Main.tile[x, y].type == 82 && WorldGen.genRand.Next(50) == 0) + { + Main.tile[x, y].type = 83; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + WorldGen.SquareTileFrame(x, y, true); + return; + } + if (Main.tile[x, y].frameX == 36) + { + if (Main.tile[x, y].type == 83) + { + Main.tile[x, y].type = 84; + } + else + { + Main.tile[x, y].type = 83; + } + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + } + } + } + public static void PlantAlch() + { + int num = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num2; + if (WorldGen.genRand.Next(40) == 0) + { + num2 = WorldGen.genRand.Next((int)(Main.rockLayer + (double)Main.maxTilesY) / 2, Main.maxTilesY - 20); + } + else + { + if (WorldGen.genRand.Next(10) == 0) + { + num2 = WorldGen.genRand.Next(0, Main.maxTilesY - 20); + } + else + { + num2 = WorldGen.genRand.Next((int)Main.worldSurface, Main.maxTilesY - 20); + } + } + while (num2 < Main.maxTilesY - 20 && !Main.tile[num, num2].active()) + { + num2++; + } + if (Main.tile[num, num2].nactive() && !Main.tile[num, num2 - 1].active() && Main.tile[num, num2 - 1].liquid == 0) + { + if (Main.tile[num, num2].type == 2 || Main.tile[num, num2].type == 109) + { + WorldGen.PlaceAlch(num, num2 - 1, 0); + } + if (Main.tile[num, num2].type == 60) + { + WorldGen.PlaceAlch(num, num2 - 1, 1); + } + if (Main.tile[num, num2].type == 0 || Main.tile[num, num2].type == 59) + { + WorldGen.PlaceAlch(num, num2 - 1, 2); + } + if (Main.tile[num, num2].type == 23 || Main.tile[num, num2].type == 25 || Main.tile[num, num2].type == 203 || Main.tile[num, num2].type == 199) + { + WorldGen.PlaceAlch(num, num2 - 1, 3); + } + if (Main.tile[num, num2].type == 53 || Main.tile[num, num2].type == 116) + { + WorldGen.PlaceAlch(num, num2 - 1, 4); + } + if (Main.tile[num, num2].type == 57) + { + WorldGen.PlaceAlch(num, num2 - 1, 5); + } + if (Main.tile[num, num2 - 1].active() && Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num, num2 - 1, 1); + } + } + } + public static void CheckAlch(int x, int y) + { + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + bool flag = false; + if (!Main.tile[x, y + 1].active()) + { + flag = true; + } + if (Main.tile[x, y + 1].halfBrick()) + { + flag = true; + } + int num = (int)(Main.tile[x, y].frameX / 18); + Main.tile[x, y].frameY = 0; + if (!flag) + { + if (num == 0) + { + if (Main.tile[x, y + 1].type != 109 && Main.tile[x, y + 1].type != 2 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava()) + { + flag = true; + } + } + else + { + if (num == 1) + { + if (Main.tile[x, y + 1].type != 60 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava()) + { + flag = true; + } + } + else + { + if (num == 2) + { + if (Main.tile[x, y + 1].type != 0 && Main.tile[x, y + 1].type != 59 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava()) + { + flag = true; + } + } + else + { + if (num == 3) + { + if (Main.tile[x, y + 1].type != 199 && Main.tile[x, y + 1].type != 203 && Main.tile[x, y + 1].type != 23 && Main.tile[x, y + 1].type != 25 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava()) + { + flag = true; + } + } + else + { + if (num == 4) + { + if (Main.tile[x, y + 1].type != 53 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 116) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava()) + { + flag = true; + } + if (Main.tile[x, y].type != 82 && !Main.tile[x, y].lava() && Main.netMode != 1) + { + if (Main.tile[x, y].liquid > 16) + { + if (Main.tile[x, y].type == 83) + { + Main.tile[x, y].type = 84; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + } + } + else + { + if (Main.tile[x, y].type == 84) + { + Main.tile[x, y].type = 83; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + } + } + } + } + else + { + if (num == 5) + { + if (Main.tile[x, y + 1].type != 57 && Main.tile[x, y + 1].type != 78) + { + flag = true; + } + if (Main.tile[x, y].liquid > 0 && !Main.tile[x, y].lava()) + { + flag = true; + } + if (Main.tile[x, y].type != 82 && Main.tile[x, y].lava() && Main.tile[x, y].type != 82 && Main.tile[x, y].lava() && Main.netMode != 1) + { + if (Main.tile[x, y].liquid > 16) + { + if (Main.tile[x, y].type == 83) + { + Main.tile[x, y].type = 84; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + } + } + else + { + if (Main.tile[x, y].type == 84) + { + Main.tile[x, y].type = 83; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + } + } + } + } + } + } + } + } + } + } + if (flag) + { + WorldGen.KillTile(x, y, false, false, false); + } + } + public static void CheckBanner(int x, int j, byte type) + { + if (WorldGen.destroyObject) + { + return; + } + int num = j - (int)(Main.tile[x, j].frameY / 18); + int frameX = (int)Main.tile[x, j].frameX; + bool flag = false; + for (int i = 0; i < 3; i++) + { + if (Main.tile[x, num + i] == null) + { + Main.tile[x, num + i] = new Tile(); + } + if (!Main.tile[x, num + i].active()) + { + flag = true; + } + else + { + if (Main.tile[x, num + i].type != type) + { + flag = true; + } + else + { + if ((int)Main.tile[x, num + i].frameY != i * 18) + { + flag = true; + } + else + { + if ((int)Main.tile[x, num + i].frameX != frameX) + { + flag = true; + } + } + } + } + } + if (Main.tile[x, num - 1] == null) + { + Main.tile[x, num - 1] = new Tile(); + } + if (!Main.tile[x, num - 1].nactive()) + { + flag = true; + } + if (!Main.tileSolid[(int)Main.tile[x, num - 1].type]) + { + flag = true; + } + if (Main.tileSolidTop[(int)Main.tile[x, num - 1].type]) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + for (int k = 0; k < 3; k++) + { + if (Main.tile[x, num + k].type == type) + { + WorldGen.KillTile(x, num + k, false, false, false); + } + } + if (type == 91) + { + int num2 = frameX / 18; + if (num2 >= 22) + { + Item.NewItem(x * 16, (num + 1) * 16, 32, 32, 1593 + num2, 1, false, 0, false); + } + else + { + if (num2 >= 10 && num2 <= 15) + { + Item.NewItem(x * 16, (num + 1) * 16, 32, 32, 1441 + num2, 1, false, 0, false); + } + else + { + if (num2 >= 16 && num2 <= 21) + { + Item.NewItem(x * 16, (num + 1) * 16, 32, 32, 1448 + num2, 1, false, 0, false); + } + else + { + if (num2 >= 7 && num2 <= 9) + { + Item.NewItem(x * 16, (num + 1) * 16, 32, 32, 838 + num2, 1, false, 0, false); + } + else + { + if (num2 >= 4 && num2 <= 6) + { + Item.NewItem(x * 16, (num + 1) * 16, 32, 32, 785 + num2, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, (num + 1) * 16, 32, 32, 337 + num2, 1, false, 0, false); + } + } + } + } + } + } + WorldGen.destroyObject = false; + } + } + public static void PlaceBanner(int x, int y, int type, int style = 0) + { + int num = style * 18; + if (Main.tile[x, y - 1] == null) + { + Main.tile[x, y - 1] = new Tile(); + } + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (Main.tile[x, y + 2] == null) + { + Main.tile[x, y + 2] = new Tile(); + } + if (Main.tile[x, y - 1].nactive() && Main.tileSolid[(int)Main.tile[x, y - 1].type] && !Main.tileSolidTop[(int)Main.tile[x, y - 1].type] && !Main.tile[x, y].active() && !Main.tile[x, y + 1].active() && !Main.tile[x, y + 2].active()) + { + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = 0; + Main.tile[x, y].frameX = (short)num; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameY = 18; + Main.tile[x, y + 1].frameX = (short)num; + Main.tile[x, y + 1].type = (byte)type; + Main.tile[x, y + 2].active(true); + Main.tile[x, y + 2].frameY = 36; + Main.tile[x, y + 2].frameX = (short)num; + Main.tile[x, y + 2].type = (byte)type; + } + } + public static void PlaceMan(int i, int j, int dir) + { + for (int k = i; k <= i + 1; k++) + { + for (int l = j - 2; l <= j; l++) + { + if (Main.tile[k, l].active()) + { + return; + } + } + } + if (!WorldGen.SolidTile2(i, j + 1) || !WorldGen.SolidTile2(i + 1, j + 1)) + { + return; + } + byte b = 0; + if (dir == 1) + { + b = 36; + } + Main.tile[i, j - 2].active(true); + Main.tile[i, j - 2].frameY = 0; + Main.tile[i, j - 2].frameX = (short)b; + Main.tile[i, j - 2].type = 128; + Main.tile[i, j - 1].active(true); + Main.tile[i, j - 1].frameY = 18; + Main.tile[i, j - 1].frameX = (short)b; + Main.tile[i, j - 1].type = 128; + Main.tile[i, j].active(true); + Main.tile[i, j].frameY = 36; + Main.tile[i, j].frameX = (short)b; + Main.tile[i, j].type = 128; + Main.tile[i + 1, j - 2].active(true); + Main.tile[i + 1, j - 2].frameY = 0; + Main.tile[i + 1, j - 2].frameX = (short)(18 + b); + Main.tile[i + 1, j - 2].type = 128; + Main.tile[i + 1, j - 1].active(true); + Main.tile[i + 1, j - 1].frameY = 18; + Main.tile[i + 1, j - 1].frameX = (short)(18 + b); + Main.tile[i + 1, j - 1].type = 128; + Main.tile[i + 1, j].active(true); + Main.tile[i + 1, j].frameY = 36; + Main.tile[i + 1, j].frameX = (short)(18 + b); + Main.tile[i + 1, j].type = 128; + } + public static void CheckMan(int i, int j) + { + if (WorldGen.destroyObject) + { + return; + } + int num = j - (int)(Main.tile[i, j].frameY / 18); + int k; + for (k = (int)Main.tile[i, j].frameX; k >= 100; k -= 100) + { + } + while (k >= 36) + { + k -= 36; + } + int num2 = i - k / 18; + bool flag = false; + for (int l = 0; l <= 1; l++) + { + for (int m = 0; m <= 2; m++) + { + int num3 = num2 + l; + int num4 = num + m; + int n; + for (n = (int)Main.tile[num3, num4].frameX; n >= 100; n -= 100) + { + } + if (n >= 36) + { + n -= 36; + } + if (!Main.tile[num3, num4].active() || Main.tile[num3, num4].type != 128 || (int)Main.tile[num3, num4].frameY != m * 18 || n != l * 18) + { + flag = true; + } + } + } + if (!WorldGen.SolidTile2(num2, num + 3) || !WorldGen.SolidTile2(num2 + 1, num + 3)) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + Item.NewItem(i * 16, j * 16, 32, 32, 498, 1, false, 0, false); + for (int num5 = 0; num5 <= 1; num5++) + { + for (int num6 = 0; num6 <= 2; num6++) + { + int num7 = num2 + num5; + int num8 = num + num6; + if (Main.tile[num7, num8].active() && Main.tile[num7, num8].type == 128) + { + WorldGen.KillTile(num7, num8, false, false, false); + } + } + } + WorldGen.destroyObject = false; + } + } + public static void Place1x2(int x, int y, int type, int style) + { + short frameX = 0; + if (type == 20) + { + frameX = (short)(WorldGen.genRand.Next(3) * 18); + } + if (Main.tile[x, y - 1] == null) + { + Main.tile[x, y - 1] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (WorldGen.SolidTile2(x, y + 1) & !Main.tile[x, y - 1].active()) + { + short num = (short)(style * 40); + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameY = num; + Main.tile[x, y - 1].frameX = frameX; + Main.tile[x, y - 1].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = (short)(num + 18); + Main.tile[x, y].frameX = frameX; + Main.tile[x, y].type = (byte)type; + } + } + public static void Place1x2Top(int x, int y, int type, int style) + { + short frameX = 0; + if (Main.tile[x, y - 1] == null) + { + Main.tile[x, y - 1] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (Main.tile[x, y - 1].nactive() && Main.tileSolid[(int)Main.tile[x, y - 1].type] && !Main.tileSolidTop[(int)Main.tile[x, y - 1].type] && !Main.tile[x, y + 1].active()) + { + short num = (short)(style * 36); + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = num; + Main.tile[x, y].frameX = frameX; + Main.tile[x, y].type = (byte)type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameY = (short)(num + 18); + Main.tile[x, y + 1].frameX = frameX; + Main.tile[x, y + 1].type = (byte)type; + } + } + public static void Check1x2Top(int x, int j, byte type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = true; + int i = (int)(Main.tile[x, j].frameY / 18); + int num = 0; + while (i >= 2) + { + i -= 2; + num++; + } + int num2 = j - i; + i = num * 36; + if (Main.tile[x, num2] == null) + { + Main.tile[x, num2] = new Tile(); + } + if (Main.tile[x, num2 + 1] == null) + { + Main.tile[x, num2 + 1] = new Tile(); + } + if (Main.tile[x, num2] == null) + { + Main.tile[x, num2] = new Tile(); + } + if ((int)Main.tile[x, num2].frameY == i && (int)Main.tile[x, num2 + 1].frameY == i + 18 && Main.tile[x, num2].type == type && Main.tile[x, num2 + 1].type == type) + { + flag = false; + } + if (Main.tile[x, num2 - 1] == null) + { + Main.tile[x, num2 - 1] = new Tile(); + } + if (!Main.tile[x, num2 - 1].nactive() || !Main.tileSolid[(int)Main.tile[x, num2 - 1].type] || Main.tileSolidTop[(int)Main.tile[x, num2 - 1].type]) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + if (Main.tile[x, num2].type == type) + { + WorldGen.KillTile(x, num2, false, false, false); + } + if (Main.tile[x, num2 + 1].type == type) + { + WorldGen.KillTile(x, num2 + 1, false, false, false); + } + if (type == 42) + { + if (num == 0) + { + Item.NewItem(x * 16, num2 * 16, 32, 32, 136, 1, false, 0, false); + } + else + { + if (num == 7) + { + Item.NewItem(x * 16, num2 * 16, 32, 32, 1431, 1, false, 0, false); + } + else + { + Item.NewItem(x * 16, num2 * 16, 32, 32, 1389 + num, 1, false, 0, false); + } + } + } + WorldGen.destroyObject = false; + } + } + public static bool PlaceSmallPile(int i, int j, int X, int Y, int type = 185) + { + short frameY = (short)(Y * 18); + short num = (short)(X * 18); + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i + 1, j] == null) + { + Main.tile[i + 1, j] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i + 1, j + 1] == null) + { + Main.tile[i + 1, j + 1] = new Tile(); + } + if (Main.tile[i, j].lava()) + { + return false; + } + if (Y == 1) + { + num = (short)(X * 36); + bool flag = false; + if (WorldGen.SolidTile2(i, j + 1) && WorldGen.SolidTile2(i + 1, j + 1) && !Main.tile[i, j].active() && !Main.tile[i + 1, j].active()) + { + flag = true; + } + if (flag) + { + Main.tile[i, j].active(true); + Main.tile[i, j].frameY = frameY; + Main.tile[i, j].frameX = num; + Main.tile[i, j].type = (byte)type; + Main.tile[i + 1, j].active(true); + Main.tile[i + 1, j].frameY = frameY; + Main.tile[i + 1, j].frameX = (short)(num + 18); + Main.tile[i + 1, j].type = (byte)type; + return true; + } + } + else + { + if (WorldGen.SolidTile2(i, j + 1) && !Main.tile[i, j].active()) + { + Main.tile[i, j].active(true); + Main.tile[i, j].frameY = frameY; + Main.tile[i, j].frameX = num; + Main.tile[i, j].type = (byte)type; + return true; + } + } + return false; + } + public static void CheckPile(int i, int y) + { + if (Main.tile[i, y] == null) + { + Main.tile[i, y] = new Tile(); + } + if (Main.tile[i + 1, y] == null) + { + Main.tile[i + 1, y] = new Tile(); + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (Main.tile[i + 1, y + 1] == null) + { + Main.tile[i + 1, y + 1] = new Tile(); + } + if (Main.tile[i, y].frameY == 18) + { + WorldGen.Check2x1(i, y, Main.tile[i, y].type); + return; + } + if (!WorldGen.SolidTile(i, y + 1)) + { + WorldGen.KillTile(i, y, false, false, false); + } + } + public static void Check2x1(int i, int y, byte type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = true; + if (Main.tile[i, y] == null) + { + Main.tile[i, y] = new Tile(); + } + if (Main.tile[i + 1, y] == null) + { + Main.tile[i + 1, y] = new Tile(); + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (Main.tile[i + 1, y + 1] == null) + { + Main.tile[i + 1, y + 1] = new Tile(); + } + int j = (int)(Main.tile[i, y].frameX / 18); + int num = 0; + while (j > 1) + { + j -= 2; + num++; + } + int num2 = i - j; + if (Main.tile[num2 + 1, y].frameX == Main.tile[num2, y].frameX + 18 && Main.tile[num2, y].type == type && Main.tile[num2 + 1, y].type == type) + { + flag = false; + } + if (type == 29 || type == 103) + { + if (!Main.tile[num2, y + 1].active() || !Main.tileTable[(int)Main.tile[num2, y + 1].type]) + { + flag = true; + } + if (!Main.tile[num2 + 1, y + 1].active() || !Main.tileTable[(int)Main.tile[num2 + 1, y + 1].type]) + { + flag = true; + } + } + else + { + if (!WorldGen.SolidTile2(num2, y + 1)) + { + flag = true; + } + if (!WorldGen.SolidTile2(num2 + 1, y + 1)) + { + flag = true; + } + } + if (type == 185 && Main.tile[num2, y].frameX >= 1368 && Main.tile[num2, y].frameX <= 1458 && Main.tile[num2, y + 1].type != 2 && Main.tile[num2 + 1, y + 1].type != 2) + { + Tile expr_21E = Main.tile[num2, y]; + expr_21E.frameX -= 1368; + Tile expr_23E = Main.tile[num2 + 1, y]; + expr_23E.frameX -= 1368; + } + if (flag) + { + int frameX = (int)Main.tile[num2, y].frameX; + if (!Main.tile[num2, y].active()) + { + frameX = (int)Main.tile[num2 + 1, y].frameX; + } + WorldGen.destroyObject = true; + if (Main.tile[num2, y].type == type) + { + WorldGen.KillTile(num2, y, false, false, false); + } + if (Main.tile[num2 + 1, y].type == type) + { + WorldGen.KillTile(num2 + 1, y, false, false, false); + } + if (type == 16) + { + if (num == 1) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 716, 1, false, 0, false); + } + else + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 35, 1, false, 0, false); + } + } + if (type == 18) + { + int type2 = 36; + if (num >= 1 && num <= 3) + { + type2 = 634 + num; + } + if (num >= 4 && num <= 8) + { + type2 = 807 + num; + } + if (num == 9) + { + type2 = 916; + } + if (num == 10) + { + type2 = 1145; + } + if (num == 11) + { + type2 = 1398; + } + if (num == 12) + { + type2 = 1401; + } + if (num == 13) + { + type2 = 1404; + } + if (num == 14) + { + type2 = 1461; + } + if (num == 15) + { + type2 = 1511; + } + Item.NewItem(num2 * 16, y * 16, 32, 32, type2, 1, false, 0, false); + } + if (type == 185) + { + if (frameX >= 576 && frameX <= 610) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(10, 100), false, 0, false); + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + if (WorldGen.genRand.Next(3) != 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(10, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) != 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(10, 100), false, 0, false); + } + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(10, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(4) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(10, 100), false, 0, false); + } + if (WorldGen.genRand.Next(4) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(5) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(10, 100), false, 0, false); + } + if (WorldGen.genRand.Next(5) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + } + if (frameX >= 612 && frameX <= 646) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 72, WorldGen.genRand.Next(10, 100), false, 0, false); + if (Main.rand.Next(2) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 72, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 72, WorldGen.genRand.Next(30, 100), false, 0, false); + } + } + if (frameX >= 648 && frameX <= 682) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 73, WorldGen.genRand.Next(1, 6), false, 0, false); + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 73, WorldGen.genRand.Next(2, 6), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 73, WorldGen.genRand.Next(3, 6), false, 0, false); + } + } + if (frameX >= 684 && frameX <= 718) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 181, WorldGen.genRand.Next(1, 4), false, 0, false); + } + if (frameX >= 720 && frameX <= 754) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 180, WorldGen.genRand.Next(1, 4), false, 0, false); + } + if (frameX >= 756 && frameX <= 790) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 177, WorldGen.genRand.Next(1, 4), false, 0, false); + } + if (frameX >= 792 && frameX <= 826) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 179, WorldGen.genRand.Next(1, 4), false, 0, false); + } + if (frameX >= 828 && frameX <= 862) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 178, WorldGen.genRand.Next(1, 4), false, 0, false); + } + if (frameX >= 864 && frameX <= 898) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 182, WorldGen.genRand.Next(1, 4), false, 0, false); + } + } + if (type == 29) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 87, 1, false, 0, false); + Main.PlaySound(13, i * 16, y * 16, 1); + } + if (type == 103) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 356, 1, false, 0, false); + Main.PlaySound(13, i * 16, y * 16, 1); + } + else + { + if (type == 134) + { + if (num == 1) + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 1220, 1, false, 0, false); + } + else + { + Item.NewItem(num2 * 16, y * 16, 32, 32, 525, 1, false, 0, false); + } + } + } + WorldGen.destroyObject = false; + WorldGen.SquareTileFrame(num2, y, true); + WorldGen.SquareTileFrame(num2 + 1, y, true); + } + } + public static void Place2x1(int x, int y, int type, int style = 0) + { + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x + 1, y] == null) + { + Main.tile[x + 1, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (Main.tile[x + 1, y + 1] == null) + { + Main.tile[x + 1, y + 1] = new Tile(); + } + bool flag = false; + if (type != 29 && type != 103 && WorldGen.SolidTile2(x, y + 1) && WorldGen.SolidTile2(x + 1, y + 1) && !Main.tile[x, y].active() && !Main.tile[x + 1, y].active()) + { + flag = true; + } + else + { + if ((type == 29 || type == 103) && Main.tile[x, y + 1].active() && Main.tile[x + 1, y + 1].active() && Main.tileTable[(int)Main.tile[x, y + 1].type] && Main.tileTable[(int)Main.tile[x + 1, y + 1].type] && !Main.tile[x, y].active() && !Main.tile[x + 1, y].active()) + { + flag = true; + } + } + if (flag) + { + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = 0; + Main.tile[x, y].frameX = (short)(36 * style); + Main.tile[x, y].type = (byte)type; + Main.tile[x + 1, y].active(true); + Main.tile[x + 1, y].frameY = 0; + Main.tile[x + 1, y].frameX = (short)(36 * style + 18); + Main.tile[x + 1, y].type = (byte)type; + } + } + public static void Check4x2(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int num = i + (int)(Main.tile[i, j].frameX / 18 * -1); + if ((type == 79 || type == 90) && Main.tile[i, j].frameX >= 72) + { + num += 4; + } + int k = (int)(Main.tile[i, j].frameY / 18); + int num2 = 0; + while (k > 1) + { + k -= 2; + num2++; + } + k = j - k; + for (int l = num; l < num + 4; l++) + { + for (int m = k; m < k + 2; m++) + { + int num3 = (l - num) * 18; + if ((type == 79 || type == 90) && Main.tile[i, j].frameX >= 72) + { + num3 = (l - num + 4) * 18; + } + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (!Main.tile[l, m].active() || (int)Main.tile[l, m].type != type || (int)Main.tile[l, m].frameX != num3 || (int)Main.tile[l, m].frameY != (m - k) * 18 + num2 * 36) + { + flag = true; + } + } + if (Main.tile[l, k + 2] == null) + { + Main.tile[l, k + 2] = new Tile(); + } + if (!WorldGen.SolidTile2(l, k + 2)) + { + flag = true; + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int n = num; n < num + 4; n++) + { + for (int num4 = k; num4 < k + 3; num4++) + { + if ((int)Main.tile[n, num4].type == type && Main.tile[n, num4].active()) + { + WorldGen.KillTile(n, num4, false, false, false); + } + } + } + if (type == 79) + { + if (num2 == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 224, 1, false, 0, false); + } + else + { + if (num2 == 4) + { + Item.NewItem(i * 16, j * 16, 32, 32, 920, 1, false, 0, false); + } + else + { + if (num2 >= 9 && num2 <= 12) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1710 + num2, 1, false, 0, false); + } + else + { + if (num2 >= 5 && num2 <= 8) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1465 + num2, 1, false, 0, false); + } + else + { + Item.NewItem(i * 16, j * 16, 32, 32, num2 + 643, 1, false, 0, false); + } + } + } + } + } + if (type == 90) + { + Item.NewItem(i * 16, j * 16, 32, 32, 336, 1, false, 0, false); + } + WorldGen.destroyObject = false; + for (int num5 = num - 1; num5 < num + 4; num5++) + { + for (int num6 = k - 1; num6 < k + 4; num6++) + { + WorldGen.TileFrame(num5, num6, false, false); + } + } + } + } + public static void PlaceJunglePlant(int X2, int Y2, int type, int styleX, int styleY) + { + if (styleY > 0 || type == 236 || type == 238) + { + int num = Y2; + if (type == 95 || type == 126) + { + num++; + } + if (X2 < 5 || X2 > Main.maxTilesX - 5 || num < 5 || num > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = X2 - 1; i < X2 + 1; i++) + { + for (int j = num - 1; j < num + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active() && Main.tile[i, j].type != 61 && Main.tile[i, j].type != 62 && Main.tile[i, j].type != 69 && Main.tile[i, j].type != 74 && (type != 236 || Main.tile[i, j].type != 233) && (type != 238 || Main.tile[i, j].type != 233) && (Main.tile[i, j].type != 185 || Main.tile[i, j].frameY != 0)) + { + flag = false; + } + if (type == 98 && Main.tile[i, j].liquid > 0) + { + flag = false; + } + } + if (Main.tile[i, num + 1] == null) + { + Main.tile[i, num + 1] = new Tile(); + } + if (!WorldGen.SolidTile(i, num + 1) || Main.tile[i, num + 1].type != 60) + { + flag = false; + } + } + if (flag) + { + short num2 = 36; + if (type == 236 || type == 238) + { + num2 = 0; + } + short num3 = (short)(36 * styleX); + Main.tile[X2 - 1, num - 1].active(true); + Main.tile[X2 - 1, num - 1].frameY = num2; + Main.tile[X2 - 1, num - 1].frameX = num3; + Main.tile[X2 - 1, num - 1].type = (byte)type; + Main.tile[X2, num - 1].active(true); + Main.tile[X2, num - 1].frameY = num2; + Main.tile[X2, num - 1].frameX = (short)(18 + num3); + Main.tile[X2, num - 1].type = (byte)type; + Main.tile[X2 - 1, num].active(true); + Main.tile[X2 - 1, num].frameY = (short)(num2 + 18); + Main.tile[X2 - 1, num].frameX = num3; + Main.tile[X2 - 1, num].type = (byte)type; + Main.tile[X2, num].active(true); + Main.tile[X2, num].frameY = (short)(num2 + 18); + Main.tile[X2, num].frameX = (short)(18 + num3); + Main.tile[X2, num].type = (byte)type; + return; + } + } + else + { + if (X2 < 5 || X2 > Main.maxTilesX - 5 || Y2 < 5 || Y2 > Main.maxTilesY - 5) + { + return; + } + bool flag2 = true; + for (int k = X2 - 1; k < X2 + 2; k++) + { + for (int l = Y2 - 1; l < Y2 + 1; l++) + { + if (Main.tile[k, l] == null) + { + Main.tile[k, l] = new Tile(); + } + if (Main.tile[k, l].active() && Main.tile[k, l].type != 61 && Main.tile[k, l].type != 62 && Main.tile[k, l].type != 69 && Main.tile[k, l].type != 74 && (Main.tile[k, l].type != 185 || Main.tile[k, l].frameY != 0)) + { + flag2 = false; + } + } + if (Main.tile[k, Y2 + 1] == null) + { + Main.tile[k, Y2 + 1] = new Tile(); + } + if (!WorldGen.SolidTile(k, Y2 + 1) || Main.tile[k, Y2 + 1].type != 60) + { + flag2 = false; + } + } + if (flag2) + { + short num4 = (short)(54 * styleX); + Main.tile[X2 - 1, Y2 - 1].active(true); + Main.tile[X2 - 1, Y2 - 1].frameY = 0; + Main.tile[X2 - 1, Y2 - 1].frameX = num4; + Main.tile[X2 - 1, Y2 - 1].type = (byte)type; + Main.tile[X2, Y2 - 1].active(true); + Main.tile[X2, Y2 - 1].frameY = 0; + Main.tile[X2, Y2 - 1].frameX = (short)(num4 + 18); + Main.tile[X2, Y2 - 1].type = (byte)type; + Main.tile[X2 + 1, Y2 - 1].active(true); + Main.tile[X2 + 1, Y2 - 1].frameY = 0; + Main.tile[X2 + 1, Y2 - 1].frameX = (short)(num4 + 36); + Main.tile[X2 + 1, Y2 - 1].type = (byte)type; + Main.tile[X2 - 1, Y2].active(true); + Main.tile[X2 - 1, Y2].frameY = 18; + Main.tile[X2 - 1, Y2].frameX = num4; + Main.tile[X2 - 1, Y2].type = (byte)type; + Main.tile[X2, Y2].active(true); + Main.tile[X2, Y2].frameY = 18; + Main.tile[X2, Y2].frameX = (short)(num4 + 18); + Main.tile[X2, Y2].type = (byte)type; + Main.tile[X2 + 1, Y2].active(true); + Main.tile[X2 + 1, Y2].frameY = 18; + Main.tile[X2 + 1, Y2].frameX = (short)(num4 + 36); + Main.tile[X2 + 1, Y2].type = (byte)type; + } + } + } + public static void CheckJunglePlant(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + if (Main.tile[i, j].frameY >= 36 || Main.tile[i, j].type == 236 || Main.tile[i, j].type == 238) + { + bool flag = false; + int k = (int)(Main.tile[i, j].frameX / 18); + int num = 0; + while (k > 1) + { + k -= 2; + num++; + } + k = i - k; + int num2 = 36; + if (type == 236 || type == 238) + { + num2 = 0; + } + int l; + for (l = (int)(Main.tile[i, j].frameY / 18); l > 1; l -= 2) + { + } + l = j - l; + int num3 = num * 36; + for (int m = k; m < k + 2; m++) + { + for (int n = l; n < l + 2; n++) + { + if (Main.tile[m, n] == null) + { + Main.tile[m, n] = new Tile(); + } + if (!Main.tile[m, n].active() || (int)Main.tile[m, n].type != type || (int)Main.tile[m, n].frameX != (m - k) * 18 + num3 || (int)Main.tile[m, n].frameY != (n - l) * 18 + num2) + { + flag = true; + } + } + if (Main.tile[m, l + 2] == null) + { + Main.tile[m, l + 2] = new Tile(); + } + if (!WorldGen.SolidTile(m, l + 2) || Main.tile[m, l + 2].type != 60) + { + flag = true; + } + } + if (flag) + { + if (type == 238) + { + float num4 = (float)(i * 16); + float num5 = (float)(j * 16); + float num6 = -1f; + int plr = 0; + for (int num7 = 0; num7 < 255; num7++) + { + float num8 = Math.Abs(Main.player[num7].position.X - num4) + Math.Abs(Main.player[num7].position.Y - num5); + if (num8 < num6 || num6 == -1f) + { + plr = num7; + num6 = num8; + } + } + if (num6 / 16f < 50f) + { + NPC.SpawnOnPlayer(plr, 262); + } + } + if (type == 236) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1291, 1, false, 0, false); + } + short arg_2A8_0 = Main.tile[i, j].frameX; + WorldGen.destroyObject = true; + for (int num9 = k; num9 < k + 2; num9++) + { + for (int num10 = l; num10 < l + 2; num10++) + { + if (Main.tile[num9, num10] == null) + { + Main.tile[num9, num10] = new Tile(); + } + if ((int)Main.tile[num9, num10].type == type && Main.tile[num9, num10].active()) + { + WorldGen.KillTile(num9, num10, false, false, false); + } + } + } + return; + } + } + else + { + bool flag2 = false; + int num11 = j + (int)(Main.tile[i, j].frameY / 18 * -1); + int num12 = (int)(Main.tile[i, j].frameX / 18); + int num13 = 0; + while (num12 > 2) + { + num12 -= 3; + num13++; + } + num12 = i - num12; + int num14 = num13 * 54; + for (int num15 = num12; num15 < num12 + 3; num15++) + { + for (int num16 = num11; num16 < num11 + 2; num16++) + { + if (Main.tile[num15, num16] == null) + { + Main.tile[num15, num16] = new Tile(); + } + if (!Main.tile[num15, num16].active() || (int)Main.tile[num15, num16].type != type || (int)Main.tile[num15, num16].frameX != (num15 - num12) * 18 + num14 || (int)Main.tile[num15, num16].frameY != (num16 - num11) * 18) + { + flag2 = true; + } + } + if (!WorldGen.SolidTile(num15, num11 + 2) || Main.tile[num15, num11 + 2].type != 60) + { + flag2 = true; + } + } + if (flag2) + { + short arg_48D_0 = Main.tile[i, j].frameX; + WorldGen.destroyObject = true; + for (int num17 = num12; num17 < num12 + 3; num17++) + { + for (int num18 = num11; num18 < num11 + 3; num18++) + { + if (Main.tile[num17, num18] == null) + { + Main.tile[num17, num18] = new Tile(); + } + if ((int)Main.tile[num17, num18].type == type && Main.tile[num17, num18].active()) + { + WorldGen.KillTile(num17, num18, false, false, false); + } + } + } + } + } + } + public static void Check2x2(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int num = 0; + int num2 = (int)(Main.tile[i, j].frameX / 18 * -1); + if (num2 < -1) + { + num2 += 2; + num = 36; + } + num2 += i; + int num3 = (int)(Main.tile[i, j].frameY / 18 * -1); + num3 += j; + for (int k = num2; k < num2 + 2; k++) + { + for (int l = num3; l < num3 + 2; l++) + { + if (Main.tile[k, l] == null) + { + Main.tile[k, l] = new Tile(); + } + if (!Main.tile[k, l].active() || (int)Main.tile[k, l].type != type || (int)Main.tile[k, l].frameX != (k - num2) * 18 + num || (int)Main.tile[k, l].frameY != (l - num3) * 18) + { + flag = true; + } + } + if (type == 95 || type == 126) + { + if (Main.tile[k, num3 - 1] == null) + { + Main.tile[k, num3 - 1] = new Tile(); + } + if (!Main.tile[k, num3 - 1].active() || !Main.tileSolid[(int)Main.tile[k, num3 - 1].type] || Main.tileSolidTop[(int)Main.tile[k, num3 - 1].type]) + { + flag = true; + } + } + else + { + if (type != 138) + { + if (Main.tile[k, num3 + 2] == null) + { + Main.tile[k, num3 + 2] = new Tile(); + } + if (!Main.tile[k, num3 + 2].active() || (!Main.tileSolid[(int)Main.tile[k, num3 + 2].type] && !Main.tileTable[(int)Main.tile[k, num3 + 2].type])) + { + flag = true; + } + if (Main.tile[k, num3 + 2].halfBrick()) + { + flag = true; + } + } + } + } + if (type == 138 && !WorldGen.SolidTile2(num2, num3 + 2) && !WorldGen.SolidTile2(num2 + 1, num3 + 2)) + { + flag = true; + } + if (flag) + { + WorldGen.destroyObject = true; + for (int m = num2; m < num2 + 2; m++) + { + for (int n = num3; n < num3 + 2; n++) + { + if ((int)Main.tile[m, n].type == type && Main.tile[m, n].active()) + { + WorldGen.KillTile(m, n, false, false, false); + } + } + } + if (type == 85) + { + Item.NewItem(i * 16, j * 16, 32, 32, 321, 1, false, 0, false); + } + if (type == 94) + { + Item.NewItem(i * 16, j * 16, 32, 32, 352, 1, false, 0, false); + } + if (type == 95) + { + Item.NewItem(i * 16, j * 16, 32, 32, 344, 1, false, 0, false); + } + if (type == 96) + { + Item.NewItem(i * 16, j * 16, 32, 32, 345, 1, false, 0, false); + } + if (type == 97) + { + Item.NewItem(i * 16, j * 16, 32, 32, 346, 1, false, 0, false); + } + if (type == 98) + { + Item.NewItem(i * 16, j * 16, 32, 32, 347, 1, false, 0, false); + } + if (type == 99) + { + Item.NewItem(i * 16, j * 16, 32, 32, 348, 1, false, 0, false); + } + if (type == 100) + { + Item.NewItem(i * 16, j * 16, 32, 32, 349, 1, false, 0, false); + } + if (type == 173) + { + Item.NewItem(i * 16, j * 16, 32, 32, 714, 1, false, 0, false); + } + if (type == 125) + { + Item.NewItem(i * 16, j * 16, 32, 32, 487, 1, false, 0, false); + } + if (type == 126) + { + Item.NewItem(i * 16, j * 16, 32, 32, 488, 1, false, 0, false); + } + if (type == 132) + { + Item.NewItem(i * 16, j * 16, 32, 32, 513, 1, false, 0, false); + } + if (type == 142) + { + Item.NewItem(i * 16, j * 16, 32, 32, 581, 1, false, 0, false); + } + if (type == 143) + { + Item.NewItem(i * 16, j * 16, 32, 32, 582, 1, false, 0, false); + } + if (type == 138 && !WorldGen.gen && Main.netMode != 1) + { + Projectile.NewProjectile((float)(num2 * 16) + 15.5f, (float)(num3 * 16 + 16), 0f, 0f, 99, 70, 10f, Main.myPlayer, 0f, 0f); + } + WorldGen.destroyObject = false; + for (int num4 = num2 - 1; num4 < num2 + 3; num4++) + { + for (int num5 = num3 - 1; num5 < num3 + 3; num5++) + { + WorldGen.TileFrame(num4, num5, false, false); + } + } + } + } + public static void OreRunner(int i, int j, double strength, int steps, int type) + { + double num = strength; + float num2 = (float)steps; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + while (num > 0.0 && num2 > 0f) + { + if (value.Y < 0f && num2 > 0f && type == 59) + { + num2 = 0f; + } + num = strength * (double)(num2 / (float)steps); + num2 -= 1f; + int num3 = (int)((double)value.X - num * 0.5); + int num4 = (int)((double)value.X + num * 0.5); + int num5 = (int)((double)value.Y - num * 0.5); + int num6 = (int)((double)value.Y + num * 0.5); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int k = num3; k < num4; k++) + { + for (int l = num5; l < num6; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < strength * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[k, l].active() && (Main.tile[k, l].type == 0 || Main.tile[k, l].type == 1 || Main.tile[k, l].type == 23 || Main.tile[k, l].type == 25 || Main.tile[k, l].type == 40 || Main.tile[k, l].type == 53 || Main.tile[k, l].type == 57 || Main.tile[k, l].type == 59 || Main.tile[k, l].type == 60 || Main.tile[k, l].type == 70 || Main.tile[k, l].type == 109 || Main.tile[k, l].type == 112 || Main.tile[k, l].type == 116 || Main.tile[k, l].type == 117 || Main.tile[k, l].type == 147 || Main.tile[k, l].type == 161 || Main.tile[k, l].type == 163 || Main.tile[k, l].type == 164 || Main.tileMoss[(int)Main.tile[k, l].type] || Main.tile[k, l].type == 199 || Main.tile[k, l].type == 200 || Main.tile[k, l].type == 203 || Main.tile[k, l].type == 234)) + { + Main.tile[k, l].type = (byte)type; + WorldGen.SquareTileFrame(k, l, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, k, l, 1); + } + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + } + } + public static void SmashAltar(int i, int j) + { + if (Main.netMode == 1) + { + return; + } + if (!Main.hardMode) + { + return; + } + if (WorldGen.noTileActions) + { + return; + } + if (WorldGen.gen) + { + return; + } + int num = WorldGen.altarCount % 3; + int num2 = WorldGen.altarCount / 3 + 1; + float num3 = (float)(Main.maxTilesX / 4200); + int num4 = 1 - num; + num3 = num3 * 310f - (float)(85 * num); + num3 *= 0.85f; + num3 /= (float)num2; + if (num == 0) + { + if (WorldGen.oreTier1 == -1) + { + WorldGen.oreTier1 = 107; + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.oreTier1 = 221; + } + } + int num5 = 12; + if (WorldGen.oreTier1 == 221) + { + num5 += 9; + } + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[num5], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[num5], 255, 50f, 255f, 130f, 0); + } + } + num = WorldGen.oreTier1; + num3 *= 1.05f; + } + else + { + if (num == 1) + { + if (WorldGen.oreTier2 == -1) + { + WorldGen.oreTier2 = 108; + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.oreTier2 = 222; + } + } + int num6 = 13; + if (WorldGen.oreTier2 == 222) + { + num6 += 9; + } + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[num6], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[num6], 255, 50f, 255f, 130f, 0); + } + } + num = WorldGen.oreTier2; + } + else + { + if (WorldGen.oreTier3 == -1) + { + WorldGen.oreTier3 = 111; + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.oreTier3 = 223; + } + } + int num7 = 14; + if (WorldGen.oreTier3 == 223) + { + num7 += 9; + } + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[num7], 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, Lang.misc[num7], 255, 50f, 255f, 130f, 0); + } + } + num = WorldGen.oreTier3; + } + } + int num8 = 0; + while ((float)num8 < num3) + { + int i2 = WorldGen.genRand.Next(100, Main.maxTilesX - 100); + double num9 = Main.worldSurface; + if (num == 108) + { + num9 = Main.rockLayer; + } + if (num == 111) + { + num9 = (Main.rockLayer + Main.rockLayer + (double)Main.maxTilesY) / 3.0; + } + int j2 = WorldGen.genRand.Next((int)num9, Main.maxTilesY - 150); + WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(5, 9 + num4), WorldGen.genRand.Next(5, 9 + num4), num); + num8++; + } + int num10 = WorldGen.genRand.Next(3); + while (num10 != 2) + { + int num11 = WorldGen.genRand.Next(100, Main.maxTilesX - 100); + int num12 = WorldGen.genRand.Next((int)Main.rockLayer + 50, Main.maxTilesY - 300); + if (Main.tile[num11, num12].active() && Main.tile[num11, num12].type == 1) + { + if (num10 == 0) + { + if (WorldGen.crimson) + { + Main.tile[num11, num12].type = 203; + } + else + { + Main.tile[num11, num12].type = 25; + } + } + else + { + Main.tile[num11, num12].type = 117; + } + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num11, num12, 1); + break; + } + break; + } + } + if (Main.netMode != 1) + { + int num13 = Main.rand.Next(2) + 1; + for (int k = 0; k < num13; k++) + { + NPC.SpawnOnPlayer((int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16), 82); + } + } + WorldGen.altarCount++; + } + public static void Check3x1(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int k = (int)(Main.tile[i, j].frameX / 18); + int num = 0; + while (k > 2) + { + k -= 3; + num++; + } + k = i - k; + int num2 = num * 54; + for (int l = k; l < k + 3; l++) + { + if (Main.tile[l, j] == null) + { + Main.tile[l, j] = new Tile(); + } + if (!Main.tile[l, j].active() || (int)Main.tile[l, j].type != type || (int)Main.tile[l, j].frameX != (l - k) * 18 + num2 || Main.tile[l, j].frameY != 0) + { + flag = true; + } + if (!WorldGen.SolidTile2(l, j + 1)) + { + flag = true; + } + } + if (flag) + { + short arg_FC_0 = Main.tile[i, j].frameX; + WorldGen.destroyObject = true; + if (type == 235) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1263, 1, false, 0, false); + } + for (int m = k; m < k + 3; m++) + { + if (Main.tile[m, j] == null) + { + Main.tile[m, j] = new Tile(); + } + if ((int)Main.tile[m, j].type == type && Main.tile[m, j].active()) + { + WorldGen.KillTile(m, j, false, false, false); + } + } + WorldGen.destroyObject = false; + for (int n = k - 1; n < k + 4; n++) + { + WorldGen.TileFrame(n, j, false, false); + } + } + } + public static void Check3x2(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int num = j + (int)(Main.tile[i, j].frameY / 18 * -1); + int k = (int)(Main.tile[i, j].frameX / 18); + int num2 = 0; + while (k > 2) + { + k -= 3; + num2++; + } + k = i - k; + int num3 = num2 * 54; + for (int l = k; l < k + 3; l++) + { + for (int m = num; m < num + 2; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (!Main.tile[l, m].active() || (int)Main.tile[l, m].type != type || (int)Main.tile[l, m].frameX != (l - k) * 18 + num3 || (int)Main.tile[l, m].frameY != (m - num) * 18) + { + flag = true; + } + } + if (!WorldGen.SolidTile2(l, num + 2)) + { + flag = true; + } + } + if (type == 187 && Main.tile[k, num].frameX >= 756 && Main.tile[k, num].frameX <= 900 && Main.tile[k, num + 2].type != 2 && Main.tile[k + 1, num + 2].type != 2 && Main.tile[k + 2, num + 2].type != 2) + { + Tile expr_1B9 = Main.tile[k, num]; + expr_1B9.frameX -= 378; + Tile expr_1D9 = Main.tile[k + 1, num]; + expr_1D9.frameX -= 378; + Tile expr_1F9 = Main.tile[k + 2, num]; + expr_1F9.frameX -= 378; + Tile expr_219 = Main.tile[k, num + 1]; + expr_219.frameX -= 378; + Tile expr_23B = Main.tile[k + 1, num + 1]; + expr_23B.frameX -= 378; + Tile expr_25D = Main.tile[k + 2, num + 1]; + expr_25D.frameX -= 378; + Main.tile[k, num].type = 186; + Main.tile[k + 1, num].type = 186; + Main.tile[k + 2, num].type = 186; + Main.tile[k, num + 1].type = 186; + Main.tile[k + 1, num + 1].type = 186; + Main.tile[k + 2, num + 1].type = 186; + } + if (flag) + { + int frameX = (int)Main.tile[i, j].frameX; + WorldGen.destroyObject = true; + for (int n = k; n < k + 3; n++) + { + for (int num4 = num; num4 < num + 3; num4++) + { + if (Main.tile[n, num4] == null) + { + Main.tile[n, num4] = new Tile(); + } + if ((int)Main.tile[n, num4].type == type && Main.tile[n, num4].active()) + { + WorldGen.KillTile(n, num4, false, false, false); + } + } + } + if (type == 14) + { + int type2 = 32; + if (num2 >= 1 && num2 <= 3) + { + type2 = 637 + num2; + } + if (num2 >= 15 && num2 <= 20) + { + type2 = 1698 + num2; + } + if (num2 >= 4 && num2 <= 7) + { + type2 = 823 + num2; + } + if (num2 == 8) + { + type2 = 917; + } + if (num2 == 9) + { + type2 = 1144; + } + if (num2 == 10) + { + type2 = 1397; + } + if (num2 == 11) + { + type2 = 1400; + } + if (num2 == 12) + { + type2 = 1403; + } + if (num2 == 13) + { + type2 = 1460; + } + if (num2 == 14) + { + type2 = 1510; + } + Item.NewItem(i * 16, j * 16, 32, 32, type2, 1, false, 0, false); + } + else + { + if (type == 114) + { + Item.NewItem(i * 16, j * 16, 32, 32, 398, 1, false, 0, false); + } + else + { + if (type == 26) + { + if (!WorldGen.noTileActions) + { + WorldGen.SmashAltar(i, j); + } + } + else + { + if (type == 217) + { + Item.NewItem(i * 16, j * 16, 32, 32, 995, 1, false, 0, false); + } + else + { + if (type == 218) + { + Item.NewItem(i * 16, j * 16, 32, 32, 996, 1, false, 0, false); + } + else + { + if (type == 219) + { + Item.NewItem(i * 16, j * 16, 32, 32, 997, 1, false, 0, false); + } + else + { + if (type == 220) + { + Item.NewItem(i * 16, j * 16, 32, 32, 998, 1, false, 0, false); + } + else + { + if (type == 228) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1120, 1, false, 0, false); + } + else + { + if (type == 215) + { + Item.NewItem(i * 16, j * 16, 32, 32, 966, 1, false, 0, false); + } + else + { + if (type == 244) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1449, 1, false, 0, false); + } + else + { + if (type == 17) + { + Item.NewItem(i * 16, j * 16, 32, 32, 33, 1, false, 0, false); + } + else + { + if (type == 77) + { + Item.NewItem(i * 16, j * 16, 32, 32, 221, 1, false, 0, false); + } + else + { + if (type == 86) + { + Item.NewItem(i * 16, j * 16, 32, 32, 332, 1, false, 0, false); + } + else + { + if (type == 237) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1292, 1, false, 0, false); + } + else + { + if (type == 87) + { + int type3 = 333; + if (num2 >= 1 && num2 <= 3) + { + type3 = 640 + num2; + } + if (num2 == 4) + { + type3 = 919; + } + Item.NewItem(i * 16, j * 16, 32, 32, type3, 1, false, 0, false); + } + else + { + if (type == 88) + { + int type4 = 334; + if (num2 >= 1 && num2 <= 3) + { + type4 = 646 + num2; + } + if (num2 == 4) + { + type4 = 918; + } + Item.NewItem(i * 16, j * 16, 32, 32, type4, 1, false, 0, false); + } + else + { + if (type == 89) + { + Item.NewItem(i * 16, j * 16, 32, 32, 335, 1, false, 0, false); + } + else + { + if (type == 133) + { + if (frameX >= 54) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1221, 1, false, 0, false); + } + else + { + Item.NewItem(i * 16, j * 16, 32, 32, 524, 1, false, 0, false); + } + } + else + { + if (type == 186) + { + if (frameX >= 864) + { + if (frameX <= 954) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(30, 100), false, 0, false); + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(40, 100), false, 0, false); + if (WorldGen.genRand.Next(3) != 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) != 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(30, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) != 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(40, 100), false, 0, false); + } + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(30, 100), false, 0, false); + } + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(40, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(30, 100), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(40, 100), false, 0, false); + } + if (WorldGen.genRand.Next(4) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(4) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(30, 100), false, 0, false); + } + if (WorldGen.genRand.Next(4) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(40, 100), false, 0, false); + } + if (WorldGen.genRand.Next(5) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (WorldGen.genRand.Next(5) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(30, 100), false, 0, false); + } + if (WorldGen.genRand.Next(5) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 71, WorldGen.genRand.Next(40, 100), false, 0, false); + } + } + else + { + if (frameX <= 1062) + { + Item.NewItem(i * 16, j * 16, 32, 32, 72, WorldGen.genRand.Next(10, 100), false, 0, false); + if (Main.rand.Next(2) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 72, WorldGen.genRand.Next(20, 100), false, 0, false); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 72, WorldGen.genRand.Next(30, 100), false, 0, false); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 72, WorldGen.genRand.Next(40, 100), false, 0, false); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 72, WorldGen.genRand.Next(50, 100), false, 0, false); + } + } + else + { + if (frameX <= 1170) + { + Item.NewItem(i * 16, j * 16, 32, 32, 73, WorldGen.genRand.Next(1, 7), false, 0, false); + if (WorldGen.genRand.Next(2) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 73, WorldGen.genRand.Next(2, 7), false, 0, false); + } + if (WorldGen.genRand.Next(3) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 73, WorldGen.genRand.Next(3, 7), false, 0, false); + } + if (WorldGen.genRand.Next(4) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 73, WorldGen.genRand.Next(4, 7), false, 0, false); + } + if (WorldGen.genRand.Next(5) == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 73, WorldGen.genRand.Next(5, 7), false, 0, false); + } + } + } + } + } + } + else + { + if (type == 187 && frameX >= 918 && frameX <= 970) + { + Item.NewItem(i * 16, j * 16, 32, 32, 989, 1, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + WorldGen.destroyObject = false; + for (int num5 = k - 1; num5 < k + 4; num5++) + { + for (int num6 = num - 1; num6 < num + 4; num6++) + { + WorldGen.TileFrame(num5, num6, false, false); + } + } + } + } + public static void Check3x4(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int num = 0; + int k; + for (k = (int)(Main.tile[i, j].frameX / 18); k >= 3; k -= 3) + { + num++; + } + int num2 = i - k; + int num3 = j + (int)(Main.tile[i, j].frameY / 18 * -1); + for (int l = num2; l < num2 + 3; l++) + { + for (int m = num3; m < num3 + 4; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (!Main.tile[l, m].active() || (int)Main.tile[l, m].type != type || (int)Main.tile[l, m].frameX != num * 54 + (l - num2) * 18 || (int)Main.tile[l, m].frameY != (m - num3) * 18) + { + flag = true; + } + } + if (Main.tile[l, num3 + 4] == null) + { + Main.tile[l, num3 + 4] = new Tile(); + } + if (!WorldGen.SolidTile2(l, num3 + 4)) + { + flag = true; + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int n = num2; n < num2 + 3; n++) + { + for (int num4 = num3; num4 < num3 + 4; num4++) + { + if ((int)Main.tile[n, num4].type == type && Main.tile[n, num4].active()) + { + WorldGen.KillTile(n, num4, false, false, false); + } + } + } + if (type == 101) + { + if (num == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 354, 1, false, 0, false); + } + if (num == 1) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1414, 1, false, 0, false); + } + if (num == 2) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1415, 1, false, 0, false); + } + if (num == 3) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1416, 1, false, 0, false); + } + if (num == 4) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1463, 1, false, 0, false); + } + if (num == 5) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1512, 1, false, 0, false); + } + } + else + { + if (type == 102) + { + Item.NewItem(i * 16, j * 16, 32, 32, 355, 1, false, 0, false); + } + } + WorldGen.destroyObject = false; + for (int num5 = num2 - 1; num5 < num2 + 4; num5++) + { + for (int num6 = num3 - 1; num6 < num3 + 4; num6++) + { + WorldGen.TileFrame(num5, num6, false, false); + } + } + } + } + public static void Place4x2(int x, int y, int type, int direction = -1, int style = 0) + { + if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = x - 1; i < x + 3; i++) + { + for (int j = y - 1; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(i, y + 1)) + { + flag = false; + } + } + short num = 0; + if (direction == 1) + { + num = 72; + } + int num2 = 36 * style; + if (flag) + { + Main.tile[x - 1, y - 1].active(true); + Main.tile[x - 1, y - 1].frameY = (short)num2; + Main.tile[x - 1, y - 1].frameX = num; + Main.tile[x - 1, y - 1].type = (byte)type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameY = (short)num2; + Main.tile[x, y - 1].frameX = (short)(18 + num); + Main.tile[x, y - 1].type = (byte)type; + Main.tile[x + 1, y - 1].active(true); + Main.tile[x + 1, y - 1].frameY = (short)num2; + Main.tile[x + 1, y - 1].frameX = (short)(36 + num); + Main.tile[x + 1, y - 1].type = (byte)type; + Main.tile[x + 2, y - 1].active(true); + Main.tile[x + 2, y - 1].frameY = (short)num2; + Main.tile[x + 2, y - 1].frameX = (short)(54 + num); + Main.tile[x + 2, y - 1].type = (byte)type; + Main.tile[x - 1, y].active(true); + Main.tile[x - 1, y].frameY = (short)(num2 + 18); + Main.tile[x - 1, y].frameX = num; + Main.tile[x - 1, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = (short)(num2 + 18); + Main.tile[x, y].frameX = (short)(18 + num); + Main.tile[x, y].type = (byte)type; + Main.tile[x + 1, y].active(true); + Main.tile[x + 1, y].frameY = (short)(num2 + 18); + Main.tile[x + 1, y].frameX = (short)(36 + num); + Main.tile[x + 1, y].type = (byte)type; + Main.tile[x + 2, y].active(true); + Main.tile[x + 2, y].frameY = (short)(num2 + 18); + Main.tile[x + 2, y].frameX = (short)(54 + num); + Main.tile[x + 2, y].type = (byte)type; + } + } + public static void SwitchCannon(int i, int j) + { + int k; + for (k = (int)(Main.tile[i, j].frameX / 18); k >= 4; k -= 4) + { + } + int l; + for (l = (int)(Main.tile[i, j].frameY / 18); l >= 3; l -= 3) + { + } + int num = 1; + if (k < 2) + { + num = -1; + } + k = i - k; + l = j - l; + if (num == 1 && Main.tile[k, l].frameY <= 52) + { + return; + } + if (num == -1 && Main.tile[k, l].frameY >= 432) + { + return; + } + num *= -54; + for (int m = k; m < k + 4; m++) + { + for (int n = l; n < l + 3; n++) + { + if (Main.tile[m, n] == null) + { + Main.tile[m, n] = new Tile(); + } + if (Main.tile[m, n].active() && Main.tile[m, n].type == 209) + { + Main.tile[m, n].frameY = (short)((int)Main.tile[m, n].frameY + num); + } + } + } + NetMessage.SendTileSquare(-1, k + 1, l + 1, 4); + } + public static void CheckCannon(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int k = (int)(Main.tile[i, j].frameX / 18); + int num = 0; + while (k >= 4) + { + num++; + k -= 4; + } + k = i - k; + int l = (int)(Main.tile[i, j].frameY / 18); + int num2 = 0; + while (l >= 3) + { + num2 += 54; + l -= 3; + } + l = j - l; + int num3 = 72 * num; + for (int m = k; m < k + 4; m++) + { + int num4 = num2; + for (int n = l; n < l + 3; n++) + { + if (Main.tile[m, n] == null) + { + Main.tile[m, n] = new Tile(); + } + if (!Main.tile[m, n].active() || (int)Main.tile[m, n].type != type || (int)Main.tile[m, n].frameX != num3 || (int)Main.tile[m, n].frameY != num4) + { + flag = true; + } + num4 += 18; + } + if (Main.tile[m, l + 3] == null) + { + Main.tile[m, l + 3] = new Tile(); + } + if (!WorldGen.SolidTile2(m, l + 3) && m != k && m != k + 3) + { + flag = true; + } + num3 += 18; + } + if (flag) + { + WorldGen.destroyObject = true; + for (int num5 = k; num5 < k + 4; num5++) + { + for (int num6 = l; num6 < l + 3; num6++) + { + if ((int)Main.tile[num5, num6].type == type && Main.tile[num5, num6].active()) + { + WorldGen.KillTile(num5, num6, false, false, false); + } + } + } + if (num == 0) + { + Item.NewItem(i * 16, j * 16, 32, 32, 928, 1, false, 0, false); + } + if (num == 1) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1337, 1, false, 0, false); + } + WorldGen.destroyObject = false; + for (int num7 = k; num7 < k + 4; num7++) + { + for (int num8 = l; num8 < l + 3; num8++) + { + WorldGen.TileFrame(num7, num8, false, false); + } + } + } + } + public static void PlaceCannon(int x, int y, int type, int style = 0) + { + if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = x - 1; i < x + 3; i++) + { + for (int j = y - 2; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(i, y + 1) && i != x - 1 && i != x + 2) + { + flag = false; + } + } + int num = 72 * style; + int num2 = 0; + if (flag) + { + Main.tile[x - 1, y - 2].active(true); + Main.tile[x - 1, y - 2].frameY = (short)num2; + Main.tile[x - 1, y - 2].frameX = (short)num; + Main.tile[x - 1, y - 2].type = (byte)type; + Main.tile[x, y - 2].active(true); + Main.tile[x, y - 2].frameY = (short)num2; + Main.tile[x, y - 2].frameX = (short)(18 + num); + Main.tile[x, y - 2].type = (byte)type; + Main.tile[x + 1, y - 2].active(true); + Main.tile[x + 1, y - 2].frameY = (short)num2; + Main.tile[x + 1, y - 2].frameX = (short)(36 + num); + Main.tile[x + 1, y - 2].type = (byte)type; + Main.tile[x + 2, y - 2].active(true); + Main.tile[x + 2, y - 2].frameY = (short)num2; + Main.tile[x + 2, y - 2].frameX = (short)(54 + num); + Main.tile[x + 2, y - 2].type = (byte)type; + Main.tile[x - 1, y - 1].active(true); + Main.tile[x - 1, y - 1].frameY = (short)(num2 + 18); + Main.tile[x - 1, y - 1].frameX = (short)num; + Main.tile[x - 1, y - 1].type = (byte)type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameY = (short)(num2 + 18); + Main.tile[x, y - 1].frameX = (short)(18 + num); + Main.tile[x, y - 1].type = (byte)type; + Main.tile[x + 1, y - 1].active(true); + Main.tile[x + 1, y - 1].frameY = (short)(num2 + 18); + Main.tile[x + 1, y - 1].frameX = (short)(36 + num); + Main.tile[x + 1, y - 1].type = (byte)type; + Main.tile[x + 2, y - 1].active(true); + Main.tile[x + 2, y - 1].frameY = (short)(num2 + 18); + Main.tile[x + 2, y - 1].frameX = (short)(54 + num); + Main.tile[x + 2, y - 1].type = (byte)type; + Main.tile[x - 1, y].active(true); + Main.tile[x - 1, y].frameY = (short)(num2 + 36); + Main.tile[x - 1, y].frameX = (short)num; + Main.tile[x - 1, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = (short)(num2 + 36); + Main.tile[x, y].frameX = (short)(18 + num); + Main.tile[x, y].type = (byte)type; + Main.tile[x + 1, y].active(true); + Main.tile[x + 1, y].frameY = (short)(num2 + 36); + Main.tile[x + 1, y].frameX = (short)(36 + num); + Main.tile[x + 1, y].type = (byte)type; + Main.tile[x + 2, y].active(true); + Main.tile[x + 2, y].frameY = (short)(num2 + 36); + Main.tile[x + 2, y].frameX = (short)(54 + num); + Main.tile[x + 2, y].type = (byte)type; + } + } + public static void SwitchMB(int i, int j) + { + int k; + for (k = (int)(Main.tile[i, j].frameY / 18); k >= 2; k -= 2) + { + } + int num = (int)(Main.tile[i, j].frameX / 18); + if (num >= 2) + { + num -= 2; + } + int num2 = i - num; + int num3 = j - k; + for (int l = num2; l < num2 + 2; l++) + { + for (int m = num3; m < num3 + 2; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (Main.tile[l, m].active() && Main.tile[l, m].type == 139) + { + if (Main.tile[l, m].frameX < 36) + { + Tile expr_D2 = Main.tile[l, m]; + expr_D2.frameX += 36; + } + else + { + Tile expr_F1 = Main.tile[l, m]; + expr_F1.frameX -= 36; + } + WorldGen.noWireX[WorldGen.numNoWire] = l; + WorldGen.noWireY[WorldGen.numNoWire] = m; + WorldGen.numNoWire++; + } + } + } + NetMessage.SendTileSquare(-1, num2, num3, 3); + } + public static void SwitchFountain(int i, int j) + { + int k; + for (k = (int)(Main.tile[i, j].frameX / 18); k >= 2; k -= 2) + { + } + int num = (int)(Main.tile[i, j].frameY / 18); + if (num >= 4) + { + num -= 4; + } + int num2 = i - k; + int num3 = j - num; + for (int l = num2; l < num2 + 2; l++) + { + for (int m = num3; m < num3 + 4; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (Main.tile[l, m].active() && Main.tile[l, m].type == 207) + { + if (Main.tile[l, m].frameY < 72) + { + Tile expr_D2 = Main.tile[l, m]; + expr_D2.frameY += 72; + } + else + { + Tile expr_F1 = Main.tile[l, m]; + expr_F1.frameY -= 72; + } + WorldGen.noWireX[WorldGen.numNoWire] = l; + WorldGen.noWireY[WorldGen.numNoWire] = m; + WorldGen.numNoWire++; + } + } + } + NetMessage.SendTileSquare(-1, num2, num3 + 1, 4); + } + public static void CheckMB(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int num = 0; + int k; + for (k = (int)(Main.tile[i, j].frameY / 18); k >= 2; k -= 2) + { + num++; + } + int num2 = (int)(Main.tile[i, j].frameX / 18); + int num3 = 0; + if (num2 >= 2) + { + num2 -= 2; + num3++; + } + int num4 = i - num2; + int num5 = j - k; + for (int l = num4; l < num4 + 2; l++) + { + for (int m = num5; m < num5 + 2; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (!Main.tile[l, m].active() || (int)Main.tile[l, m].type != type || (int)Main.tile[l, m].frameX != (l - num4) * 18 + num3 * 36 || (int)Main.tile[l, m].frameY != (m - num5) * 18 + num * 36) + { + flag = true; + } + } + if (!Main.tileSolid[(int)Main.tile[l, num5 + 2].type] && !Main.tileTable[(int)Main.tile[l, num5 + 2].type]) + { + flag = true; + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int n = num4; n < num4 + 2; n++) + { + for (int num6 = num5; num6 < num5 + 3; num6++) + { + if ((int)Main.tile[n, num6].type == type && Main.tile[n, num6].active()) + { + WorldGen.KillTile(n, num6, false, false, false); + } + } + } + if (num >= 13) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1596 + num - 13, 1, false, 0, false); + } + else + { + Item.NewItem(i * 16, j * 16, 32, 32, 562 + num, 1, false, 0, false); + } + for (int num7 = num4 - 1; num7 < num4 + 3; num7++) + { + for (int num8 = num5 - 1; num8 < num5 + 3; num8++) + { + WorldGen.TileFrame(num7, num8, false, false); + } + } + WorldGen.destroyObject = false; + } + } + public static void PlaceMB(int X, int y, int type, int style) + { + int num = X + 1; + if (num < 5 || num > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = num - 1; i < num + 1; i++) + { + for (int j = y - 1; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!Main.tile[i, y + 1].active() || Main.tile[i, y + 1].halfBrick() || (!Main.tileSolid[(int)Main.tile[i, y + 1].type] && !Main.tileTable[(int)Main.tile[i, y + 1].type])) + { + flag = false; + } + } + if (flag) + { + Main.tile[num - 1, y - 1].active(true); + Main.tile[num - 1, y - 1].frameY = (short)(style * 36); + Main.tile[num - 1, y - 1].frameX = 0; + Main.tile[num - 1, y - 1].type = (byte)type; + Main.tile[num, y - 1].active(true); + Main.tile[num, y - 1].frameY = (short)(style * 36); + Main.tile[num, y - 1].frameX = 18; + Main.tile[num, y - 1].type = (byte)type; + Main.tile[num - 1, y].active(true); + Main.tile[num - 1, y].frameY = (short)(style * 36 + 18); + Main.tile[num - 1, y].frameX = 0; + Main.tile[num - 1, y].type = (byte)type; + Main.tile[num, y].active(true); + Main.tile[num, y].frameY = (short)(style * 36 + 18); + Main.tile[num, y].frameX = 18; + Main.tile[num, y].type = (byte)type; + } + } + public static void Place2x2(int x, int superY, int type) + { + int num = superY; + if (type == 95 || type == 126) + { + num++; + } + if (x < 5 || x > Main.maxTilesX - 5 || num < 5 || num > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = x - 1; i < x + 1; i++) + { + for (int j = num - 1; j < num + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + if (type == 98 && Main.tile[i, j].liquid > 0) + { + flag = false; + } + } + if (type == 95 || type == 126) + { + if (Main.tile[i, num - 2] == null) + { + Main.tile[i, num - 2] = new Tile(); + } + if (!Main.tile[i, num - 2].nactive() || !Main.tileSolid[(int)Main.tile[i, num - 2].type] || Main.tileSolidTop[(int)Main.tile[i, num - 2].type]) + { + flag = false; + } + } + else + { + if (Main.tile[i, num + 1] == null) + { + Main.tile[i, num + 1] = new Tile(); + } + if (!Main.tile[i, num + 1].nactive() || (!WorldGen.SolidTile2(i, num + 1) && !Main.tileTable[(int)Main.tile[i, num + 1].type])) + { + flag = false; + } + } + } + if (flag) + { + Main.tile[x - 1, num - 1].active(true); + Main.tile[x - 1, num - 1].frameY = 0; + Main.tile[x - 1, num - 1].frameX = 0; + Main.tile[x - 1, num - 1].type = (byte)type; + Main.tile[x, num - 1].active(true); + Main.tile[x, num - 1].frameY = 0; + Main.tile[x, num - 1].frameX = 18; + Main.tile[x, num - 1].type = (byte)type; + Main.tile[x - 1, num].active(true); + Main.tile[x - 1, num].frameY = 18; + Main.tile[x - 1, num].frameX = 0; + Main.tile[x - 1, num].type = (byte)type; + Main.tile[x, num].active(true); + Main.tile[x, num].frameY = 18; + Main.tile[x, num].frameX = 18; + Main.tile[x, num].type = (byte)type; + } + } + public static void Place3x4(int x, int y, int type, int style) + { + if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = x - 1; i < x + 2; i++) + { + for (int j = y - 3; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(i, y + 1)) + { + flag = false; + } + } + if (flag) + { + int num = style * 54; + for (int k = -3; k <= 0; k++) + { + short frameY = (short)((3 + k) * 18); + Main.tile[x - 1, y + k].active(true); + Main.tile[x - 1, y + k].frameY = frameY; + Main.tile[x - 1, y + k].frameX = (short)num; + Main.tile[x - 1, y + k].type = (byte)type; + Main.tile[x, y + k].active(true); + Main.tile[x, y + k].frameY = frameY; + Main.tile[x, y + k].frameX = (short)(num + 18); + Main.tile[x, y + k].type = (byte)type; + Main.tile[x + 1, y + k].active(true); + Main.tile[x + 1, y + k].frameY = frameY; + Main.tile[x + 1, y + k].frameX = (short)(num + 36); + Main.tile[x + 1, y + k].type = (byte)type; + } + } + } + public static void Place3x1(int x, int y, int type, int style = 0) + { + if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = x - 1; i < x + 2; i++) + { + if (Main.tile[i, y] == null) + { + Main.tile[i, y] = new Tile(); + } + if (Main.tile[i, y].active()) + { + flag = false; + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(i, y + 1)) + { + flag = false; + } + } + if (flag) + { + short num = (short)(54 * style); + Main.tile[x - 1, y].active(true); + Main.tile[x - 1, y].frameY = 0; + Main.tile[x - 1, y].frameX = num; + Main.tile[x - 1, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = 0; + Main.tile[x, y].frameX = (short)(num + 18); + Main.tile[x, y].type = (byte)type; + Main.tile[x + 1, y].active(true); + Main.tile[x + 1, y].frameY = 0; + Main.tile[x + 1, y].frameX = (short)(num + 36); + Main.tile[x + 1, y].type = (byte)type; + } + } + public static void Place3x2(int x, int y, int type, int style = 0) + { + if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5) + { + return; + } + bool flag = true; + for (int i = x - 1; i < x + 2; i++) + { + for (int j = y - 1; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(i, y + 1)) + { + flag = false; + } + } + if (flag) + { + short num = (short)(54 * style); + Main.tile[x - 1, y - 1].active(true); + Main.tile[x - 1, y - 1].frameY = 0; + Main.tile[x - 1, y - 1].frameX = num; + Main.tile[x - 1, y - 1].type = (byte)type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameY = 0; + Main.tile[x, y - 1].frameX = (short)(num + 18); + Main.tile[x, y - 1].type = (byte)type; + Main.tile[x + 1, y - 1].active(true); + Main.tile[x + 1, y - 1].frameY = 0; + Main.tile[x + 1, y - 1].frameX = (short)(num + 36); + Main.tile[x + 1, y - 1].type = (byte)type; + Main.tile[x - 1, y].active(true); + Main.tile[x - 1, y].frameY = 18; + Main.tile[x - 1, y].frameX = num; + Main.tile[x - 1, y].type = (byte)type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = 18; + Main.tile[x, y].frameX = (short)(num + 18); + Main.tile[x, y].type = (byte)type; + Main.tile[x + 1, y].active(true); + Main.tile[x + 1, y].frameY = 18; + Main.tile[x + 1, y].frameX = (short)(num + 36); + Main.tile[x + 1, y].type = (byte)type; + } + } + public static void Check3x3(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int k = (int)(Main.tile[i, j].frameX / 18); + int num = 0; + while (k >= 3) + { + num++; + k -= 3; + } + int num2 = i - k; + int num3 = 54 * num; + if (k >= 3) + { + k -= 3; + } + k = i - k; + int num4 = j + (int)(Main.tile[i, j].frameY / 18 * -1); + for (int l = k; l < k + 3; l++) + { + for (int m = num4; m < num4 + 3; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (!Main.tile[l, m].active() || (int)Main.tile[l, m].type != type || (int)Main.tile[l, m].frameX != (l - num2) * 18 + num3 || (int)Main.tile[l, m].frameY != (m - num4) * 18) + { + flag = true; + } + } + } + if (type == 106 || type == 212 || type == 219 || type == 220 || type == 228 || type == 231 || type == 243 || type == 247) + { + for (int n = k; n < k + 3; n++) + { + if (Main.tile[n, num4 + 3] == null) + { + Main.tile[n, num4 + 3] = new Tile(); + } + if (!WorldGen.SolidTile2(n, num4 + 3)) + { + flag = true; + break; + } + } + } + else + { + if (Main.tile[k + 1, num4 - 1] == null) + { + Main.tile[k + 1, num4 - 1] = new Tile(); + } + if (!Main.tile[k + 1, num4 - 1].nactive() || !Main.tileSolid[(int)Main.tile[k + 1, num4 - 1].type] || Main.tileSolidTop[(int)Main.tile[k + 1, num4 - 1].type]) + { + flag = true; + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int num5 = k; num5 < k + 3; num5++) + { + for (int num6 = num4; num6 < num4 + 3; num6++) + { + if ((int)Main.tile[num5, num6].type == type && Main.tile[num5, num6].active()) + { + WorldGen.KillTile(num5, num6, false, false, false); + } + } + } + if (type == 34) + { + Item.NewItem(i * 16, j * 16, 32, 32, 106, 1, false, 0, false); + } + else + { + if (type == 35) + { + Item.NewItem(i * 16, j * 16, 32, 32, 107, 1, false, 0, false); + } + else + { + if (type == 36) + { + Item.NewItem(i * 16, j * 16, 32, 32, 108, 1, false, 0, false); + } + else + { + if (type == 106) + { + Item.NewItem(i * 16, j * 16, 32, 32, 363, 1, false, 0, false); + } + else + { + if (type == 243) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1430, 1, false, 0, false); + } + else + { + if (type == 170) + { + Item.NewItem(i * 16, j * 16, 32, 32, 710, 1, false, 0, false); + } + else + { + if (type == 171) + { + Item.NewItem(i * 16, j * 16, 32, 32, 711, 1, false, 0, false); + } + else + { + if (type == 172) + { + Item.NewItem(i * 16, j * 16, 32, 32, 712, 1, false, 0, false); + } + else + { + if (type == 212) + { + Item.NewItem(i * 16, j * 16, 32, 32, 951, 1, false, 0, false); + } + else + { + if (type == 219) + { + Item.NewItem(i * 16, j * 16, 32, 32, 997, 1, false, 0, false); + } + else + { + if (type == 220) + { + Item.NewItem(i * 16, j * 16, 32, 32, 998, 1, false, 0, false); + } + else + { + if (type == 228) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1120, 1, false, 0, false); + } + else + { + if (type == 247) + { + Item.NewItem(i * 16, j * 16, 32, 32, 1551, 1, false, 0, false); + } + else + { + if (type == 231) + { + int num7 = (i + 1) * 16 + 8; + int num8 = j * 16; + Gore.NewGore(new Vector2((float)num7, (float)num8), default(Vector2), 300, 1f); + Gore.NewGore(new Vector2((float)num7, (float)(num8 + 8)), default(Vector2), 301, 1f); + Gore.NewGore(new Vector2((float)num7, (float)(num8 + 16)), default(Vector2), 302, 1f); + float num9 = (float)(i * 16); + float num10 = (float)(j * 16); + float num11 = -1f; + int plr = 0; + for (int num12 = 0; num12 < 255; num12++) + { + if (Main.player[num12].active && !Main.player[num12].dead) + { + float num13 = Math.Abs(Main.player[num12].position.X - num9) + Math.Abs(Main.player[num12].position.Y - num10); + if (num13 < num11 || num11 == -1f) + { + plr = num12; + num11 = num13; + } + } + } + NPC.SpawnOnPlayer(plr, 222); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + WorldGen.destroyObject = false; + for (int num14 = k - 1; num14 < k + 4; num14++) + { + for (int num15 = num4 - 1; num15 < num4 + 4; num15++) + { + WorldGen.TileFrame(num14, num15, false, false); + } + } + } + } + public static void Place3x3(int x, int y, int type, int style = 0) + { + bool flag = true; + int num = 0; + if (type == 106 || type == 212 || type == 219 || type == 220 || type == 228 || type == 231 || type == 243 || type == 247) + { + num = -2; + for (int i = x - 1; i < x + 2; i++) + { + for (int j = y - 2; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + } + for (int k = x - 1; k < x + 2; k++) + { + if (Main.tile[k, y + 1] == null) + { + Main.tile[k, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(k, y + 1)) + { + flag = false; + break; + } + } + } + else + { + for (int l = x - 1; l < x + 2; l++) + { + for (int m = y; m < y + 3; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (Main.tile[l, m].active()) + { + flag = false; + } + } + } + if (Main.tile[x, y - 1] == null) + { + Main.tile[x, y - 1] = new Tile(); + } + if (!Main.tile[x, y - 1].nactive() || !Main.tileSolid[(int)Main.tile[x, y - 1].type] || Main.tileSolidTop[(int)Main.tile[x, y - 1].type]) + { + flag = false; + } + } + if (flag) + { + int num2 = style * 18 * 3; + Main.tile[x - 1, y + num].active(true); + Main.tile[x - 1, y + num].frameY = 0; + Main.tile[x - 1, y + num].frameX = (short)num2; + Main.tile[x - 1, y + num].type = (byte)type; + Main.tile[x, y + num].active(true); + Main.tile[x, y + num].frameY = 0; + Main.tile[x, y + num].frameX = (short)(num2 + 18); + Main.tile[x, y + num].type = (byte)type; + Main.tile[x + 1, y + num].active(true); + Main.tile[x + 1, y + num].frameY = 0; + Main.tile[x + 1, y + num].frameX = (short)(num2 + 36); + Main.tile[x + 1, y + num].type = (byte)type; + Main.tile[x - 1, y + 1 + num].active(true); + Main.tile[x - 1, y + 1 + num].frameY = 18; + Main.tile[x - 1, y + 1 + num].frameX = (short)num2; + Main.tile[x - 1, y + 1 + num].type = (byte)type; + Main.tile[x, y + 1 + num].active(true); + Main.tile[x, y + 1 + num].frameY = 18; + Main.tile[x, y + 1 + num].frameX = (short)(num2 + 18); + Main.tile[x, y + 1 + num].type = (byte)type; + Main.tile[x + 1, y + 1 + num].active(true); + Main.tile[x + 1, y + 1 + num].frameY = 18; + Main.tile[x + 1, y + 1 + num].frameX = (short)(num2 + 36); + Main.tile[x + 1, y + 1 + num].type = (byte)type; + Main.tile[x - 1, y + 2 + num].active(true); + Main.tile[x - 1, y + 2 + num].frameY = 36; + Main.tile[x - 1, y + 2 + num].frameX = (short)num2; + Main.tile[x - 1, y + 2 + num].type = (byte)type; + Main.tile[x, y + 2 + num].active(true); + Main.tile[x, y + 2 + num].frameY = 36; + Main.tile[x, y + 2 + num].frameX = (short)(num2 + 18); + Main.tile[x, y + 2 + num].type = (byte)type; + Main.tile[x + 1, y + 2 + num].active(true); + Main.tile[x + 1, y + 2 + num].frameY = 36; + Main.tile[x + 1, y + 2 + num].frameX = (short)(num2 + 36); + Main.tile[x + 1, y + 2 + num].type = (byte)type; + } + } + public static void PlaceSunflower(int x, int y, int type = 27) + { + if ((double)y > Main.worldSurface - 1.0) + { + return; + } + bool flag = true; + for (int i = x; i < x + 2; i++) + { + for (int j = y - 3; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active() || Main.tile[i, j].wall > 0) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!Main.tile[i, y + 1].nactive() || Main.tile[i, y + 1].halfBrick() || Main.tile[i, y + 1].slope() != 0 || (Main.tile[i, y + 1].type != 2 && Main.tile[i, y + 1].type != 109)) + { + flag = false; + } + } + if (flag) + { + int num = WorldGen.genRand.Next(3); + for (int k = 0; k < 2; k++) + { + for (int l = -3; l < 1; l++) + { + int num2 = k * 18 + WorldGen.genRand.Next(3) * 36; + if (l <= -2) + { + num2 = k * 18 + num * 36; + } + int num3 = (l + 3) * 18; + Main.tile[x + k, y + l].active(true); + Main.tile[x + k, y + l].frameX = (short)num2; + Main.tile[x + k, y + l].frameY = (short)num3; + Main.tile[x + k, y + l].type = (byte)type; + } + } + } + } + public static void FixSunflowers() + { + for (int i = 5; i < Main.maxTilesX - 5; i++) + { + int num = 5; + while ((double)num < Main.worldSurface) + { + if (Main.tile[i, num].active() && Main.tile[i, num].type == 27) + { + WorldGen.FixSunflower(i, num); + } + num++; + } + } + } + public static void FixSunflower(int i, int j) + { + if (Main.tile[i, j].type != 27) + { + return; + } + int k = 0; + k += (int)(Main.tile[i, j].frameX / 18); + int num = j + (int)(Main.tile[i, j].frameY / 18 * -1); + while (k > 1) + { + k -= 2; + } + k *= -1; + k += i; + int num2 = WorldGen.genRand.Next(3) * 36; + int num3 = 0; + for (int l = k; l < k + 2; l++) + { + for (int m = num; m < num + 4; m++) + { + Main.tile[l, m].frameX = (short)(num3 + num2); + } + num3 += 18; + } + } + public static void CheckSunflower(int i, int j, int type = 27) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int k = 0; + k += (int)(Main.tile[i, j].frameX / 18); + int num = j + (int)(Main.tile[i, j].frameY / 18 * -1); + while (k > 1) + { + k -= 2; + } + k *= -1; + k += i; + for (int l = k; l < k + 2; l++) + { + for (int m = num; m < num + 4; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + int n; + for (n = (int)(Main.tile[l, m].frameX / 18); n > 1; n -= 2) + { + } + if (!Main.tile[l, m].nactive() || (int)Main.tile[l, m].type != type || n != l - k || (int)Main.tile[l, m].frameY != (m - num) * 18) + { + flag = true; + } + } + if (Main.tile[l, num + 4] == null) + { + Main.tile[l, num + 4] = new Tile(); + } + if (!Main.tile[l, num + 4].nactive() || (Main.tile[l, num + 4].type != 2 && Main.tile[l, num + 4].type != 109)) + { + flag = true; + } + if (!WorldGen.SolidTile(l, num + 4)) + { + flag = true; + } + } + if (flag) + { + WorldGen.destroyObject = true; + for (int num2 = k; num2 < k + 2; num2++) + { + for (int num3 = num; num3 < num + 4; num3++) + { + if ((int)Main.tile[num2, num3].type == type && Main.tile[num2, num3].active()) + { + WorldGen.KillTile(num2, num3, false, false, false); + } + } + } + Item.NewItem(i * 16, j * 16, 32, 32, 63, 1, false, 0, false); + WorldGen.destroyObject = false; + } + } + public static void CheckDye(int x, int y) + { + int num = (int)(Main.tile[x, y].frameX / 34); + if (num == 7) + { + if (!WorldGen.SolidTile(x, y - 1)) + { + WorldGen.KillTile(x, y, false, false, false); + return; + } + } + else + { + if (num == 6) + { + if (!Main.tile[x, y + 1].nactive() || Main.tile[x, y + 1].type != 80) + { + WorldGen.KillTile(x, y, false, false, false); + return; + } + } + else + { + if (!WorldGen.SolidTile(x, y + 1)) + { + WorldGen.KillTile(x, y, false, false, false); + } + } + } + } + public static void PlaceDye(int x, int y, int style) + { + bool flag = false; + if (style == 7) + { + if (Main.tile[x, y + 1].active() && Main.tile[x, y + 1].type != 3 && Main.tile[x, y + 1].type != 51 && Main.tile[x, y + 1].type != 61 && Main.tile[x, y + 1].type != 73 && Main.tile[x, y + 1].type != 74 && Main.tile[x, y + 1].type != 184) + { + return; + } + if (WorldGen.SolidTile(x, y - 1) && !Main.tile[x, y + 1].active()) + { + flag = true; + } + } + else + { + if (Main.tile[x, y - 1].active() && Main.tile[x, y - 1].type != 3 && Main.tile[x, y - 1].type != 51 && Main.tile[x, y - 1].type != 61 && Main.tile[x, y - 1].type != 73 && Main.tile[x, y - 1].type != 74 && Main.tile[x, y - 1].type != 184) + { + return; + } + if (style == 6) + { + if (Main.tile[x, y + 1].nactive() && Main.tile[x, y + 1].type == 80 && !Main.tile[x - 1, y + 1].active() && !Main.tile[x + 1, y + 1].active()) + { + flag = true; + } + } + else + { + if (WorldGen.SolidTile(x, y + 1) && !Main.tile[x, y - 1].active()) + { + if (style == 5) + { + if (Main.tile[x, y].liquid == 255) + { + flag = true; + } + } + else + { + if (Main.tile[x, y].liquid == 0) + { + if (style == 3 || style == 4) + { + if (Main.tile[x, y].wall == 0) + { + flag = true; + } + } + else + { + flag = true; + } + } + } + } + } + } + if (flag) + { + Main.tile[x, y].type = 227; + Main.tile[x, y].active(true); + Main.tile[x, y].halfBrick(false); + Main.tile[x, y].slope(0); + Main.tile[x, y].frameY = 0; + Main.tile[x, y].frameX = (short)(34 * style); + } + } + public static bool PlacePot(int x, int y, int type = 28, int style = 0) + { + bool flag = true; + for (int i = x; i < x + 2; i++) + { + for (int j = y - 1; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!Main.tile[i, y + 1].nactive() || Main.tile[i, y + 1].halfBrick() || Main.tile[i, y + 1].slope() != 0 || !Main.tileSolid[(int)Main.tile[i, y + 1].type]) + { + flag = false; + } + } + if (flag) + { + int num = WorldGen.genRand.Next(3) * 36; + for (int k = 0; k < 2; k++) + { + for (int l = -1; l < 1; l++) + { + int num2 = k * 18 + num; + int num3 = (l + 1) * 18; + Main.tile[x + k, y + l].active(true); + Main.tile[x + k, y + l].frameX = (short)num2; + Main.tile[x + k, y + l].frameY = (short)(num3 + style * 36); + Main.tile[x + k, y + l].type = (byte)type; + Main.tile[x + k, y + l].halfBrick(false); + } + } + return true; + } + return false; + } + public static bool CheckCactus(int i, int j) + { + int num = j; + int num2 = i; + while (Main.tile[num2, num].active() && Main.tile[num2, num].type == 80) + { + num++; + if (!Main.tile[num2, num].active() || Main.tile[num2, num].type != 80) + { + if (Main.tile[num2 - 1, num].active() && Main.tile[num2 - 1, num].type == 80 && Main.tile[num2 - 1, num - 1].active() && Main.tile[num2 - 1, num - 1].type == 80 && num2 >= i) + { + num2--; + } + if (Main.tile[num2 + 1, num].active() && Main.tile[num2 + 1, num].type == 80 && Main.tile[num2 + 1, num - 1].active() && Main.tile[num2 + 1, num - 1].type == 80 && num2 <= i) + { + num2++; + } + } + } + if (!Main.tile[num2, num].nactive() || Main.tile[num2, num].halfBrick() || Main.tile[num2, num].slope() != 0 || (Main.tile[num2, num].type != 53 && Main.tile[num2, num].type != 112 && Main.tile[num2, num].type != 116 && Main.tile[num2, num].type != 234)) + { + WorldGen.KillTile(i, j, false, false, false); + return true; + } + if (i != num2) + { + if ((!Main.tile[i, j + 1].active() || Main.tile[i, j + 1].type != 80) && (!Main.tile[i - 1, j].active() || Main.tile[i - 1, j].type != 80) && (!Main.tile[i + 1, j].active() || Main.tile[i + 1, j].type != 80)) + { + WorldGen.KillTile(i, j, false, false, false); + return true; + } + } + else + { + if (i == num2 && (!Main.tile[i, j + 1].active() || (Main.tile[i, j + 1].type != 80 && Main.tile[i, j + 1].type != 53 && Main.tile[i, j + 1].type != 112 && Main.tile[i, j + 1].type != 116 && Main.tile[i, j + 1].type != 234))) + { + WorldGen.KillTile(i, j, false, false, false); + return true; + } + } + return false; + } + public static void PlantCactus(int i, int j) + { + WorldGen.GrowCactus(i, j); + for (int k = 0; k < 150; k++) + { + int i2 = WorldGen.genRand.Next(i - 1, i + 2); + int j2 = WorldGen.genRand.Next(j - 10, j + 2); + WorldGen.GrowCactus(i2, j2); + } + } + public static void CheckOrb(int i, int j, int type) + { + int frameX = (int)Main.tile[i, j].frameX; + bool flag = false; + if (frameX >= 36) + { + flag = true; + } + if (!WorldGen.destroyObject) + { + int num; + if (Main.tile[i, j].frameX == 0 || Main.tile[i, j].frameX == 36) + { + num = i; + } + else + { + num = i - 1; + } + int num2; + if (Main.tile[i, j].frameY == 0) + { + num2 = j; + } + else + { + num2 = j - 1; + } + if (Main.tile[num, num2] != null && Main.tile[num + 1, num2] != null && Main.tile[num, num2 + 1] != null && Main.tile[num + 1, num2 + 1] != null && (!Main.tile[num, num2].active() || (int)Main.tile[num, num2].type != type || !Main.tile[num + 1, num2].active() || (int)Main.tile[num + 1, num2].type != type || !Main.tile[num, num2 + 1].active() || (int)Main.tile[num, num2 + 1].type != type || !Main.tile[num + 1, num2 + 1].active() || (int)Main.tile[num + 1, num2 + 1].type != type)) + { + WorldGen.destroyObject = true; + if ((int)Main.tile[num, num2].type == type) + { + WorldGen.KillTile(num, num2, false, false, false); + } + if ((int)Main.tile[num + 1, num2].type == type) + { + WorldGen.KillTile(num + 1, num2, false, false, false); + } + if ((int)Main.tile[num, num2 + 1].type == type) + { + WorldGen.KillTile(num, num2 + 1, false, false, false); + } + if ((int)Main.tile[num + 1, num2 + 1].type == type) + { + WorldGen.KillTile(num + 1, num2 + 1, false, false, false); + } + if (Main.netMode != 1 && !WorldGen.noTileActions) + { + if (type == 12) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 29, 1, false, 0, false); + } + else + { + if (type == 31) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.spawnMeteor = true; + } + if (flag) + { + int num3 = Main.rand.Next(4); + if (!WorldGen.shadowOrbSmashed) + { + num3 = 0; + } + if (num3 == 0) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 800, 1, false, -1, false); + int stack = WorldGen.genRand.Next(25, 51); + Item.NewItem(num * 16, num2 * 16, 32, 32, 97, stack, false, 0, false); + } + else + { + if (num3 == 1) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 1256, 1, false, -1, false); + } + else + { + if (num3 == 2) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 802, 1, false, -1, false); + } + else + { + if (num3 == 3) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 1290, 1, false, -1, false); + } + } + } + } + } + else + { + int num4 = Main.rand.Next(5); + if (!WorldGen.shadowOrbSmashed) + { + num4 = 0; + } + if (num4 == 0) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 96, 1, false, -1, false); + int stack2 = WorldGen.genRand.Next(25, 51); + Item.NewItem(num * 16, num2 * 16, 32, 32, 97, stack2, false, 0, false); + } + else + { + if (num4 == 1) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 64, 1, false, -1, false); + } + else + { + if (num4 == 2) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 162, 1, false, -1, false); + } + else + { + if (num4 == 3) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 115, 1, false, -1, false); + } + else + { + if (num4 == 4) + { + Item.NewItem(num * 16, num2 * 16, 32, 32, 111, 1, false, -1, false); + } + } + } + } + } + } + WorldGen.shadowOrbSmashed = true; + WorldGen.shadowOrbCount++; + if (WorldGen.shadowOrbCount >= 3) + { + WorldGen.shadowOrbCount = 0; + float num5 = (float)(num * 16); + float num6 = (float)(num2 * 16); + float num7 = -1f; + int plr = 0; + for (int k = 0; k < 255; k++) + { + float num8 = Math.Abs(Main.player[k].position.X - num5) + Math.Abs(Main.player[k].position.Y - num6); + if (num8 < num7 || num7 == -1f) + { + plr = k; + num7 = num8; + } + } + if (flag) + { + NPC.SpawnOnPlayer(plr, 266); + } + else + { + NPC.SpawnOnPlayer(plr, 13); + } + } + else + { + string text = Lang.misc[10]; + if (WorldGen.shadowOrbCount == 2) + { + text = Lang.misc[11]; + } + if (Main.netMode == 0) + { + Main.NewText(text, 50, 255, 130, false); + } + else + { + if (Main.netMode == 2) + { + NetMessage.SendData(25, -1, -1, text, 255, 50f, 255f, 130f, 0); + } + } + } + } + } + } + if (frameX >= 36) + { + Main.PlaySound(4, i * 16, j * 16, 1); + } + else + { + Main.PlaySound(13, i * 16, j * 16, 1); + } + WorldGen.destroyObject = false; + } + } + } + public static void CheckTree(int i, int j) + { + int num = -1; + int num2 = -1; + int num3 = -1; + int num4 = -1; + int type = (int)Main.tile[i, j].type; + int frameX = (int)Main.tile[i, j].frameX; + int frameY = (int)Main.tile[i, j].frameY; + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].active()) + { + num2 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].active()) + { + num3 = (int)Main.tile[i + 1, j].type; + } + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active()) + { + num = (int)Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active()) + { + num4 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].active()) + { + byte arg_163_0 = Main.tile[i - 1, j - 1].type; + } + if (Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].active()) + { + byte arg_1A2_0 = Main.tile[i + 1, j - 1].type; + } + if (Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].active()) + { + byte arg_1E1_0 = Main.tile[i - 1, j + 1].type; + } + if (Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].active()) + { + byte arg_220_0 = Main.tile[i + 1, j + 1].type; + } + if (num4 == 23) + { + num4 = 2; + } + if (num4 == 60) + { + num4 = 2; + } + if (num4 == 70) + { + num4 = 2; + } + if (num4 == 109) + { + num4 = 2; + } + if (num4 == 147) + { + num4 = 2; + } + if (num4 == 199) + { + num4 = 2; + } + if (num4 != 2 && num4 != type && ((Main.tile[i, j].frameX == 0 && Main.tile[i, j].frameY <= 130) || (Main.tile[i, j].frameX == 22 && Main.tile[i, j].frameY <= 130) || (Main.tile[i, j].frameX == 44 && Main.tile[i, j].frameY <= 130))) + { + WorldGen.KillTile(i, j, false, false, false); + } + if (Main.tile[i, j].frameX >= 22 && Main.tile[i, j].frameX <= 44 && Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176) + { + if (num4 != 2) + { + WorldGen.KillTile(i, j, false, false, false); + } + else + { + if ((Main.tile[i, j].frameX != 22 || num2 != type) && (Main.tile[i, j].frameX != 44 || num3 != type)) + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + else + { + if ((Main.tile[i, j].frameX == 88 && Main.tile[i, j].frameY >= 0 && Main.tile[i, j].frameY <= 44) || (Main.tile[i, j].frameX == 66 && Main.tile[i, j].frameY >= 66 && Main.tile[i, j].frameY <= 130) || (Main.tile[i, j].frameX == 110 && Main.tile[i, j].frameY >= 66 && Main.tile[i, j].frameY <= 110) || (Main.tile[i, j].frameX == 132 && Main.tile[i, j].frameY >= 0 && Main.tile[i, j].frameY <= 176)) + { + if (num2 == type && num3 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 66; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 88; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (num2 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 22; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num3 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 66; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 88; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 110; + } + } + else + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 22; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 44; + } + } + } + } + } + } + if (Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176 && (Main.tile[i, j].frameX == 0 || Main.tile[i, j].frameX == 66 || Main.tile[i, j].frameX == 88)) + { + if (num4 != 2) + { + WorldGen.KillTile(i, j, false, false, false); + } + if (num2 != type && num3 != type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 22; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num2 != type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 132; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 154; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 176; + } + } + else + { + if (num3 != type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 132; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 154; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 66; + Main.tile[i, j].frameY = 176; + } + } + else + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 132; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 154; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 88; + Main.tile[i, j].frameY = 176; + } + } + } + } + } + if ((Main.tile[i, j].frameX == 66 && (Main.tile[i, j].frameY == 0 || Main.tile[i, j].frameY == 22 || Main.tile[i, j].frameY == 44)) || (Main.tile[i, j].frameX == 44 && (Main.tile[i, j].frameY == 198 || Main.tile[i, j].frameY == 220 || Main.tile[i, j].frameY == 242))) + { + if (num3 != type) + { + WorldGen.KillTile(i, j, false, false, false); + } + } + else + { + if ((Main.tile[i, j].frameX == 88 && (Main.tile[i, j].frameY == 66 || Main.tile[i, j].frameY == 88 || Main.tile[i, j].frameY == 110)) || (Main.tile[i, j].frameX == 66 && (Main.tile[i, j].frameY == 198 || Main.tile[i, j].frameY == 220 || Main.tile[i, j].frameY == 242))) + { + if (num2 != type) + { + WorldGen.KillTile(i, j, false, false, false); + } + } + else + { + if (num4 == -1 || num4 == 23) + { + WorldGen.KillTile(i, j, false, false, false); + } + else + { + if (num != type && Main.tile[i, j].frameY < 198 && ((Main.tile[i, j].frameX != 22 && Main.tile[i, j].frameX != 44) || Main.tile[i, j].frameY < 132)) + { + if (num2 == type || num3 == type) + { + if (num4 == type) + { + if (num2 == type && num3 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 132; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 154; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 176; + } + } + else + { + if (num2 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 22; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num3 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 66; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 88; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 132; + Main.tile[i, j].frameY = 110; + } + } + } + } + } + else + { + if (num2 == type && num3 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 132; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 154; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 176; + } + } + else + { + if (num2 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 22; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 44; + } + } + else + { + if (num3 == type) + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 66; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 88; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 154; + Main.tile[i, j].frameY = 110; + } + } + } + } + } + } + else + { + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 22; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 110; + Main.tile[i, j].frameY = 44; + } + } + } + } + } + } + if ((int)Main.tile[i, j].frameX != frameX && (int)Main.tile[i, j].frameY != frameY && frameX >= 0 && frameY >= 0) + { + WorldGen.TileFrame(i - 1, j, false, false); + WorldGen.TileFrame(i + 1, j, false, false); + WorldGen.TileFrame(i, j - 1, false, false); + WorldGen.TileFrame(i, j + 1, false, false); + } + } + public static void Convert(int i, int j, int type, int size = 4) + { + for (int k = i - size; k <= i + size; k++) + { + for (int l = j - size; l <= j + size; l++) + { + if (Math.Abs(k - i) + Math.Abs(l - j) < 6) + { + if (type == 4) + { + if (Main.tile[k, l].wall == 63 || Main.tile[k, l].wall == 64 || Main.tile[k, l].wall == 65 || Main.tile[k, l].wall == 66 || Main.tile[k, l].wall == 67 || Main.tile[k, l].wall == 68 || Main.tile[k, l].wall == 69 || Main.tile[k, l].wall == 70) + { + Main.tile[k, l].wall = 81; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].wall == 3 || Main.tile[k, l].wall == 1 || Main.tile[k, l].wall == 28) + { + Main.tile[k, l].wall = 83; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + } + if (Main.tile[k, l].type == 59 && (Main.tile[k - 1, l].type == 199 || Main.tile[k + 1, l].type == 199 || Main.tile[k, l - 1].type == 199 || Main.tile[k, l + 1].type == 199)) + { + Main.tile[k, l].type = 0; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + if (Main.tile[k, l].type == 2 || Main.tile[k, l].type == 60 || Main.tile[k, l].type == 109 || Main.tile[k, l].type == 23) + { + Main.tile[k, l].type = 199; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 1 || Main.tile[k, l].type == 25 || Main.tile[k, l].type == 117 || Main.tileMoss[(int)Main.tile[k, l].type]) + { + Main.tile[k, l].type = 203; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 161 || Main.tile[k, l].type == 163 || Main.tile[k, l].type == 164) + { + Main.tile[k, l].type = 200; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 112 || Main.tile[k, l].type == 116) + { + Main.tile[k, l].type = 234; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 32 || Main.tile[k, l].type == 69) + { + WorldGen.KillTile(k, l, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)k, (float)l, 0f, 0); + } + } + } + } + } + } + } + else + { + if (type == 2) + { + if (Main.tile[k, l].wall == 63 || Main.tile[k, l].wall == 64 || Main.tile[k, l].wall == 65 || Main.tile[k, l].wall == 66 || Main.tile[k, l].wall == 67 || Main.tile[k, l].wall == 68 || Main.tile[k, l].wall == 69 || Main.tile[k, l].wall == 81) + { + Main.tile[k, l].wall = 70; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].wall == 3 || Main.tile[k, l].wall == 1 || Main.tile[k, l].wall == 83) + { + Main.tile[k, l].wall = 28; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + } + if (Main.tile[k, l].type == 59) + { + if (Main.tile[k - 1, l].type == 109 || Main.tile[k + 1, l].type == 109 || Main.tile[k, l - 1].type == 109 || Main.tile[k, l + 1].type == 109) + { + Main.tile[k, l].type = 0; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + } + else + { + if (Main.tile[k, l].type == 2 || Main.tile[k, l].type == 60 || Main.tile[k, l].type == 199) + { + Main.tile[k, l].type = 109; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 1 || Main.tileMoss[(int)Main.tile[k, l].type] || Main.tile[k, l].type == 203) + { + Main.tile[k, l].type = 117; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 234) + { + Main.tile[k, l].type = 116; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 23) + { + Main.tile[k, l].type = 109; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 25) + { + Main.tile[k, l].type = 117; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 112) + { + Main.tile[k, l].type = 116; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 161 || Main.tile[k, l].type == 163 || Main.tile[k, l].type == 200) + { + Main.tile[k, l].type = 164; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 32 || Main.tile[k, l].type == 69) + { + WorldGen.KillTile(k, l, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)k, (float)l, 0f, 0); + } + } + } + } + } + } + } + } + } + } + } + else + { + if (type == 1) + { + if (Main.tile[k, l].wall == 63 || Main.tile[k, l].wall == 64 || Main.tile[k, l].wall == 65 || Main.tile[k, l].wall == 66 || Main.tile[k, l].wall == 67 || Main.tile[k, l].wall == 68 || Main.tile[k, l].wall == 70 || Main.tile[k, l].wall == 81) + { + Main.tile[k, l].wall = 69; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].wall == 28 || Main.tile[k, l].wall == 1 || Main.tile[k, l].wall == 83) + { + Main.tile[k, l].wall = 3; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + } + if (Main.tile[k, l].type == 59) + { + if (Main.tile[k - 1, l].type == 23 || Main.tile[k + 1, l].type == 23 || Main.tile[k, l - 1].type == 23 || Main.tile[k, l + 1].type == 23) + { + Main.tile[k, l].type = 0; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + } + else + { + if (Main.tile[k, l].type == 2 || Main.tile[k, l].type == 60 || Main.tile[k, l].type == 199) + { + Main.tile[k, l].type = 23; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 1 || Main.tileMoss[(int)Main.tile[k, l].type] || Main.tile[k, l].type == 203) + { + Main.tile[k, l].type = 25; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 234) + { + Main.tile[k, l].type = 112; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 109) + { + Main.tile[k, l].type = 23; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 117) + { + Main.tile[k, l].type = 25; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 116) + { + Main.tile[k, l].type = 112; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 161 || Main.tile[k, l].type == 164 || Main.tile[k, l].type == 200) + { + Main.tile[k, l].type = 163; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 69) + { + WorldGen.KillTile(k, l, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)k, (float)l, 0f, 0); + } + } + } + } + } + } + } + } + } + } + } + else + { + if (type == 3) + { + if (Main.tile[k, l].wall == 64 || Main.tile[k, l].wall == 15) + { + Main.tile[k, l].wall = 80; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 3); + } + if (Main.tile[k, l].type == 60) + { + Main.tile[k, l].type = 70; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 3); + } + else + { + if (Main.tile[k, l].type == 32 || Main.tile[k, l].type == 69) + { + WorldGen.KillTile(k, l, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)k, (float)l, 0f, 0); + } + } + } + } + else + { + if (Main.tile[k, l].wall == 69 || Main.tile[k, l].wall == 70 || Main.tile[k, l].wall == 81) + { + if ((double)l < Main.worldSurface) + { + if (Main.rand.Next(10) == 0) + { + Main.tile[k, l].wall = 65; + } + else + { + Main.tile[k, l].wall = 63; + } + } + else + { + Main.tile[k, l].wall = 64; + } + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].wall == 3 || Main.tile[k, l].wall == 28 || Main.tile[k, l].wall == 83) + { + Main.tile[k, l].wall = 1; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].wall == 80) + { + if ((double)l < Main.worldSurface + 4.0 + (double)WorldGen.genRand.Next(3) || (double)l > ((double)Main.maxTilesY + Main.rockLayer) / 2.0 - 3.0 + (double)WorldGen.genRand.Next(3)) + { + Main.tile[k, l].wall = 15; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 3); + } + else + { + Main.tile[k, l].wall = 64; + WorldGen.SquareWallFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 3); + } + } + } + } + if (Main.tile[k, l].type == 23 || Main.tile[k, l].type == 109 || Main.tile[k, l].type == 199) + { + Main.tile[k, l].type = 2; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 117 || Main.tile[k, l].type == 25 || Main.tile[k, l].type == 203) + { + Main.tile[k, l].type = 1; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 112 || Main.tile[k, l].type == 116 || Main.tile[k, l].type == 234) + { + Main.tile[k, l].type = 53; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 164 || Main.tile[k, l].type == 163 || Main.tile[k, l].type == 200) + { + Main.tile[k, l].type = 161; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 70) + { + Main.tile[k, l].type = 60; + WorldGen.SquareTileFrame(k, l, true); + NetMessage.SendTileSquare(-1, k, l, 1); + } + else + { + if (Main.tile[k, l].type == 32) + { + WorldGen.KillTile(k, l, false, false, false); + if (Main.netMode == 1) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)k, (float)l, 0f, 0); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + public static void CactusFrame(int i, int j) + { + try + { + int num = j; + int num2 = i; + if (!WorldGen.CheckCactus(i, j)) + { + while (Main.tile[num2, num].active() && Main.tile[num2, num].type == 80) + { + num++; + if (!Main.tile[num2, num].active() || Main.tile[num2, num].type != 80) + { + if (Main.tile[num2 - 1, num].active() && Main.tile[num2 - 1, num].type == 80 && Main.tile[num2 - 1, num - 1].active() && Main.tile[num2 - 1, num - 1].type == 80 && num2 >= i) + { + num2--; + } + if (Main.tile[num2 + 1, num].active() && Main.tile[num2 + 1, num].type == 80 && Main.tile[num2 + 1, num - 1].active() && Main.tile[num2 + 1, num - 1].type == 80 && num2 <= i) + { + num2++; + } + } + } + num--; + int num3 = i - num2; + int type = (int)Main.tile[i - 2, j].type; + int num4 = (int)Main.tile[i - 1, j].type; + int num5 = (int)Main.tile[i + 1, j].type; + int num6 = (int)Main.tile[i, j - 1].type; + if (num6 == 227) + { + num6 = 80; + } + int num7 = (int)Main.tile[i, j + 1].type; + int num8 = (int)Main.tile[i - 1, j + 1].type; + int num9 = (int)Main.tile[i + 1, j + 1].type; + if (!Main.tile[i - 1, j].active()) + { + num4 = -1; + } + if (!Main.tile[i + 1, j].active()) + { + num5 = -1; + } + if (!Main.tile[i, j - 1].active()) + { + num6 = -1; + } + if (!Main.tile[i, j + 1].active()) + { + num7 = -1; + } + if (!Main.tile[i - 1, j + 1].active()) + { + num8 = -1; + } + if (!Main.tile[i + 1, j + 1].active()) + { + num9 = -1; + } + short num10 = Main.tile[i, j].frameX; + short num11 = Main.tile[i, j].frameY; + if (num3 == 0) + { + if (num6 != 80) + { + if (num4 == 80 && num5 == 80 && num8 != 80 && num9 != 80 && type != 80) + { + num10 = 90; + num11 = 0; + } + else + { + if (num4 == 80 && num8 != 80 && type != 80) + { + num10 = 72; + num11 = 0; + } + else + { + if (num5 == 80 && num9 != 80) + { + num10 = 18; + num11 = 0; + } + else + { + num10 = 0; + num11 = 0; + } + } + } + } + else + { + if (num4 == 80 && num5 == 80 && num8 != 80 && num9 != 80 && type != 80) + { + num10 = 90; + num11 = 36; + } + else + { + if (num4 == 80 && num8 != 80 && type != 80) + { + num10 = 72; + num11 = 36; + } + else + { + if (num5 == 80 && num9 != 80) + { + num10 = 18; + num11 = 36; + } + else + { + if (num7 >= 0 && Main.tileSolid[num7]) + { + num10 = 0; + num11 = 36; + } + else + { + num10 = 0; + num11 = 18; + } + } + } + } + } + } + else + { + if (num3 == -1) + { + if (num5 == 80) + { + if (num6 != 80 && num7 != 80) + { + num10 = 108; + num11 = 36; + } + else + { + if (num7 != 80) + { + num10 = 54; + num11 = 36; + } + else + { + if (num6 != 80) + { + num10 = 54; + num11 = 0; + } + else + { + num10 = 54; + num11 = 18; + } + } + } + } + else + { + if (num6 != 80) + { + num10 = 54; + num11 = 0; + } + else + { + num10 = 54; + num11 = 18; + } + } + } + else + { + if (num3 == 1) + { + if (num4 == 80) + { + if (num6 != 80 && num7 != 80) + { + num10 = 108; + num11 = 18; + } + else + { + if (num7 != 80) + { + num10 = 36; + num11 = 36; + } + else + { + if (num6 != 80) + { + num10 = 36; + num11 = 0; + } + else + { + num10 = 36; + num11 = 18; + } + } + } + } + else + { + if (num6 != 80) + { + num10 = 36; + num11 = 0; + } + else + { + num10 = 36; + num11 = 18; + } + } + } + } + } + if (num10 != Main.tile[i, j].frameX || num11 != Main.tile[i, j].frameY) + { + Main.tile[i, j].frameX = num10; + Main.tile[i, j].frameY = num11; + WorldGen.DiamondTileFrame(i, j); + } + } + } + catch + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + } + public static void GrowCactus(int i, int j) + { + int num = j; + int num2 = i; + if (!Main.tile[i, j].nactive()) + { + return; + } + if (Main.tile[i, j].halfBrick()) + { + return; + } + if (Main.tile[i, j].slope() != 0) + { + return; + } + if (Main.tile[i, j - 1].liquid > 0) + { + return; + } + if (Main.tile[i, j].type != 53 && Main.tile[i, j].type != 80 && Main.tile[i, j].type != 234 && Main.tile[i, j].type != 112 && Main.tile[i, j].type != 116) + { + return; + } + if (Main.tile[i, j].type == 53 || Main.tile[i, j].type == 112 || Main.tile[i, j].type == 116 || Main.tile[i, j].type == 234) + { + if (Main.tile[i, j - 1].active() || Main.tile[i - 1, j - 1].active() || Main.tile[i + 1, j - 1].active()) + { + return; + } + int num3 = 0; + int num4 = 0; + for (int k = i - 6; k <= i + 6; k++) + { + for (int l = j - 3; l <= j + 1; l++) + { + try + { + if (Main.tile[k, l].active()) + { + if (Main.tile[k, l].type == 80) + { + num3++; + if (num3 >= 4) + { + return; + } + } + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 112 || Main.tile[k, l].type == 116 || Main.tile[k, l].type == 234) + { + num4++; + } + } + } + catch + { + } + } + } + if (num4 > 10) + { + Main.tile[i, j - 1].active(true); + Main.tile[i, j - 1].type = 80; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, j - 1, 1); + } + WorldGen.SquareTileFrame(num2, num - 1, true); + return; + } + return; + } + else + { + if (Main.tile[i, j].type != 80) + { + return; + } + while (Main.tile[num2, num].active() && Main.tile[num2, num].type == 80) + { + num++; + if (!Main.tile[num2, num].active() || Main.tile[num2, num].type != 80) + { + if (Main.tile[num2 - 1, num].active() && Main.tile[num2 - 1, num].type == 80 && Main.tile[num2 - 1, num - 1].active() && Main.tile[num2 - 1, num - 1].type == 80 && num2 >= i) + { + num2--; + } + if (Main.tile[num2 + 1, num].active() && Main.tile[num2 + 1, num].type == 80 && Main.tile[num2 + 1, num - 1].active() && Main.tile[num2 + 1, num - 1].type == 80 && num2 <= i) + { + num2++; + } + } + } + num--; + int num5 = num - j; + int num6 = i - num2; + num2 = i - num6; + num = j; + int num7 = 11 - num5; + int num8 = 0; + for (int m = num2 - 2; m <= num2 + 2; m++) + { + for (int n = num - num7; n <= num + num5; n++) + { + if (Main.tile[m, n].active() && Main.tile[m, n].type == 80) + { + num8++; + } + } + } + if (num8 < WorldGen.genRand.Next(11, 13)) + { + num2 = i; + num = j; + if (num6 == 0) + { + if (num5 == 0) + { + if (Main.tile[num2, num - 1].active()) + { + return; + } + Main.tile[num2, num - 1].active(true); + Main.tile[num2, num - 1].type = 80; + WorldGen.SquareTileFrame(num2, num - 1, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num2, num - 1, 1); + return; + } + return; + } + else + { + bool flag = false; + bool flag2 = false; + if (Main.tile[num2, num - 1].active() && Main.tile[num2, num - 1].type == 80) + { + if (!Main.tile[num2 - 1, num].active() && !Main.tile[num2 - 2, num + 1].active() && !Main.tile[num2 - 1, num - 1].active() && !Main.tile[num2 - 1, num + 1].active() && !Main.tile[num2 - 2, num].active()) + { + flag = true; + } + if (!Main.tile[num2 + 1, num].active() && !Main.tile[num2 + 2, num + 1].active() && !Main.tile[num2 + 1, num - 1].active() && !Main.tile[num2 + 1, num + 1].active() && !Main.tile[num2 + 2, num].active()) + { + flag2 = true; + } + } + int num9 = WorldGen.genRand.Next(3); + if (num9 == 0 && flag) + { + Main.tile[num2 - 1, num].active(true); + Main.tile[num2 - 1, num].type = 80; + WorldGen.SquareTileFrame(num2 - 1, num, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num2 - 1, num, 1); + return; + } + return; + } + else + { + if (num9 == 1 && flag2) + { + Main.tile[num2 + 1, num].active(true); + Main.tile[num2 + 1, num].type = 80; + WorldGen.SquareTileFrame(num2 + 1, num, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num2 + 1, num, 1); + return; + } + return; + } + else + { + if (num5 >= WorldGen.genRand.Next(2, 8)) + { + return; + } + if (Main.tile[num2 - 1, num - 1].active()) + { + byte arg_6E3_0 = Main.tile[num2 - 1, num - 1].type; + } + if (Main.tile[num2 + 1, num - 1].active() && Main.tile[num2 + 1, num - 1].type == 80) + { + return; + } + if (Main.tile[num2, num - 1].active()) + { + return; + } + Main.tile[num2, num - 1].active(true); + Main.tile[num2, num - 1].type = 80; + WorldGen.SquareTileFrame(num2, num - 1, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num2, num - 1, 1); + return; + } + return; + } + } + } + } + else + { + if (Main.tile[num2, num - 1].active() || Main.tile[num2, num - 2].active() || Main.tile[num2 + num6, num - 1].active() || !Main.tile[num2 - num6, num - 1].active() || Main.tile[num2 - num6, num - 1].type != 80) + { + return; + } + Main.tile[num2, num - 1].active(true); + Main.tile[num2, num - 1].type = 80; + WorldGen.SquareTileFrame(num2, num - 1, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num2, num - 1, 1); + return; + } + return; + } + } + } + } + public static void CheckPot(int i, int j, int type = 28) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int k = 0; + for (k += (int)(Main.tile[i, j].frameX / 18); k > 1; k -= 2) + { + } + k *= -1; + k += i; + int l = (int)(Main.tile[i, j].frameY / 18); + int num = 0; + while (l > 1) + { + l -= 2; + num++; + } + int num2 = j - l; + for (int m = k; m < k + 2; m++) + { + for (int n = num2; n < num2 + 2; n++) + { + if (Main.tile[m, n] == null) + { + Main.tile[m, n] = new Tile(); + } + int num3; + for (num3 = (int)(Main.tile[m, n].frameX / 18); num3 > 1; num3 -= 2) + { + } + if (!Main.tile[m, n].active() || (int)Main.tile[m, n].type != type || num3 != m - k || (int)Main.tile[m, n].frameY != (n - num2) * 18 + num * 36) + { + flag = true; + } + } + if (Main.tile[m, num2 + 2] == null) + { + Main.tile[m, num2 + 2] = new Tile(); + } + if (!WorldGen.SolidTile2(m, num2 + 2)) + { + flag = true; + } + } + if (flag) + { + WorldGen.destroyObject = true; + if (num >= 7 && num <= 9) + { + Main.PlaySound(6, i * 16, j * 16, 1); + } + else + { + if (num >= 16 && num <= 24) + { + Main.PlaySound(4, i * 16, j * 16, 1); + } + else + { + Main.PlaySound(13, i * 16, j * 16, 1); + } + } + for (int num4 = k; num4 < k + 2; num4++) + { + for (int num5 = num2; num5 < num2 + 2; num5++) + { + if ((int)Main.tile[num4, num5].type == type && Main.tile[num4, num5].active()) + { + WorldGen.KillTile(num4, num5, false, false, false); + } + } + } + if (num == 0) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 51, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 52, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 53, 1f); + } + else + { + if (num == 1) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 166, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 167, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 168, 1f); + } + else + { + if (num == 2) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 169, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 170, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 171, 1f); + } + else + { + if (num == 3) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 172, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 173, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 174, 1f); + } + else + { + if (num >= 4 && num <= 6) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 197, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 198, 1f); + } + else + { + if (num >= 7 && num <= 9) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 199, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 200, 1f); + } + else + { + if (num >= 10 && num <= 12) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 201, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 202, 1f); + } + else + { + if (num >= 13 && num <= 15) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 203, 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), 204, 1f); + } + else + { + if (num >= 25 && num <= 27) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), WorldGen.genRand.Next(217, 220), 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), WorldGen.genRand.Next(217, 220), 1f); + } + else + { + if (num >= 28 && num <= 30) + { + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), WorldGen.genRand.Next(315, 317), 1f); + Gore.NewGore(new Vector2((float)(i * 16), (float)(j * 16)), default(Vector2), WorldGen.genRand.Next(315, 317), 1f); + } + } + } + } + } + } + } + } + } + } + if (WorldGen.genRand.Next(40) == 0 && Main.wallDungeon[(int)Main.tile[i, j].wall]) + { + Item.NewItem(i * 16, j * 16, 16, 16, 327, 1, false, 0, false); + } + else + { + if (WorldGen.genRand.Next(45) == 0) + { + if ((double)j < Main.worldSurface) + { + int num6 = WorldGen.genRand.Next(4); + if (num6 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 292, 1, false, 0, false); + } + if (num6 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false); + } + if (num6 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 299, 1, false, 0, false); + } + if (num6 == 3) + { + Item.NewItem(i * 16, j * 16, 16, 16, 290, 1, false, 0, false); + } + } + else + { + if ((double)j < Main.rockLayer) + { + int num7 = WorldGen.genRand.Next(7); + if (num7 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false); + } + if (num7 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false); + } + if (num7 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 299, 1, false, 0, false); + } + if (num7 == 3) + { + Item.NewItem(i * 16, j * 16, 16, 16, 290, 1, false, 0, false); + } + if (num7 == 4) + { + Item.NewItem(i * 16, j * 16, 16, 16, 303, 1, false, 0, false); + } + if (num7 == 5) + { + Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false); + } + if (num7 == 6) + { + Item.NewItem(i * 16, j * 16, 16, 16, 304, 1, false, 0, false); + } + } + else + { + if (j < Main.maxTilesY - 200) + { + int num8 = WorldGen.genRand.Next(10); + if (num8 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false); + } + if (num8 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 295, 1, false, 0, false); + } + if (num8 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 299, 1, false, 0, false); + } + if (num8 == 3) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false); + } + if (num8 == 4) + { + Item.NewItem(i * 16, j * 16, 16, 16, 303, 1, false, 0, false); + } + if (num8 == 5) + { + Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false); + } + if (num8 == 6) + { + Item.NewItem(i * 16, j * 16, 16, 16, 301, 1, false, 0, false); + } + if (num8 == 7) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false); + } + if (num8 == 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, 297, 1, false, 0, false); + } + if (num8 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 304, 1, false, 0, false); + } + } + else + { + int num9 = WorldGen.genRand.Next(12); + if (num9 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false); + } + if (num9 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 295, 1, false, 0, false); + } + if (num9 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 293, 1, false, 0, false); + } + if (num9 == 3) + { + Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false); + } + if (num9 == 4) + { + Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false); + } + if (num9 == 5) + { + Item.NewItem(i * 16, j * 16, 16, 16, 297, 1, false, 0, false); + } + if (num9 == 6) + { + Item.NewItem(i * 16, j * 16, 16, 16, 304, 1, false, 0, false); + } + if (num9 == 7) + { + Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false); + } + if (num9 == 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, 301, 1, false, 0, false); + } + if (num9 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false); + } + if (num9 == 10) + { + Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false); + } + if (num9 == 11) + { + Item.NewItem(i * 16, j * 16, 16, 16, 300, 1, false, 0, false); + } + } + } + } + } + else + { + int num10 = Main.rand.Next(9); + if (num10 == 0 && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].statLife < Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].statLifeMax) + { + Item.NewItem(i * 16, j * 16, 16, 16, 58, 1, false, 0, false); + } + else + { + if (num10 == 1 && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].statMana < Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].statManaMax) + { + Item.NewItem(i * 16, j * 16, 16, 16, 184, 1, false, 0, false); + } + else + { + if (num10 == 2) + { + int stack = Main.rand.Next(1, 6); + if (Main.tile[i, j].liquid > 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 282, stack, false, 0, false); + } + else + { + Item.NewItem(i * 16, j * 16, 16, 16, 8, stack, false, 0, false); + } + } + else + { + if (num10 == 3) + { + int stack2 = Main.rand.Next(8) + 3; + int type2 = 40; + if ((double)j < Main.rockLayer && WorldGen.genRand.Next(2) == 0) + { + if (Main.hardMode) + { + type2 = 168; + } + else + { + type2 = 42; + } + } + if (j > Main.maxTilesY - 200) + { + type2 = 265; + } + else + { + if (Main.hardMode) + { + if (Main.rand.Next(2) == 0) + { + type2 = 278; + } + else + { + type2 = 47; + } + } + } + Item.NewItem(i * 16, j * 16, 16, 16, type2, stack2, false, 0, false); + } + else + { + if (num10 == 4) + { + int type3 = 28; + if (j > Main.maxTilesY - 200 || Main.hardMode) + { + type3 = 188; + } + Item.NewItem(i * 16, j * 16, 16, 16, type3, 1, false, 0, false); + } + else + { + if (num10 == 5 && (double)j > Main.rockLayer) + { + int stack3 = Main.rand.Next(4) + 1; + Item.NewItem(i * 16, j * 16, 16, 16, 166, stack3, false, 0, false); + } + else + { + if (num10 == 6 && j < Main.maxTilesY - 200 && !Main.hardMode) + { + int stack4 = Main.rand.Next(20, 41); + Item.NewItem(i * 16, j * 16, 16, 16, 965, stack4, false, 0, false); + } + else + { + float num11 = (float)(200 + WorldGen.genRand.Next(-100, 101)); + if ((double)j < Main.worldSurface) + { + num11 *= 0.5f; + } + else + { + if ((double)j < Main.rockLayer) + { + num11 *= 0.75f; + } + else + { + if (j > Main.maxTilesY - 250) + { + num11 *= 1.25f; + } + } + } + num11 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + if (Main.rand.Next(5) == 0) + { + num11 *= 1f + (float)Main.rand.Next(5, 11) * 0.01f; + } + if (Main.rand.Next(10) == 0) + { + num11 *= 1f + (float)Main.rand.Next(10, 21) * 0.01f; + } + if (Main.rand.Next(15) == 0) + { + num11 *= 1f + (float)Main.rand.Next(20, 41) * 0.01f; + } + if (Main.rand.Next(20) == 0) + { + num11 *= 1f + (float)Main.rand.Next(40, 81) * 0.01f; + } + if (Main.rand.Next(25) == 0) + { + num11 *= 1f + (float)Main.rand.Next(50, 101) * 0.01f; + } + while ((int)num11 > 0) + { + if (num11 > 1000000f) + { + int num12 = (int)(num11 / 1000000f); + if (num12 > 50 && Main.rand.Next(2) == 0) + { + num12 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num12 /= Main.rand.Next(3) + 1; + } + num11 -= (float)(1000000 * num12); + Item.NewItem(i * 16, j * 16, 16, 16, 74, num12, false, 0, false); + } + else + { + if (num11 > 10000f) + { + int num13 = (int)(num11 / 10000f); + if (num13 > 50 && Main.rand.Next(2) == 0) + { + num13 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num13 /= Main.rand.Next(3) + 1; + } + num11 -= (float)(10000 * num13); + Item.NewItem(i * 16, j * 16, 16, 16, 73, num13, false, 0, false); + } + else + { + if (num11 > 100f) + { + int num14 = (int)(num11 / 100f); + if (num14 > 50 && Main.rand.Next(2) == 0) + { + num14 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num14 /= Main.rand.Next(3) + 1; + } + num11 -= (float)(100 * num14); + Item.NewItem(i * 16, j * 16, 16, 16, 72, num14, false, 0, false); + } + else + { + int num15 = (int)num11; + if (num15 > 50 && Main.rand.Next(2) == 0) + { + num15 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num15 /= Main.rand.Next(4) + 1; + } + if (num15 < 1) + { + num15 = 1; + } + num11 -= (float)num15; + Item.NewItem(i * 16, j * 16, 16, 16, 71, num15, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + WorldGen.destroyObject = false; + } + } + public static int PlaceChest(int x, int y, int type = 21, bool notNearOtherChests = false, int style = 0) + { + bool flag = true; + int num = -1; + for (int i = x; i < x + 2; i++) + { + for (int j = y - 1; j < y + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + flag = false; + } + if (Main.tile[i, j].lava()) + { + flag = false; + } + } + if (Main.tile[i, y + 1] == null) + { + Main.tile[i, y + 1] = new Tile(); + } + if (!WorldGen.SolidTile2(i, y + 1)) + { + flag = false; + } + } + if (flag && notNearOtherChests) + { + for (int k = x - 25; k < x + 25; k++) + { + for (int l = y - 8; l < y + 8; l++) + { + try + { + if (Main.tile[k, l].active() && Main.tile[k, l].type == 21) + { + flag = false; + return -1; + } + } + catch + { + } + } + } + } + if (flag) + { + num = Chest.CreateChest(x, y - 1); + if (num == -1) + { + flag = false; + } + } + if (flag) + { + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameY = 0; + Main.tile[x, y - 1].frameX = (short)(36 * style); + Main.tile[x, y - 1].type = (byte)type; + Main.tile[x, y - 1].halfBrick(false); + Main.tile[x + 1, y - 1].active(true); + Main.tile[x + 1, y - 1].frameY = 0; + Main.tile[x + 1, y - 1].frameX = (short)(18 + 36 * style); + Main.tile[x + 1, y - 1].type = (byte)type; + Main.tile[x + 1, y - 1].halfBrick(false); + Main.tile[x, y].active(true); + Main.tile[x, y].frameY = 18; + Main.tile[x, y].frameX = (short)(36 * style); + Main.tile[x, y].type = (byte)type; + Main.tile[x, y].halfBrick(false); + Main.tile[x + 1, y].active(true); + Main.tile[x + 1, y].frameY = 18; + Main.tile[x + 1, y].frameX = (short)(18 + 36 * style); + Main.tile[x + 1, y].type = (byte)type; + Main.tile[x + 1, y].halfBrick(false); + } + return num; + } + public static void CheckChest(int i, int j, int type) + { + if (WorldGen.destroyObject) + { + return; + } + bool flag = false; + int k = 0; + k += (int)(Main.tile[i, j].frameX / 18); + int num = j + (int)(Main.tile[i, j].frameY / 18 * -1); + while (k > 1) + { + k -= 2; + } + k *= -1; + k += i; + for (int l = k; l < k + 2; l++) + { + for (int m = num; m < num + 2; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + int n; + for (n = (int)(Main.tile[l, m].frameX / 18); n > 1; n -= 2) + { + } + if (!Main.tile[l, m].active() || (int)Main.tile[l, m].type != type || n != l - k || (int)Main.tile[l, m].frameY != (m - num) * 18) + { + flag = true; + } + } + if (Main.tile[l, num + 2] == null) + { + Main.tile[l, num + 2] = new Tile(); + } + if (!Main.tile[l, num + 2].active() || !Main.tileSolid[(int)Main.tile[l, num + 2].type]) + { + flag = true; + } + } + if (flag) + { + int type2 = 48; + if (Main.tile[i, j].frameX >= 792) + { + type2 = 1532; + } + else + { + if (Main.tile[i, j].frameX >= 756) + { + type2 = 1531; + } + else + { + if (Main.tile[i, j].frameX >= 720) + { + type2 = 1530; + } + else + { + if (Main.tile[i, j].frameX >= 684) + { + type2 = 1529; + } + else + { + if (Main.tile[i, j].frameX >= 648) + { + type2 = 1528; + } + else + { + if (Main.tile[i, j].frameX >= 612) + { + type2 = 1298; + } + else + { + if (Main.tile[i, j].frameX >= 576) + { + type2 = 1142; + } + else + { + if (Main.tile[i, j].frameX >= 540) + { + type2 = 952; + } + else + { + if (Main.tile[i, j].frameX >= 504) + { + type2 = 914; + } + else + { + if (Main.tile[i, j].frameX >= 468) + { + type2 = 838; + } + else + { + if (Main.tile[i, j].frameX >= 432) + { + type2 = 831; + } + else + { + if (Main.tile[i, j].frameX >= 396) + { + type2 = 681; + } + else + { + if (Main.tile[i, j].frameX >= 360) + { + type2 = 680; + } + else + { + if (Main.tile[i, j].frameX >= 324) + { + type2 = 627; + } + else + { + if (Main.tile[i, j].frameX >= 288) + { + type2 = 626; + } + else + { + if (Main.tile[i, j].frameX >= 252) + { + type2 = 625; + } + else + { + if (Main.tile[i, j].frameX >= 216) + { + type2 = 348; + } + else + { + if (Main.tile[i, j].frameX >= 180) + { + type2 = 343; + } + else + { + if (Main.tile[i, j].frameX >= 108) + { + type2 = 328; + } + else + { + if (Main.tile[i, j].frameX >= 36) + { + type2 = 306; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + WorldGen.destroyObject = true; + for (int num2 = k; num2 < k + 2; num2++) + { + for (int num3 = num; num3 < num + 3; num3++) + { + if ((int)Main.tile[num2, num3].type == type && Main.tile[num2, num3].active()) + { + Chest.DestroyChest(num2, num3); + WorldGen.KillTile(num2, num3, false, false, false); + } + } + } + Item.NewItem(i * 16, j * 16, 32, 32, type2, 1, false, 0, false); + WorldGen.destroyObject = false; + } + } + public static bool PlaceActuator(int i, int j) + { + if (!Main.tile[i, j].actuator()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].actuator(true); + return true; + } + return false; + } + public static bool KillActuator(int i, int j) + { + if (Main.tile[i, j].actuator()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].actuator(false); + if (Main.netMode != 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 849, 1, false, 0, false); + } + for (int k = 0; k < 5; k++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 50, 0f, 0f, 0, default(Color), 1f); + } + return true; + } + return false; + } + public static bool PlaceWire(int i, int j) + { + if (!Main.tile[i, j].wire()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].wire(true); + return true; + } + return false; + } + public static bool KillWire(int i, int j) + { + if (Main.tile[i, j].wire()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].wire(false); + if (Main.netMode != 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 530, 1, false, 0, false); + } + for (int k = 0; k < 5; k++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 50, 0f, 0f, 0, default(Color), 1f); + } + return true; + } + return false; + } + public static bool PlaceWire2(int i, int j) + { + if (!Main.tile[i, j].wire2()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].wire2(true); + return true; + } + return false; + } + public static bool KillWire2(int i, int j) + { + if (Main.tile[i, j].wire2()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].wire2(false); + if (Main.netMode != 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 530, 1, false, 0, false); + } + for (int k = 0; k < 5; k++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 50, 0f, 0f, 0, default(Color), 1f); + } + return true; + } + return false; + } + public static bool PlaceWire3(int i, int j) + { + if (!Main.tile[i, j].wire3()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].wire3(true); + return true; + } + return false; + } + public static bool KillWire3(int i, int j) + { + if (Main.tile[i, j].wire3()) + { + Main.PlaySound(0, i * 16, j * 16, 1); + Main.tile[i, j].wire3(false); + if (Main.netMode != 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 530, 1, false, 0, false); + } + for (int k = 0; k < 5; k++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 50, 0f, 0f, 0, default(Color), 1f); + } + return true; + } + return false; + } + public static bool PlaceTile(int i, int j, int type, bool mute = false, bool forced = false, int plr = -1, int style = 0) + { + if (type >= 251) + { + return false; + } + bool result = false; + if (i >= 0 && j >= 0 && i < Main.maxTilesX && j < Main.maxTilesY) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (forced || Collision.EmptyTile(i, j, false) || !Main.tileSolid[type] || (type == 23 && Main.tile[i, j].type == 0 && Main.tile[i, j].active()) || (type == 2 && Main.tile[i, j].type == 0 && Main.tile[i, j].active()) || (type == 109 && Main.tile[i, j].type == 0 && Main.tile[i, j].active()) || (type == 60 && Main.tile[i, j].type == 59 && Main.tile[i, j].active()) || (type == 70 && Main.tile[i, j].type == 59 && Main.tile[i, j].active())) + { + if (type == 23 && (Main.tile[i, j].type != 0 || !Main.tile[i, j].active())) + { + return false; + } + if (type == 2 && (Main.tile[i, j].type != 0 || !Main.tile[i, j].active())) + { + return false; + } + if (type == 109 && (Main.tile[i, j].type != 0 || !Main.tile[i, j].active())) + { + return false; + } + if (type == 60 && (Main.tile[i, j].type != 59 || !Main.tile[i, j].active())) + { + return false; + } + if (type == 81) + { + if (Main.tile[i - 1, j] == null) + { + Main.tile[i - 1, j] = new Tile(); + } + if (Main.tile[i + 1, j] == null) + { + Main.tile[i + 1, j] = new Tile(); + } + if (Main.tile[i, j - 1] == null) + { + Main.tile[i, j - 1] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i - 1, j].active() || Main.tile[i + 1, j].active() || Main.tile[i, j - 1].active()) + { + return false; + } + if (!Main.tile[i, j + 1].active() || !Main.tileSolid[(int)Main.tile[i, j + 1].type] || Main.tile[i, j + 1].halfBrick() || Main.tile[i, j + 1].slope() != 0) + { + return false; + } + } + if (Main.tile[i, j].liquid > 0) + { + if (type == 4) + { + if (style != 8 && style != 11) + { + return false; + } + } + else + { + if (type == 3 || type == 4 || type == 20 || type == 24 || type == 27 || type == 32 || type == 51 || type == 69 || type == 72 || type == 201) + { + return false; + } + } + } + Main.tile[i, j].halfBrick(false); + Main.tile[i, j].frameY = 0; + Main.tile[i, j].frameX = 0; + if (type == 3 || type == 24 || type == 110 || type == 201) + { + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick() && ((Main.tile[i, j + 1].type == 2 && type == 3) || (Main.tile[i, j + 1].type == 23 && type == 24) || (Main.tile[i, j + 1].type == 199 && type == 201) || (Main.tile[i, j + 1].type == 78 && type == 3) || (Main.tile[i, j + 1].type == 109 && type == 110))) + { + if (type == 24 && WorldGen.genRand.Next(13) == 0) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = 32; + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (Main.tile[i, j + 1].type == 78) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(2) * 18 + 108); + } + else + { + if ((Main.tile[i, j].wall == 0 || Main.tile[i, j].wall == 106 || Main.tile[i, j].wall == 107 || (Main.tile[i, j].wall >= 63 && Main.tile[i, j].wall <= 70)) && (Main.tile[i, j + 1].wall == 0 || Main.tile[i, j + 1].wall == 106 || Main.tile[i, j + 1].wall == 107 || (Main.tile[i, j + 1].wall >= 63 && Main.tile[i, j + 1].wall <= 70))) + { + if (type == 3 && WorldGen.genRand.Next(35) == 0) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(2) * 18 + 162); + } + else + { + if (WorldGen.genRand.Next(50) == 0 || (type == 24 && WorldGen.genRand.Next(40) == 0)) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = 144; + } + else + { + if (WorldGen.genRand.Next(35) == 0) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(2) * 18 + 108); + } + else + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(6) * 18); + } + } + } + } + } + } + } + } + else + { + if (type == 61) + { + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].type == 60) + { + if (WorldGen.genRand.Next(16) == 0 && (double)j > Main.worldSurface) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = 69; + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (WorldGen.genRand.Next(60) == 0 && (double)j > Main.rockLayer) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = 144; + } + else + { + if (WorldGen.genRand.Next(400) == 0 && (double)j > Main.rockLayer) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = 162; + } + else + { + if (WorldGen.genRand.Next(15) == 0) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(2) * 18 + 108); + } + else + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(6) * 18); + } + } + } + } + } + } + else + { + if (type == 71) + { + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].type == 70) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(5) * 18); + } + } + else + { + if (type == 129) + { + if (WorldGen.SolidTile(i - 1, j) || WorldGen.SolidTile(i + 1, j) || WorldGen.SolidTile(i, j - 1) || WorldGen.SolidTile(i, j + 1)) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(8) * 18); + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 178) + { + if (WorldGen.SolidTile(i - 1, j) || WorldGen.SolidTile(i + 1, j) || WorldGen.SolidTile(i, j - 1) || WorldGen.SolidTile(i, j + 1)) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(style * 18); + Main.tile[i, j].frameY = (short)(WorldGen.genRand.Next(3) * 18); + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 184) + { + if ((Main.tileMoss[(int)Main.tile[i - 1, j].type] && WorldGen.SolidTile(i - 1, j)) || (Main.tileMoss[(int)Main.tile[i + 1, j].type] && WorldGen.SolidTile(i + 1, j)) || (Main.tileMoss[(int)Main.tile[i, j - 1].type] && WorldGen.SolidTile(i, j - 1)) || (Main.tileMoss[(int)Main.tile[i, j + 1].type] && WorldGen.SolidTile(i, j + 1))) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameX = (short)(style * 18); + Main.tile[i, j].frameY = (short)(WorldGen.genRand.Next(3) * 18); + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 132 || type == 138 || type == 142 || type == 143) + { + WorldGen.Place2x2(i, j, type); + } + else + { + if (type == 137) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameY = (short)(18 * style); + } + else + { + if (type == 136) + { + if (Main.tile[i - 1, j] == null) + { + Main.tile[i - 1, j] = new Tile(); + } + if (Main.tile[i + 1, j] == null) + { + Main.tile[i + 1, j] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if ((Main.tile[i - 1, j].nactive() && !Main.tile[i - 1, j].halfBrick() && Main.tile[i - 1, j].type != 10 && Main.tile[i - 1, j].slope() == 0 && (WorldGen.SolidTile(i - 1, j) || Main.tile[i - 1, j].type == 124 || (Main.tile[i - 1, j].type == 5 && Main.tile[i - 1, j - 1].type == 5 && Main.tile[i - 1, j + 1].type == 5))) || (Main.tile[i + 1, j].nactive() && !Main.tile[i + 1, j].halfBrick() && Main.tile[i + 1, j].type != 10 && Main.tile[i + 1, j].slope() == 0 && (WorldGen.SolidTile(i + 1, j) || Main.tile[i + 1, j].type == 124 || (Main.tile[i + 1, j].type == 5 && Main.tile[i + 1, j - 1].type == 5 && Main.tile[i + 1, j + 1].type == 5))) || (Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && WorldGen.SolidTile(i, j + 1) && Main.tile[i, j + 1].slope() == 0)) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 4) + { + if (Main.tile[i - 1, j] == null) + { + Main.tile[i - 1, j] = new Tile(); + } + if (Main.tile[i + 1, j] == null) + { + Main.tile[i + 1, j] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i, j].wall > 0 || (Main.tile[i - 1, j].active() && Main.tile[i - 1, j].slope() == 0 && (Main.tileSolid[(int)Main.tile[i - 1, j].type] || Main.tile[i - 1, j].type == 124 || (Main.tile[i - 1, j].type == 5 && Main.tile[i - 1, j - 1].type == 5 && Main.tile[i - 1, j + 1].type == 5))) || (Main.tile[i + 1, j].active() && Main.tile[i + 1, j].slope() == 0 && (Main.tileSolid[(int)Main.tile[i + 1, j].type] || Main.tile[i + 1, j].type == 124 || (Main.tile[i + 1, j].type == 5 && Main.tile[i + 1, j - 1].type == 5 && Main.tile[i + 1, j + 1].type == 5))) || (Main.tile[i, j + 1].active() && Main.tileSolid[(int)Main.tile[i, j + 1].type] && !Main.tileSolidTop[(int)Main.tile[i, j + 1].type] && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0)) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + Main.tile[i, j].frameY = (short)(22 * style); + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 10) + { + if (Main.tile[i, j - 1] == null) + { + Main.tile[i, j - 1] = new Tile(); + } + if (Main.tile[i, j - 2] == null) + { + Main.tile[i, j - 2] = new Tile(); + } + if (Main.tile[i, j - 3] == null) + { + Main.tile[i, j - 3] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i, j + 2] == null) + { + Main.tile[i, j + 2] = new Tile(); + } + if (Main.tile[i, j + 3] == null) + { + Main.tile[i, j + 3] = new Tile(); + } + if (!Main.tile[i, j - 1].active() && !Main.tile[i, j - 2].active() && Main.tile[i, j - 3].active() && Main.tileSolid[(int)Main.tile[i, j - 3].type]) + { + WorldGen.PlaceDoor(i, j - 1, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (Main.tile[i, j + 1].active() || Main.tile[i, j + 2].active() || !Main.tile[i, j + 3].active() || !Main.tileSolid[(int)Main.tile[i, j + 3].type]) + { + return false; + } + WorldGen.PlaceDoor(i, j + 1, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 237 || type == 244) + { + WorldGen.Place3x2(i, j, type, 0); + } + else + { + if (type == 128) + { + WorldGen.PlaceMan(i, j, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 149) + { + if (WorldGen.SolidTile(i - 1, j) || WorldGen.SolidTile(i + 1, j) || WorldGen.SolidTile(i, j - 1) || WorldGen.SolidTile(i, j + 1)) + { + Main.tile[i, j].frameX = (short)(18 * style); + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 139) + { + WorldGen.PlaceMB(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 165) + { + WorldGen.PlaceTight(i, j, type, false); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 235) + { + WorldGen.Place3x1(i, j, type, 0); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 240) + { + WorldGen.Place3x3Wall(i, j, type, style); + } + else + { + if (type == 245) + { + WorldGen.Place2x3Wall(i, j, type, style); + } + else + { + if (type == 246) + { + WorldGen.Place3x2Wall(i, j, type, style); + } + else + { + if (type == 241) + { + WorldGen.Place4x3Wall(i, j, type, style); + } + else + { + if (type == 242) + { + WorldGen.Place6x4Wall(i, j, type, style); + } + else + { + if (type == 34 || type == 35 || type == 36 || type == 106 || type == 170 || type == 171 || type == 172 || type == 212 || type == 219 || type == 220 || type == 228 || type == 231 || type == 243 || type == 247) + { + WorldGen.Place3x3(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 13 || type == 33 || type == 49 || type == 50 || type == 78 || type == 174) + { + WorldGen.PlaceOnTable1x1(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 14 || type == 26 || type == 86 || type == 87 || type == 88 || type == 89 || type == 114 || type == 186 || type == 187 || type == 215 || type == 217 || type == 218) + { + WorldGen.Place3x2(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 236) + { + WorldGen.PlaceJunglePlant(i, j, type, WorldGen.genRand.Next(3), 0); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 238) + { + WorldGen.PlaceJunglePlant(i, j, type, 0, 0); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 20) + { + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i, j + 1].active() && (Main.tile[i, j + 1].type == 2 || Main.tile[i, j + 1].type == 109 || Main.tile[i, j + 1].type == 147)) + { + WorldGen.Place1x2(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + } + else + { + if (type == 15 || type == 216) + { + if (Main.tile[i, j - 1] == null) + { + Main.tile[i, j - 1] = new Tile(); + } + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + WorldGen.Place1x2(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 227) + { + WorldGen.PlaceDye(i, j, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 16 || type == 18 || type == 29 || type == 103 || type == 134) + { + WorldGen.Place2x1(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 92 || type == 93) + { + WorldGen.Place1xX(i, j, type, 0); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 104 || type == 105) + { + WorldGen.Place2xX(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 17 || type == 77 || type == 133) + { + WorldGen.Place3x2(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 207) + { + WorldGen.Place2xX(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 21) + { + WorldGen.PlaceChest(i, j, type, false, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 91) + { + WorldGen.PlaceBanner(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 135 || type == 141 || type == 144 || type == 210 || type == 239) + { + WorldGen.Place1x1(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 101 || type == 102) + { + WorldGen.Place3x4(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 27) + { + WorldGen.PlaceSunflower(i, j, 27); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 28) + { + WorldGen.PlacePot(i, j, 28, Main.rand.Next(4)); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 42) + { + WorldGen.Place1x2Top(i, j, type, style); + WorldGen.SquareTileFrame(i, j, true); + } + else + { + if (type == 55 || type == 85) + { + WorldGen.PlaceSign(i, j, type, style); + } + else + { + if (Main.tileAlch[type]) + { + WorldGen.PlaceAlch(i, j, style); + } + else + { + if (type == 94 || type == 95 || type == 96 || type == 97 || type == 98 || type == 99 || type == 100 || type == 125 || type == 126 || type == 173) + { + WorldGen.Place2x2(i, j, type); + } + else + { + if (type == 79 || type == 90) + { + int direction = 1; + if (plr > -1) + { + direction = Main.player[plr].direction; + } + WorldGen.Place4x2(i, j, type, direction, style); + } + else + { + if (type == 209) + { + WorldGen.PlaceCannon(i, j, type, style); + } + else + { + if (type == 81) + { + Main.tile[i, j].frameX = (short)(26 * WorldGen.genRand.Next(6)); + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + } + else + { + if (type == 19) + { + Main.tile[i, j].frameY = (short)(18 * style); + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + } + else + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = (byte)type; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].active() && !mute) + { + WorldGen.SquareTileFrame(i, j, true); + result = true; + if (type == 127) + { + Main.PlaySound(2, i * 16, j * 16, 30); + } + else + { + Main.PlaySound(0, i * 16, j * 16, 1); + } + if (type == 22 || type == 140) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 14, 0f, 0f, 0, default(Color), 1f); + } + } + } + } + } + return result; + } + public static void UpdateMech() + { + for (int i = WorldGen.numMechs - 1; i >= 0; i--) + { + WorldGen.mechTime[i]--; + if (Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].active() && Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].type == 144) + { + if (Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].frameY == 0) + { + WorldGen.mechTime[i] = 0; + } + else + { + int num = (int)(Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].frameX / 18); + if (num == 0) + { + num = 60; + } + else + { + if (num == 1) + { + num = 180; + } + else + { + if (num == 2) + { + num = 300; + } + } + } + if (Math.IEEERemainder((double)WorldGen.mechTime[i], (double)num) == 0.0) + { + WorldGen.mechTime[i] = 18000; + WorldGen.TripWire(WorldGen.mechX[i], WorldGen.mechY[i]); + } + } + } + if (WorldGen.mechTime[i] <= 0) + { + if (Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].active() && Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].type == 144) + { + Main.tile[WorldGen.mechX[i], WorldGen.mechY[i]].frameY = 0; + NetMessage.SendTileSquare(-1, WorldGen.mechX[i], WorldGen.mechY[i], 1); + } + for (int j = i; j < WorldGen.numMechs; j++) + { + WorldGen.mechX[j] = WorldGen.mechX[j + 1]; + WorldGen.mechY[j] = WorldGen.mechY[j + 1]; + WorldGen.mechTime[j] = WorldGen.mechTime[j + 1]; + } + WorldGen.numMechs--; + } + } + } + public static bool checkMech(int i, int j, int time) + { + for (int k = 0; k < WorldGen.numMechs; k++) + { + if (WorldGen.mechX[k] == i && WorldGen.mechY[k] == j) + { + return false; + } + } + if (WorldGen.numMechs < WorldGen.maxMech - 1) + { + WorldGen.mechX[WorldGen.numMechs] = i; + WorldGen.mechY[WorldGen.numMechs] = j; + WorldGen.mechTime[WorldGen.numMechs] = time; + WorldGen.numMechs++; + return true; + } + return false; + } + public static void Teleport() + { + if (WorldGen.teleport[0].X < WorldGen.teleport[1].X + 3f && WorldGen.teleport[0].X > WorldGen.teleport[1].X - 3f && WorldGen.teleport[0].Y > WorldGen.teleport[1].Y - 3f && WorldGen.teleport[0].Y < WorldGen.teleport[1].Y) + { + return; + } + Rectangle[] array = new Rectangle[2]; + array[0].X = (int)(WorldGen.teleport[0].X * 16f); + array[0].Width = 48; + array[0].Height = 48; + array[0].Y = (int)(WorldGen.teleport[0].Y * 16f - (float)array[0].Height); + array[1].X = (int)(WorldGen.teleport[1].X * 16f); + array[1].Width = 48; + array[1].Height = 48; + array[1].Y = (int)(WorldGen.teleport[1].Y * 16f - (float)array[1].Height); + for (int i = 0; i < 2; i++) + { + Vector2 value = new Vector2((float)(array[1].X - array[0].X), (float)(array[1].Y - array[0].Y)); + if (i == 1) + { + value = new Vector2((float)(array[0].X - array[1].X), (float)(array[0].Y - array[1].Y)); + } + for (int j = 0; j < 255; j++) + { + if (Main.player[j].active && !Main.player[j].dead && !Main.player[j].teleporting && array[i].Intersects(Main.player[j].getRect())) + { + Vector2 vector = Main.player[j].position + value; + Main.player[j].teleporting = true; + if (Main.netMode == 2) + { + ServerSock.CheckSection(j, vector); + } + Main.player[j].Teleport(vector, 0); + if (Main.netMode == 2) + { + NetMessage.SendData(65, -1, -1, "", 0, (float)j, vector.X, vector.Y, 0); + } + } + } + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && !Main.npc[k].teleporting && Main.npc[k].lifeMax > 5 && !Main.npc[k].boss && !Main.npc[k].noTileCollide && array[i].Intersects(Main.npc[k].getRect())) + { + Main.npc[k].teleporting = true; + Main.npc[k].Teleport(Main.npc[k].position + value, 0); + } + } + } + for (int l = 0; l < 255; l++) + { + Main.player[l].teleporting = false; + } + for (int m = 0; m < 200; m++) + { + Main.npc[m].teleporting = false; + } + } + public static void hitSwitch(int i, int j) + { + if (Main.tile[i, j] == null) + { + return; + } + if (Main.tile[i, j].type == 135) + { + Main.PlaySound(28, i * 16, j * 16, 0); + WorldGen.TripWire(i, j); + return; + } + if (Main.tile[i, j].type == 136) + { + if (Main.tile[i, j].frameY == 0) + { + Main.tile[i, j].frameY = 18; + } + else + { + Main.tile[i, j].frameY = 0; + } + Main.PlaySound(28, i * 16, j * 16, 0); + WorldGen.TripWire(i, j); + return; + } + if (Main.tile[i, j].type == 144) + { + if (Main.tile[i, j].frameY == 0) + { + Main.tile[i, j].frameY = 18; + if (Main.netMode != 1) + { + WorldGen.checkMech(i, j, 18000); + } + } + else + { + Main.tile[i, j].frameY = 0; + } + Main.PlaySound(28, i * 16, j * 16, 0); + return; + } + if (Main.tile[i, j].type == 132) + { + short num = 36; + int num2 = (int)(Main.tile[i, j].frameX / 18 * -1); + int num3 = (int)(Main.tile[i, j].frameY / 18 * -1); + if (num2 < -1) + { + num2 += 2; + num = -36; + } + num2 += i; + num3 += j; + for (int k = num2; k < num2 + 2; k++) + { + for (int l = num3; l < num3 + 2; l++) + { + if (Main.tile[k, l].type == 132) + { + Tile expr_1B3 = Main.tile[k, l]; + expr_1B3.frameX += num; + } + } + } + WorldGen.TileFrame(num2, num3, false, false); + Main.PlaySound(28, i * 16, j * 16, 0); + for (int m = num2; m < num2 + 2; m++) + { + for (int n = num3; n < num3 + 2; n++) + { + if (Main.tile[m, n].type == 132 && Main.tile[m, n].active() && (Main.tile[m, n].wire() || Main.tile[m, n].wire2() || Main.tile[m, n].wire3())) + { + WorldGen.TripWire(m, n); + return; + } + } + } + } + } + public static void TripWire(int i, int j) + { + if (Main.netMode == 1) + { + return; + } + WorldGen.teleport[0].X = -1f; + WorldGen.teleport[0].Y = -1f; + WorldGen.teleport[1].X = -1f; + WorldGen.teleport[1].Y = -1f; + WorldGen.numWire = 0; + WorldGen.numNoWire = 0; + WorldGen.numInPump = 0; + WorldGen.numOutPump = 0; + WorldGen.noWire(i, j); + WorldGen.hitWire(i, j, 1); + if (WorldGen.numInPump > 0 && WorldGen.numOutPump > 0) + { + WorldGen.xferWater(); + } + WorldGen.numWire = 0; + WorldGen.numNoWire = 0; + WorldGen.numInPump = 0; + WorldGen.numOutPump = 0; + WorldGen.noWire(i, j); + WorldGen.hitWire(i, j, 2); + if (WorldGen.numInPump > 0 && WorldGen.numOutPump > 0) + { + WorldGen.xferWater(); + } + WorldGen.numWire = 0; + WorldGen.numNoWire = 0; + WorldGen.numInPump = 0; + WorldGen.numOutPump = 0; + WorldGen.noWire(i, j); + WorldGen.hitWire(i, j, 3); + if (WorldGen.numInPump > 0 && WorldGen.numOutPump > 0) + { + WorldGen.xferWater(); + } + if (WorldGen.teleport[0].X >= 0f && WorldGen.teleport[1].X >= 0f) + { + WorldGen.Teleport(); + } + } + public static void xferWater() + { + for (int i = 0; i < WorldGen.numInPump; i++) + { + int num = WorldGen.inPumpX[i]; + int num2 = WorldGen.inPumpY[i]; + int liquid = (int)Main.tile[num, num2].liquid; + if (liquid > 0) + { + bool flag = Main.tile[num, num2].lava(); + bool flag2 = Main.tile[num, num2].honey(); + for (int j = 0; j < WorldGen.numOutPump; j++) + { + int num3 = WorldGen.outPumpX[j]; + int num4 = WorldGen.outPumpY[j]; + int liquid2 = (int)Main.tile[num3, num4].liquid; + if (liquid2 < 255) + { + bool flag3 = Main.tile[num3, num4].lava(); + bool flag4 = Main.tile[num3, num4].honey(); + if (liquid2 == 0) + { + flag3 = flag; + flag4 = flag2; + } + if (flag == flag3 && flag2 == flag4) + { + int num5 = liquid; + if (num5 + liquid2 > 255) + { + num5 = 255 - liquid2; + } + Tile expr_102 = Main.tile[num3, num4]; + expr_102.liquid += (byte)num5; + Tile expr_11E = Main.tile[num, num2]; + expr_11E.liquid -= (byte)num5; + liquid = (int)Main.tile[num, num2].liquid; + Main.tile[num3, num4].lava(flag); + Main.tile[num3, num4].honey(flag2); + WorldGen.SquareTileFrame(num3, num4, true); + if (Main.tile[num, num2].liquid == 0) + { + Main.tile[num, num2].lava(false); + WorldGen.SquareTileFrame(num, num2, true); + break; + } + } + } + } + WorldGen.SquareTileFrame(num, num2, true); + } + } + } + public static void noWire(int i, int j) + { + if (WorldGen.numNoWire >= WorldGen.maxWire - 1) + { + return; + } + WorldGen.noWireX[WorldGen.numNoWire] = i; + WorldGen.noWireY[WorldGen.numNoWire] = j; + WorldGen.numNoWire++; + } + public static bool DeActive(int i, int j) + { + if (!Main.tile[i, j].active() || !Main.tileSolid[(int)Main.tile[i, j].type]) + { + return false; + } + if (Main.tile[i, j - 1].active() && (Main.tile[i, j - 1].type == 5 || Main.tile[i, j - 1].type == 21 || Main.tile[i, j - 1].type == 26 || Main.tile[i, j - 1].type == 77 || Main.tile[i, j - 1].type == 72)) + { + return false; + } + Main.tile[i, j].inActive(true); + WorldGen.SquareTileFrame(i, j, false); + if (Main.netMode != 1) + { + NetMessage.SendTileSquare(-1, i, j, 1); + } + return true; + } + public static bool ReActive(int i, int j) + { + Main.tile[i, j].inActive(false); + WorldGen.SquareTileFrame(i, j, false); + if (Main.netMode != 1) + { + NetMessage.SendTileSquare(-1, i, j, 1); + } + return true; + } + public static void hitWire(int i, int j, int wireType) + { + if (i < 2 || i >= Main.maxTilesX - 2 || j < 2 || j >= Main.maxTilesY - 2) + { + return; + } + if (WorldGen.numWire >= WorldGen.maxWire - 1) + { + return; + } + if (wireType == 1 && !Main.tile[i, j].wire()) + { + return; + } + if (wireType == 2 && !Main.tile[i, j].wire2()) + { + return; + } + if (wireType == 3 && !Main.tile[i, j].wire3()) + { + return; + } + for (int k = 0; k < WorldGen.numWire; k++) + { + if (WorldGen.wireX[k] == i && WorldGen.wireY[k] == j) + { + return; + } + } + WorldGen.wireX[WorldGen.numWire] = i; + WorldGen.wireY[WorldGen.numWire] = j; + WorldGen.numWire++; + int type = (int)Main.tile[i, j].type; + bool flag = true; + for (int l = 0; l < WorldGen.numNoWire; l++) + { + if (WorldGen.noWireX[l] == i && WorldGen.noWireY[l] == j) + { + flag = false; + } + } + if (flag && Main.tile[i, j].actuator() && (Main.tile[i, j].type != 226 || (double)j <= Main.worldSurface || NPC.downedPlantBoss)) + { + if (Main.tile[i, j].inActive()) + { + WorldGen.ReActive(i, j); + } + else + { + WorldGen.DeActive(i, j); + } + } + if (flag && Main.tile[i, j].active()) + { + if (type == 144) + { + WorldGen.hitSwitch(i, j); + WorldGen.SquareTileFrame(i, j, true); + NetMessage.SendTileSquare(-1, i, j, 1); + } + else + { + if (type == 130) + { + if (Main.tile[i, j - 1] == null || !Main.tile[i, j - 1].active() || Main.tile[i, j - 1].type != 21) + { + Main.tile[i, j].type = 131; + WorldGen.SquareTileFrame(i, j, true); + NetMessage.SendTileSquare(-1, i, j, 1); + } + } + else + { + if (type == 131) + { + Main.tile[i, j].type = 130; + WorldGen.SquareTileFrame(i, j, true); + NetMessage.SendTileSquare(-1, i, j, 1); + } + else + { + if (type == 11) + { + if (WorldGen.CloseDoor(i, j, true)) + { + NetMessage.SendData(19, -1, -1, "", 1, (float)i, (float)j, 0f, 0); + } + } + else + { + if (type == 10) + { + int num = 1; + if (Main.rand.Next(2) == 0) + { + num = -1; + } + if (!WorldGen.OpenDoor(i, j, num)) + { + if (WorldGen.OpenDoor(i, j, -num)) + { + NetMessage.SendData(19, -1, -1, "", 0, (float)i, (float)j, (float)(-(float)num), 0); + } + } + else + { + NetMessage.SendData(19, -1, -1, "", 0, (float)i, (float)j, (float)num, 0); + } + } + else + { + if (type == 216) + { + WorldGen.LaunchRocket(i, j); + WorldGen.noWire(i, j); + } + else + { + if (type == 235) + { + int num2 = i - (int)(Main.tile[i, j].frameX / 18); + if (WorldGen.teleport[0].X == -1f) + { + WorldGen.teleport[0].X = (float)num2; + WorldGen.teleport[0].Y = (float)j; + if (Main.tile[i, j].halfBrick()) + { + Vector2[] expr_378_cp_0 = WorldGen.teleport; + int expr_378_cp_1 = 0; + expr_378_cp_0[expr_378_cp_1].Y = expr_378_cp_0[expr_378_cp_1].Y + 0.5f; + } + } + else + { + if (WorldGen.teleport[0].X != (float)num2 || WorldGen.teleport[0].Y != (float)j) + { + WorldGen.teleport[1].X = (float)num2; + WorldGen.teleport[1].Y = (float)j; + if (Main.tile[i, j].halfBrick()) + { + Vector2[] expr_400_cp_0 = WorldGen.teleport; + int expr_400_cp_1 = 1; + expr_400_cp_0[expr_400_cp_1].Y = expr_400_cp_0[expr_400_cp_1].Y + 0.5f; + } + } + } + } + else + { + if (type == 4) + { + if (Main.tile[i, j].frameX < 66) + { + Tile expr_43B = Main.tile[i, j]; + expr_43B.frameX += 66; + } + else + { + Tile expr_458 = Main.tile[i, j]; + expr_458.frameX -= 66; + } + NetMessage.SendTileSquare(-1, i, j, 1); + } + else + { + if (type == 149) + { + if (Main.tile[i, j].frameX < 54) + { + Tile expr_49E = Main.tile[i, j]; + expr_49E.frameX += 54; + } + else + { + Tile expr_4BB = Main.tile[i, j]; + expr_4BB.frameX -= 54; + } + NetMessage.SendTileSquare(-1, i, j, 1); + } + else + { + if (type == 244) + { + int m; + for (m = (int)(Main.tile[i, j].frameX / 18); m >= 3; m -= 3) + { + } + int n; + for (n = (int)(Main.tile[i, j].frameY / 18); n >= 3; n -= 3) + { + } + int num3 = i - m; + int num4 = j - n; + int num5 = 54; + if (Main.tile[num3, num4].frameX >= 54) + { + num5 = -54; + } + for (int num6 = num3; num6 < num3 + 3; num6++) + { + for (int num7 = num4; num7 < num4 + 2; num7++) + { + WorldGen.noWire(num6, num7); + Main.tile[num6, num7].frameX = (short)((int)Main.tile[num6, num7].frameX + num5); + } + } + } + else + { + if (type == 42) + { + int num8; + for (num8 = (int)(Main.tile[i, j].frameY / 18); num8 >= 2; num8 -= 2) + { + } + int num9 = j - num8; + short num10 = 18; + if (Main.tile[i, j].frameX > 0) + { + num10 = -18; + } + Tile expr_60E = Main.tile[i, num9]; + expr_60E.frameX += num10; + Tile expr_62C = Main.tile[i, num9 + 1]; + expr_62C.frameX += num10; + WorldGen.noWire(i, num9); + WorldGen.noWire(i, num9 + 1); + NetMessage.SendTileSquare(-1, i, j, 2); + } + else + { + if (type == 93) + { + int num11 = j - (int)(Main.tile[i, j].frameY / 18); + short num12 = 18; + if (Main.tile[i, j].frameX > 0) + { + num12 = -18; + } + Tile expr_6A4 = Main.tile[i, num11]; + expr_6A4.frameX += num12; + Tile expr_6C2 = Main.tile[i, num11 + 1]; + expr_6C2.frameX += num12; + Tile expr_6E0 = Main.tile[i, num11 + 2]; + expr_6E0.frameX += num12; + WorldGen.noWire(i, num11); + WorldGen.noWire(i, num11 + 1); + WorldGen.noWire(i, num11 + 2); + NetMessage.SendTileSquare(-1, i, num11 + 1, 3); + } + else + { + if (type == 126 || type == 100 || type == 95 || type == 173) + { + int num13 = j - (int)(Main.tile[i, j].frameY / 18); + int num14 = (int)(Main.tile[i, j].frameX / 18); + if (num14 > 1) + { + num14 -= 2; + } + num14 = i - num14; + short num15 = 36; + if (Main.tile[num14, num13].frameX > 0) + { + num15 = -36; + } + Tile expr_7A1 = Main.tile[num14, num13]; + expr_7A1.frameX += num15; + Tile expr_7C0 = Main.tile[num14, num13 + 1]; + expr_7C0.frameX += num15; + Tile expr_7DF = Main.tile[num14 + 1, num13]; + expr_7DF.frameX += num15; + Tile expr_800 = Main.tile[num14 + 1, num13 + 1]; + expr_800.frameX += num15; + WorldGen.noWire(num14, num13); + WorldGen.noWire(num14, num13 + 1); + WorldGen.noWire(num14 + 1, num13); + WorldGen.noWire(num14 + 1, num13 + 1); + NetMessage.SendTileSquare(-1, num14, num13, 3); + } + else + { + if (type == 34 || type == 35 || type == 36 || type == 170 || type == 171 || type == 172) + { + int num16 = j - (int)(Main.tile[i, j].frameY / 18); + int num17 = (int)(Main.tile[i, j].frameX / 18); + if (num17 > 2) + { + num17 -= 3; + } + num17 = i - num17; + short num18 = 54; + if (Main.tile[num17, num16].frameX > 0) + { + num18 = -54; + } + for (int num19 = num17; num19 < num17 + 3; num19++) + { + for (int num20 = num16; num20 < num16 + 3; num20++) + { + Tile expr_8EC = Main.tile[num19, num20]; + expr_8EC.frameX += num18; + WorldGen.noWire(num19, num20); + } + } + NetMessage.SendTileSquare(-1, num17 + 1, num16 + 1, 3); + } + else + { + if (type == 33 || type == 174) + { + short num21 = 18; + if (Main.tile[i, j].frameX > 0) + { + num21 = -18; + } + Tile expr_969 = Main.tile[i, j]; + expr_969.frameX += num21; + NetMessage.SendTileSquare(-1, i, j, 3); + } + else + { + if (type == 92) + { + int num22 = j - (int)(Main.tile[i, j].frameY / 18); + short num23 = 18; + if (Main.tile[i, j].frameX > 0) + { + num23 = -18; + } + Tile expr_9CF = Main.tile[i, num22]; + expr_9CF.frameX += num23; + Tile expr_9ED = Main.tile[i, num22 + 1]; + expr_9ED.frameX += num23; + Tile expr_A0B = Main.tile[i, num22 + 2]; + expr_A0B.frameX += num23; + Tile expr_A29 = Main.tile[i, num22 + 3]; + expr_A29.frameX += num23; + Tile expr_A47 = Main.tile[i, num22 + 4]; + expr_A47.frameX += num23; + Tile expr_A65 = Main.tile[i, num22 + 5]; + expr_A65.frameX += num23; + WorldGen.noWire(i, num22); + WorldGen.noWire(i, num22 + 1); + WorldGen.noWire(i, num22 + 2); + WorldGen.noWire(i, num22 + 3); + WorldGen.noWire(i, num22 + 4); + WorldGen.noWire(i, num22 + 5); + NetMessage.SendTileSquare(-1, i, num22 + 3, 7); + } + else + { + if (type == 137) + { + int num24 = (int)(Main.tile[i, j].frameY / 18); + if (num24 == 0 && WorldGen.checkMech(i, j, 180)) + { + int num25 = -1; + if (Main.tile[i, j].frameX != 0) + { + num25 = 1; + } + float speedX = (float)(12 * num25); + int damage = 20; + int type2 = 98; + Vector2 vector = new Vector2((float)(i * 16 + 8), (float)(j * 16 + 7)); + vector.X += (float)(10 * num25); + vector.Y += 2f; + Projectile.NewProjectile((float)((int)vector.X), (float)((int)vector.Y), speedX, 0f, type2, damage, 2f, Main.myPlayer, 0f, 0f); + } + if (num24 == 1 && WorldGen.checkMech(i, j, 180)) + { + int num26 = -1; + if (Main.tile[i, j].frameX != 0) + { + num26 = 1; + } + float speedX2 = (float)(12 * num26); + int damage2 = 40; + int type3 = 184; + Vector2 vector2 = new Vector2((float)(i * 16 + 8), (float)(j * 16 + 7)); + vector2.X += (float)(10 * num26); + vector2.Y += 2f; + Projectile.NewProjectile((float)((int)vector2.X), (float)((int)vector2.Y), speedX2, 0f, type3, damage2, 2f, Main.myPlayer, 0f, 0f); + } + if (num24 == 2 && WorldGen.checkMech(i, j, 180)) + { + int num27 = -1; + if (Main.tile[i, j].frameX != 0) + { + num27 = 1; + } + float speedX3 = (float)(5 * num27); + int damage3 = 40; + int type4 = 187; + Vector2 vector3 = new Vector2((float)(i * 16 + 8), (float)(j * 16 + 7)); + vector3.X += (float)(10 * num27); + vector3.Y += 2f; + Projectile.NewProjectile((float)((int)vector3.X), (float)((int)vector3.Y), speedX3, 0f, type4, damage3, 2f, Main.myPlayer, 0f, 0f); + } + if (num24 == 3 && WorldGen.checkMech(i, j, 240)) + { + float speedX4 = (float)Main.rand.Next(-20, 21) * 0.05f; + float speedY = 4f + (float)Main.rand.Next(0, 21) * 0.05f; + int damage4 = 40; + int type5 = 185; + Vector2 vector4 = new Vector2((float)(i * 16 + 8), (float)(j * 16 + 16)); + vector4.Y += 6f; + Projectile.NewProjectile((float)((int)vector4.X), (float)((int)vector4.Y), speedX4, speedY, type5, damage4, 2f, Main.myPlayer, 0f, 0f); + } + if (num24 == 4 && WorldGen.checkMech(i, j, 90)) + { + float speedX5 = 0f; + float speedY2 = 8f; + int damage5 = 60; + int type6 = 186; + Vector2 vector5 = new Vector2((float)(i * 16 + 8), (float)(j * 16 + 16)); + vector5.Y += 10f; + Projectile.NewProjectile((float)((int)vector5.X), (float)((int)vector5.Y), speedX5, speedY2, type6, damage5, 2f, Main.myPlayer, 0f, 0f); + } + } + else + { + if (type == 139) + { + WorldGen.SwitchMB(i, j); + } + else + { + if (type == 207) + { + WorldGen.SwitchFountain(i, j); + } + else + { + if (type == 141) + { + WorldGen.KillTile(i, j, false, false, true); + NetMessage.SendTileSquare(-1, i, j, 1); + Projectile.NewProjectile((float)(i * 16 + 8), (float)(j * 16 + 8), 0f, 0f, 108, 250, 10f, Main.myPlayer, 0f, 0f); + } + else + { + if (type == 210) + { + WorldGen.ExplodeMine(i, j); + } + else + { + if (type == 142 || type == 143) + { + int num28 = j - (int)(Main.tile[i, j].frameY / 18); + int num29 = (int)(Main.tile[i, j].frameX / 18); + if (num29 > 1) + { + num29 -= 2; + } + num29 = i - num29; + WorldGen.noWire(num29, num28); + WorldGen.noWire(num29, num28 + 1); + WorldGen.noWire(num29 + 1, num28); + WorldGen.noWire(num29 + 1, num28 + 1); + if (type == 142) + { + for (int num30 = 0; num30 < 4; num30++) + { + if (WorldGen.numInPump >= WorldGen.maxPump - 1) + { + break; + } + int num31; + int num32; + if (num30 == 0) + { + num31 = num29; + num32 = num28 + 1; + } + else + { + if (num30 == 1) + { + num31 = num29 + 1; + num32 = num28 + 1; + } + else + { + if (num30 == 2) + { + num31 = num29; + num32 = num28; + } + else + { + num31 = num29 + 1; + num32 = num28; + } + } + } + WorldGen.inPumpX[WorldGen.numInPump] = num31; + WorldGen.inPumpY[WorldGen.numInPump] = num32; + WorldGen.numInPump++; + } + } + else + { + for (int num33 = 0; num33 < 4; num33++) + { + if (WorldGen.numOutPump >= WorldGen.maxPump - 1) + { + break; + } + int num34; + int num35; + if (num33 == 0) + { + num34 = num29; + num35 = num28 + 1; + } + else + { + if (num33 == 1) + { + num34 = num29 + 1; + num35 = num28 + 1; + } + else + { + if (num33 == 2) + { + num34 = num29; + num35 = num28; + } + else + { + num34 = num29 + 1; + num35 = num28; + } + } + } + WorldGen.outPumpX[WorldGen.numOutPump] = num34; + WorldGen.outPumpY[WorldGen.numOutPump] = num35; + WorldGen.numOutPump++; + } + } + } + else + { + if (type == 105) + { + int num36 = j - (int)(Main.tile[i, j].frameY / 18); + int num37 = (int)(Main.tile[i, j].frameX / 18); + int num38 = 0; + while (num37 >= 2) + { + num37 -= 2; + num38++; + } + num37 = i - num37; + WorldGen.noWire(num37, num36); + WorldGen.noWire(num37, num36 + 1); + WorldGen.noWire(num37, num36 + 2); + WorldGen.noWire(num37 + 1, num36); + WorldGen.noWire(num37 + 1, num36 + 1); + WorldGen.noWire(num37 + 1, num36 + 2); + int num39 = num37 * 16 + 16; + int num40 = (num36 + 3) * 16; + int num41 = -1; + if (num38 == 4) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 1)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 1, 0); + } + } + else + { + if (num38 == 7) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 49)) + { + num41 = NPC.NewNPC(num39 - 4, num40 - 6, 49, 0); + } + } + else + { + if (num38 == 8) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 55)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 55, 0); + } + } + else + { + if (num38 == 9) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 46)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 46, 0); + } + } + else + { + if (num38 == 10) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 21)) + { + num41 = NPC.NewNPC(num39, num40, 21, 0); + } + } + else + { + if (num38 == 18) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 67)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 67, 0); + } + } + else + { + if (num38 == 23) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 63)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 63, 0); + } + } + else + { + if (num38 == 27) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 85)) + { + num41 = NPC.NewNPC(num39 - 9, num40, 85, 0); + } + } + else + { + if (num38 == 28) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 74)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 74, 0); + } + } + else + { + if (num38 == 42) + { + if (WorldGen.checkMech(i, j, 30) && NPC.MechSpawn((float)num39, (float)num40, 58)) + { + num41 = NPC.NewNPC(num39, num40 - 12, 58, 0); + } + } + else + { + if (num38 == 37) + { + if (WorldGen.checkMech(i, j, 600) && Item.MechSpawn((float)num39, (float)num40, 58)) + { + Item.NewItem(num39, num40 - 16, 0, 0, 58, 1, false, 0, false); + } + } + else + { + if (num38 == 2) + { + if (WorldGen.checkMech(i, j, 600) && Item.MechSpawn((float)num39, (float)num40, 184)) + { + Item.NewItem(num39, num40 - 16, 0, 0, 184, 1, false, 0, false); + } + } + else + { + if (num38 == 17) + { + if (WorldGen.checkMech(i, j, 600) && Item.MechSpawn((float)num39, (float)num40, 166)) + { + Item.NewItem(num39, num40 - 20, 0, 0, 166, 1, false, 0, false); + } + } + else + { + if (num38 == 40) + { + if (WorldGen.checkMech(i, j, 300)) + { + int[] array = new int[10]; + int num42 = 0; + for (int num43 = 0; num43 < 200; num43++) + { + if (Main.npc[num43].active && (Main.npc[num43].type == 17 || Main.npc[num43].type == 19 || Main.npc[num43].type == 22 || Main.npc[num43].type == 38 || Main.npc[num43].type == 54 || Main.npc[num43].type == 107 || Main.npc[num43].type == 108 || Main.npc[num43].type == 142 || Main.npc[num43].type == 160 || Main.npc[num43].type == 207 || Main.npc[num43].type == 209 || Main.npc[num43].type == 227 || Main.npc[num43].type == 228 || Main.npc[num43].type == 229)) + { + array[num42] = num43; + num42++; + if (num42 >= 9) + { + break; + } + } + } + if (num42 > 0) + { + int num44 = array[Main.rand.Next(num42)]; + Main.npc[num44].position.X = (float)(num39 - Main.npc[num44].width / 2); + Main.npc[num44].position.Y = (float)(num40 - Main.npc[num44].height - 1); + NetMessage.SendData(23, -1, -1, "", num44, 0f, 0f, 0f, 0); + } + } + } + else + { + if (num38 == 41 && WorldGen.checkMech(i, j, 300)) + { + int[] array2 = new int[10]; + int num45 = 0; + for (int num46 = 0; num46 < 200; num46++) + { + if (Main.npc[num46].active && (Main.npc[num46].type == 18 || Main.npc[num46].type == 20 || Main.npc[num46].type == 124 || Main.npc[num46].type == 178 || Main.npc[num46].type == 208)) + { + array2[num45] = num46; + num45++; + if (num45 >= 9) + { + break; + } + } + } + if (num45 > 0) + { + int num47 = array2[Main.rand.Next(num45)]; + Main.npc[num47].position.X = (float)(num39 - Main.npc[num47].width / 2); + Main.npc[num47].position.Y = (float)(num40 - Main.npc[num47].height - 1); + NetMessage.SendData(23, -1, -1, "", num47, 0f, 0f, 0f, 0); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (num41 >= 0) + { + Main.npc[num41].value = 0f; + Main.npc[num41].npcSlots = 0f; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + WorldGen.hitWire(i - 1, j, wireType); + WorldGen.hitWire(i + 1, j, wireType); + WorldGen.hitWire(i, j - 1, wireType); + WorldGen.hitWire(i, j + 1, wireType); + } + public static void KillWall(int i, int j, bool fail = false) + { + if (i >= 0 && j >= 0 && i < Main.maxTilesX && j < Main.maxTilesY) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].wall > 0) + { + if (Main.tile[i, j].wall == 21) + { + Main.PlaySound(13, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].wall >= 63 && Main.tile[i, j].wall <= 70) + { + Main.PlaySound(6, i * 16, j * 16, 1); + } + else + { + Main.PlaySound(0, i * 16, j * 16, 1); + } + } + int num = 10; + if (fail) + { + num = 3; + } + for (int k = 0; k < num; k++) + { + int type = 0; + if (Main.tile[i, j].wall == 1 || Main.tile[i, j].wall == 5 || Main.tile[i, j].wall == 6 || Main.tile[i, j].wall == 7 || Main.tile[i, j].wall == 107 || Main.tile[i, j].wall == 8 || Main.tile[i, j].wall == 9 || (Main.tile[i, j].wall >= 48 && Main.tile[i, j].wall <= 53) || (Main.tile[i, j].wall >= 54 && Main.tile[i, j].wall <= 58)) + { + type = 1; + } + if (Main.tile[i, j].wall >= 94 && Main.tile[i, j].wall <= 105) + { + type = 1; + } + if (Main.tile[i, j].wall == 3) + { + if (WorldGen.genRand.Next(2) == 0) + { + type = 14; + } + else + { + type = 1; + } + } + if (Main.tile[i, j].wall == 35) + { + type = 37; + } + if (Main.tile[i, j].wall == 4 || Main.tile[i, j].wall == 106) + { + type = 7; + } + if (Main.tile[i, j].wall == 12) + { + type = 9; + } + if (Main.tile[i, j].wall == 10) + { + type = 10; + } + if (Main.tile[i, j].wall == 11) + { + type = 11; + } + if (Main.tile[i, j].wall == 21) + { + type = 13; + } + if (Main.tile[i, j].wall == 34) + { + type = 32; + } + if (Main.tile[i, j].wall == 22 || Main.tile[i, j].wall == 28) + { + type = 51; + } + if (Main.tile[i, j].wall == 23) + { + type = 38; + } + if (Main.tile[i, j].wall == 24) + { + type = 36; + } + if (Main.tile[i, j].wall == 25) + { + type = 48; + } + if (Main.tile[i, j].wall == 26 || Main.tile[i, j].wall == 30) + { + type = 49; + } + if (Main.tile[i, j].wall == 29 || Main.tile[i, j].wall == 32) + { + type = 50; + } + if (Main.tile[i, j].wall == 31) + { + type = 51; + } + if (Main.tile[i, j].wall == 14 || Main.tile[i, j].wall == 20) + { + type = 109; + } + if (Main.tile[i, j].wall >= 88 && Main.tile[i, j].wall <= 93) + { + type = (int)(86 + Main.tile[i, j].wall - 88); + if (Main.tile[i, j].wall == 93) + { + type = WorldGen.genRand.Next(88, 94); + } + } + if (Main.tile[i, j].wall == 33) + { + type = 14; + } + if (Main.tile[i, j].wall == 41) + { + type = 77; + } + if (Main.tile[i, j].wall == 42) + { + type = 78; + } + if (Main.tile[i, j].wall == 43) + { + type = 78; + } + if (Main.tile[i, j].wall == 43) + { + type = 78; + } + if (Main.tile[i, j].wall == 36) + { + type = 26; + } + if (Main.tile[i, j].wall == 37) + { + type = 32; + } + if (Main.tile[i, j].wall == 38) + { + type = 2; + } + if (Main.tile[i, j].wall == 39) + { + type = 1; + } + if (Main.tile[i, j].wall == 40) + { + type = 51; + } + if (Main.tile[i, j].wall == 45) + { + type = 81; + } + if (Main.tile[i, j].wall == 46) + { + type = 83; + } + if (Main.tile[i, j].wall == 47) + { + type = 84; + } + if (Main.tile[i, j].wall == 85) + { + type = 126; + } + if (Main.tile[i, j].wall == 59) + { + type = 0; + } + if (Main.tile[i, j].wall == 60) + { + type = 1; + } + if (Main.tile[i, j].wall == 61) + { + type = 0; + } + if (Main.tile[i, j].wall == 62) + { + type = 0; + } + if (Main.tile[i, j].wall == 63) + { + type = 3; + } + if (Main.tile[i, j].wall == 65) + { + type = 3; + } + if (Main.tile[i, j].wall == 66) + { + type = 3; + } + if (Main.tile[i, j].wall == 68) + { + type = 3; + } + if (Main.tile[i, j].wall == 64) + { + type = 40; + } + if (Main.tile[i, j].wall == 67) + { + type = 40; + } + if (Main.tile[i, j].wall == 84) + { + type = 80; + } + if (Main.tile[i, j].wall == 71) + { + type = 80; + } + if (Main.tile[i, j].wall == 71) + { + type = 80; + } + if (Main.tile[i, j].wall == 109) + { + type = 144; + } + if (Main.tile[i, j].wall == 110) + { + type = 145; + } + if (Main.tile[i, j].wall == 111) + { + type = 146; + } + if (Main.tile[i, j].wall == 86 || Main.tile[i, j].wall == 108) + { + type = 147; + } + if (Main.tile[i, j].wall == 87) + { + type = 148; + } + if (Main.tile[i, j].wall == 83) + { + type = 117; + if (WorldGen.genRand.Next(2) == 0) + { + type = 1; + } + } + if (Main.tile[i, j].wall == 81) + { + type = 123; + } + if (Main.tile[i, j].wall == 72) + { + type = 40; + } + if (Main.tile[i, j].wall == 73) + { + type = 16; + } + if (Main.tile[i, j].wall == 74 || Main.tile[i, j].wall == 80) + { + type = 26; + } + if (Main.tile[i, j].wall == 75) + { + type = 26; + } + if (Main.tile[i, j].wall == 76) + { + type = 4; + } + if (Main.tile[i, j].wall == 77 || Main.tile[i, j].wall == 81) + { + type = 5; + } + if (Main.tile[i, j].wall == 78) + { + type = 7; + } + if (Main.tile[i, j].wall == 79) + { + type = 37; + } + if (Main.tile[i, j].wall == 82) + { + type = 36; + } + if (Main.tile[i, j].wall == 69) + { + if (WorldGen.genRand.Next(2) == 0) + { + type = 14; + } + else + { + type = 17; + } + } + if (Main.tile[i, j].wall == 70) + { + type = 47; + } + if (Main.tile[i, j].wall == 27) + { + if (WorldGen.genRand.Next(2) == 0) + { + type = 7; + } + else + { + type = 1; + } + } + if (Main.tile[i, j].wall == 44) + { + int num2 = Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.75f); + Main.dust[num2].noGravity = true; + } + else + { + if (Main.tile[i, j].wall == 76) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, type, 0f, 0f, 75, new Color(0, 80, 255, 100), 0.75f); + } + else + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, type, 0f, 0f, 0, default(Color), 1f); + } + } + } + if (fail) + { + WorldGen.SquareWallFrame(i, j, true); + return; + } + int num3 = 0; + if (Main.tile[i, j].wall == 1) + { + num3 = 26; + } + if (Main.tile[i, j].wall == 4) + { + num3 = 93; + } + if (Main.tile[i, j].wall == 5) + { + num3 = 130; + } + if (Main.tile[i, j].wall == 6) + { + num3 = 132; + } + if (Main.tile[i, j].wall == 7) + { + num3 = 135; + } + if (Main.tile[i, j].wall == 8) + { + num3 = 138; + } + if (Main.tile[i, j].wall == 9) + { + num3 = 140; + } + if (Main.tile[i, j].wall == 10) + { + num3 = 142; + } + if (Main.tile[i, j].wall == 11) + { + num3 = 144; + } + if (Main.tile[i, j].wall == 12) + { + num3 = 146; + } + if (Main.tile[i, j].wall == 14) + { + num3 = 330; + } + if (Main.tile[i, j].wall == 16) + { + num3 = 30; + } + if (Main.tile[i, j].wall == 17) + { + num3 = 135; + } + if (Main.tile[i, j].wall == 18) + { + num3 = 138; + } + if (Main.tile[i, j].wall == 19) + { + num3 = 140; + } + if (Main.tile[i, j].wall == 20) + { + num3 = 330; + } + if (Main.tile[i, j].wall == 21) + { + num3 = 392; + } + if (Main.tile[i, j].wall == 86 || Main.tile[i, j].wall == 108) + { + num3 = 1126; + } + if (Main.tile[i, j].wall == 22) + { + num3 = 417; + } + if (Main.tile[i, j].wall == 23) + { + num3 = 418; + } + if (Main.tile[i, j].wall == 24) + { + num3 = 419; + } + if (Main.tile[i, j].wall == 25) + { + num3 = 420; + } + if (Main.tile[i, j].wall == 26) + { + num3 = 421; + } + if (Main.tile[i, j].wall == 29) + { + num3 = 587; + } + if (Main.tile[i, j].wall == 30) + { + num3 = 592; + } + if (Main.tile[i, j].wall == 31) + { + num3 = 595; + } + if (Main.tile[i, j].wall == 32) + { + num3 = 605; + } + if (Main.tile[i, j].wall == 33) + { + num3 = 606; + } + if (Main.tile[i, j].wall == 34) + { + num3 = 608; + } + if (Main.tile[i, j].wall == 35) + { + num3 = 610; + } + if (Main.tile[i, j].wall == 36) + { + num3 = 615; + } + if (Main.tile[i, j].wall == 37) + { + num3 = 616; + } + if (Main.tile[i, j].wall == 38) + { + num3 = 617; + } + if (Main.tile[i, j].wall == 39) + { + num3 = 618; + } + if (Main.tile[i, j].wall == 41) + { + num3 = 622; + } + if (Main.tile[i, j].wall == 42) + { + num3 = 623; + } + if (Main.tile[i, j].wall == 43) + { + num3 = 624; + } + if (Main.tile[i, j].wall == 44) + { + num3 = 663; + } + if (Main.tile[i, j].wall == 45) + { + num3 = 720; + } + if (Main.tile[i, j].wall == 46) + { + num3 = 721; + } + if (Main.tile[i, j].wall == 47) + { + num3 = 722; + } + if (Main.tile[i, j].wall == 66) + { + num3 = 745; + } + if (Main.tile[i, j].wall == 67) + { + num3 = 746; + } + if (Main.tile[i, j].wall == 68) + { + num3 = 747; + } + if (Main.tile[i, j].wall == 84) + { + num3 = 884; + } + if (Main.tile[i, j].wall == 72) + { + num3 = 750; + } + if (Main.tile[i, j].wall == 73) + { + num3 = 752; + } + if (Main.tile[i, j].wall == 74) + { + num3 = 764; + } + if (Main.tile[i, j].wall == 85) + { + num3 = 927; + } + if (Main.tile[i, j].wall == 75) + { + num3 = 768; + } + if (Main.tile[i, j].wall == 76) + { + num3 = 769; + } + if (Main.tile[i, j].wall == 82) + { + num3 = 825; + } + if (Main.tile[i, j].wall == 27) + { + num3 = 479; + } + if (Main.tile[i, j].wall == 106) + { + num3 = 1447; + } + if (Main.tile[i, j].wall == 107) + { + num3 = 1448; + } + if (Main.tile[i, j].wall == 109) + { + num3 = 1590; + } + if (Main.tile[i, j].wall == 110) + { + num3 = 1592; + } + if (Main.tile[i, j].wall == 111) + { + num3 = 1594; + } + if (Main.tile[i, j].wall == 78) + { + num3 = 1723; + } + if (Main.tile[i, j].wall == 87 || Main.tile[i, j].wall == 112) + { + num3 = 1102; + } + if (Main.tile[i, j].wall == 94 || Main.tile[i, j].wall == 100) + { + num3 = 1378; + } + if (Main.tile[i, j].wall == 95 || Main.tile[i, j].wall == 101) + { + num3 = 1379; + } + if (Main.tile[i, j].wall == 96 || Main.tile[i, j].wall == 102) + { + num3 = 1380; + } + if (Main.tile[i, j].wall == 97 || Main.tile[i, j].wall == 103) + { + num3 = 1381; + } + if (Main.tile[i, j].wall == 98 || Main.tile[i, j].wall == 104) + { + num3 = 1382; + } + if (Main.tile[i, j].wall == 99 || Main.tile[i, j].wall == 105) + { + num3 = 1383; + } + if (Main.tile[i, j].wall >= 88 && Main.tile[i, j].wall <= 93) + { + num3 = 1267 + (int)Main.tile[i, j].wall - 88; + } + if (num3 > 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, num3, 1, false, 0, false); + } + Main.tile[i, j].wall = 0; + Main.tile[i, j].wallColor(0); + WorldGen.SquareWallFrame(i, j, true); + if (Main.tile[i, j].type == 240 || Main.tile[i, j].type == 241 || Main.tile[i, j].type == 242 || Main.tile[i, j].type == 245 || Main.tile[i, j].type == 246 || Main.tile[i, j].type == 4) + { + WorldGen.TileFrame(i, j, false, false); + } + } + } + } + public static void LaunchRocket(int x, int y) + { + int i = (int)Main.tile[x, y].frameY; + int num = 0; + while (i >= 40) + { + i -= 40; + num++; + } + if (i == 18) + { + y--; + } + Vector2 vector = new Vector2((float)(x * 16 + 8), (float)(y * 16 + 4)); + int type = 167 + num; + int damage = 150; + int num2 = 7; + Projectile.NewProjectile(vector.X, vector.Y + 2f, 0f, -8f, type, damage, (float)num2, Main.myPlayer, 0f, 0f); + Main.tile[x, y].active(false); + Main.tile[x, y + 1].active(false); + NetMessage.SendTileSquare(-1, x - 1, y, 3); + } + public static void KillTile(int i, int j, bool fail = false, bool effectOnly = false, bool noItem = false) + { + if (i >= 0 && j >= 0 && i < Main.maxTilesX && j < Main.maxTilesY) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].active()) + { + if (j >= 1 && Main.tile[i, j - 1] == null) + { + Main.tile[i, j - 1] = new Tile(); + } + if (j >= 1 && Main.tile[i, j - 1].active() && ((Main.tile[i, j - 1].type == 5 && Main.tile[i, j].type != 5) || (Main.tile[i, j - 1].type == 21 && Main.tile[i, j].type != 21) || (Main.tile[i, j - 1].type == 26 && Main.tile[i, j].type != 26) || (Main.tile[i, j - 1].type == 72 && Main.tile[i, j].type != 72) || (Main.tile[i, j - 1].type == 12 && Main.tile[i, j].type != 12)) && (Main.tile[i, j - 1].type != 5 || ((Main.tile[i, j - 1].frameX != 66 || Main.tile[i, j - 1].frameY < 0 || Main.tile[i, j - 1].frameY > 44) && (Main.tile[i, j - 1].frameX != 88 || Main.tile[i, j - 1].frameY < 66 || Main.tile[i, j - 1].frameY > 110) && Main.tile[i, j - 1].frameY < 198))) + { + return; + } + if (Main.tile[i, j].type == 10 && Main.tile[i, j].frameY >= 594 && Main.tile[i, j].frameY <= 646) + { + fail = true; + } + if (!effectOnly && !WorldGen.stopDrops) + { + if (Main.tile[i, j].type == 127) + { + Main.PlaySound(2, i * 16, j * 16, 27); + } + else + { + if (Main.tile[i, j].type == 147 || Main.tile[i, j].type == 224) + { + Main.PlaySound(2, i * 16, j * 16, WorldGen.genRand.Next(48, 50)); + } + else + { + if (Main.tile[i, j].type == 161 || Main.tile[i, j].type == 163 || Main.tile[i, j].type == 164 || Main.tile[i, j].type == 200) + { + Main.PlaySound(2, i * 16, j * 16, 50); + } + else + { + if (Main.tile[i, j].type == 3 || Main.tile[i, j].type == 110) + { + Main.PlaySound(6, i * 16, j * 16, 1); + if (Main.tile[i, j].frameX == 144) + { + Item.NewItem(i * 16, j * 16, 16, 16, 5, 1, false, 0, false); + } + } + else + { + if (Main.tile[i, j].type == 24) + { + Main.PlaySound(6, i * 16, j * 16, 1); + if (Main.tile[i, j].frameX == 144) + { + Item.NewItem(i * 16, j * 16, 16, 16, 60, 1, false, 0, false); + } + } + else + { + if (Main.tileAlch[(int)Main.tile[i, j].type] || Main.tile[i, j].type == 32 || Main.tile[i, j].type == 51 || Main.tile[i, j].type == 52 || Main.tile[i, j].type == 61 || Main.tile[i, j].type == 62 || Main.tile[i, j].type == 69 || Main.tile[i, j].type == 71 || Main.tile[i, j].type == 73 || Main.tile[i, j].type == 74 || Main.tile[i, j].type == 113 || Main.tile[i, j].type == 115 || Main.tile[i, j].type == 184 || Main.tile[i, j].type == 192 || Main.tile[i, j].type == 205 || Main.tile[i, j].type == 233) + { + Main.PlaySound(6, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].type == 201) + { + Main.PlaySound(6, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].type == 1 || Main.tile[i, j].type == 6 || Main.tile[i, j].type == 7 || Main.tile[i, j].type == 8 || Main.tile[i, j].type == 9 || Main.tile[i, j].type == 22 || Main.tile[i, j].type == 140 || Main.tile[i, j].type == 25 || Main.tile[i, j].type == 37 || Main.tile[i, j].type == 38 || Main.tile[i, j].type == 39 || Main.tile[i, j].type == 41 || Main.tile[i, j].type == 43 || Main.tile[i, j].type == 44 || Main.tile[i, j].type == 45 || Main.tile[i, j].type == 46 || Main.tile[i, j].type == 47 || Main.tile[i, j].type == 48 || Main.tile[i, j].type == 56 || Main.tile[i, j].type == 58 || Main.tile[i, j].type == 63 || Main.tile[i, j].type == 64 || Main.tile[i, j].type == 65 || Main.tile[i, j].type == 66 || Main.tile[i, j].type == 67 || Main.tile[i, j].type == 68 || Main.tile[i, j].type == 75 || Main.tile[i, j].type == 76 || Main.tile[i, j].type == 107 || Main.tile[i, j].type == 108 || Main.tile[i, j].type == 111 || Main.tile[i, j].type == 117 || Main.tile[i, j].type == 118 || Main.tile[i, j].type == 119 || Main.tile[i, j].type == 120 || Main.tile[i, j].type == 121 || Main.tile[i, j].type == 122 || Main.tile[i, j].type == 150 || Main.tile[i, j].type == 151 || Main.tile[i, j].type == 152 || Main.tile[i, j].type == 153 || Main.tile[i, j].type == 154 || Main.tile[i, j].type == 155 || Main.tile[i, j].type == 156 || Main.tile[i, j].type == 160 || Main.tile[i, j].type == 161 || Main.tile[i, j].type == 166 || Main.tile[i, j].type == 167 || Main.tile[i, j].type == 168 || Main.tile[i, j].type == 169 || Main.tile[i, j].type == 175 || Main.tile[i, j].type == 176 || Main.tile[i, j].type == 177 || Main.tile[i, j].type == 203 || Main.tile[i, j].type == 202 || Main.tile[i, j].type == 204 || Main.tile[i, j].type == 206 || Main.tile[i, j].type == 211 || Main.tile[i, j].type == 221 || Main.tile[i, j].type == 222 || Main.tile[i, j].type == 223 || Main.tile[i, j].type == 226 || Main.tile[i, j].type == 248 || Main.tile[i, j].type == 249 || Main.tile[i, j].type == 250) + { + Main.PlaySound(21, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].type == 231) + { + Main.PlaySound(4, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].type == 26 && Main.tile[i, j].frameX >= 54) + { + Main.PlaySound(4, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].type != 138) + { + Main.PlaySound(0, i * 16, j * 16, 1); + } + } + } + } + } + } + } + } + } + } + } + if ((Main.tile[i, j].type == 162 || Main.tile[i, j].type == 129 || (Main.tile[i, j].type == 165 && Main.tile[i, j].frameX < 54)) && !fail) + { + Main.PlaySound(2, i * 16, j * 16, 27); + } + } + int num = 10; + if (Main.tile[i, j].type == 231) + { + num = 6; + } + if (Main.tile[i, j].type == 128) + { + int num2 = i; + int k = (int)Main.tile[i, j].frameX; + int l; + for (l = (int)Main.tile[i, j].frameX; l >= 100; l -= 100) + { + } + while (l >= 36) + { + l -= 36; + } + if (l == 18) + { + k = (int)Main.tile[i - 1, j].frameX; + num2--; + } + if (k >= 100) + { + int num3 = 0; + while (k >= 100) + { + k -= 100; + num3++; + } + int num4 = (int)(Main.tile[num2, j].frameY / 18); + if (num4 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, Item.headType[num3], 1, false, 0, false); + } + if (num4 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, Item.bodyType[num3], 1, false, 0, false); + } + if (num4 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, Item.legType[num3], 1, false, 0, false); + } + for (k = (int)Main.tile[num2, j].frameX; k >= 100; k -= 100) + { + } + Main.tile[num2, j].frameX = (short)k; + } + } + if (fail) + { + num = 3; + } + if (Main.tile[i, j].type == 138) + { + num = 0; + } + for (int m = 0; m < num; m++) + { + int num5 = 0; + if (Main.tile[i, j].type == 216) + { + num5 = -1; + } + if (Main.tile[i, j].type == 0) + { + num5 = 0; + } + if (Main.tile[i, j].type == 192) + { + num5 = 3; + } + if (Main.tile[i, j].type == 208) + { + num5 = 126; + } + if (Main.tile[i, j].type == 16) + { + num5 = 1; + if (Main.tile[i, j].frameX >= 36) + { + num5 = 82; + } + } + if (Main.tile[i, j].type == 1 || Main.tile[i, j].type == 17 || Main.tile[i, j].type == 38 || Main.tile[i, j].type == 39 || Main.tile[i, j].type == 41 || Main.tile[i, j].type == 43 || Main.tile[i, j].type == 44 || Main.tile[i, j].type == 48 || Main.tileStone[(int)Main.tile[i, j].type] || Main.tile[i, j].type == 85 || Main.tile[i, j].type == 90 || Main.tile[i, j].type == 92 || Main.tile[i, j].type == 96 || Main.tile[i, j].type == 97 || Main.tile[i, j].type == 99 || Main.tile[i, j].type == 117 || Main.tile[i, j].type == 130 || Main.tile[i, j].type == 131 || Main.tile[i, j].type == 132 || Main.tile[i, j].type == 135 || Main.tile[i, j].type == 135 || Main.tile[i, j].type == 142 || Main.tile[i, j].type == 143 || Main.tile[i, j].type == 144 || Main.tile[i, j].type == 210 || Main.tile[i, j].type == 207 || Main.tile[i, j].type == 235 || Main.tile[i, j].type == 247) + { + num5 = 1; + } + if (Main.tile[i, j].type == 95 || Main.tile[i, j].type == 98 || Main.tile[i, j].type == 100 || Main.tile[i, j].type == 174 || Main.tile[i, j].type == 173) + { + num5 = 6; + } + if (Main.tile[i, j].type == 30 || Main.tile[i, j].type == 86 || Main.tile[i, j].type == 89 || Main.tile[i, j].type == 93 || Main.tile[i, j].type == 94 || Main.tile[i, j].type == 104 || Main.tile[i, j].type == 106 || Main.tile[i, j].type == 114 || Main.tile[i, j].type == 124 || Main.tile[i, j].type == 128 || Main.tile[i, j].type == 139) + { + num5 = 7; + } + if (Main.tile[i, j].type == 10 || Main.tile[i, j].type == 11) + { + num5 = -1; + } + if (Main.tile[i, j].type == 240) + { + int num6 = (int)(Main.tile[i, j].frameX / 54); + num5 = 7; + if (num6 == 16 || num6 == 17) + { + num5 = 26; + } + } + if (Main.tile[i, j].type == 241) + { + num5 = 1; + } + if (Main.tile[i, j].type == 242) + { + num5 = 7; + } + if (Main.tile[i, j].type == 101) + { + int num7 = (int)(Main.tile[i, j].frameX / 54); + if (num7 == 0) + { + num5 = 7; + } + else + { + if (num7 == 4) + { + num5 = 109; + } + else + { + if (num7 == 5) + { + num5 = 126; + } + else + { + num5 = 1; + } + } + } + } + if (Main.tile[i, j].type == 19) + { + int num8 = (int)(Main.tile[i, j].frameY / 18); + if (num8 == 0 || num8 == 9 || num8 == 10 || num8 == 11 || num8 == 12) + { + num5 = 7; + } + else + { + if (num8 == 1) + { + num5 = 77; + } + else + { + if (num8 == 2) + { + num5 = 78; + } + else + { + if (num8 == 3) + { + num5 = 79; + } + else + { + if (num8 == 4) + { + num5 = 26; + } + else + { + if (num8 == 5) + { + num5 = 126; + } + else + { + if (num8 == 13) + { + num5 = 109; + } + else + { + if (num8 == 14) + { + num5 = 13; + } + else + { + num5 = 1; + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 79) + { + int num9 = (int)(Main.tile[i, j].frameY / 36); + if (num9 == 0) + { + num5 = 7; + } + else + { + if (num9 == 1) + { + num5 = 77; + } + else + { + if (num9 == 2) + { + num5 = 78; + } + else + { + if (num9 == 3) + { + num5 = 79; + } + else + { + if (num9 == 4) + { + num5 = 126; + } + else + { + if (num9 == 8) + { + num5 = 109; + } + else + { + if (num9 >= 9) + { + num5 = -1; + } + else + { + num5 = 1; + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 18) + { + int num10 = (int)(Main.tile[i, j].frameX / 36); + if (num10 == 0) + { + num5 = 7; + } + else + { + if (num10 == 1) + { + num5 = 77; + } + else + { + if (num10 == 2) + { + num5 = 78; + } + else + { + if (num10 == 3) + { + num5 = 79; + } + else + { + if (num10 == 4) + { + num5 = 26; + } + else + { + if (num10 == 5) + { + num5 = 40; + } + else + { + if (num10 == 6) + { + num5 = 5; + } + else + { + if (num10 == 7) + { + num5 = 26; + } + else + { + if (num10 == 8) + { + num5 = 4; + } + else + { + if (num10 == 9) + { + num5 = 126; + } + else + { + if (num10 == 10) + { + num5 = 148; + } + else + { + if (num10 == 11 || num10 == 12 || num10 == 13) + { + num5 = 1; + } + else + { + if (num10 == 14) + { + num5 = 109; + } + else + { + if (num10 == 15) + { + num5 = 126; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 14 || Main.tile[i, j].type == 87 || Main.tile[i, j].type == 88) + { + int num11 = (int)(Main.tile[i, j].frameX / 54); + if (num11 == 0) + { + num5 = 7; + } + else + { + if (num11 == 1) + { + num5 = 77; + } + else + { + if (num11 == 2) + { + num5 = 78; + } + else + { + if (num11 == 3) + { + num5 = 79; + } + } + } + } + if (Main.tile[i, j].type == 14 && num11 >= 15) + { + num5 = -1; + } + if (Main.tile[i, j].type == 14 && num11 == 9) + { + num5 = 148; + } + if (Main.tile[i, j].type == 14 && num11 == 8) + { + num5 = 126; + } + if (Main.tile[i, j].type != 14 && num11 == 4) + { + num5 = 126; + } + if (Main.tile[i, j].type == 14 && num11 == 4) + { + num5 = 26; + } + if (Main.tile[i, j].type == 14 && num11 == 5) + { + num5 = 5; + } + if (Main.tile[i, j].type == 14 && num11 == 6) + { + num5 = 7; + } + if (Main.tile[i, j].type == 14 && num11 == 7) + { + num5 = 116; + } + if (Main.tile[i, j].type == 14 && (num11 == 10 || num11 == 11 || num11 == 12)) + { + num5 = 1; + } + if (Main.tile[i, j].type == 14 && num11 == 13) + { + num5 = 109; + } + if (Main.tile[i, j].type == 14 && num11 == 14) + { + num5 = 126; + } + } + if (Main.tile[i, j].type == 178) + { + int num12 = (int)(Main.tile[i, j].frameX / 18); + num5 = 86 + num12; + if (num12 == 6) + { + num5 = 138; + } + } + if (Main.tile[i, j].type == 186) + { + if (Main.tile[i, j].frameX <= 360) + { + num5 = 26; + } + else + { + if (Main.tile[i, j].frameX <= 846) + { + num5 = 1; + } + else + { + if (Main.tile[i, j].frameX <= 954) + { + num5 = 9; + } + else + { + if (Main.tile[i, j].frameX <= 1062) + { + num5 = 11; + } + else + { + if (Main.tile[i, j].frameX <= 1170) + { + num5 = 10; + } + else + { + if (Main.tile[i, j].frameX <= 1332) + { + num5 = 0; + } + else + { + if (Main.tile[i, j].frameX <= 1386) + { + num5 = 10; + } + else + { + num5 = 80; + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 187) + { + if (Main.tile[i, j].frameX <= 144) + { + num5 = 1; + } + else + { + if (Main.tile[i, j].frameX <= 306) + { + num5 = 38; + } + else + { + if (Main.tile[i, j].frameX <= 468) + { + num5 = 36; + } + else + { + if (Main.tile[i, j].frameX <= 738) + { + num5 = 30; + } + else + { + if (Main.tile[i, j].frameX <= 970) + { + num5 = 1; + } + else + { + if (Main.tile[i, j].frameX <= 1132) + { + num5 = 148; + } + else + { + if (Main.tile[i, j].frameX <= 1132) + { + num5 = 155; + } + else + { + if (Main.tile[i, j].frameX <= 1348) + { + num5 = 1; + } + else + { + if (Main.tile[i, j].frameX <= 1564) + { + num5 = 0; + } + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 105) + { + num5 = 1; + if (Main.tile[i, j].frameX >= 1548 && Main.tile[i, j].frameX <= 1654) + { + num5 = 148; + } + } + if (Main.tile[i, j].type == 239) + { + int num13 = (int)(Main.tile[i, j].frameX / 18); + if (num13 == 0) + { + num5 = 9; + } + if (num13 == 1) + { + num5 = 81; + } + if (num13 == 2) + { + num5 = 8; + } + if (num13 == 3) + { + num5 = 82; + } + if (num13 == 4) + { + num5 = 11; + } + if (num13 == 5) + { + num5 = 83; + } + if (num13 == 6) + { + num5 = 10; + } + if (num13 == 7) + { + num5 = 84; + } + if (num13 == 8) + { + num5 = 14; + } + if (num13 == 9) + { + num5 = 23; + } + if (num13 == 10) + { + num5 = 25; + } + if (num13 == 11) + { + num5 = 48; + } + if (num13 == 12) + { + num5 = 144; + } + if (num13 == 13) + { + num5 = 49; + } + if (num13 == 14) + { + num5 = 145; + } + if (num13 == 15) + { + num5 = 50; + } + if (num13 == 16) + { + num5 = 146; + } + if (num13 == 17) + { + num5 = 128; + } + if (num13 == 18) + { + num5 = 84; + } + if (num13 == 19) + { + num5 = 117; + } + if (num13 == 20) + { + num5 = 26; + } + } + if (Main.tile[i, j].type == 185) + { + if (Main.tile[i, j].frameY == 18) + { + int num14 = (int)(Main.tile[i, j].frameX / 36); + if (num14 < 6) + { + num5 = 1; + } + else + { + if (num14 < 16) + { + num5 = 26; + } + else + { + if (num14 == 16) + { + num5 = 9; + } + else + { + if (num14 == 17) + { + num5 = 11; + } + else + { + if (num14 == 18) + { + num5 = 10; + } + else + { + if (num14 == 19) + { + num5 = 86; + } + else + { + if (num14 == 20) + { + num5 = 87; + } + else + { + if (num14 == 21) + { + num5 = 88; + } + else + { + if (num14 == 22) + { + num5 = 89; + } + else + { + if (num14 == 23) + { + num5 = 90; + } + else + { + if (num14 == 24) + { + num5 = 91; + } + else + { + if (num14 < 31) + { + num5 = 80; + } + else + { + if (num14 < 33) + { + num5 = 7; + } + else + { + if (num14 < 34) + { + num5 = 8; + } + else + { + if (num14 < 39) + { + num5 = 30; + } + else + { + if (num14 < 42) + { + num5 = 1; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + int num15 = (int)(Main.tile[i, j].frameX / 18); + if (num15 < 6) + { + num5 = 1; + } + else + { + if (num15 < 12) + { + num5 = 0; + } + else + { + if (num15 < 27) + { + num5 = 26; + } + else + { + if (num15 < 32) + { + num5 = 1; + } + else + { + if (num15 < 35) + { + num5 = 0; + } + else + { + if (num15 < 46) + { + num5 = 80; + } + else + { + if (num15 < 52) + { + num5 = 30; + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 184) + { + int num16 = (int)(Main.tile[i, j].frameX / 22); + num5 = 93 + num16; + } + if (Main.tile[i, j].type == 237) + { + num5 = 148; + } + if (Main.tile[i, j].type == 157) + { + num5 = 77; + } + if (Main.tile[i, j].type == 158 || Main.tile[i, j].type == 232) + { + num5 = 78; + } + if (Main.tile[i, j].type == 159) + { + num5 = 78; + } + if (Main.tile[i, j].type == 15) + { + if (Main.tile[i, j].frameY >= 720) + { + num5 = -1; + } + else + { + if (Main.tile[i, j].frameY >= 680) + { + num5 = 126; + } + else + { + if (Main.tile[i, j].frameY >= 640) + { + num5 = 109; + } + else + { + if (Main.tile[i, j].frameY >= 520) + { + num5 = 1; + } + else + { + if (Main.tile[i, j].frameY >= 480) + { + num5 = 148; + } + else + { + if (Main.tile[i, j].frameY >= 440) + { + num5 = 126; + } + else + { + if (Main.tile[i, j].frameY >= 400) + { + num5 = 116; + } + else + { + if (Main.tile[i, j].frameY >= 360) + { + num5 = 26; + } + else + { + if (Main.tile[i, j].frameY >= 320) + { + num5 = 5; + } + else + { + if (Main.tile[i, j].frameY >= 280) + { + num5 = 26; + } + else + { + if (Main.tile[i, j].frameY >= 240) + { + num5 = 40; + } + else + { + if (Main.tile[i, j].frameY >= 200) + { + num5 = 7; + } + else + { + if (Main.tile[i, j].frameY >= 160) + { + num5 = 79; + } + else + { + if (Main.tile[i, j].frameY >= 120) + { + num5 = 78; + } + else + { + if (Main.tile[i, j].frameY >= 80) + { + num5 = 77; + } + else + { + if (Main.tile[i, j].frameY >= 40) + { + num5 = 1; + } + else + { + num5 = 7; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 191) + { + num5 = 7; + } + if (Main.tile[i, j].type == 5) + { + num5 = 7; + if (i > 5 && i < Main.maxTilesX - 5) + { + int num17 = i; + int num18 = j; + if (Main.tile[i, j].frameX == 66 && Main.tile[i, j].frameY <= 45) + { + num17++; + } + if (Main.tile[i, j].frameX == 88 && Main.tile[i, j].frameY >= 66 && Main.tile[i, j].frameY <= 110) + { + num17--; + } + if (Main.tile[i, j].frameX == 22 && Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176) + { + num17--; + } + if (Main.tile[i, j].frameX == 44 && Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176) + { + num17++; + } + if (Main.tile[i, j].frameX == 44 && Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176) + { + num17++; + } + if (Main.tile[i, j].frameX == 44 && Main.tile[i, j].frameY >= 198) + { + num17++; + } + if (Main.tile[i, j].frameX == 66 && Main.tile[i, j].frameY >= 198) + { + num17--; + } + while (Main.tile[num17, num18] != null && (!Main.tile[num17, num18].active() || !Main.tileSolid[(int)Main.tile[num17, num18].type])) + { + num18++; + } + if (Main.tile[num17, num18] != null) + { + if (Main.tile[num17, num18].active() && Main.tile[num17, num18].type == 23) + { + num5 = 77; + } + if (Main.tile[num17, num18].active() && Main.tile[num17, num18].type == 60) + { + num5 = 78; + } + if (Main.tile[num17, num18].active() && Main.tile[num17, num18].type == 70) + { + num5 = 26; + } + if (Main.tile[num17, num18].active() && Main.tile[num17, num18].type == 109) + { + num5 = 79; + } + if (Main.tile[num17, num18].active() && Main.tile[num17, num18].type == 199) + { + num5 = 121; + } + if (Main.tile[num17, num18].active() && Main.tile[num17, num18].type == 147) + { + num5 = 122; + } + } + } + } + if (Main.tile[i, j].type == 137) + { + num5 = 1; + int num19 = (int)(Main.tile[i, j].frameY / 18); + if (num19 > 0) + { + num5 = 148; + } + } + if (Main.tile[i, j].type == 212) + { + num5 = -1; + } + if (Main.tile[i, j].type == 213) + { + num5 = 129; + } + if (Main.tile[i, j].type == 214) + { + num5 = 1; + } + if (Main.tile[i, j].type == 215) + { + num5 = 6; + } + if (Main.tile[i, j].type == 21) + { + if (Main.tile[i, j].frameX >= 612) + { + num5 = 11; + } + else + { + if (Main.tile[i, j].frameX >= 576) + { + num5 = 148; + } + else + { + if (Main.tile[i, j].frameX >= 540) + { + num5 = 26; + } + else + { + if (Main.tile[i, j].frameX >= 504) + { + num5 = 126; + } + else + { + if (Main.tile[i, j].frameX >= 468) + { + num5 = 116; + } + else + { + if (Main.tile[i, j].frameX >= 432) + { + num5 = 7; + } + else + { + if (Main.tile[i, j].frameX >= 396) + { + num5 = 11; + } + else + { + if (Main.tile[i, j].frameX >= 360) + { + num5 = 10; + } + else + { + if (Main.tile[i, j].frameX >= 324) + { + num5 = 79; + } + else + { + if (Main.tile[i, j].frameX >= 288) + { + num5 = 78; + } + else + { + if (Main.tile[i, j].frameX >= 252) + { + num5 = 77; + } + else + { + if (Main.tile[i, j].frameX >= 216) + { + num5 = 1; + } + else + { + if (Main.tile[i, j].frameX >= 180) + { + num5 = 7; + } + else + { + if (Main.tile[i, j].frameX >= 108) + { + num5 = 37; + } + else + { + if (Main.tile[i, j].frameX >= 36) + { + num5 = 10; + } + else + { + num5 = 7; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tile[i, j].type == 2) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 0; + } + else + { + num5 = 2; + } + } + if (Main.tile[i, j].type == 2) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 0; + } + else + { + num5 = 5; + } + } + if (Main.tileMoss[(int)Main.tile[i, j].type]) + { + num5 = (int)(Main.tile[i, j].type - 179 + 93); + } + if (Main.tile[i, j].type == 127) + { + num5 = 67; + } + if (Main.tile[i, j].type == 91) + { + num5 = -1; + } + if (Main.tile[i, j].type == 198) + { + num5 = 109; + } + if (Main.tile[i, j].type == 26) + { + if (Main.tile[i, j].frameX >= 54) + { + num5 = 5; + } + else + { + num5 = 8; + } + } + if (Main.tile[i, j].type == 6) + { + num5 = 8; + } + if (Main.tile[i, j].type == 7 || Main.tile[i, j].type == 34 || Main.tile[i, j].type == 47) + { + num5 = 9; + } + if (Main.tile[i, j].type == 8 || Main.tile[i, j].type == 36 || Main.tile[i, j].type == 45 || Main.tile[i, j].type == 102) + { + num5 = 10; + } + if (Main.tile[i, j].type == 9 || Main.tile[i, j].type == 35 || Main.tile[i, j].type == 42 || Main.tile[i, j].type == 46 || Main.tile[i, j].type == 126 || Main.tile[i, j].type == 136) + { + num5 = 11; + } + if (Main.tile[i, j].type == 166 || Main.tile[i, j].type == 170 || Main.tile[i, j].type == 175) + { + num5 = 81; + } + if (Main.tile[i, j].type == 167) + { + num5 = 82; + } + if (Main.tile[i, j].type == 168 || Main.tile[i, j].type == 171 || Main.tile[i, j].type == 176) + { + num5 = 83; + } + if (Main.tile[i, j].type == 169 || Main.tile[i, j].type == 172 || Main.tile[i, j].type == 177) + { + num5 = 84; + } + if (Main.tile[i, j].type == 199) + { + num5 = 117; + } + if (Main.tile[i, j].type == 205) + { + num5 = 125; + } + if (Main.tile[i, j].type == 201) + { + num5 = 125; + } + if (Main.tile[i, j].type == 211) + { + num5 = 128; + } + if (Main.tile[i, j].type == 227) + { + int num20 = (int)(Main.tile[i, j].frameX / 34); + if (num20 == 0 || num20 == 1) + { + num5 = 26; + } + else + { + if (num20 == 3) + { + num5 = 3; + } + else + { + if (num20 == 2 || num20 == 4 || num20 == 5 || num20 == 6) + { + num5 = 40; + } + else + { + if (num20 == 7) + { + num5 = 117; + } + } + } + } + } + if (Main.tile[i, j].type == 204) + { + num5 = 117; + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 1; + } + } + if (Main.tile[i, j].type == 203) + { + num5 = 117; + } + if (Main.tile[i, j].type == 243) + { + if (Main.rand.Next(2) == 0) + { + num5 = 7; + } + else + { + num5 = 13; + } + } + if (Main.tile[i, j].type == 244) + { + if (Main.rand.Next(2) == 0) + { + num5 = 1; + } + else + { + num5 = 13; + } + } + if (Main.tile[i, j].type == 189) + { + num5 = 16; + } + if (Main.tile[i, j].type == 12) + { + num5 = 12; + } + if (Main.tile[i, j].type == 3 || Main.tile[i, j].type == 73) + { + num5 = 3; + } + if (Main.tile[i, j].type == 13 || Main.tile[i, j].type == 54) + { + num5 = 13; + } + if (Main.tile[i, j].type == 22 || Main.tile[i, j].type == 140) + { + num5 = 14; + } + if (Main.tile[i, j].type == 78) + { + num5 = 22; + } + if (Main.tile[i, j].type == 28) + { + num5 = 22; + if (Main.tile[i, j].frameY >= 72 && Main.tile[i, j].frameY <= 90) + { + num5 = 1; + } + if (Main.tile[i, j].frameY >= 144 && Main.tile[i, j].frameY <= 234) + { + num5 = 48; + } + if (Main.tile[i, j].frameY >= 252 && Main.tile[i, j].frameY <= 358) + { + num5 = 85; + } + if (Main.tile[i, j].frameY >= 360 && Main.tile[i, j].frameY <= 466) + { + num5 = 26; + } + if (Main.tile[i, j].frameY >= 468 && Main.tile[i, j].frameY <= 574) + { + num5 = 36; + } + if (Main.tile[i, j].frameY >= 576 && Main.tile[i, j].frameY <= 790) + { + num5 = 18; + } + if (Main.tile[i, j].frameY >= 792 && Main.tile[i, j].frameY <= 898) + { + num5 = 5; + } + if (Main.tile[i, j].frameY >= 900 && Main.tile[i, j].frameY <= 1006) + { + num5 = 0; + } + if (Main.tile[i, j].frameY >= 1008 && Main.tile[i, j].frameY <= 1114) + { + num5 = 148; + } + } + if (Main.tile[i, j].type == 163) + { + num5 = 118; + } + if (Main.tile[i, j].type == 164) + { + num5 = 119; + } + if (Main.tile[i, j].type == 200) + { + num5 = 120; + } + if (Main.tile[i, j].type == 221 || Main.tile[i, j].type == 248) + { + num5 = 144; + } + if (Main.tile[i, j].type == 222 || Main.tile[i, j].type == 249) + { + num5 = 145; + } + if (Main.tile[i, j].type == 223 || Main.tile[i, j].type == 250) + { + num5 = 146; + } + if (Main.tile[i, j].type == 224) + { + num5 = 149; + } + if (Main.tile[i, j].type == 225) + { + num5 = 147; + } + if (Main.tile[i, j].type == 229) + { + num5 = 153; + } + if (Main.tile[i, j].type == 231) + { + num5 = 153; + if (Main.rand.Next(3) == 0) + { + num5 = 26; + } + } + if (Main.tile[i, j].type == 226) + { + num5 = 148; + } + if (Main.tile[i, j].type == 29) + { + num5 = 23; + } + if (Main.tile[i, j].type == 40 || Main.tile[i, j].type == 103) + { + num5 = 28; + } + if (Main.tile[i, j].type == 49) + { + num5 = 29; + } + if (Main.tile[i, j].type == 50) + { + num5 = 22; + } + if (Main.tile[i, j].type == 51) + { + num5 = 30; + } + if (Main.tile[i, j].type == 52) + { + num5 = 3; + } + if (Main.tile[i, j].type == 53 || Main.tile[i, j].type == 81 || Main.tile[i, j].type == 151 || Main.tile[i, j].type == 202) + { + num5 = 32; + } + if (Main.tile[i, j].type == 56 || Main.tile[i, j].type == 152) + { + num5 = 37; + } + if (Main.tile[i, j].type == 75) + { + num5 = 109; + } + if (Main.tile[i, j].type == 57 || Main.tile[i, j].type == 119 || Main.tile[i, j].type == 141 || Main.tile[i, j].type == 234) + { + num5 = 36; + } + if (Main.tile[i, j].type == 59 || Main.tile[i, j].type == 120) + { + num5 = 38; + } + if (Main.tile[i, j].type == 61 || Main.tile[i, j].type == 62 || Main.tile[i, j].type == 74 || Main.tile[i, j].type == 80 || Main.tile[i, j].type == 188 || Main.tile[i, j].type == 233 || Main.tile[i, j].type == 236) + { + num5 = 40; + } + if (Main.tile[i, j].type == 238) + { + if (WorldGen.genRand.Next(3) == 0) + { + num5 = 167; + } + else + { + num5 = 166; + } + } + if (Main.tile[i, j].type == 69) + { + num5 = 7; + } + if (Main.tile[i, j].type == 71 || Main.tile[i, j].type == 72 || Main.tile[i, j].type == 190) + { + num5 = 26; + } + if (Main.tile[i, j].type == 70) + { + num5 = 17; + } + if (Main.tile[i, j].type == 112) + { + num5 = 14; + } + if (Main.tile[i, j].type == 123) + { + num5 = 53; + } + if (Main.tile[i, j].type == 161) + { + num5 = 80; + } + if (Main.tile[i, j].type == 206) + { + num5 = 80; + } + if (Main.tile[i, j].type == 162) + { + num5 = 80; + } + if (Main.tile[i, j].type == 165) + { + if (Main.tile[i, j].frameX < 54) + { + num5 = 80; + } + else + { + if (Main.tile[i, j].frameX >= 162) + { + num5 = 147; + } + else + { + if (Main.tile[i, j].frameX >= 108) + { + num5 = 30; + } + else + { + num5 = 1; + } + } + } + } + if (Main.tile[i, j].type == 193) + { + num5 = 4; + } + if (Main.tile[i, j].type == 194) + { + num5 = 26; + } + if (Main.tile[i, j].type == 195) + { + num5 = 5; + } + if (Main.tile[i, j].type == 196) + { + num5 = 108; + } + if (Main.tile[i, j].type == 197) + { + num5 = 4; + } + if (Main.tile[i, j].type == 153) + { + num5 = 26; + } + if (Main.tile[i, j].type == 154) + { + num5 = 32; + } + if (Main.tile[i, j].type == 155) + { + num5 = 2; + } + if (Main.tile[i, j].type == 156) + { + num5 = 1; + } + if (Main.tile[i, j].type == 116 || Main.tile[i, j].type == 118 || Main.tile[i, j].type == 147 || Main.tile[i, j].type == 148) + { + num5 = 51; + } + if (Main.tile[i, j].type == 109) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 0; + } + else + { + num5 = 47; + } + } + if (Main.tile[i, j].type == 110 || Main.tile[i, j].type == 113 || Main.tile[i, j].type == 115) + { + num5 = 47; + } + if (Main.tile[i, j].type == 107 || Main.tile[i, j].type == 121) + { + num5 = 48; + } + if (Main.tile[i, j].type == 108 || Main.tile[i, j].type == 122 || Main.tile[i, j].type == 146) + { + num5 = 49; + } + if (Main.tile[i, j].type == 111 || Main.tile[i, j].type == 145 || Main.tile[i, j].type == 150) + { + num5 = 50; + } + if (Main.tile[i, j].type == 133) + { + num5 = 50; + if (Main.tile[i, j].frameX >= 54) + { + num5 = 146; + } + } + if (Main.tile[i, j].type == 134) + { + num5 = 49; + if (Main.tile[i, j].frameX >= 36) + { + num5 = 145; + } + } + if (Main.tile[i, j].type == 149) + { + num5 = 49; + } + if (Main.tileAlch[(int)Main.tile[i, j].type]) + { + int num21 = (int)(Main.tile[i, j].frameX / 18); + if (num21 == 0) + { + num5 = 3; + } + if (num21 == 1) + { + num5 = 3; + } + if (num21 == 2) + { + num5 = 7; + } + if (num21 == 3) + { + num5 = 17; + } + if (num21 == 4) + { + num5 = 3; + } + if (num21 == 5) + { + num5 = 6; + } + } + if (Main.tile[i, j].type == 61) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 38; + } + else + { + num5 = 39; + } + } + if (Main.tile[i, j].type == 58 || Main.tile[i, j].type == 76 || Main.tile[i, j].type == 77) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 6; + } + else + { + num5 = 25; + } + } + if (Main.tile[i, j].type == 37) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 6; + } + else + { + num5 = 23; + } + } + if (Main.tile[i, j].type == 32) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 14; + } + else + { + num5 = 24; + } + } + if (Main.tile[i, j].type == 23 || Main.tile[i, j].type == 24) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 14; + } + else + { + num5 = 17; + } + } + if (Main.tile[i, j].type == 25 || Main.tile[i, j].type == 31) + { + if (Main.tile[i, j].type == 31 && Main.tile[i, j].frameX >= 36) + { + num5 = 5; + } + else + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 14; + } + else + { + num5 = 1; + } + } + } + if (Main.tile[i, j].type == 20) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 7; + } + else + { + num5 = 2; + } + } + if (Main.tile[i, j].type == 27) + { + if (WorldGen.genRand.Next(2) == 0) + { + num5 = 3; + } + else + { + num5 = 19; + } + } + if (Main.tile[i, j].type == 129) + { + if (Main.tile[i, j].frameX == 0 || Main.tile[i, j].frameX == 54 || Main.tile[i, j].frameX == 108) + { + num5 = 68; + } + else + { + if (Main.tile[i, j].frameX == 18 || Main.tile[i, j].frameX == 72 || Main.tile[i, j].frameX == 126) + { + num5 = 69; + } + else + { + num5 = 70; + } + } + } + if (Main.tile[i, j].type == 4) + { + int num22 = (int)(Main.tile[i, j].frameY / 22); + if (num22 == 0) + { + num5 = 6; + } + else + { + if (num22 == 8) + { + num5 = 75; + } + else + { + if (num22 == 9) + { + num5 = 135; + } + else + { + if (num22 == 10) + { + num5 = 158; + } + else + { + if (num22 == 11) + { + num5 = 169; + } + else + { + num5 = 58 + num22; + } + } + } + } + } + } + if ((Main.tile[i, j].type == 34 || Main.tile[i, j].type == 35 || Main.tile[i, j].type == 36 || Main.tile[i, j].type == 42) && Main.rand.Next(2) == 0) + { + num5 = 6; + } + if (num5 >= 0) + { + if (Main.tile[i, j].type == 160) + { + int num23 = Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.75f); + Main.dust[num23].noGravity = true; + } + else + { + if (Main.tile[i, j].type == 178) + { + int num24 = Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, num5, 0f, 0f, 75, default(Color), 0.75f); + Main.dust[num24].noLight = true; + } + else + { + if (Main.tile[i, j].type == 193 || (Main.tile[i, j].type == 18 && num5 == 4)) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, num5, 0f, 0f, 75, new Color(0, 80, 255, 100), 0.75f); + } + else + { + if (Main.tile[i, j].type == 197) + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, num5, 0f, 0f, 75, new Color(97, 200, 255, 100), 0.75f); + } + else + { + if (Main.tile[i, j].type == 185 && num5 >= 86 && num5 <= 91) + { + int num25 = Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, num5, 0f, 0f, 75, default(Color), 0.75f); + Main.dust[num25].noLight = true; + } + else + { + Dust.NewDust(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16, num5, 0f, 0f, 0, default(Color), 1f); + } + } + } + } + } + } + } + if (effectOnly) + { + return; + } + if (fail) + { + if (Main.tile[i, j].type == 2 || Main.tile[i, j].type == 23 || Main.tile[i, j].type == 109 || Main.tile[i, j].type == 199) + { + Main.tile[i, j].type = 0; + } + if (Main.tile[i, j].type == 60 || Main.tile[i, j].type == 70) + { + Main.tile[i, j].type = 59; + } + if (Main.tileMoss[(int)Main.tile[i, j].type]) + { + Main.tile[i, j].type = 1; + } + WorldGen.SquareTileFrame(i, j, true); + return; + } + if (Main.tile[i, j].type == 21 && Main.netMode != 1) + { + int n = (int)(Main.tile[i, j].frameX / 18); + int y = j - (int)(Main.tile[i, j].frameY / 18); + while (n > 1) + { + n -= 2; + } + n = i - n; + if (!Chest.DestroyChest(n, y)) + { + return; + } + } + if (Main.tile[i, j].type == 51 && Main.tile[i, j].wall == 62 && WorldGen.genRand.Next(4) != 0) + { + noItem = true; + } + if (!noItem && !WorldGen.stopDrops && Main.netMode != 1) + { + int num26 = 0; + if (Main.tile[i, j].type == 0 || Main.tile[i, j].type == 2 || Main.tile[i, j].type == 109) + { + num26 = 2; + } + else + { + if (Main.tile[i, j].type == 1) + { + num26 = 3; + } + else + { + if (Main.tile[i, j].type == 3 || Main.tile[i, j].type == 73) + { + if (Main.rand.Next(2) == 0 && (Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].HasItem(281) || Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].HasItem(986))) + { + num26 = 283; + } + } + else + { + if (Main.tile[i, j].type == 227) + { + int num27 = (int)(Main.tile[i, j].frameX / 34); + num26 = 1107 + num27; + } + else + { + if (Main.tile[i, j].type == 4) + { + int num28 = (int)(Main.tile[i, j].frameY / 22); + if (num28 == 0) + { + num26 = 8; + } + else + { + if (num28 == 8) + { + num26 = 523; + } + else + { + if (num28 == 9) + { + num26 = 974; + } + else + { + if (num28 == 10) + { + num26 = 1245; + } + else + { + if (num28 == 11) + { + num26 = 1333; + } + else + { + num26 = 426 + num28; + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 239) + { + int num29 = (int)(Main.tile[i, j].frameX / 18); + if (num29 == 0) + { + num26 = 20; + } + if (num29 == 1) + { + num26 = 703; + } + if (num29 == 2) + { + num26 = 22; + } + if (num29 == 3) + { + num26 = 704; + } + if (num29 == 4) + { + num26 = 21; + } + if (num29 == 5) + { + num26 = 705; + } + if (num29 == 6) + { + num26 = 19; + } + if (num29 == 7) + { + num26 = 706; + } + if (num29 == 8) + { + num26 = 57; + } + if (num29 == 9) + { + num26 = 117; + } + if (num29 == 10) + { + num26 = 175; + } + if (num29 == 11) + { + num26 = 381; + } + if (num29 == 12) + { + num26 = 1184; + } + if (num29 == 13) + { + num26 = 382; + } + if (num29 == 14) + { + num26 = 1191; + } + if (num29 == 15) + { + num26 = 391; + } + if (num29 == 16) + { + num26 = 1198; + } + if (num29 == 17) + { + num26 = 1006; + } + if (num29 == 18) + { + num26 = 1225; + } + if (num29 == 19) + { + num26 = 1257; + } + if (num29 == 20) + { + num26 = 1552; + } + } + else + { + if (Main.tile[i, j].type == 5) + { + if (Main.tile[i, j].frameX >= 22 && Main.tile[i, j].frameY >= 198) + { + if (Main.netMode != 1) + { + if (WorldGen.genRand.Next(2) == 0) + { + int num30 = j; + while (Main.tile[i, num30] != null && (!Main.tile[i, num30].active() || !Main.tileSolid[(int)Main.tile[i, num30].type] || Main.tileSolidTop[(int)Main.tile[i, num30].type])) + { + num30++; + } + if (Main.tile[i, num30] != null) + { + if (Main.tile[i, num30].type == 2 || Main.tile[i, num30].type == 109 || Main.tile[i, num30].type == 147) + { + num26 = 27; + } + else + { + num26 = 9; + } + } + } + else + { + num26 = 9; + } + } + } + else + { + num26 = 9; + } + if (num26 == 9) + { + int num31 = 3; + int num32 = i; + int num33 = j; + if (Main.tile[i, j].frameX == 66 && Main.tile[i, j].frameY <= 45) + { + num32++; + } + if (Main.tile[i, j].frameX == 88 && Main.tile[i, j].frameY >= 66 && Main.tile[i, j].frameY <= 110) + { + num32--; + } + if (Main.tile[i, j].frameX == 22 && Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176) + { + num32--; + } + if (Main.tile[i, j].frameX == 44 && Main.tile[i, j].frameY >= 132 && Main.tile[i, j].frameY <= 176) + { + num32++; + } + if (Main.tile[i, j].frameX == 44 && Main.tile[i, j].frameY >= 198) + { + num32++; + } + if (Main.tile[i, j].frameX == 66 && Main.tile[i, j].frameY >= 198) + { + num32--; + } + while (!Main.tile[num32, num33].active() || !Main.tileSolid[(int)Main.tile[num32, num33].type]) + { + num33++; + } + if (Main.tile[num32, num33].active() && Main.tile[num32, num33].type == 23) + { + num31 = 0; + } + if (Main.tile[num32, num33].active() && Main.tile[num32, num33].type == 60) + { + num31 = 1; + } + if (Main.tile[num32, num33].active() && Main.tile[num32, num33].type == 109) + { + num31 = 2; + } + if (Main.tile[num32, num33].active() && Main.tile[num32, num33].type == 199) + { + num26 = 911; + } + else + { + if (Main.tile[num32, num33].active() && Main.tile[num32, num33].type == 70) + { + num26 = 183; + } + else + { + if (num31 != 3) + { + num26 = num31 + 619; + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 214) + { + num26 = 85; + } + else + { + if (Main.tile[i, j].type == 213) + { + num26 = 965; + } + else + { + if (Main.tile[i, j].type == 211) + { + num26 = 947; + } + else + { + if (Main.tile[i, j].type == 6) + { + num26 = 11; + } + else + { + if (Main.tile[i, j].type == 7) + { + num26 = 12; + } + else + { + if (Main.tile[i, j].type == 8) + { + num26 = 13; + } + else + { + if (Main.tile[i, j].type == 9) + { + num26 = 14; + } + else + { + if (Main.tile[i, j].type == 202) + { + num26 = 824; + } + else + { + if (Main.tile[i, j].type == 234) + { + num26 = 1246; + } + else + { + if (Main.tile[i, j].type == 226) + { + num26 = 1101; + } + else + { + if (Main.tile[i, j].type == 224) + { + num26 = 1103; + } + else + { + if (Main.tile[i, j].type == 229) + { + num26 = 1125; + } + else + { + if (Main.tile[i, j].type == 230) + { + num26 = 1127; + } + else + { + if (Main.tile[i, j].type == 225) + { + if (WorldGen.genRand.Next(3) == 0) + { + Main.tile[i, j].honey(true); + Main.tile[i, j].liquid = 255; + } + else + { + num26 = 1124; + if (Main.netMode != 1 && WorldGen.genRand.Next(2) == 0) + { + int num34 = 1; + if (WorldGen.genRand.Next(3) == 0) + { + num34 = 2; + } + for (int num35 = 0; num35 < num34; num35++) + { + int type = WorldGen.genRand.Next(210, 212); + int num36 = NPC.NewNPC(i * 16 + 8, j * 16 + 15, type, 1); + Main.npc[num36].velocity.X = (float)WorldGen.genRand.Next(-200, 201) * 0.002f; + Main.npc[num36].velocity.Y = (float)WorldGen.genRand.Next(-200, 201) * 0.002f; + Main.npc[num36].netUpdate = true; + } + } + } + } + else + { + if (Main.tile[i, j].type == 221) + { + num26 = 1104; + } + else + { + if (Main.tile[i, j].type == 222) + { + num26 = 1105; + } + else + { + if (Main.tile[i, j].type == 223) + { + num26 = 1106; + } + else + { + if (Main.tile[i, j].type == 248) + { + num26 = 1589; + } + else + { + if (Main.tile[i, j].type == 249) + { + num26 = 1591; + } + else + { + if (Main.tile[i, j].type == 250) + { + num26 = 1593; + } + else + { + if (Main.tile[i, j].type == 191) + { + num26 = 9; + } + else + { + if (Main.tile[i, j].type == 203) + { + num26 = 836; + } + else + { + if (Main.tile[i, j].type == 204) + { + num26 = 880; + } + else + { + if (Main.tile[i, j].type == 166) + { + num26 = 699; + } + else + { + if (Main.tile[i, j].type == 167) + { + num26 = 700; + } + else + { + if (Main.tile[i, j].type == 168) + { + num26 = 701; + } + else + { + if (Main.tile[i, j].type == 169) + { + num26 = 702; + } + else + { + if (Main.tile[i, j].type == 123) + { + num26 = 424; + } + else + { + if (Main.tile[i, j].type == 124) + { + num26 = 480; + } + else + { + if (Main.tile[i, j].type == 157) + { + num26 = 619; + } + else + { + if (Main.tile[i, j].type == 158) + { + num26 = 620; + } + else + { + if (Main.tile[i, j].type == 159) + { + num26 = 621; + } + else + { + if (Main.tile[i, j].type == 161) + { + num26 = 664; + } + else + { + if (Main.tile[i, j].type == 206) + { + num26 = 883; + } + else + { + if (Main.tile[i, j].type == 232) + { + num26 = 1150; + } + else + { + if (Main.tile[i, j].type == 198) + { + num26 = 775; + } + else + { + if (Main.tile[i, j].type == 189) + { + num26 = 751; + } + else + { + if (Main.tile[i, j].type == 195) + { + num26 = 763; + } + else + { + if (Main.tile[i, j].type == 194) + { + num26 = 766; + } + else + { + if (Main.tile[i, j].type == 193) + { + num26 = 762; + } + else + { + if (Main.tile[i, j].type == 196) + { + num26 = 765; + } + else + { + if (Main.tile[i, j].type == 197) + { + num26 = 767; + } + else + { + if (Main.tile[i, j].type == 178) + { + int num37 = (int)(Main.tile[i, j].frameX / 18); + if (num37 == 0) + { + num26 = 181; + } + else + { + if (num37 == 1) + { + num26 = 180; + } + else + { + if (num37 == 2) + { + num26 = 177; + } + else + { + if (num37 == 3) + { + num26 = 179; + } + else + { + if (num37 == 4) + { + num26 = 178; + } + else + { + if (num37 == 5) + { + num26 = 182; + } + else + { + if (num37 == 6) + { + num26 = 999; + } + } + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 149) + { + if (Main.tile[i, j].frameX == 0 || Main.tile[i, j].frameX == 54) + { + num26 = 596; + } + else + { + if (Main.tile[i, j].frameX == 18 || Main.tile[i, j].frameX == 72) + { + num26 = 597; + } + else + { + if (Main.tile[i, j].frameX == 36 || Main.tile[i, j].frameX == 90) + { + num26 = 598; + } + } + } + } + else + { + if (Main.tile[i, j].type == 13) + { + Main.PlaySound(13, i * 16, j * 16, 1); + if (Main.tile[i, j].frameX == 18) + { + num26 = 28; + } + else + { + if (Main.tile[i, j].frameX == 36) + { + num26 = 110; + } + else + { + if (Main.tile[i, j].frameX == 54) + { + num26 = 350; + } + else + { + if (Main.tile[i, j].frameX == 72) + { + num26 = 351; + } + else + { + num26 = 31; + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 19) + { + int num38 = (int)(Main.tile[i, j].frameY / 18); + if (num38 == 0) + { + num26 = 94; + } + else + { + if (num38 == 1) + { + num26 = 631; + } + else + { + if (num38 == 2) + { + num26 = 632; + } + else + { + if (num38 == 3) + { + num26 = 633; + } + else + { + if (num38 == 4) + { + num26 = 634; + } + else + { + if (num38 == 5) + { + num26 = 913; + } + else + { + if (num38 == 6) + { + num26 = 1384; + } + else + { + if (num38 == 7) + { + num26 = 1385; + } + else + { + if (num38 == 8) + { + num26 = 1386; + } + else + { + if (num38 == 9) + { + num26 = 1387; + } + else + { + if (num38 == 10) + { + num26 = 1388; + } + else + { + if (num38 == 11) + { + num26 = 1389; + } + else + { + if (num38 == 12) + { + num26 = 1418; + } + else + { + if (num38 == 13) + { + num26 = 1457; + } + else + { + if (num38 == 14) + { + num26 = 1702; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 22) + { + num26 = 56; + } + else + { + if (Main.tile[i, j].type == 140) + { + num26 = 577; + } + else + { + if (Main.tile[i, j].type == 23) + { + num26 = 2; + } + else + { + if (Main.tile[i, j].type == 25) + { + num26 = 61; + } + else + { + if (Main.tile[i, j].type == 30) + { + num26 = 9; + } + else + { + if (Main.tile[i, j].type == 191) + { + num26 = 9; + } + else + { + if (Main.tile[i, j].type == 208) + { + num26 = 911; + } + else + { + if (Main.tile[i, j].type == 33) + { + int num39 = (int)(Main.tile[i, j].frameY / 22); + num26 = 105; + if (num39 == 1) + { + num26 = 1405; + } + else + { + if (num39 == 2) + { + num26 = 1406; + } + else + { + if (num39 == 3) + { + num26 = 1407; + } + } + } + } + else + { + if (Main.tile[i, j].type == 174) + { + num26 = 713; + } + else + { + if (Main.tile[i, j].type == 37) + { + num26 = 116; + } + else + { + if (Main.tile[i, j].type == 38) + { + num26 = 129; + } + else + { + if (Main.tile[i, j].type == 39) + { + num26 = 131; + } + else + { + if (Main.tile[i, j].type == 40) + { + num26 = 133; + } + else + { + if (Main.tile[i, j].type == 41) + { + num26 = 134; + } + else + { + if (Main.tile[i, j].type == 43) + { + num26 = 137; + } + else + { + if (Main.tile[i, j].type == 44) + { + num26 = 139; + } + else + { + if (Main.tile[i, j].type == 45) + { + num26 = 141; + } + else + { + if (Main.tile[i, j].type == 46) + { + num26 = 143; + } + else + { + if (Main.tile[i, j].type == 47) + { + num26 = 145; + } + else + { + if (Main.tile[i, j].type == 48) + { + num26 = 147; + } + else + { + if (Main.tile[i, j].type == 49) + { + num26 = 148; + } + else + { + if (Main.tile[i, j].type == 51) + { + num26 = 150; + } + else + { + if (Main.tile[i, j].type == 53) + { + num26 = 169; + } + else + { + if (Main.tile[i, j].type == 151) + { + num26 = 607; + } + else + { + if (Main.tile[i, j].type == 152) + { + num26 = 609; + } + else + { + if (Main.tile[i, j].type == 54) + { + num26 = 170; + Main.PlaySound(13, i * 16, j * 16, 1); + } + else + { + if (Main.tile[i, j].type == 56) + { + num26 = 173; + } + else + { + if (Main.tile[i, j].type == 57) + { + num26 = 172; + } + else + { + if (Main.tile[i, j].type == 58) + { + num26 = 174; + } + else + { + if (Main.tile[i, j].type == 60) + { + num26 = 176; + } + else + { + if (Main.tile[i, j].type == 70) + { + num26 = 176; + } + else + { + if (Main.tile[i, j].type == 75) + { + num26 = 192; + } + else + { + if (Main.tile[i, j].type == 76) + { + num26 = 214; + } + else + { + if (Main.tile[i, j].type == 78) + { + num26 = 222; + } + else + { + if (Main.tile[i, j].type == 81) + { + num26 = 275; + } + else + { + if (Main.tile[i, j].type == 80) + { + num26 = 276; + } + else + { + if (Main.tile[i, j].type == 188) + { + num26 = 276; + } + else + { + if (Main.tile[i, j].type == 107) + { + num26 = 364; + } + else + { + if (Main.tile[i, j].type == 108) + { + num26 = 365; + } + else + { + if (Main.tile[i, j].type == 111) + { + num26 = 366; + } + else + { + if (Main.tile[i, j].type == 150) + { + num26 = 604; + } + else + { + if (Main.tile[i, j].type == 112) + { + num26 = 370; + } + else + { + if (Main.tile[i, j].type == 116) + { + num26 = 408; + } + else + { + if (Main.tile[i, j].type == 117) + { + num26 = 409; + } + else + { + if (Main.tile[i, j].type == 129) + { + num26 = 502; + } + else + { + if (Main.tile[i, j].type == 118) + { + num26 = 412; + } + else + { + if (Main.tile[i, j].type == 119) + { + num26 = 413; + } + else + { + if (Main.tile[i, j].type == 120) + { + num26 = 414; + } + else + { + if (Main.tile[i, j].type == 121) + { + num26 = 415; + } + else + { + if (Main.tile[i, j].type == 122) + { + num26 = 416; + } + else + { + if (Main.tile[i, j].type == 136) + { + num26 = 538; + } + else + { + if (Main.tile[i, j].type == 137) + { + int num40 = (int)(Main.tile[i, j].frameY / 18); + if (num40 == 0) + { + num26 = 539; + } + if (num40 == 1) + { + num26 = 1146; + } + if (num40 == 2) + { + num26 = 1147; + } + if (num40 == 3) + { + num26 = 1148; + } + if (num40 == 4) + { + num26 = 1149; + } + } + else + { + if (Main.tile[i, j].type == 141) + { + num26 = 580; + } + else + { + if (Main.tile[i, j].type == 145) + { + num26 = 586; + } + else + { + if (Main.tile[i, j].type == 146) + { + num26 = 591; + } + else + { + if (Main.tile[i, j].type == 147) + { + num26 = 593; + } + else + { + if (Main.tile[i, j].type == 148) + { + num26 = 594; + } + else + { + if (Main.tile[i, j].type == 153) + { + num26 = 611; + } + else + { + if (Main.tile[i, j].type == 154) + { + num26 = 612; + } + else + { + if (Main.tile[i, j].type == 155) + { + num26 = 613; + } + else + { + if (Main.tile[i, j].type == 156) + { + num26 = 614; + } + else + { + if (Main.tile[i, j].type == 160) + { + num26 = 662; + } + else + { + if (Main.tile[i, j].type == 175) + { + num26 = 717; + } + else + { + if (Main.tile[i, j].type == 176) + { + num26 = 718; + } + else + { + if (Main.tile[i, j].type == 177) + { + num26 = 719; + } + else + { + if (Main.tile[i, j].type == 163) + { + num26 = 833; + } + else + { + if (Main.tile[i, j].type == 164) + { + num26 = 834; + } + else + { + if (Main.tile[i, j].type == 200) + { + num26 = 835; + } + else + { + if (Main.tile[i, j].type == 210) + { + num26 = 937; + } + else + { + if (Main.tile[i, j].type == 135) + { + int num41 = (int)(Main.tile[i, j].frameY / 18); + if (num41 == 0) + { + num26 = 529; + } + if (num41 == 1) + { + num26 = 541; + } + if (num41 == 2) + { + num26 = 542; + } + if (num41 == 3) + { + num26 = 543; + } + if (num41 == 4) + { + num26 = 852; + } + if (num41 == 5) + { + num26 = 853; + } + if (num41 == 6) + { + num26 = 1151; + } + } + else + { + if (Main.tile[i, j].type == 144) + { + if (Main.tile[i, j].frameX == 0) + { + num26 = 583; + } + if (Main.tile[i, j].frameX == 18) + { + num26 = 584; + } + if (Main.tile[i, j].frameX == 36) + { + num26 = 585; + } + } + else + { + if (Main.tile[i, j].type == 130) + { + num26 = 511; + } + else + { + if (Main.tile[i, j].type == 131) + { + num26 = 512; + } + else + { + if (Main.tile[i, j].type == 61 || Main.tile[i, j].type == 74) + { + if (Main.tile[i, j].frameX == 144 && Main.tile[i, j].type == 61) + { + Item.NewItem(i * 16, j * 16, 16, 16, 331, WorldGen.genRand.Next(2, 4), false, 0, false); + } + else + { + if (Main.tile[i, j].frameX == 162 && Main.tile[i, j].type == 61) + { + num26 = 223; + } + else + { + if (Main.tile[i, j].frameX >= 108 && Main.tile[i, j].frameX <= 126 && Main.tile[i, j].type == 61 && WorldGen.genRand.Next(20) == 0) + { + num26 = 208; + } + else + { + if (WorldGen.genRand.Next(100) == 0) + { + num26 = 195; + } + } + } + } + } + else + { + if (Main.tile[i, j].type == 59 || Main.tile[i, j].type == 60) + { + num26 = 176; + } + else + { + if (Main.tile[i, j].type == 190) + { + num26 = 183; + } + else + { + if (Main.tile[i, j].type == 71 || Main.tile[i, j].type == 72) + { + if (WorldGen.genRand.Next(50) == 0) + { + num26 = 194; + } + else + { + if (WorldGen.genRand.Next(2) == 0) + { + num26 = 183; + } + } + } + else + { + if (Main.tile[i, j].type >= 63 && Main.tile[i, j].type <= 68) + { + num26 = (int)(Main.tile[i, j].type - 63 + 177); + } + else + { + if (Main.tile[i, j].type == 50) + { + if (Main.tile[i, j].frameX == 90) + { + num26 = 165; + } + else + { + num26 = 149; + } + } + else + { + if (Main.tileAlch[(int)Main.tile[i, j].type] && Main.tile[i, j].type > 82) + { + int num42 = (int)(Main.tile[i, j].frameX / 18); + bool flag = false; + if (Main.tile[i, j].type == 84) + { + flag = true; + } + if (num42 == 0 && Main.dayTime) + { + flag = true; + } + if (num42 == 1 && !Main.dayTime) + { + flag = true; + } + if (num42 == 3 && Main.bloodMoon) + { + flag = true; + } + num26 = 313 + num42; + if (flag) + { + Item.NewItem(i * 16, j * 16, 16, 16, 307 + num42, WorldGen.genRand.Next(1, 4), false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (num26 > 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, num26, 1, false, -1, false); + } + } + Main.tile[i, j].active(false); + Main.tile[i, j].halfBrick(false); + Main.tile[i, j].frameX = -1; + Main.tile[i, j].frameY = -1; + Main.tile[i, j].color(0); + Main.tile[i, j].frameNumber(0); + if (Main.tile[i, j].type == 58 && j > Main.maxTilesY - 200) + { + Main.tile[i, j].lava(true); + Main.tile[i, j].liquid = 128; + } + Main.tile[i, j].type = 0; + Main.tile[i, j].inActive(false); + WorldGen.SquareTileFrame(i, j, true); + } + } + } + public static bool PlayerLOS(int x, int y) + { + Rectangle rectangle = new Rectangle(x * 16, y * 16, 16, 16); + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active) + { + Rectangle value = new Rectangle((int)((double)Main.player[i].position.X + (double)Main.player[i].width * 0.5 - (double)NPC.sWidth * 0.6), (int)((double)Main.player[i].position.Y + (double)Main.player[i].height * 0.5 - (double)NPC.sHeight * 0.6), (int)((double)NPC.sWidth * 1.2), (int)((double)NPC.sHeight * 1.2)); + if (rectangle.Intersects(value)) + { + return true; + } + } + } + return false; + } + public static bool Chlorophyte(int i, int j) + { + int num = 25; + int num2 = 150; + int num3 = 30; + int num4 = 80; + int num5 = 0; + for (int k = i - num3; k < i + num3; k++) + { + for (int l = j - num3; l < j + num3; l++) + { + if (k < Main.maxTilesX - 10 && k > 10 && Main.tile[k, l].active() && Main.tile[k, l].type == 211) + { + num5++; + } + } + } + if (num5 > num) + { + return false; + } + num5 = 0; + for (int m = i - num4; m < i + num4; m++) + { + for (int n = j - num4; n < j + num4; n++) + { + if (m < Main.maxTilesX - 10 && m > 10 && Main.tile[m, n].active() && Main.tile[m, n].type == 211) + { + num5++; + } + } + } + return num5 <= num2; + } + public static void hardUpdateWorld(int i, int j) + { + if (Main.hardMode) + { + if (Main.tile[i, j].inActive()) + { + return; + } + int type = (int)Main.tile[i, j].type; + if ((type == 117 || type == 164) && (double)j > Main.rockLayer && Main.rand.Next(110) == 0) + { + int num = WorldGen.genRand.Next(4); + int num2 = 0; + int num3 = 0; + if (num == 0) + { + num2 = -1; + } + else + { + if (num == 1) + { + num2 = 1; + } + else + { + if (num == 0) + { + num3 = -1; + } + else + { + num3 = 1; + } + } + } + if (!Main.tile[i + num2, j + num3].active()) + { + int num4 = 0; + int num5 = 6; + for (int k = i - num5; k <= i + num5; k++) + { + for (int l = j - num5; l <= j + num5; l++) + { + if (Main.tile[k, l].active() && Main.tile[k, l].type == 129) + { + num4++; + } + } + } + if (num4 < 2) + { + WorldGen.PlaceTile(i + num2, j + num3, 129, true, false, -1, 0); + NetMessage.SendTileSquare(-1, i + num2, j + num3, 1); + } + } + } + if ((double)j > (Main.worldSurface + Main.rockLayer) / 2.0) + { + if (type == 60 && WorldGen.genRand.Next(300) == 0) + { + int num6 = i + WorldGen.genRand.Next(-10, 11); + int num7 = j + WorldGen.genRand.Next(-10, 11); + if (Main.tile[num6, num7].active() && Main.tile[num6, num7].type == 59 && (!Main.tile[num6, num7 - 1].active() || (Main.tile[num6, num7 - 1].type != 5 && Main.tile[num6, num7 - 1].type != 236 && Main.tile[num6, num7 - 1].type != 238)) && WorldGen.Chlorophyte(num6, num7)) + { + Main.tile[num6, num7].type = 211; + WorldGen.SquareTileFrame(num6, num7, true); + } + } + if (type == 211) + { + int num8 = i; + int num9 = j; + int num10 = WorldGen.genRand.Next(4); + if (num10 == 0) + { + num8++; + } + if (num10 == 1) + { + num8--; + } + if (num10 == 2) + { + num9++; + } + if (num10 == 3) + { + num9--; + } + if (Main.tile[num8, num9].active() && (Main.tile[num8, num9].type == 59 || Main.tile[num8, num9].type == 60) && WorldGen.Chlorophyte(num8, num9)) + { + Main.tile[num8, num9].type = 211; + WorldGen.SquareTileFrame(num8, num9, true); + } + } + } + if (NPC.downedPlantBoss && WorldGen.genRand.Next(3) != 0) + { + return; + } + if (type == 23 || type == 25 || type == 32 || type == 112 || type == 153 || type == 163) + { + bool flag = true; + while (flag) + { + flag = false; + int num11 = i + WorldGen.genRand.Next(-3, 4); + int num12 = j + WorldGen.genRand.Next(-3, 4); + if (Main.tile[num11, num12 - 1].type != 27) + { + if (Main.tile[num11, num12].type == 2) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 23; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + else + { + if (Main.tile[num11, num12].type == 1 || Main.tileMoss[(int)Main.tile[num11, num12].type]) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 25; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + else + { + if (Main.tile[num11, num12].type == 53) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 112; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + else + { + if (Main.tile[num11, num12].type == 59) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 0; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + else + { + if (Main.tile[num11, num12].type == 60) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 23; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + else + { + if (Main.tile[num11, num12].type == 69) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 32; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + else + { + if (Main.tile[num11, num12].type == 161) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag = true; + } + Main.tile[num11, num12].type = 163; + WorldGen.SquareTileFrame(num11, num12, true); + NetMessage.SendTileSquare(-1, num11, num12, 1); + } + } + } + } + } + } + } + } + } + } + if (type == 199 || type == 200 || type == 201 || type == 203 || type == 205 || type == 234) + { + bool flag2 = true; + while (flag2) + { + flag2 = false; + int num13 = i + WorldGen.genRand.Next(-3, 4); + int num14 = j + WorldGen.genRand.Next(-3, 4); + if (Main.tile[num13, num14 - 1].type != 27) + { + if (Main.tile[num13, num14].type == 2) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + Main.tile[num13, num14].type = 199; + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + else + { + if (Main.tile[num13, num14].type == 1 || Main.tileMoss[(int)Main.tile[num13, num14].type]) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + Main.tile[num13, num14].type = 203; + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + else + { + if (Main.tile[num13, num14].type == 53) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + Main.tile[num13, num14].type = 234; + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + else + { + if (Main.tile[num13, num14].type == 59) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + Main.tile[num13, num14].type = 0; + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + else + { + if (Main.tile[num13, num14].type == 60) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + Main.tile[num13, num14].type = 199; + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + else + { + if (Main.tile[num13, num14].type == 69) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + WorldGen.KillTile(num13, num14, false, false, false); + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + else + { + if (Main.tile[num13, num14].type == 161) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag2 = true; + } + Main.tile[num13, num14].type = 200; + WorldGen.SquareTileFrame(num13, num14, true); + NetMessage.SendTileSquare(-1, num13, num14, 1); + } + } + } + } + } + } + } + } + } + } + if (type == 109 || type == 110 || type == 113 || type == 115 || type == 116 || type == 117 || type == 164) + { + bool flag3 = true; + while (flag3) + { + flag3 = false; + int num15 = i + WorldGen.genRand.Next(-3, 4); + int num16 = j + WorldGen.genRand.Next(-3, 4); + if (Main.tile[num15, num16].type == 2) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag3 = true; + } + Main.tile[num15, num16].type = 109; + WorldGen.SquareTileFrame(num15, num16, true); + NetMessage.SendTileSquare(-1, num15, num16, 1); + } + else + { + if (Main.tile[num15, num16].type == 1 || Main.tileMoss[(int)Main.tile[num15, num16].type]) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag3 = true; + } + Main.tile[num15, num16].type = 117; + WorldGen.SquareTileFrame(num15, num16, true); + NetMessage.SendTileSquare(-1, num15, num16, 1); + } + else + { + if (Main.tile[num15, num16].type == 53) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag3 = true; + } + Main.tile[num15, num16].type = 116; + WorldGen.SquareTileFrame(num15, num16, true); + NetMessage.SendTileSquare(-1, num15, num16, 1); + } + else + { + if (Main.tile[num15, num16].type == 161) + { + if (WorldGen.genRand.Next(2) == 0) + { + flag3 = true; + } + Main.tile[num15, num16].type = 164; + WorldGen.SquareTileFrame(num15, num16, true); + NetMessage.SendTileSquare(-1, num15, num16, 1); + } + } + } + } + } + } + } + } + public static bool SolidTile(int i, int j) + { + try + { + if (Main.tile[i, j] == null) + { + bool result = true; + return result; + } + if (Main.tile[i, j].active() && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type] && !Main.tile[i, j].halfBrick() && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].inActive()) + { + bool result = true; + return result; + } + } + catch + { + } + return false; + } + public static bool SolidTile2(int i, int j) + { + try + { + if (Main.tile[i, j] == null) + { + bool result = true; + return result; + } + if (Main.tile[i, j].active() && Main.tileSolid[(int)Main.tile[i, j].type] && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].halfBrick() && !Main.tile[i, j].inActive()) + { + bool result = true; + return result; + } + } + catch + { + } + return false; + } + public static bool SolidTileNotDoor(int i, int j) + { + try + { + if (Main.tile[i, j] == null) + { + bool result = true; + return result; + } + if (Main.tile[i, j].active() && Main.tileSolid[(int)Main.tile[i, j].type] && Main.tile[i, j].slope() == 0 && Main.tile[i, j].type != 10 && !Main.tile[i, j].halfBrick() && !Main.tile[i, j].inActive()) + { + bool result = true; + return result; + } + } + catch + { + } + return false; + } + public static Vector2 Hive(int i, int j) + { + double num = (double)WorldGen.genRand.Next(12, 21); + double num2 = num; + float num3 = (float)WorldGen.genRand.Next(10, 21); + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.2f; + value2.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.2f; + while (num > 0.0 && num3 > 0f) + { + num = num2 * (double)(1f + (float)WorldGen.genRand.Next(-20, 20) * 0.01f); + num3 -= 1f; + int num4 = (int)((double)value.X - num); + int num5 = (int)((double)value.X + num); + int num6 = (int)((double)value.Y - num); + int num7 = (int)((double)value.Y + num); + if (num4 < 1) + { + num4 = 1; + } + if (num5 > Main.maxTilesX - 1) + { + num5 = Main.maxTilesX - 1; + } + if (num6 < 1) + { + num6 = 1; + } + if (num7 > Main.maxTilesY - 1) + { + num7 = Main.maxTilesY - 1; + } + for (int k = num4; k < num5; k++) + { + for (int l = num6; l < num7; l++) + { + float num8 = Math.Abs((float)k - value.X); + float num9 = Math.Abs((float)l - value.Y); + double num10 = Math.Sqrt((double)(num8 * num8 + num9 * num9)); + if (num10 < num2 * 0.4 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.005)) + { + if (WorldGen.genRand.Next(3) == 0) + { + Main.tile[k, l].liquid = 255; + } + Main.tile[k, l].honey(true); + Main.tile[k, l].wall = 86; + Main.tile[k, l].active(false); + Main.tile[k, l].halfBrick(false); + Main.tile[k, l].slope(0); + WorldGen.SquareWallFrame(k, l, true); + } + else + { + if (num10 < num2 * 0.75 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.005)) + { + Main.tile[k, l].liquid = 0; + if (Main.tile[k, l].wall != 86) + { + Main.tile[k, l].active(true); + Main.tile[k, l].halfBrick(false); + Main.tile[k, l].slope(0); + Main.tile[k, l].type = 225; + } + } + } + if (num10 < num2 * 0.6 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.005)) + { + Main.tile[k, l].wall = 86; + } + WorldGen.SquareWallFrame(k, l, true); + WorldGen.SquareTileFrame(k, l, true); + } + } + value += value2; + num3 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + } + return new Vector2(value.X, value.Y); + } + public static void MineHouse(int i, int j) + { + if (i < 50 || i > Main.maxTilesX - 50 || j < 50 || j > Main.maxTilesY - 50) + { + return; + } + int num = WorldGen.genRand.Next(6, 12); + int num2 = WorldGen.genRand.Next(3, 6); + int num3 = WorldGen.genRand.Next(15, 30); + int num4 = WorldGen.genRand.Next(15, 30); + if (WorldGen.SolidTile(i, j)) + { + return; + } + if (Main.tile[i, j].wall > 0) + { + return; + } + int num5 = j - num; + int num6 = j + num2; + for (int k = 0; k < 2; k++) + { + bool flag = true; + int num7 = i; + int num8 = j; + int num9 = -1; + int num10 = num3; + if (k == 1) + { + num9 = 1; + num10 = num4; + num7++; + } + while (flag) + { + if (num8 - num < num5) + { + num5 = num8 - num; + } + if (num8 + num2 > num6) + { + num6 = num8 + num2; + } + for (int l = 0; l < 2; l++) + { + int num11 = num8; + bool flag2 = true; + int num12 = num; + int num13 = -1; + if (l == 1) + { + num11++; + num12 = num2; + num13 = 1; + } + while (flag2) + { + if (num7 != i && Main.tile[num7 - num9, num11].wall != 27 && (WorldGen.SolidTile(num7 - num9, num11) || !Main.tile[num7 - num9, num11].active() || Main.tile[num7 - num9, num11].halfBrick() || Main.tile[num7 - num9, num11].slope() != 0)) + { + Main.tile[num7 - num9, num11].active(true); + Main.tile[num7 - num9, num11].type = 30; + } + if (WorldGen.SolidTile(num7 - 1, num11) || Main.tile[num7 - 1, num11].halfBrick() || Main.tile[num7 - 1, num11].slope() != 0) + { + Main.tile[num7 - 1, num11].type = 30; + } + if (WorldGen.SolidTile(num7 + 1, num11) || Main.tile[num7 + 1, num11].halfBrick() || Main.tile[num7 + 1, num11].slope() != 0) + { + Main.tile[num7 + 1, num11].type = 30; + } + if (WorldGen.SolidTile(num7, num11) || Main.tile[num7, num11].halfBrick() || Main.tile[num7, num11].slope() != 0) + { + int num14 = 0; + if (WorldGen.SolidTile(num7 - 1, num11)) + { + num14++; + } + if (WorldGen.SolidTile(num7 + 1, num11)) + { + num14++; + } + if (WorldGen.SolidTile(num7, num11 - 1)) + { + num14++; + } + if (WorldGen.SolidTile(num7, num11 + 1)) + { + num14++; + } + if (num14 < 2) + { + Main.tile[num7, num11].active(false); + } + else + { + flag2 = false; + Main.tile[num7, num11].type = 30; + } + } + else + { + Main.tile[num7, num11].wall = 27; + Main.tile[num7, num11].liquid = 0; + Main.tile[num7, num11].lava(false); + } + num11 += num13; + num12--; + if (num12 <= 0) + { + if (!Main.tile[num7, num11].active()) + { + Main.tile[num7, num11].active(true); + Main.tile[num7, num11].type = 30; + } + flag2 = false; + } + } + } + num10--; + num7 += num9; + if (WorldGen.SolidTile(num7, num8)) + { + int num15 = 0; + int num16 = 0; + int num17 = num8; + bool flag3 = true; + while (flag3) + { + num17--; + num15++; + if (WorldGen.SolidTile(num7 - num9, num17)) + { + num15 = 999; + flag3 = false; + } + else + { + if (!WorldGen.SolidTile(num7, num17)) + { + flag3 = false; + } + } + } + num17 = num8; + flag3 = true; + while (flag3) + { + num17++; + num16++; + if (WorldGen.SolidTile(num7 - num9, num17)) + { + num16 = 999; + flag3 = false; + } + else + { + if (!WorldGen.SolidTile(num7, num17)) + { + flag3 = false; + } + } + } + if (num16 <= num15) + { + if (num16 > num2) + { + num10 = 0; + } + else + { + num8 += num16 + 1; + } + } + else + { + if (num15 > num) + { + num10 = 0; + } + else + { + num8 -= num15 + 1; + } + } + } + if (num10 <= 0) + { + flag = false; + } + } + } + int num18 = i - num3 - 1; + int num19 = i + num4 + 2; + int num20 = num5 - 1; + int num21 = num6 + 2; + for (int m = num18; m < num19; m++) + { + for (int n = num20; n < num21; n++) + { + if (Main.tile[m, n].wall == 27 && !Main.tile[m, n].active()) + { + if (Main.tile[m - 1, n].wall != 27 && m < i && !WorldGen.SolidTile(m - 1, n)) + { + WorldGen.PlaceTile(m, n, 30, true, false, -1, 0); + Main.tile[m, n].wall = 0; + } + if (Main.tile[m + 1, n].wall != 27 && m > i && !WorldGen.SolidTile(m + 1, n)) + { + WorldGen.PlaceTile(m, n, 30, true, false, -1, 0); + Main.tile[m, n].wall = 0; + } + for (int num22 = m - 1; num22 <= m + 1; num22++) + { + for (int num23 = n - 1; num23 <= n + 1; num23++) + { + if (WorldGen.SolidTile(num22, num23)) + { + Main.tile[num22, num23].type = 30; + } + } + } + } + if (Main.tile[m, n].type == 30 && Main.tile[m - 1, n].wall == 27 && Main.tile[m + 1, n].wall == 27 && (Main.tile[m, n - 1].wall == 27 || Main.tile[m, n - 1].active()) && (Main.tile[m, n + 1].wall == 27 || Main.tile[m, n + 1].active())) + { + Main.tile[m, n].active(false); + Main.tile[m, n].wall = 27; + } + } + } + for (int num24 = num18; num24 < num19; num24++) + { + for (int num25 = num20; num25 < num21; num25++) + { + if (Main.tile[num24, num25].type == 30) + { + if (Main.tile[num24 - 1, num25].wall == 27 && Main.tile[num24 + 1, num25].wall == 27 && !Main.tile[num24 - 1, num25].active() && !Main.tile[num24 + 1, num25].active()) + { + Main.tile[num24, num25].active(false); + Main.tile[num24, num25].wall = 27; + } + if (Main.tile[num24, num25 - 1].type != 21 && Main.tile[num24 - 1, num25].wall == 27 && Main.tile[num24 + 1, num25].type == 30 && Main.tile[num24 + 2, num25].wall == 27 && !Main.tile[num24 - 1, num25].active() && !Main.tile[num24 + 2, num25].active()) + { + Main.tile[num24, num25].active(false); + Main.tile[num24, num25].wall = 27; + Main.tile[num24 + 1, num25].active(false); + Main.tile[num24 + 1, num25].wall = 27; + } + if (Main.tile[num24, num25 - 1].wall == 27 && Main.tile[num24, num25 + 1].wall == 27 && !Main.tile[num24, num25 - 1].active() && !Main.tile[num24, num25 + 1].active()) + { + Main.tile[num24, num25].active(false); + Main.tile[num24, num25].wall = 27; + } + } + } + } + for (int num26 = num18; num26 < num19; num26++) + { + for (int num27 = num21; num27 > num20; num27--) + { + bool flag4 = false; + if (Main.tile[num26, num27].active() && Main.tile[num26, num27].type == 30) + { + int num28 = -1; + for (int num29 = 0; num29 < 2; num29++) + { + if (!WorldGen.SolidTile(num26 + num28, num27) && Main.tile[num26 + num28, num27].wall == 0) + { + int num30 = 0; + int num31 = num27; + int num32 = num27; + while (Main.tile[num26, num31].active() && Main.tile[num26, num31].type == 30 && !WorldGen.SolidTile(num26 + num28, num31) && Main.tile[num26 + num28, num31].wall == 0) + { + num31--; + num30++; + } + num31++; + int num33 = num31 + 1; + if (num30 > 4) + { + if (WorldGen.genRand.Next(2) == 0) + { + num31 = num32 - 1; + bool flag5 = true; + for (int num34 = num26 - 2; num34 <= num26 + 2; num34++) + { + for (int num35 = num31 - 2; num35 <= num31; num35++) + { + if (num34 != num26 && Main.tile[num34, num35].active()) + { + flag5 = false; + } + } + } + if (flag5) + { + Main.tile[num26, num31].active(false); + Main.tile[num26, num31 - 1].active(false); + Main.tile[num26, num31 - 2].active(false); + WorldGen.PlaceTile(num26, num31, 10, true, false, -1, 0); + flag4 = true; + } + } + if (!flag4) + { + for (int num36 = num33; num36 < num32; num36++) + { + Main.tile[num26, num36].type = 124; + } + } + } + } + num28 = 1; + } + } + if (flag4) + { + break; + } + } + } + int num37 = WorldGen.genRand.Next(1, 2); + if (WorldGen.genRand.Next(4) == 0) + { + num37 = 0; + } + if (WorldGen.genRand.Next(6) == 0) + { + num37++; + } + if (WorldGen.genRand.Next(10) == 0) + { + num37++; + } + for (int num38 = 0; num38 < num37; num38++) + { + int num39 = 0; + int num40 = WorldGen.genRand.Next(num18, num19); + int num41 = WorldGen.genRand.Next(num20, num21); + while (!Main.wallHouse[(int)Main.tile[num40, num41].wall] || Main.tile[num40, num41].active()) + { + num39++; + if (num39 > 1000) + { + break; + } + num40 = WorldGen.genRand.Next(num18, num19); + num41 = WorldGen.genRand.Next(num20, num21); + } + if (num39 > 1000) + { + break; + } + int num43; + int num44; + int num45; + int num46; + for (int num42 = 0; num42 < 2; num42++) + { + num43 = num40; + num44 = num40; + while (!Main.tile[num43, num41].active() && Main.wallHouse[(int)Main.tile[num43, num41].wall]) + { + num43--; + } + num43++; + while (!Main.tile[num44, num41].active() && Main.wallHouse[(int)Main.tile[num44, num41].wall]) + { + num44++; + } + num44--; + i = (num43 + num44) / 2; + num45 = num41; + num46 = num41; + while (!Main.tile[num40, num45].active() && Main.wallHouse[(int)Main.tile[num40, num45].wall]) + { + num45--; + } + num45++; + while (!Main.tile[num40, num46].active() && Main.wallHouse[(int)Main.tile[num40, num46].wall]) + { + num46++; + } + num46--; + num41 = (num45 + num46) / 2; + } + num43 = num40; + num44 = num40; + while (!Main.tile[num43, num41].active() && !Main.tile[num43, num41 - 1].active() && !Main.tile[num43, num41 + 1].active()) + { + num43--; + } + num43++; + while (!Main.tile[num44, num41].active() && !Main.tile[num44, num41 - 1].active() && !Main.tile[num44, num41 + 1].active()) + { + num44++; + } + num44--; + num45 = num41; + num46 = num41; + while (!Main.tile[num40, num45].active() && !Main.tile[num40 - 1, num45].active() && !Main.tile[num40 + 1, num45].active()) + { + num45--; + } + num45++; + while (!Main.tile[num40, num46].active() && !Main.tile[num40 - 1, num46].active() && !Main.tile[num40 + 1, num46].active()) + { + num46++; + } + num46--; + num40 = (num43 + num44) / 2; + num41 = (num45 + num46) / 2; + int num47 = num44 - num43; + int num48 = num46 - num45; + if (num47 > 7 && num48 > 5) + { + int num49 = 0; + if (WorldGen.nearPicture2(i, num41)) + { + num49 = -1; + } + if (num49 == 0) + { + Vector2 vector = WorldGen.randHousePicture(); + int type = (int)vector.X; + int style = (int)vector.Y; + if (!WorldGen.nearPicture(num40, num41)) + { + WorldGen.PlaceTile(num40, num41, type, true, false, -1, style); + } + } + } + } + for (int num50 = num18; num50 < num19; num50++) + { + bool flag6 = true; + for (int num51 = num20; num51 < num21; num51++) + { + for (int num52 = num50 - 3; num52 <= num50 + 3; num52++) + { + if (Main.tile[num52, num51].active() && (!WorldGen.SolidTile(num52, num51) || Main.tile[num52, num51].type == 10)) + { + flag6 = false; + } + } + } + if (flag6) + { + for (int num53 = num20; num53 < num21; num53++) + { + if (Main.tile[num50, num53].wall == 27 && !Main.tile[num50, num53].active()) + { + WorldGen.PlaceTile(num50, num53, 124, true, false, -1, 0); + } + } + } + num50 += WorldGen.genRand.Next(4); + } + for (int num54 = 0; num54 < 4; num54++) + { + int num55 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + int num56 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + while (Main.tile[num55, num56].wall != 27) + { + num55 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + num56 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + } + while (Main.tile[num55, num56].active()) + { + num56--; + } + while (!Main.tile[num55, num56].active()) + { + num56++; + } + num56--; + if (Main.tile[num55, num56].wall == 27) + { + if (WorldGen.genRand.Next(3) == 0) + { + int num57 = WorldGen.genRand.Next(9); + if (num57 == 0) + { + num57 = 14; + } + if (num57 == 1) + { + num57 = 16; + } + if (num57 == 2) + { + num57 = 18; + } + if (num57 == 3) + { + num57 = 86; + } + if (num57 == 4) + { + num57 = 87; + } + if (num57 == 5) + { + num57 = 94; + } + if (num57 == 6) + { + num57 = 101; + } + if (num57 == 7) + { + num57 = 104; + } + if (num57 == 8) + { + num57 = 106; + } + WorldGen.PlaceTile(num55, num56, num57, true, false, -1, 0); + } + else + { + int style2 = WorldGen.genRand.Next(2, 43); + WorldGen.PlaceTile(num55, num56, 105, true, true, -1, style2); + } + } + } + for (int num58 = 0; num58 < 40; num58++) + { + int num59 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + int num60 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + while (Main.tile[num59, num60].wall != 27) + { + num59 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + num60 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + } + while (Main.tile[num59, num60].active()) + { + num60--; + } + while (!Main.tile[num59, num60].active()) + { + num60++; + } + num60--; + if (Main.tile[num59, num60].wall == 27 && WorldGen.genRand.Next(2) == 0) + { + int style3 = WorldGen.genRand.Next(22, 26); + WorldGen.PlaceTile(num59, num60, 186, true, false, -1, style3); + } + } + for (int num61 = 0; num61 < 20; num61++) + { + int num62 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + int num63 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + while (Main.tile[num62, num63].wall != 27) + { + num62 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + num63 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + } + while (Main.tile[num62, num63].active()) + { + num63--; + } + while (!Main.tile[num62, num63].active()) + { + num63++; + } + num63--; + if (Main.tile[num62, num63].wall == 27 && WorldGen.genRand.Next(2) == 0) + { + int x = WorldGen.genRand.Next(31, 34); + WorldGen.PlaceSmallPile(num62, num63, x, 1, 185); + } + } + for (int num64 = 0; num64 < 15; num64++) + { + int num65 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + int num66 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + while (Main.tile[num65, num66].wall != 27) + { + num65 = WorldGen.genRand.Next(num18 + 2, num19 - 1); + num66 = WorldGen.genRand.Next(num20 + 2, num21 - 1); + } + while (Main.tile[num65, num66].active()) + { + num66--; + } + while (num66 > 0 && !Main.tile[num65, num66 - 1].active()) + { + num66--; + } + if (Main.tile[num65, num66].wall == 27) + { + int style4 = 0; + int num67 = WorldGen.genRand.Next(10); + int num68; + if (num67 < 9) + { + num68 = -1; + } + else + { + num67 = WorldGen.genRand.Next(6); + if (num67 == 0) + { + num68 = 34; + } + else + { + if (num67 == 1) + { + num68 = 35; + } + else + { + if (num67 == 2) + { + num68 = 36; + } + else + { + if (num67 == 3) + { + num68 = 170; + } + else + { + if (num67 == 4) + { + num68 = 171; + } + else + { + num68 = 172; + } + } + } + } + } + } + if (num68 > 0) + { + WorldGen.PlaceTile(num65, num66, num68, true, false, -1, style4); + if ((int)Main.tile[num65, num66].type == num68) + { + if (num68 == 4) + { + Tile expr_151D = Main.tile[num65, num66]; + expr_151D.frameX += 54; + } + else + { + int num69 = num65; + int num70 = num66; + num66 = num70 - (int)(Main.tile[num69, num70].frameY / 18); + num65 = (int)(Main.tile[num69, num70].frameX / 18); + if (num65 > 2) + { + num65 -= 3; + } + num65 = num69 - num65; + short num71 = 54; + if (Main.tile[num65, num66].frameX > 0) + { + num71 = -54; + } + for (int num72 = num65; num72 < num65 + 3; num72++) + { + for (int num73 = num66; num73 < num66 + 3; num73++) + { + Tile expr_15B6 = Main.tile[num72, num73]; + expr_15B6.frameX += num71; + } + } + } + } + } + } + } + } + public static void CountTiles(int X) + { + if (X == 0) + { + WorldGen.totalEvil = WorldGen.totalEvil2; + WorldGen.totalSolid = WorldGen.totalSolid2; + WorldGen.totalGood = WorldGen.totalGood2; + float num = (float)WorldGen.totalGood / (float)WorldGen.totalSolid; + num = (float)Math.Round((double)(num * 100f)); + float num2 = (float)WorldGen.totalEvil / (float)WorldGen.totalSolid; + num2 = (float)Math.Round((double)(num2 * 100f)); + WorldGen.tGood = (byte)num; + WorldGen.tEvil = (byte)num2; + if (Main.netMode == 2) + { + NetMessage.SendData(57, -1, -1, "", 0, 0f, 0f, 0f, 0); + } + WorldGen.totalEvil2 = 0; + WorldGen.totalSolid2 = 0; + WorldGen.totalGood2 = 0; + } + for (int i = 0; i < Main.maxTilesY; i++) + { + int num3 = 1; + if ((double)i <= Main.worldSurface) + { + num3 *= 5; + } + if (WorldGen.SolidTile(X, i)) + { + if (Main.tile[X, i].type == 109 || Main.tile[X, i].type == 116 || Main.tile[X, i].type == 117 || Main.tile[X, i].type == 164) + { + WorldGen.totalGood2 += num3; + } + else + { + if (Main.tile[X, i].type == 23 || Main.tile[X, i].type == 25 || Main.tile[X, i].type == 112 || Main.tile[X, i].type == 163) + { + WorldGen.totalEvil2 += num3; + } + else + { + if (Main.tile[X, i].type == 199 || Main.tile[X, i].type == 200 || Main.tile[X, i].type == 203 || Main.tile[X, i].type == 234) + { + WorldGen.totalEvil2 += num3; + } + } + } + WorldGen.totalSolid2 += num3; + } + } + } + public static void plantDye(int i, int j) + { + if (Main.tile[i, j].active()) + { + if (i < 80 || i > Main.maxTilesX - 80 || j < 80 || j > Main.maxTilesY - 80) + { + return; + } + int num = 75; + if ((double)j < Main.worldSurface) + { + if (Main.tile[i, j - 1].active() && Main.tile[i, j - 1].type != 3 && Main.tile[i, j - 1].type != 51 && Main.tile[i, j - 1].type != 61 && Main.tile[i, j - 1].type != 73 && Main.tile[i, j - 1].type != 74 && Main.tile[i, j - 1].type != 184) + { + return; + } + for (int k = i - num; k < i + num; k++) + { + for (int l = j - num; l < j + num; l++) + { + if (Main.tile[k, l].active() && Main.tile[k, l].type == 227) + { + return; + } + } + } + if (Main.tile[i, j].type == 2 || Main.tile[i, j].type == 109) + { + if (Main.rand.Next(4) == 0) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 4); + return; + } + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 3); + return; + } + else + { + if (Main.tile[i, j].type == 60) + { + if (Main.rand.Next(2) == 0) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 2); + return; + } + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 4); + return; + } + else + { + if (Main.tile[i, j].type == 53 && Main.tile[i, j - 1].liquid == 255 && Main.tile[i, j - 2].liquid == 255) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 2); + return; + } + if (Main.tile[i, j].type != 80 || Main.tile[i - 1, j - 1].active() || Main.tile[i + 1, j - 1].active()) + { + return; + } + try + { + bool flag = true; + for (int m = i - 5; m <= i + 5; m++) + { + for (int n = j - 5; n <= j + 15; n++) + { + if (Main.tile[m, n].active() && (Main.tile[m, n].type == 112 || Main.tile[m, n].type == 234)) + { + flag = false; + } + } + } + if (flag) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 6); + } + return; + } + catch + { + return; + } + } + } + } + if (j < Main.maxTilesY - 200) + { + if (!Main.tile[i, j - 1].active() || Main.tile[i, j - 1].type == 3 || Main.tile[i, j - 1].type == 51 || Main.tile[i, j - 1].type == 61 || Main.tile[i, j - 1].type == 73 || Main.tile[i, j - 1].type == 74 || Main.tile[i, j - 1].type == 184) + { + for (int num2 = i - num; num2 < i + num; num2++) + { + for (int num3 = j - num; num3 < j + num; num3++) + { + if (Main.tile[num2, num3].active() && Main.tile[num2, num3].type == 227) + { + return; + } + } + } + if (Main.tile[i, j].type == 60) + { + if (Main.rand.Next(2) == 0) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 2); + } + else + { + if (Main.rand.Next(2) == 0) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 0); + } + else + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 1); + } + } + } + else + { + if (Main.tile[i, j].type == 0 || Main.tile[i, j].type == 1 || Main.tile[i, j].type == 59) + { + if (Main.rand.Next(2) == 0) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 0); + } + else + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 1); + } + } + else + { + if (Main.tile[i, j - 1].liquid == 255 && Main.tile[i, j - 2].liquid == 255) + { + WorldGen.PlaceTile(i, j - 1, 227, true, false, -1, 5); + } + } + } + } + if (!Main.tile[i, j + 1].active()) + { + for (int num4 = i - num; num4 < i + num; num4++) + { + for (int num5 = j - num; num5 < j + num; num5++) + { + if (Main.tile[num4, num5].active() && Main.tile[num4, num5].type == 227) + { + return; + } + } + } + if (Main.tile[i, j].type == 0) + { + WorldGen.PlaceTile(i, j + 1, 227, true, false, -1, 7); + } + } + } + } + } + public static void UpdateWorld() + { + WorldGen.UpdateMech(); + WorldGen.totalD++; + if (WorldGen.totalD >= 10) + { + WorldGen.totalD = 0; + WorldGen.CountTiles(WorldGen.totalX); + WorldGen.totalX++; + if (WorldGen.totalX >= Main.maxTilesX) + { + WorldGen.totalX = 0; + } + } + Liquid.skipCount++; + if (Liquid.skipCount > 1) + { + Liquid.UpdateLiquid(); + Liquid.skipCount = 0; + } + float num = 3E-05f * (float)Main.worldRate; + float num2 = 1.5E-05f * (float)Main.worldRate; + bool flag = false; + WorldGen.spawnDelay++; + if (Main.invasionType > 0 || Main.eclipse) + { + WorldGen.spawnDelay = 0; + } + if (WorldGen.spawnDelay >= 20) + { + flag = true; + WorldGen.spawnDelay = 0; + if (WorldGen.spawnNPC != 37) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && Main.npc[i].homeless && Main.npc[i].townNPC) + { + WorldGen.spawnNPC = Main.npc[i].type; + break; + } + } + } + } + int num3 = 0; + while ((float)num3 < (float)(Main.maxTilesX * Main.maxTilesY) * num) + { + int num4 = WorldGen.genRand.Next(10, Main.maxTilesX - 10); + int num5 = WorldGen.genRand.Next(10, (int)Main.worldSurface - 1); + int num6 = num4 - 1; + int num7 = num4 + 2; + int num8 = num5 - 1; + int num9 = num5 + 2; + if (num6 < 10) + { + num6 = 10; + } + if (num7 > Main.maxTilesX - 10) + { + num7 = Main.maxTilesX - 10; + } + if (num8 < 10) + { + num8 = 10; + } + if (num9 > Main.maxTilesY - 10) + { + num9 = Main.maxTilesY - 10; + } + if (Main.tile[num4, num5] != null) + { + if (Main.tileAlch[(int)Main.tile[num4, num5].type]) + { + WorldGen.GrowAlch(num4, num5); + } + if (Main.tile[num4, num5].liquid > 32) + { + if (Main.tile[num4, num5].active() && (Main.tile[num4, num5].type == 3 || Main.tile[num4, num5].type == 20 || Main.tile[num4, num5].type == 24 || Main.tile[num4, num5].type == 27 || Main.tile[num4, num5].type == 73)) + { + WorldGen.KillTile(num4, num5, false, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num4, (float)num5, 0f, 0); + } + } + } + else + { + if (Main.tile[num4, num5].nactive()) + { + WorldGen.hardUpdateWorld(num4, num5); + if (Main.rand.Next(2000) == 0) + { + WorldGen.plantDye(num4, num5); + } + if (Main.tile[num4, num5].type == 80) + { + if (WorldGen.genRand.Next(15) == 0) + { + WorldGen.GrowCactus(num4, num5); + } + } + else + { + if (Main.tile[num4, num5].type == 53) + { + if (!Main.tile[num4, num8].active()) + { + if (num4 < 250 || num4 > Main.maxTilesX - 250) + { + if (WorldGen.genRand.Next(500) == 0 && Main.tile[num4, num8].liquid == 255 && Main.tile[num4, num8 - 1].liquid == 255 && Main.tile[num4, num8 - 2].liquid == 255 && Main.tile[num4, num8 - 3].liquid == 255 && Main.tile[num4, num8 - 4].liquid == 255) + { + WorldGen.PlaceTile(num4, num8, 81, true, false, -1, 0); + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + } + else + { + if (num4 > 400 && num4 < Main.maxTilesX - 400 && WorldGen.genRand.Next(300) == 0) + { + WorldGen.GrowCactus(num4, num5); + } + } + } + } + else + { + if (Main.tile[num4, num5].type == 116 || Main.tile[num4, num5].type == 112 || Main.tile[num4, num5].type == 234) + { + if (!Main.tile[num4, num8].active() && num4 > 400 && num4 < Main.maxTilesX - 400 && WorldGen.genRand.Next(300) == 0) + { + WorldGen.GrowCactus(num4, num5); + } + } + else + { + if (Main.tile[num4, num5].type == 147 || Main.tile[num4, num5].type == 161 || Main.tile[num4, num5].type == 163 || Main.tile[num4, num5].type == 164 || Main.tile[num4, num5].type == 200) + { + if (Main.rand.Next(10) == 0 && !Main.tile[num4, num5 + 1].active() && !Main.tile[num4, num5 + 2].active()) + { + int num10 = num4 - 3; + int num11 = num4 + 4; + int num12 = 0; + for (int j = num10; j < num11; j++) + { + if (Main.tile[j, num5].type == 165 && Main.tile[j, num5].active()) + { + num12++; + } + if (Main.tile[j, num5 + 1].type == 165 && Main.tile[j, num5 + 1].active()) + { + num12++; + } + if (Main.tile[j, num5 + 2].type == 165 && Main.tile[j, num5 + 2].active()) + { + num12++; + } + if (Main.tile[j, num5 + 3].type == 165 && Main.tile[j, num5 + 3].active()) + { + num12++; + } + } + if (num12 < 2) + { + WorldGen.PlaceTight(num4, num5 + 1, 165, false); + WorldGen.SquareTileFrame(num4, num5 + 1, true); + if (Main.netMode == 2 && Main.tile[num4, num5 + 1].active()) + { + NetMessage.SendTileSquare(-1, num4, num5 + 1, 3); + } + } + } + } + else + { + if (Main.tile[num4, num5].type == 78) + { + if (!Main.tile[num4, num8].active()) + { + WorldGen.PlaceTile(num4, num8, 3, true, false, -1, 0); + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + } + else + { + if (Main.tile[num4, num5].type == 2 || Main.tile[num4, num5].type == 23 || Main.tile[num4, num5].type == 32 || Main.tile[num4, num5].type == 109 || Main.tile[num4, num5].type == 199) + { + int num13 = (int)Main.tile[num4, num5].type; + if (!Main.tile[num4, num8].active() && WorldGen.genRand.Next(12) == 0 && num13 == 2) + { + WorldGen.PlaceTile(num4, num8, 3, true, false, -1, 0); + if (Main.tile[num4, num8].active()) + { + Main.tile[num4, num8].color(Main.tile[num4, num5].color()); + } + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + if (!Main.tile[num4, num8].active() && WorldGen.genRand.Next(10) == 0 && num13 == 23) + { + WorldGen.PlaceTile(num4, num8, 24, true, false, -1, 0); + if (Main.tile[num4, num8].active()) + { + Main.tile[num4, num8].color(Main.tile[num4, num5].color()); + } + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + if (!Main.tile[num4, num8].active() && WorldGen.genRand.Next(10) == 0 && num13 == 109) + { + WorldGen.PlaceTile(num4, num8, 110, true, false, -1, 0); + if (Main.tile[num4, num8].active()) + { + Main.tile[num4, num8].color(Main.tile[num4, num5].color()); + } + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + if (!Main.tile[num4, num8].active() && WorldGen.genRand.Next(10) == 0 && num13 == 199) + { + WorldGen.PlaceTile(num4, num8, 201, true, false, -1, 0); + if (Main.tile[num4, num8].active()) + { + Main.tile[num4, num8].color(Main.tile[num4, num5].color()); + } + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + bool flag2 = false; + for (int k = num6; k < num7; k++) + { + for (int l = num8; l < num9; l++) + { + if ((num4 != k || num5 != l) && Main.tile[k, l].active()) + { + if (num13 == 32) + { + num13 = 23; + } + if (Main.tile[k, l].type == 0 || (num13 == 23 && Main.tile[k, l].type == 2) || (num13 == 199 && Main.tile[k, l].type == 2) || (num13 == 23 && Main.tile[k, l].type == 109)) + { + WorldGen.SpreadGrass(k, l, 0, num13, false, Main.tile[num4, num5].color()); + if (num13 == 23) + { + WorldGen.SpreadGrass(k, l, 2, num13, false, Main.tile[num4, num5].color()); + } + if (num13 == 23) + { + WorldGen.SpreadGrass(k, l, 109, num13, false, Main.tile[num4, num5].color()); + } + if (num13 == 199) + { + WorldGen.SpreadGrass(k, l, 2, num13, false, Main.tile[num4, num5].color()); + } + if (num13 == 199) + { + WorldGen.SpreadGrass(k, l, 109, num13, false, Main.tile[num4, num5].color()); + } + if ((int)Main.tile[k, l].type == num13) + { + WorldGen.SquareTileFrame(k, l, true); + flag2 = true; + } + } + if (Main.tile[k, l].type == 0 || (num13 == 109 && Main.tile[k, l].type == 2) || (num13 == 109 && Main.tile[k, l].type == 23) || (num13 == 109 && Main.tile[k, l].type == 199)) + { + WorldGen.SpreadGrass(k, l, 0, num13, false, Main.tile[num4, num5].color()); + if (num13 == 109) + { + WorldGen.SpreadGrass(k, l, 2, num13, false, Main.tile[num4, num5].color()); + } + if (num13 == 109) + { + WorldGen.SpreadGrass(k, l, 23, num13, false, Main.tile[num4, num5].color()); + } + if (num13 == 109) + { + WorldGen.SpreadGrass(k, l, 199, num13, false, Main.tile[num4, num5].color()); + } + if ((int)Main.tile[k, l].type == num13) + { + WorldGen.SquareTileFrame(k, l, true); + flag2 = true; + } + } + } + } + } + if (Main.netMode == 2 && flag2) + { + NetMessage.SendTileSquare(-1, num4, num5, 3); + } + } + else + { + if (Main.tile[num4, num5].type == 20 && WorldGen.genRand.Next(20) == 0 && !WorldGen.PlayerLOS(num4, num5)) + { + WorldGen.GrowTree(num4, num5); + } + } + } + } + } + } + } + if (Main.tile[num4, num5].type == 3 && WorldGen.genRand.Next(20) == 0 && Main.tile[num4, num5].frameX != 144) + { + if ((Main.tile[num4, num5].frameX < 144 && Main.rand.Next(10) == 0) || (Main.tile[num4, num5 + 1].type == 78 && Main.rand.Next(2) == 0)) + { + Main.tile[num4, num5].frameX = (short)(198 + WorldGen.genRand.Next(10) * 18); + } + Main.tile[num4, num5].type = 73; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num4, num5, 3); + } + } + if (Main.tile[num4, num5].type == 110 && WorldGen.genRand.Next(20) == 0 && Main.tile[num4, num5].frameX < 144) + { + Main.tile[num4, num5].type = 113; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num4, num5, 3); + } + } + if (Main.tile[num4, num5].type == 32 && WorldGen.genRand.Next(3) == 0) + { + int num14 = num4; + int num15 = num5; + int num16 = 0; + if (Main.tile[num14 + 1, num15].active() && Main.tile[num14 + 1, num15].type == 32) + { + num16++; + } + if (Main.tile[num14 - 1, num15].active() && Main.tile[num14 - 1, num15].type == 32) + { + num16++; + } + if (Main.tile[num14, num15 + 1].active() && Main.tile[num14, num15 + 1].type == 32) + { + num16++; + } + if (Main.tile[num14, num15 - 1].active() && Main.tile[num14, num15 - 1].type == 32) + { + num16++; + } + if (num16 < 3 || Main.tile[num4, num5].type == 23) + { + int num17 = WorldGen.genRand.Next(4); + if (num17 == 0) + { + num15--; + } + else + { + if (num17 == 1) + { + num15++; + } + else + { + if (num17 == 2) + { + num14--; + } + else + { + if (num17 == 3) + { + num14++; + } + } + } + } + if (!Main.tile[num14, num15].active()) + { + num16 = 0; + if (Main.tile[num14 + 1, num15].active() && Main.tile[num14 + 1, num15].type == 32) + { + num16++; + } + if (Main.tile[num14 - 1, num15].active() && Main.tile[num14 - 1, num15].type == 32) + { + num16++; + } + if (Main.tile[num14, num15 + 1].active() && Main.tile[num14, num15 + 1].type == 32) + { + num16++; + } + if (Main.tile[num14, num15 - 1].active() && Main.tile[num14, num15 - 1].type == 32) + { + num16++; + } + if (num16 < 2) + { + int num18 = 7; + int num19 = num14 - num18; + int num20 = num14 + num18; + int num21 = num15 - num18; + int num22 = num15 + num18; + bool flag3 = false; + for (int m = num19; m < num20; m++) + { + for (int n = num21; n < num22; n++) + { + if (Math.Abs(m - num14) * 2 + Math.Abs(n - num15) < 9 && Main.tile[m, n].active() && Main.tile[m, n].type == 23 && Main.tile[m, n - 1].active() && Main.tile[m, n - 1].type == 32 && Main.tile[m, n - 1].liquid == 0) + { + flag3 = true; + break; + } + } + } + if (flag3) + { + Main.tile[num14, num15].type = 32; + Main.tile[num14, num15].active(true); + WorldGen.SquareTileFrame(num14, num15, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num14, num15, 3); + } + } + } + } + } + } + } + else + { + if (flag && WorldGen.spawnNPC > 0) + { + if (Main.tile[num4, num5].wall == 34) + { + if (Main.rand.Next(4) == 0) + { + WorldGen.SpawnNPC(num4, num5); + } + } + else + { + WorldGen.SpawnNPC(num4, num5); + } + } + } + } + int num23 = 10; + if (Main.tile[num4, num5].wall == 81 || Main.tile[num4, num5].wall == 83 || (Main.tile[num4, num5].type == 199 && Main.tile[num4, num5].active())) + { + int num24 = num4 + WorldGen.genRand.Next(-2, 3); + int num25 = num5 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[num24, num25].wall >= 63 && Main.tile[num24, num25].wall <= 68) + { + bool flag4 = false; + for (int num26 = num4 - num23; num26 < num4 + num23; num26++) + { + for (int num27 = num5 - num23; num27 < num5 + num23; num27++) + { + if (Main.tile[num4, num5].active()) + { + int type = (int)Main.tile[num4, num5].type; + if (type == 199 || type == 200 || type == 201 || type == 203 || type == 205 || type == 234) + { + flag4 = true; + break; + } + } + } + } + if (flag4) + { + Main.tile[num24, num25].wall = 81; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num24, num25, 3); + } + } + } + } + if (Main.tile[num4, num5].wall == 69 || Main.tile[num4, num5].wall == 3 || (Main.tile[num4, num5].type == 23 && Main.tile[num4, num5].active())) + { + int num28 = num4 + WorldGen.genRand.Next(-2, 3); + int num29 = num5 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[num28, num29].wall >= 63 && Main.tile[num28, num29].wall <= 68) + { + bool flag5 = false; + for (int num30 = num4 - num23; num30 < num4 + num23; num30++) + { + for (int num31 = num5 - num23; num31 < num5 + num23; num31++) + { + if (Main.tile[num4, num5].active()) + { + int type2 = (int)Main.tile[num4, num5].type; + if (type2 == 22 || type2 == 23 || type2 == 24 || type2 == 25 || type2 == 32 || type2 == 112 || type2 == 163) + { + flag5 = true; + break; + } + } + } + } + if (flag5) + { + Main.tile[num28, num29].wall = 69; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num28, num29, 3); + } + } + } + } + if (Main.tile[num4, num5].wall == 70 || (Main.tile[num4, num5].type == 109 && Main.tile[num4, num5].active())) + { + int num32 = num4 + WorldGen.genRand.Next(-2, 3); + int num33 = num5 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[num32, num33].wall == 63 || Main.tile[num32, num33].wall == 65 || Main.tile[num32, num33].wall == 66 || Main.tile[num32, num33].wall == 68) + { + bool flag6 = false; + for (int num34 = num4 - num23; num34 < num4 + num23; num34++) + { + for (int num35 = num5 - num23; num35 < num5 + num23; num35++) + { + if (Main.tile[num4, num5].active()) + { + int type3 = (int)Main.tile[num4, num5].type; + if (type3 == 109 || type3 == 110 || type3 == 113 || type3 == 115 || type3 == 116 || type3 == 117 || type3 == 164) + { + flag6 = true; + break; + } + } + } + } + if (flag6) + { + Main.tile[num32, num33].wall = 70; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num32, num33, 3); + } + } + } + } + if (Main.tile[num4, num5].active()) + { + if ((Main.tile[num4, num5].type == 2 || Main.tile[num4, num5].type == 52 || (Main.tile[num4, num5].type == 192 && WorldGen.genRand.Next(10) == 0)) && WorldGen.genRand.Next(40) == 0 && !Main.tile[num4, num5 + 1].active() && !Main.tile[num4, num5 + 1].lava()) + { + bool flag7 = false; + for (int num36 = num5; num36 > num5 - 10; num36--) + { + if (Main.tile[num4, num36].active() && Main.tile[num4, num36].type == 2) + { + flag7 = true; + break; + } + } + if (flag7) + { + int num37 = num4; + int num38 = num5 + 1; + Main.tile[num37, num38].type = 52; + Main.tile[num37, num38].active(true); + Main.tile[num37, num38].color(Main.tile[num4, num5].color()); + WorldGen.SquareTileFrame(num37, num38, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num37, num38, 3); + } + } + } + if (Main.tile[num4, num5].type == 70) + { + int type4 = (int)Main.tile[num4, num5].type; + if (!Main.tile[num4, num8].active() && WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(num4, num8, 71, true, false, -1, 0); + if (Main.tile[num4, num8].active()) + { + Main.tile[num4, num8].color(Main.tile[num4, num5].color()); + } + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + if (WorldGen.genRand.Next(100) == 0 && !WorldGen.PlayerLOS(num4, num5)) + { + WorldGen.GrowTree(num4, num5); + } + bool flag8 = false; + for (int num39 = num6; num39 < num7; num39++) + { + for (int num40 = num8; num40 < num9; num40++) + { + if ((num4 != num39 || num5 != num40) && Main.tile[num39, num40].active() && Main.tile[num39, num40].type == 59) + { + WorldGen.SpreadGrass(num39, num40, 59, type4, false, Main.tile[num4, num5].color()); + if ((int)Main.tile[num39, num40].type == type4) + { + WorldGen.SquareTileFrame(num39, num40, true); + flag8 = true; + } + } + } + } + if (Main.netMode == 2 && flag8) + { + NetMessage.SendTileSquare(-1, num4, num5, 3); + } + } + if (Main.tile[num4, num5].type == 60) + { + int type5 = (int)Main.tile[num4, num5].type; + if (!Main.tile[num4, num8].active() && WorldGen.genRand.Next(7) == 0) + { + WorldGen.PlaceTile(num4, num8, 61, true, false, -1, 0); + if (Main.tile[num4, num8].active()) + { + Main.tile[num4, num8].color(Main.tile[num4, num5].color()); + } + if (Main.netMode == 2 && Main.tile[num4, num8].active()) + { + NetMessage.SendTileSquare(-1, num4, num8, 1); + } + } + else + { + if (WorldGen.genRand.Next(500) == 0 && (!Main.tile[num4, num8].active() || Main.tile[num4, num8].type == 61 || Main.tile[num4, num8].type == 74 || Main.tile[num4, num8].type == 69)) + { + if (!WorldGen.PlayerLOS(num4, num5)) + { + WorldGen.GrowTree(num4, num5); + } + } + else + { + if (WorldGen.genRand.Next(25) == 0 && Main.tile[num4, num8].liquid == 0) + { + WorldGen.PlaceJunglePlant(num4, num8, 233, WorldGen.genRand.Next(8), 0); + if (Main.tile[num4, num8].type == 233) + { + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num4, num8, 4); + } + else + { + WorldGen.PlaceJunglePlant(num4, num8, 233, WorldGen.genRand.Next(12), 1); + if (Main.tile[num4, num8].type == 233 && Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num4, num8, 3); + } + } + } + } + } + } + bool flag9 = false; + for (int num41 = num6; num41 < num7; num41++) + { + for (int num42 = num8; num42 < num9; num42++) + { + if ((num4 != num41 || num5 != num42) && Main.tile[num41, num42].active() && Main.tile[num41, num42].type == 59) + { + WorldGen.SpreadGrass(num41, num42, 59, type5, false, Main.tile[num4, num5].color()); + if ((int)Main.tile[num41, num42].type == type5) + { + WorldGen.SquareTileFrame(num41, num42, true); + flag9 = true; + } + } + } + } + if (Main.netMode == 2 && flag9) + { + NetMessage.SendTileSquare(-1, num4, num5, 3); + } + } + if (Main.tile[num4, num5].type == 61 && WorldGen.genRand.Next(3) == 0 && Main.tile[num4, num5].frameX < 144) + { + if (Main.rand.Next(4) == 0) + { + Main.tile[num4, num5].frameX = (short)(162 + WorldGen.genRand.Next(8) * 18); + } + Main.tile[num4, num5].type = 74; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num4, num5, 3); + } + } + if ((Main.tile[num4, num5].type == 60 || Main.tile[num4, num5].type == 62) && WorldGen.genRand.Next(15) == 0 && !Main.tile[num4, num5 + 1].active() && !Main.tile[num4, num5 + 1].lava()) + { + bool flag10 = false; + for (int num43 = num5; num43 > num5 - 10; num43--) + { + if (Main.tile[num4, num43].active() && Main.tile[num4, num43].type == 60) + { + flag10 = true; + break; + } + } + if (flag10) + { + int num44 = num4; + int num45 = num5 + 1; + Main.tile[num44, num45].type = 62; + Main.tile[num44, num45].active(true); + WorldGen.SquareTileFrame(num44, num45, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num44, num45, 3); + } + } + } + if ((Main.tile[num4, num5].type == 109 || Main.tile[num4, num5].type == 115) && WorldGen.genRand.Next(15) == 0 && !Main.tile[num4, num5 + 1].active() && !Main.tile[num4, num5 + 1].lava()) + { + bool flag11 = false; + for (int num46 = num5; num46 > num5 - 10; num46--) + { + if (Main.tile[num4, num46].active() && Main.tile[num4, num46].type == 109) + { + flag11 = true; + break; + } + } + if (flag11) + { + int num47 = num4; + int num48 = num5 + 1; + Main.tile[num47, num48].type = 115; + Main.tile[num47, num48].active(true); + WorldGen.SquareTileFrame(num47, num48, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num47, num48, 3); + } + } + } + if ((Main.tile[num4, num5].type == 199 || Main.tile[num4, num5].type == 205) && WorldGen.genRand.Next(15) == 0 && !Main.tile[num4, num5 + 1].active() && !Main.tile[num4, num5 + 1].lava()) + { + bool flag12 = false; + for (int num49 = num5; num49 > num5 - 10; num49--) + { + if (Main.tile[num4, num49].active() && Main.tile[num4, num49].type == 199) + { + flag12 = true; + break; + } + } + if (flag12) + { + int num50 = num4; + int num51 = num5 + 1; + Main.tile[num50, num51].type = 205; + Main.tile[num50, num51].active(true); + WorldGen.SquareTileFrame(num50, num51, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num50, num51, 3); + } + } + } + } + } + num3++; + } + int num52 = 0; + while ((float)num52 < (float)(Main.maxTilesX * Main.maxTilesY) * num2) + { + int num53 = WorldGen.genRand.Next(10, Main.maxTilesX - 10); + int num54 = WorldGen.genRand.Next((int)Main.worldSurface - 1, Main.maxTilesY - 20); + int num55 = num53 - 1; + int num56 = num53 + 2; + int num57 = num54 - 1; + int num58 = num54 + 2; + if (num55 < 10) + { + num55 = 10; + } + if (num56 > Main.maxTilesX - 10) + { + num56 = Main.maxTilesX - 10; + } + if (num57 < 10) + { + num57 = 10; + } + if (num58 > Main.maxTilesY - 10) + { + num58 = Main.maxTilesY - 10; + } + if (Main.tile[num53, num54] != null) + { + if (Main.tileAlch[(int)Main.tile[num53, num54].type]) + { + WorldGen.GrowAlch(num53, num54); + } + if (Main.tile[num53, num54].liquid <= 32) + { + if (Main.tile[num53, num54].nactive()) + { + WorldGen.hardUpdateWorld(num53, num54); + if (Main.rand.Next(2000) == 0) + { + WorldGen.plantDye(num53, num54); + } + if (Main.tile[num53, num54].type == 23 && !Main.tile[num53, num57].active() && WorldGen.genRand.Next(1) == 0) + { + WorldGen.PlaceTile(num53, num57, 24, true, false, -1, 0); + if (Main.netMode == 2 && Main.tile[num53, num57].active()) + { + NetMessage.SendTileSquare(-1, num53, num57, 1); + } + } + if (Main.tile[num53, num54].type == 32 && WorldGen.genRand.Next(3) == 0) + { + int num59 = num53; + int num60 = num54; + int num61 = 0; + if (Main.tile[num59 + 1, num60].active() && Main.tile[num59 + 1, num60].type == 32) + { + num61++; + } + if (Main.tile[num59 - 1, num60].active() && Main.tile[num59 - 1, num60].type == 32) + { + num61++; + } + if (Main.tile[num59, num60 + 1].active() && Main.tile[num59, num60 + 1].type == 32) + { + num61++; + } + if (Main.tile[num59, num60 - 1].active() && Main.tile[num59, num60 - 1].type == 32) + { + num61++; + } + if (num61 < 3 || Main.tile[num53, num54].type == 23) + { + int num62 = WorldGen.genRand.Next(4); + if (num62 == 0) + { + num60--; + } + else + { + if (num62 == 1) + { + num60++; + } + else + { + if (num62 == 2) + { + num59--; + } + else + { + if (num62 == 3) + { + num59++; + } + } + } + } + if (!Main.tile[num59, num60].active()) + { + num61 = 0; + if (Main.tile[num59 + 1, num60].active() && Main.tile[num59 + 1, num60].type == 32) + { + num61++; + } + if (Main.tile[num59 - 1, num60].active() && Main.tile[num59 - 1, num60].type == 32) + { + num61++; + } + if (Main.tile[num59, num60 + 1].active() && Main.tile[num59, num60 + 1].type == 32) + { + num61++; + } + if (Main.tile[num59, num60 - 1].active() && Main.tile[num59, num60 - 1].type == 32) + { + num61++; + } + if (num61 < 2) + { + int num63 = 7; + int num64 = num59 - num63; + int num65 = num59 + num63; + int num66 = num60 - num63; + int num67 = num60 + num63; + bool flag13 = false; + for (int num68 = num64; num68 < num65; num68++) + { + for (int num69 = num66; num69 < num67; num69++) + { + if (Math.Abs(num68 - num59) * 2 + Math.Abs(num69 - num60) < 9 && Main.tile[num68, num69].active() && Main.tile[num68, num69].type == 23 && Main.tile[num68, num69 - 1].active() && Main.tile[num68, num69 - 1].type == 32 && Main.tile[num68, num69 - 1].liquid == 0) + { + flag13 = true; + break; + } + } + } + if (flag13) + { + Main.tile[num59, num60].type = 32; + Main.tile[num59, num60].active(true); + WorldGen.SquareTileFrame(num59, num60, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num59, num60, 3); + } + } + } + } + } + } + if (Main.tile[num53, num54].type == 199) + { + int type6 = (int)Main.tile[num53, num54].type; + bool flag14 = false; + for (int num70 = num55; num70 < num56; num70++) + { + for (int num71 = num57; num71 < num58; num71++) + { + if ((num53 != num70 || num54 != num71) && Main.tile[num70, num71].active() && Main.tile[num70, num71].type == 0) + { + WorldGen.SpreadGrass(num70, num71, 0, type6, false, Main.tile[num53, num54].color()); + if ((int)Main.tile[num70, num71].type == type6) + { + WorldGen.SquareTileFrame(num70, num71, true); + flag14 = true; + } + } + } + } + if (Main.netMode == 2 && flag14) + { + NetMessage.SendTileSquare(-1, num53, num54, 3); + } + } + if (Main.tile[num53, num54].type == 60) + { + int type7 = (int)Main.tile[num53, num54].type; + if (!Main.tile[num53, num57].active() && WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(num53, num57, 61, true, false, -1, 0); + if (Main.netMode == 2 && Main.tile[num53, num57].active()) + { + NetMessage.SendTileSquare(-1, num53, num57, 1); + } + } + else + { + if (WorldGen.genRand.Next(25) == 0 && Main.tile[num53, num57].liquid == 0) + { + if (Main.hardMode && NPC.downedMechBossAny && WorldGen.genRand.Next(60) == 0) + { + bool flag15 = true; + int num72 = 150; + for (int num73 = num53 - num72; num73 < num53 + num72; num73 += 2) + { + for (int num74 = num54 - num72; num74 < num54 + num72; num74 += 2) + { + if (num73 > 1 && num73 < Main.maxTilesX - 2 && num74 > 1 && num74 < Main.maxTilesY - 2 && Main.tile[num73, num74].active() && Main.tile[num73, num74].type == 238) + { + flag15 = false; + break; + } + } + } + if (flag15) + { + WorldGen.PlaceJunglePlant(num53, num57, 238, 0, 0); + WorldGen.SquareTileFrame(num53, num57, true); + WorldGen.SquareTileFrame(num53 + 1, num57 + 1, true); + if (Main.tile[num53, num57].type == 238 && Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num53, num57, 4); + } + } + } + if (Main.hardMode && WorldGen.genRand.Next(40) == 0) + { + bool flag16 = true; + int num75 = 80; + for (int num76 = num53 - num75; num76 < num53 + num75; num76 += 2) + { + for (int num77 = num54 - num75; num77 < num54 + num75; num77 += 2) + { + if (num76 > 1 && num76 < Main.maxTilesX - 2 && num77 > 1 && num77 < Main.maxTilesY - 2 && Main.tile[num76, num77].active() && Main.tile[num76, num77].type == 236) + { + flag16 = false; + break; + } + } + } + if (flag16) + { + WorldGen.PlaceJunglePlant(num53, num57, 236, WorldGen.genRand.Next(3), 0); + WorldGen.SquareTileFrame(num53, num57, true); + WorldGen.SquareTileFrame(num53 + 1, num57 + 1, true); + if (Main.tile[num53, num57].type == 236 && Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num53, num57, 4); + } + } + } + else + { + WorldGen.PlaceJunglePlant(num53, num57, 233, WorldGen.genRand.Next(8), 0); + if (Main.tile[num53, num57].type == 233) + { + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num53, num57, 4); + } + else + { + WorldGen.PlaceJunglePlant(num53, num57, 233, WorldGen.genRand.Next(12), 1); + if (Main.tile[num53, num57].type == 233 && Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num53, num57, 3); + } + } + } + } + } + } + bool flag17 = false; + for (int num78 = num55; num78 < num56; num78++) + { + for (int num79 = num57; num79 < num58; num79++) + { + if ((num53 != num78 || num54 != num79) && Main.tile[num78, num79].active() && Main.tile[num78, num79].type == 59) + { + WorldGen.SpreadGrass(num78, num79, 59, type7, false, Main.tile[num53, num54].color()); + if ((int)Main.tile[num78, num79].type == type7) + { + WorldGen.SquareTileFrame(num78, num79, true); + flag17 = true; + } + } + } + } + if (Main.netMode == 2 && flag17) + { + NetMessage.SendTileSquare(-1, num53, num54, 3); + } + } + if (Main.tile[num53, num54].type == 61 && WorldGen.genRand.Next(3) == 0 && Main.tile[num53, num54].frameX < 144) + { + if (Main.rand.Next(4) == 0) + { + Main.tile[num53, num54].frameX = (short)(162 + WorldGen.genRand.Next(8) * 18); + } + Main.tile[num53, num54].type = 74; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num53, num54, 3); + } + } + if ((Main.tile[num53, num54].type == 60 || Main.tile[num53, num54].type == 62) && WorldGen.genRand.Next(5) == 0 && !Main.tile[num53, num54 + 1].active() && !Main.tile[num53, num54 + 1].lava()) + { + bool flag18 = false; + for (int num80 = num54; num80 > num54 - 10; num80--) + { + if (Main.tile[num53, num80].active() && Main.tile[num53, num80].type == 60) + { + flag18 = true; + break; + } + } + if (flag18) + { + int num81 = num53; + int num82 = num54 + 1; + Main.tile[num81, num82].type = 62; + Main.tile[num81, num82].active(true); + WorldGen.SquareTileFrame(num81, num82, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num81, num82, 3); + } + } + } + if (Main.tile[num53, num54].type == 69 && WorldGen.genRand.Next(3) == 0) + { + int num83 = num53; + int num84 = num54; + int num85 = 0; + if (Main.tile[num83 + 1, num84].active() && Main.tile[num83 + 1, num84].type == 69) + { + num85++; + } + if (Main.tile[num83 - 1, num84].active() && Main.tile[num83 - 1, num84].type == 69) + { + num85++; + } + if (Main.tile[num83, num84 + 1].active() && Main.tile[num83, num84 + 1].type == 69) + { + num85++; + } + if (Main.tile[num83, num84 - 1].active() && Main.tile[num83, num84 - 1].type == 69) + { + num85++; + } + if (num85 < 3 || Main.tile[num53, num54].type == 60) + { + int num86 = WorldGen.genRand.Next(4); + if (num86 == 0) + { + num84--; + } + else + { + if (num86 == 1) + { + num84++; + } + else + { + if (num86 == 2) + { + num83--; + } + else + { + if (num86 == 3) + { + num83++; + } + } + } + } + if (!Main.tile[num83, num84].active()) + { + num85 = 0; + if (Main.tile[num83 + 1, num84].active() && Main.tile[num83 + 1, num84].type == 69) + { + num85++; + } + if (Main.tile[num83 - 1, num84].active() && Main.tile[num83 - 1, num84].type == 69) + { + num85++; + } + if (Main.tile[num83, num84 + 1].active() && Main.tile[num83, num84 + 1].type == 69) + { + num85++; + } + if (Main.tile[num83, num84 - 1].active() && Main.tile[num83, num84 - 1].type == 69) + { + num85++; + } + if (num85 < 2) + { + int num87 = 7; + int num88 = num83 - num87; + int num89 = num83 + num87; + int num90 = num84 - num87; + int num91 = num84 + num87; + bool flag19 = false; + for (int num92 = num88; num92 < num89; num92++) + { + for (int num93 = num90; num93 < num91; num93++) + { + if (Math.Abs(num92 - num83) * 2 + Math.Abs(num93 - num84) < 9 && Main.tile[num92, num93].active() && Main.tile[num92, num93].type == 60 && Main.tile[num92, num93 - 1].active() && Main.tile[num92, num93 - 1].type == 69 && Main.tile[num92, num93 - 1].liquid == 0) + { + flag19 = true; + break; + } + } + } + if (flag19) + { + Main.tile[num83, num84].type = 69; + Main.tile[num83, num84].active(true); + WorldGen.SquareTileFrame(num83, num84, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num83, num84, 3); + } + } + } + } + } + } + else + { + if (Main.tile[num53, num54].type == 147 || Main.tile[num53, num54].type == 161 || Main.tile[num53, num54].type == 163 || Main.tile[num53, num54].type == 164 || Main.tile[num53, num54].type == 200) + { + if (Main.rand.Next(10) == 0 && !Main.tile[num53, num54 + 1].active() && !Main.tile[num53, num54 + 2].active()) + { + int num94 = num53 - 3; + int num95 = num53 + 4; + int num96 = 0; + for (int num97 = num94; num97 < num95; num97++) + { + if (Main.tile[num97, num54].type == 165 && Main.tile[num97, num54].active()) + { + num96++; + } + if (Main.tile[num97, num54 + 1].type == 165 && Main.tile[num97, num54 + 1].active()) + { + num96++; + } + if (Main.tile[num97, num54 + 2].type == 165 && Main.tile[num97, num54 + 2].active()) + { + num96++; + } + if (Main.tile[num97, num54 + 3].type == 165 && Main.tile[num97, num54 + 3].active()) + { + num96++; + } + } + if (num96 < 2) + { + WorldGen.PlaceTight(num53, num54 + 1, 165, false); + WorldGen.SquareTileFrame(num53, num54 + 1, true); + if (Main.netMode == 2 && Main.tile[num53, num54 + 1].active()) + { + NetMessage.SendTileSquare(-1, num53, num54 + 1, 3); + } + } + } + } + else + { + if (Main.tileMoss[(int)Main.tile[num53, num54].type]) + { + int type8 = (int)Main.tile[num53, num54].type; + bool flag20 = false; + for (int num98 = num55; num98 < num56; num98++) + { + for (int num99 = num57; num99 < num58; num99++) + { + if ((num53 != num98 || num54 != num99) && Main.tile[num98, num99].active() && Main.tile[num98, num99].type == 1) + { + WorldGen.SpreadGrass(num98, num99, 1, type8, false, Main.tile[num53, num54].color()); + if ((int)Main.tile[num98, num99].type == type8) + { + WorldGen.SquareTileFrame(num98, num99, true); + flag20 = true; + } + } + } + } + if (Main.netMode == 2 && flag20) + { + NetMessage.SendTileSquare(-1, num53, num54, 3); + } + if (WorldGen.genRand.Next(6) == 0) + { + int num100 = num53; + int num101 = num54; + int num102 = WorldGen.genRand.Next(4); + if (num102 == 0) + { + num100--; + } + else + { + if (num102 == 1) + { + num100++; + } + else + { + if (num102 == 2) + { + num101--; + } + else + { + num101++; + } + } + } + if (!Main.tile[num100, num101].active()) + { + WorldGen.PlaceTile(num100, num101, 184, true, false, -1, 0); + if (Main.netMode == 2 && Main.tile[num100, num101].active()) + { + NetMessage.SendTileSquare(-1, num100, num101, 1); + } + } + } + } + } + } + if (Main.tile[num53, num54].type == 70) + { + int type9 = (int)Main.tile[num53, num54].type; + if (!Main.tile[num53, num57].active() && WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(num53, num57, 71, true, false, -1, 0); + if (Main.netMode == 2 && Main.tile[num53, num57].active()) + { + NetMessage.SendTileSquare(-1, num53, num57, 1); + } + } + if (WorldGen.genRand.Next(200) == 0 && !WorldGen.PlayerLOS(num53, num54)) + { + WorldGen.GrowShroom(num53, num54); + } + bool flag21 = false; + for (int num103 = num55; num103 < num56; num103++) + { + for (int num104 = num57; num104 < num58; num104++) + { + if ((num53 != num103 || num54 != num104) && Main.tile[num103, num104].active() && Main.tile[num103, num104].type == 59) + { + WorldGen.SpreadGrass(num103, num104, 59, type9, false, Main.tile[num53, num54].color()); + if ((int)Main.tile[num103, num104].type == type9) + { + WorldGen.SquareTileFrame(num103, num104, true); + flag21 = true; + } + } + } + } + if (Main.netMode == 2 && flag21) + { + NetMessage.SendTileSquare(-1, num53, num54, 3); + } + } + } + else + { + if (Main.tile[num53, num54].wall == 62 && Main.tile[num53, num54].liquid == 0 && WorldGen.genRand.Next(10) == 0) + { + int num105 = WorldGen.genRand.Next(2, 4); + int num106 = num53 - num105; + int num107 = num53 + num105; + int num108 = num54 - num105; + int num109 = num54 + num105; + bool flag22 = false; + for (int num110 = num106; num110 <= num107; num110++) + { + for (int num111 = num108; num111 <= num109; num111++) + { + if (WorldGen.SolidTile(num110, num111)) + { + flag22 = true; + break; + } + } + } + if (flag22 && !Main.tile[num53, num54].active()) + { + WorldGen.PlaceTile(num53, num54, 51, true, false, -1, 0); + WorldGen.TileFrame(num53, num54, true, false); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num53, num54, 3); + } + } + } + if (flag && WorldGen.spawnNPC > 0) + { + if (Main.tile[num53, num54].wall == 34) + { + if (Main.rand.Next(4) == 0) + { + WorldGen.SpawnNPC(num53, num54); + } + } + else + { + WorldGen.SpawnNPC(num53, num54); + } + } + } + } + int num112 = 10; + if (Main.tile[num53, num54].wall == 81 || Main.tile[num53, num54].wall == 83 || (Main.tile[num53, num54].type == 199 && Main.tile[num53, num54].active())) + { + int num113 = num53 + WorldGen.genRand.Next(-2, 3); + int num114 = num54 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[num113, num114].wall >= 63 && Main.tile[num113, num114].wall <= 68) + { + bool flag23 = false; + for (int num115 = num53 - num112; num115 < num53 + num112; num115++) + { + for (int num116 = num54 - num112; num116 < num54 + num112; num116++) + { + if (Main.tile[num53, num54].active()) + { + int type10 = (int)Main.tile[num53, num54].type; + if (type10 == 199 || type10 == 200 || type10 == 201 || type10 == 203 || type10 == 205 || type10 == 234) + { + flag23 = true; + break; + } + } + } + } + if (flag23) + { + Main.tile[num113, num114].wall = 81; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num113, num114, 3); + } + } + } + } + if (Main.tile[num53, num54].wall == 69 || Main.tile[num53, num54].wall == 3 || (Main.tile[num53, num54].type == 23 && Main.tile[num53, num54].active())) + { + int num117 = num53 + WorldGen.genRand.Next(-2, 3); + int num118 = num54 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[num117, num118].wall >= 63 && Main.tile[num117, num118].wall <= 68) + { + bool flag24 = false; + for (int num119 = num53 - num112; num119 < num53 + num112; num119++) + { + for (int num120 = num54 - num112; num120 < num54 + num112; num120++) + { + if (Main.tile[num53, num54].active()) + { + int type11 = (int)Main.tile[num53, num54].type; + if (type11 == 22 || type11 == 23 || type11 == 24 || type11 == 25 || type11 == 32 || type11 == 112 || type11 == 163) + { + flag24 = true; + break; + } + } + } + } + if (flag24) + { + Main.tile[num117, num118].wall = 69; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num117, num118, 3); + } + } + } + } + if (Main.tile[num53, num54].wall == 70 || (Main.tile[num53, num54].type == 109 && Main.tile[num53, num54].active())) + { + int num121 = num53 + WorldGen.genRand.Next(-2, 3); + int num122 = num54 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[num121, num122].wall == 63 || Main.tile[num121, num122].wall == 65 || Main.tile[num121, num122].wall == 66 || Main.tile[num121, num122].wall == 68) + { + bool flag25 = false; + for (int num123 = num53 - num112; num123 < num53 + num112; num123++) + { + for (int num124 = num54 - num112; num124 < num54 + num112; num124++) + { + if (Main.tile[num53, num54].active()) + { + int type12 = (int)Main.tile[num53, num54].type; + if (type12 == 109 || type12 == 110 || type12 == 113 || type12 == 115 || type12 == 116 || type12 == 117 || type12 == 164) + { + flag25 = true; + break; + } + } + } + } + if (flag25) + { + Main.tile[num121, num122].wall = 70; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num121, num122, 3); + } + } + } + } + } + num52++; + } + if (Main.rand.Next(100) == 0) + { + WorldGen.PlantAlch(); + } + if (!Main.dayTime) + { + float num125 = (float)(Main.maxTilesX / 4200); + if ((float)Main.rand.Next(8000) < 10f * num125) + { + int num126 = 12; + int num127 = Main.rand.Next(Main.maxTilesX - 50) + 100; + num127 *= 16; + int num128 = Main.rand.Next((int)((double)Main.maxTilesY * 0.05)); + num128 *= 16; + Vector2 vector = new Vector2((float)num127, (float)num128); + float num129 = (float)Main.rand.Next(-100, 101); + float num130 = (float)(Main.rand.Next(200) + 100); + float num131 = (float)Math.Sqrt((double)(num129 * num129 + num130 * num130)); + num131 = (float)num126 / num131; + num129 *= num131; + num130 *= num131; + Projectile.NewProjectile(vector.X, vector.Y, num129, num130, 12, 1000, 10f, Main.myPlayer, 0f, 0f); + } + } + } + public static void PlaceWall(int i, int j, int type, bool mute = false) + { + if (i <= 1 || j <= 1 || i >= Main.maxTilesX - 2 || j >= Main.maxTilesY - 2) + { + return; + } + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j].wall == 0) + { + Main.tile[i, j].wall = (byte)type; + WorldGen.SquareWallFrame(i, j, true); + if (!mute) + { + Main.PlaySound(0, i * 16, j * 16, 1); + } + } + } + public static void AddPlants() + { + for (int i = 0; i < Main.maxTilesX; i++) + { + for (int j = 1; j < Main.maxTilesY; j++) + { + if (Main.tile[i, j].type == 2 && Main.tile[i, j].nactive()) + { + if (!Main.tile[i, j - 1].active()) + { + WorldGen.PlaceTile(i, j - 1, 3, true, false, -1, 0); + } + } + else + { + if (Main.tile[i, j].type == 23 && Main.tile[i, j].nactive()) + { + if (!Main.tile[i, j - 1].active()) + { + WorldGen.PlaceTile(i, j - 1, 24, true, false, -1, 0); + } + } + else + { + if (Main.tile[i, j].type == 199 && Main.tile[i, j].nactive() && !Main.tile[i, j - 1].active()) + { + WorldGen.PlaceTile(i, j - 1, 201, true, false, -1, 0); + } + } + } + } + } + } + public static void SpreadGrass(int i, int j, int dirt = 0, int grass = 2, bool repeat = true, byte color = 0) + { + try + { + if ((int)Main.tile[i, j].type == dirt && Main.tile[i, j].active() && ((double)j < Main.worldSurface || dirt != 0)) + { + int num = i - 1; + int num2 = i + 2; + int num3 = j - 1; + int num4 = j + 2; + if (num < 0) + { + num = 0; + } + if (num2 > Main.maxTilesX) + { + num2 = Main.maxTilesX; + } + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesY) + { + num4 = Main.maxTilesY; + } + bool flag = true; + for (int k = num; k < num2; k++) + { + for (int l = num3; l < num4; l++) + { + if (!Main.tile[k, l].active() || !Main.tileSolid[(int)Main.tile[k, l].type]) + { + flag = false; + } + if (Main.tile[k, l].lava() && Main.tile[k, l].liquid > 0) + { + flag = true; + break; + } + } + } + if (!flag) + { + if (grass != 23 || Main.tile[i, j - 1].type != 27) + { + Main.tile[i, j].type = (byte)grass; + Main.tile[i, j].color(color); + for (int m = num; m < num2; m++) + { + for (int n = num3; n < num4; n++) + { + if (Main.tile[m, n].active() && (int)Main.tile[m, n].type == dirt) + { + try + { + if (repeat && WorldGen.grassSpread < 1000) + { + WorldGen.grassSpread++; + WorldGen.SpreadGrass(m, n, dirt, grass, true, 0); + WorldGen.grassSpread--; + } + } + catch + { + } + } + } + } + } + } + } + } + catch + { + } + } + public static void ChasmRunnerSideways(int i, int j, int direction, int steps) + { + float num = (float)steps; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(10, 21) * 0.1f * (float)direction; + value2.Y = (float)WorldGen.genRand.Next(-10, 10) * 0.01f; + double num2 = (double)(WorldGen.genRand.Next(5) + 7); + while (num2 > 0.0) + { + if (num > 0f) + { + num2 += (double)WorldGen.genRand.Next(3); + num2 -= (double)WorldGen.genRand.Next(3); + if (num2 < 7.0) + { + num2 = 7.0; + } + if (num2 > 20.0) + { + num2 = 20.0; + } + if (num == 1f && num2 < 10.0) + { + num2 = 10.0; + } + } + else + { + num2 -= (double)WorldGen.genRand.Next(4); + } + if ((double)value.Y > Main.rockLayer && num > 0f) + { + num = 0f; + } + num -= 1f; + int num3 = (int)((double)value.X - num2 * 0.5); + int num4 = (int)((double)value.X + num2 * 0.5); + int num5 = (int)((double)value.Y - num2 * 0.5); + int num6 = (int)((double)value.Y + num2 * 0.5); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX - 1) + { + num4 = Main.maxTilesX - 1; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int k = num3; k < num4; k++) + { + for (int l = num5; l < num6; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < num2 * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[k, l].type != 31 && Main.tile[k, l].type != 22) + { + Main.tile[k, l].active(false); + } + } + } + value += value2; + value2.Y += (float)WorldGen.genRand.Next(-10, 10) * 0.1f; + if (value.Y < (float)(j - 20)) + { + value2.Y += (float)WorldGen.genRand.Next(20) * 0.01f; + } + if (value.Y > (float)(j + 20)) + { + value2.Y -= (float)WorldGen.genRand.Next(20) * 0.01f; + } + if ((double)value2.Y < -0.5) + { + value2.Y = -0.5f; + } + if ((double)value2.Y > 0.5) + { + value2.Y = 0.5f; + } + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.01f; + if (direction == -1) + { + if ((double)value2.X > -0.5) + { + value2.X = -0.5f; + } + if (value2.X < -2f) + { + value2.X = -2f; + } + } + else + { + if (direction == 1) + { + if ((double)value2.X < 0.5) + { + value2.X = 0.5f; + } + if (value2.X > 2f) + { + value2.X = 2f; + } + } + } + num3 = (int)((double)value.X - num2 * 1.1); + num4 = (int)((double)value.X + num2 * 1.1); + num5 = (int)((double)value.Y - num2 * 1.1); + num6 = (int)((double)value.Y + num2 * 1.1); + if (num3 < 1) + { + num3 = 1; + } + if (num4 > Main.maxTilesX - 1) + { + num4 = Main.maxTilesX - 1; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + for (int m = num3; m < num4; m++) + { + for (int n = num5; n < num6; n++) + { + if ((double)(Math.Abs((float)m - value.X) + Math.Abs((float)n - value.Y)) < num2 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[m, n].wall != 3) + { + if (Main.tile[m, n].type != 25 && n > j + WorldGen.genRand.Next(3, 20)) + { + Main.tile[m, n].active(true); + } + Main.tile[m, n].active(true); + if (Main.tile[m, n].type != 31 && Main.tile[m, n].type != 22) + { + Main.tile[m, n].type = 25; + } + if (Main.tile[m, n].wall == 2) + { + Main.tile[m, n].wall = 0; + } + } + } + } + for (int num7 = num3; num7 < num4; num7++) + { + for (int num8 = num5; num8 < num6; num8++) + { + if ((double)(Math.Abs((float)num7 - value.X) + Math.Abs((float)num8 - value.Y)) < num2 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[num7, num8].wall != 3) + { + if (Main.tile[num7, num8].type != 31 && Main.tile[num7, num8].type != 22) + { + Main.tile[num7, num8].type = 25; + } + Main.tile[num7, num8].active(true); + WorldGen.PlaceWall(num7, num8, 3, true); + } + } + } + } + if (WorldGen.genRand.Next(3) == 0) + { + int num9 = (int)value.X; + int num10 = (int)value.Y; + while (!Main.tile[num9, num10].active()) + { + num10++; + } + WorldGen.TileRunner(num9, num10, (double)WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(3, 7), 22, false, 0f, 0f, false, true); + } + } + public static void CrimStart(int i, int j) + { + int crimDir = 1; + WorldGen.heartCount = 0; + WorldGen.crimson = true; + int num = j; + if ((double)num > Main.worldSurface) + { + num = (int)Main.worldSurface; + } + while (!WorldGen.SolidTile(i, num)) + { + num++; + } + int num2 = num; + Vector2 vector = new Vector2((float)i, (float)num); + Vector2 value = new Vector2((float)WorldGen.genRand.Next(-20, 21) * 0.1f, (float)WorldGen.genRand.Next(20, 201) * 0.01f); + if (value.X < 0f) + { + crimDir = -1; + } + float num3 = (float)WorldGen.genRand.Next(15, 26); + bool flag = true; + int num4 = 0; + while (flag) + { + num3 += (float)Main.rand.Next(-50, 51) * 0.01f; + if (num3 < 15f) + { + num3 = 15f; + } + if (num3 > 25f) + { + num3 = 25f; + } + int num5 = (int)(vector.X - num3 / 2f); + while ((float)num5 < vector.X + num3 / 2f) + { + int num6 = (int)(vector.Y - num3 / 2f); + while ((float)num6 < vector.Y + num3 / 2f) + { + if (num6 > num2) + { + if ((double)(Math.Abs((float)num5 - vector.X) + Math.Abs((float)num6 - vector.Y)) < (double)num3 * 0.3) + { + Main.tile[num5, num6].active(false); + Main.tile[num5, num6].wall = 83; + } + else + { + if ((double)(Math.Abs((float)num5 - vector.X) + Math.Abs((float)num6 - vector.Y)) < (double)num3 * 0.8 && Main.tile[num5, num6].wall != 83) + { + Main.tile[num5, num6].active(true); + Main.tile[num5, num6].type = 203; + if ((double)(Math.Abs((float)num5 - vector.X) + Math.Abs((float)num6 - vector.Y)) < (double)num3 * 0.6) + { + Main.tile[num5, num6].wall = 83; + } + } + } + } + else + { + if ((double)(Math.Abs((float)num5 - vector.X) + Math.Abs((float)num6 - vector.Y)) < (double)num3 * 0.3 && Main.tile[num5, num6].active()) + { + Main.tile[num5, num6].active(false); + Main.tile[num5, num6].wall = 83; + } + } + num6++; + } + num5++; + } + if (vector.X > (float)(i + 50)) + { + num4 = -100; + } + if (vector.X < (float)(i - 50)) + { + num4 = 100; + } + if (num4 < 0) + { + value.X -= (float)WorldGen.genRand.Next(20, 51) * 0.01f; + } + else + { + if (num4 > 0) + { + value.X += (float)WorldGen.genRand.Next(20, 51) * 0.01f; + } + else + { + value.X += (float)WorldGen.genRand.Next(-50, 51) * 0.01f; + } + } + value.Y += (float)WorldGen.genRand.Next(-50, 51) * 0.01f; + if ((double)value.Y < 0.25) + { + value.Y = 0.25f; + } + if (value.Y > 2f) + { + value.Y = 2f; + } + if (value.X < -2f) + { + value.X = -2f; + } + if (value.X > 2f) + { + value.X = 2f; + } + vector += value; + if ((double)vector.Y > Main.worldSurface + 100.0) + { + flag = false; + } + } + num3 = (float)WorldGen.genRand.Next(40, 55); + for (int k = 0; k < 50; k++) + { + int num7 = (int)vector.X + WorldGen.genRand.Next(-20, 21); + int num8 = (int)vector.Y + WorldGen.genRand.Next(-20, 21); + int num9 = (int)((float)num7 - num3 / 2f); + while ((float)num9 < (float)num7 + num3 / 2f) + { + int num10 = (int)((float)num8 - num3 / 2f); + while ((float)num10 < (float)num8 + num3 / 2f) + { + float num11 = (float)Math.Abs(num9 - num7); + float num12 = (float)Math.Abs(num10 - num8); + float num13 = 1f + (float)WorldGen.genRand.Next(-20, 21) * 0.01f; + float num14 = 1f + (float)WorldGen.genRand.Next(-20, 21) * 0.01f; + num11 *= num13; + num12 *= num14; + double num15 = Math.Sqrt((double)(num11 * num11 + num12 * num12)); + if (num15 < (double)num3 * 0.25) + { + Main.tile[num9, num10].active(false); + Main.tile[num9, num10].wall = 83; + } + else + { + if (num15 < (double)num3 * 0.4 && Main.tile[num9, num10].wall != 83) + { + Main.tile[num9, num10].active(true); + Main.tile[num9, num10].type = 203; + if (num15 < (double)num3 * 0.35) + { + Main.tile[num9, num10].wall = 83; + } + } + } + num10++; + } + num9++; + } + } + int num16 = WorldGen.genRand.Next(5, 9); + Vector2[] array = new Vector2[num16]; + for (int l = 0; l < num16; l++) + { + int num17 = (int)vector.X; + int num18 = (int)vector.Y; + int num19 = 0; + bool flag2 = true; + Vector2 vector2 = new Vector2((float)WorldGen.genRand.Next(-20, 21) * 0.15f, (float)WorldGen.genRand.Next(0, 21) * 0.15f); + while (flag2) + { + vector2 = new Vector2((float)WorldGen.genRand.Next(-20, 21) * 0.15f, (float)WorldGen.genRand.Next(0, 21) * 0.15f); + while ((double)(Math.Abs(vector2.X) + Math.Abs(vector2.Y)) < 1.5) + { + vector2 = new Vector2((float)WorldGen.genRand.Next(-20, 21) * 0.15f, (float)WorldGen.genRand.Next(0, 21) * 0.15f); + } + flag2 = false; + for (int m = 0; m < l; m++) + { + if ((double)value.X > (double)array[m].X - 0.75 && (double)value.X < (double)array[m].X + 0.75 && (double)value.Y > (double)array[m].Y - 0.75 && (double)value.Y < (double)array[m].Y + 0.75) + { + flag2 = true; + num19++; + break; + } + } + if (num19 > 10000) + { + break; + } + } + array[l] = vector2; + WorldGen.CrimVein(new Vector2((float)num17, (float)num18), vector2); + } + for (int n = 0; n < WorldGen.heartCount; n++) + { + num3 = (float)WorldGen.genRand.Next(16, 21); + int num20 = (int)WorldGen.heartPos[n].X; + int num21 = (int)WorldGen.heartPos[n].Y; + int num22 = (int)((float)num20 - num3 / 2f); + while ((float)num22 < (float)num20 + num3 / 2f) + { + int num23 = (int)((float)num21 - num3 / 2f); + while ((float)num23 < (float)num21 + num3 / 2f) + { + float num24 = (float)Math.Abs(num22 - num20); + float num25 = (float)Math.Abs(num23 - num21); + double num26 = Math.Sqrt((double)(num24 * num24 + num25 * num25)); + if (num26 < (double)num3 * 0.4) + { + Main.tile[num22, num23].active(true); + Main.tile[num22, num23].type = 203; + Main.tile[num22, num23].wall = 83; + } + num23++; + } + num22++; + } + } + for (int num27 = 0; num27 < WorldGen.heartCount; num27++) + { + num3 = (float)WorldGen.genRand.Next(10, 14); + int num28 = (int)WorldGen.heartPos[num27].X; + int num29 = (int)WorldGen.heartPos[num27].Y; + int num30 = (int)((float)num28 - num3 / 2f); + while ((float)num30 < (float)num28 + num3 / 2f) + { + int num31 = (int)((float)num29 - num3 / 2f); + while ((float)num31 < (float)num29 + num3 / 2f) + { + float num32 = (float)Math.Abs(num30 - num28); + float num33 = (float)Math.Abs(num31 - num29); + double num34 = Math.Sqrt((double)(num32 * num32 + num33 * num33)); + if (num34 < (double)num3 * 0.3) + { + Main.tile[num30, num31].active(false); + Main.tile[num30, num31].wall = 83; + } + num31++; + } + num30++; + } + } + for (int num35 = 0; num35 < WorldGen.heartCount; num35++) + { + WorldGen.AddShadowOrb((int)WorldGen.heartPos[num35].X, (int)WorldGen.heartPos[num35].Y); + } + int num36 = Main.maxTilesX; + int num37 = 0; + vector.X = (float)i; + vector.Y = (float)num2; + num3 = (float)WorldGen.genRand.Next(25, 35); + float num38 = (float)WorldGen.genRand.Next(0, 6); + for (int num39 = 0; num39 < 50; num39++) + { + if (num38 > 0f) + { + float num40 = (float)WorldGen.genRand.Next(10, 30) * 0.01f; + num38 -= num40; + vector.Y -= num40; + } + int num41 = (int)vector.X + WorldGen.genRand.Next(-2, 3); + int num42 = (int)vector.Y + WorldGen.genRand.Next(-2, 3); + int num43 = (int)((float)num41 - num3 / 2f); + while ((float)num43 < (float)num41 + num3 / 2f) + { + int num44 = (int)((float)num42 - num3 / 2f); + while ((float)num44 < (float)num42 + num3 / 2f) + { + float num45 = (float)Math.Abs(num43 - num41); + float num46 = (float)Math.Abs(num44 - num42); + float num47 = 1f + (float)WorldGen.genRand.Next(-20, 21) * 0.005f; + float num48 = 1f + (float)WorldGen.genRand.Next(-20, 21) * 0.005f; + num45 *= num47; + num46 *= num48; + double num49 = Math.Sqrt((double)(num45 * num45 + num46 * num46)); + if (num49 < (double)num3 * 0.2 * ((double)WorldGen.genRand.Next(90, 111) * 0.01)) + { + Main.tile[num43, num44].active(false); + Main.tile[num43, num44].wall = 83; + } + else + { + if (num49 < (double)num3 * 0.45) + { + if (num43 < num36) + { + num36 = num43; + } + if (num43 > num37) + { + num37 = num43; + } + if (Main.tile[num43, num44].wall != 83) + { + Main.tile[num43, num44].active(true); + Main.tile[num43, num44].type = 203; + if (num49 < (double)num3 * 0.35) + { + Main.tile[num43, num44].wall = 83; + } + } + } + } + num44++; + } + num43++; + } + } + for (int num50 = num36; num50 <= num37; num50++) + { + int num51 = num2; + while ((Main.tile[num50, num51].type == 203 && Main.tile[num50, num51].active()) || Main.tile[num50, num51].wall == 83) + { + num51++; + } + int num52 = WorldGen.genRand.Next(15, 20); + while (!Main.tile[num50, num51].active() && num52 > 0 && Main.tile[num50, num51].wall != 83) + { + num52--; + Main.tile[num50, num51].type = 203; + Main.tile[num50, num51].active(true); + num51++; + } + } + WorldGen.CrimEnt(vector, crimDir); + } + public static void CrimEnt(Vector2 position, int crimDir) + { + float num = 0f; + float num2 = (float)WorldGen.genRand.Next(6, 11); + bool flag = true; + Vector2 value = new Vector2(2f, (float)WorldGen.genRand.Next(-20, 0) * 0.01f); + value.X *= (float)(-(float)crimDir); + while (flag) + { + num += 1f; + if (num >= 20f) + { + flag = false; + } + num2 += (float)Main.rand.Next(-10, 11) * 0.02f; + if (num2 < 6f) + { + num2 = 6f; + } + if (num2 > 10f) + { + num2 = 10f; + } + int num3 = (int)(position.X - num2 / 2f); + while ((float)num3 < position.X + num2 / 2f) + { + int num4 = (int)(position.Y - num2 / 2f); + while ((float)num4 < position.Y + num2 / 2f) + { + float num5 = Math.Abs((float)num3 - position.X); + float num6 = Math.Abs((float)num4 - position.Y); + double num7 = Math.Sqrt((double)(num5 * num5 + num6 * num6)); + if (num7 < (double)num2 * 0.5 && Main.tile[num3, num4].active() && Main.tile[num3, num4].type == 203) + { + Main.tile[num3, num4].active(false); + flag = true; + num = 0f; + } + num4++; + } + num3++; + } + position += value; + } + } + public static void CrimVein(Vector2 position, Vector2 velocity) + { + float num = (float)WorldGen.genRand.Next(15, 26); + bool flag = true; + Vector2 vector = velocity; + Vector2 vector2 = position; + int num2 = WorldGen.genRand.Next(100, 150); + if (velocity.Y < 0f) + { + num2 -= 25; + } + while (flag) + { + num += (float)Main.rand.Next(-50, 51) * 0.02f; + if (num < 15f) + { + num = 15f; + } + if (num > 25f) + { + num = 25f; + } + int num3 = (int)(position.X - num / 2f); + while ((float)num3 < position.X + num / 2f) + { + int num4 = (int)(position.Y - num / 2f); + while ((float)num4 < position.Y + num / 2f) + { + float num5 = Math.Abs((float)num3 - position.X); + float num6 = Math.Abs((float)num4 - position.Y); + double num7 = Math.Sqrt((double)(num5 * num5 + num6 * num6)); + if (num7 < (double)num * 0.2) + { + Main.tile[num3, num4].active(false); + Main.tile[num3, num4].wall = 83; + } + else + { + if (num7 < (double)num * 0.5 && Main.tile[num3, num4].wall != 83) + { + Main.tile[num3, num4].active(true); + Main.tile[num3, num4].type = 203; + if (num7 < (double)num * 0.4) + { + Main.tile[num3, num4].wall = 83; + } + } + } + num4++; + } + num3++; + } + velocity.X += (float)WorldGen.genRand.Next(-50, 51) * 0.05f; + velocity.Y += (float)WorldGen.genRand.Next(-50, 51) * 0.05f; + if ((double)velocity.Y < (double)vector.Y - 0.75) + { + velocity.Y = vector.Y - 0.75f; + } + if ((double)velocity.Y > (double)vector.Y + 0.75) + { + velocity.Y = vector.Y + 0.75f; + } + if ((double)velocity.X < (double)vector.X - 0.75) + { + velocity.X = vector.X - 0.75f; + } + if ((double)velocity.X > (double)vector.X + 0.75) + { + velocity.X = vector.X + 0.75f; + } + position += velocity; + if (Math.Abs(position.X - vector2.X) + Math.Abs(position.Y - vector2.Y) > (float)num2) + { + flag = false; + } + } + WorldGen.heartPos[WorldGen.heartCount] = position; + WorldGen.heartCount++; + } + public static void ChasmRunner(int i, int j, int steps, bool makeOrb = false) + { + bool flag = false; + bool flag2 = false; + bool flag3 = false; + if (!makeOrb) + { + flag2 = true; + } + float num = (float)steps; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(11) * 0.2f + 0.5f; + int num2 = 5; + double num3 = (double)(WorldGen.genRand.Next(5) + 7); + while (num3 > 0.0) + { + if (num > 0f) + { + num3 += (double)WorldGen.genRand.Next(3); + num3 -= (double)WorldGen.genRand.Next(3); + if (num3 < 7.0) + { + num3 = 7.0; + } + if (num3 > 20.0) + { + num3 = 20.0; + } + if (num == 1f && num3 < 10.0) + { + num3 = 10.0; + } + } + else + { + if ((double)value.Y > Main.worldSurface + 45.0) + { + num3 -= (double)WorldGen.genRand.Next(4); + } + } + if ((double)value.Y > Main.rockLayer && num > 0f) + { + num = 0f; + } + num -= 1f; + if (!flag && (double)value.Y > Main.worldSurface + 20.0) + { + flag = true; + WorldGen.ChasmRunnerSideways((int)value.X, (int)value.Y, -1, WorldGen.genRand.Next(20, 40)); + WorldGen.ChasmRunnerSideways((int)value.X, (int)value.Y, 1, WorldGen.genRand.Next(20, 40)); + } + int num4; + int num5; + int num6; + int num7; + if (num > (float)num2) + { + num4 = (int)((double)value.X - num3 * 0.5); + num5 = (int)((double)value.X + num3 * 0.5); + num6 = (int)((double)value.Y - num3 * 0.5); + num7 = (int)((double)value.Y + num3 * 0.5); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX - 1) + { + num5 = Main.maxTilesX - 1; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int k = num4; k < num5; k++) + { + for (int l = num6; l < num7; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < num3 * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[k, l].type != 31 && Main.tile[k, l].type != 22) + { + Main.tile[k, l].active(false); + } + } + } + } + if (num <= 2f && (double)value.Y < Main.worldSurface + 45.0) + { + num = 2f; + } + if (num <= 0f) + { + if (!flag2) + { + flag2 = true; + WorldGen.AddShadowOrb((int)value.X, (int)value.Y); + } + else + { + if (!flag3) + { + flag3 = false; + bool flag4 = false; + int num8 = 0; + while (!flag4) + { + int num9 = WorldGen.genRand.Next((int)value.X - 25, (int)value.X + 25); + int num10 = WorldGen.genRand.Next((int)value.Y - 50, (int)value.Y); + if (num9 < 5) + { + num9 = 5; + } + if (num9 > Main.maxTilesX - 5) + { + num9 = Main.maxTilesX - 5; + } + if (num10 < 5) + { + num10 = 5; + } + if (num10 > Main.maxTilesY - 5) + { + num10 = Main.maxTilesY - 5; + } + if ((double)num10 > Main.worldSurface) + { + WorldGen.Place3x2(num9, num10, 26, 0); + if (Main.tile[num9, num10].type == 26) + { + flag4 = true; + } + else + { + num8++; + if (num8 >= 10000) + { + flag4 = true; + } + } + } + else + { + flag4 = true; + } + } + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.01f; + if ((double)value2.X > 0.3) + { + value2.X = 0.3f; + } + if ((double)value2.X < -0.3) + { + value2.X = -0.3f; + } + num4 = (int)((double)value.X - num3 * 1.1); + num5 = (int)((double)value.X + num3 * 1.1); + num6 = (int)((double)value.Y - num3 * 1.1); + num7 = (int)((double)value.Y + num3 * 1.1); + if (num4 < 1) + { + num4 = 1; + } + if (num5 > Main.maxTilesX - 1) + { + num5 = Main.maxTilesX - 1; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int m = num4; m < num5; m++) + { + for (int n = num6; n < num7; n++) + { + if ((double)(Math.Abs((float)m - value.X) + Math.Abs((float)n - value.Y)) < num3 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015)) + { + if (Main.tile[m, n].type != 25 && n > j + WorldGen.genRand.Next(3, 20)) + { + Main.tile[m, n].active(true); + } + if (steps <= num2) + { + Main.tile[m, n].active(true); + } + if (Main.tile[m, n].type != 31) + { + Main.tile[m, n].type = 25; + } + } + } + } + for (int num11 = num4; num11 < num5; num11++) + { + for (int num12 = num6; num12 < num7; num12++) + { + if ((double)(Math.Abs((float)num11 - value.X) + Math.Abs((float)num12 - value.Y)) < num3 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015)) + { + if (Main.tile[num11, num12].type != 31) + { + Main.tile[num11, num12].type = 25; + } + if (steps <= num2) + { + Main.tile[num11, num12].active(true); + } + if (num12 > j + WorldGen.genRand.Next(3, 20)) + { + Main.tile[num11, num12].wall = 3; + } + } + } + } + } + } + public static void JungleRunner(int i, int j) + { + double num = (double)WorldGen.genRand.Next(5, 11); + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(10, 20) * 0.1f; + int num2 = 0; + bool flag = true; + while (flag) + { + if ((double)value.Y < Main.worldSurface) + { + int num3 = (int)value.X; + int num4 = (int)value.Y; + if (num4 < 5) + { + num4 = 5; + } + if (Main.tile[num3, num4].wall == 0 && !Main.tile[num3, num4].active() && Main.tile[num3, num4 - 3].wall == 0 && !Main.tile[num3, num4 - 3].active() && Main.tile[num3, num4 - 1].wall == 0 && !Main.tile[num3, num4 - 1].active() && Main.tile[num3, num4 - 4].wall == 0 && !Main.tile[num3, num4 - 4].active() && Main.tile[num3, num4 - 2].wall == 0 && !Main.tile[num3, num4 - 2].active() && Main.tile[num3, num4 - 5].wall == 0 && !Main.tile[num3, num4 - 5].active()) + { + flag = false; + } + } + WorldGen.JungleX = (int)value.X; + num += (double)((float)WorldGen.genRand.Next(-20, 21) * 0.1f); + if (num < 5.0) + { + num = 5.0; + } + if (num > 10.0) + { + num = 10.0; + } + int num5 = (int)((double)value.X - num * 0.5); + int num6 = (int)((double)value.X + num * 0.5); + int num7 = (int)((double)value.Y - num * 0.5); + int num8 = (int)((double)value.Y + num * 0.5); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int k = num5; k < num6; k++) + { + for (int l = num7; l < num8; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < num * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015)) + { + WorldGen.KillTile(k, l, false, false, false); + } + } + } + num2++; + if (num2 > 10 && WorldGen.genRand.Next(50) < num2) + { + num2 = 0; + int num9 = -2; + if (WorldGen.genRand.Next(2) == 0) + { + num9 = 2; + } + WorldGen.TileRunner((int)value.X, (int)value.Y, (double)WorldGen.genRand.Next(3, 20), WorldGen.genRand.Next(10, 100), -1, false, (float)num9, 0f, false, true); + } + value += value2; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.01f; + if (value2.Y > 0f) + { + value2.Y = 0f; + } + if (value2.Y < -2f) + { + value2.Y = -2f; + } + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + if (value.X < (float)(i - 200)) + { + value2.X += (float)WorldGen.genRand.Next(5, 21) * 0.1f; + } + if (value.X > (float)(i + 200)) + { + value2.X -= (float)WorldGen.genRand.Next(5, 21) * 0.1f; + } + if ((double)value2.X > 1.5) + { + value2.X = 1.5f; + } + if ((double)value2.X < -1.5) + { + value2.X = -1.5f; + } + } + } + public static void GERunner(int i, int j, float speedX = 0f, float speedY = 0f, bool good = true) + { + int num = WorldGen.genRand.Next(200, 250); + float num2 = (float)(Main.maxTilesX / 4200); + num = (int)((float)num * num2); + double num3 = (double)num; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + if (speedX != 0f || speedY != 0f) + { + value2.X = speedX; + value2.Y = speedY; + } + bool flag = true; + while (flag) + { + int num4 = (int)((double)value.X - num3 * 0.5); + int num5 = (int)((double)value.X + num3 * 0.5); + int num6 = (int)((double)value.Y - num3 * 0.5); + int num7 = (int)((double)value.Y + num3 * 0.5); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int k = num4; k < num5; k++) + { + for (int l = num6; l < num7; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < (double)num * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015)) + { + if (good) + { + if (Main.tile[k, l].wall == 63 || Main.tile[k, l].wall == 65 || Main.tile[k, l].wall == 66 || Main.tile[k, l].wall == 68 || Main.tile[k, l].wall == 69 || Main.tile[k, l].wall == 81) + { + Main.tile[k, l].wall = 70; + } + if (Main.tile[k, l].wall == 3 || Main.tile[k, l].wall == 83) + { + Main.tile[k, l].wall = 28; + } + if (Main.tile[k, l].type == 2) + { + Main.tile[k, l].type = 109; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 1) + { + Main.tile[k, l].type = 117; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 123) + { + Main.tile[k, l].type = 116; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 23 || Main.tile[k, l].type == 199) + { + Main.tile[k, l].type = 109; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 25 || Main.tile[k, l].type == 203) + { + Main.tile[k, l].type = 117; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 112 || Main.tile[k, l].type == 234) + { + Main.tile[k, l].type = 116; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 161 || Main.tile[k, l].type == 163 || Main.tile[k, l].type == 200) + { + Main.tile[k, l].type = 164; + WorldGen.SquareTileFrame(k, l, true); + } + } + } + } + } + } + } + } + else + { + if (WorldGen.crimson) + { + if (Main.tile[k, l].wall == 63 || Main.tile[k, l].wall == 65 || Main.tile[k, l].wall == 66 || Main.tile[k, l].wall == 68) + { + Main.tile[k, l].wall = 81; + } + if (Main.tile[k, l].type == 2) + { + Main.tile[k, l].type = 199; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 1) + { + Main.tile[k, l].type = 203; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 123) + { + Main.tile[k, l].type = 234; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 109) + { + Main.tile[k, l].type = 199; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 117) + { + Main.tile[k, l].type = 203; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 116) + { + Main.tile[k, l].type = 234; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 161 || Main.tile[k, l].type == 164) + { + Main.tile[k, l].type = 200; + WorldGen.SquareTileFrame(k, l, true); + } + } + } + } + } + } + } + } + else + { + if (Main.tile[k, l].wall == 63 || Main.tile[k, l].wall == 65 || Main.tile[k, l].wall == 66 || Main.tile[k, l].wall == 68) + { + Main.tile[k, l].wall = 69; + } + if (Main.tile[k, l].type == 2) + { + Main.tile[k, l].type = 23; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 1) + { + Main.tile[k, l].type = 25; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 53 || Main.tile[k, l].type == 123) + { + Main.tile[k, l].type = 112; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 109) + { + Main.tile[k, l].type = 23; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 117) + { + Main.tile[k, l].type = 25; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 116) + { + Main.tile[k, l].type = 112; + WorldGen.SquareTileFrame(k, l, true); + } + else + { + if (Main.tile[k, l].type == 161 || Main.tile[k, l].type == 164) + { + Main.tile[k, l].type = 163; + WorldGen.SquareTileFrame(k, l, true); + } + } + } + } + } + } + } + } + } + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > speedX + 1f) + { + value2.X = speedX + 1f; + } + if (value2.X < speedX - 1f) + { + value2.X = speedX - 1f; + } + if (value.X < (float)(-(float)num) || value.Y < (float)(-(float)num) || value.X > (float)(Main.maxTilesX + num) || value.Y > (float)(Main.maxTilesX + num)) + { + flag = false; + } + } + } + public static void TileRunner(int i, int j, double strength, int steps, int type, bool addTile = false, float speedX = 0f, float speedY = 0f, bool noYChange = false, bool overRide = true) + { + double num = strength; + float num2 = (float)steps; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + if (speedX != 0f || speedY != 0f) + { + value2.X = speedX; + value2.Y = speedY; + } + while (num > 0.0 && num2 > 0f) + { + if (value.Y < 0f && num2 > 0f && type == 59) + { + num2 = 0f; + } + num = strength * (double)(num2 / (float)steps); + num2 -= 1f; + int num3 = (int)((double)value.X - num * 0.5); + int num4 = (int)((double)value.X + num * 0.5); + int num5 = (int)((double)value.Y - num * 0.5); + int num6 = (int)((double)value.Y + num * 0.5); + if (num3 < 1) + { + num3 = 1; + } + if (num4 > Main.maxTilesX - 1) + { + num4 = Main.maxTilesX - 1; + } + if (num5 < 1) + { + num5 = 1; + } + if (num6 > Main.maxTilesY - 1) + { + num6 = Main.maxTilesY - 1; + } + for (int k = num3; k < num4; k++) + { + for (int l = num5; l < num6; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < strength * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015)) + { + if (WorldGen.mudWall && (double)l > Main.worldSurface && Main.tile[k, l - 1].wall != 2 && l < Main.maxTilesY - 210 - WorldGen.genRand.Next(3)) + { + if (l > WorldGen.lavaLine - WorldGen.genRand.Next(0, 4) - 50) + { + if (Main.tile[k, l - 1].wall != 64 && Main.tile[k, l + 1].wall != 64 && Main.tile[k - 1, l].wall != 64 && Main.tile[k, l + 1].wall != 64) + { + WorldGen.PlaceWall(k, l, 15, true); + } + } + else + { + if (Main.tile[k, l - 1].wall != 15 && Main.tile[k, l + 1].wall != 15 && Main.tile[k - 1, l].wall != 15 && Main.tile[k, l + 1].wall != 15) + { + WorldGen.PlaceWall(k, l, 64, true); + } + } + } + if (type < 0) + { + if (type == -2 && Main.tile[k, l].active() && (l < WorldGen.waterLine || l > WorldGen.lavaLine)) + { + Main.tile[k, l].liquid = 255; + if (l > WorldGen.lavaLine) + { + Main.tile[k, l].lava(true); + } + } + Main.tile[k, l].active(false); + } + else + { + if ((overRide || !Main.tile[k, l].active()) && (type != 40 || Main.tile[k, l].type != 53) && (!Main.tileStone[type] || Main.tile[k, l].type == 1) && Main.tile[k, l].type != 189 && Main.tile[k, l].type != 196 && Main.tile[k, l].type != 45 && Main.tile[k, l].type != 147 && Main.tile[k, l].type != 190 && (Main.tile[k, l].type != 1 || type != 59 || (double)l >= Main.worldSurface + (double)WorldGen.genRand.Next(-50, 50))) + { + if (Main.tile[k, l].type != 53 || (double)l >= Main.worldSurface) + { + Main.tile[k, l].type = (byte)type; + } + else + { + if (type == 59) + { + Main.tile[k, l].type = (byte)type; + } + } + } + if (addTile) + { + Main.tile[k, l].active(true); + Main.tile[k, l].liquid = 0; + Main.tile[k, l].lava(false); + } + if (noYChange && (double)l < Main.worldSurface && type != 59) + { + Main.tile[k, l].wall = 2; + } + if (type == 59 && l > WorldGen.waterLine && Main.tile[k, l].liquid > 0) + { + Main.tile[k, l].lava(false); + Main.tile[k, l].liquid = 0; + } + } + } + } + } + value += value2; + if (num > 50.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 100.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 150.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 200.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 250.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 300.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 400.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 500.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 600.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 700.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 800.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (num > 900.0) + { + value += value2; + num2 -= 1f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + } + } + } + } + } + } + } + } + } + } + } + } + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + if (!noYChange) + { + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.Y > 1f) + { + value2.Y = 1f; + } + if (value2.Y < -1f) + { + value2.Y = -1f; + } + } + else + { + if (type != 59 && num < 3.0) + { + if (value2.Y > 1f) + { + value2.Y = 1f; + } + if (value2.Y < -1f) + { + value2.Y = -1f; + } + } + } + if (type == 59 && !noYChange) + { + if ((double)value2.Y > 0.5) + { + value2.Y = 0.5f; + } + if ((double)value2.Y < -0.5) + { + value2.Y = -0.5f; + } + if ((double)value.Y < Main.rockLayer + 100.0) + { + value2.Y = 1f; + } + if (value.Y > (float)(Main.maxTilesY - 300)) + { + value2.Y = -1f; + } + } + } + } + public static void DirtyRockRunner(int i, int j) + { + double num = (double)WorldGen.genRand.Next(2, 6); + float num2 = (float)WorldGen.genRand.Next(5, 50); + float num3 = num2; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + while (num > 0.0 && num3 > 0f) + { + double num4 = num * (double)(num3 / num2); + num3 -= 1f; + int num5 = (int)((double)value.X - num4 * 0.5); + int num6 = (int)((double)value.X + num4 * 0.5); + int num7 = (int)((double)value.Y - num4 * 0.5); + int num8 = (int)((double)value.Y + num4 * 0.5); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int k = num5; k < num6; k++) + { + for (int l = num7; l < num8; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < num * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[k, l].wall == 2) + { + Main.tile[k, l].wall = 59; + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.Y > 1f) + { + value2.Y = 1f; + } + if (value2.Y < -1f) + { + value2.Y = -1f; + } + } + } + public static void MudWallRunner(int i, int j) + { + double num = (double)WorldGen.genRand.Next(8, 21); + float num2 = (float)WorldGen.genRand.Next(8, 33); + float num3 = num2; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + while (num > 0.0 && num3 > 0f) + { + double num4 = num * (double)(num3 / num2); + num3 -= 1f; + int num5 = (int)((double)value.X - num4 * 0.5); + int num6 = (int)((double)value.X + num4 * 0.5); + int num7 = (int)((double)value.Y - num4 * 0.5); + int num8 = (int)((double)value.Y + num4 * 0.5); + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesX) + { + num6 = Main.maxTilesX; + } + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesY) + { + num8 = Main.maxTilesY; + } + for (int k = num5; k < num6; k++) + { + for (int l = num7; l < num8; l++) + { + if ((double)(Math.Abs((float)k - value.X) + Math.Abs((float)l - value.Y)) < num * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.015) && (double)l > Main.worldSurface) + { + Main.tile[k, l].wall = 0; + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.Y > 1f) + { + value2.Y = 1f; + } + if (value2.Y < -1f) + { + value2.Y = -1f; + } + } + } + public static void CloudIsland(int i, int j) + { + double num = (double)WorldGen.genRand.Next(100, 150); + float num2 = (float)WorldGen.genRand.Next(20, 30); + int num3 = i; + int num4 = i; + int num5 = i; + int num6 = j; + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (value2.X > -2f && value2.X < 2f) + { + value2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + value2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num7 = (int)((double)value.X - num * 0.5); + int num8 = (int)((double)value.X + num * 0.5); + int num9 = (int)((double)value.Y - num * 0.5); + int num10 = (int)((double)value.Y + num * 0.5); + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesX) + { + num8 = Main.maxTilesX; + } + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesY) + { + num10 = Main.maxTilesY; + } + double num11 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + float num12 = value.Y + 1f; + for (int k = num7; k < num8; k++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num12 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num12 < value.Y) + { + num12 = value.Y; + } + if (num12 > value.Y + 2f) + { + num12 = value.Y + 2f; + } + for (int l = num9; l < num10; l++) + { + if ((float)l > num12) + { + float num13 = Math.Abs((float)k - value.X); + float num14 = Math.Abs((float)l - value.Y) * 3f; + double num15 = Math.Sqrt((double)(num13 * num13 + num14 * num14)); + if (num15 < num11 * 0.4) + { + if (k < num3) + { + num3 = k; + } + if (k > num4) + { + num4 = k; + } + if (l < num5) + { + num5 = l; + } + if (l > num6) + { + num6 = l; + } + Main.tile[k, l].active(true); + Main.tile[k, l].type = 189; + WorldGen.SquareTileFrame(k, l, true); + } + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + if ((double)value2.Y > 0.2) + { + value2.Y = -0.2f; + } + if ((double)value2.Y < -0.2) + { + value2.Y = -0.2f; + } + } + int m = num3; + int num17; + for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num17, (int)((double)num17 * 1.5))) + { + int num16 = num6; + while (!Main.tile[m, num16].active()) + { + num16--; + } + num16 += WorldGen.genRand.Next(-3, 4); + num17 = WorldGen.genRand.Next(4, 8); + int num18 = 189; + if (WorldGen.genRand.Next(4) == 0) + { + num18 = 196; + } + for (int n = m - num17; n <= m + num17; n++) + { + for (int num19 = num16 - num17; num19 <= num16 + num17; num19++) + { + if (num19 > num5) + { + float num20 = (float)Math.Abs(n - m); + float num21 = (float)(Math.Abs(num19 - num16) * 2); + double num22 = Math.Sqrt((double)(num20 * num20 + num21 * num21)); + if (num22 < (double)(num17 + WorldGen.genRand.Next(2))) + { + Main.tile[n, num19].active(true); + Main.tile[n, num19].type = (byte)num18; + WorldGen.SquareTileFrame(n, num19, true); + } + } + } + } + } + num = (double)WorldGen.genRand.Next(80, 95); + num2 = (float)WorldGen.genRand.Next(10, 15); + value.X = (float)i; + value.Y = (float)num5; + value2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (value2.X > -2f && value2.X < 2f) + { + value2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + value2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num7 = (int)((double)value.X - num * 0.5); + int num8 = (int)((double)value.X + num * 0.5); + int num9 = num5 - 1; + int num10 = (int)((double)value.Y + num * 0.5); + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesX) + { + num8 = Main.maxTilesX; + } + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesY) + { + num10 = Main.maxTilesY; + } + double num11 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + float num23 = value.Y + 1f; + for (int num24 = num7; num24 < num8; num24++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num23 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num23 < value.Y) + { + num23 = value.Y; + } + if (num23 > value.Y + 2f) + { + num23 = value.Y + 2f; + } + for (int num25 = num9; num25 < num10; num25++) + { + if ((float)num25 > num23) + { + float num26 = Math.Abs((float)num24 - value.X); + float num27 = Math.Abs((float)num25 - value.Y) * 3f; + double num28 = Math.Sqrt((double)(num26 * num26 + num27 * num27)); + if (num28 < num11 * 0.4 && Main.tile[num24, num25].type == 189) + { + Main.tile[num24, num25].type = 0; + WorldGen.SquareTileFrame(num24, num25, true); + } + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + if ((double)value2.Y > 0.2) + { + value2.Y = -0.2f; + } + if ((double)value2.Y < -0.2) + { + value2.Y = -0.2f; + } + } + int num29 = num3; + num29 += WorldGen.genRand.Next(5); + while (num29 < num4) + { + int num30 = num6; + while ((!Main.tile[num29, num30].active() || Main.tile[num29, num30].type != 0) && num29 < num4) + { + num30--; + if (num30 < num5) + { + num30 = num6; + num29 += WorldGen.genRand.Next(1, 4); + } + } + if (num29 < num4) + { + num30 += WorldGen.genRand.Next(0, 4); + int num31 = WorldGen.genRand.Next(2, 5); + int num32 = 189; + for (int num33 = num29 - num31; num33 <= num29 + num31; num33++) + { + for (int num34 = num30 - num31; num34 <= num30 + num31; num34++) + { + if (num34 > num5) + { + float num35 = (float)Math.Abs(num33 - num29); + float num36 = (float)(Math.Abs(num34 - num30) * 2); + double num37 = Math.Sqrt((double)(num35 * num35 + num36 * num36)); + if (num37 < (double)num31) + { + Main.tile[num33, num34].type = (byte)num32; + WorldGen.SquareTileFrame(num33, num34, true); + } + } + } + } + num29 += WorldGen.genRand.Next(num31, (int)((double)num31 * 1.5)); + } + } + for (int num38 = num3 - 20; num38 <= num4 + 20; num38++) + { + for (int num39 = num5 - 20; num39 <= num6 + 20; num39++) + { + bool flag = true; + for (int num40 = num38 - 1; num40 <= num38 + 1; num40++) + { + for (int num41 = num39 - 1; num41 <= num39 + 1; num41++) + { + if (!Main.tile[num40, num41].active()) + { + flag = false; + } + } + } + if (flag) + { + Main.tile[num38, num39].wall = 73; + WorldGen.SquareWallFrame(num38, num39, true); + } + } + } + for (int num42 = num3; num42 <= num4; num42++) + { + int num43 = num5 - 10; + while (!Main.tile[num42, num43 + 1].active()) + { + num43++; + } + if (num43 < num6 && Main.tile[num42, num43 + 1].type == 189) + { + if (WorldGen.genRand.Next(10) == 0) + { + int num44 = WorldGen.genRand.Next(1, 3); + for (int num45 = num42 - num44; num45 <= num42 + num44; num45++) + { + if (Main.tile[num45, num43].type == 189) + { + Main.tile[num45, num43].active(false); + Main.tile[num45, num43].liquid = 255; + Main.tile[num45, num43].lava(false); + WorldGen.SquareTileFrame(num42, num43, true); + } + if (Main.tile[num45, num43 + 1].type == 189) + { + Main.tile[num45, num43 + 1].active(false); + Main.tile[num45, num43 + 1].liquid = 255; + Main.tile[num45, num43 + 1].lava(false); + WorldGen.SquareTileFrame(num42, num43 + 1, true); + } + if (num45 > num42 - num44 && num45 < num42 + 2 && Main.tile[num45, num43 + 2].type == 189) + { + Main.tile[num45, num43 + 2].active(false); + Main.tile[num45, num43 + 2].liquid = 255; + Main.tile[num45, num43 + 2].lava(false); + WorldGen.SquareTileFrame(num42, num43 + 2, true); + } + } + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.tile[num42, num43].liquid = 255; + } + Main.tile[num42, num43].lava(false); + WorldGen.SquareTileFrame(num42, num43, true); + } + } + int num46 = WorldGen.genRand.Next(4); + for (int num47 = 0; num47 <= num46; num47++) + { + int num48 = WorldGen.genRand.Next(num3 - 5, num4 + 5); + int num49 = num5 - WorldGen.genRand.Next(20, 40); + int num50 = WorldGen.genRand.Next(4, 8); + int num51 = 189; + if (WorldGen.genRand.Next(2) == 0) + { + num51 = 196; + } + for (int num52 = num48 - num50; num52 <= num48 + num50; num52++) + { + for (int num53 = num49 - num50; num53 <= num49 + num50; num53++) + { + float num54 = (float)Math.Abs(num52 - num48); + float num55 = (float)(Math.Abs(num53 - num49) * 2); + double num56 = Math.Sqrt((double)(num54 * num54 + num55 * num55)); + if (num56 < (double)(num50 + WorldGen.genRand.Next(-1, 2))) + { + Main.tile[num52, num53].active(true); + Main.tile[num52, num53].type = (byte)num51; + WorldGen.SquareTileFrame(num52, num53, true); + } + } + } + for (int num57 = num48 - num50 + 2; num57 <= num48 + num50 - 2; num57++) + { + int num58 = num49 - num50; + while (!Main.tile[num57, num58].active()) + { + num58++; + } + Main.tile[num57, num58].active(false); + Main.tile[num57, num58].liquid = 255; + WorldGen.SquareTileFrame(num57, num58, true); + } + } + } + public static void FloatingIsland(int i, int j) + { + double num = (double)WorldGen.genRand.Next(80, 120); + float num2 = (float)WorldGen.genRand.Next(20, 25); + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (value2.X > -2f && value2.X < 2f) + { + value2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + value2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num3 = (int)((double)value.X - num * 0.5); + int num4 = (int)((double)value.X + num * 0.5); + int num5 = (int)((double)value.Y - num * 0.5); + int num6 = (int)((double)value.Y + num * 0.5); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + double num7 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + float num8 = value.Y + 1f; + for (int k = num3; k < num4; k++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num8 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num8 < value.Y) + { + num8 = value.Y; + } + if (num8 > value.Y + 2f) + { + num8 = value.Y + 2f; + } + for (int l = num5; l < num6; l++) + { + if ((float)l > num8) + { + float num9 = Math.Abs((float)k - value.X); + float num10 = Math.Abs((float)l - value.Y) * 2f; + double num11 = Math.Sqrt((double)(num9 * num9 + num10 * num10)); + if (num11 < num7 * 0.4) + { + Main.tile[k, l].active(true); + if (Main.tile[k, l].type == 59) + { + Main.tile[k, l].type = 0; + } + } + } + } + } + num3 = (int)((double)value.X - num * 0.4); + num4 = (int)((double)value.X + num * 0.4); + num5 = (int)((double)value.Y - num * 0.4); + num6 = (int)((double)value.Y + num * 0.4); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + num7 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + for (int m = num3; m < num4; m++) + { + for (int n = num5; n < num6; n++) + { + if ((float)n > value.Y + 2f) + { + float num12 = Math.Abs((float)m - value.X); + float num13 = Math.Abs((float)n - value.Y) * 2f; + double num14 = Math.Sqrt((double)(num12 * num12 + num13 * num13)); + if (num14 < num7 * 0.4) + { + Main.tile[m, n].wall = 2; + } + } + } + } + value += value2; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > 1f) + { + value2.X = 1f; + } + if (value2.X < -1f) + { + value2.X = -1f; + } + if ((double)value2.Y > 0.2) + { + value2.Y = -0.2f; + } + if ((double)value2.Y < -0.2) + { + value2.Y = -0.2f; + } + } + } + public static void Caverer(int X, int Y) + { + int num = WorldGen.genRand.Next(2); + if (num == 0) + { + int num2 = WorldGen.genRand.Next(7, 9); + float num3 = (float)WorldGen.genRand.Next(100) * 0.01f; + float num4 = 1f - num3; + if (WorldGen.genRand.Next(2) == 0) + { + num3 = -num3; + } + if (WorldGen.genRand.Next(2) == 0) + { + num4 = -num4; + } + Vector2 vector = new Vector2((float)X, (float)Y); + for (int i = 0; i < num2; i++) + { + vector = WorldGen.digTunnel(vector.X, vector.Y, num3, num4, WorldGen.genRand.Next(6, 20), WorldGen.genRand.Next(4, 9), false); + num3 += (float)WorldGen.genRand.Next(-20, 21) * 0.1f; + num4 += (float)WorldGen.genRand.Next(-20, 21) * 0.1f; + if ((double)num3 < -1.5) + { + num3 = -1.5f; + } + if ((double)num3 > 1.5) + { + num3 = 1.5f; + } + if ((double)num4 < -1.5) + { + num4 = -1.5f; + } + if ((double)num4 > 1.5) + { + num4 = 1.5f; + } + float num5 = (float)WorldGen.genRand.Next(100) * 0.01f; + float num6 = 1f - num5; + if (WorldGen.genRand.Next(2) == 0) + { + num5 = -num5; + } + if (WorldGen.genRand.Next(2) == 0) + { + num6 = -num6; + } + Vector2 vector2 = WorldGen.digTunnel(vector.X, vector.Y, num5, num6, WorldGen.genRand.Next(30, 50), WorldGen.genRand.Next(3, 6), false); + WorldGen.TileRunner((int)vector2.X, (int)vector2.Y, (double)WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(5, 10), -1, false, 0f, 0f, false, true); + } + return; + } + if (num == 1) + { + int num7 = WorldGen.genRand.Next(15, 30); + float num8 = (float)WorldGen.genRand.Next(100) * 0.01f; + float num9 = 1f - num8; + if (WorldGen.genRand.Next(2) == 0) + { + num8 = -num8; + } + if (WorldGen.genRand.Next(2) == 0) + { + num9 = -num9; + } + Vector2 vector3 = new Vector2((float)X, (float)Y); + for (int j = 0; j < num7; j++) + { + vector3 = WorldGen.digTunnel(vector3.X, vector3.Y, num8, num9, WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(2, 6), true); + num8 += (float)WorldGen.genRand.Next(-20, 21) * 0.1f; + num9 += (float)WorldGen.genRand.Next(-20, 21) * 0.1f; + if ((double)num8 < -1.5) + { + num8 = -1.5f; + } + if ((double)num8 > 1.5) + { + num8 = 1.5f; + } + if ((double)num9 < -1.5) + { + num9 = -1.5f; + } + if ((double)num9 > 1.5) + { + num9 = 1.5f; + } + } + } + } + public static Vector2 digTunnel(float X, float Y, float xDir, float yDir, int Steps, int Size, bool Wet = false) + { + float num = X; + float num2 = Y; + try + { + float num3 = 0f; + float num4 = 0f; + float num5 = (float)Size; + for (int i = 0; i < Steps; i++) + { + int num6 = (int)(num - num5); + while ((float)num6 <= num + num5) + { + int num7 = (int)(num2 - num5); + while ((float)num7 <= num2 + num5) + { + if ((double)(Math.Abs((float)num6 - num) + Math.Abs((float)num7 - num2)) < (double)num5 * (1.0 + (double)WorldGen.genRand.Next(-10, 11) * 0.005)) + { + Main.tile[num6, num7].active(false); + if (Wet) + { + Main.tile[num6, num7].liquid = 255; + } + } + num7++; + } + num6++; + } + num5 += (float)WorldGen.genRand.Next(-50, 51) * 0.03f; + if ((double)num5 < (double)Size * 0.6) + { + num5 = (float)Size * 0.6f; + } + if (num5 > (float)(Size * 2)) + { + num5 = (float)Size * 2f; + } + num3 += (float)WorldGen.genRand.Next(-20, 21) * 0.01f; + num4 += (float)WorldGen.genRand.Next(-20, 21) * 0.01f; + if (num3 < -1f) + { + num3 = -1f; + } + if (num3 > 1f) + { + num3 = 1f; + } + if (num4 < -1f) + { + num4 = -1f; + } + if (num4 > 1f) + { + num4 = 1f; + } + num += (xDir + num3) * 0.6f; + num2 += (yDir + num4) * 0.6f; + } + } + catch + { + } + return new Vector2(num, num2); + } + public static void IslandHouse(int i, int j) + { + byte type = 202; + byte wall = 82; + Vector2 vector = new Vector2((float)i, (float)j); + int num = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num = -1; + } + int num2 = WorldGen.genRand.Next(7, 12); + int num3 = WorldGen.genRand.Next(5, 7); + vector.X = (float)(i + (num2 + 2) * num); + for (int k = j - 15; k < j + 30; k++) + { + if (Main.tile[(int)vector.X, k].active()) + { + vector.Y = (float)(k - 1); + break; + } + } + vector.X = (float)i; + int num4 = (int)(vector.X - (float)num2 - 1f); + int num5 = (int)(vector.X + (float)num2 + 1f); + int num6 = (int)(vector.Y - (float)num3 - 1f); + int num7 = (int)(vector.Y + 2f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int l = num4; l <= num5; l++) + { + for (int m = num6 - 1; m < num7 + 1; m++) + { + if (m != num6 - 1 || (l != num4 && l != num5)) + { + Main.tile[l, m].active(true); + Main.tile[l, m].liquid = 0; + Main.tile[l, m].type = type; + Main.tile[l, m].wall = 0; + Main.tile[l, m].halfBrick(false); + Main.tile[l, m].slope(0); + } + } + } + num4 = (int)(vector.X - (float)num2); + num5 = (int)(vector.X + (float)num2); + num6 = (int)(vector.Y - (float)num3); + num7 = (int)(vector.Y + 1f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int n = num4; n <= num5; n++) + { + for (int num8 = num6; num8 < num7; num8++) + { + if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == 0) + { + Main.tile[n, num8].active(false); + Main.tile[n, num8].wall = wall; + } + } + } + int num9 = i + (num2 + 1) * num; + int num10 = (int)vector.Y; + for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) + { + Main.tile[num11, num10].active(false); + Main.tile[num11, num10 - 1].active(false); + Main.tile[num11, num10 - 2].active(false); + } + WorldGen.PlaceTile(num9, num10, 10, true, false, -1, 9); + num9 = i + (num2 + 1) * -num - num; + for (int num12 = num6; num12 <= num7 + 1; num12++) + { + Main.tile[num9, num12].active(true); + Main.tile[num9, num12].liquid = 0; + Main.tile[num9, num12].type = type; + Main.tile[num9, num12].wall = 0; + Main.tile[num9, num12].halfBrick(false); + Main.tile[num9, num12].slope(0); + } + int contain = 0; + int num13 = WorldGen.houseCount; + if (num13 > 2) + { + num13 = WorldGen.genRand.Next(3); + } + if (num13 == 0) + { + contain = 159; + } + else + { + if (num13 == 1) + { + contain = 65; + } + else + { + if (num13 == 2) + { + contain = 158; + } + } + } + WorldGen.AddBuriedChest(i, num10 - 3, contain, false, 13); + WorldGen.houseCount++; + int num14 = i - num2 / 2 + 1; + int num15 = i + num2 / 2 - 1; + int num16 = 1; + if (num2 > 10) + { + num16 = 2; + } + int num17 = (num6 + num7) / 2 - 1; + for (int num18 = num14 - num16; num18 <= num14 + num16; num18++) + { + for (int num19 = num17 - 1; num19 <= num17 + 1; num19++) + { + Main.tile[num18, num19].wall = 21; + } + } + for (int num20 = num15 - num16; num20 <= num15 + num16; num20++) + { + for (int num21 = num17 - 1; num21 <= num17 + 1; num21++) + { + Main.tile[num20, num21].wall = 21; + } + } + int num22 = i + (num2 / 2 + 1) * -num; + WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, 7); + WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, 10); + Tile expr_51A = Main.tile[num22 - 2, num7 - 1]; + expr_51A.frameX += 18; + Tile expr_53B = Main.tile[num22 - 2, num7 - 2]; + expr_53B.frameX += 18; + WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, 10); + int i2 = num4 + 1; + int j2 = num6; + WorldGen.PlaceTile(i2, j2, 91, true, false, -1, WorldGen.genRand.Next(7, 10)); + i2 = num5 - 1; + j2 = num6; + WorldGen.PlaceTile(i2, j2, 91, true, false, -1, WorldGen.genRand.Next(7, 10)); + if (num > 0) + { + i2 = num4; + j2 = num6 + 1; + } + else + { + i2 = num5; + j2 = num6 + 1; + } + WorldGen.PlaceTile(i2, j2, 91, true, false, -1, WorldGen.genRand.Next(7, 10)); + } + public static void Mountinater(int i, int j) + { + double num = (double)WorldGen.genRand.Next(80, 120); + float num2 = (float)WorldGen.genRand.Next(40, 55); + Vector2 value; + value.X = (float)i; + value.Y = (float)j + num2 / 2f; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.1f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num3 = (int)((double)value.X - num * 0.5); + int num4 = (int)((double)value.X + num * 0.5); + int num5 = (int)((double)value.Y - num * 0.5); + int num6 = (int)((double)value.Y + num * 0.5); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + double num7 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + for (int k = num3; k < num4; k++) + { + for (int l = num5; l < num6; l++) + { + float num8 = Math.Abs((float)k - value.X); + float num9 = Math.Abs((float)l - value.Y); + double num10 = Math.Sqrt((double)(num8 * num8 + num9 * num9)); + if (num10 < num7 * 0.4 && !Main.tile[k, l].active()) + { + Main.tile[k, l].active(true); + Main.tile[k, l].type = 0; + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if ((double)value2.X > 0.5) + { + value2.X = 0.5f; + } + if ((double)value2.X < -0.5) + { + value2.X = -0.5f; + } + if ((double)value2.Y > -0.5) + { + value2.Y = -0.5f; + } + if ((double)value2.Y < -1.5) + { + value2.Y = -1.5f; + } + } + } + public static void MakeWateryIceThing(int i, int j) + { + if (Main.tile[i, j].liquid > 0 && !Main.tile[i, j].active() && !Main.tile[i, j].lava()) + { + int num = j; + while (!Main.tile[i, num].active() && Main.tile[i, num].liquid > 0) + { + num++; + if (num > Main.maxTilesY - 50) + { + return; + } + } + if (Main.tile[i, num].type == 147 || Main.tile[i, num].type == 161) + { + num--; + while (Main.tile[i, num].liquid > 0) + { + num--; + if (num < 10) + { + return; + } + } + if (Main.tile[i, num].active()) + { + return; + } + num++; + if (Main.tile[i, num].active()) + { + return; + } + int num2 = i; + while (!Main.tile[num2, num].active() && Main.tile[num2, num].liquid > 0 && Main.tile[num2, num - 1].liquid == 0 && !Main.tile[num2, num - 1].active() && !Main.tile[num2 - 1, num].halfBrick()) + { + WorldGen.PlaceTile(num2, num, 162, true, false, -1, 0); + num2--; + } + num2 = i + 1; + while (!Main.tile[num2, num].active() && Main.tile[num2, num].liquid > 0 && Main.tile[num2, num - 1].liquid == 0 && !Main.tile[num2, num - 1].active() && !Main.tile[num2 + 1, num].halfBrick()) + { + WorldGen.PlaceTile(num2, num, 162, true, false, -1, 0); + num2++; + } + } + } + } + public static void Lakinater(int i, int j) + { + double num = (double)WorldGen.genRand.Next(25, 50); + double num2 = num; + float num3 = (float)WorldGen.genRand.Next(30, 80); + if (WorldGen.genRand.Next(5) == 0) + { + num *= 1.5; + num2 *= 1.5; + num3 *= 1.2f; + } + Vector2 value; + value.X = (float)i; + value.Y = (float)j - num3 * 0.3f; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.1f; + while (num > 0.0 && num3 > 0f) + { + if ((double)value.Y + num2 * 0.5 > Main.worldSurface) + { + num3 = 0f; + } + num -= (double)WorldGen.genRand.Next(3); + num3 -= 1f; + int num4 = (int)((double)value.X - num * 0.5); + int num5 = (int)((double)value.X + num * 0.5); + int num6 = (int)((double)value.Y - num * 0.5); + int num7 = (int)((double)value.Y + num * 0.5); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + num2 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + for (int k = num4; k < num5; k++) + { + for (int l = num6; l < num7; l++) + { + float num8 = Math.Abs((float)k - value.X); + float num9 = Math.Abs((float)l - value.Y); + double num10 = Math.Sqrt((double)(num8 * num8 + num9 * num9)); + if (num10 < num2 * 0.4) + { + if (Main.tile[k, l].active()) + { + Main.tile[k, l].liquid = 255; + } + Main.tile[k, l].active(false); + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if ((double)value2.X > 0.5) + { + value2.X = 0.5f; + } + if ((double)value2.X < -0.5) + { + value2.X = -0.5f; + } + if ((double)value2.Y > 1.5) + { + value2.Y = 1.5f; + } + if ((double)value2.Y < 0.5) + { + value2.Y = 0.5f; + } + } + } + public static void ShroomPatch(int i, int j) + { + double num = (double)WorldGen.genRand.Next(40, 70); + double num2 = num; + float num3 = (float)WorldGen.genRand.Next(20, 30); + if (WorldGen.genRand.Next(5) == 0) + { + num *= 1.5; + num2 *= 1.5; + num3 *= 1.2f; + } + Vector2 value; + value.X = (float)i; + value.Y = (float)j - num3 * 0.3f; + Vector2 value2; + value2.X = (float)WorldGen.genRand.Next(-10, 11) * 0.1f; + value2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.1f; + while (num > 0.0 && num3 > 0f) + { + num -= (double)WorldGen.genRand.Next(3); + num3 -= 1f; + int num4 = (int)((double)value.X - num * 0.5); + int num5 = (int)((double)value.X + num * 0.5); + int num6 = (int)((double)value.Y - num * 0.5); + int num7 = (int)((double)value.Y + num * 0.5); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + num2 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + for (int k = num4; k < num5; k++) + { + for (int l = num6; l < num7; l++) + { + float num8 = Math.Abs((float)k - value.X); + float num9 = Math.Abs(((float)l - value.Y) * 2.3f); + double num10 = Math.Sqrt((double)(num8 * num8 + num9 * num9)); + if (num10 < num2 * 0.4) + { + if ((double)l < (double)value.Y + num2 * 0.02) + { + if (Main.tile[k, l].type != 59) + { + Main.tile[k, l].active(false); + } + } + else + { + Main.tile[k, l].type = 59; + } + Main.tile[k, l].liquid = 0; + Main.tile[k, l].lava(false); + } + } + } + value += value2; + value.X += value2.X; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.Y -= (float)WorldGen.genRand.Next(11) * 0.05f; + if ((double)value2.X > -0.5 && (double)value2.X < 0.5) + { + if (value2.X < 0f) + { + value2.X = -0.5f; + } + else + { + value2.X = 0.5f; + } + } + if (value2.X > 2f) + { + value2.X = 1f; + } + if (value2.X < -2f) + { + value2.X = -1f; + } + if (value2.Y > 1f) + { + value2.Y = 1f; + } + if (value2.Y < -1f) + { + value2.Y = -1f; + } + for (int m = 0; m < 2; m++) + { + int num11 = (int)value.X + WorldGen.genRand.Next(-20, 20); + int num12 = (int)value.Y + WorldGen.genRand.Next(0, 20); + while (!Main.tile[num11, num12].active() && Main.tile[num11, num12].type != 59) + { + num11 = (int)value.X + WorldGen.genRand.Next(-20, 20); + num12 = (int)value.Y + WorldGen.genRand.Next(0, 20); + } + int num13 = WorldGen.genRand.Next(7, 10); + int num14 = WorldGen.genRand.Next(7, 10); + WorldGen.TileRunner(num11, num12, (double)num13, num14, 59, false, 0f, 2f, true, true); + if (WorldGen.genRand.Next(3) == 0) + { + WorldGen.TileRunner(num11, num12, (double)(num13 - 3), num14 - 3, -1, false, 0f, 2f, true, true); + } + } + } + } + public static void Cavinator(int i, int j, int steps) + { + double num = (double)WorldGen.genRand.Next(7, 15); + int num2 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num2 = -1; + } + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + int k = WorldGen.genRand.Next(20, 40); + Vector2 value2; + value2.Y = (float)WorldGen.genRand.Next(10, 20) * 0.01f; + value2.X = (float)num2; + while (k > 0) + { + k--; + int num3 = (int)((double)value.X - num * 0.5); + int num4 = (int)((double)value.X + num * 0.5); + int num5 = (int)((double)value.Y - num * 0.5); + int num6 = (int)((double)value.Y + num * 0.5); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + double num7 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + for (int l = num3; l < num4; l++) + { + for (int m = num5; m < num6; m++) + { + float num8 = Math.Abs((float)l - value.X); + float num9 = Math.Abs((float)m - value.Y); + double num10 = Math.Sqrt((double)(num8 * num8 + num9 * num9)); + if (num10 < num7 * 0.4) + { + Main.tile[l, m].active(false); + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > (float)num2 + 0.5f) + { + value2.X = (float)num2 + 0.5f; + } + if (value2.X < (float)num2 - 0.5f) + { + value2.X = (float)num2 - 0.5f; + } + if (value2.Y > 2f) + { + value2.Y = 2f; + } + if (value2.Y < 0f) + { + value2.Y = 0f; + } + } + if (steps > 0 && (double)((int)value.Y) < Main.rockLayer + 50.0) + { + WorldGen.Cavinator((int)value.X, (int)value.Y, steps - 1); + } + } + public static void CaveOpenater(int i, int j) + { + double num = (double)WorldGen.genRand.Next(7, 12); + int num2 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num2 = -1; + } + Vector2 value; + value.X = (float)i; + value.Y = (float)j; + int k = 100; + Vector2 value2; + value2.Y = 0f; + value2.X = (float)num2; + while (k > 0) + { + if (Main.tile[(int)value.X, (int)value.Y].wall == 0) + { + k = 0; + } + k--; + int num3 = (int)((double)value.X - num * 0.5); + int num4 = (int)((double)value.X + num * 0.5); + int num5 = (int)((double)value.Y - num * 0.5); + int num6 = (int)((double)value.Y + num * 0.5); + if (num3 < 0) + { + num3 = 0; + } + if (num4 > Main.maxTilesX) + { + num4 = Main.maxTilesX; + } + if (num5 < 0) + { + num5 = 0; + } + if (num6 > Main.maxTilesY) + { + num6 = Main.maxTilesY; + } + double num7 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + for (int l = num3; l < num4; l++) + { + for (int m = num5; m < num6; m++) + { + float num8 = Math.Abs((float)l - value.X); + float num9 = Math.Abs((float)m - value.Y); + double num10 = Math.Sqrt((double)(num8 * num8 + num9 * num9)); + if (num10 < num7 * 0.4) + { + Main.tile[l, m].active(false); + } + } + } + value += value2; + value2.X += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + value2.Y += (float)WorldGen.genRand.Next(-10, 11) * 0.05f; + if (value2.X > (float)num2 + 0.5f) + { + value2.X = (float)num2 + 0.5f; + } + if (value2.X < (float)num2 - 0.5f) + { + value2.X = (float)num2 - 0.5f; + } + if (value2.Y > 0f) + { + value2.Y = 0f; + } + if ((double)value2.Y < -0.5) + { + value2.Y = -0.5f; + } + } + } + public static void DiamondTileFrame(int i, int j) + { + WorldGen.TileFrame(i - 1, j, false, false); + WorldGen.TileFrame(i, j - 1, false, false); + WorldGen.TileFrame(i, j + 1, false, false); + WorldGen.TileFrame(i + 1, j, false, false); + } + public static void SquareTileFrame(int i, int j, bool resetFrame = true) + { + WorldGen.TileFrame(i - 1, j - 1, false, false); + WorldGen.TileFrame(i - 1, j, false, false); + WorldGen.TileFrame(i - 1, j + 1, false, false); + WorldGen.TileFrame(i, j - 1, false, false); + WorldGen.TileFrame(i, j, resetFrame, false); + WorldGen.TileFrame(i, j + 1, false, false); + WorldGen.TileFrame(i + 1, j - 1, false, false); + WorldGen.TileFrame(i + 1, j, false, false); + WorldGen.TileFrame(i + 1, j + 1, false, false); + } + public static void SquareWallFrame(int i, int j, bool resetFrame = true) + { + WorldGen.WallFrame(i - 1, j - 1, false); + WorldGen.WallFrame(i - 1, j, false); + WorldGen.WallFrame(i - 1, j + 1, false); + WorldGen.WallFrame(i, j - 1, false); + WorldGen.WallFrame(i, j, resetFrame); + WorldGen.WallFrame(i, j + 1, false); + WorldGen.WallFrame(i + 1, j - 1, false); + WorldGen.WallFrame(i + 1, j, false); + WorldGen.WallFrame(i + 1, j + 1, false); + } + public static void SectionTileFrame(int startX, int startY, int endX, int endY) + { + Main.mapTime = Main.mapTimeMax + 10; + WorldGen.noMapUpdate = true; + int num = startX * 200; + int num2 = (endX + 1) * 200; + int num3 = startY * 150; + int num4 = (endY + 1) * 150; + if (num < 1) + { + num = 1; + } + if (num3 < 1) + { + num3 = 1; + } + if (num > Main.maxTilesX - 2) + { + num = Main.maxTilesX - 2; + } + if (num3 > Main.maxTilesY - 2) + { + num3 = Main.maxTilesY - 2; + } + for (int i = num - 1; i < num2 + 1; i++) + { + for (int j = num3 - 1; j < num4 + 1; j++) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + WorldGen.TileFrame(i, j, true, true); + WorldGen.WallFrame(i, j, true); + } + } + WorldGen.noMapUpdate = false; + } + public static void RangeFrame(int startX, int startY, int endX, int endY) + { + int num = endX + 1; + int num2 = endY + 1; + for (int i = startX - 1; i < num + 1; i++) + { + for (int j = startY - 1; j < num2 + 1; j++) + { + WorldGen.TileFrame(i, j, false, false); + WorldGen.WallFrame(i, j, false); + } + } + } + public static void WaterCheck() + { + Liquid.numLiquid = 0; + LiquidBuffer.numLiquidBuffer = 0; + for (int i = 1; i < Main.maxTilesX - 1; i++) + { + for (int j = Main.maxTilesY - 2; j > 0; j--) + { + Main.tile[i, j].checkingLiquid(false); + if (Main.tile[i, j].liquid > 0 && Main.tile[i, j].active() && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type]) + { + Main.tile[i, j].liquid = 0; + } + else + { + if (Main.tile[i, j].liquid > 0) + { + if (Main.tile[i, j].active()) + { + if (Main.tileWaterDeath[(int)Main.tile[i, j].type] && (Main.tile[i, j].type != 4 || (Main.tile[i, j].frameY != 176 && Main.tile[i, j].frameY != 242))) + { + WorldGen.KillTile(i, j, false, false, false); + } + if (Main.tile[i, j].lava() && Main.tileLavaDeath[(int)Main.tile[i, j].type] && (Main.tile[i, j].type != 19 || Main.tile[i, j].frameY != 234) && (Main.tile[i, j].type != 11 || Main.tile[i, j].frameY < 1026 || Main.tile[i, j].frameY > 1078) && (Main.tile[i, j].type != 15 || Main.tile[i, j].frameY < 640 || Main.tile[i, j].frameY > 678) && (Main.tile[i, j].type != 14 || Main.tile[i, j].frameX < 702 || Main.tile[i, j].frameX > 754) && (Main.tile[i, j].type != 18 || Main.tile[i, j].frameX < 504 || Main.tile[i, j].frameX > 538) && (Main.tile[i, j].type != 105 || Main.tile[i, j].frameX < 1764 || Main.tile[i, j].frameX > 1798) && (Main.tile[i, j].type != 101 || Main.tile[i, j].frameX < 216 || Main.tile[i, j].frameX > 268)) + { + WorldGen.KillTile(i, j, false, false, false); + } + } + if ((!Main.tile[i, j + 1].nactive() || !Main.tileSolid[(int)Main.tile[i, j + 1].type] || Main.tileSolidTop[(int)Main.tile[i, j + 1].type]) && Main.tile[i, j + 1].liquid < 255) + { + if (Main.tile[i, j + 1].liquid > 250) + { + Main.tile[i, j + 1].liquid = 255; + } + else + { + Liquid.AddWater(i, j); + } + } + if ((!Main.tile[i - 1, j].nactive() || !Main.tileSolid[(int)Main.tile[i - 1, j].type] || Main.tileSolidTop[(int)Main.tile[i - 1, j].type]) && Main.tile[i - 1, j].liquid != Main.tile[i, j].liquid) + { + Liquid.AddWater(i, j); + } + else + { + if ((!Main.tile[i + 1, j].nactive() || !Main.tileSolid[(int)Main.tile[i + 1, j].type] || Main.tileSolidTop[(int)Main.tile[i + 1, j].type]) && Main.tile[i + 1, j].liquid != Main.tile[i, j].liquid) + { + Liquid.AddWater(i, j); + } + } + if (Main.tile[i, j].lava()) + { + if (Main.tile[i - 1, j].liquid > 0 && !Main.tile[i - 1, j].lava()) + { + Liquid.AddWater(i, j); + } + else + { + if (Main.tile[i + 1, j].liquid > 0 && !Main.tile[i + 1, j].lava()) + { + Liquid.AddWater(i, j); + } + else + { + if (Main.tile[i, j - 1].liquid > 0 && !Main.tile[i, j - 1].lava()) + { + Liquid.AddWater(i, j); + } + else + { + if (Main.tile[i, j + 1].liquid > 0 && !Main.tile[i, j + 1].lava()) + { + Liquid.AddWater(i, j); + } + } + } + } + } + } + } + } + } + } + public static void EveryTileFrame() + { + WorldGen.noLiquidCheck = true; + WorldGen.noTileActions = true; + for (int i = 0; i < Main.maxTilesX; i++) + { + float num = (float)i / (float)Main.maxTilesX; + Main.statusText = string.Concat(new object[] + { + Lang.gen[55], + " ", + (int)(num * 100f + 1f), + "%" + }); + for (int j = 0; j < Main.maxTilesY; j++) + { + if (Main.tile[i, j].active()) + { + WorldGen.TileFrame(i, j, true, false); + } + if (Main.tile[i, j].wall > 0) + { + WorldGen.WallFrame(i, j, true); + } + } + } + WorldGen.noLiquidCheck = false; + WorldGen.noTileActions = false; + } + public static void PlantCheck(int i, int j) + { + int num = -1; + int num2 = (int)Main.tile[i, j].type; + int arg_19_0 = i - 1; + int arg_23_0 = i + 1; + int arg_22_0 = Main.maxTilesX; + int arg_29_0 = j - 1; + if (j + 1 >= Main.maxTilesY) + { + num = num2; + } + if (i - 1 >= 0 && Main.tile[i - 1, j] != null && Main.tile[i - 1, j].nactive()) + { + byte arg_74_0 = Main.tile[i - 1, j].type; + } + if (i + 1 < Main.maxTilesX && Main.tile[i + 1, j] != null && Main.tile[i + 1, j].nactive()) + { + byte arg_B7_0 = Main.tile[i + 1, j].type; + } + if (j - 1 >= 0 && Main.tile[i, j - 1] != null && Main.tile[i, j - 1].nactive()) + { + byte arg_F6_0 = Main.tile[i, j - 1].type; + } + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1] != null && Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0) + { + num = (int)Main.tile[i, j + 1].type; + } + if (i - 1 >= 0 && j - 1 >= 0 && Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].nactive()) + { + byte arg_1AE_0 = Main.tile[i - 1, j - 1].type; + } + if (i + 1 < Main.maxTilesX && j - 1 >= 0 && Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].nactive()) + { + byte arg_1FD_0 = Main.tile[i + 1, j - 1].type; + } + if (i - 1 >= 0 && j + 1 < Main.maxTilesY && Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].nactive()) + { + byte arg_24C_0 = Main.tile[i - 1, j + 1].type; + } + if (i + 1 < Main.maxTilesX && j + 1 < Main.maxTilesY && Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].nactive()) + { + byte arg_29F_0 = Main.tile[i + 1, j + 1].type; + } + if ((num2 == 3 && num != 2 && num != 78) || (num2 == 24 && num != 23) || (num2 == 61 && num != 60) || (num2 == 71 && num != 70) || (num2 == 73 && num != 2 && num != 78) || (num2 == 74 && num != 60) || (num2 == 110 && num != 109) || (num2 == 113 && num != 109) || (num2 == 201 && num != 199)) + { + if ((num2 == 3 || num2 == 73) && num != 2 && Main.tile[i, j].frameX >= 162) + { + Main.tile[i, j].frameX = 126; + } + if (num2 == 74 && num != 60 && Main.tile[i, j].frameX >= 162) + { + Main.tile[i, j].frameX = 126; + } + if (num == 23) + { + num2 = 24; + if (Main.tile[i, j].frameX >= 162) + { + Main.tile[i, j].frameX = 126; + } + } + else + { + if (num == 2) + { + if (num2 == 113) + { + num2 = 73; + } + else + { + num2 = 3; + } + } + else + { + if (num == 109) + { + if (num2 == 73) + { + num2 = 113; + } + else + { + num2 = 110; + } + } + else + { + if (num == 199) + { + num2 = 201; + } + else + { + if (num == 70) + { + num2 = 71; + while (Main.tile[i, j].frameX > 72) + { + Tile expr_3FE = Main.tile[i, j]; + expr_3FE.frameX -= 72; + } + } + } + } + } + } + if (num2 != (int)Main.tile[i, j].type) + { + Main.tile[i, j].type = (byte)num2; + return; + } + WorldGen.KillTile(i, j, false, false, false); + } + } + public static void WallFrame(int i, int j, bool resetFrame = false) + { + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY || Main.tile[i, j] == null) + { + return; + } + if (Main.netMode != 2 && Main.mapEnabled && !WorldGen.noMapUpdate && !WorldGen.gen && Main.map[i, j] != null && Main.map[i, j].light > 0) + { + Main.map[i, j].setTile(i, j, Main.map[i, j].light); + if (Main.map[i, j].changed()) + { + if (Map.numUpdateTile < Map.maxUpdateTile - 1) + { + Map.updateTileX[Map.numUpdateTile] = (short)i; + Map.updateTileY[Map.numUpdateTile] = (short)j; + Map.numUpdateTile++; + } + else + { + Main.mapUnfinished = true; + } + } + } + if (Main.tile[i, j].wall == 0) + { + Main.tile[i, j].wallColor(0); + return; + } + int num = -1; + int num2 = -1; + int num3 = -1; + int num4 = -1; + int num5 = -1; + int num6 = -1; + int num7 = -1; + int num8 = -1; + int wall = (int)Main.tile[i, j].wall; + if (wall == 0) + { + return; + } + Main.tile[i, j].wallFrameX(); + Main.tile[i, j].wallFrameY(); + Rectangle rectangle; + rectangle.X = -1; + rectangle.Y = -1; + if (i - 1 < 0) + { + num = wall; + num4 = wall; + num6 = wall; + } + if (i + 1 >= Main.maxTilesX) + { + num3 = wall; + num5 = wall; + num8 = wall; + } + if (j - 1 < 0) + { + num = wall; + num2 = wall; + num3 = wall; + } + if (j + 1 >= Main.maxTilesY) + { + num6 = wall; + num7 = wall; + num8 = wall; + } + if (i - 1 >= 0 && Main.tile[i - 1, j] != null) + { + num4 = (int)Main.tile[i - 1, j].wall; + } + if (i + 1 < Main.maxTilesX && Main.tile[i + 1, j] != null) + { + num5 = (int)Main.tile[i + 1, j].wall; + } + if (j - 1 >= 0 && Main.tile[i, j - 1] != null) + { + num2 = (int)Main.tile[i, j - 1].wall; + } + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1] != null) + { + num7 = (int)Main.tile[i, j + 1].wall; + } + if (i - 1 >= 0 && j - 1 >= 0 && Main.tile[i - 1, j - 1] != null) + { + num = (int)Main.tile[i - 1, j - 1].wall; + } + if (i + 1 < Main.maxTilesX && j - 1 >= 0 && Main.tile[i + 1, j - 1] != null) + { + num3 = (int)Main.tile[i + 1, j - 1].wall; + } + if (i - 1 >= 0 && j + 1 < Main.maxTilesY && Main.tile[i - 1, j + 1] != null) + { + num6 = (int)Main.tile[i - 1, j + 1].wall; + } + if (i + 1 < Main.maxTilesX && j + 1 < Main.maxTilesY && Main.tile[i + 1, j + 1] != null) + { + num8 = (int)Main.tile[i + 1, j + 1].wall; + } + if (num7 > 0) + { + num7 = wall; + } + if (num6 > 0) + { + } + if (num8 > 0) + { + } + if (num2 > 0) + { + num2 = wall; + } + if (num > 0) + { + } + if (num3 > 0) + { + } + if (num4 > 0) + { + num4 = wall; + } + if (num5 > 0) + { + num5 = wall; + } + int num9; + if (resetFrame) + { + num9 = WorldGen.genRand.Next(0, 3); + Main.tile[i, j].wallFrameNumber((byte)num9); + } + else + { + num9 = (int)Main.tile[i, j].wallFrameNumber(); + } + if (rectangle.X < 0 || rectangle.Y < 0) + { + if (num2 == wall && num7 == wall && (num4 == wall & num5 == wall)) + { + if (i % 3 == 1 && j % 3 == 1) + { + if (num9 == 0) + { + rectangle.X = 108; + rectangle.Y = 18; + } + if (num9 == 1) + { + rectangle.X = 126; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 144; + rectangle.Y = 18; + } + } + else + { + if (i % 3 == 0 && j % 3 == 0) + { + if (num9 == 0) + { + rectangle.X = 108; + rectangle.Y = 36; + } + if (num9 == 1) + { + rectangle.X = 126; + rectangle.Y = 36; + } + if (num9 == 2) + { + rectangle.X = 144; + rectangle.Y = 36; + } + } + else + { + if (i % 3 == 2 && j % 3 == 1) + { + if (num9 == 0) + { + rectangle.X = 180; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 180; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 180; + rectangle.Y = 36; + } + } + else + { + if (i % 3 == 1 && j % 3 == 2) + { + if (num9 == 0) + { + rectangle.X = 198; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 198; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 198; + rectangle.Y = 36; + } + } + else + { + if (num9 == 0) + { + rectangle.X = 18; + rectangle.Y = 18; + } + if (num9 == 1) + { + rectangle.X = 36; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 54; + rectangle.Y = 18; + } + } + } + } + } + } + else + { + if (num2 != wall && num7 == wall && (num4 == wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 18; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 36; + rectangle.Y = 0; + } + if (num9 == 2) + { + rectangle.X = 54; + rectangle.Y = 0; + } + } + else + { + if (num2 == wall && num7 != wall && (num4 == wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 18; + rectangle.Y = 36; + } + if (num9 == 1) + { + rectangle.X = 36; + rectangle.Y = 36; + } + if (num9 == 2) + { + rectangle.X = 54; + rectangle.Y = 36; + } + } + else + { + if (num2 == wall && num7 == wall && (num4 != wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 0; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 0; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 0; + rectangle.Y = 36; + } + } + else + { + if (num2 == wall && num7 == wall && (num4 == wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 72; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 72; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 72; + rectangle.Y = 36; + } + } + else + { + if (num2 != wall && num7 == wall && (num4 != wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 0; + rectangle.Y = 54; + } + if (num9 == 1) + { + rectangle.X = 36; + rectangle.Y = 54; + } + if (num9 == 2) + { + rectangle.X = 72; + rectangle.Y = 54; + } + } + else + { + if (num2 != wall && num7 == wall && (num4 == wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 18; + rectangle.Y = 54; + } + if (num9 == 1) + { + rectangle.X = 54; + rectangle.Y = 54; + } + if (num9 == 2) + { + rectangle.X = 90; + rectangle.Y = 54; + } + } + else + { + if (num2 == wall && num7 != wall && (num4 != wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 0; + rectangle.Y = 72; + } + if (num9 == 1) + { + rectangle.X = 36; + rectangle.Y = 72; + } + if (num9 == 2) + { + rectangle.X = 72; + rectangle.Y = 72; + } + } + else + { + if (num2 == wall && num7 != wall && (num4 == wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 18; + rectangle.Y = 72; + } + if (num9 == 1) + { + rectangle.X = 54; + rectangle.Y = 72; + } + if (num9 == 2) + { + rectangle.X = 90; + rectangle.Y = 72; + } + } + else + { + if (num2 == wall && num7 == wall && (num4 != wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 90; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 90; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 90; + rectangle.Y = 36; + } + } + else + { + if (num2 != wall && num7 != wall && (num4 == wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 108; + rectangle.Y = 72; + } + if (num9 == 1) + { + rectangle.X = 126; + rectangle.Y = 72; + } + if (num9 == 2) + { + rectangle.X = 144; + rectangle.Y = 72; + } + } + else + { + if (num2 != wall && num7 == wall && (num4 != wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 108; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 126; + rectangle.Y = 0; + } + if (num9 == 2) + { + rectangle.X = 144; + rectangle.Y = 0; + } + } + else + { + if (num2 == wall && num7 != wall && (num4 != wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 108; + rectangle.Y = 54; + } + if (num9 == 1) + { + rectangle.X = 126; + rectangle.Y = 54; + } + if (num9 == 2) + { + rectangle.X = 144; + rectangle.Y = 54; + } + } + else + { + if (num2 != wall && num7 != wall && (num4 != wall & num5 == wall)) + { + if (num9 == 0) + { + rectangle.X = 162; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 162; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 162; + rectangle.Y = 36; + } + } + else + { + if (num2 != wall && num7 != wall && (num4 == wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 216; + rectangle.Y = 0; + } + if (num9 == 1) + { + rectangle.X = 216; + rectangle.Y = 18; + } + if (num9 == 2) + { + rectangle.X = 216; + rectangle.Y = 36; + } + } + else + { + if (num2 != wall && num7 != wall && (num4 != wall & num5 != wall)) + { + if (num9 == 0) + { + rectangle.X = 162; + rectangle.Y = 54; + } + if (num9 == 1) + { + rectangle.X = 180; + rectangle.Y = 54; + } + if (num9 == 2) + { + rectangle.X = 198; + rectangle.Y = 54; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (rectangle.X <= -1 || rectangle.Y <= -1) + { + if (num9 <= 0) + { + rectangle.X = 18; + rectangle.Y = 18; + } + if (num9 == 1) + { + rectangle.X = 36; + rectangle.Y = 18; + } + if (num9 >= 2) + { + rectangle.X = 54; + rectangle.Y = 18; + } + } + Main.tile[i, j].wallFrameX((int)((byte)rectangle.X)); + Main.tile[i, j].wallFrameY((int)((byte)rectangle.Y)); + } + public static bool CheckPound(int i, int j) + { + if (Main.tile[i, j] == null) + { + Main.tile[i, j] = new Tile(); + } + if (Main.tile[i, j - 1] == null) + { + Main.tile[i, j - 1] = new Tile(); + } + if (Main.tile[i, j + 1] == null) + { + Main.tile[i, j + 1] = new Tile(); + } + if (Main.tile[i, j].type == 48) + { + return false; + } + if (Main.tile[i, j].type == 137) + { + return false; + } + if (Main.tile[i, j].type == 138) + { + return false; + } + if (Main.tile[i, j].type == 232) + { + return false; + } + if (WorldGen.gen) + { + if (Main.tile[i, j].type == 190) + { + return false; + } + if (Main.tile[i, j].type == 30) + { + return false; + } + } + return (!Main.tile[i, j - 1].active() || (Main.tile[i, j - 1].type != 5 && Main.tile[i, j - 1].type != 26 && Main.tile[i, j - 1].type != 21 && Main.tile[i, j - 1].type != 77 && Main.tile[i, j - 1].type != 237)) && Main.tile[i, j].type != 10; + } + public static bool SlopeTile(int i, int j, int slope = 0) + { + if (!WorldGen.CheckPound(i, j)) + { + return false; + } + Main.tile[i, j].halfBrick(false); + Main.tile[i, j].slope((byte)slope); + if (!WorldGen.gen) + { + WorldGen.KillTile(i, j, true, true, false); + Main.PlaySound(0, i * 16, j * 16, 1); + WorldGen.SquareTileFrame(i, j, true); + if (Main.tile[i, j].slope() == 0) + { + Rectangle rectangle = new Rectangle(i * 16, j * 16, 16, 16); + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active && !Main.player[k].dead && rectangle.Intersects(new Rectangle((int)Main.player[k].position.X, (int)Main.player[k].position.Y, Main.player[k].width, Main.player[k].height))) + { + Main.player[k].gfxOffY += Main.player[k].position.Y + (float)Main.player[k].height - (float)rectangle.Y; + Main.player[k].position.Y = (float)(rectangle.Y - Main.player[k].height); + } + } + } + } + return true; + } + public static bool PoundTile(int i, int j) + { + if (!WorldGen.CheckPound(i, j)) + { + return false; + } + if (!Main.tile[i, j].halfBrick()) + { + Main.tile[i, j].halfBrick(true); + } + else + { + Main.tile[i, j].halfBrick(false); + } + if (!WorldGen.gen) + { + WorldGen.KillTile(i, j, true, true, false); + Main.PlaySound(0, i * 16, j * 16, 1); + WorldGen.SquareTileFrame(i, j, true); + if (!Main.tile[i, j].halfBrick()) + { + Rectangle rectangle = new Rectangle(i * 16, j * 16, 16, 16); + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active && !Main.player[k].dead && rectangle.Intersects(new Rectangle((int)Main.player[k].position.X, (int)Main.player[k].position.Y, Main.player[k].width, Main.player[k].height))) + { + Main.player[k].gfxOffY += Main.player[k].position.Y + (float)Main.player[k].height - (float)rectangle.Y; + Main.player[k].position.Y = (float)(rectangle.Y - Main.player[k].height); + } + } + } + } + return true; + } + public static void TileFrame(int i, int j, bool resetFrame = false, bool noBreak = false) + { + bool flag = false; + try + { + if (i > 5 && j > 5 && i < Main.maxTilesX - 5 && j < Main.maxTilesY - 5 && Main.tile[i, j] != null) + { + if (Main.netMode != 2 && Main.mapEnabled && !WorldGen.noMapUpdate && !WorldGen.gen && Main.map[i, j] != null && Main.map[i, j].light > 0) + { + Main.map[i, j].setTile(i, j, Main.map[i, j].light); + if (Main.map[i, j].changed()) + { + flag = true; + if (Map.numUpdateTile < Map.maxUpdateTile - 1) + { + Map.updateTileX[Map.numUpdateTile] = (short)i; + Map.updateTileY[Map.numUpdateTile] = (short)j; + Map.numUpdateTile++; + } + else + { + Main.mapUnfinished = true; + } + } + } + if (!Main.tile[i, j].active()) + { + Main.tile[i, j].halfBrick(false); + Main.tile[i, j].color(0); + Main.tile[i, j].slope(0); + } + if (Main.tile[i, j].liquid > 0 && Main.netMode != 1 && !WorldGen.noLiquidCheck) + { + Liquid.AddWater(i, j); + } + if (Main.tile[i, j].active()) + { + if (noBreak && Main.tileFrameImportant[(int)Main.tile[i, j].type] && Main.tile[i, j].type != 4) + { + return; + } + int num = (int)Main.tile[i, j].type; + if (Main.tileStone[num]) + { + num = 1; + } + int frameX = (int)Main.tile[i, j].frameX; + int frameY = (int)Main.tile[i, j].frameY; + Rectangle rectangle = new Rectangle(-1, -1, 0, 0); + if (Main.tileFrameImportant[(int)Main.tile[i, j].type]) + { + if (num == 4) + { + short num2 = 0; + if (Main.tile[i, j].frameX >= 66) + { + num2 = 66; + } + int num3 = -1; + int num4 = -1; + int num5 = -1; + int num6 = -1; + int num7 = -1; + int num8 = -1; + int num9 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].nactive()) + { + byte arg_294_0 = Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0) + { + num3 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].nactive()) + { + num4 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].nactive()) + { + num5 = (int)Main.tile[i + 1, j].type; + } + if (Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].nactive()) + { + num6 = (int)Main.tile[i - 1, j + 1].type; + } + if (Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].nactive()) + { + num7 = (int)Main.tile[i + 1, j + 1].type; + } + if (Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].nactive()) + { + num8 = (int)Main.tile[i - 1, j - 1].type; + } + if (Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].nactive()) + { + num9 = (int)Main.tile[i + 1, j - 1].type; + } + if (num3 >= 0 && Main.tileSolid[num3] && !Main.tileNoAttach[num3]) + { + Main.tile[i, j].frameX = num2; + } + else + { + if ((num4 >= 0 && Main.tileSolid[num4] && !Main.tileNoAttach[num4]) || num4 == 124 || (num4 == 5 && num8 == 5 && num6 == 5)) + { + Main.tile[i, j].frameX = (short)(22 + num2); + } + else + { + if ((num5 >= 0 && Main.tileSolid[num5] && !Main.tileNoAttach[num5]) || num5 == 124 || (num5 == 5 && num9 == 5 && num7 == 5)) + { + Main.tile[i, j].frameX = (short)(44 + num2); + } + else + { + if (Main.tile[i, j].wall > 0) + { + Main.tile[i, j].frameX = num2; + } + else + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + } + return; + } + if (num == 136) + { + int num10 = -1; + int num11 = -1; + int num12 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].nactive()) + { + byte arg_5B2_0 = Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0) + { + num10 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].nactive()) + { + num11 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].nactive()) + { + num12 = (int)Main.tile[i + 1, j].type; + } + if (num10 >= 0 && Main.tileSolid[num10] && !Main.tileNoAttach[num10]) + { + Main.tile[i, j].frameX = 0; + } + else + { + if ((num11 >= 0 && Main.tileSolid[num11] && !Main.tileNoAttach[num11]) || num11 == 124 || num11 == 5) + { + Main.tile[i, j].frameX = 18; + } + else + { + if ((num12 >= 0 && Main.tileSolid[num12] && !Main.tileNoAttach[num12]) || num12 == 124 || num12 == 5) + { + Main.tile[i, j].frameX = 36; + } + else + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + return; + } + if (num == 129 || num == 149) + { + int num13 = -1; + int num14 = -1; + int num15 = -1; + int num16 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].nactive()) + { + num14 = (int)Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0) + { + num13 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].nactive()) + { + num15 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].nactive()) + { + num16 = (int)Main.tile[i + 1, j].type; + } + if (num13 >= 0 && Main.tileSolid[num13] && !Main.tileSolidTop[num13]) + { + Main.tile[i, j].frameY = 0; + } + else + { + if (num15 >= 0 && Main.tileSolid[num15] && !Main.tileSolidTop[num15]) + { + Main.tile[i, j].frameY = 54; + } + else + { + if (num16 >= 0 && Main.tileSolid[num16] && !Main.tileSolidTop[num16]) + { + Main.tile[i, j].frameY = 36; + } + else + { + if (num14 >= 0 && Main.tileSolid[num14] && !Main.tileSolidTop[num14]) + { + Main.tile[i, j].frameY = 18; + } + else + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + } + } + else + { + if (num == 178) + { + int num17 = -1; + int num18 = -1; + int num19 = -1; + int num20 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active()) + { + num18 = (int)Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0) + { + num17 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].active()) + { + num19 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].active()) + { + num20 = (int)Main.tile[i + 1, j].type; + } + short num21 = (short)(WorldGen.genRand.Next(3) * 18); + if (num17 >= 0 && Main.tileSolid[num17] && !Main.tileSolidTop[num17]) + { + if (Main.tile[i, j].frameY < 0 || Main.tile[i, j].frameY > 36) + { + Main.tile[i, j].frameY = num21; + } + } + else + { + if (num19 >= 0 && Main.tileSolid[num19] && !Main.tileSolidTop[num19]) + { + if (Main.tile[i, j].frameY < 108 || Main.tile[i, j].frameY > 54) + { + Main.tile[i, j].frameY = (short)(108 + num21); + } + } + else + { + if (num20 >= 0 && Main.tileSolid[num20] && !Main.tileSolidTop[num20]) + { + if (Main.tile[i, j].frameY < 162 || Main.tile[i, j].frameY > 198) + { + Main.tile[i, j].frameY = (short)(162 + num21); + } + } + else + { + if (num18 >= 0 && Main.tileSolid[num18] && !Main.tileSolidTop[num18]) + { + if (Main.tile[i, j].frameY < 54 || Main.tile[i, j].frameY > 90) + { + Main.tile[i, j].frameY = (short)(54 + num21); + } + } + else + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + } + } + else + { + if (num == 184) + { + int num22 = -1; + int num23 = -1; + int num24 = -1; + int num25 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active()) + { + num23 = (int)Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == 0) + { + num22 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].active()) + { + num24 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].active()) + { + num25 = (int)Main.tile[i + 1, j].type; + } + short num26 = (short)(WorldGen.genRand.Next(3) * 18); + if (num22 >= 0 && Main.tileMoss[num22]) + { + Main.tile[i, j].frameX = (short)(22 * (num22 - 179)); + if (Main.tile[i, j].frameY < 0 || Main.tile[i, j].frameY > 36) + { + Main.tile[i, j].frameY = num26; + } + } + else + { + if (num23 >= 0 && Main.tileMoss[num23]) + { + Main.tile[i, j].frameX = (short)(22 * (num23 - 179)); + if (Main.tile[i, j].frameY < 54 || Main.tile[i, j].frameY > 90) + { + Main.tile[i, j].frameY = (short)(54 + num26); + } + } + else + { + if (num24 >= 0 && Main.tileMoss[num24]) + { + Main.tile[i, j].frameX = (short)(22 * (num24 - 179)); + if (Main.tile[i, j].frameY < 108 || Main.tile[i, j].frameY > 54) + { + Main.tile[i, j].frameY = (short)(108 + num26); + } + } + else + { + if (num25 >= 0 && Main.tileMoss[num25]) + { + Main.tile[i, j].frameX = (short)(22 * (num25 - 179)); + if (Main.tile[i, j].frameY < 162 || Main.tile[i, j].frameY > 198) + { + Main.tile[i, j].frameY = (short)(162 + num26); + } + } + else + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + } + } + else + { + if (num == 3 || num == 24 || num == 61 || num == 71 || num == 73 || num == 74 || num == 110 || num == 113 || num == 201) + { + WorldGen.PlantCheck(i, j); + } + else + { + if (num == 227) + { + WorldGen.CheckDye(i, j); + } + else + { + if (num == 12 || num == 31) + { + WorldGen.CheckOrb(i, j, num); + } + else + { + if (num == 165) + { + WorldGen.CheckTight(i, j); + } + else + { + if (num == 235) + { + WorldGen.Check3x1(i, j, num); + } + else + { + if (num == 185) + { + WorldGen.CheckPile(i, j); + } + else + { + if (num == 10) + { + if (!WorldGen.destroyObject) + { + bool flag2 = false; + int k = (int)Main.tile[i, j].frameY; + int num27 = 0; + while (k >= 54) + { + k -= 54; + num27++; + } + int num28 = j - k / 18; + if (Main.tile[i, num28 - 1] == null) + { + Main.tile[i, num28 - 1] = new Tile(); + } + if (Main.tile[i, num28 + 3] == null) + { + Main.tile[i, num28 + 3] = new Tile(); + } + if (Main.tile[i, num28 + 2] == null) + { + Main.tile[i, num28 + 2] = new Tile(); + } + if (Main.tile[i, num28 + 1] == null) + { + Main.tile[i, num28 + 1] = new Tile(); + } + if (Main.tile[i, num28] == null) + { + Main.tile[i, num28] = new Tile(); + } + if (!Main.tile[i, num28 - 1].active() || !Main.tileSolid[(int)Main.tile[i, num28 - 1].type]) + { + flag2 = true; + } + if (!WorldGen.SolidTile(i, num28 + 3)) + { + flag2 = true; + } + if (!Main.tile[i, num28].active() || (int)Main.tile[i, num28].type != num) + { + flag2 = true; + } + if (!Main.tile[i, num28 + 1].active() || (int)Main.tile[i, num28 + 1].type != num) + { + flag2 = true; + } + if (!Main.tile[i, num28 + 2].active() || (int)Main.tile[i, num28 + 2].type != num) + { + flag2 = true; + } + if (flag2) + { + WorldGen.destroyObject = true; + WorldGen.KillTile(i, num28, false, false, false); + WorldGen.KillTile(i, num28 + 1, false, false, false); + WorldGen.KillTile(i, num28 + 2, false, false, false); + if (num27 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 25, 1, false, 0, false); + } + else + { + if (num27 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 837, 1, false, 0, false); + } + else + { + if (num27 == 10) + { + Item.NewItem(i * 16, j * 16, 16, 16, 912, 1, false, 0, false); + } + else + { + if (num27 == 12) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1137, 1, false, 0, false); + } + else + { + if (num27 == 13) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1138, 1, false, 0, false); + } + else + { + if (num27 == 14) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1139, 1, false, 0, false); + } + else + { + if (num27 == 15) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1140, 1, false, 0, false); + } + else + { + if (num27 == 16) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1411, 1, false, 0, false); + } + else + { + if (num27 == 17) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1412, 1, false, 0, false); + } + else + { + if (num27 == 18) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1413, 1, false, 0, false); + } + else + { + if (num27 == 19) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1458, 1, false, 0, false); + } + else + { + if (num27 >= 20 && num27 <= 23) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1709 + num27 - 20, 1, false, 0, false); + } + else + { + if (num27 >= 4 && num27 <= 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, 812 + num27, 1, false, 0, false); + } + else + { + if (num27 != 11) + { + Item.NewItem(i * 16, j * 16, 16, 16, 649 + num27, 1, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + WorldGen.destroyObject = false; + } + } + else + { + if (num == 11) + { + if (!WorldGen.destroyObject) + { + int num29 = 0; + int num30 = i; + int frameX2 = (int)Main.tile[i, j].frameX; + int l = (int)Main.tile[i, j].frameY; + int num31 = 0; + while (l >= 54) + { + l -= 54; + num31++; + } + int num32 = j - l / 18; + bool flag3 = false; + if (frameX2 == 0) + { + num30 = i; + num29 = 1; + } + else + { + if (frameX2 == 18) + { + num30 = i - 1; + num29 = 1; + } + else + { + if (frameX2 == 36) + { + num30 = i + 1; + num29 = -1; + } + else + { + if (frameX2 == 54) + { + num30 = i; + num29 = -1; + } + } + } + } + if (Main.tile[num30, num32 + 3] == null) + { + Main.tile[num30, num32 + 3] = new Tile(); + } + if (Main.tile[num30, num32 - 1] == null) + { + Main.tile[num30, num32 - 1] = new Tile(); + } + if (!Main.tile[num30, num32 - 1].active() || !Main.tileSolid[(int)Main.tile[num30, num32 - 1].type] || !WorldGen.SolidTile(num30, num32 + 3)) + { + flag3 = true; + WorldGen.destroyObject = true; + if (num31 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 25, 1, false, 0, false); + } + else + { + if (num31 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 837, 1, false, 0, false); + } + else + { + if (num31 == 10) + { + Item.NewItem(i * 16, j * 16, 16, 16, 912, 1, false, 0, false); + } + else + { + if (num31 == 11 || num31 == 12) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1137, 1, false, 0, false); + } + else + { + if (num31 == 13) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1138, 1, false, 0, false); + } + else + { + if (num31 == 14) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1139, 1, false, 0, false); + } + else + { + if (num31 == 15) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1140, 1, false, 0, false); + } + else + { + if (num31 == 16) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1411, 1, false, 0, false); + } + else + { + if (num31 == 17) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1412, 1, false, 0, false); + } + else + { + if (num31 == 18) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1413, 1, false, 0, false); + } + else + { + if (num31 == 19) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1458, 1, false, 0, false); + } + else + { + if (num31 >= 20 && num31 <= 23) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1709 + num31 - 20, 1, false, 0, false); + } + else + { + if (num31 >= 4 && num31 <= 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, 812 + num31, 1, false, 0, false); + } + else + { + Item.NewItem(i * 16, j * 16, 16, 16, 649 + num31, 1, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + int num33 = num30; + if (num29 == -1) + { + num33 = num30 - 1; + } + for (int m = num33; m < num33 + 2; m++) + { + for (int n = num32; n < num32 + 3; n++) + { + if (!flag3 && (Main.tile[m, n].type != 11 || !Main.tile[m, n].active())) + { + WorldGen.destroyObject = true; + if (num31 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 25, 1, false, 0, false); + } + else + { + if (num31 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 837, 1, false, 0, false); + } + else + { + if (num31 == 10) + { + Item.NewItem(i * 16, j * 16, 16, 16, 912, 1, false, 0, false); + } + else + { + if (num31 == 11 || num31 == 12) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1137, 1, false, 0, false); + } + else + { + if (num31 == 13) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1138, 1, false, 0, false); + } + else + { + if (num31 == 14) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1139, 1, false, 0, false); + } + else + { + if (num31 == 15) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1140, 1, false, 0, false); + } + else + { + if (num31 == 16) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1411, 1, false, 0, false); + } + else + { + if (num31 == 17) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1412, 1, false, 0, false); + } + else + { + if (num31 == 18) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1413, 1, false, 0, false); + } + else + { + if (num31 == 19) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1458, 1, false, 0, false); + } + else + { + if (num31 >= 20 && num31 <= 23) + { + Item.NewItem(i * 16, j * 16, 16, 16, 1709 + num31 - 20, 1, false, 0, false); + } + else + { + if (num31 >= 4 && num31 <= 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, 812 + num31, 1, false, 0, false); + } + else + { + Item.NewItem(i * 16, j * 16, 16, 16, 649 + num31, 1, false, 0, false); + } + } + } + } + } + } + } + } + } + } + } + } + } + flag3 = true; + m = num33; + n = num32; + } + if (flag3) + { + WorldGen.KillTile(m, n, false, false, false); + } + } + } + WorldGen.destroyObject = false; + } + } + else + { + if (num == 19) + { + int num34 = -1; + int num35 = -1; + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].active()) + { + if (Main.tileStone[(int)Main.tile[i - 1, j].type]) + { + num35 = 1; + } + else + { + num35 = (int)Main.tile[i - 1, j].type; + } + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].active()) + { + if (Main.tileStone[(int)Main.tile[i + 1, j].type]) + { + num34 = 1; + } + else + { + num34 = (int)Main.tile[i + 1, j].type; + } + } + if (num34 >= 0 && !Main.tileSolid[num34]) + { + num34 = -1; + } + if (num35 >= 0 && !Main.tileSolid[num35]) + { + num35 = -1; + } + if (num35 == num && Main.tile[i - 1, j].halfBrick() != Main.tile[i, j].halfBrick()) + { + num35 = -1; + } + if (num34 == num && Main.tile[i + 1, j].halfBrick() != Main.tile[i, j].halfBrick()) + { + num34 = -1; + } + if (num35 != -1 && num35 != num && Main.tile[i, j].halfBrick()) + { + num35 = -1; + } + if (num34 != -1 && num34 != num && Main.tile[i, j].halfBrick()) + { + num34 = -1; + } + if (num35 == num && num34 == num) + { + rectangle.X = 0; + } + else + { + if (num35 == num && num34 == -1) + { + rectangle.X = 18; + } + else + { + if (num35 == -1 && num34 == num) + { + rectangle.X = 36; + } + else + { + if (num35 != num && num34 == num) + { + rectangle.X = 54; + } + else + { + if (num35 == num && num34 != num) + { + rectangle.X = 72; + } + else + { + if (num35 != num && num35 != -1 && num34 == -1) + { + rectangle.X = 108; + } + else + { + if (num35 == -1 && num34 != num && num34 != -1) + { + rectangle.X = 126; + } + else + { + rectangle.X = 90; + } + } + } + } + } + } + } + Main.tile[i, j].frameX = (short)rectangle.X; + } + else + { + if (num == 233 || num == 236 || num == 238) + { + WorldGen.CheckJunglePlant(i, j, num); + } + else + { + if (num == 240) + { + WorldGen.Check3x3Wall(i, j); + } + else + { + if (num == 245) + { + WorldGen.Check2x3Wall(i, j); + } + else + { + if (num == 246) + { + WorldGen.Check3x2Wall(i, j); + } + else + { + if (num == 241) + { + WorldGen.Check4x3Wall(i, j); + } + else + { + if (num == 242) + { + WorldGen.Check6x4Wall(i, j); + } + else + { + if (num == 34 || num == 35 || num == 36 || num == 106 || num == 170 || num == 171 || num == 172 || num == 212 || num == 219 || num == 220 || num == 228 || num == 231 || num == 243 || num == 247) + { + WorldGen.Check3x3(i, j, (int)((byte)num)); + } + else + { + if (num == 15 || num == 20 || num == 216) + { + WorldGen.Check1x2(i, j, (byte)num); + } + else + { + if (num == 14 || num == 17 || num == 26 || num == 77 || num == 86 || num == 87 || num == 88 || num == 89 || num == 114 || num == 133 || num == 186 || num == 187 || num == 215 || num == 217 || num == 218 || num == 237 || num == 244) + { + WorldGen.Check3x2(i, j, (int)((byte)num)); + } + else + { + if (num == 135 || num == 144 || num == 141 || num == 210 || num == 239) + { + WorldGen.Check1x1(i, j, num); + } + else + { + if (num == 16 || num == 18 || num == 29 || num == 103 || num == 134) + { + WorldGen.Check2x1(i, j, (byte)num); + } + else + { + if (num == 13 || num == 33 || num == 50 || num == 78 || num == 174) + { + WorldGen.CheckOnTable1x1(i, j, (int)((byte)num)); + } + else + { + if (num == 21) + { + WorldGen.CheckChest(i, j, (int)((byte)num)); + } + else + { + if (num == 128) + { + WorldGen.CheckMan(i, j); + } + else + { + if (num == 27) + { + WorldGen.CheckSunflower(i, j, 27); + } + else + { + if (num == 28) + { + WorldGen.CheckPot(i, j, 28); + } + else + { + if (num == 132 || num == 138 || num == 142 || num == 143) + { + WorldGen.Check2x2(i, j, num); + } + else + { + if (num == 91) + { + WorldGen.CheckBanner(i, j, (byte)num); + } + else + { + if (num == 139) + { + WorldGen.CheckMB(i, j, (int)((byte)num)); + } + else + { + if (num == 92 || num == 93) + { + WorldGen.Check1xX(i, j, (byte)num); + } + else + { + if (num == 104 || num == 105 || num == 207) + { + WorldGen.Check2xX(i, j, (byte)num); + } + else + { + if (num == 101 || num == 102) + { + WorldGen.Check3x4(i, j, (int)((byte)num)); + } + else + { + if (num == 42) + { + WorldGen.Check1x2Top(i, j, (byte)num); + } + else + { + if (num == 55 || num == 85) + { + WorldGen.CheckSign(i, j, num); + } + else + { + if (num == 209) + { + WorldGen.CheckCannon(i, j, num); + } + else + { + if (num == 79 || num == 90) + { + WorldGen.Check4x2(i, j, num); + } + else + { + if (num == 85 || num == 94 || num == 95 || num == 96 || num == 97 || num == 98 || num == 99 || num == 100 || num == 125 || num == 126 || num == 173) + { + WorldGen.Check2x2(i, j, num); + } + else + { + if (num == 81) + { + int num36 = -1; + int num37 = -1; + int num38 = -1; + int num39 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active()) + { + num37 = (int)Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active()) + { + num36 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].active()) + { + num38 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].active()) + { + num39 = (int)Main.tile[i + 1, j].type; + } + if (num38 != -1 || num37 != -1 || num39 != -1) + { + WorldGen.KillTile(i, j, false, false, false); + } + else + { + if (num36 < 0 || !Main.tileSolid[num36] || Main.tile[i, j + 1].halfBrick() || Main.tile[i, j + 1].slope() != 0) + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + else + { + if (Main.tileAlch[num]) + { + WorldGen.CheckAlch(i, j); + } + else + { + if (num == 72) + { + int num40 = -1; + int num41 = -1; + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active()) + { + num41 = (int)Main.tile[i, j - 1].type; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active()) + { + num40 = (int)Main.tile[i, j + 1].type; + } + if (num40 != num && num40 != 70) + { + WorldGen.KillTile(i, j, false, false, false); + } + else + { + if (num41 != num && Main.tile[i, j].frameX == 0) + { + Main.tile[i, j].frameNumber((byte)WorldGen.genRand.Next(3)); + if (Main.tile[i, j].frameNumber() == 0) + { + Main.tile[i, j].frameX = 18; + Main.tile[i, j].frameY = 0; + } + if (Main.tile[i, j].frameNumber() == 1) + { + Main.tile[i, j].frameX = 18; + Main.tile[i, j].frameY = 18; + } + if (Main.tile[i, j].frameNumber() == 2) + { + Main.tile[i, j].frameX = 18; + Main.tile[i, j].frameY = 36; + } + } + } + } + else + { + if (num == 5) + { + WorldGen.CheckTree(i, j); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return; + } + else + { + int num42 = -1; + int num43 = -1; + int num44 = -1; + int num45 = -1; + int num46 = -1; + int num47 = -1; + int num48 = -1; + int num49 = -1; + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].active()) + { + if (Main.tileStone[(int)Main.tile[i - 1, j].type]) + { + num45 = 1; + } + else + { + num45 = (int)Main.tile[i - 1, j].type; + } + if (Main.tile[i - 1, j].slope() == 1) + { + num45 = -1; + } + } + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].active()) + { + if (Main.tileStone[(int)Main.tile[i + 1, j].type]) + { + num46 = 1; + } + else + { + num46 = (int)Main.tile[i + 1, j].type; + } + if (Main.tile[i + 1, j].slope() == 2) + { + num46 = -1; + } + } + if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active()) + { + if (Main.tileStone[(int)Main.tile[i, j - 1].type]) + { + num43 = 1; + } + else + { + num43 = (int)Main.tile[i, j - 1].type; + } + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active()) + { + if (Main.tileStone[(int)Main.tile[i, j + 1].type]) + { + num48 = 1; + } + else + { + num48 = (int)Main.tile[i, j + 1].type; + } + if (Main.tile[i, j + 1].slope() == 1 || Main.tile[i, j + 1].slope() == 2) + { + num48 = -1; + } + } + if (Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].active()) + { + if (Main.tileStone[(int)Main.tile[i - 1, j - 1].type]) + { + num42 = 1; + } + else + { + num42 = (int)Main.tile[i - 1, j - 1].type; + } + } + if (Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].active()) + { + if (Main.tileStone[(int)Main.tile[i + 1, j - 1].type]) + { + num44 = 1; + } + else + { + num44 = (int)Main.tile[i + 1, j - 1].type; + } + } + if (Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].active()) + { + if (Main.tileStone[(int)Main.tile[i - 1, j + 1].type]) + { + num47 = 1; + } + else + { + num47 = (int)Main.tile[i - 1, j + 1].type; + } + } + if (Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].active()) + { + if (Main.tileStone[(int)Main.tile[i + 1, j + 1].type]) + { + num49 = 1; + } + else + { + num49 = (int)Main.tile[i + 1, j + 1].type; + } + } + if (Main.tile[i, j].slope() == 2) + { + num43 = -1; + num45 = -1; + } + if (Main.tile[i, j].slope() == 1) + { + num43 = -1; + num46 = -1; + } + if (num == 147) + { + if (num43 > -1 && Main.tileBrick[num43] && num43 != 161 && num43 != 163 && num43 != 164 && num43 != 200 && num43 != 200 && num43 != 224) + { + num43 = num; + } + if (num48 > -1 && Main.tileBrick[num48] && num48 != 161 && num48 != 163 && num48 != 164 && num48 != 200 && num48 != 224) + { + num48 = num; + } + if (num45 > -1 && Main.tileBrick[num45] && num45 != 161 && num45 != 163 && num45 != 164 && num45 != 200 && num45 != 224) + { + num45 = num; + } + if (num46 > -1 && Main.tileBrick[num46] && num46 != 161 && num46 != 163 && num46 != 164 && num46 != 200 && num46 != 224) + { + num46 = num; + } + if (num42 > -1 && Main.tileBrick[num42] && num42 != 161 && num42 != 163 && num42 != 164 && num42 != 200 && num42 != 224) + { + num42 = num; + } + if (num44 > -1 && Main.tileBrick[num44] && num44 != 161 && num44 != 163 && num44 != 164 && num44 != 200 && num44 != 224) + { + num44 = num; + } + if (num47 > -1 && Main.tileBrick[num47] && num47 != 161 && num47 != 163 && num47 != 164 && num47 != 200 && num47 != 224) + { + num47 = num; + } + if (num49 > -1 && Main.tileBrick[num49] && num49 != 161 && num49 != 163 && num49 != 164 && num49 != 200 && num49 != 224) + { + num49 = num; + } + } + else + { + if (num == 161 || num == 163 || num == 164 || num == 200) + { + if (num43 > -1 && Main.tileBrick[num43] && num43 != 147) + { + num43 = num; + } + if (num48 > -1 && Main.tileBrick[num48] && num48 != 147) + { + num48 = num; + } + if (num45 > -1 && Main.tileBrick[num45] && num45 != 147) + { + num45 = num; + } + if (num46 > -1 && Main.tileBrick[num46] && num46 != 147) + { + num46 = num; + } + if (num42 > -1 && Main.tileBrick[num42] && num42 != 147) + { + num42 = num; + } + if (num44 > -1 && Main.tileBrick[num44] && num44 != 147) + { + num44 = num; + } + if (num47 > -1 && Main.tileBrick[num47] && num47 != 147) + { + num47 = num; + } + if (num49 > -1 && Main.tileBrick[num49] && num49 != 147) + { + num49 = num; + } + } + else + { + if (Main.tileBrick[num]) + { + if (num == 60 || num == 70) + { + if (num43 > -1 && num43 != 59 && Main.tileBrick[num43]) + { + num43 = num; + } + if (num48 > -1 && num48 != 59 && Main.tileBrick[num48]) + { + num48 = num; + } + if (num45 > -1 && num45 != 59 && Main.tileBrick[num45]) + { + num45 = num; + } + if (num46 > -1 && num46 != 59 && Main.tileBrick[num46]) + { + num46 = num; + } + if (num42 > -1 && num42 != 59 && Main.tileBrick[num42]) + { + num42 = num; + } + if (num44 > -1 && num44 != 59 && Main.tileBrick[num44]) + { + num44 = num; + } + if (num47 > -1 && num47 != 59 && Main.tileBrick[num47]) + { + num47 = num; + } + if (num49 > -1 && num49 != 59 && Main.tileBrick[num49]) + { + num49 = num; + } + } + else + { + if (num43 > -1 && Main.tileBrick[num43]) + { + num43 = num; + } + if (num48 > -1 && Main.tileBrick[num48]) + { + num48 = num; + } + if (num45 > -1 && Main.tileBrick[num45]) + { + num45 = num; + } + if (num46 > -1 && Main.tileBrick[num46]) + { + num46 = num; + } + if (num42 > -1 && Main.tileBrick[num42]) + { + num42 = num; + } + if (num44 > -1 && Main.tileBrick[num44]) + { + num44 = num; + } + if (num47 > -1 && Main.tileBrick[num47]) + { + num47 = num; + } + if (num49 > -1 && Main.tileBrick[num49]) + { + num49 = num; + } + } + } + } + } + if ((num == 1 || Main.tileMoss[num]) && num48 == 165) + { + if (Main.tile[i, j + 1].frameY == 72) + { + num48 = 1; + } + else + { + if (Main.tile[i, j + 1].frameY == 0) + { + num48 = 1; + } + } + } + if ((num == 1 || Main.tileMoss[num]) && num43 == 165) + { + if (Main.tile[i, j - 1].frameY == 90) + { + num43 = 1; + } + else + { + if (Main.tile[i, j - 1].frameY == 54) + { + num43 = 1; + } + } + } + if (num == 225) + { + if (num48 == 165) + { + num48 = num; + } + if (num43 == 165) + { + num43 = num; + } + } + if (num == 25 && num48 == 165 && Main.tile[i, j + 1].frameY < 36) + { + num48 = 25; + } + if (num == 25 && num43 == 165 && Main.tile[i, j - 1].frameY >= 36) + { + num43 = 25; + } + if (num == 117 && num48 == 165 && Main.tile[i, j + 1].frameY < 36) + { + num48 = 117; + } + if (num == 117 && num43 == 165 && Main.tile[i, j - 1].frameY >= 36) + { + num43 = 117; + } + if (num == 200 && num48 == 165) + { + num48 = 200; + } + if (num == 161 && num48 == 165) + { + num48 = 161; + } + if (num == 163 && num48 == 165) + { + num48 = 163; + } + if (num == 164 && num48 == 165) + { + num48 = 164; + } + if (Main.tile[i, j].slope() != 0 && num48 > -1) + { + num48 = num; + } + if (num43 > -1 && Main.tile[i, j - 1].slope() != 0) + { + num43 = num; + } + if (num == 124) + { + if (num43 > -1 && Main.tileSolid[num43]) + { + num43 = num; + } + if (num48 > -1 && Main.tileSolid[num48]) + { + num48 = num; + } + } + if (num43 > -1 && Main.tile[i, j - 1].halfBrick()) + { + num43 = num; + } + if (num45 > -1 && Main.tile[i - 1, j].halfBrick()) + { + if (Main.tile[i, j].halfBrick()) + { + num45 = num; + } + else + { + if ((int)Main.tile[i - 1, j].type != num) + { + num45 = -1; + } + } + } + if (num46 > -1 && Main.tile[i + 1, j].halfBrick()) + { + if (Main.tile[i, j].halfBrick()) + { + num46 = num; + } + else + { + if ((int)Main.tile[i + 1, j].type != num) + { + num46 = -1; + } + } + } + if (Main.tile[i, j].halfBrick()) + { + if (num45 != num) + { + num45 = -1; + } + if (num46 != num) + { + num46 = -1; + } + num43 = -1; + } + if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].halfBrick()) + { + num48 = -1; + } + if (!Main.tileSolid[num]) + { + if (num == 49) + { + WorldGen.CheckOnTable1x1(i, j, (int)((byte)num)); + return; + } + if (num == 80) + { + WorldGen.CactusFrame(i, j); + return; + } + } + WorldGen.mergeUp = false; + WorldGen.mergeDown = false; + WorldGen.mergeLeft = false; + WorldGen.mergeRight = false; + int num50; + if (resetFrame) + { + num50 = WorldGen.genRand.Next(0, 3); + Main.tile[i, j].frameNumber((byte)num50); + } + else + { + num50 = (int)Main.tile[i, j].frameNumber(); + } + if (num == 0) + { + if (num43 >= 0 && Main.tileMergeDirt[num43]) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + else + { + if (num43 == 147) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + } + if (num48 >= 0 && Main.tileMergeDirt[num48]) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + else + { + if (num48 == 147) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + } + if (num45 >= 0 && Main.tileMergeDirt[num45]) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + else + { + if (num45 == 147) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + } + if (num46 >= 0 && Main.tileMergeDirt[num46]) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + else + { + if (num46 == 147) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + } + if (num43 == 2 || num43 == 23 || num43 == 109 || num43 == 199) + { + num43 = num; + } + if (num48 == 2 || num48 == 23 || num48 == 109 || num48 == 199) + { + num48 = num; + } + if (num45 == 2 || num45 == 23 || num45 == 109 || num45 == 199) + { + num45 = num; + } + if (num46 == 2 || num46 == 23 || num46 == 109 || num46 == 199) + { + num46 = num; + } + if (num42 >= 0 && Main.tileMergeDirt[num42]) + { + num42 = num; + } + else + { + if (num42 == 2 || num42 == 23 || num42 == 109 || num42 == 199) + { + num42 = num; + } + } + if (num44 >= 0 && Main.tileMergeDirt[num44]) + { + num44 = num; + } + else + { + if (num44 == 2 || num44 == 23 || num44 == 109 || num44 == 199) + { + num44 = num; + } + } + if (num47 >= 0 && Main.tileMergeDirt[num47]) + { + num47 = num; + } + else + { + if (num47 == 2 || num47 == 23 || num47 == 109 || num47 == 199) + { + num47 = num; + } + } + if (num49 >= 0 && Main.tileMergeDirt[num49]) + { + num49 = num; + } + else + { + if (num49 == 2 || num49 == 23 || num49 == 109 || num49 == 199) + { + num49 = num; + } + } + double arg_313B_0 = Main.rockLayer; + if (num43 == 59) + { + num43 = -2; + } + if (num48 == 59) + { + num48 = -2; + } + if (num45 == 59) + { + num45 = -2; + } + if (num46 == 59) + { + num46 = -2; + } + if (num42 == 59) + { + num42 = -2; + } + if (num44 == 59) + { + num44 = -2; + } + if (num47 == 59) + { + num47 = -2; + } + if (num49 == 59) + { + num49 = -2; + } + if (num43 == 191) + { + num43 = num; + } + if (num48 == 191) + { + num48 = num; + } + if (num45 == 191) + { + num45 = num; + } + if (num46 == 191) + { + num46 = num; + } + if (num42 == 191) + { + num42 = num; + } + if (num44 == 191) + { + num44 = num; + } + if (num47 == 191) + { + num47 = num; + } + if (num49 == 191) + { + num49 = num; + } + } + else + { + if (num == 213) + { + if (num43 >= 0 && Main.tileSolid[num43] && !Main.tileSolidTop[num43]) + { + num43 = num; + } + if (num48 >= 0 && Main.tileSolid[num48]) + { + num48 = num; + } + if (num43 != num) + { + if (num45 >= 0 && Main.tileSolid[num45]) + { + num45 = num; + } + if (num46 >= 0 && Main.tileSolid[num46]) + { + num46 = num; + } + } + } + if (Main.tileMergeDirt[num]) + { + if (num43 == 0) + { + num43 = -2; + } + if (num48 == 0) + { + num48 = -2; + } + if (num45 == 0) + { + num45 = -2; + } + if (num46 == 0) + { + num46 = -2; + } + if (num42 == 0) + { + num42 = -2; + } + if (num44 == 0) + { + num44 = -2; + } + if (num47 == 0) + { + num47 = -2; + } + if (num49 == 0) + { + num49 = -2; + } + if (num == 1) + { + if ((double)j > Main.rockLayer) + { + if (num43 == 59) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 59) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 59) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 59) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 59) + { + num42 = num; + } + if (num44 == 59) + { + num44 = num; + } + if (num47 == 59) + { + num47 = num; + } + if (num49 == 59) + { + num49 = num; + } + } + if (num43 == 57) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 57) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 57) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 57) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 57) + { + num42 = num; + } + if (num44 == 57) + { + num44 = num; + } + if (num47 == 57) + { + num47 = num; + } + if (num49 == 57) + { + num49 = num; + } + } + } + else + { + if (num == 58 || num == 76 || num == 75) + { + if (num43 == 57) + { + num43 = -2; + } + if (num48 == 57) + { + num48 = -2; + } + if (num45 == 57) + { + num45 = -2; + } + if (num46 == 57) + { + num46 = -2; + } + if (num42 == 57) + { + num42 = -2; + } + if (num44 == 57) + { + num44 = -2; + } + if (num47 == 57) + { + num47 = -2; + } + if (num49 == 57) + { + num49 = -2; + } + } + else + { + if (num == 211) + { + if (num43 == 60) + { + num43 = 59; + } + if (num48 == 60) + { + num48 = 59; + } + if (num45 == 60) + { + num45 = 59; + } + if (num46 == 60) + { + num46 = 59; + } + if (num43 == 59) + { + num43 = -2; + } + if (num48 == 59) + { + num48 = -2; + } + if (num45 == 59) + { + num45 = -2; + } + if (num46 == 59) + { + num46 = -2; + } + if (num42 == 59) + { + num42 = -2; + } + if (num44 == 59) + { + num44 = -2; + } + if (num47 == 59) + { + num47 = -2; + } + if (num49 == 59) + { + num49 = -2; + } + } + else + { + if (num == 225 || num == 226) + { + if (num43 == 59) + { + num43 = -2; + } + if (num48 == 59) + { + num48 = -2; + } + if (num45 == 59) + { + num45 = -2; + } + if (num46 == 59) + { + num46 = -2; + } + if (num42 == 59) + { + num42 = -2; + } + if (num44 == 59) + { + num44 = -2; + } + if (num47 == 59) + { + num47 = -2; + } + if (num49 == 59) + { + num49 = -2; + } + } + else + { + if (num == 59) + { + if ((double)j > Main.rockLayer) + { + if (num43 == 1) + { + num43 = -2; + } + if (num48 == 1) + { + num48 = -2; + } + if (num45 == 1) + { + num45 = -2; + } + if (num46 == 1) + { + num46 = -2; + } + if (num42 == 1) + { + num42 = -2; + } + if (num44 == 1) + { + num44 = -2; + } + if (num47 == 1) + { + num47 = -2; + } + if (num49 == 1) + { + num49 = -2; + } + } + if (num43 == 60) + { + num43 = num; + } + if (num48 == 60) + { + num48 = num; + } + if (num45 == 60) + { + num45 = num; + } + if (num46 == 60) + { + num46 = num; + } + if (num42 == 60) + { + num42 = num; + } + if (num44 == 60) + { + num44 = num; + } + if (num47 == 60) + { + num47 = num; + } + if (num49 == 60) + { + num49 = num; + } + if (num43 == 70) + { + num43 = num; + } + if (num48 == 70) + { + num48 = num; + } + if (num45 == 70) + { + num45 = num; + } + if (num46 == 70) + { + num46 = num; + } + if (num42 == 70) + { + num42 = num; + } + if (num44 == 70) + { + num44 = num; + } + if (num47 == 70) + { + num47 = num; + } + if (num49 == 70) + { + num49 = num; + } + if (num43 == 211 || num43 == 226 || num43 == 225) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 211 || num48 == 226 || num48 == 225) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 211 || num45 == 226 || num45 == 225) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 211 || num46 == 226 || num46 == 225) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 211 || num42 == 225 || num42 == 226) + { + num42 = num; + } + if (num44 == 211 || num44 == 225 || num44 == 226) + { + num44 = num; + } + if (num47 == 211 || num47 == 225 || num47 == 226) + { + num47 = num; + } + if (num49 == 211 || num49 == 225 || num49 == 226) + { + num49 = num; + } + if ((double)j < Main.rockLayer) + { + if (num43 == 0) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 0) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 0) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 0) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 0) + { + num42 = num; + } + if (num44 == 0) + { + num44 = num; + } + if (num47 == 0) + { + num47 = num; + } + if (num49 == 0) + { + num49 = num; + } + } + else + { + if (num43 == 0) + { + num43 = num; + } + if (num45 == 0) + { + num45 = num; + } + if (num46 == 0) + { + num46 = num; + } + if (num48 == 0) + { + num48 = num; + } + } + } + else + { + if (num == 57) + { + if (num43 == 1) + { + num43 = -2; + } + if (num48 == 1) + { + num48 = -2; + } + if (num45 == 1) + { + num45 = -2; + } + if (num46 == 1) + { + num46 = -2; + } + if (num42 == 1) + { + num42 = -2; + } + if (num44 == 1) + { + num44 = -2; + } + if (num47 == 1) + { + num47 = -2; + } + if (num49 == 1) + { + num49 = -2; + } + if (num43 == 58 || num43 == 76 || num43 == 75) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 58 || num48 == 76 || num48 == 75) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 58 || num45 == 76 || num45 == 75) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 58 || num46 == 76 || num46 == 75) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 58 || num42 == 76 || num42 == 75) + { + num42 = num; + } + if (num44 == 58 || num44 == 76 || num44 == 75) + { + num44 = num; + } + if (num47 == 58 || num47 == 76 || num47 == 75) + { + num47 = num; + } + if (num49 == 58 || num49 == 76 || num49 == 75) + { + num49 = num; + } + } + else + { + if (num == 189) + { + if (num43 == 196) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 196) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 196) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 196) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 196) + { + num42 = num; + } + if (num44 == 196) + { + num44 = num; + } + if (num47 == 196) + { + num47 = num; + } + if (num49 == 196) + { + num49 = num; + } + } + else + { + if (num == 196) + { + if (num43 == 189) + { + num43 = -2; + } + if (num48 == 189) + { + num48 = -2; + } + if (num45 == 189) + { + num45 = -2; + } + if (num46 == 189) + { + num46 = -2; + } + if (num42 == 189) + { + num42 = -2; + } + if (num44 == 189) + { + num44 = -2; + } + if (num47 == 189) + { + num47 = -2; + } + if (num49 == 189) + { + num49 = -2; + } + } + else + { + if (num == 147) + { + if (num43 == 0) + { + num43 = -2; + } + if (num48 == 0) + { + num48 = -2; + } + if (num45 == 0) + { + num45 = -2; + } + if (num46 == 0) + { + num46 = -2; + } + if (num42 == 0) + { + num42 = -2; + } + if (num44 == 0) + { + num44 = -2; + } + if (num47 == 0) + { + num47 = -2; + } + if (num49 == 0) + { + num49 = -2; + } + if (num43 == 161 || num43 == 163 || num43 == 164 || num43 == 200 || num43 == 224) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 161 || num48 == 163 || num48 == 164 || num48 == 200 || num48 == 224) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 161 || num45 == 163 || num45 == 164 || num45 == 200 || num45 == 224) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 161 || num46 == 163 || num46 == 164 || num46 == 200 || num46 == 224) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 161 || num42 == 163 || num42 == 164 || num42 == 200 || num42 == 224) + { + num42 = num; + } + if (num44 == 161 || num44 == 163 || num44 == 164 || num44 == 200 || num44 == 224) + { + num44 = num; + } + if (num47 == 161 || num47 == 163 || num47 == 164 || num47 == 200 || num47 == 224) + { + num47 = num; + } + if (num49 == 161 || num49 == 163 || num49 == 164 || num49 == 200 || num49 == 224) + { + num49 = num; + } + } + else + { + if (num == 161 || num == 163 || num == 164 || num == 200 || num == 224) + { + if (num43 == 147) + { + num43 = -2; + } + if (num48 == 147) + { + num48 = -2; + } + if (num45 == 147) + { + num45 = -2; + } + if (num46 == 147) + { + num46 = -2; + } + if (num42 == 147) + { + num42 = -2; + } + if (num44 == 147) + { + num44 = -2; + } + if (num47 == 147) + { + num47 = -2; + } + if (num49 == 147) + { + num49 = -2; + } + } + else + { + if (num == 32) + { + if (num48 == 23) + { + num48 = num; + } + } + else + { + if (num == 69) + { + if (num48 == 60) + { + num48 = num; + } + } + else + { + if (num == 51) + { + if (num43 > -1 && !Main.tileNoAttach[num43]) + { + num43 = num; + } + if (num48 > -1 && !Main.tileNoAttach[num48]) + { + num48 = num; + } + if (num45 > -1 && !Main.tileNoAttach[num45]) + { + num45 = num; + } + if (num46 > -1 && !Main.tileNoAttach[num46]) + { + num46 = num; + } + if (num42 > -1 && !Main.tileNoAttach[num42]) + { + num42 = num; + } + if (num44 > -1 && !Main.tileNoAttach[num44]) + { + num44 = num; + } + if (num47 > -1 && !Main.tileNoAttach[num47]) + { + num47 = num; + } + if (num49 > -1 && !Main.tileNoAttach[num49]) + { + num49 = num; + } + } + else + { + if (num == 192) + { + if (num43 == 191) + { + WorldGen.TileFrame(i, j - 1, false, false); + if (WorldGen.mergeDown) + { + num43 = num; + } + } + if (num48 == 191) + { + WorldGen.TileFrame(i, j + 1, false, false); + if (WorldGen.mergeUp) + { + num48 = num; + } + } + if (num45 == 191) + { + WorldGen.TileFrame(i - 1, j, false, false); + if (WorldGen.mergeRight) + { + num45 = num; + } + } + if (num46 == 191) + { + WorldGen.TileFrame(i + 1, j, false, false); + if (WorldGen.mergeLeft) + { + num46 = num; + } + } + if (num42 == 191) + { + num42 = num; + } + if (num44 == 191) + { + num44 = num; + } + if (num47 == 191) + { + num47 = num; + } + if (num49 == 191) + { + num49 = num; + } + } + else + { + if (num == 191) + { + if (num43 == 192) + { + num43 = -2; + } + if (num48 == 192) + { + num48 = -2; + } + if (num45 == 192) + { + num45 = -2; + } + if (num46 == 192) + { + num46 = -2; + } + if (num42 == 192) + { + num42 = -2; + } + if (num44 == 192) + { + num44 = -2; + } + if (num47 == 192) + { + num47 = -2; + } + if (num49 == 192) + { + num49 = -2; + } + if (num43 == 0) + { + num43 = num; + } + if (num48 == 0) + { + num48 = num; + } + if (num45 == 0) + { + num45 = num; + } + if (num46 == 0) + { + num46 = num; + } + if (num42 == 0) + { + num42 = num; + } + if (num44 == 0) + { + num44 = num; + } + if (num47 == 0) + { + num47 = num; + } + if (num49 == 0) + { + num49 = num; + } + } + else + { + if (num == 60) + { + if (num43 == 211) + { + num43 = 59; + } + if (num48 == 211) + { + num48 = 59; + } + if (num45 == 211) + { + num45 = 59; + } + if (num46 == 211) + { + num46 = 59; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.tileStone[num] || num == 1) + { + if (num43 > -1 && Main.tileMoss[num43]) + { + num43 = num; + } + if (num48 > -1 && Main.tileMoss[num48]) + { + num48 = num; + } + if (num45 > -1 && Main.tileMoss[num45]) + { + num45 = num; + } + if (num46 > -1 && Main.tileMoss[num46]) + { + num46 = num; + } + if (num42 > -1 && Main.tileMoss[num42]) + { + num42 = num; + } + if (num44 > -1 && Main.tileMoss[num44]) + { + num44 = num; + } + if (num47 > -1 && Main.tileMoss[num47]) + { + num47 = num; + } + if (num49 > -1 && Main.tileMoss[num49]) + { + num49 = num; + } + } + bool flag4 = false; + if (num43 == -2 && Main.tile[i, j].color() != Main.tile[i, j - 1].color()) + { + num43 = num; + WorldGen.mergeUp = true; + } + if (num48 == -2 && Main.tile[i, j].color() != Main.tile[i, j + 1].color()) + { + num48 = num; + WorldGen.mergeDown = true; + } + if (num45 == -2 && Main.tile[i, j].color() != Main.tile[i - 1, j].color()) + { + num45 = num; + WorldGen.mergeLeft = true; + } + if (num46 == -2 && Main.tile[i, j].color() != Main.tile[i + 1, j].color()) + { + num46 = num; + WorldGen.mergeRight = true; + } + if (num == 2 || num == 23 || num == 60 || num == 70 || num == 109 || num == 199 || Main.tileMoss[num]) + { + flag4 = true; + if (num43 > -1 && !Main.tileSolid[num43] && num43 != num) + { + num43 = -1; + } + if (num48 > -1 && !Main.tileSolid[num48] && num48 != num) + { + num48 = -1; + } + if (num45 > -1 && !Main.tileSolid[num45] && num45 != num) + { + num45 = -1; + } + if (num46 > -1 && !Main.tileSolid[num46] && num46 != num) + { + num46 = -1; + } + if (num42 > -1 && !Main.tileSolid[num42] && num42 != num) + { + num42 = -1; + } + if (num44 > -1 && !Main.tileSolid[num44] && num44 != num) + { + num44 = -1; + } + if (num47 > -1 && !Main.tileSolid[num47] && num47 != num) + { + num47 = -1; + } + if (num49 > -1 && !Main.tileSolid[num49] && num49 != num) + { + num49 = -1; + } + int num51 = 0; + if (num == 60 || num == 70) + { + num51 = 59; + } + else + { + if (Main.tileMoss[num]) + { + num51 = 1; + } + else + { + if (num == 2) + { + if (num43 == 23) + { + num43 = num51; + } + if (num48 == 23) + { + num48 = num51; + } + if (num45 == 23) + { + num45 = num51; + } + if (num46 == 23) + { + num46 = num51; + } + if (num42 == 23) + { + num42 = num51; + } + if (num44 == 23) + { + num44 = num51; + } + if (num47 == 23) + { + num47 = num51; + } + if (num49 == 23) + { + num49 = num51; + } + } + else + { + if (num == 23) + { + if (num43 == 2) + { + num43 = num51; + } + if (num48 == 2) + { + num48 = num51; + } + if (num45 == 2) + { + num45 = num51; + } + if (num46 == 2) + { + num46 = num51; + } + if (num42 == 2) + { + num42 = num51; + } + if (num44 == 2) + { + num44 = num51; + } + if (num47 == 2) + { + num47 = num51; + } + if (num49 == 2) + { + num49 = num51; + } + } + } + } + } + if (num43 != num && num43 != num51 && (num48 == num || num48 == num51)) + { + if (num45 == num51 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 198; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 198; + } + else + { + rectangle.X = 36; + rectangle.Y = 198; + } + } + } + else + { + if (num45 == num && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 198; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 198; + } + else + { + rectangle.X = 90; + rectangle.Y = 198; + } + } + } + } + } + else + { + if (num48 != num && num48 != num51 && (num43 == num || num43 == num51)) + { + if (num45 == num51 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 216; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 216; + } + else + { + rectangle.X = 36; + rectangle.Y = 216; + } + } + } + else + { + if (num45 == num && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 216; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 216; + } + else + { + rectangle.X = 90; + rectangle.Y = 216; + } + } + } + } + } + else + { + if (num45 != num && num45 != num51 && (num46 == num || num46 == num51)) + { + if (num43 == num51 && num48 == num) + { + if (num50 == 0) + { + rectangle.X = 72; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 162; + } + else + { + rectangle.X = 72; + rectangle.Y = 180; + } + } + } + else + { + if (num48 == num && num46 == num43) + { + if (num50 == 0) + { + rectangle.X = 72; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 108; + } + else + { + rectangle.X = 72; + rectangle.Y = 126; + } + } + } + } + } + else + { + if (num46 != num && num46 != num51 && (num45 == num || num45 == num51)) + { + if (num43 == num51 && num48 == num) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 90; + rectangle.Y = 162; + } + else + { + rectangle.X = 90; + rectangle.Y = 180; + } + } + } + else + { + if (num48 == num && num46 == num43) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 90; + rectangle.Y = 108; + } + else + { + rectangle.X = 90; + rectangle.Y = 126; + } + } + } + } + } + else + { + if (num43 == num && num48 == num && num45 == num && num46 == num) + { + if (num42 != num && num44 != num && num47 != num && num49 != num) + { + if (num49 == num51) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 324; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 324; + } + else + { + rectangle.X = 144; + rectangle.Y = 324; + } + } + } + else + { + if (num44 == num51) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 342; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 342; + } + else + { + rectangle.X = 144; + rectangle.Y = 342; + } + } + } + else + { + if (num47 == num51) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 360; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 360; + } + else + { + rectangle.X = 144; + rectangle.Y = 360; + } + } + } + else + { + if (num42 == num51) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 378; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 378; + } + else + { + rectangle.X = 144; + rectangle.Y = 378; + } + } + } + else + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 234; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 234; + } + else + { + rectangle.X = 252; + rectangle.Y = 234; + } + } + } + } + } + } + } + else + { + if (num42 != num && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 306; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 306; + } + else + { + rectangle.X = 72; + rectangle.Y = 306; + } + } + } + else + { + if (num44 != num && num47 != num) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 306; + } + else + { + if (num50 == 1) + { + rectangle.X = 108; + rectangle.Y = 306; + } + else + { + rectangle.X = 126; + rectangle.Y = 306; + } + } + } + else + { + if (num42 != num && num44 == num && num47 == num && num49 == num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 144; + } + else + { + rectangle.X = 54; + rectangle.Y = 180; + } + } + } + else + { + if (num42 == num && num44 != num && num47 == num && num49 == num) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 144; + } + else + { + rectangle.X = 36; + rectangle.Y = 180; + } + } + } + else + { + if (num42 == num && num44 == num && num47 != num && num49 == num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 126; + } + else + { + rectangle.X = 54; + rectangle.Y = 162; + } + } + } + else + { + if (num42 == num && num44 == num && num47 == num && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 126; + } + else + { + rectangle.X = 36; + rectangle.Y = 162; + } + } + } + } + } + } + } + } + } + } + else + { + if (num43 == num && num48 == num51 && num45 == num && num46 == num && num42 == -1 && num44 == -1) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 18; + } + else + { + rectangle.X = 144; + rectangle.Y = 18; + } + } + } + else + { + if (num43 == num51 && num48 == num && num45 == num && num46 == num && num47 == -1 && num49 == -1) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 36; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 36; + } + else + { + rectangle.X = 144; + rectangle.Y = 36; + } + } + } + else + { + if (num43 == num && num48 == num && num45 == num51 && num46 == num && num44 == -1 && num49 == -1) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 18; + } + else + { + rectangle.X = 198; + rectangle.Y = 36; + } + } + } + else + { + if (num43 == num && num48 == num && num45 == num && num46 == num51 && num42 == -1 && num47 == -1) + { + if (num50 == 0) + { + rectangle.X = 180; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 180; + rectangle.Y = 18; + } + else + { + rectangle.X = 180; + rectangle.Y = 36; + } + } + } + else + { + if (num43 == num && num48 == num51 && num45 == num && num46 == num) + { + if (num44 != -1) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 144; + } + else + { + rectangle.X = 54; + rectangle.Y = 180; + } + } + } + else + { + if (num42 != -1) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 144; + } + else + { + rectangle.X = 36; + rectangle.Y = 180; + } + } + } + } + } + else + { + if (num43 == num51 && num48 == num && num45 == num && num46 == num) + { + if (num49 != -1) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 126; + } + else + { + rectangle.X = 54; + rectangle.Y = 162; + } + } + } + else + { + if (num47 != -1) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 126; + } + else + { + rectangle.X = 36; + rectangle.Y = 162; + } + } + } + } + } + else + { + if (num43 == num && num48 == num && num45 == num && num46 == num51) + { + if (num42 != -1) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 126; + } + else + { + rectangle.X = 54; + rectangle.Y = 162; + } + } + } + else + { + if (num47 != -1) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 144; + } + else + { + rectangle.X = 54; + rectangle.Y = 180; + } + } + } + } + } + else + { + if (num43 == num && num48 == num && num45 == num51 && num46 == num) + { + if (num44 != -1) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 126; + } + else + { + rectangle.X = 36; + rectangle.Y = 162; + } + } + } + else + { + if (num49 != -1) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 144; + } + else + { + rectangle.X = 36; + rectangle.Y = 180; + } + } + } + } + } + else + { + if ((num43 == num51 && num48 == num && num45 == num && num46 == num) || (num43 == num && num48 == num51 && num45 == num && num46 == num) || (num43 == num && num48 == num && num45 == num51 && num46 == num) || (num43 == num && num48 == num && num45 == num && num46 == num51)) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 18; + } + else + { + rectangle.X = 54; + rectangle.Y = 18; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if ((num43 == num || num43 == num51) && (num48 == num || num48 == num51) && (num45 == num || num45 == num51) && (num46 == num || num46 == num51)) + { + if (num42 != num && num42 != num51 && (num44 == num || num44 == num51) && (num47 == num || num47 == num51) && (num49 == num || num49 == num51)) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 144; + } + else + { + rectangle.X = 54; + rectangle.Y = 180; + } + } + } + else + { + if (num44 != num && num44 != num51 && (num42 == num || num42 == num51) && (num47 == num || num47 == num51) && (num49 == num || num49 == num51)) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 144; + } + else + { + rectangle.X = 36; + rectangle.Y = 180; + } + } + } + else + { + if (num47 != num && num47 != num51 && (num42 == num || num42 == num51) && (num44 == num || num44 == num51) && (num49 == num || num49 == num51)) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 126; + } + else + { + rectangle.X = 54; + rectangle.Y = 162; + } + } + } + else + { + if (num49 != num && num49 != num51 && (num42 == num || num42 == num51) && (num47 == num || num47 == num51) && (num44 == num || num44 == num51)) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 126; + } + else + { + rectangle.X = 36; + rectangle.Y = 162; + } + } + } + } + } + } + } + if (num43 != num51 && num43 != num && num48 == num && num45 != num51 && num45 != num && num46 == num && num49 != num51 && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 270; + } + else + { + if (num50 == 1) + { + rectangle.X = 108; + rectangle.Y = 270; + } + else + { + rectangle.X = 126; + rectangle.Y = 270; + } + } + } + else + { + if (num43 != num51 && num43 != num && num48 == num && num45 == num && num46 != num51 && num46 != num && num47 != num51 && num47 != num) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 270; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 270; + } + else + { + rectangle.X = 180; + rectangle.Y = 270; + } + } + } + else + { + if (num48 != num51 && num48 != num && num43 == num && num45 != num51 && num45 != num && num46 == num && num44 != num51 && num44 != num) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 288; + } + else + { + if (num50 == 1) + { + rectangle.X = 108; + rectangle.Y = 288; + } + else + { + rectangle.X = 126; + rectangle.Y = 288; + } + } + } + else + { + if (num48 != num51 && num48 != num && num43 == num && num45 == num && num46 != num51 && num46 != num && num42 != num51 && num42 != num) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 288; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 288; + } + else + { + rectangle.X = 180; + rectangle.Y = 288; + } + } + } + else + { + if (num43 != num && num43 != num51 && num48 == num && num45 == num && num46 == num && num47 != num && num47 != num51 && num49 != num && num49 != num51) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 216; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 216; + } + else + { + rectangle.X = 252; + rectangle.Y = 216; + } + } + } + else + { + if (num48 != num && num48 != num51 && num43 == num && num45 == num && num46 == num && num42 != num && num42 != num51 && num44 != num && num44 != num51) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 252; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 252; + } + else + { + rectangle.X = 252; + rectangle.Y = 252; + } + } + } + else + { + if (num45 != num && num45 != num51 && num48 == num && num43 == num && num46 == num && num44 != num && num44 != num51 && num49 != num && num49 != num51) + { + if (num50 == 0) + { + rectangle.X = 126; + rectangle.Y = 234; + } + else + { + if (num50 == 1) + { + rectangle.X = 180; + rectangle.Y = 234; + } + else + { + rectangle.X = 234; + rectangle.Y = 234; + } + } + } + else + { + if (num46 != num && num46 != num51 && num48 == num && num43 == num && num45 == num && num42 != num && num42 != num51 && num47 != num && num47 != num51) + { + if (num50 == 0) + { + rectangle.X = 162; + rectangle.Y = 234; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 234; + } + else + { + rectangle.X = 270; + rectangle.Y = 234; + } + } + } + else + { + if (num43 != num51 && num43 != num && (num48 == num51 || num48 == num) && num45 == num51 && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 270; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 270; + } + else + { + rectangle.X = 72; + rectangle.Y = 270; + } + } + } + else + { + if (num48 != num51 && num48 != num && (num43 == num51 || num43 == num) && num45 == num51 && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 288; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 288; + } + else + { + rectangle.X = 72; + rectangle.Y = 288; + } + } + } + else + { + if (num45 != num51 && num45 != num && (num46 == num51 || num46 == num) && num43 == num51 && num48 == num51) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 270; + } + else + { + if (num50 == 1) + { + rectangle.X = 0; + rectangle.Y = 288; + } + else + { + rectangle.X = 0; + rectangle.Y = 306; + } + } + } + else + { + if (num46 != num51 && num46 != num && (num45 == num51 || num45 == num) && num43 == num51 && num48 == num51) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 270; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 288; + } + else + { + rectangle.X = 18; + rectangle.Y = 306; + } + } + } + else + { + if (num43 == num && num48 == num51 && num45 == num51 && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 288; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 288; + } + else + { + rectangle.X = 234; + rectangle.Y = 288; + } + } + } + else + { + if (num43 == num51 && num48 == num && num45 == num51 && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 270; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 270; + } + else + { + rectangle.X = 234; + rectangle.Y = 270; + } + } + } + else + { + if (num43 == num51 && num48 == num51 && num45 == num && num46 == num51) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 306; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 306; + } + else + { + rectangle.X = 234; + rectangle.Y = 306; + } + } + } + else + { + if (num43 == num51 && num48 == num51 && num45 == num51 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 306; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 306; + } + else + { + rectangle.X = 180; + rectangle.Y = 306; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (num43 != num && num43 != num51 && num48 == num && num45 == num && num46 == num) + { + if ((num47 == num51 || num47 == num) && num49 != num51 && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 324; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 324; + } + else + { + rectangle.X = 36; + rectangle.Y = 324; + } + } + } + else + { + if ((num49 == num51 || num49 == num) && num47 != num51 && num47 != num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 324; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 324; + } + else + { + rectangle.X = 90; + rectangle.Y = 324; + } + } + } + } + } + else + { + if (num48 != num && num48 != num51 && num43 == num && num45 == num && num46 == num) + { + if ((num42 == num51 || num42 == num) && num44 != num51 && num44 != num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 342; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 342; + } + else + { + rectangle.X = 36; + rectangle.Y = 342; + } + } + } + else + { + if ((num44 == num51 || num44 == num) && num42 != num51 && num42 != num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 342; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 342; + } + else + { + rectangle.X = 90; + rectangle.Y = 342; + } + } + } + } + } + else + { + if (num45 != num && num45 != num51 && num43 == num && num48 == num && num46 == num) + { + if ((num44 == num51 || num44 == num) && num49 != num51 && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 360; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 360; + } + else + { + rectangle.X = 90; + rectangle.Y = 360; + } + } + } + else + { + if ((num49 == num51 || num49 == num) && num44 != num51 && num44 != num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 360; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 360; + } + else + { + rectangle.X = 36; + rectangle.Y = 360; + } + } + } + } + } + else + { + if (num46 != num && num46 != num51 && num43 == num && num48 == num && num45 == num) + { + if ((num42 == num51 || num42 == num) && num47 != num51 && num47 != num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 378; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 378; + } + else + { + rectangle.X = 36; + rectangle.Y = 378; + } + } + } + else + { + if ((num47 == num51 || num47 == num) && num42 != num51 && num42 != num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 378; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 378; + } + else + { + rectangle.X = 90; + rectangle.Y = 378; + } + } + } + } + } + } + } + } + if ((num43 == num || num43 == num51) && (num48 == num || num48 == num51) && (num45 == num || num45 == num51) && (num46 == num || num46 == num51) && num42 != -1 && num44 != -1 && num47 != -1 && num49 != -1) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 18; + } + else + { + rectangle.X = 54; + rectangle.Y = 18; + } + } + } + if (num43 == num51) + { + num43 = -2; + } + if (num48 == num51) + { + num48 = -2; + } + if (num45 == num51) + { + num45 = -2; + } + if (num46 == num51) + { + num46 = -2; + } + if (num42 == num51) + { + num42 = -2; + } + if (num44 == num51) + { + num44 = -2; + } + if (num47 == num51) + { + num47 = -2; + } + if (num49 == num51) + { + num49 = -2; + } + } + if (rectangle.X == -1 && rectangle.Y == -1 && (Main.tileMergeDirt[num] || num == 0 || num == 2 || num == 57 || num == 58 || num == 59 || num == 60 || num == 70 || num == 109 || num == 76 || num == 75 || num == 147 || num == 161 || num == 163 || num == 164 || num == 189 || num == 196 || num == 191 || num == 199 || num == 200 || num == 211 || num == 224 || num == 226 || num == 225)) + { + if (!flag4) + { + flag4 = true; + if (num43 > -1 && !Main.tileSolid[num43] && num43 != num) + { + num43 = -1; + } + if (num48 > -1 && !Main.tileSolid[num48] && num48 != num) + { + num48 = -1; + } + if (num45 > -1 && !Main.tileSolid[num45] && num45 != num) + { + num45 = -1; + } + if (num46 > -1 && !Main.tileSolid[num46] && num46 != num) + { + num46 = -1; + } + if (num42 > -1 && !Main.tileSolid[num42] && num42 != num) + { + num42 = -1; + } + if (num44 > -1 && !Main.tileSolid[num44] && num44 != num) + { + num44 = -1; + } + if (num47 > -1 && !Main.tileSolid[num47] && num47 != num) + { + num47 = -1; + } + if (num49 > -1 && !Main.tileSolid[num49] && num49 != num) + { + num49 = -1; + } + } + if (num43 >= 0 && num43 != num) + { + num43 = -1; + } + if (num48 >= 0 && num48 != num) + { + num48 = -1; + } + if (num45 >= 0 && num45 != num) + { + num45 = -1; + } + if (num46 >= 0 && num46 != num) + { + num46 = -1; + } + if (num43 != -1 && num48 != -1 && num45 != -1 && num46 != -1) + { + if (num43 == -2 && num48 == num && num45 == num && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 108; + } + else + { + rectangle.X = 180; + rectangle.Y = 108; + } + } + WorldGen.mergeUp = true; + } + else + { + if (num43 == num && num48 == -2 && num45 == num && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 90; + } + else + { + rectangle.X = 180; + rectangle.Y = 90; + } + } + WorldGen.mergeDown = true; + } + else + { + if (num43 == num && num48 == num && num45 == -2 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 162; + rectangle.Y = 126; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 144; + } + else + { + rectangle.X = 162; + rectangle.Y = 162; + } + } + WorldGen.mergeLeft = true; + } + else + { + if (num43 == num && num48 == num && num45 == num && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 126; + } + else + { + if (num50 == 1) + { + rectangle.X = 144; + rectangle.Y = 144; + } + else + { + rectangle.X = 144; + rectangle.Y = 162; + } + } + WorldGen.mergeRight = true; + } + else + { + if (num43 == -2 && num48 == num && num45 == -2 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 126; + } + else + { + rectangle.X = 36; + rectangle.Y = 162; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeLeft = true; + } + else + { + if (num43 == -2 && num48 == num && num45 == num && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 126; + } + else + { + rectangle.X = 54; + rectangle.Y = 162; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == num && num48 == -2 && num45 == -2 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 36; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 144; + } + else + { + rectangle.X = 36; + rectangle.Y = 180; + } + } + WorldGen.mergeDown = true; + WorldGen.mergeLeft = true; + } + else + { + if (num43 == num && num48 == -2 && num45 == num && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 144; + } + else + { + rectangle.X = 54; + rectangle.Y = 180; + } + } + WorldGen.mergeDown = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == num && num48 == num && num45 == -2 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 180; + rectangle.Y = 126; + } + else + { + if (num50 == 1) + { + rectangle.X = 180; + rectangle.Y = 144; + } + else + { + rectangle.X = 180; + rectangle.Y = 162; + } + } + WorldGen.mergeLeft = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == -2 && num48 == -2 && num45 == num && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 144; + rectangle.Y = 180; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 180; + } + else + { + rectangle.X = 180; + rectangle.Y = 180; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeDown = true; + } + else + { + if (num43 == -2 && num48 == num && num45 == -2 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 108; + } + else + { + rectangle.X = 198; + rectangle.Y = 126; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeLeft = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == num && num48 == -2 && num45 == -2 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 162; + } + else + { + rectangle.X = 198; + rectangle.Y = 180; + } + } + WorldGen.mergeDown = true; + WorldGen.mergeLeft = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == -2 && num48 == -2 && num45 == num && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 216; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 162; + } + else + { + rectangle.X = 216; + rectangle.Y = 180; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeDown = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == -2 && num48 == -2 && num45 == -2 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 216; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 108; + } + else + { + rectangle.X = 216; + rectangle.Y = 126; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeDown = true; + WorldGen.mergeLeft = true; + } + else + { + if (num43 == -2 && num48 == -2 && num45 == -2 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 198; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 198; + } + else + { + rectangle.X = 144; + rectangle.Y = 198; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeDown = true; + WorldGen.mergeLeft = true; + WorldGen.mergeRight = true; + } + else + { + if (num43 == num && num48 == num && num45 == num && num46 == num) + { + if (num42 == -2) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 144; + } + else + { + rectangle.X = 18; + rectangle.Y = 180; + } + } + } + if (num44 == -2) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 108; + } + else + { + if (num50 == 1) + { + rectangle.X = 0; + rectangle.Y = 144; + } + else + { + rectangle.X = 0; + rectangle.Y = 180; + } + } + } + if (num47 == -2) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 126; + } + else + { + rectangle.X = 18; + rectangle.Y = 162; + } + } + } + if (num49 == -2) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 0; + rectangle.Y = 126; + } + else + { + rectangle.X = 0; + rectangle.Y = 162; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else + { + if (num != 2 && num != 23 && num != 60 && num != 70 && num != 109 && num != 199) + { + if (num43 == -1 && num48 == -2 && num45 == num && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 234; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 252; + rectangle.Y = 0; + } + else + { + rectangle.X = 270; + rectangle.Y = 0; + } + } + WorldGen.mergeDown = true; + } + else + { + if (num43 == -2 && num48 == -1 && num45 == num && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 234; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 252; + rectangle.Y = 18; + } + else + { + rectangle.X = 270; + rectangle.Y = 18; + } + } + WorldGen.mergeUp = true; + } + else + { + if (num43 == num && num48 == num && num45 == -1 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 234; + rectangle.Y = 36; + } + else + { + if (num50 == 1) + { + rectangle.X = 252; + rectangle.Y = 36; + } + else + { + rectangle.X = 270; + rectangle.Y = 36; + } + } + WorldGen.mergeRight = true; + } + else + { + if (num43 == num && num48 == num && num45 == -2 && num46 == -1) + { + if (num50 == 0) + { + rectangle.X = 234; + rectangle.Y = 54; + } + else + { + if (num50 == 1) + { + rectangle.X = 252; + rectangle.Y = 54; + } + else + { + rectangle.X = 270; + rectangle.Y = 54; + } + } + WorldGen.mergeLeft = true; + } + } + } + } + } + if (num43 != -1 && num48 != -1 && num45 == -1 && num46 == num) + { + if (num43 == -2 && num48 == num) + { + if (num50 == 0) + { + rectangle.X = 72; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 162; + } + else + { + rectangle.X = 72; + rectangle.Y = 180; + } + } + WorldGen.mergeUp = true; + } + else + { + if (num48 == -2 && num43 == num) + { + if (num50 == 0) + { + rectangle.X = 72; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 108; + } + else + { + rectangle.X = 72; + rectangle.Y = 126; + } + } + WorldGen.mergeDown = true; + } + } + } + else + { + if (num43 != -1 && num48 != -1 && num45 == num && num46 == -1) + { + if (num43 == -2 && num48 == num) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 90; + rectangle.Y = 162; + } + else + { + rectangle.X = 90; + rectangle.Y = 180; + } + } + WorldGen.mergeUp = true; + } + else + { + if (num48 == -2 && num43 == num) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 90; + rectangle.Y = 108; + } + else + { + rectangle.X = 90; + rectangle.Y = 126; + } + } + WorldGen.mergeDown = true; + } + } + } + else + { + if (num43 == -1 && num48 == num && num45 != -1 && num46 != -1) + { + if (num45 == -2 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 198; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 198; + } + else + { + rectangle.X = 36; + rectangle.Y = 198; + } + } + WorldGen.mergeLeft = true; + } + else + { + if (num46 == -2 && num45 == num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 198; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 198; + } + else + { + rectangle.X = 90; + rectangle.Y = 198; + } + } + WorldGen.mergeRight = true; + } + } + } + else + { + if (num43 == num && num48 == -1 && num45 != -1 && num46 != -1) + { + if (num45 == -2 && num46 == num) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 216; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 216; + } + else + { + rectangle.X = 36; + rectangle.Y = 216; + } + } + WorldGen.mergeLeft = true; + } + else + { + if (num46 == -2 && num45 == num) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 216; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 216; + } + else + { + rectangle.X = 90; + rectangle.Y = 216; + } + } + WorldGen.mergeRight = true; + } + } + } + else + { + if (num43 != -1 && num48 != -1 && num45 == -1 && num46 == -1) + { + if (num43 == -2 && num48 == -2) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 216; + } + else + { + if (num50 == 1) + { + rectangle.X = 108; + rectangle.Y = 234; + } + else + { + rectangle.X = 108; + rectangle.Y = 252; + } + } + WorldGen.mergeUp = true; + WorldGen.mergeDown = true; + } + else + { + if (num43 == -2) + { + if (num50 == 0) + { + rectangle.X = 126; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 162; + } + else + { + rectangle.X = 126; + rectangle.Y = 180; + } + } + WorldGen.mergeUp = true; + } + else + { + if (num48 == -2) + { + if (num50 == 0) + { + rectangle.X = 126; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 108; + } + else + { + rectangle.X = 126; + rectangle.Y = 126; + } + } + WorldGen.mergeDown = true; + } + } + } + } + else + { + if (num43 == -1 && num48 == -1 && num45 != -1 && num46 != -1) + { + if (num45 == -2 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 162; + rectangle.Y = 198; + } + else + { + if (num50 == 1) + { + rectangle.X = 180; + rectangle.Y = 198; + } + else + { + rectangle.X = 198; + rectangle.Y = 198; + } + } + WorldGen.mergeLeft = true; + WorldGen.mergeRight = true; + } + else + { + if (num45 == -2) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 252; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 252; + } + else + { + rectangle.X = 36; + rectangle.Y = 252; + } + } + WorldGen.mergeLeft = true; + } + else + { + if (num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 252; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 252; + } + else + { + rectangle.X = 90; + rectangle.Y = 252; + } + } + WorldGen.mergeRight = true; + } + } + } + } + else + { + if (num43 == -2 && num48 == -1 && num45 == -1 && num46 == -1) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 144; + } + else + { + if (num50 == 1) + { + rectangle.X = 108; + rectangle.Y = 162; + } + else + { + rectangle.X = 108; + rectangle.Y = 180; + } + } + WorldGen.mergeUp = true; + } + else + { + if (num43 == -1 && num48 == -2 && num45 == -1 && num46 == -1) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 90; + } + else + { + if (num50 == 1) + { + rectangle.X = 108; + rectangle.Y = 108; + } + else + { + rectangle.X = 108; + rectangle.Y = 126; + } + } + WorldGen.mergeDown = true; + } + else + { + if (num43 == -1 && num48 == -1 && num45 == -2 && num46 == -1) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 234; + } + else + { + if (num50 == 1) + { + rectangle.X = 18; + rectangle.Y = 234; + } + else + { + rectangle.X = 36; + rectangle.Y = 234; + } + } + WorldGen.mergeLeft = true; + } + else + { + if (num43 == -1 && num48 == -1 && num45 == -1 && num46 == -2) + { + if (num50 == 0) + { + rectangle.X = 54; + rectangle.Y = 234; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 234; + } + else + { + rectangle.X = 90; + rectangle.Y = 234; + } + } + WorldGen.mergeRight = true; + } + } + } + } + } + } + } + } + } + } + } + } + if (rectangle.X < 0 || rectangle.Y < 0) + { + if (!flag4) + { + if (num43 > -1 && !Main.tileSolid[num43] && num43 != num) + { + num43 = -1; + } + if (num48 > -1 && !Main.tileSolid[num48] && num48 != num) + { + num48 = -1; + } + if (num45 > -1 && !Main.tileSolid[num45] && num45 != num) + { + num45 = -1; + } + if (num46 > -1 && !Main.tileSolid[num46] && num46 != num) + { + num46 = -1; + } + if (num42 > -1 && !Main.tileSolid[num42] && num42 != num) + { + num42 = -1; + } + if (num44 > -1 && !Main.tileSolid[num44] && num44 != num) + { + num44 = -1; + } + if (num47 > -1 && !Main.tileSolid[num47] && num47 != num) + { + num47 = -1; + } + if (num49 > -1 && !Main.tileSolid[num49] && num49 != num) + { + num49 = -1; + } + } + if (num == 2 || num == 23 || num == 60 || num == 70 || num == 109 || num == 199 || Main.tileMoss[num]) + { + if (num43 == -2) + { + num43 = num; + } + if (num48 == -2) + { + num48 = num; + } + if (num45 == -2) + { + num45 = num; + } + if (num46 == -2) + { + num46 = num; + } + if (num42 == -2) + { + num42 = num; + } + if (num44 == -2) + { + num44 = num; + } + if (num47 == -2) + { + num47 = num; + } + if (num49 == -2) + { + num49 = num; + } + } + if (num43 == num && num48 == num && (num45 == num & num46 == num)) + { + if (num42 != num && num44 != num) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 18; + } + else + { + rectangle.X = 144; + rectangle.Y = 18; + } + } + } + else + { + if (num47 != num && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 36; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 36; + } + else + { + rectangle.X = 144; + rectangle.Y = 36; + } + } + } + else + { + if (num42 != num && num47 != num) + { + if (num50 == 0) + { + rectangle.X = 180; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 180; + rectangle.Y = 18; + } + else + { + rectangle.X = 180; + rectangle.Y = 36; + } + } + } + else + { + if (num44 != num && num49 != num) + { + if (num50 == 0) + { + rectangle.X = 198; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 198; + rectangle.Y = 18; + } + else + { + rectangle.X = 198; + rectangle.Y = 36; + } + } + } + else + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 18; + } + else + { + rectangle.X = 54; + rectangle.Y = 18; + } + } + } + } + } + } + } + else + { + if (num43 != num && num48 == num && (num45 == num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 0; + } + else + { + rectangle.X = 54; + rectangle.Y = 0; + } + } + } + else + { + if (num43 == num && num48 != num && (num45 == num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 36; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 36; + } + else + { + rectangle.X = 54; + rectangle.Y = 36; + } + } + } + else + { + if (num43 == num && num48 == num && (num45 != num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 0; + rectangle.Y = 18; + } + else + { + rectangle.X = 0; + rectangle.Y = 36; + } + } + } + else + { + if (num43 == num && num48 == num && (num45 == num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 72; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 72; + rectangle.Y = 18; + } + else + { + rectangle.X = 72; + rectangle.Y = 36; + } + } + } + else + { + if (num43 != num && num48 == num && (num45 != num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 54; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 54; + } + else + { + rectangle.X = 72; + rectangle.Y = 54; + } + } + } + else + { + if (num43 != num && num48 == num && (num45 == num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 54; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 54; + } + else + { + rectangle.X = 90; + rectangle.Y = 54; + } + } + } + else + { + if (num43 == num && num48 != num && (num45 != num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 0; + rectangle.Y = 72; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 72; + } + else + { + rectangle.X = 72; + rectangle.Y = 72; + } + } + } + else + { + if (num43 == num && num48 != num && (num45 == num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 18; + rectangle.Y = 72; + } + else + { + if (num50 == 1) + { + rectangle.X = 54; + rectangle.Y = 72; + } + else + { + rectangle.X = 90; + rectangle.Y = 72; + } + } + } + else + { + if (num43 == num && num48 == num && (num45 != num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 90; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 90; + rectangle.Y = 18; + } + else + { + rectangle.X = 90; + rectangle.Y = 36; + } + } + } + else + { + if (num43 != num && num48 != num && (num45 == num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 72; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 72; + } + else + { + rectangle.X = 144; + rectangle.Y = 72; + } + } + } + else + { + if (num43 != num && num48 == num && (num45 != num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 0; + } + else + { + rectangle.X = 144; + rectangle.Y = 0; + } + } + } + else + { + if (num43 == num && num48 != num && (num45 != num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 108; + rectangle.Y = 54; + } + else + { + if (num50 == 1) + { + rectangle.X = 126; + rectangle.Y = 54; + } + else + { + rectangle.X = 144; + rectangle.Y = 54; + } + } + } + else + { + if (num43 != num && num48 != num && (num45 != num & num46 == num)) + { + if (num50 == 0) + { + rectangle.X = 162; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 162; + rectangle.Y = 18; + } + else + { + rectangle.X = 162; + rectangle.Y = 36; + } + } + } + else + { + if (num43 != num && num48 != num && (num45 == num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 216; + rectangle.Y = 0; + } + else + { + if (num50 == 1) + { + rectangle.X = 216; + rectangle.Y = 18; + } + else + { + rectangle.X = 216; + rectangle.Y = 36; + } + } + } + else + { + if (num43 != num && num48 != num && (num45 != num & num46 != num)) + { + if (num50 == 0) + { + rectangle.X = 162; + rectangle.Y = 54; + } + else + { + if (num50 == 1) + { + rectangle.X = 180; + rectangle.Y = 54; + } + else + { + rectangle.X = 198; + rectangle.Y = 54; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (rectangle.X <= -1 || rectangle.Y <= -1) + { + if (num50 <= 0) + { + rectangle.X = 18; + rectangle.Y = 18; + } + else + { + if (num50 == 1) + { + rectangle.X = 36; + rectangle.Y = 18; + } + } + if (num50 >= 2) + { + rectangle.X = 54; + rectangle.Y = 18; + } + } + Main.tile[i, j].frameX = (short)rectangle.X; + Main.tile[i, j].frameY = (short)rectangle.Y; + if (num == 52 || num == 62 || num == 115 || num == 205) + { + if (Main.tile[i, j - 1] != null) + { + if (!Main.tile[i, j - 1].active()) + { + num43 = -1; + } + else + { + num43 = (int)Main.tile[i, j - 1].type; + } + } + else + { + num43 = num; + } + if ((num == 52 || num == 205) && (num43 == 109 || num43 == 115)) + { + Main.tile[i, j].type = 115; + WorldGen.SquareTileFrame(i, j, true); + return; + } + if ((num == 115 || num == 205) && (num43 == 2 || num43 == 52)) + { + Main.tile[i, j].type = 52; + WorldGen.SquareTileFrame(i, j, true); + return; + } + if ((num == 52 || num == 115) && (num43 == 199 || num43 == 205)) + { + Main.tile[i, j].type = 205; + WorldGen.SquareTileFrame(i, j, true); + return; + } + if (num43 != num) + { + bool flag5 = false; + if (num43 == -1) + { + flag5 = true; + } + if (num == 52 && num43 != 2 && num43 != 192) + { + flag5 = true; + } + if (num == 62 && num43 != 60) + { + flag5 = true; + } + if (num == 115 && num43 != 109) + { + flag5 = true; + } + if (num == 205 && num43 != 199) + { + flag5 = true; + } + if (flag5) + { + WorldGen.KillTile(i, j, false, false, false); + } + } + } + if (!WorldGen.noTileActions && (num == 53 || num == 112 || num == 116 || num == 123 || num == 224 || num == 234)) + { + if (Main.netMode == 0) + { + if (Main.tile[i, j + 1] != null && !Main.tile[i, j + 1].active()) + { + bool flag6 = true; + if (Main.tile[i, j - 1].active() && Main.tile[i, j - 1].type == 21) + { + flag6 = false; + } + if (flag6) + { + int type = 31; + if (num == 59) + { + type = 39; + } + if (num == 57) + { + type = 40; + } + if (num == 112) + { + type = 56; + } + if (num == 116) + { + type = 67; + } + if (num == 123) + { + type = 71; + } + if (num == 224) + { + type = 179; + } + if (num == 234) + { + type = 241; + } + Main.tile[i, j].active(false); + int num52 = Projectile.NewProjectile((float)(i * 16 + 8), (float)(j * 16 + 8), 0f, 0.41f, type, 10, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num52].ai[0] = 1f; + WorldGen.SquareTileFrame(i, j, true); + } + } + } + else + { + if (Main.netMode == 2 && Main.tile[i, j + 1] != null && !Main.tile[i, j + 1].active()) + { + bool flag7 = true; + if (Main.tile[i, j - 1].active() && Main.tile[i, j - 1].type == 21) + { + flag7 = false; + } + if (flag7) + { + int type2 = 31; + if (num == 59) + { + type2 = 39; + } + if (num == 57) + { + type2 = 40; + } + if (num == 112) + { + type2 = 56; + } + if (num == 116) + { + type2 = 67; + } + if (num == 123) + { + type2 = 71; + } + if (num == 224) + { + type2 = 179; + } + if (num == 234) + { + type2 = 241; + } + Main.tile[i, j].active(false); + int num53 = Projectile.NewProjectile((float)(i * 16 + 8), (float)(j * 16 + 8), 0f, 2.5f, type2, 10, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num53].velocity.Y = 0.5f; + Projectile expr_8165_cp_0 = Main.projectile[num53]; + expr_8165_cp_0.position.Y = expr_8165_cp_0.position.Y + 2f; + Main.projectile[num53].netUpdate = true; + NetMessage.SendTileSquare(-1, i, j, 1); + WorldGen.SquareTileFrame(i, j, true); + } + } + } + } + if (rectangle.X != frameX && rectangle.Y != frameY && frameX >= 0 && frameY >= 0) + { + WorldGen.tileReframeCount++; + if (WorldGen.tileReframeCount < 100) + { + bool flag8 = WorldGen.mergeUp; + bool flag9 = WorldGen.mergeDown; + bool flag10 = WorldGen.mergeLeft; + bool flag11 = WorldGen.mergeRight; + WorldGen.TileFrame(i - 1, j, false, false); + WorldGen.TileFrame(i + 1, j, false, false); + WorldGen.TileFrame(i, j - 1, false, false); + WorldGen.TileFrame(i, j + 1, false, false); + WorldGen.mergeUp = flag8; + WorldGen.mergeDown = flag9; + WorldGen.mergeLeft = flag10; + WorldGen.mergeRight = flag11; + } + WorldGen.tileReframeCount--; + } + } + } + } + } + catch + { + } + if (Main.netMode != 2 && Main.mapEnabled && !WorldGen.noMapUpdate && !WorldGen.gen && i > 0 && j > 0 && Main.map[i, j] != null && Main.map[i, j].light > 0) + { + Main.map[i, j].setTile(i, j, Main.map[i, j].light); + if (Main.map[i, j].changed() && !flag) + { + if (Map.numUpdateTile < Map.maxUpdateTile - 1) + { + Map.updateTileX[Map.numUpdateTile] = (short)i; + Map.updateTileY[Map.numUpdateTile] = (short)j; + Map.numUpdateTile++; + return; + } + Main.mapUnfinished = true; + } + } + } + } +} diff --git a/Terraria/keyBoardInput.cs b/Terraria/keyBoardInput.cs new file mode 100644 index 0000000..b721b3b --- /dev/null +++ b/Terraria/keyBoardInput.cs @@ -0,0 +1,41 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; +namespace Terraria +{ + public class keyBoardInput + { + public class inKey : IMessageFilter + { + public bool PreFilterMessage(ref Message m) + { + if (m.Msg == 258) + { + char c = (char)((int)m.WParam); + Console.WriteLine(c); + if (keyBoardInput.newKeyEvent != null) + { + keyBoardInput.newKeyEvent(c); + } + } + else + { + if (m.Msg == 256) + { + IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(m)); + Marshal.StructureToPtr(m, intPtr, true); + keyBoardInput.TranslateMessage(intPtr); + } + } + return false; + } + } + public static event Action newKeyEvent; + [DllImport("user32.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)] + public static extern bool TranslateMessage(IntPtr message); + static keyBoardInput() + { + Application.AddMessageFilter(new keyBoardInput.inKey()); + } + } +} diff --git a/Terraria/messageBuffer.cs b/Terraria/messageBuffer.cs new file mode 100644 index 0000000..e84d776 --- /dev/null +++ b/Terraria/messageBuffer.cs @@ -0,0 +1,3060 @@ +using Microsoft.Xna.Framework; +using System; +using System.Text; +namespace Terraria +{ + public class messageBuffer + { + public const int readBufferMax = 65535; + public const int writeBufferMax = 65535; + public bool broadcast; + public byte[] readBuffer = new byte[65535]; + public byte[] writeBuffer = new byte[65535]; + public bool writeLocked; + public int messageLength; + public int totalData; + public int whoAmI; + public int spamCount; + public int maxSpam; + public bool checkBytes; + public void Reset() + { + this.writeBuffer = new byte[65535]; + this.writeLocked = false; + this.messageLength = 0; + this.totalData = 0; + this.spamCount = 0; + this.broadcast = false; + this.checkBytes = false; + } + public void GetData(int start, int length) + { + if (this.whoAmI < 256) + { + Netplay.serverSock[this.whoAmI].timeOut = 0; + } + else + { + Netplay.clientSock.timeOut = 0; + } + int num = start + 1; + byte b = this.readBuffer[start]; + Main.rxMsg++; + Main.rxData += length; + Main.rxMsgType[(int)b]++; + Main.rxDataType[(int)b] += length; + if (Main.netMode == 1 && Netplay.clientSock.statusMax > 0) + { + Netplay.clientSock.statusCount++; + } + if (Main.verboseNetplay) + { + for (int i = start; i < start + length; i++) + { + } + for (int j = start; j < start + length; j++) + { + byte arg_CD_0 = this.readBuffer[j]; + } + } + if (Main.netMode == 2 && b != 38 && Netplay.serverSock[this.whoAmI].state == -1) + { + NetMessage.SendData(2, this.whoAmI, -1, Lang.mp[1], 0, 0f, 0f, 0f, 0); + return; + } + if (Main.netMode == 2 && Netplay.serverSock[this.whoAmI].state < 10 && b > 12 && b != 16 && b != 42 && b != 50 && b != 38 && b != 68) + { + NetMessage.BootPlayer(this.whoAmI, Lang.mp[2]); + } + if (b == 1 && Main.netMode == 2) + { + if (Main.dedServ && Netplay.CheckBan(Netplay.serverSock[this.whoAmI].tcpClient.Client.RemoteEndPoint.ToString())) + { + NetMessage.SendData(2, this.whoAmI, -1, Lang.mp[3], 0, 0f, 0f, 0f, 0); + return; + } + if (Netplay.serverSock[this.whoAmI].state == 0) + { + string @string = Encoding.UTF8.GetString(this.readBuffer, start + 1, length - 1); + if (!(@string == "Terraria" + Main.curRelease)) + { + NetMessage.SendData(2, this.whoAmI, -1, Lang.mp[4], 0, 0f, 0f, 0f, 0); + return; + } + if (Netplay.password == null || Netplay.password == "") + { + Netplay.serverSock[this.whoAmI].state = 1; + NetMessage.SendData(3, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + return; + } + Netplay.serverSock[this.whoAmI].state = -1; + NetMessage.SendData(37, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 2 && Main.netMode == 1) + { + Netplay.disconnect = true; + Main.statusText = Encoding.UTF8.GetString(this.readBuffer, start + 1, length - 1); + return; + } + if (b == 3 && Main.netMode == 1) + { + if (Netplay.clientSock.state == 1) + { + Netplay.clientSock.state = 2; + } + int num2 = (int)this.readBuffer[start + 1]; + if (num2 != Main.myPlayer) + { + Main.player[num2] = (Player)Main.player[Main.myPlayer].Clone(); + Main.player[Main.myPlayer] = new Player(); + Main.player[num2].whoAmi = num2; + Main.myPlayer = num2; + } + NetMessage.SendData(4, -1, -1, Main.player[Main.myPlayer].name, Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(68, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(16, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(42, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + NetMessage.SendData(50, -1, -1, "", Main.myPlayer, 0f, 0f, 0f, 0); + for (int k = 0; k < 59; k++) + { + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].inventory[k].name, Main.myPlayer, (float)k, (float)Main.player[Main.myPlayer].inventory[k].prefix, 0f, 0); + } + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[0].name, Main.myPlayer, 59f, (float)Main.player[Main.myPlayer].armor[0].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[1].name, Main.myPlayer, 60f, (float)Main.player[Main.myPlayer].armor[1].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[2].name, Main.myPlayer, 61f, (float)Main.player[Main.myPlayer].armor[2].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[3].name, Main.myPlayer, 62f, (float)Main.player[Main.myPlayer].armor[3].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[4].name, Main.myPlayer, 63f, (float)Main.player[Main.myPlayer].armor[4].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[5].name, Main.myPlayer, 64f, (float)Main.player[Main.myPlayer].armor[5].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[6].name, Main.myPlayer, 65f, (float)Main.player[Main.myPlayer].armor[6].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[7].name, Main.myPlayer, 66f, (float)Main.player[Main.myPlayer].armor[7].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[8].name, Main.myPlayer, 67f, (float)Main.player[Main.myPlayer].armor[8].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[9].name, Main.myPlayer, 68f, (float)Main.player[Main.myPlayer].armor[9].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].armor[10].name, Main.myPlayer, 69f, (float)Main.player[Main.myPlayer].armor[10].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].dye[0].name, Main.myPlayer, 70f, (float)Main.player[Main.myPlayer].dye[0].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].dye[1].name, Main.myPlayer, 71f, (float)Main.player[Main.myPlayer].dye[1].prefix, 0f, 0); + NetMessage.SendData(5, -1, -1, Main.player[Main.myPlayer].dye[2].name, Main.myPlayer, 72f, (float)Main.player[Main.myPlayer].dye[2].prefix, 0f, 0); + NetMessage.SendData(6, -1, -1, "", 0, 0f, 0f, 0f, 0); + if (Netplay.clientSock.state == 2) + { + Netplay.clientSock.state = 3; + return; + } + } + else + { + if (b == 4) + { + bool flag = false; + int num3 = (int)this.readBuffer[start + 1]; + if (Main.netMode == 2) + { + num3 = this.whoAmI; + } + if (num3 == Main.myPlayer && !Main.ServerSideCharacter) + { + return; + } + int num4 = (int)this.readBuffer[start + 2]; + if (num4 >= 51) + { + num4 = 0; + } + Main.player[num3].hair = num4; + Main.player[num3].whoAmi = num3; + num += 2; + byte b2 = this.readBuffer[num]; + num++; + if (b2 == 1) + { + Main.player[num3].male = true; + } + else + { + Main.player[num3].male = false; + } + Main.player[num3].hairColor.R = this.readBuffer[num]; + num++; + Main.player[num3].hairColor.G = this.readBuffer[num]; + num++; + Main.player[num3].hairColor.B = this.readBuffer[num]; + num++; + Main.player[num3].skinColor.R = this.readBuffer[num]; + num++; + Main.player[num3].skinColor.G = this.readBuffer[num]; + num++; + Main.player[num3].skinColor.B = this.readBuffer[num]; + num++; + Main.player[num3].eyeColor.R = this.readBuffer[num]; + num++; + Main.player[num3].eyeColor.G = this.readBuffer[num]; + num++; + Main.player[num3].eyeColor.B = this.readBuffer[num]; + num++; + Main.player[num3].shirtColor.R = this.readBuffer[num]; + num++; + Main.player[num3].shirtColor.G = this.readBuffer[num]; + num++; + Main.player[num3].shirtColor.B = this.readBuffer[num]; + num++; + Main.player[num3].underShirtColor.R = this.readBuffer[num]; + num++; + Main.player[num3].underShirtColor.G = this.readBuffer[num]; + num++; + Main.player[num3].underShirtColor.B = this.readBuffer[num]; + num++; + Main.player[num3].pantsColor.R = this.readBuffer[num]; + num++; + Main.player[num3].pantsColor.G = this.readBuffer[num]; + num++; + Main.player[num3].pantsColor.B = this.readBuffer[num]; + num++; + Main.player[num3].shoeColor.R = this.readBuffer[num]; + num++; + Main.player[num3].shoeColor.G = this.readBuffer[num]; + num++; + Main.player[num3].shoeColor.B = this.readBuffer[num]; + num++; + byte difficulty = this.readBuffer[num]; + Main.player[num3].difficulty = difficulty; + num++; + string text = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + text = text.Trim(); + Main.player[num3].name = text.Trim(); + if (Main.netMode == 2) + { + if (Netplay.serverSock[this.whoAmI].state < 10) + { + for (int l = 0; l < 255; l++) + { + if (l != num3 && text == Main.player[l].name && Netplay.serverSock[l].active) + { + flag = true; + } + } + } + if (flag) + { + NetMessage.SendData(2, this.whoAmI, -1, text + " " + Lang.mp[5], 0, 0f, 0f, 0f, 0); + return; + } + if (text.Length > Player.nameLen) + { + NetMessage.SendData(2, this.whoAmI, -1, "Name is too long.", 0, 0f, 0f, 0f, 0); + return; + } + if (text == "") + { + NetMessage.SendData(2, this.whoAmI, -1, "Empty name.", 0, 0f, 0f, 0f, 0); + return; + } + Netplay.serverSock[this.whoAmI].oldName = text; + Netplay.serverSock[this.whoAmI].name = text; + NetMessage.SendData(4, -1, this.whoAmI, text, num3, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 5) + { + int num5 = (int)this.readBuffer[start + 1]; + if (Main.netMode == 2) + { + num5 = this.whoAmI; + } + if (num5 == Main.myPlayer && !Main.ServerSideCharacter) + { + return; + } + lock (Main.player[num5]) + { + int num6 = (int)this.readBuffer[start + 2]; + int stack = (int)BitConverter.ToInt16(this.readBuffer, start + 3); + byte b3 = this.readBuffer[start + 5]; + int type = (int)BitConverter.ToInt16(this.readBuffer, start + 6); + if (num6 < 59) + { + Main.player[num5].inventory[num6] = new Item(); + Main.player[num5].inventory[num6].netDefaults(type); + Main.player[num5].inventory[num6].stack = stack; + Main.player[num5].inventory[num6].Prefix((int)b3); + } + else + { + if (num6 >= 70 && num6 <= 72) + { + int num7 = num6 - 58 - 12; + Main.player[num5].dye[num7] = new Item(); + Main.player[num5].dye[num7].netDefaults(type); + Main.player[num5].dye[num7].stack = stack; + Main.player[num5].dye[num7].Prefix((int)b3); + } + else + { + Main.player[num5].armor[num6 - 58 - 1] = new Item(); + Main.player[num5].armor[num6 - 58 - 1].netDefaults(type); + Main.player[num5].armor[num6 - 58 - 1].stack = stack; + Main.player[num5].armor[num6 - 58 - 1].Prefix((int)b3); + } + } + if (Main.netMode == 2 && num5 == this.whoAmI) + { + NetMessage.SendData(5, -1, this.whoAmI, "", num5, (float)num6, (float)b3, 0f, 0); + } + return; + } + } + if (b == 6) + { + if (Main.netMode == 2) + { + if (Netplay.serverSock[this.whoAmI].state == 1) + { + Netplay.serverSock[this.whoAmI].state = 2; + } + NetMessage.SendData(7, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 7) + { + if (Main.netMode == 1) + { + Main.time = (double)BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.dayTime = false; + if (this.readBuffer[num] == 1) + { + Main.dayTime = true; + } + num++; + Main.moonPhase = (int)this.readBuffer[num]; + num++; + int num8 = (int)this.readBuffer[num]; + num++; + int num9 = (int)this.readBuffer[num]; + num++; + if (num8 == 1) + { + Main.bloodMoon = true; + } + else + { + Main.bloodMoon = false; + } + if (num9 == 1) + { + Main.eclipse = true; + } + else + { + Main.eclipse = false; + } + Main.maxTilesX = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.maxTilesY = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.spawnTileX = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.spawnTileY = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.worldSurface = (double)BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.rockLayer = (double)BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.worldID = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.moonType = (int)this.readBuffer[num]; + num++; + Main.treeX[0] = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.treeX[1] = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.treeX[2] = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.treeStyle[0] = (int)this.readBuffer[num]; + num++; + Main.treeStyle[1] = (int)this.readBuffer[num]; + num++; + Main.treeStyle[2] = (int)this.readBuffer[num]; + num++; + Main.treeStyle[3] = (int)this.readBuffer[num]; + num++; + Main.caveBackX[0] = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.caveBackX[1] = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.caveBackX[2] = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.caveBackStyle[0] = (int)this.readBuffer[num]; + num++; + Main.caveBackStyle[1] = (int)this.readBuffer[num]; + num++; + Main.caveBackStyle[2] = (int)this.readBuffer[num]; + num++; + Main.caveBackStyle[3] = (int)this.readBuffer[num]; + num++; + byte style = this.readBuffer[num]; + num++; + byte style2 = this.readBuffer[num]; + num++; + byte style3 = this.readBuffer[num]; + num++; + byte style4 = this.readBuffer[num]; + num++; + byte style5 = this.readBuffer[num]; + num++; + byte style6 = this.readBuffer[num]; + num++; + byte style7 = this.readBuffer[num]; + num++; + byte style8 = this.readBuffer[num]; + num++; + WorldGen.setBG(0, (int)style); + WorldGen.setBG(1, (int)style2); + WorldGen.setBG(2, (int)style3); + WorldGen.setBG(3, (int)style4); + WorldGen.setBG(4, (int)style5); + WorldGen.setBG(5, (int)style6); + WorldGen.setBG(6, (int)style7); + WorldGen.setBG(7, (int)style8); + Main.iceBackStyle = (int)this.readBuffer[num]; + num++; + Main.jungleBackStyle = (int)this.readBuffer[num]; + num++; + Main.hellBackStyle = (int)this.readBuffer[num]; + num++; + Main.windSpeedSet = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + Main.numClouds = (int)this.readBuffer[num]; + num++; + byte b4 = this.readBuffer[num]; + num++; + byte b5 = this.readBuffer[num]; + num++; + float num10 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + Main.maxRaining = num10; + if (num10 > 0f) + { + Main.raining = true; + } + else + { + Main.raining = false; + } + bool flag3 = false; + bool crimson = false; + if ((b4 & 1) == 1) + { + WorldGen.shadowOrbSmashed = true; + } + if ((b4 & 2) == 2) + { + NPC.downedBoss1 = true; + } + if ((b4 & 4) == 4) + { + NPC.downedBoss2 = true; + } + if ((b4 & 8) == 8) + { + NPC.downedBoss3 = true; + } + if ((b4 & 16) == 16) + { + Main.hardMode = true; + } + if ((b4 & 32) == 32) + { + NPC.downedClown = true; + } + if ((b4 & 64) == 64) + { + Main.ServerSideCharacter = true; + } + if ((b4 & 128) == 128) + { + NPC.downedPlantBoss = true; + } + if ((b5 & 1) == 1) + { + NPC.downedMechBoss1 = true; + } + if ((b5 & 2) == 2) + { + NPC.downedMechBoss2 = true; + } + if ((b5 & 4) == 4) + { + NPC.downedMechBoss3 = true; + } + if ((b5 & 8) == 8) + { + NPC.downedMechBossAny = true; + } + if ((b5 & 16) == 16) + { + flag3 = true; + } + if ((b5 & 32) == 32) + { + crimson = true; + } + if (flag3) + { + Main.cloudBGActive = 1f; + } + if (!flag3) + { + Main.cloudBGActive = 0f; + } + WorldGen.crimson = crimson; + Main.worldName = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + if (Netplay.clientSock.state == 3) + { + Netplay.clientSock.state = 4; + return; + } + } + } + else + { + if (b == 8) + { + if (Main.netMode == 2) + { + int num11 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num12 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + bool flag4 = true; + if (num11 == -1 || num12 == -1) + { + flag4 = false; + } + else + { + if (num11 < 10 || num11 > Main.maxTilesX - 10) + { + flag4 = false; + } + else + { + if (num12 < 10 || num12 > Main.maxTilesY - 10) + { + flag4 = false; + } + } + } + int num13 = 1350; + if (flag4) + { + num13 *= 2; + } + if (Netplay.serverSock[this.whoAmI].state == 2) + { + Netplay.serverSock[this.whoAmI].state = 3; + } + NetMessage.SendData(9, this.whoAmI, -1, Lang.inter[44], num13, 0f, 0f, 0f, 0); + Netplay.serverSock[this.whoAmI].statusText2 = "is receiving tile data"; + Netplay.serverSock[this.whoAmI].statusMax += num13; + int sectionX = Netplay.GetSectionX(Main.spawnTileX); + int sectionY = Netplay.GetSectionY(Main.spawnTileY); + for (int m = sectionX - 2; m < sectionX + 3; m++) + { + for (int n = sectionY - 1; n < sectionY + 2; n++) + { + NetMessage.SendSection(this.whoAmI, m, n); + } + } + if (flag4) + { + num11 = Netplay.GetSectionX(num11); + num12 = Netplay.GetSectionY(num12); + for (int num14 = num11 - 2; num14 < num11 + 3; num14++) + { + for (int num15 = num12 - 1; num15 < num12 + 2; num15++) + { + NetMessage.SendSection(this.whoAmI, num14, num15); + } + } + NetMessage.SendData(11, this.whoAmI, -1, "", num11 - 2, (float)(num12 - 1), (float)(num11 + 2), (float)(num12 + 1), 0); + } + NetMessage.SendData(11, this.whoAmI, -1, "", sectionX - 2, (float)(sectionY - 1), (float)(sectionX + 2), (float)(sectionY + 1), 0); + for (int num16 = 0; num16 < 400; num16++) + { + if (Main.item[num16].active) + { + NetMessage.SendData(21, this.whoAmI, -1, "", num16, 0f, 0f, 0f, 0); + NetMessage.SendData(22, this.whoAmI, -1, "", num16, 0f, 0f, 0f, 0); + } + } + for (int num17 = 0; num17 < 200; num17++) + { + if (Main.npc[num17].active) + { + NetMessage.SendData(23, this.whoAmI, -1, "", num17, 0f, 0f, 0f, 0); + } + } + for (int num18 = 0; num18 < 1000; num18++) + { + if (Main.projectile[num18].active && (Main.projPet[Main.projectile[num18].type] || Main.projectile[num18].netImportant)) + { + NetMessage.SendData(27, this.whoAmI, -1, "", num18, 0f, 0f, 0f, 0); + } + } + NetMessage.SendData(49, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + NetMessage.SendData(57, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 17, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 18, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 19, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 20, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 22, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 38, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 54, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 107, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 108, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 124, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 160, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 178, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 207, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 208, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 209, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 227, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 228, 0f, 0f, 0f, 0); + NetMessage.SendData(56, this.whoAmI, -1, "", 229, 0f, 0f, 0f, 0); + NetMessage.SendData(7, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 9) + { + if (Main.netMode == 1) + { + int num19 = BitConverter.ToInt32(this.readBuffer, start + 1); + string string2 = Encoding.UTF8.GetString(this.readBuffer, start + 5, length - 5); + Netplay.clientSock.statusMax += num19; + Netplay.clientSock.statusText = string2; + return; + } + } + else + { + if (b == 10 && Main.netMode == 1) + { + short num20 = BitConverter.ToInt16(this.readBuffer, start + 1); + int num21 = BitConverter.ToInt32(this.readBuffer, start + 3); + int num22 = BitConverter.ToInt32(this.readBuffer, start + 7); + num = start + 11; + for (int num23 = num21; num23 < num21 + (int)num20; num23++) + { + if (Main.tile[num23, num22] == null) + { + Main.tile[num23, num22] = new Tile(); + } + byte b6 = this.readBuffer[num]; + num++; + byte b7 = this.readBuffer[num]; + num++; + bool flag5 = Main.tile[num23, num22].active(); + if ((b6 & 1) == 1) + { + Main.tile[num23, num22].active(true); + } + else + { + Main.tile[num23, num22].active(false); + } + byte arg_1BFD_0 = (byte)(b6 & 2); + if ((b6 & 4) == 4) + { + Main.tile[num23, num22].wall = 1; + } + else + { + Main.tile[num23, num22].wall = 0; + } + if ((b6 & 8) == 8) + { + Main.tile[num23, num22].liquid = 1; + } + else + { + Main.tile[num23, num22].liquid = 0; + } + if ((b6 & 16) == 16) + { + Main.tile[num23, num22].wire(true); + } + else + { + Main.tile[num23, num22].wire(false); + } + if ((b6 & 32) == 32) + { + Main.tile[num23, num22].halfBrick(true); + } + else + { + Main.tile[num23, num22].halfBrick(false); + } + if ((b6 & 64) == 64) + { + Main.tile[num23, num22].actuator(true); + } + else + { + Main.tile[num23, num22].actuator(false); + } + if ((b6 & 128) == 128) + { + Main.tile[num23, num22].inActive(true); + } + else + { + Main.tile[num23, num22].inActive(false); + } + if ((b7 & 1) == 1) + { + Main.tile[num23, num22].wire2(true); + } + else + { + Main.tile[num23, num22].wire2(false); + } + if ((b7 & 2) == 2) + { + Main.tile[num23, num22].wire3(true); + } + else + { + Main.tile[num23, num22].wire3(false); + } + if ((b7 & 4) == 4) + { + Main.tile[num23, num22].color(this.readBuffer[num]); + num++; + } + else + { + Main.tile[num23, num22].color(0); + } + if ((b7 & 8) == 8) + { + Main.tile[num23, num22].wallColor(this.readBuffer[num]); + num++; + } + else + { + Main.tile[num23, num22].wallColor(0); + } + if (Main.tile[num23, num22].active()) + { + int type2 = (int)Main.tile[num23, num22].type; + Main.tile[num23, num22].type = this.readBuffer[num]; + num++; + if (Main.tileFrameImportant[(int)Main.tile[num23, num22].type]) + { + Main.tile[num23, num22].frameX = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + Main.tile[num23, num22].frameY = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + } + else + { + if (!flag5 || (int)Main.tile[num23, num22].type != type2) + { + Main.tile[num23, num22].frameX = -1; + Main.tile[num23, num22].frameY = -1; + } + } + byte b8 = 0; + if ((b7 & 16) == 16) + { + b8 += 1; + } + if ((b7 & 32) == 32) + { + b8 += 2; + } + Main.tile[num23, num22].slope(b8); + } + if (Main.tile[num23, num22].wall > 0) + { + Main.tile[num23, num22].wall = this.readBuffer[num]; + num++; + } + if (Main.tile[num23, num22].liquid > 0) + { + Main.tile[num23, num22].liquid = this.readBuffer[num]; + num++; + byte liquidType = this.readBuffer[num]; + num++; + Main.tile[num23, num22].liquidType((int)liquidType); + } + short num24 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int num25 = num23; + while (num24 > 0) + { + num25++; + num24 -= 1; + if (Main.tile[num25, num22] == null) + { + Main.tile[num25, num22] = new Tile(); + } + Main.tile[num25, num22].active(Main.tile[num23, num22].active()); + Main.tile[num25, num22].type = Main.tile[num23, num22].type; + Main.tile[num25, num22].wall = Main.tile[num23, num22].wall; + Main.tile[num25, num22].wire(Main.tile[num23, num22].wire()); + if (Main.tileFrameImportant[(int)Main.tile[num25, num22].type]) + { + Main.tile[num25, num22].frameX = Main.tile[num23, num22].frameX; + Main.tile[num25, num22].frameY = Main.tile[num23, num22].frameY; + } + else + { + Main.tile[num25, num22].frameX = -1; + Main.tile[num25, num22].frameY = -1; + } + Main.tile[num25, num22].liquid = Main.tile[num23, num22].liquid; + Main.tile[num25, num22].liquidType((int)Main.tile[num23, num22].liquidType()); + Main.tile[num25, num22].halfBrick(Main.tile[num23, num22].halfBrick()); + Main.tile[num25, num22].slope(Main.tile[num23, num22].slope()); + Main.tile[num25, num22].actuator(Main.tile[num23, num22].actuator()); + Main.tile[num25, num22].inActive(Main.tile[num23, num22].inActive()); + Main.tile[num25, num22].wire2(Main.tile[num23, num22].wire2()); + Main.tile[num25, num22].wire3(Main.tile[num23, num22].wire3()); + Main.tile[num25, num22].color(Main.tile[num23, num22].color()); + Main.tile[num25, num22].wallColor(Main.tile[num23, num22].wallColor()); + } + num23 = num25; + } + if (Main.netMode == 2) + { + NetMessage.SendData((int)b, -1, this.whoAmI, "", (int)num20, (float)num21, (float)num22, 0f, 0); + return; + } + } + else + { + if (b == 11) + { + if (Main.netMode == 1) + { + int startX = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 4; + int startY = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 4; + int endX = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 4; + int endY = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 4; + WorldGen.SectionTileFrame(startX, startY, endX, endY); + return; + } + } + else + { + if (b == 12) + { + int num26 = (int)this.readBuffer[num]; + if (Main.netMode == 2) + { + num26 = this.whoAmI; + } + num++; + Main.player[num26].SpawnX = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.player[num26].SpawnY = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + Main.player[num26].Spawn(); + if (Main.netMode == 2 && Netplay.serverSock[this.whoAmI].state >= 3) + { + if (Netplay.serverSock[this.whoAmI].state == 3) + { + Netplay.serverSock[this.whoAmI].state = 10; + NetMessage.greetPlayer(this.whoAmI); + NetMessage.buffer[this.whoAmI].broadcast = true; + NetMessage.syncPlayers(); + NetMessage.SendData(12, -1, this.whoAmI, "", this.whoAmI, 0f, 0f, 0f, 0); + return; + } + NetMessage.SendData(12, -1, this.whoAmI, "", this.whoAmI, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 13) + { + int num27 = (int)this.readBuffer[num]; + if (num27 == Main.myPlayer && !Main.ServerSideCharacter) + { + return; + } + if (Main.netMode == 1) + { + bool arg_24C7_0 = Main.player[num27].active; + } + if (Main.netMode == 2) + { + num27 = this.whoAmI; + } + num++; + int num28 = (int)this.readBuffer[num]; + num++; + int selectedItem = (int)this.readBuffer[num]; + num++; + float x = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float num29 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float x2 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float y = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + byte b9 = this.readBuffer[num]; + num++; + Main.player[num27].selectedItem = selectedItem; + Main.player[num27].position.X = x; + Main.player[num27].position.Y = num29; + Main.player[num27].velocity.X = x2; + Main.player[num27].velocity.Y = y; + Main.player[num27].oldVelocity = Main.player[num27].velocity; + Main.player[num27].fallStart = (int)(num29 / 16f); + Main.player[num27].controlUp = false; + Main.player[num27].controlDown = false; + Main.player[num27].controlLeft = false; + Main.player[num27].controlRight = false; + Main.player[num27].controlJump = false; + Main.player[num27].controlUseItem = false; + Main.player[num27].direction = -1; + if ((num28 & 1) == 1) + { + Main.player[num27].controlUp = true; + } + if ((num28 & 2) == 2) + { + Main.player[num27].controlDown = true; + } + if ((num28 & 4) == 4) + { + Main.player[num27].controlLeft = true; + } + if ((num28 & 8) == 8) + { + Main.player[num27].controlRight = true; + } + if ((num28 & 16) == 16) + { + Main.player[num27].controlJump = true; + } + if ((num28 & 32) == 32) + { + Main.player[num27].controlUseItem = true; + } + if ((num28 & 64) == 64) + { + Main.player[num27].direction = 1; + } + if ((b9 & 1) == 1) + { + Main.player[num27].pulley = true; + if ((b9 & 2) == 2) + { + Main.player[num27].pulleyDir = 2; + } + else + { + Main.player[num27].pulleyDir = 1; + } + } + else + { + Main.player[num27].pulley = false; + } + if (Main.netMode == 2 && Netplay.serverSock[this.whoAmI].state == 10) + { + NetMessage.SendData(13, -1, this.whoAmI, "", num27, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 14) + { + if (Main.netMode == 1) + { + int num30 = (int)this.readBuffer[num]; + num++; + int num31 = (int)this.readBuffer[num]; + if (num31 == 1) + { + if (!Main.player[num30].active) + { + Main.player[num30] = new Player(); + } + Main.player[num30].active = true; + return; + } + Main.player[num30].active = false; + return; + } + } + else + { + if (b == 15) + { + if (Main.netMode == 2) + { + return; + } + } + else + { + if (b == 16) + { + int num32 = (int)this.readBuffer[num]; + num++; + if (num32 == Main.myPlayer && !Main.ServerSideCharacter) + { + return; + } + int statLife = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int num33 = (int)BitConverter.ToInt16(this.readBuffer, num); + if (Main.netMode == 2) + { + num32 = this.whoAmI; + } + Main.player[num32].statLife = statLife; + if (num33 < 100) + { + num33 = 100; + } + Main.player[num32].statLifeMax = num33; + if (Main.player[num32].statLife <= 0) + { + Main.player[num32].dead = true; + } + if (Main.netMode == 2) + { + NetMessage.SendData(16, -1, this.whoAmI, "", num32, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 17) + { + byte b10 = this.readBuffer[num]; + num++; + int num34 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num35 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + byte b11 = this.readBuffer[num]; + num++; + int num36 = (int)this.readBuffer[num]; + bool flag6 = false; + if (b11 == 1) + { + flag6 = true; + } + if (Main.tile[num34, num35] == null) + { + Main.tile[num34, num35] = new Tile(); + } + if (Main.netMode == 2) + { + if (!flag6) + { + if (b10 == 0 || b10 == 2 || b10 == 4) + { + Netplay.serverSock[this.whoAmI].spamDelBlock += 1f; + } + else + { + if (b10 == 1 || b10 == 3) + { + Netplay.serverSock[this.whoAmI].spamAddBlock += 1f; + } + } + } + if (!Netplay.serverSock[this.whoAmI].tileSection[Netplay.GetSectionX(num34), Netplay.GetSectionY(num35)]) + { + flag6 = true; + } + } + if (b10 == 0) + { + WorldGen.KillTile(num34, num35, flag6, false, false); + } + else + { + if (b10 == 1) + { + WorldGen.PlaceTile(num34, num35, (int)b11, false, true, -1, num36); + } + else + { + if (b10 == 2) + { + WorldGen.KillWall(num34, num35, flag6); + } + else + { + if (b10 == 3) + { + WorldGen.PlaceWall(num34, num35, (int)b11, false); + } + else + { + if (b10 == 4) + { + WorldGen.KillTile(num34, num35, flag6, false, true); + } + else + { + if (b10 == 5) + { + WorldGen.PlaceWire(num34, num35); + } + else + { + if (b10 == 6) + { + WorldGen.KillWire(num34, num35); + } + else + { + if (b10 == 7) + { + WorldGen.PoundTile(num34, num35); + } + else + { + if (b10 == 8) + { + WorldGen.PlaceActuator(num34, num35); + } + else + { + if (b10 == 9) + { + WorldGen.KillActuator(num34, num35); + } + else + { + if (b10 == 10) + { + WorldGen.PlaceWire2(num34, num35); + } + else + { + if (b10 == 11) + { + WorldGen.KillWire2(num34, num35); + } + else + { + if (b10 == 12) + { + WorldGen.PlaceWire3(num34, num35); + } + else + { + if (b10 == 13) + { + WorldGen.KillWire3(num34, num35); + } + else + { + if (b10 == 14) + { + WorldGen.SlopeTile(num34, num35, (int)b11); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(17, -1, this.whoAmI, "", (int)b10, (float)num34, (float)num35, (float)b11, num36); + if (b10 == 1 && b11 == 53) + { + NetMessage.SendTileSquare(-1, num34, num35, 1); + return; + } + } + } + else + { + if (b == 18) + { + if (Main.netMode == 1) + { + byte b12 = this.readBuffer[num]; + num++; + int num37 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + short sunModY = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + short moonModY = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + if (b12 == 1) + { + Main.dayTime = true; + } + else + { + Main.dayTime = false; + } + Main.time = (double)num37; + Main.sunModY = sunModY; + Main.moonModY = moonModY; + if (Main.netMode == 2) + { + NetMessage.SendData(18, -1, this.whoAmI, "", 0, 0f, 0f, 0f, 0); + return; + } + } + } + else + { + if (b == 19) + { + byte b13 = this.readBuffer[num]; + num++; + int num38 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num39 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num40 = (int)this.readBuffer[num]; + int direction = 0; + if (num40 == 0) + { + direction = -1; + } + if (b13 == 0) + { + WorldGen.OpenDoor(num38, num39, direction); + } + else + { + if (b13 == 1) + { + WorldGen.CloseDoor(num38, num39, true); + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(19, -1, this.whoAmI, "", (int)b13, (float)num38, (float)num39, (float)num40, 0); + return; + } + } + else + { + if (b == 20) + { + short num41 = BitConverter.ToInt16(this.readBuffer, start + 1); + int num42 = BitConverter.ToInt32(this.readBuffer, start + 3); + int num43 = BitConverter.ToInt32(this.readBuffer, start + 7); + num = start + 11; + for (int num44 = num42; num44 < num42 + (int)num41; num44++) + { + for (int num45 = num43; num45 < num43 + (int)num41; num45++) + { + if (Main.tile[num44, num45] == null) + { + Main.tile[num44, num45] = new Tile(); + } + byte b14 = this.readBuffer[num]; + num++; + byte b15 = this.readBuffer[num]; + num++; + bool flag7 = Main.tile[num44, num45].active(); + if ((b14 & 1) == 1) + { + Main.tile[num44, num45].active(true); + } + else + { + Main.tile[num44, num45].active(false); + } + if ((b14 & 4) == 4) + { + Main.tile[num44, num45].wall = 1; + } + else + { + Main.tile[num44, num45].wall = 0; + } + bool flag8 = false; + if ((b14 & 8) == 8) + { + flag8 = true; + } + if (Main.netMode != 2) + { + if (flag8) + { + Main.tile[num44, num45].liquid = 1; + } + else + { + Main.tile[num44, num45].liquid = 0; + } + } + if ((b14 & 16) == 16) + { + Main.tile[num44, num45].wire(true); + } + else + { + Main.tile[num44, num45].wire(false); + } + if ((b14 & 32) == 32) + { + Main.tile[num44, num45].halfBrick(true); + } + else + { + Main.tile[num44, num45].halfBrick(false); + } + if ((b14 & 64) == 64) + { + Main.tile[num44, num45].actuator(true); + } + else + { + Main.tile[num44, num45].actuator(false); + } + if ((b14 & 128) == 128) + { + Main.tile[num44, num45].inActive(true); + } + else + { + Main.tile[num44, num45].inActive(false); + } + if ((b15 & 1) == 1) + { + Main.tile[num44, num45].wire2(true); + } + else + { + Main.tile[num44, num45].wire2(false); + } + if ((b15 & 2) == 2) + { + Main.tile[num44, num45].wire3(true); + } + else + { + Main.tile[num44, num45].wire3(false); + } + if ((b15 & 4) == 4) + { + Main.tile[num44, num45].color(this.readBuffer[num]); + num++; + } + if ((b15 & 8) == 8) + { + Main.tile[num44, num45].wallColor(this.readBuffer[num]); + num++; + } + if (Main.tile[num44, num45].active()) + { + int type3 = (int)Main.tile[num44, num45].type; + Main.tile[num44, num45].type = this.readBuffer[num]; + num++; + if (Main.tileFrameImportant[(int)Main.tile[num44, num45].type]) + { + Main.tile[num44, num45].frameX = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + Main.tile[num44, num45].frameY = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + } + else + { + if (!flag7 || (int)Main.tile[num44, num45].type != type3) + { + Main.tile[num44, num45].frameX = -1; + Main.tile[num44, num45].frameY = -1; + } + } + byte b16 = 0; + if ((b15 & 16) == 16) + { + b16 += 1; + } + if ((b15 & 32) == 32) + { + b16 += 2; + } + Main.tile[num44, num45].slope(b16); + } + if (Main.tile[num44, num45].wall > 0) + { + Main.tile[num44, num45].wall = this.readBuffer[num]; + num++; + } + if (flag8) + { + Main.tile[num44, num45].liquid = this.readBuffer[num]; + num++; + byte liquidType2 = this.readBuffer[num]; + num++; + Main.tile[num44, num45].liquidType((int)liquidType2); + } + } + } + WorldGen.RangeFrame(num42, num43, num42 + (int)num41, num43 + (int)num41); + if (Main.netMode == 2) + { + NetMessage.SendData((int)b, -1, this.whoAmI, "", (int)num41, (float)num42, (float)num43, 0f, 0); + return; + } + } + else + { + if (b == 21) + { + short num46 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + float num47 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float num48 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float x3 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float y2 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + short stack2 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte pre = this.readBuffer[num]; + num++; + byte b17 = this.readBuffer[num]; + num++; + short num49 = BitConverter.ToInt16(this.readBuffer, num); + if (Main.netMode == 1) + { + if (num49 == 0) + { + Main.item[(int)num46].active = false; + return; + } + Main.item[(int)num46].netDefaults((int)num49); + Main.item[(int)num46].Prefix((int)pre); + Main.item[(int)num46].stack = (int)stack2; + Main.item[(int)num46].position.X = num47; + Main.item[(int)num46].position.Y = num48; + Main.item[(int)num46].velocity.X = x3; + Main.item[(int)num46].velocity.Y = y2; + Main.item[(int)num46].active = true; + Main.item[(int)num46].wet = Collision.WetCollision(Main.item[(int)num46].position, Main.item[(int)num46].width, Main.item[(int)num46].height); + return; + } + else + { + if (num49 == 0) + { + if (num46 < 400) + { + Main.item[(int)num46].active = false; + NetMessage.SendData(21, -1, -1, "", (int)num46, 0f, 0f, 0f, 0); + return; + } + } + else + { + bool flag9 = false; + if (num46 == 400) + { + flag9 = true; + } + if (flag9) + { + Item item = new Item(); + item.netDefaults((int)num49); + num46 = (short)Item.NewItem((int)num47, (int)num48, item.width, item.height, item.type, (int)stack2, true, 0, false); + } + Main.item[(int)num46].netDefaults((int)num49); + Main.item[(int)num46].Prefix((int)pre); + Main.item[(int)num46].stack = (int)stack2; + Main.item[(int)num46].position.X = num47; + Main.item[(int)num46].position.Y = num48; + Main.item[(int)num46].velocity.X = x3; + Main.item[(int)num46].velocity.Y = y2; + Main.item[(int)num46].active = true; + Main.item[(int)num46].owner = Main.myPlayer; + if (flag9) + { + NetMessage.SendData(21, -1, -1, "", (int)num46, 0f, 0f, 0f, 0); + if (b17 == 0) + { + Main.item[(int)num46].ownIgnore = this.whoAmI; + Main.item[(int)num46].ownTime = 100; + } + Main.item[(int)num46].FindOwner((int)num46); + return; + } + NetMessage.SendData(21, -1, this.whoAmI, "", (int)num46, 0f, 0f, 0f, 0); + return; + } + } + } + else + { + if (b == 22) + { + short num50 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b18 = this.readBuffer[num]; + if (Main.netMode == 2 && Main.item[(int)num50].owner != this.whoAmI) + { + return; + } + Main.item[(int)num50].owner = (int)b18; + if ((int)b18 == Main.myPlayer) + { + Main.item[(int)num50].keepTime = 15; + } + else + { + Main.item[(int)num50].keepTime = 0; + } + if (Main.netMode == 2) + { + Main.item[(int)num50].owner = 255; + Main.item[(int)num50].keepTime = 15; + NetMessage.SendData(22, -1, -1, "", (int)num50, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 23 && Main.netMode == 1) + { + short num51 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + float x4 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float y3 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float x5 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float y4 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + int target = (int)this.readBuffer[num]; + num++; + byte b19 = this.readBuffer[num]; + num++; + int direction2 = -1; + int directionY = -1; + if ((b19 & 1) == 1) + { + direction2 = 1; + } + if ((b19 & 2) == 2) + { + directionY = 1; + } + bool[] array = new bool[4]; + if ((b19 & 4) == 4) + { + array[3] = true; + } + if ((b19 & 8) == 8) + { + array[2] = true; + } + if ((b19 & 16) == 16) + { + array[1] = true; + } + if ((b19 & 32) == 32) + { + array[0] = true; + } + int spriteDirection = -1; + if ((b19 & 64) == 64) + { + spriteDirection = 1; + } + int num52 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + float[] array2 = new float[NPC.maxAI]; + for (int num53 = 0; num53 < NPC.maxAI; num53++) + { + if (array[num53]) + { + array2[num53] = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + } + else + { + array2[num53] = 0f; + } + } + int num54 = (int)BitConverter.ToInt16(this.readBuffer, num); + int num55 = -1; + if (!Main.npc[(int)num51].active || Main.npc[(int)num51].netID != num54) + { + if (Main.npc[(int)num51].active) + { + num55 = Main.npc[(int)num51].type; + } + Main.npc[(int)num51].active = true; + Main.npc[(int)num51].netDefaults(num54); + } + Main.npc[(int)num51].position.X = x4; + Main.npc[(int)num51].position.Y = y3; + Main.npc[(int)num51].velocity.X = x5; + Main.npc[(int)num51].velocity.Y = y4; + Main.npc[(int)num51].target = target; + Main.npc[(int)num51].direction = direction2; + Main.npc[(int)num51].directionY = directionY; + Main.npc[(int)num51].spriteDirection = spriteDirection; + Main.npc[(int)num51].life = num52; + if (num52 <= 0) + { + Main.npc[(int)num51].active = false; + } + for (int num56 = 0; num56 < NPC.maxAI; num56++) + { + Main.npc[(int)num51].ai[num56] = array2[num56]; + } + if (num55 > -1 && num55 != Main.npc[(int)num51].type) + { + Main.npc[(int)num51].xForm(num55, Main.npc[(int)num51].type); + } + if (num54 == 262) + { + NPC.plantBoss = (int)num51; + } + if (num54 == 245) + { + NPC.golemBoss = (int)num51; + return; + } + } + else + { + if (b == 24) + { + short num57 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b20 = this.readBuffer[num]; + if (Main.netMode == 2) + { + b20 = (byte)this.whoAmI; + } + Main.npc[(int)num57].StrikeNPC(Main.player[(int)b20].inventory[Main.player[(int)b20].selectedItem].damage, Main.player[(int)b20].inventory[Main.player[(int)b20].selectedItem].knockBack, Main.player[(int)b20].direction, false, false); + if (Main.netMode == 2) + { + NetMessage.SendData(24, -1, this.whoAmI, "", (int)num57, (float)b20, 0f, 0f, 0); + NetMessage.SendData(23, -1, -1, "", (int)num57, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 25) + { + int num58 = (int)this.readBuffer[start + 1]; + if (Main.netMode == 2) + { + num58 = this.whoAmI; + } + byte b21 = this.readBuffer[start + 2]; + byte b22 = this.readBuffer[start + 3]; + byte b23 = this.readBuffer[start + 4]; + if (Main.netMode == 2) + { + b21 = 255; + b22 = 255; + b23 = 255; + } + string string3 = Encoding.UTF8.GetString(this.readBuffer, start + 5, length - 5); + if (Main.netMode == 1) + { + string newText = string3; + if (num58 < 255) + { + newText = "<" + Main.player[num58].name + "> " + string3; + Main.player[num58].chatText = string3; + Main.player[num58].chatShowTime = Main.chatLength / 2; + } + Main.NewText(newText, b21, b22, b23, false); + return; + } + if (Main.netMode == 2) + { + string text2 = string3.ToLower(); + if (text2 == Lang.mp[6] || text2 == Lang.mp[21]) + { + string text3 = ""; + for (int num59 = 0; num59 < 255; num59++) + { + if (Main.player[num59].active) + { + if (text3 == "") + { + text3 += Main.player[num59].name; + } + else + { + text3 = text3 + ", " + Main.player[num59].name; + } + } + } + NetMessage.SendData(25, this.whoAmI, -1, Lang.mp[7] + " " + text3 + ".", 255, 255f, 240f, 20f, 0); + return; + } + if (text2.Length >= 4 && text2.Substring(0, 4) == "/me ") + { + NetMessage.SendData(25, -1, -1, "*" + Main.player[this.whoAmI].name + " " + string3.Substring(4), 255, 200f, 100f, 0f, 0); + return; + } + if (text2 == Lang.mp[8]) + { + NetMessage.SendData(25, -1, -1, string.Concat(new object[] + { + "*", + Main.player[this.whoAmI].name, + " ", + Lang.mp[9], + " ", + Main.rand.Next(1, 101) + }), 255, 255f, 240f, 20f, 0); + return; + } + if (text2.Length >= 3 && text2.Substring(0, 3) == "/p ") + { + if (Main.player[this.whoAmI].team != 0) + { + for (int num60 = 0; num60 < 255; num60++) + { + if (Main.player[num60].team == Main.player[this.whoAmI].team) + { + NetMessage.SendData(25, num60, -1, string3.Substring(3), num58, (float)Main.teamColor[Main.player[this.whoAmI].team].R, (float)Main.teamColor[Main.player[this.whoAmI].team].G, (float)Main.teamColor[Main.player[this.whoAmI].team].B, 0); + } + } + return; + } + NetMessage.SendData(25, this.whoAmI, -1, Lang.mp[10], 255, 255f, 240f, 20f, 0); + return; + } + else + { + if (Main.player[this.whoAmI].difficulty == 2) + { + b21 = Main.hcColor.R; + b22 = Main.hcColor.G; + b23 = Main.hcColor.B; + } + else + { + if (Main.player[this.whoAmI].difficulty == 1) + { + b21 = Main.mcColor.R; + b22 = Main.mcColor.G; + b23 = Main.mcColor.B; + } + } + NetMessage.SendData(25, -1, -1, string3, num58, (float)b21, (float)b22, (float)b23, 0); + if (Main.dedServ) + { + Console.WriteLine("<" + Main.player[this.whoAmI].name + "> " + string3); + return; + } + } + } + } + else + { + if (b == 26) + { + byte b24 = this.readBuffer[num]; + if (Main.netMode == 2 && this.whoAmI != (int)b24 && (!Main.player[(int)b24].hostile || !Main.player[this.whoAmI].hostile)) + { + return; + } + num++; + int num61 = (int)(this.readBuffer[num] - 1); + num++; + short num62 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b25 = this.readBuffer[num]; + num++; + bool pvp = false; + byte b26 = this.readBuffer[num]; + num++; + bool crit = false; + string string4 = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + if (b25 != 0) + { + pvp = true; + } + if (b26 != 0) + { + crit = true; + } + Main.player[(int)b24].Hurt((int)num62, num61, pvp, true, string4, crit); + if (Main.netMode == 2) + { + NetMessage.SendData(26, -1, this.whoAmI, string4, (int)b24, (float)num61, (float)num62, (float)b25, (int)b26); + return; + } + } + else + { + if (b == 27) + { + short num63 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + float x6 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float y5 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float x7 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float y6 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + float knockBack = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + short damage = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b27 = this.readBuffer[num]; + num++; + short num64 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + float[] array3 = new float[Projectile.maxAI]; + if (Main.netMode == 2) + { + b27 = (byte)this.whoAmI; + if (Main.projHostile[(int)num64]) + { + return; + } + } + for (int num65 = 0; num65 < Projectile.maxAI; num65++) + { + array3[num65] = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + } + int num66 = 1000; + for (int num67 = 0; num67 < 1000; num67++) + { + if (Main.projectile[num67].owner == (int)b27 && Main.projectile[num67].identity == (int)num63 && Main.projectile[num67].active) + { + num66 = num67; + break; + } + } + if (num66 == 1000) + { + for (int num68 = 0; num68 < 1000; num68++) + { + if (!Main.projectile[num68].active) + { + num66 = num68; + break; + } + } + } + if (!Main.projectile[num66].active || Main.projectile[num66].type != (int)num64) + { + Main.projectile[num66].SetDefaults((int)num64); + if (Main.netMode == 2) + { + Netplay.serverSock[this.whoAmI].spamProjectile += 1f; + } + } + Main.projectile[num66].identity = (int)num63; + Main.projectile[num66].position.X = x6; + Main.projectile[num66].position.Y = y5; + Main.projectile[num66].velocity.X = x7; + Main.projectile[num66].velocity.Y = y6; + Main.projectile[num66].damage = (int)damage; + Main.projectile[num66].type = (int)num64; + Main.projectile[num66].owner = (int)b27; + Main.projectile[num66].knockBack = knockBack; + for (int num69 = 0; num69 < Projectile.maxAI; num69++) + { + Main.projectile[num66].ai[num69] = array3[num69]; + } + if (Main.netMode == 2) + { + NetMessage.SendData(27, -1, this.whoAmI, "", num66, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 28) + { + short num70 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + short num71 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + float num72 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + int num73 = (int)(this.readBuffer[num] - 1); + num++; + int num74 = (int)this.readBuffer[num]; + if (num71 >= 0) + { + if (num74 == 1) + { + Main.npc[(int)num70].StrikeNPC((int)num71, num72, num73, true, false); + } + else + { + Main.npc[(int)num70].StrikeNPC((int)num71, num72, num73, false, false); + } + } + else + { + Main.npc[(int)num70].life = 0; + Main.npc[(int)num70].HitEffect(0, 10.0); + Main.npc[(int)num70].active = false; + } + if (Main.netMode == 2) + { + if (Main.npc[(int)num70].life <= 0) + { + NetMessage.SendData(28, -1, this.whoAmI, "", (int)num70, (float)num71, num72, (float)num73, num74); + NetMessage.SendData(23, -1, -1, "", (int)num70, 0f, 0f, 0f, 0); + return; + } + NetMessage.SendData(28, -1, this.whoAmI, "", (int)num70, (float)num71, num72, (float)num73, num74); + Main.npc[(int)num70].netUpdate = true; + return; + } + } + else + { + if (b == 29) + { + short num75 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b28 = this.readBuffer[num]; + if (Main.netMode == 2) + { + b28 = (byte)this.whoAmI; + } + for (int num76 = 0; num76 < 1000; num76++) + { + if (Main.projectile[num76].owner == (int)b28 && Main.projectile[num76].identity == (int)num75 && Main.projectile[num76].active) + { + Main.projectile[num76].Kill(); + break; + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(29, -1, this.whoAmI, "", (int)num75, (float)b28, 0f, 0f, 0); + return; + } + } + else + { + if (b == 30) + { + byte b29 = this.readBuffer[num]; + if (Main.netMode == 2) + { + b29 = (byte)this.whoAmI; + } + num++; + byte b30 = this.readBuffer[num]; + if (b30 == 1) + { + Main.player[(int)b29].hostile = true; + } + else + { + Main.player[(int)b29].hostile = false; + } + if (Main.netMode == 2) + { + NetMessage.SendData(30, -1, this.whoAmI, "", (int)b29, 0f, 0f, 0f, 0); + string str = " " + Lang.mp[11]; + if (b30 == 0) + { + str = " " + Lang.mp[12]; + } + NetMessage.SendData(25, -1, -1, Main.player[(int)b29].name + str, 255, (float)Main.teamColor[Main.player[(int)b29].team].R, (float)Main.teamColor[Main.player[(int)b29].team].G, (float)Main.teamColor[Main.player[(int)b29].team].B, 0); + return; + } + } + else + { + if (b == 31) + { + if (Main.netMode == 2) + { + int x8 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int y7 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num77 = Chest.FindChest(x8, y7); + if (num77 > -1 && Chest.UsingChest(num77) == -1) + { + for (int num78 = 0; num78 < Chest.maxItems; num78++) + { + NetMessage.SendData(32, this.whoAmI, -1, "", num77, (float)num78, 0f, 0f, 0); + } + NetMessage.SendData(33, this.whoAmI, -1, "", num77, 0f, 0f, 0f, 0); + Main.player[this.whoAmI].chest = num77; + return; + } + } + } + else + { + if (b == 32) + { + int num79 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int num80 = (int)this.readBuffer[num]; + num++; + int stack3 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int pre2 = (int)this.readBuffer[num]; + num++; + int type4 = (int)BitConverter.ToInt16(this.readBuffer, num); + if (Main.chest[num79] == null) + { + Main.chest[num79] = new Chest(); + } + if (Main.chest[num79].item[num80] == null) + { + Main.chest[num79].item[num80] = new Item(); + } + Main.chest[num79].item[num80].netDefaults(type4); + Main.chest[num79].item[num80].Prefix(pre2); + Main.chest[num79].item[num80].stack = stack3; + return; + } + if (b == 33) + { + int num81 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int chestX = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int chestY = BitConverter.ToInt32(this.readBuffer, num); + if (Main.netMode == 1) + { + if (Main.player[Main.myPlayer].chest == -1) + { + Main.playerInventory = true; + Main.PlaySound(10, -1, -1, 1); + } + else + { + if (Main.player[Main.myPlayer].chest != num81 && num81 != -1) + { + Main.playerInventory = true; + Main.PlaySound(12, -1, -1, 1); + } + else + { + if (Main.player[Main.myPlayer].chest != -1 && num81 == -1) + { + Main.PlaySound(11, -1, -1, 1); + } + } + } + Main.player[Main.myPlayer].chest = num81; + Main.player[Main.myPlayer].chestX = chestX; + Main.player[Main.myPlayer].chestY = chestY; + return; + } + Main.player[this.whoAmI].chest = num81; + return; + } + else + { + if (b == 34) + { + if (Main.netMode == 2) + { + int num82 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num83 = BitConverter.ToInt32(this.readBuffer, num); + if (Main.tile[num82, num83].type == 21) + { + WorldGen.KillTile(num82, num83, false, false, false); + if (!Main.tile[num82, num83].active()) + { + NetMessage.SendData(17, -1, -1, "", 0, (float)num82, (float)num83, 0f, 0); + return; + } + } + } + } + else + { + if (b == 35) + { + int num84 = (int)this.readBuffer[num]; + if (Main.netMode == 2) + { + num84 = this.whoAmI; + } + num++; + int num85 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + if (num84 != Main.myPlayer || Main.ServerSideCharacter) + { + Main.player[num84].HealEffect(num85, true); + } + if (Main.netMode == 2) + { + NetMessage.SendData(35, -1, this.whoAmI, "", num84, (float)num85, 0f, 0f, 0); + return; + } + } + else + { + if (b == 36) + { + int num86 = (int)this.readBuffer[num]; + if (Main.netMode == 2) + { + num86 = this.whoAmI; + } + num++; + byte b31 = this.readBuffer[num]; + num++; + if ((b31 & 1) == 1) + { + Main.player[num86].zoneEvil = true; + } + else + { + Main.player[num86].zoneEvil = false; + } + if ((b31 & 2) == 2) + { + Main.player[num86].zoneMeteor = true; + } + else + { + Main.player[num86].zoneMeteor = false; + } + if ((b31 & 4) == 4) + { + Main.player[num86].zoneDungeon = true; + } + else + { + Main.player[num86].zoneDungeon = false; + } + if ((b31 & 8) == 8) + { + Main.player[num86].zoneJungle = true; + } + else + { + Main.player[num86].zoneJungle = false; + } + if ((b31 & 16) == 16) + { + Main.player[num86].zoneHoly = true; + } + else + { + Main.player[num86].zoneHoly = false; + } + if ((b31 & 32) == 32) + { + Main.player[num86].zoneSnow = true; + } + else + { + Main.player[num86].zoneSnow = false; + } + if ((b31 & 64) == 64) + { + Main.player[num86].zoneBlood = true; + } + else + { + Main.player[num86].zoneBlood = false; + } + if ((b31 & 128) == 128) + { + Main.player[num86].zoneCandle = true; + } + else + { + Main.player[num86].zoneCandle = false; + } + if (Main.netMode == 2) + { + NetMessage.SendData(36, -1, this.whoAmI, "", num86, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 37) + { + if (Main.netMode == 1) + { + if (Main.autoPass) + { + NetMessage.SendData(38, -1, -1, Netplay.password, 0, 0f, 0f, 0f, 0); + Main.autoPass = false; + return; + } + Netplay.password = ""; + Main.menuMode = 31; + return; + } + } + else + { + if (b == 38) + { + if (Main.netMode == 2) + { + string string5 = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + if (string5 == Netplay.password) + { + Netplay.serverSock[this.whoAmI].state = 1; + NetMessage.SendData(3, this.whoAmI, -1, "", 0, 0f, 0f, 0f, 0); + return; + } + NetMessage.SendData(2, this.whoAmI, -1, Lang.mp[1], 0, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 39 && Main.netMode == 1) + { + short num87 = BitConverter.ToInt16(this.readBuffer, num); + Main.item[(int)num87].owner = 255; + NetMessage.SendData(22, -1, -1, "", (int)num87, 0f, 0f, 0f, 0); + return; + } + if (b == 40) + { + byte b32 = this.readBuffer[num]; + if (Main.netMode == 2) + { + b32 = (byte)this.whoAmI; + } + num++; + int talkNPC = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + Main.player[(int)b32].talkNPC = talkNPC; + if (Main.netMode == 2) + { + NetMessage.SendData(40, -1, this.whoAmI, "", (int)b32, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 41) + { + byte b33 = this.readBuffer[num]; + if (Main.netMode == 2) + { + b33 = (byte)this.whoAmI; + } + num++; + float itemRotation = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + int itemAnimation = (int)BitConverter.ToInt16(this.readBuffer, num); + Main.player[(int)b33].itemRotation = itemRotation; + Main.player[(int)b33].itemAnimation = itemAnimation; + Main.player[(int)b33].channel = Main.player[(int)b33].inventory[Main.player[(int)b33].selectedItem].channel; + if (Main.netMode == 2) + { + NetMessage.SendData(41, -1, this.whoAmI, "", (int)b33, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 42) + { + int num88 = (int)this.readBuffer[num]; + if (Main.netMode == 2) + { + num88 = this.whoAmI; + } + num++; + int statMana = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int statManaMax = (int)BitConverter.ToInt16(this.readBuffer, num); + if (Main.netMode == 2) + { + num88 = this.whoAmI; + } + else + { + if (Main.myPlayer == num88 && !Main.ServerSideCharacter) + { + return; + } + } + Main.player[num88].statMana = statMana; + Main.player[num88].statManaMax = statManaMax; + if (Main.netMode == 2) + { + NetMessage.SendData(42, -1, this.whoAmI, "", num88, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 43) + { + int num89 = (int)this.readBuffer[num]; + if (Main.netMode == 2) + { + num89 = this.whoAmI; + } + num++; + int num90 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + if (num89 != Main.myPlayer) + { + Main.player[num89].ManaEffect(num90); + } + if (Main.netMode == 2) + { + NetMessage.SendData(43, -1, this.whoAmI, "", num89, (float)num90, 0f, 0f, 0); + return; + } + } + else + { + if (b == 44) + { + byte b34 = this.readBuffer[num]; + if ((int)b34 == Main.myPlayer) + { + return; + } + if (Main.netMode == 2) + { + b34 = (byte)this.whoAmI; + } + num++; + int num91 = (int)(this.readBuffer[num] - 1); + num++; + short num92 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b35 = this.readBuffer[num]; + num++; + string string6 = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + bool pvp2 = false; + if (b35 != 0) + { + pvp2 = true; + } + Main.player[(int)b34].KillMe((double)num92, num91, pvp2, string6); + if (Main.netMode == 2) + { + NetMessage.SendData(44, -1, this.whoAmI, string6, (int)b34, (float)num91, (float)num92, (float)b35, 0); + return; + } + } + else + { + if (b == 45) + { + int num93 = (int)this.readBuffer[num]; + if (Main.netMode == 2) + { + num93 = this.whoAmI; + } + num++; + int num94 = (int)this.readBuffer[num]; + num++; + int team = Main.player[num93].team; + Main.player[num93].team = num94; + if (Main.netMode == 2) + { + NetMessage.SendData(45, -1, this.whoAmI, "", num93, 0f, 0f, 0f, 0); + string str2 = ""; + if (num94 == 0) + { + str2 = " " + Lang.mp[13]; + } + else + { + if (num94 == 1) + { + str2 = " " + Lang.mp[14]; + } + else + { + if (num94 == 2) + { + str2 = " " + Lang.mp[15]; + } + else + { + if (num94 == 3) + { + str2 = " " + Lang.mp[16]; + } + else + { + if (num94 == 4) + { + str2 = " " + Lang.mp[17]; + } + } + } + } + } + for (int num95 = 0; num95 < 255; num95++) + { + if (num95 == this.whoAmI || (team > 0 && Main.player[num95].team == team) || (num94 > 0 && Main.player[num95].team == num94)) + { + NetMessage.SendData(25, num95, -1, Main.player[num93].name + str2, 255, (float)Main.teamColor[num94].R, (float)Main.teamColor[num94].G, (float)Main.teamColor[num94].B, 0); + } + } + return; + } + } + else + { + if (b == 46) + { + if (Main.netMode == 2) + { + int i2 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int j2 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num96 = Sign.ReadSign(i2, j2); + if (num96 >= 0) + { + NetMessage.SendData(47, this.whoAmI, -1, "", num96, 0f, 0f, 0f, 0); + return; + } + } + } + else + { + if (b == 47) + { + int num97 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + int x9 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int y8 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + string string7 = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + Main.sign[num97] = new Sign(); + Main.sign[num97].x = x9; + Main.sign[num97].y = y8; + Sign.TextSign(num97, string7); + if (Main.netMode == 1 && Main.sign[num97] != null && num97 != Main.player[Main.myPlayer].sign) + { + Main.playerInventory = false; + Main.player[Main.myPlayer].talkNPC = -1; + Main.editSign = false; + Main.PlaySound(10, -1, -1, 1); + Main.player[Main.myPlayer].sign = num97; + Main.npcChatText = Main.sign[num97].text; + return; + } + } + else + { + if (b == 48) + { + int num98 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num99 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + byte liquid = this.readBuffer[num]; + num++; + byte liquidType3 = this.readBuffer[num]; + num++; + if (Main.netMode == 2 && Netplay.spamCheck) + { + int num100 = this.whoAmI; + int num101 = (int)(Main.player[num100].position.X + (float)(Main.player[num100].width / 2)); + int num102 = (int)(Main.player[num100].position.Y + (float)(Main.player[num100].height / 2)); + int num103 = 10; + int num104 = num101 - num103; + int num105 = num101 + num103; + int num106 = num102 - num103; + int num107 = num102 + num103; + if (num101 < num104 || num101 > num105 || num102 < num106 || num102 > num107) + { + NetMessage.BootPlayer(this.whoAmI, "Cheating attempt detected: Liquid spam"); + return; + } + } + if (Main.tile[num98, num99] == null) + { + Main.tile[num98, num99] = new Tile(); + } + lock (Main.tile[num98, num99]) + { + Main.tile[num98, num99].liquid = liquid; + Main.tile[num98, num99].liquidType((int)liquidType3); + if (Main.netMode == 2) + { + WorldGen.SquareTileFrame(num98, num99, true); + } + return; + } + } + if (b == 49) + { + if (Netplay.clientSock.state == 6) + { + Netplay.clientSock.state = 10; + Main.player[Main.myPlayer].Spawn(); + return; + } + } + else + { + if (b == 50) + { + int num108 = (int)this.readBuffer[num]; + num++; + if (Main.netMode == 2) + { + num108 = this.whoAmI; + } + else + { + if (num108 == Main.myPlayer && !Main.ServerSideCharacter) + { + return; + } + } + for (int num109 = 0; num109 < 10; num109++) + { + Main.player[num108].buffType[num109] = (int)this.readBuffer[num]; + if (Main.player[num108].buffType[num109] > 0) + { + Main.player[num108].buffTime[num109] = 60; + } + else + { + Main.player[num108].buffTime[num109] = 0; + } + num++; + } + if (Main.netMode == 2) + { + NetMessage.SendData(50, -1, this.whoAmI, "", num108, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 51) + { + byte b36 = this.readBuffer[num]; + num++; + byte b37 = this.readBuffer[num]; + if (b37 == 1) + { + NPC.SpawnSkeletron(); + return; + } + if (b37 == 2) + { + if (Main.netMode != 2) + { + Main.PlaySound(2, (int)Main.player[(int)b36].position.X, (int)Main.player[(int)b36].position.Y, 1); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(51, -1, this.whoAmI, "", (int)b36, (float)b37, 0f, 0f, 0); + return; + } + } + } + else + { + if (b == 52) + { + byte number = this.readBuffer[num]; + num++; + byte b38 = this.readBuffer[num]; + num++; + int num110 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num111 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + if (b38 == 1) + { + Chest.Unlock(num110, num111); + if (Main.netMode == 2) + { + NetMessage.SendData(52, -1, this.whoAmI, "", (int)number, (float)b38, (float)num110, (float)num111, 0); + NetMessage.SendTileSquare(-1, num110, num111, 2); + } + } + if (b38 == 2) + { + WorldGen.UnlockDoor(num110, num111); + if (Main.netMode == 2) + { + NetMessage.SendData(52, -1, this.whoAmI, "", (int)number, (float)b38, (float)num110, (float)num111, 0); + NetMessage.SendTileSquare(-1, num110, num111, 2); + return; + } + } + } + else + { + if (b == 53) + { + short num112 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte type5 = this.readBuffer[num]; + num++; + short time = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + Main.npc[(int)num112].AddBuff((int)type5, (int)time, true); + if (Main.netMode == 2) + { + NetMessage.SendData(54, -1, -1, "", (int)num112, 0f, 0f, 0f, 0); + return; + } + } + else + { + if (b == 54) + { + if (Main.netMode == 1) + { + short num113 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + for (int num114 = 0; num114 < 5; num114++) + { + Main.npc[(int)num113].buffType[num114] = (int)this.readBuffer[num]; + num++; + Main.npc[(int)num113].buffTime[num114] = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + } + return; + } + } + else + { + if (b == 55) + { + byte b39 = this.readBuffer[num]; + num++; + byte b40 = this.readBuffer[num]; + num++; + short num115 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + if (Main.netMode == 2 && (int)b39 != this.whoAmI && !Main.pvpBuff[(int)b40]) + { + return; + } + if (Main.netMode == 1 && (int)b39 == Main.myPlayer) + { + Main.player[(int)b39].AddBuff((int)b40, (int)num115, true); + return; + } + if (Main.netMode == 2) + { + NetMessage.SendData(55, (int)b39, -1, "", (int)b39, (float)b40, (float)num115, 0f, 0); + return; + } + } + else + { + if (b == 56) + { + if (Main.netMode == 1) + { + short num116 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + string string8 = Encoding.UTF8.GetString(this.readBuffer, num, length - num + start); + Main.chrName[(int)num116] = string8; + return; + } + } + else + { + if (b == 57) + { + if (Main.netMode == 1) + { + WorldGen.tGood = this.readBuffer[num]; + num++; + WorldGen.tEvil = this.readBuffer[num]; + return; + } + } + else + { + if (b == 58) + { + byte b41 = this.readBuffer[num]; + if (Main.netMode == 2) + { + b41 = (byte)this.whoAmI; + } + num++; + float num117 = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + if (Main.netMode == 2) + { + NetMessage.SendData(58, -1, this.whoAmI, "", this.whoAmI, num117, 0f, 0f, 0); + return; + } + Main.harpNote = num117; + int style9 = 26; + if (Main.player[(int)b41].inventory[Main.player[(int)b41].selectedItem].type == 507) + { + style9 = 35; + } + Main.PlaySound(2, (int)Main.player[(int)b41].position.X, (int)Main.player[(int)b41].position.Y, style9); + return; + } + else + { + if (b == 59) + { + int num118 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num119 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + WorldGen.hitSwitch(num118, num119); + if (Main.netMode == 2) + { + NetMessage.SendData(59, -1, this.whoAmI, "", num118, (float)num119, 0f, 0f, 0); + return; + } + } + else + { + if (b == 60) + { + short num120 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + short num121 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + short num122 = BitConverter.ToInt16(this.readBuffer, num); + num += 2; + byte b42 = this.readBuffer[num]; + num++; + bool homeless = false; + if (b42 == 1) + { + homeless = true; + } + if (Main.netMode == 1) + { + Main.npc[(int)num120].homeless = homeless; + Main.npc[(int)num120].homeTileX = (int)num121; + Main.npc[(int)num120].homeTileY = (int)num122; + return; + } + if (b42 == 0) + { + WorldGen.kickOut((int)num120); + return; + } + WorldGen.moveRoom((int)num121, (int)num122, (int)num120); + return; + } + else + { + if (b == 61) + { + int plr = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num123 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + if (Main.netMode == 2) + { + if (num123 == 4 || num123 == 13 || num123 == 50 || num123 == 125 || num123 == 126 || num123 == 134 || num123 == 127 || num123 == 128 || num123 == 222 || num123 == 245 || num123 == 266) + { + bool flag11 = true; + for (int num124 = 0; num124 < 200; num124++) + { + if (Main.npc[num124].active && Main.npc[num124].type == num123) + { + flag11 = false; + } + } + if (flag11) + { + NPC.SpawnOnPlayer(plr, num123); + return; + } + } + else + { + if (num123 < 0) + { + int num125 = -1; + if (num123 == -1) + { + num125 = 1; + } + if (num123 == -2) + { + num125 = 2; + } + if (num123 == -3) + { + num125 = 3; + } + if (num125 > 0 && Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(num125); + return; + } + } + } + } + } + else + { + if (b == 62) + { + int num126 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num127 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + if (Main.netMode == 2) + { + num126 = this.whoAmI; + } + if (num127 == 1) + { + Main.player[num126].NinjaDodge(); + } + if (num127 == 2) + { + Main.player[num126].ShadowDodge(); + } + if (Main.netMode == 2) + { + NetMessage.SendData(62, -1, this.whoAmI, "", num126, (float)num127, 0f, 0f, 0); + return; + } + } + else + { + if (b == 63) + { + int num128 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num129 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + byte b43 = this.readBuffer[num]; + WorldGen.paintTile(num128, num129, b43, false); + if (Main.netMode == 2) + { + NetMessage.SendData(63, -1, this.whoAmI, "", num128, (float)num129, (float)b43, 0f, 0); + return; + } + } + else + { + if (b == 64) + { + int num130 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + int num131 = BitConverter.ToInt32(this.readBuffer, num); + num += 4; + byte b44 = this.readBuffer[num]; + WorldGen.paintWall(num130, num131, b44, false); + if (Main.netMode == 2) + { + NetMessage.SendData(64, -1, this.whoAmI, "", num130, (float)num131, (float)b44, 0f, 0); + return; + } + } + else + { + if (b == 65) + { + byte b45 = this.readBuffer[num]; + num++; + short num132 = BitConverter.ToInt16(this.readBuffer, num); + if (Main.netMode == 2) + { + num132 = (short)this.whoAmI; + } + num += 2; + Vector2 newPos; + newPos.X = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + newPos.Y = BitConverter.ToSingle(this.readBuffer, num); + num += 4; + int num133 = 0; + int num134 = 0; + if ((b45 & 1) == 1) + { + num133++; + } + if ((b45 & 2) == 2) + { + num133 += 2; + } + if ((b45 & 4) == 4) + { + num134++; + } + if ((b45 & 8) == 8) + { + num134++; + } + if (num133 == 0) + { + Main.player[(int)num132].Teleport(newPos, num134); + } + else + { + if (num133 == 1) + { + Main.npc[(int)num132].Teleport(newPos, num134); + } + } + if (Main.netMode == 2 && num133 == 0) + { + NetMessage.SendData(65, -1, this.whoAmI, "", 0, (float)num132, newPos.X, newPos.Y, num134); + return; + } + } + else + { + if (b == 66) + { + int num135 = (int)this.readBuffer[num]; + num++; + int num136 = (int)BitConverter.ToInt16(this.readBuffer, num); + num += 2; + if (num136 > 0) + { + Main.player[num135].statLife += num136; + if (Main.player[num135].statLife > Main.player[num135].statLifeMax) + { + Main.player[num135].statLife = Main.player[num135].statLifeMax; + } + Main.player[num135].HealEffect(num136, false); + if (Main.netMode == 2) + { + NetMessage.SendData(66, -1, this.whoAmI, "", num135, (float)num136, 0f, 0f, 0); + return; + } + } + } + else + { + if (b == 67) + { + return; + } + if (b == 68) + { + Encoding.UTF8.GetString(this.readBuffer, start + 1, length - 1); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +}