29920 {
29922 {
29923 return;
29924 }
29927 {
29928 return;
29929 }
29930 bool flag2 =
false;
29932 {
29936 int num = Main.tile[
myX,
myY].frameX / 18;
29938 while (num >= 3)
29939 {
29941 num -= 3;
29942 }
29946 {
29947 }
29949 float num4 = 12f + (float)Main.rand.Next(450) * 0.01f;
29950 float num5 = Main.rand.Next(85, 105);
29951 float num6 = Main.rand.Next(-35, 11);
29953 int damage = 35;
29954 float knockBack = 3.5f;
29957 {
29959 vector.X -= 14f;
29960 vector.X -= 2f;
29961 }
29962 else
29963 {
29964 vector.X += 14f;
29965 }
29972 int num10 = Projectile.NewProjectile(
GetProjectileSource_TileInteraction(num,
num3),
vector.X,
vector.Y,
num7,
num8,
type, damage, knockBack, Main.myPlayer, -Main.rand.Next(0, 16));
29973 Main.projectile[
num10].originatedFromActivableTile =
true;
29974 }
29975 if (flag)
29976 {
29977 if (Main.tile[
myX,
myY].type == 132 || Main.tile[
myX,
myY].type == 136 || Main.tile[
myX,
myY].type == 144)
29978 {
29981 NetMessage.SendData(59, -1, -1,
null,
myX,
myY);
29982 }
29983 else if (Main.tile[
myX,
myY].type == 597)
29984 {
29987 }
29988 else if (Main.tile[
myX,
myY].type == 441 || Main.tile[
myX,
myY].type == 468)
29989 {
29993 {
29994 }
29997 Animation.NewTemporaryAnimation(2, Main.tile[
myX,
myY].type,
num11,
num12);
29998 NetMessage.SendTemporaryAnimation(-1, 2, Main.tile[
myX,
myY].type,
num11,
num12);
30000 NetMessage.SendData(59, -1, -1,
null,
myX,
myY);
30001 }
30002 else if (Main.tile[
myX,
myY].type == 139)
30003 {
30007 }
30008 else if (Main.tile[
myX,
myY].type == 215)
30009 {
30012 int num13 = Main.tile[
myX,
myY].frameX % 54 / 18;
30013 int num14 = Main.tile[
myX,
myY].frameY % 36 / 18;
30018 {
30020 }
30022 {
30024 {
30025 Main.tile[
i,
j].frameY = (
short)(Main.tile[i,
j].frameY +
num17);
30026 }
30027 }
30028 NetMessage.SendTileSquare(-1,
num15,
num16, 3, 2);
30029 }
30030 else if (Main.tile[
myX,
myY].type == 207)
30031 {
30035 }
30036 else if (Main.tile[
myX,
myY].type == 410 || Main.tile[
myX,
myY].type == 480 || Main.tile[
myX,
myY].type == 509 || Main.tile[
myX,
myY].type == 657 || Main.tile[
myX,
myY].type == 658)
30037 {
30042 }
30043 else if (Main.tile[
myX,
myY].type == 455)
30044 {
30049 }
30050 else if (Main.tile[
myX,
myY].type == 216)
30051 {
30054 }
30055 else if (Main.tile[
myX,
myY].type == 386 || Main.tile[
myX,
myY].type == 387)
30056 {
30061 {
30063 }
30065 {
30067 }
30068 }
30069 else if (Main.tile[
myX,
myY].type == 388 || Main.tile[
myX,
myY].type == 389)
30070 {
30074 {
30075 NetMessage.SendData(19, -1, -1,
null, 4 +
flag4.ToInt(),
myX,
myY);
30076 }
30077 }
30078 else if (Main.tile[
myX,
myY].type == 15 || Main.tile[
myX,
myY].type == 497)
30079 {
30081 {
30085 }
30086 }
30087 else if (Main.tile[
myX,
myY].type == 89 || Main.tile[
myX,
myY].type == 102 || Main.tile[
myX,
myY].type == 487)
30088 {
30090 {
30094 }
30095 }
30096 else if (Main.tile[
myX,
myY].type == 335)
30097 {
30100 }
30101 else if (Main.tile[
myX,
myY].type == 411 && Main.tile[
myX,
myY].frameX < 36)
30102 {
30105 NetMessage.SendData(59, -1, -1,
null,
myX,
myY);
30106 }
30107 else if (Main.tile[
myX,
myY].type == 494)
30108 {
30110 for (
int k = 0;
k < 1000;
k++)
30111 {
30113 {
30114 Main.projectile[
k].Kill();
30115 }
30116 }
30118 Projectile.NewProjectile(
GetProjectileSource_TileInteraction(
myX,
myY), (
float)(
myX * 16) + 8.5f,
myY * 16 + 6, 0f, 0f,
projType, 0, 0f,
whoAmI, 0f, -1f);
30119 }
30120 else if (Main.tile[
myX,
myY].type == 338)
30121 {
30124 if (Main.tile[
myX,
num19].frameY == 18)
30125 {
30127 }
30128 bool flag5 =
false;
30129 for (
int l = 0;
l < 1000;
l++)
30130 {
30131 if (Main.projectile[
l].active && Main.projectile[
l].aiStyle == 73 && Main.projectile[
l].ai[0] == (
float)
myX && Main.projectile[
l].ai[1] == (
float)
num19)
30132 {
30134 break;
30135 }
30136 }
30138 {
30139 int num20 = Projectile.NewProjectile(
GetProjectileSource_TileInteraction(
myX,
num19),
myX * 16 + 8,
num19 * 16 + 2, 0f, 0f, 419 + Main.rand.Next(4), 0, 0f,
whoAmI,
myX,
num19);
30140 Main.projectile[
num20].originatedFromActivableTile =
true;
30141 }
30142 }
30143 else if (Main.tile[
myX,
myY].type == 33 || Main.tile[
myX,
myY].type == 49 || Main.tile[
myX,
myY].type == 372 || Main.tile[
myX,
myY].type == 174 || Main.tile[
myX,
myY].type == 646)
30144 {
30147 if (tile.frameX > 0)
30148 {
30150 }
30151 tile.frameX +=
num21;
30152 NetMessage.SendTileSquare(-1,
myX,
myY);
30155 }
30156 else if (Main.tile[
myX,
myY].type == 4 || Main.tile[
myX,
myY].type == 13 || (Main.tile[
myX,
myY].type == 50 && Main.tile[
myX,
myY].frameX == 90))
30157 {
30159 if (Main.netMode == 1)
30160 {
30161 NetMessage.SendData(17, -1, -1,
null, 0,
myX,
myY);
30162 }
30165 }
30166 else if (Main.tile[
myX,
myY].type == 466)
30167 {
30173 {
30175 }
30177 {
30179 }
30181 {
30183 }
30185 {
30187 }
30188 else
30189 {
30190 bool flag6 = !DD2Event.Ongoing && !
NPC.AnyNPCs(548) && !Main.pumpkinMoon && !Main.snowMoon;
30192 {
30194 }
30196 {
30199 {
30201 }
30202 }
30204 {
30206 }
30208 {
30210 }
30211 }
30212 }
30213 else if (Main.tile[
myX,
myY].type == 334)
30214 {
30217 {
30220 }
30221 else
30222 {
30225 if (Main.tile[
myX,
myY].frameY == 0)
30226 {
30228 }
30229 if (Main.tile[
myX,
myY].frameY == 36)
30230 {
30232 }
30233 int frameX = Main.tile[
myX,
num24].frameX;
30236 while (
num25 >= 5000)
30237 {
30240 }
30242 {
30244 }
30247 {
30248 frameX = Main.tile[
myX - 1,
num24].frameX;
30250 }
30252 {
30253 frameX = Main.tile[
myX - 2,
num24].frameX;
30255 }
30256 if (frameX >= 5000)
30257 {
30260 if (Main.netMode == 1)
30261 {
30262 NetMessage.SendData(17, -1, -1,
null, 0,
myX,
num24, 1f);
30263 }
30264 }
30265 }
30266 }
30267 else if (Main.tile[
myX,
myY].type == 440)
30268 {
30272 _ = Main.tile[
myX,
myY].frameX % 54 / 18;
30273 _ = Main.tile[
myX,
myY].frameY % 54 / 18;
30276 {
30277 case 0:
30279 break;
30280 case 1:
30282 break;
30283 case 2:
30285 break;
30286 case 3:
30288 break;
30289 case 4:
30291 break;
30292 case 5:
30294 break;
30295 case 6:
30297 break;
30298 }
30300 {
30302 {
30304 if (Main.netMode != 1)
30305 {
30308 }
30309 else
30310 {
30312 NetMessage.SendData(105, -1, -1,
null,
myX,
myY, 1f);
30313 }
30314 }
30315 else if (
num28 == 1)
30316 {
30318 if (Main.netMode != 1)
30319 {
30321 }
30322 else
30323 {
30324 NetMessage.SendData(105, -1, -1,
null,
myX,
myY);
30325 }
30326 }
30327 }
30328 }
30329 else if (Main.tile[
myX,
myY].type == 395)
30330 {
30333 }
30334 else if (Main.tile[
myX,
myY].type == 520)
30335 {
30338 }
30339 else if (Main.tile[
myX,
myY].type == 471)
30340 {
30343 }
30344 else if (Main.tile[
myX,
myY].type == 470)
30345 {
30348 }
30349 else if (Main.tile[
myX,
myY].type == 475)
30350 {
30353 }
30354 else if (Main.tile[
myX,
myY].type == 125)
30355 {
30359 }
30360 else if (Main.tile[
myX,
myY].type == 621)
30361 {
30365 }
30366 else if (Main.tile[
myX,
myY].type == 464)
30367 {
30371 }
30372 else if (Main.tile[
myX,
myY].type == 377)
30373 {
30377 }
30378 else if (Main.tile[
myX,
myY].type == 354)
30379 {
30383 }
30384 else if (Main.tile[
myX,
myY].type == 287)
30385 {
30389 }
30390 else if (Main.tile[
myX,
myY].type == 356)
30391 {
30393 if (!Main.fastForwardTimeToDawn && (Main.netMode == 1 || Main.sundialCooldown == 0))
30394 {
30395 Main.Sundialing();
30397 }
30398 }
30399 else if (Main.tile[
myX,
myY].type == 663)
30400 {
30402 if (!Main.fastForwardTimeToDusk && (Main.netMode == 1 || Main.moondialCooldown == 0))
30403 {
30404 Main.Moondialing();
30406 }
30407 }
30408 else if (Main.tile[
myX,
myY].type == 79)
30409 {
30414 if (Main.tile[
myX,
myY].frameX >= 72)
30415 {
30418 }
30419 else
30420 {
30422 }
30426 {
30429 }
30433 {
30435 {
30439 }
30440 }
30441 else
30442 {
30445 {
30448 }
30450 {
30453 }
30454 }
30455 }
30456 else if (Main.tileSign[Main.tile[
myX,
myY].type])
30457 {
30461 {
30463 Main.npcChatText = "";
30464 Main.editSign = false;
30467 }
30469 {
30470 if (Main.netMode == 0)
30471 {
30473 Main.npcChatCornerItem = 0;
30474 Main.playerInventory = false;
30475 Main.editSign = false;
30478 {
30479 return;
30480 }
30483 Main.npcChatText = Main.sign[
num34].text;
30484 }
30485 else
30486 {
30490 {
30492 }
30495 if (Main.tileSign[Main.tile[
num37,
num38].type])
30496 {
30497 NetMessage.SendData(46, -1, -1,
null,
num37,
num38);
30498 }
30499 }
30500 }
30501 }
30502 else if (Main.tile[
myX,
myY].type == 104)
30503 {
30506 double num39 = Main.time;
30507 if (!Main.dayTime)
30508 {
30510 }
30512 double num40 = 7.5;
30515 {
30517 }
30519 {
30521 }
30526 {
30528 }
30530 {
30532 }
30534 {
30536 }
30538 }
30539 else if (Main.tile[
myX,
myY].type == 237)
30540 {
30542 bool flag8 =
false;
30543 if (!
NPC.AnyNPCs(245) && Main.hardMode &&
NPC.downedPlantBoss)
30544 {
30545 for (
int m = 0;
m < 58;
m++)
30546 {
30548 {
30551 {
30553 }
30555 break;
30556 }
30557 }
30558 }
30560 {
30562 if (Main.netMode != 1)
30563 {
30565 }
30566 else
30567 {
30568 NetMessage.SendData(61, -1, -1,
null,
whoAmI, 245f);
30569 }
30570 }
30571 }
30572 else if (Main.tile[
myX,
myY].type == 10)
30573 {
30576 {
30578 bool flag9 =
false;
30579 for (
int n = 0;
n < 58;
n++)
30580 {
30582 {
30586 {
30588 }
30590 if (Main.netMode == 1)
30591 {
30592 NetMessage.SendData(52, -1, -1,
null,
whoAmI, 2f,
myX,
myY);
30593 }
30594 }
30595 }
30597 {
30599 {
30601 {
30604 {
30606 }
30608 if (Main.netMode == 1)
30609 {
30610 NetMessage.SendData(52, -1, -1,
null,
whoAmI, 2f,
myX,
myY);
30611 }
30612 }
30613 }
30614 }
30615 }
30616 else
30617 {
30619 if (Main.tile[
myX,
myY].type != 10)
30620 {
30622 }
30623 else
30624 {
30626 if (Main.tile[
myX,
myY].type != 10)
30627 {
30629 }
30630 }
30631 }
30632 }
30633 else if (Main.tile[
myX,
myY].type == 11)
30634 {
30637 {
30639 }
30640 }
30641 else if (Main.tile[
myX,
myY].type == 88)
30642 {
30648 if (Main.tile[
myX,
myY].frameY == 0)
30649 {
30651 Main.mouseRightRelease = false;
30654 Main.npcChatCornerItem = 0;
30655 Main.npcChatText = "";
30656 if (Main.editChest)
30657 {
30659 Main.editChest = false;
30660 Main.npcChatText = string.Empty;
30661 }
30663 {
30666 }
30667 if (Main.netMode == 1)
30668 {
30670 {
30672 Recipe.FindRecipes();
30674 }
30675 else
30676 {
30677 NetMessage.SendData(31, -1, -1,
null,
num45,
num46);
30678 Main.stackSplit = 600;
30679 }
30680 }
30681 else
30682 {
30687 {
30688 Main.stackSplit = 600;
30690 {
30692 Recipe.FindRecipes();
30694 }
30696 {
30699 }
30700 else
30701 {
30704 }
30705 Recipe.FindRecipes();
30706 }
30707 }
30708 }
30709 else
30710 {
30711 Main.playerInventory = false;
30713 Recipe.FindRecipes();
30715 Main.npcChatCornerItem = 0;
30716 Main.npcChatText = "";
30717 Main.interactedDresserTopLeftX =
num45;
30718 Main.interactedDresserTopLeftY =
num46;
30719 Main.OpenClothesWindow();
30720 }
30721 }
30722 else if (Main.tile[
myX,
myY].type == 209)
30723 {
30726 int num48 = tile2.frameX % 72 / 18;
30727 int num49 = tile2.frameY % 54 / 18;
30730 int num52 = tile2.frameY / 54;
30731 int num53 = tile2.frameX / 72;
30734 {
30736 }
30739 {
30741 }
30743 {
30745 }
30747 {
30749 }
30751 {
30753 }
30756 {
30758 {
30760 {
30762 }
30763 }
30765 }
30767 {
30770 {
30772 {
30774 }
30775 }
30777 }
30779 {
30780 NetMessage.SendTileSquare(-1,
num50,
num51, 4, 3);
30781 }
30783 {
30786 {
30788 }
30790 {
30792 }
30793 }
30794 }
30795 else if (Main.tile[
myX,
myY].type == 510 || Main.tile[
myX,
myY].type == 511)
30796 {
30799 int num60 = tile3.frameX % 36 / 18;
30800 int num61 = tile3.frameY % 36 / 18;
30803 int num64 = tile3.frameY / 36;
30804 _ = tile3.frameX / 36;
30807 {
30809 }
30811 {
30813 }
30815 {
30817 }
30819 {
30821 }
30824 {
30826 {
30828 {
30830 }
30831 }
30833 }
30835 {
30836 NetMessage.SendTileSquare(-1,
num62,
num63, 2, 2);
30837 }
30838 }
30840 {
30842 Main.mouseRightRelease = false;
30846 {
30847 }
30850 if (Main.tile[
myX,
myY].type == 29)
30851 {
30853 }
30854 else if (Main.tile[
myX,
myY].type == 97)
30855 {
30857 }
30858 else if (Main.tile[
myX,
myY].type == 463)
30859 {
30863 }
30864 else if (Main.tile[
myX,
myY].type == 491)
30865 {
30869 }
30872 Main.npcChatCornerItem = 0;
30873 Main.npcChatText = "";
30874 if (Main.editChest)
30875 {
30877 Main.editChest = false;
30878 Main.npcChatText = string.Empty;
30879 }
30881 {
30884 }
30887 {
30889 {
30891 Recipe.FindRecipes();
30893 }
30894 else
30895 {
30897 {
30899 }
30900 NetMessage.SendData(31, -1, -1,
null,
num69,
num70);
30901 Main.stackSplit = 600;
30902 }
30903 }
30904 else
30905 {
30908 {
30909 case 1:
30911 break;
30912 case 2:
30914 break;
30915 case 3:
30917 break;
30918 case 4:
30920 {
30922 }
30923 break;
30924 default:
30925 {
30928 {
30932 {
30933 case 21:
30935 {
30937 }
30939 {
30943 {
30946 }
30949 }
30950 break;
30951 case 467:
30952 {
30955 {
30957 }
30958 break;
30959 }
30960 }
30965 {
30967 {
30968 continue;
30969 }
30972 {
30975 {
30977 }
30978 }
30979 if (Main.netMode == 1)
30980 {
30982 }
30983 }
30985 {
30987 {
30989 {
30990 continue;
30991 }
30993 {
30996 {
30998 }
30999 }
31000 if (Main.netMode == 1)
31001 {
31003 }
31004 }
31005 }
31006 }
31008 {
31010 }
31011 break;
31012 }
31013 }
31015 {
31016 Main.stackSplit = 600;
31019 {
31022 }
31024 {
31028 {
31030 }
31031 }
31032 else
31033 {
31036 }
31038 {
31040 NetMessage.SendData(59, -1, -1,
null,
myX,
myY);
31042 }
31043 Recipe.FindRecipes();
31044 }
31045 }
31046 }
31048 {
31052 {
31054 {
31056 }
31057 else
31058 {
31060 }
31061 }
31063 {
31065 }
31066 }
31067 }
31069 {
31071 }
31072 }
static double Sqrt(double d)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
static void HandleSpecialEvent(Player player, int eventID)
static void ToggleManualParty()
static bool WouldFailSpawningHere(int x, int y)
static void SummonCrystal(int x, int y, int whoAsks)
static void RequestToSkipWaitTime(int x, int y)
static void FailureMessage(int client)
static void OnPlayerInteraction(Player player, int clickX, int clickY)
static void OnPlayerInteraction(Player player, int clickX, int clickY)
static void OnPlayerInteraction(Player player, int clickX, int clickY)
static void OnPlayerInteraction(Player player, int clickX, int clickY)
static void OnPlayerInteraction(Player player, int clickX, int clickY)
static bool[] IsAGolfBall
static readonly LegacySoundStyle Item37
static readonly LegacySoundStyle Item4
static readonly LegacySoundStyle Item2
static readonly LegacySoundStyle Item11
static readonly LegacySoundStyle Item149
void SetDefaults(int Type=0)
static string GetTextValue(string key)
static NetworkText FromLiteral(string text)
void Dismount(Player mountedPlayer)
void SetTalkNPC(int npcIndex, bool fromNet=false)
PlayerSleepingHelper sleeping
void GetPreferredGolfBallToUse(out int projType)
TrackedProjectileReference voidLensChest
int _framesLeftEligibleForDeadmansChestDeathAchievement
void GamepadEnableGrappleCooldown()
PlayerSittingHelper sitting
bool ConsumeItem(int type, bool reverseOrder=false, bool includeVoidBag=false)
int snowBallLauncherInteractionCooldown
bool IsWithinSnappngRangeToTile(int x, int y, int distanceInPixels)
static bool CheckSpawn(int x, int y)
void ChangeSpawn(int x, int y)
void LaunchMinecartHook(int myX, int myY)
static bool IsHoveringOverABottomSideOfABed(int myX, int myY)
bool tileInteractAttempted
void OpenChest(int x, int y, int newChest)
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
void PlaceWeapon(int x, int y)
void TryOpeningFullscreenMap()
bool ItemFitsWeaponRack(Item i)
int[] ownedProjectileCounts
bool tileInteractionHappened
IEntitySource GetProjectileSource_TileInteraction(int tileCoordsX, int tileCoordsY)
TrackedProjectileReference piggyBankProjTracker
void SitDown(Player player, int x, int y)
void StartSleeping(Player player, int x, int y)