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

◆ Update()

void Terraria.Player.Update ( int i)
inline

Definition at line 23305 of file Player.cs.

23306 {
23307 if (i == Main.myPlayer && Main.netMode != 2)
23308 {
23310 }
23311 if (i == Main.myPlayer && Main.dontStarveWorld)
23312 {
23314 }
23315 maxFallSpeed = 10f;
23317 jumpHeight = 15;
23318 jumpSpeed = 5.01f;
23319 maxRunSpeed = 3f;
23320 runAcceleration = 0.08f;
23321 runSlowdown = 0.2f;
23323 if (!mount.Active || !mount.Cart)
23324 {
23325 onWrongGround = false;
23326 }
23327 heldProj = -1;
23330 {
23331 maxFallSpeed = 35f;
23332 }
23333 if (shimmerWet || shimmering)
23334 {
23335 if (shimmering)
23336 {
23337 gravity *= 0.9f;
23338 maxFallSpeed *= 0.9f;
23339 }
23340 else
23341 {
23342 gravity = 0.15f;
23343 jumpHeight = 23;
23344 jumpSpeed = 5.51f;
23345 }
23346 }
23347 else if (wet)
23348 {
23349 if (honeyWet)
23350 {
23351 gravity = 0.1f;
23352 maxFallSpeed = 3f;
23353 }
23354 else if (merman)
23355 {
23356 gravity = 0.3f;
23357 maxFallSpeed = 7f;
23358 }
23359 else if (trident && !lavaWet)
23360 {
23361 gravity = 0.25f;
23362 maxFallSpeed = 6f;
23363 jumpHeight = 25;
23364 jumpSpeed = 5.51f;
23365 if (controlUp)
23366 {
23367 gravity = 0.1f;
23368 maxFallSpeed = 2f;
23369 }
23370 }
23371 else
23372 {
23373 gravity = 0.2f;
23374 maxFallSpeed = 5f;
23375 jumpHeight = 30;
23376 jumpSpeed = 6.01f;
23377 }
23378 }
23379 if (vortexDebuff)
23380 {
23381 gravity = 0f;
23382 }
23383 maxFallSpeed += 0.01f;
23384 bool flag = false;
23385 if (Main.myPlayer == i)
23386 {
23387 if (Main.mapFullscreen)
23388 {
23390 }
23391 else if (_quickGrappleCooldown > 0)
23392 {
23394 }
23395 TileObject.objectPreview.Reset();
23397 {
23399 }
23400 autoReuseAllWeapons = Main.SettingsEnabled_AutoReuseAllItems;
23401 }
23402 if (NPC.freeCake && talkNPC >= 0 && Main.npc[talkNPC].type == 208)
23403 {
23404 NPC.freeCake = false;
23405 if (Main.netMode != 1)
23406 {
23407 Item.NewItem(new EntitySource_Gift(Main.npc[talkNPC]), (int)position.X, (int)position.Y, width, height, 3750);
23408 }
23409 }
23410 if (emoteTime > 0)
23411 {
23412 emoteTime--;
23413 }
23414 if (ghostDmg > 0f)
23415 {
23416 ghostDmg -= 6.6666665f;
23417 }
23418 if (ghostDmg < 0f)
23419 {
23420 ghostDmg = 0f;
23421 }
23422 if (Main.expertMode)
23423 {
23424 if (lifeSteal < 70f)
23425 {
23426 lifeSteal += 0.5f;
23427 }
23428 if (lifeSteal > 70f)
23429 {
23430 lifeSteal = 70f;
23431 }
23432 }
23433 else
23434 {
23435 if (lifeSteal < 80f)
23436 {
23437 lifeSteal += 0.6f;
23438 }
23439 if (lifeSteal > 80f)
23440 {
23441 lifeSteal = 80f;
23442 }
23443 }
23444 ResizeHitbox();
23445 if (mount.Active && mount.Type == 0)
23446 {
23447 int num = (int)(position.X + (float)(width / 2)) / 16;
23448 int j = (int)(position.Y + (float)(height / 2) - 14f) / 16;
23449 Lighting.AddLight(num, j, 0.5f, 0.2f, 0.05f);
23450 Lighting.AddLight(num + direction, j, 0.5f, 0.2f, 0.05f);
23451 Lighting.AddLight(num + direction * 2, j, 0.5f, 0.2f, 0.05f);
23452 }
23453 outOfRange = false;
23454 if (whoAmI != Main.myPlayer)
23455 {
23456 int num2 = (int)(position.X + (float)(width / 2)) / 16;
23457 int num3 = (int)(position.Y + (float)(height / 2)) / 16;
23458 if (!WorldGen.InWorld(num2, num3, 4))
23459 {
23460 flag = true;
23461 }
23462 else if (Main.tile[num2, num3] == null)
23463 {
23464 flag = true;
23465 }
23466 else if (Main.tile[num2 - 3, num3] == null)
23467 {
23468 flag = true;
23469 }
23470 else if (Main.tile[num2 + 3, num3] == null)
23471 {
23472 flag = true;
23473 }
23474 else if (Main.tile[num2, num3 - 3] == null)
23475 {
23476 flag = true;
23477 }
23478 else if (Main.tile[num2, num3 + 3] == null)
23479 {
23480 flag = true;
23481 }
23482 if (flag)
23483 {
23484 outOfRange = true;
23485 numMinions = 0;
23486 slotsMinions = 0f;
23487 itemAnimation = 0;
23488 UpdateBuffs(i);
23489 PlayerFrame();
23490 }
23491 }
23492 if (tankPet >= 0)
23493 {
23494 if (!tankPetReset)
23495 {
23496 tankPetReset = true;
23497 }
23498 else
23499 {
23500 tankPet = -1;
23501 }
23502 }
23503 if (i == Main.myPlayer)
23504 {
23506 }
23507 if (chatOverhead.timeLeft > 0)
23508 {
23510 }
23512 {
23514 }
23516 if (flag)
23517 {
23518 return;
23519 }
23523 if (infernoCounter >= 180)
23524 {
23525 infernoCounter = 0;
23526 }
23528 if (timeSinceLastDashStarted >= 300)
23529 {
23531 }
23534 {
23536 }
23537 if (titaniumStormCooldown > 0)
23538 {
23540 }
23541 if (starCloakCooldown > 0)
23542 {
23544 if (Main.rand.Next(5) == 0)
23545 {
23546 for (int k = 0; k < 2; k++)
23547 {
23548 Dust dust = Dust.NewDustDirect(position, width, height, 45, 0f, 0f, 255, default(Color), (float)Main.rand.Next(20, 26) * 0.1f);
23549 dust.noLight = true;
23550 dust.noGravity = true;
23551 dust.velocity *= 0.5f;
23552 dust.velocity.X = 0f;
23553 dust.velocity.Y -= 0.5f;
23554 }
23555 }
23556 if (starCloakCooldown == 0)
23557 {
23559 }
23560 }
23562 if (_timeSinceLastImmuneGet >= 10000)
23563 {
23565 }
23566 float num4 = (float)Main.maxTilesX / 4200f;
23567 num4 *= num4;
23568 float num5 = (float)((double)(position.Y / 16f - (60f + 10f * num4)) / (Main.worldSurface / 6.0));
23569 if (Main.remixWorld)
23570 {
23571 num5 = (float)((double)(position.Y / 16f - (60f + 10f * num4)) / (Main.worldSurface / 1.0));
23572 }
23573 if (Main.remixWorld)
23574 {
23575 if ((double)num5 < 0.1)
23576 {
23577 num5 = 0.1f;
23578 }
23579 }
23580 else if ((double)num5 < 0.25)
23581 {
23582 num5 = 0.25f;
23583 }
23584 if (num5 > 1f)
23585 {
23586 num5 = 1f;
23587 }
23588 gravity *= num5;
23589 maxRegenDelay = (1f - (float)statMana / (float)statManaMax2) * 60f * 4f + 45f;
23590 maxRegenDelay *= 0.7f;
23593 whoAmI = i;
23594 if (whoAmI == Main.myPlayer)
23595 {
23596 if (!DD2Event.Ongoing)
23597 {
23599 }
23601 if (whoAmI == Main.myPlayer)
23602 {
23603 doorHelper.Update(this);
23604 }
23605 }
23606 if (runSoundDelay > 0)
23607 {
23608 runSoundDelay--;
23609 }
23610 if (attackCD > 0)
23611 {
23612 attackCD--;
23613 }
23614 if (itemAnimation == 0)
23615 {
23616 attackCD = 0;
23617 }
23618 if (potionDelay > 0)
23619 {
23620 potionDelay--;
23621 }
23622 if (i == Main.myPlayer)
23623 {
23624 if (trashItem.type >= 1522 && trashItem.type <= 1527)
23625 {
23627 }
23628 if (trashItem.type == 3643)
23629 {
23631 }
23632 UpdateBiomes();
23634 }
23635 if (ghost)
23636 {
23637 Ghost();
23638 return;
23639 }
23640 if (dead)
23641 {
23642 UpdateDead();
23645 return;
23646 }
23648 if (i == Main.myPlayer && hasLucyTheAxe)
23649 {
23651 }
23652 if (velocity.Y == 0f)
23653 {
23655 }
23656 if (i == Main.myPlayer && !isControlledByFilm)
23657 {
23658 ResetControls();
23659 if (Main.hasFocus)
23660 {
23661 if (!Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput)
23662 {
23663 PlayerInput.Triggers.Current.CopyInto(this);
23664 LocalInputCache = new DirectionalInputSyncCache(this);
23665 if (Main.mapFullscreen)
23666 {
23667 if (controlUp)
23668 {
23669 Main.mapFullscreenPos.Y -= 1f * (16f / Main.mapFullscreenScale);
23670 }
23671 if (controlDown)
23672 {
23673 Main.mapFullscreenPos.Y += 1f * (16f / Main.mapFullscreenScale);
23674 }
23675 if (controlLeft)
23676 {
23677 Main.mapFullscreenPos.X -= 1f * (16f / Main.mapFullscreenScale);
23678 }
23679 if (controlRight)
23680 {
23681 Main.mapFullscreenPos.X += 1f * (16f / Main.mapFullscreenScale);
23682 }
23683 controlUp = false;
23684 controlLeft = false;
23685 controlDown = false;
23686 controlRight = false;
23687 controlJump = false;
23688 controlUseItem = false;
23689 controlUseTile = false;
23690 controlThrow = false;
23691 controlHook = false;
23692 controlTorch = false;
23693 controlSmart = false;
23694 controlMount = false;
23695 }
23697 {
23699 }
23700 if (controlQuickHeal)
23701 {
23702 if (releaseQuickHeal)
23703 {
23704 QuickHeal();
23705 }
23706 releaseQuickHeal = false;
23707 }
23708 else
23709 {
23710 releaseQuickHeal = true;
23711 }
23712 if (controlQuickMana)
23713 {
23714 if (releaseQuickMana)
23715 {
23716 QuickMana();
23717 }
23718 releaseQuickMana = false;
23719 }
23720 else
23721 {
23722 releaseQuickMana = true;
23723 }
23725 {
23727 {
23729 }
23730 releaseCreativeMenu = false;
23731 }
23732 else
23733 {
23734 releaseCreativeMenu = true;
23735 }
23737 {
23738 controlLeft = false;
23739 controlRight = false;
23740 }
23742 {
23744 {
23745 TryToToggleSmartCursor(ref Main.SmartCursorWanted_Mouse);
23746 }
23747 else if (PlayerInput.UsingGamepad)
23748 {
23749 TryToToggleSmartCursor(ref Main.SmartCursorWanted_GamePad);
23750 }
23751 else
23752 {
23753 TryToToggleSmartCursor(ref Main.SmartCursorWanted_Mouse);
23754 }
23755 }
23756 if (controlSmart)
23757 {
23758 releaseSmart = false;
23759 }
23760 else
23761 {
23762 releaseSmart = true;
23763 }
23764 if (controlMount)
23765 {
23766 if (releaseMount)
23767 {
23768 QuickMount();
23769 }
23770 releaseMount = false;
23771 }
23772 else
23773 {
23774 releaseMount = true;
23775 }
23776 if (Main.mapFullscreen)
23777 {
23778 if (mapZoomIn)
23779 {
23780 Main.mapFullscreenScale *= 1.05f;
23781 }
23782 if (mapZoomOut)
23783 {
23784 Main.mapFullscreenScale *= 0.95f;
23785 }
23786 }
23787 else
23788 {
23789 if (Main.mapStyle == 1)
23790 {
23791 if (mapZoomIn)
23792 {
23793 Main.mapMinimapScale *= 1.025f;
23794 }
23795 if (mapZoomOut)
23796 {
23797 Main.mapMinimapScale *= 0.975f;
23798 }
23799 if (mapAlphaUp)
23800 {
23801 Main.mapMinimapAlpha += 0.015f;
23802 }
23803 if (mapAlphaDown)
23804 {
23805 Main.mapMinimapAlpha -= 0.015f;
23806 }
23807 }
23808 else if (Main.mapStyle == 2)
23809 {
23810 if (mapZoomIn)
23811 {
23812 Main.mapOverlayScale *= 1.05f;
23813 }
23814 if (mapZoomOut)
23815 {
23816 Main.mapOverlayScale *= 0.95f;
23817 }
23818 if (mapAlphaUp)
23819 {
23820 Main.mapOverlayAlpha += 0.015f;
23821 }
23822 if (mapAlphaDown)
23823 {
23824 Main.mapOverlayAlpha -= 0.015f;
23825 }
23826 }
23827 if (mapStyle)
23828 {
23829 if (releaseMapStyle)
23830 {
23832 Main.mapStyle++;
23833 if (Main.mapStyle > 2)
23834 {
23835 Main.mapStyle = 0;
23836 }
23837 }
23838 releaseMapStyle = false;
23839 }
23840 else
23841 {
23842 releaseMapStyle = true;
23843 }
23844 }
23845 if (mapFullScreen)
23846 {
23848 {
23849 if (Main.mapFullscreen)
23850 {
23852 Main.mapFullscreen = false;
23853 }
23854 else
23855 {
23857 }
23858 }
23859 releaseMapFullscreen = false;
23860 }
23861 else
23862 {
23863 releaseMapFullscreen = true;
23864 }
23865 }
23866 else if (!PlayerInput.UsingGamepad && !Main.editSign && !Main.editChest && !Main.blockInput)
23867 {
23868 PlayerInput.Triggers.Current.CopyIntoDuringChat(this);
23869 }
23870 if (confused)
23871 {
23872 bool flag2 = controlLeft;
23873 bool flag3 = controlUp;
23878 }
23879 else if (cartFlip)
23880 {
23882 {
23883 bool flag4 = controlLeft;
23886 }
23887 else
23888 {
23889 cartFlip = false;
23890 }
23891 }
23892 for (int l = 0; l < doubleTapCardinalTimer.Length; l++)
23893 {
23895 if (doubleTapCardinalTimer[l] < 0)
23896 {
23898 }
23899 }
23900 for (int m = 0; m < 4; m++)
23901 {
23902 bool flag5 = false;
23903 bool flag6 = false;
23904 switch (m)
23905 {
23906 case 0:
23909 break;
23910 case 1:
23912 flag6 = controlUp;
23913 break;
23914 case 2:
23917 break;
23918 case 3:
23921 break;
23922 }
23923 if (flag5)
23924 {
23925 if (doubleTapCardinalTimer[m] > 0)
23926 {
23927 KeyDoubleTap(m);
23928 }
23929 else
23930 {
23932 }
23933 }
23934 if (flag6)
23935 {
23938 }
23939 else
23940 {
23942 }
23943 }
23945 if (controlInv)
23946 {
23947 if (releaseInventory)
23948 {
23949 ToggleInv();
23950 }
23951 releaseInventory = false;
23952 }
23953 else
23954 {
23955 releaseInventory = true;
23956 }
23957 if (delayUseItem)
23958 {
23959 if (!controlUseItem)
23960 {
23961 delayUseItem = false;
23962 }
23963 controlUseItem = false;
23964 }
23965 if (itemAnimation == 0 && ItemTimeIsZero && reuseDelay == 0)
23966 {
23967 dropItemCheck();
23968 int num6 = selectedItem;
23969 bool flag7 = false;
23970 if (!Main.drawingPlayerChat && selectedItem != 58 && !Main.editSign && !Main.editChest)
23971 {
23972 if (PlayerInput.Triggers.Current.Hotbar1)
23973 {
23974 selectedItem = 0;
23975 flag7 = true;
23976 }
23977 if (PlayerInput.Triggers.Current.Hotbar2)
23978 {
23979 selectedItem = 1;
23980 flag7 = true;
23981 }
23982 if (PlayerInput.Triggers.Current.Hotbar3)
23983 {
23984 selectedItem = 2;
23985 flag7 = true;
23986 }
23987 if (PlayerInput.Triggers.Current.Hotbar4)
23988 {
23989 selectedItem = 3;
23990 flag7 = true;
23991 }
23992 if (PlayerInput.Triggers.Current.Hotbar5)
23993 {
23994 selectedItem = 4;
23995 flag7 = true;
23996 }
23997 if (PlayerInput.Triggers.Current.Hotbar6)
23998 {
23999 selectedItem = 5;
24000 flag7 = true;
24001 }
24002 if (PlayerInput.Triggers.Current.Hotbar7)
24003 {
24004 selectedItem = 6;
24005 flag7 = true;
24006 }
24007 if (PlayerInput.Triggers.Current.Hotbar8)
24008 {
24009 selectedItem = 7;
24010 flag7 = true;
24011 }
24012 if (PlayerInput.Triggers.Current.Hotbar9)
24013 {
24014 selectedItem = 8;
24015 flag7 = true;
24016 }
24017 if (PlayerInput.Triggers.Current.Hotbar10)
24018 {
24019 selectedItem = 9;
24020 flag7 = true;
24021 }
24029 {
24031 }
24033 {
24035 }
24037 {
24039 {
24040 case 0:
24041 QuickMount();
24042 break;
24043 case 1:
24044 QuickHeal();
24045 break;
24046 case 2:
24047 QuickBuff();
24048 break;
24049 case 3:
24050 QuickMana();
24051 break;
24052 }
24053 }
24054 if (controlTorch || flag7)
24055 {
24058 }
24059 if (controlTorch && flag7)
24060 {
24061 if (selectedItem != nonTorch)
24062 {
24064 }
24067 flag7 = false;
24068 }
24069 }
24070 bool flag8 = Main.hairWindow;
24071 if (flag8)
24072 {
24073 int y = Main.screenHeight / 2 + 60;
24074 flag8 = new Rectangle(Main.screenWidth / 2 - TextureAssets.HairStyleBack.Width() / 2, y, TextureAssets.HairStyleBack.Width(), TextureAssets.HairStyleBack.Height()).Contains(Main.MouseScreen.ToPoint());
24075 }
24076 if (flag7 && CaptureManager.Instance.Active)
24077 {
24078 CaptureManager.Instance.Active = false;
24079 }
24080 if (num6 != selectedItem)
24081 {
24083 }
24084 if (Main.mapFullscreen)
24085 {
24086 float num7 = PlayerInput.ScrollWheelDelta / 120;
24088 {
24089 num7 += (float)(PlayerInput.Triggers.Current.HotbarPlus.ToInt() - PlayerInput.Triggers.Current.HotbarMinus.ToInt()) * 0.1f;
24090 }
24091 Main.mapFullscreenScale *= 1f + num7 * 0.3f;
24092 }
24093 else if (CaptureManager.Instance.Active)
24094 {
24095 CaptureManager.Instance.Scrolling();
24096 }
24097 else if (!flag8)
24098 {
24099 if (!Main.playerInventory)
24100 {
24101 HandleHotbar();
24102 }
24103 else
24104 {
24105 int num8 = GetMouseScrollDelta();
24106 bool flag9 = true;
24107 if (Main.recBigList)
24108 {
24109 int num9 = 42;
24110 int num10 = 340;
24111 int num11 = 310;
24113 int num12 = (Main.screenWidth - num11 - 280) / num9;
24114 int num13 = (Main.screenHeight - num10 - 20) / num9;
24115 if (new Rectangle(num11, num10, num12 * num9, num13 * num9).Contains(Main.MouseScreen.ToPoint()))
24116 {
24117 num8 *= -1;
24118 int num14 = Math.Sign(num8);
24119 while (num8 != 0)
24120 {
24121 if (num8 < 0)
24122 {
24123 Main.recStart -= num12;
24124 if (Main.recStart < 0)
24125 {
24126 Main.recStart = 0;
24127 }
24128 }
24129 else
24130 {
24131 Main.recStart += num12;
24132 if (Main.recStart > Main.numAvailableRecipes - num12)
24133 {
24134 Main.recStart = Main.numAvailableRecipes - num12;
24135 }
24136 }
24137 num8 -= num14;
24138 }
24139 }
24141 }
24142 if (flag9)
24143 {
24144 Main.focusRecipe += num8;
24145 if (Main.focusRecipe > Main.numAvailableRecipes - 1)
24146 {
24147 Main.focusRecipe = Main.numAvailableRecipes - 1;
24148 }
24149 if (Main.focusRecipe < 0)
24150 {
24151 Main.focusRecipe = 0;
24152 }
24153 }
24154 }
24155 }
24156 }
24157 else
24158 {
24159 bool flag10 = false;
24160 if (!Main.drawingPlayerChat && selectedItem != 58 && !Main.editSign && !Main.editChest)
24161 {
24162 int num15 = -1;
24163 if (Main.keyState.IsKeyDown(Keys.D1))
24164 {
24165 num15 = 0;
24166 flag10 = true;
24167 }
24168 if (Main.keyState.IsKeyDown(Keys.D2))
24169 {
24170 num15 = 1;
24171 flag10 = true;
24172 }
24173 if (Main.keyState.IsKeyDown(Keys.D3))
24174 {
24175 num15 = 2;
24176 flag10 = true;
24177 }
24178 if (Main.keyState.IsKeyDown(Keys.D4))
24179 {
24180 num15 = 3;
24181 flag10 = true;
24182 }
24183 if (Main.keyState.IsKeyDown(Keys.D5))
24184 {
24185 num15 = 4;
24186 flag10 = true;
24187 }
24188 if (Main.keyState.IsKeyDown(Keys.D6))
24189 {
24190 num15 = 5;
24191 flag10 = true;
24192 }
24193 if (Main.keyState.IsKeyDown(Keys.D7))
24194 {
24195 num15 = 6;
24196 flag10 = true;
24197 }
24198 if (Main.keyState.IsKeyDown(Keys.D8))
24199 {
24200 num15 = 7;
24201 flag10 = true;
24202 }
24203 if (Main.keyState.IsKeyDown(Keys.D9))
24204 {
24205 num15 = 8;
24206 flag10 = true;
24207 }
24208 if (Main.keyState.IsKeyDown(Keys.D0))
24209 {
24210 num15 = 9;
24211 flag10 = true;
24212 }
24213 if (flag10)
24214 {
24215 if (num15 != nonTorch)
24216 {
24218 }
24219 nonTorch = num15;
24220 }
24221 }
24222 }
24223 }
24224 if (selectedItem != 58)
24225 {
24227 }
24228 if (stoned != lastStoned)
24229 {
24230 if (whoAmI == Main.myPlayer && stoned)
24231 {
24232 int damage = (int)(20.0 * (double)Main.GameModeInfo.EnemyDamageMultiplier);
24233 Hurt(PlayerDeathReason.ByOther(5), damage, 0);
24234 }
24235 SoundEngine.PlaySound(0, (int)position.X, (int)position.Y);
24236 for (int n = 0; n < 20; n++)
24237 {
24238 int num16 = Dust.NewDust(position, width, height, 1);
24239 if (Main.rand.Next(2) == 0)
24240 {
24241 Main.dust[num16].noGravity = true;
24242 }
24243 }
24244 }
24246 if (frozen || webbed || stoned)
24247 {
24248 controlJump = false;
24249 controlDown = false;
24250 controlLeft = false;
24251 controlRight = false;
24252 controlUp = false;
24253 controlUseItem = false;
24254 controlUseTile = false;
24255 controlThrow = false;
24256 gravDir = 1f;
24257 }
24258 if (!controlThrow)
24259 {
24260 releaseThrow = true;
24261 }
24262 else
24263 {
24264 releaseThrow = false;
24265 }
24266 if (controlDown && releaseDown)
24267 {
24269 {
24270 tryKeepingHoveringUp = false;
24271 }
24272 else
24273 {
24275 }
24276 }
24277 if (controlUp && releaseUp)
24278 {
24280 {
24281 tryKeepingHoveringDown = false;
24282 }
24283 else
24284 {
24285 tryKeepingHoveringUp = true;
24286 }
24287 }
24288 if (velocity.Y == 0f)
24289 {
24290 tryKeepingHoveringUp = false;
24291 tryKeepingHoveringDown = false;
24292 }
24293 if (Settings.HoverControl == Settings.HoverControlMode.Hold)
24294 {
24295 tryKeepingHoveringUp = false;
24296 tryKeepingHoveringDown = false;
24297 }
24299 if (Main.playerInventory)
24300 {
24301 AdjTiles();
24302 }
24305 }
24306 if (i == Main.myPlayer)
24307 {
24308 if (velocity.Y <= 0f)
24309 {
24310 fallStart2 = (int)(position.Y / 16f);
24311 }
24312 if (velocity.Y == 0f)
24313 {
24314 int num17 = 25;
24315 num17 += extraFall;
24316 int num18 = (int)(position.Y / 16f) - fallStart;
24317 if (mount.CanFly())
24318 {
24319 num18 = 0;
24320 }
24321 if (mount.Cart && Minecart.OnTrack(position, width, height))
24322 {
24323 num18 = 0;
24324 }
24325 if (mount.Type == 1)
24326 {
24327 num18 = 0;
24328 }
24329 if (num18 > 0 || (gravDir == -1f && num18 < 0))
24330 {
24331 int num19 = (int)(position.X / 16f);
24332 int num20 = (int)((position.X + (float)width) / 16f);
24333 int num21 = (int)((position.Y + (float)height + 1f) / 16f);
24334 if (gravDir == -1f)
24335 {
24336 num21 = (int)((position.Y - 1f) / 16f);
24337 }
24338 for (int num22 = num19; num22 <= num20; num22++)
24339 {
24340 if (Main.tile[num22, num21] != null && Main.tile[num22, num21].active() && (Main.tile[num22, num21].type == 189 || Main.tile[num22, num21].type == 196 || Main.tile[num22, num21].type == 460 || Main.tile[num22, num21].type == 666))
24341 {
24342 num18 = 0;
24343 break;
24344 }
24345 }
24346 }
24347 bool flag11 = false;
24348 for (int num23 = 3; num23 < 10; num23++)
24349 {
24350 if (armor[num23].stack > 0 && armor[num23].wingSlot > -1)
24351 {
24352 flag11 = true;
24353 }
24354 }
24355 if (stoned)
24356 {
24357 int num24 = (int)(((float)num18 * gravDir - 2f) * 20f);
24358 if (num24 > 0)
24359 {
24361 immune = false;
24362 }
24363 }
24364 else if (((gravDir == 1f && num18 > num17) || (gravDir == -1f && num18 < -num17)) && !noFallDmg && !flag11)
24365 {
24366 immune = false;
24367 int num25 = (int)((float)num18 * gravDir - (float)num17) * 10;
24368 if (mount.Active)
24369 {
24370 num25 = (int)((float)num25 * mount.FallDamage);
24371 }
24373 if (!dead && statLife <= statLifeMax2 / 10)
24374 {
24376 }
24377 }
24378 fallStart = (int)(position.Y / 16f);
24379 }
24380 if (jump > 0 || rocketDelay > 0 || wet || slowFall || (double)num5 < 0.8 || tongued)
24381 {
24382 fallStart = (int)(position.Y / 16f);
24383 }
24384 }
24385 if (Main.netMode != 1)
24386 {
24387 if (chest == -1 && lastChest >= 0 && Main.chest[lastChest] != null)
24388 {
24389 int x = Main.chest[lastChest].x;
24390 int y2 = Main.chest[lastChest].y;
24391 NPC.BigMimicSummonCheck(x, y2, this);
24392 }
24393 if (lastChest != chest && chest >= 0 && Main.chest[chest] != null)
24394 {
24395 int x2 = Main.chest[chest].x;
24396 int y3 = Main.chest[chest].y;
24397 Projectile.GasTrapCheck(x2, y3, this);
24398 ItemSlot.forceClearGlowsOnChest = true;
24399 }
24400 lastChest = chest;
24401 }
24402 if (mouseInterface)
24403 {
24404 delayUseItem = true;
24405 }
24406 tileTargetX = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f);
24407 tileTargetY = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f);
24408 if (gravDir == -1f)
24409 {
24410 tileTargetY = (int)((Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY) / 16f);
24411 }
24412 if (tileTargetX >= Main.maxTilesX - 5)
24413 {
24414 tileTargetX = Main.maxTilesX - 5;
24415 }
24416 if (tileTargetY >= Main.maxTilesY - 5)
24417 {
24418 tileTargetY = Main.maxTilesY - 5;
24419 }
24420 if (tileTargetX < 5)
24421 {
24422 tileTargetX = 5;
24423 }
24424 if (tileTargetY < 5)
24425 {
24426 tileTargetY = 5;
24427 }
24428 if (Main.tile[tileTargetX - 1, tileTargetY] == null)
24429 {
24430 Main.tile[tileTargetX - 1, tileTargetY] = new Tile();
24431 }
24432 if (Main.tile[tileTargetX + 1, tileTargetY] == null)
24433 {
24434 Main.tile[tileTargetX + 1, tileTargetY] = new Tile();
24435 }
24436 if (Main.tile[tileTargetX, tileTargetY] == null)
24437 {
24438 Main.tile[tileTargetX, tileTargetY] = new Tile();
24439 }
24441 {
24442 if (Main.tile[tileTargetX - 1, tileTargetY].active() && Main.tile[tileTargetX - 1, tileTargetY].type == 323)
24443 {
24444 if (Main.tile[tileTargetX - 1, tileTargetY].frameY > 4)
24445 {
24446 tileTargetX--;
24447 }
24448 }
24449 else if (Main.tile[tileTargetX + 1, tileTargetY].active() && Main.tile[tileTargetX + 1, tileTargetY].type == 323 && Main.tile[tileTargetX + 1, tileTargetY].frameY < -4)
24450 {
24451 tileTargetX++;
24452 }
24453 }
24454 if (i == Main.myPlayer)
24455 {
24457 }
24458 try
24459 {
24460 if (whoAmI == Main.myPlayer && Main.instance.IsActive)
24461 {
24464 }
24465 }
24466 catch
24467 {
24468 Main.SmartCursorWanted_GamePad = false;
24469 Main.SmartCursorWanted_Mouse = false;
24470 }
24472 if (petalTimer > 0)
24473 {
24474 petalTimer--;
24475 }
24476 if (shadowDodgeTimer > 0)
24477 {
24479 }
24480 if (boneGloveTimer > 0)
24481 {
24483 }
24484 if (crystalLeafCooldown > 0)
24485 {
24487 }
24488 if (jump > 0 || velocity.Y != 0f)
24489 {
24491 }
24492 bool flag12 = pStone;
24493 potionDelayTime = Item.potionDelay;
24494 restorationDelayTime = Item.restorationDelay;
24495 mushroomDelayTime = Item.mushroomDelay;
24496 if (pStone)
24497 {
24501 }
24502 if (yoraiz0rEye > 0)
24503 {
24504 Yoraiz0rEye();
24505 }
24506 ResetEffects();
24507 UpdateDyes();
24509 {
24510 creativeGodMode = true;
24511 }
24513 {
24514 afkCounter++;
24515 }
24516 else
24517 {
24518 afkCounter = 0;
24519 }
24523 if (whoAmI == Main.myPlayer)
24524 {
24525 Main.musicBox2 = -1;
24526 if (Main.SceneMetrics.WaterCandleCount > 0)
24527 {
24528 AddBuff(86, 2, quiet: false);
24529 }
24530 if (Main.SceneMetrics.PeaceCandleCount > 0)
24531 {
24532 AddBuff(157, 2, quiet: false);
24533 }
24534 if (Main.SceneMetrics.ShadowCandleCount > 0)
24535 {
24536 AddBuff(350, 2, quiet: false);
24537 }
24538 if (Main.SceneMetrics.HasCampfire)
24539 {
24540 AddBuff(87, 2, quiet: false);
24541 }
24542 if (Main.SceneMetrics.HasCatBast)
24543 {
24544 AddBuff(215, 2, quiet: false);
24545 }
24546 if (Main.SceneMetrics.HasStarInBottle)
24547 {
24548 AddBuff(158, 2, quiet: false);
24549 }
24550 if (Main.SceneMetrics.HasHeartLantern)
24551 {
24552 AddBuff(89, 2, quiet: false);
24553 }
24554 if (Main.SceneMetrics.HasSunflower)
24555 {
24556 AddBuff(146, 2, quiet: false);
24557 }
24558 if (Main.SceneMetrics.hasBanner)
24559 {
24560 AddBuff(147, 2, quiet: false);
24561 }
24563 {
24564 AddBuff(194, 2, quiet: false);
24565 }
24566 }
24567 for (int num26 = 0; num26 < BuffID.Count; num26++)
24568 {
24569 buffImmune[num26] = false;
24570 }
24572 UpdateBuffs(i);
24573 if (whoAmI == Main.myPlayer)
24574 {
24575 if (!onFire && !poisoned)
24576 {
24577 trapDebuffSource = false;
24578 }
24579 UpdatePet(i);
24580 UpdatePetLight(i);
24582 }
24583 bool flag13 = wet && !lavaWet && (!mount.Active || !mount.IsConsideredASlimeMount);
24584 if (accMerman && flag13)
24585 {
24586 releaseJump = true;
24587 wings = 0;
24588 merman = true;
24589 accFlipper = true;
24590 AddBuff(34, 2);
24591 }
24592 else
24593 {
24594 merman = false;
24595 }
24596 if (!flag13 && forceWerewolf)
24597 {
24598 forceMerman = false;
24599 }
24600 if (forceMerman && flag13)
24601 {
24602 wings = 0;
24603 }
24604 accMerman = false;
24605 hideMerman = false;
24606 forceMerman = false;
24607 if (wolfAcc && !merman && !Main.dayTime && !wereWolf)
24608 {
24609 AddBuff(28, 60);
24610 }
24611 wolfAcc = false;
24612 hideWolf = false;
24613 forceWerewolf = false;
24614 if (whoAmI == Main.myPlayer)
24615 {
24616 for (int num27 = 0; num27 < maxBuffs; num27++)
24617 {
24618 if (buffType[num27] > 0 && buffTime[num27] <= 0)
24619 {
24620 DelBuff(num27);
24621 }
24622 }
24623 }
24624 beetleDefense = false;
24625 beetleOffense = false;
24626 setSolar = false;
24627 head = armor[0].headSlot;
24628 body = armor[1].bodySlot;
24629 legs = armor[2].legSlot;
24632 {
24634 }
24635 if (_portalPhysicsTime > 0)
24636 {
24638 }
24639 UpdateEquips(i);
24640 if (Main.npcShop <= 0)
24641 {
24643 }
24644 if (flag12 != pStone)
24645 {
24647 }
24649 UpdateLuck();
24652 if (velocity.Y == 0f || controlJump)
24653 {
24654 portalPhysicsFlag = false;
24655 }
24657 {
24658 _portalPhysicsTime = 30;
24659 }
24660 if (mount.Active)
24661 {
24662 mount.UpdateEffects(this);
24663 }
24664 gemCount++;
24665 if (gemCount >= 10)
24666 {
24667 gem = -1;
24668 ownedLargeGems = (byte)0;
24669 gemCount = 0;
24670 for (int num28 = 0; num28 <= 58; num28++)
24671 {
24672 if (inventory[num28].type == 0 || inventory[num28].stack == 0)
24673 {
24675 }
24676 if (inventory[num28].type >= 1522 && inventory[num28].type <= 1527)
24677 {
24678 gem = inventory[num28].type - 1522;
24679 ownedLargeGems[gem] = true;
24680 }
24681 if (inventory[num28].type == 3643)
24682 {
24683 gem = 6;
24684 ownedLargeGems[gem] = true;
24685 }
24686 }
24687 }
24689 UpdateArmorSets(i);
24690 if (shadowDodge && !onHitDodge)
24691 {
24692 ClearBuff(59);
24693 }
24695 {
24698 }
24699 if (shieldRaised)
24700 {
24701 statDefense += 20;
24702 }
24703 if ((merman || forceMerman) && flag13)
24704 {
24705 wings = 0;
24706 }
24707 if (invis)
24708 {
24709 if (itemAnimation == 0 && aggro > -750)
24710 {
24711 aggro = -750;
24712 }
24713 else if (aggro > -250)
24714 {
24715 aggro = -250;
24716 }
24717 }
24718 if (inventory[selectedItem].type == 3106)
24719 {
24720 if (itemAnimation > 0)
24721 {
24722 stealthTimer = 15;
24723 if (stealth > 0f)
24724 {
24725 stealth += 0.1f;
24726 }
24727 }
24728 else if ((double)velocity.X > -0.1 && (double)velocity.X < 0.1 && (double)velocity.Y > -0.1 && (double)velocity.Y < 0.1 && !mount.Active)
24729 {
24730 if (stealthTimer == 0 && stealth > 0f)
24731 {
24732 stealth -= 0.02f;
24733 if ((double)stealth <= 0.0)
24734 {
24735 stealth = 0f;
24736 if (Main.netMode == 1)
24737 {
24738 NetMessage.SendData(84, -1, -1, null, whoAmI);
24739 }
24740 }
24741 }
24742 }
24743 else
24744 {
24745 if (stealth > 0f)
24746 {
24747 stealth += 0.1f;
24748 }
24749 if (mount.Active)
24750 {
24751 stealth = 1f;
24752 }
24753 }
24754 if (stealth > 1f)
24755 {
24756 stealth = 1f;
24757 }
24758 meleeDamage += (1f - stealth) * 3f;
24759 meleeCrit += (int)((1f - stealth) * 30f);
24760 if (meleeCrit > 100)
24761 {
24762 meleeCrit = 100;
24763 }
24764 aggro -= (int)((1f - stealth) * 750f);
24765 if (stealthTimer > 0)
24766 {
24767 stealthTimer--;
24768 }
24769 }
24770 else if (shroomiteStealth)
24771 {
24772 if (itemAnimation > 0)
24773 {
24774 stealthTimer = 5;
24775 }
24776 if ((double)velocity.X > -0.1 && (double)velocity.X < 0.1 && (double)velocity.Y > -0.1 && (double)velocity.Y < 0.1 && !mount.Active)
24777 {
24778 if (stealthTimer == 0 && stealth > 0f)
24779 {
24780 stealth -= 0.015f;
24781 if ((double)stealth <= 0.0)
24782 {
24783 stealth = 0f;
24784 if (Main.netMode == 1)
24785 {
24786 NetMessage.SendData(84, -1, -1, null, whoAmI);
24787 }
24788 }
24789 }
24790 }
24791 else
24792 {
24793 float num29 = Math.Abs(velocity.X) + Math.Abs(velocity.Y);
24794 stealth += num29 * 0.0075f;
24795 if (stealth > 1f)
24796 {
24797 stealth = 1f;
24798 }
24799 if (mount.Active)
24800 {
24801 stealth = 1f;
24802 }
24803 }
24804 rangedDamage += (1f - stealth) * 0.6f;
24805 rangedCrit += (int)((1f - stealth) * 10f);
24806 aggro -= (int)((1f - stealth) * 750f);
24807 if (stealthTimer > 0)
24808 {
24809 stealthTimer--;
24810 }
24811 }
24812 else if (setVortex)
24813 {
24814 bool flag14 = false;
24816 {
24817 float num30 = stealth;
24818 stealth -= 0.04f;
24819 if (stealth < 0f)
24820 {
24821 stealth = 0f;
24822 }
24823 else
24824 {
24825 flag14 = true;
24826 }
24827 if (stealth == 0f && num30 != stealth && Main.netMode == 1)
24828 {
24829 NetMessage.SendData(84, -1, -1, null, whoAmI);
24830 }
24831 rangedDamage += (1f - stealth) * 0.8f;
24832 rangedCrit += (int)((1f - stealth) * 20f);
24833 aggro -= (int)((1f - stealth) * 1200f);
24834 accRunSpeed *= 0.3f;
24835 maxRunSpeed *= 0.3f;
24836 if (mount.Active)
24837 {
24838 vortexStealthActive = false;
24839 }
24840 }
24841 else
24842 {
24843 float num31 = stealth;
24844 stealth += 0.04f;
24845 if (stealth > 1f)
24846 {
24847 stealth = 1f;
24848 }
24849 else
24850 {
24851 flag14 = true;
24852 }
24853 if (stealth == 1f && num31 != stealth && Main.netMode == 1)
24854 {
24855 NetMessage.SendData(84, -1, -1, null, whoAmI);
24856 }
24857 }
24858 if (flag14)
24859 {
24860 if (Main.rand.Next(2) == 0)
24861 {
24862 Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
24863 Dust obj2 = Main.dust[Dust.NewDust(base.Center - vector * 30f, 0, 0, 229)];
24864 obj2.noGravity = true;
24865 obj2.position = base.Center - vector * Main.rand.Next(5, 11);
24866 obj2.velocity = vector.RotatedBy(1.5707963705062866) * 4f;
24867 obj2.scale = 0.5f + Main.rand.NextFloat();
24868 obj2.fadeIn = 0.5f;
24869 }
24870 if (Main.rand.Next(2) == 0)
24871 {
24872 Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
24873 Dust obj3 = Main.dust[Dust.NewDust(base.Center - vector2 * 30f, 0, 0, 240)];
24874 obj3.noGravity = true;
24875 obj3.position = base.Center - vector2 * 12f;
24876 obj3.velocity = vector2.RotatedBy(-1.5707963705062866) * 2f;
24877 obj3.scale = 0.5f + Main.rand.NextFloat();
24878 obj3.fadeIn = 0.5f;
24879 }
24880 }
24881 }
24882 else
24883 {
24884 stealth = 1f;
24885 }
24886 if (manaSick)
24887 {
24889 }
24890 float num32 = meleeSpeed - 1f;
24892 meleeSpeed = 1f + num32;
24893 if (tileSpeed > 3f)
24894 {
24895 tileSpeed = 3f;
24896 }
24897 tileSpeed = 1f / tileSpeed;
24898 if (wallSpeed > 3f)
24899 {
24900 wallSpeed = 3f;
24901 }
24902 wallSpeed = 1f / wallSpeed;
24903 if (statManaMax2 > 400)
24904 {
24905 statManaMax2 = 400;
24906 }
24907 if (statDefense < 0)
24908 {
24909 statDefense = 0;
24910 }
24911 if (slowOgreSpit)
24912 {
24913 moveSpeed /= 3f;
24914 if (velocity.Y == 0f && Math.Abs(velocity.X) > 1f)
24915 {
24916 velocity.X /= 2f;
24917 }
24918 }
24919 else if (dazed)
24920 {
24921 moveSpeed /= 3f;
24922 }
24923 else if (slow)
24924 {
24925 moveSpeed /= 2f;
24926 }
24927 else if (chilled)
24928 {
24929 moveSpeed *= 0.75f;
24930 }
24931 if (shieldRaised)
24932 {
24933 moveSpeed /= 3f;
24934 if (velocity.Y == 0f && Math.Abs(velocity.X) > 3f)
24935 {
24936 velocity.X /= 2f;
24937 }
24938 }
24939 if (DD2Event.Ongoing)
24940 {
24942 if (DD2Event.ShouldBlockBuilding(base.Center))
24943 {
24944 noBuilding = true;
24945 AddBuff(199, 3);
24946 }
24947 }
24948 if ((double)pickSpeed < 0.3)
24949 {
24950 pickSpeed = 0.3f;
24951 }
24954 soulDrain = 0;
24956 if (manaRegenCount < 0)
24957 {
24958 manaRegenCount = 0;
24959 }
24960 if (statMana > statManaMax2)
24961 {
24963 }
24967 for (int num33 = 0; num33 < maxBuffs; num33++)
24968 {
24969 if (buffType[num33] > 0 && buffTime[num33] > 0 && buffImmune[buffType[num33]])
24970 {
24971 DelBuff(num33);
24972 }
24973 }
24974 if (brokenArmor)
24975 {
24976 statDefense /= 2;
24977 }
24978 if (witheredArmor)
24979 {
24980 statDefense /= 2;
24981 }
24982 if (witheredWeapon)
24983 {
24984 meleeDamage *= 0.5f;
24985 rangedDamage *= 0.5f;
24986 magicDamage *= 0.5f;
24987 minionDamage *= 0.5f;
24988 rangedMultDamage *= 0.5f;
24989 }
24992 if (mount.Active)
24993 {
24995 }
24996 else
24997 {
24999 }
25001 {
25002 canJumpAgain_Cloud = false;
25003 canJumpAgain_Sandstorm = false;
25004 canJumpAgain_Blizzard = false;
25005 canJumpAgain_Fart = false;
25006 canJumpAgain_Sail = false;
25007 canJumpAgain_Unicorn = false;
25008 canJumpAgain_Santank = false;
25010 canJumpAgain_Basilisk = false;
25011 }
25012 else if (velocity.Y == 0f || sliding)
25013 {
25015 }
25016 else
25017 {
25019 {
25020 canJumpAgain_Cloud = false;
25021 }
25023 {
25024 canJumpAgain_Sandstorm = false;
25025 }
25027 {
25028 canJumpAgain_Blizzard = false;
25029 }
25030 if (!hasJumpOption_Fart)
25031 {
25032 canJumpAgain_Fart = false;
25033 }
25034 if (!hasJumpOption_Sail)
25035 {
25036 canJumpAgain_Sail = false;
25037 }
25039 {
25040 canJumpAgain_Unicorn = false;
25041 }
25043 {
25044 canJumpAgain_Santank = false;
25045 }
25047 {
25049 }
25051 {
25052 canJumpAgain_Basilisk = false;
25053 }
25054 }
25055 if (!carpet)
25056 {
25057 canCarpet = false;
25058 carpetFrame = -1;
25059 }
25060 else if (velocity.Y == 0f || sliding)
25061 {
25062 canCarpet = true;
25063 carpetTime = 0;
25064 carpetFrame = -1;
25065 carpetFrameCounter = 0f;
25066 }
25067 if (gravDir == -1f)
25068 {
25069 canCarpet = false;
25070 }
25071 if (ropeCount > 0)
25072 {
25073 ropeCount--;
25074 }
25075 if (!pulley && !frozen && !webbed && !stoned && !controlJump && gravDir == 1f && ropeCount == 0 && grappling[0] == -1 && !tongued && !mount.Active)
25076 {
25077 FindPulley();
25078 }
25080 sitting.UpdateSitting(this);
25081 sleeping.UpdateState(this);
25082 eyeHelper.Update(this);
25083 if (pulley)
25084 {
25085 if (mount.Active)
25086 {
25087 pulley = false;
25088 }
25089 sandStorm = false;
25091 int num34 = (int)(position.X + (float)(width / 2)) / 16;
25092 int num35 = (int)(position.Y - 8f) / 16;
25093 bool flag15 = false;
25094 if (pulleyDir == 0)
25095 {
25096 pulleyDir = 1;
25097 }
25098 if (pulleyDir == 1)
25099 {
25100 if (direction == -1 && controlLeft && (releaseLeft || leftTimer == 0))
25101 {
25102 pulleyDir = 2;
25103 flag15 = true;
25104 }
25105 else if ((direction == 1 && controlRight && releaseRight) || rightTimer == 0)
25106 {
25107 pulleyDir = 2;
25108 flag15 = true;
25109 }
25110 else
25111 {
25112 if (direction == 1 && controlLeft)
25113 {
25114 direction = -1;
25115 flag15 = true;
25116 }
25117 if (direction == -1 && controlRight)
25118 {
25119 direction = 1;
25120 flag15 = true;
25121 }
25122 }
25123 }
25124 else if (pulleyDir == 2)
25125 {
25126 if (direction == 1 && controlLeft)
25127 {
25128 flag15 = true;
25129 if (!Collision.SolidCollision(new Vector2(num34 * 16 + 8 - width / 2, position.Y), width, height))
25130 {
25131 pulleyDir = 1;
25132 direction = -1;
25133 flag15 = true;
25134 }
25135 }
25136 if (direction == -1 && controlRight)
25137 {
25138 flag15 = true;
25139 if (!Collision.SolidCollision(new Vector2(num34 * 16 + 8 - width / 2, position.Y), width, height))
25140 {
25141 pulleyDir = 1;
25142 direction = 1;
25143 flag15 = true;
25144 }
25145 }
25146 }
25147 int num36 = 1;
25148 if (controlLeft)
25149 {
25150 num36 = -1;
25151 }
25153 if (controlLeft && direction == -1 && flag16)
25154 {
25155 instantMovementAccumulatedThisFrame.X += -1f;
25156 }
25157 if (controlRight && direction == 1 && flag16)
25158 {
25159 instantMovementAccumulatedThisFrame.X += 1f;
25160 }
25161 bool flag17 = false;
25162 if (!flag15 && ((controlLeft && (releaseLeft || leftTimer == 0)) || (controlRight && (releaseRight || rightTimer == 0))))
25163 {
25164 int num37 = num34 + num36;
25165 if (WorldGen.IsRope(num37, num35))
25166 {
25167 pulleyDir = 1;
25168 direction = num36;
25169 int num38 = num37 * 16 + 8 - width / 2;
25170 float y4 = position.Y;
25171 y4 = num35 * 16 + 22;
25172 if (Main.tile[num37, num35 - 1] == null)
25173 {
25174 Main.tile[num37, num35 - 1] = new Tile();
25175 }
25176 if (Main.tile[num37, num35 + 1] == null)
25177 {
25178 Main.tile[num37, num35 + 1] = new Tile();
25179 }
25180 if (WorldGen.IsRope(num37, num35 - 1) || WorldGen.IsRope(num37, num35 + 1))
25181 {
25182 y4 = num35 * 16 + 22;
25183 }
25184 if (Collision.SolidCollision(new Vector2(num38, y4), width, height))
25185 {
25186 pulleyDir = 2;
25187 direction = -num36;
25188 num38 = ((direction != 1) ? (num37 * 16 + 8 - width / 2 + -6) : (num37 * 16 + 8 - width / 2 + 6));
25189 }
25190 if (i == Main.myPlayer)
25191 {
25192 Main.cameraX = Main.cameraX + position.X - (float)num38;
25193 }
25194 position.X = num38;
25195 gfxOffY = position.Y - y4;
25196 position.Y = y4;
25197 flag17 = true;
25198 }
25199 }
25201 {
25202 pulley = false;
25203 if (controlLeft && velocity.X == 0f)
25204 {
25205 velocity.X = -1f;
25206 }
25207 if (controlRight && velocity.X == 0f)
25208 {
25209 velocity.X = 1f;
25210 }
25211 }
25212 if (velocity.X != 0f)
25213 {
25214 pulley = false;
25215 }
25216 if (Main.tile[num34, num35] == null)
25217 {
25218 Main.tile[num34, num35] = new Tile();
25219 }
25220 if (!WorldGen.IsRope(num34, num35))
25221 {
25222 pulley = false;
25223 }
25224 if (gravDir != 1f)
25225 {
25226 pulley = false;
25227 }
25228 if (frozen || webbed || stoned)
25229 {
25230 pulley = false;
25231 }
25232 if (!pulley)
25233 {
25234 velocity.Y -= gravity;
25235 }
25236 if (controlJump)
25237 {
25238 pulley = false;
25239 jump = jumpHeight;
25240 velocity.Y = 0f - jumpSpeed;
25241 }
25242 }
25243 if (grapCount > 0)
25244 {
25245 pulley = false;
25246 }
25247 if (NPC.brainOfGravity >= 0 && NPC.brainOfGravity < 200 && Vector2.Distance(base.Center, Main.npc[NPC.brainOfGravity].Center) < 4000f)
25248 {
25249 forcedGravity = 10;
25250 }
25251 if (forcedGravity > 0)
25252 {
25253 gravDir = -1f;
25254 }
25255 if (pulley)
25256 {
25257 fallStart = (int)position.Y / 16;
25258 wingFrame = 0;
25259 if (wings == 4)
25260 {
25261 wingFrame = 3;
25262 }
25263 int num39 = (int)(position.X + (float)(width / 2)) / 16;
25264 int num40 = (int)(position.Y - 16f) / 16;
25265 int num41 = (int)(position.Y - 8f) / 16;
25266 bool flag18 = true;
25267 bool flag19 = false;
25268 if (WorldGen.IsRope(num39, num41 - 1) || WorldGen.IsRope(num39, num41 + 1))
25269 {
25270 flag19 = true;
25271 }
25272 if (Main.tile[num39, num40] == null)
25273 {
25274 Main.tile[num39, num40] = new Tile();
25275 }
25276 if (!WorldGen.IsRope(num39, num40))
25277 {
25278 flag18 = false;
25279 if (velocity.Y < 0f)
25280 {
25281 velocity.Y = 0f;
25282 }
25283 }
25284 if (flag19)
25285 {
25286 if (controlUp && flag18)
25287 {
25288 float x3 = position.X;
25289 float y5 = position.Y - Math.Abs(velocity.Y) - 2f;
25290 if (Collision.SolidCollision(new Vector2(x3, y5), width, height))
25291 {
25292 x3 = num39 * 16 + 8 - width / 2 + 6;
25293 if (!Collision.SolidCollision(new Vector2(x3, y5), width, (int)((float)height + Math.Abs(velocity.Y) + 2f)))
25294 {
25295 if (i == Main.myPlayer)
25296 {
25297 Main.cameraX = Main.cameraX + position.X - x3;
25298 }
25299 pulleyDir = 2;
25300 direction = 1;
25301 position.X = x3;
25302 velocity.X = 0f;
25303 }
25304 else
25305 {
25306 x3 = num39 * 16 + 8 - width / 2 + -6;
25307 if (!Collision.SolidCollision(new Vector2(x3, y5), width, (int)((float)height + Math.Abs(velocity.Y) + 2f)))
25308 {
25309 if (i == Main.myPlayer)
25310 {
25311 Main.cameraX = Main.cameraX + position.X - x3;
25312 }
25313 pulleyDir = 2;
25314 direction = -1;
25315 position.X = x3;
25316 velocity.X = 0f;
25317 }
25318 }
25319 }
25320 if (velocity.Y > 0f)
25321 {
25322 velocity.Y *= 0.7f;
25323 }
25324 if (velocity.Y > -3f)
25325 {
25326 velocity.Y -= 0.2f;
25327 }
25328 else
25329 {
25330 velocity.Y -= 0.02f;
25331 }
25332 if (velocity.Y < -8f)
25333 {
25334 velocity.Y = -8f;
25335 }
25336 }
25337 else if (controlDown)
25338 {
25339 float x4 = position.X;
25340 float y6 = position.Y;
25341 if (Collision.SolidCollision(new Vector2(x4, y6), width, (int)((float)height + Math.Abs(velocity.Y) + 2f)))
25342 {
25343 x4 = num39 * 16 + 8 - width / 2 + 6;
25344 if (!Collision.SolidCollision(new Vector2(x4, y6), width, (int)((float)height + Math.Abs(velocity.Y) + 2f)))
25345 {
25346 if (i == Main.myPlayer)
25347 {
25348 Main.cameraX = Main.cameraX + position.X - x4;
25349 }
25350 pulleyDir = 2;
25351 direction = 1;
25352 position.X = x4;
25353 velocity.X = 0f;
25354 }
25355 else
25356 {
25357 x4 = num39 * 16 + 8 - width / 2 + -6;
25358 if (!Collision.SolidCollision(new Vector2(x4, y6), width, (int)((float)height + Math.Abs(velocity.Y) + 2f)))
25359 {
25360 if (i == Main.myPlayer)
25361 {
25362 Main.cameraX = Main.cameraX + position.X - x4;
25363 }
25364 pulleyDir = 2;
25365 direction = -1;
25366 position.X = x4;
25367 velocity.X = 0f;
25368 }
25369 }
25370 }
25371 if (velocity.Y < 0f)
25372 {
25373 velocity.Y *= 0.7f;
25374 }
25375 if (velocity.Y < 3f)
25376 {
25377 velocity.Y += 0.2f;
25378 }
25379 else
25380 {
25381 velocity.Y += 0.1f;
25382 }
25383 if (velocity.Y > maxFallSpeed)
25384 {
25385 velocity.Y = maxFallSpeed;
25386 }
25387 }
25388 else
25389 {
25390 velocity.Y *= 0.7f;
25391 if ((double)velocity.Y > -0.1 && (double)velocity.Y < 0.1)
25392 {
25393 velocity.Y = 0f;
25394 }
25395 }
25396 }
25397 else if (controlDown)
25398 {
25399 ropeCount = 10;
25400 pulley = false;
25401 velocity.Y = 1f;
25402 }
25403 else
25404 {
25405 velocity.Y = 0f;
25406 position.Y = num40 * 16 + 22;
25407 }
25408 float num42 = num39 * 16 + 8 - width / 2;
25409 if (pulleyDir == 1)
25410 {
25411 num42 = num39 * 16 + 8 - width / 2;
25412 }
25413 if (pulleyDir == 2)
25414 {
25415 num42 = num39 * 16 + 8 - width / 2 + 6 * direction;
25416 }
25417 if (i == Main.myPlayer)
25418 {
25419 Main.cameraX += position.X - num42;
25420 Main.cameraX = MathHelper.Clamp(Main.cameraX, -32f, 32f);
25421 }
25422 position.X = num42;
25423 pulleyFrameCounter += Math.Abs(velocity.Y * 0.75f);
25424 if (velocity.Y != 0f)
25425 {
25426 pulleyFrameCounter += 0.75f;
25427 }
25428 if (pulleyFrameCounter > 10f)
25429 {
25430 pulleyFrame++;
25431 pulleyFrameCounter = 0f;
25432 }
25433 if (pulleyFrame > 1)
25434 {
25435 pulleyFrame = 0;
25436 }
25437 canCarpet = true;
25438 carpetFrame = -1;
25441 rocketDelay = 0;
25442 rocketFrame = false;
25443 canRocket = false;
25444 rocketRelease = false;
25445 DashMovement();
25447 }
25448 else if (grappling[0] == -1 && !tongued)
25449 {
25450 if (wingsLogic > 0 && velocity.Y != 0f && !merman && !mount.Active)
25451 {
25453 }
25454 if (empressBrooch)
25455 {
25456 runAcceleration *= 1.75f;
25457 }
25458 if (hasMagiluminescence && velocity.Y == 0f)
25459 {
25460 runAcceleration *= 1.75f;
25461 maxRunSpeed *= 1.15f;
25462 accRunSpeed *= 1.15f;
25463 runSlowdown *= 1.75f;
25464 }
25465 if (shadowArmor)
25466 {
25467 runAcceleration *= 1.75f;
25468 maxRunSpeed *= 1.15f;
25469 accRunSpeed *= 1.15f;
25470 runSlowdown *= 1.75f;
25471 }
25472 if (mount.Active && mount.Type == 43 && velocity.Y != 0f)
25473 {
25474 runSlowdown = 0f;
25475 }
25476 if (sticky)
25477 {
25478 maxRunSpeed *= 0.25f;
25479 runAcceleration *= 0.25f;
25480 runSlowdown *= 2f;
25481 if (velocity.X > maxRunSpeed)
25482 {
25483 velocity.X = maxRunSpeed;
25484 }
25485 if (velocity.X < 0f - maxRunSpeed)
25486 {
25487 velocity.X = 0f - maxRunSpeed;
25488 }
25489 }
25490 else if (powerrun)
25491 {
25492 maxRunSpeed *= 3.5f;
25493 runAcceleration *= 1f;
25494 runSlowdown *= 2f;
25495 }
25496 else if (runningOnSand && desertBoots)
25497 {
25498 float num43 = 1.75f;
25499 maxRunSpeed *= num43;
25500 accRunSpeed *= num43;
25502 runSlowdown *= num43;
25503 }
25504 else if (slippy2)
25505 {
25506 runAcceleration *= 0.6f;
25507 runSlowdown = 0f;
25508 if (iceSkate)
25509 {
25510 runAcceleration *= 3.5f;
25511 maxRunSpeed *= 1.25f;
25512 }
25513 }
25514 else if (slippy)
25515 {
25516 runAcceleration *= 0.7f;
25517 if (iceSkate)
25518 {
25519 runAcceleration *= 3.5f;
25520 maxRunSpeed *= 1.25f;
25521 }
25522 else
25523 {
25524 runSlowdown *= 0.1f;
25525 }
25526 }
25527 if (sandStorm)
25528 {
25529 runAcceleration *= 1.5f;
25530 maxRunSpeed *= 2f;
25531 }
25533 {
25534 runAcceleration *= 3f;
25535 maxRunSpeed *= 1.5f;
25536 }
25538 {
25539 runAcceleration *= 3f;
25540 maxRunSpeed *= 1.75f;
25541 }
25543 {
25544 runAcceleration *= 3f;
25545 maxRunSpeed *= 1.5f;
25546 }
25548 {
25549 runAcceleration *= 3f;
25550 maxRunSpeed *= 1.5f;
25551 }
25553 {
25554 runAcceleration *= 3f;
25555 maxRunSpeed *= 1.5f;
25556 }
25558 {
25559 runAcceleration *= 3f;
25560 maxRunSpeed *= 1.5f;
25561 }
25563 {
25564 runAcceleration *= 1.5f;
25565 maxRunSpeed *= 1.25f;
25566 }
25567 if (carpetFrame != -1)
25568 {
25569 runAcceleration *= 1.25f;
25570 maxRunSpeed *= 1.5f;
25571 }
25572 if (inventory[selectedItem].type == 3106 && stealth < 1f)
25573 {
25574 float num44 = maxRunSpeed / 2f * (1f - stealth);
25575 maxRunSpeed -= num44;
25577 }
25578 if (mount.Active)
25579 {
25580 rocketBoots = 0;
25582 wings = 0;
25583 wingsLogic = 0;
25587 if (mount.Type == 12 && !MountFishronSpecial)
25588 {
25589 runAcceleration /= 2f;
25590 maxRunSpeed /= 2f;
25591 }
25593 if (mount.Cart && velocity.Y == 0f)
25594 {
25595 if (!Minecart.OnTrack(position, width, height))
25596 {
25597 fullRotation = 0f;
25598 onWrongGround = true;
25599 runSlowdown = 0.2f;
25601 {
25602 mount.Dismount(this);
25603 }
25604 }
25605 else
25606 {
25608 onWrongGround = false;
25609 }
25610 }
25611 if (mount.Type == 8)
25612 {
25614 }
25615 }
25617 bool flag20 = !mount.Active;
25618 if (forcedGravity > 0)
25619 {
25620 gravDir = -1f;
25621 }
25622 else if (gravControl && flag20)
25623 {
25624 if (controlUp && releaseUp)
25625 {
25626 if (gravDir == 1f)
25627 {
25628 gravDir = -1f;
25629 fallStart = (int)(position.Y / 16f);
25630 jump = 0;
25632 }
25633 else
25634 {
25635 gravDir = 1f;
25636 fallStart = (int)(position.Y / 16f);
25637 jump = 0;
25639 }
25640 }
25641 }
25642 else if (gravControl2 && flag20)
25643 {
25644 if (controlUp && releaseUp)
25645 {
25646 if (gravDir == 1f)
25647 {
25648 gravDir = -1f;
25649 fallStart = (int)(position.Y / 16f);
25650 jump = 0;
25652 }
25653 else
25654 {
25655 gravDir = 1f;
25656 fallStart = (int)(position.Y / 16f);
25657 jump = 0;
25659 }
25660 }
25661 }
25662 else
25663 {
25664 gravDir = 1f;
25665 }
25666 if (velocity.Y == 0f && mount.Active && mount.CanHover() && controlUp && releaseUp)
25667 {
25668 velocity.Y = 0f - (mount.Acceleration + gravity + 0.001f);
25669 }
25671 sandStorm = false;
25672 JumpMovement();
25673 if (wingsLogic == 0)
25674 {
25675 wingTime = 0f;
25676 }
25677 if (rocketBoots == 0)
25678 {
25679 rocketTime = 0;
25680 }
25681 if (jump == 0)
25682 {
25684 }
25685 DashMovement();
25689 if (wingsLogic > 0 || mount.Active)
25690 {
25691 sandStorm = false;
25692 }
25693 if (((gravDir == 1f && velocity.Y > 0f - jumpSpeed) || (gravDir == -1f && velocity.Y < jumpSpeed)) && velocity.Y != 0f)
25694 {
25695 canRocket = true;
25696 }
25697 bool flag21 = false;
25698 if (((velocity.Y == 0f || sliding) && releaseJump) || (autoJump && justJumped))
25699 {
25702 }
25703 if (wingsLogic > 0 && controlJump && wingTime > 0f && jump == 0 && velocity.Y != 0f)
25704 {
25705 flag21 = true;
25706 }
25707 if ((wingsLogic == 22 || wingsLogic == 28 || wingsLogic == 30 || wingsLogic == 32 || wingsLogic == 29 || wingsLogic == 33 || wingsLogic == 35 || wingsLogic == 37 || wingsLogic == 45) && controlJump && TryingToHoverDown && wingTime > 0f)
25708 {
25709 flag21 = true;
25710 }
25711 if (frozen || webbed || stoned)
25712 {
25713 if (mount.Active)
25714 {
25715 mount.Dismount(this);
25716 }
25717 velocity.Y += gravity;
25718 if (velocity.Y > maxFallSpeed)
25719 {
25720 velocity.Y = maxFallSpeed;
25721 }
25722 sandStorm = false;
25724 }
25725 else
25726 {
25727 if (flag21)
25728 {
25730 WingMovement();
25731 }
25733 if (wingsLogic > 0 && rocketBoots != 0 && velocity.Y != 0f && rocketTime != 0)
25734 {
25735 int num45 = 6;
25736 int num46 = rocketTime * num45;
25737 wingTime += num46;
25738 if (wingTime > (float)(wingTimeMax + num46))
25739 {
25741 }
25742 rocketTime = 0;
25743 }
25744 if (flag21 && wings != 4 && wings != 22 && wings != 0 && wings != 24 && wings != 28 && wings != 30 && wings != 33 && wings != 45)
25745 {
25746 bool flag22 = wingFrame == 3;
25747 if (wings == 43 || wings == 44)
25748 {
25749 flag22 = wingFrame == 4;
25750 }
25751 if (flag22)
25752 {
25753 if (!flapSound)
25754 {
25756 }
25757 flapSound = true;
25758 }
25759 else
25760 {
25761 flapSound = false;
25762 }
25763 }
25764 if (velocity.Y == 0f || sliding || (autoJump && justJumped))
25765 {
25767 }
25768 if (empressBrooch)
25769 {
25771 }
25772 if ((wingTime == 0f || wingsLogic == 0) && rocketBoots != 0 && controlJump && rocketDelay == 0 && canRocket && rocketRelease && !canJumpAgain_Cloud)
25773 {
25774 if (rocketTime > 0)
25775 {
25776 rocketTime--;
25777 rocketDelay = 10;
25778 if (rocketDelay2 <= 0)
25779 {
25780 if (rocketBoots == 1)
25781 {
25782 rocketDelay2 = 30;
25783 }
25784 else if (rocketBoots == 2 || rocketBoots == 5 || rocketBoots == 3 || rocketBoots == 4)
25785 {
25786 rocketDelay2 = 15;
25787 }
25788 }
25789 if (rocketSoundDelay <= 0)
25790 {
25791 if (vanityRocketBoots == 1 || vanityRocketBoots == 5)
25792 {
25793 rocketSoundDelay = 30;
25795 }
25796 else if (vanityRocketBoots == 2 || vanityRocketBoots == 3 || vanityRocketBoots == 4)
25797 {
25798 rocketSoundDelay = 15;
25800 }
25801 }
25802 }
25803 else
25804 {
25805 canRocket = false;
25806 }
25807 }
25808 if (rocketSoundDelay > 0)
25809 {
25811 }
25812 if (rocketDelay2 > 0)
25813 {
25814 rocketDelay2--;
25815 }
25816 if (rocketDelay == 0)
25817 {
25818 rocketFrame = false;
25819 }
25820 if (rocketDelay > 0)
25821 {
25822 rocketFrame = true;
25824 if (rocketDelay == 0)
25825 {
25826 releaseJump = true;
25827 }
25828 rocketDelay--;
25829 velocity.Y -= 0.1f * gravDir;
25830 if (gravDir == 1f)
25831 {
25832 if (velocity.Y > 0f)
25833 {
25834 velocity.Y -= 0.5f;
25835 }
25836 else if ((double)velocity.Y > (double)(0f - jumpSpeed) * 0.5)
25837 {
25838 velocity.Y -= 0.1f;
25839 }
25840 if (velocity.Y < (0f - jumpSpeed) * 1.5f)
25841 {
25842 velocity.Y = (0f - jumpSpeed) * 1.5f;
25843 }
25844 }
25845 else
25846 {
25847 if (velocity.Y < 0f)
25848 {
25849 velocity.Y += 0.5f;
25850 }
25851 else if ((double)velocity.Y < (double)jumpSpeed * 0.5)
25852 {
25853 velocity.Y += 0.1f;
25854 }
25855 if (velocity.Y > jumpSpeed * 1.5f)
25856 {
25857 velocity.Y = jumpSpeed * 1.5f;
25858 }
25859 }
25860 }
25861 else if (!flag21)
25862 {
25863 if (mount.CanHover())
25864 {
25865 mount.Hover(this);
25866 }
25867 else if (mount.CanFly() && controlJump && jump == 0)
25868 {
25869 if (mount.Flight())
25870 {
25872 {
25873 velocity.Y *= 0.9f;
25874 if (velocity.Y > -1f && (double)velocity.Y < 0.5)
25875 {
25876 velocity.Y = 1E-05f;
25877 }
25878 }
25879 else
25880 {
25881 float num47 = jumpSpeed;
25882 if (mount.Type == 50)
25883 {
25884 num47 *= 0.5f;
25885 }
25886 if (velocity.Y > 0f)
25887 {
25888 velocity.Y -= 0.5f;
25889 }
25890 else if ((double)velocity.Y > (double)(0f - num47) * 1.5)
25891 {
25892 velocity.Y -= 0.1f;
25893 }
25894 if (velocity.Y < (0f - num47) * 1.5f)
25895 {
25896 velocity.Y = (0f - num47) * 1.5f;
25897 }
25898 }
25899 }
25900 else
25901 {
25902 velocity.Y += gravity / 3f * gravDir;
25903 if (gravDir == 1f)
25904 {
25906 {
25907 velocity.Y = maxFallSpeed / 3f;
25908 }
25909 }
25910 else if (velocity.Y < (0f - maxFallSpeed) / 3f && !TryingToHoverUp)
25911 {
25912 velocity.Y = (0f - maxFallSpeed) / 3f;
25913 }
25914 }
25915 }
25916 else if (slowFall && !TryingToHoverDown)
25917 {
25918 if (TryingToHoverUp)
25919 {
25920 gravity = gravity / 10f * gravDir;
25921 }
25922 else
25923 {
25924 gravity = gravity / 3f * gravDir;
25925 }
25926 velocity.Y += gravity;
25927 }
25928 else if (wingsLogic > 0 && controlJump && velocity.Y > 0f)
25929 {
25930 bool noLightEmittence = wingsLogic != wings;
25931 fallStart = (int)(position.Y / 16f);
25932 if (velocity.Y > 0f)
25933 {
25934 if (wings == 10 && Main.rand.Next(3) == 0)
25935 {
25936 int num48 = 4;
25937 if (direction == 1)
25938 {
25939 num48 = -40;
25940 }
25941 int num49 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num48, position.Y + (float)(height / 2) - 15f), 30, 30, 76, 0f, 0f, 50, default(Color), 0.6f);
25942 Main.dust[num49].fadeIn = 1.1f;
25943 Main.dust[num49].noGravity = true;
25944 Main.dust[num49].noLight = true;
25945 Main.dust[num49].velocity *= 0.3f;
25946 Main.dust[num49].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
25947 }
25948 if (wings == 34 && ShouldDrawWingsThatAreAlwaysAnimated() && Main.rand.Next(3) == 0)
25949 {
25950 int num50 = 4;
25951 if (direction == 1)
25952 {
25953 num50 = -40;
25954 }
25955 int num51 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num50, position.Y + (float)(height / 2) - 15f), 30, 30, 261, 0f, 0f, 50, default(Color), 0.6f);
25956 Main.dust[num51].fadeIn = 1.1f;
25957 Main.dust[num51].noGravity = true;
25958 Main.dust[num51].noLight = true;
25959 Main.dust[num51].noLightEmittence = noLightEmittence;
25960 Main.dust[num51].velocity *= 0.3f;
25961 Main.dust[num51].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
25962 }
25963 if (wings == 40)
25964 {
25966 }
25967 if (wings == 44)
25968 {
25970 }
25971 if (wings == 9 && Main.rand.Next(3) == 0)
25972 {
25973 int num52 = 8;
25974 if (direction == 1)
25975 {
25976 num52 = -40;
25977 }
25978 int num53 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num52, position.Y + (float)(height / 2) - 15f), 30, 30, 6, 0f, 0f, 200, default(Color), 2f);
25979 Main.dust[num53].noGravity = true;
25980 Main.dust[num53].velocity *= 0.3f;
25981 Main.dust[num53].noLightEmittence = noLightEmittence;
25982 Main.dust[num53].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
25983 }
25984 if (wings == 29 && Main.rand.Next(3) == 0)
25985 {
25986 int num54 = 8;
25987 if (direction == 1)
25988 {
25989 num54 = -40;
25990 }
25991 int num55 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num54, position.Y + (float)(height / 2) - 15f), 30, 30, 6, 0f, 0f, 100, default(Color), 2.4f);
25992 Main.dust[num55].noGravity = true;
25993 Main.dust[num55].velocity *= 0.3f;
25994 Main.dust[num55].noLightEmittence = noLightEmittence;
25995 if (Main.rand.Next(10) == 0)
25996 {
25997 Main.dust[num55].fadeIn = 2f;
25998 }
25999 Main.dust[num55].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26000 }
26001 if (wings == 6)
26002 {
26003 if (Main.rand.Next(10) == 0)
26004 {
26005 int num56 = 4;
26006 if (direction == 1)
26007 {
26008 num56 = -40;
26009 }
26010 int num57 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num56, position.Y + (float)(height / 2) - 12f), 30, 20, 55, 0f, 0f, 200);
26011 Main.dust[num57].noLightEmittence = noLightEmittence;
26012 Main.dust[num57].velocity *= 0.3f;
26013 Main.dust[num57].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26014 }
26015 }
26016 else if (wings == 5 && Main.rand.Next(6) == 0)
26017 {
26018 int num58 = 6;
26019 if (direction == 1)
26020 {
26021 num58 = -30;
26022 }
26023 int num59 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num58, position.Y), 18, height, 58, 0f, 0f, 255, default(Color), 1.2f);
26024 Main.dust[num59].velocity *= 0.3f;
26025 Main.dust[num59].noLightEmittence = noLightEmittence;
26026 Main.dust[num59].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26027 }
26028 if (wings == 4)
26029 {
26030 rocketDelay2--;
26031 if (rocketDelay2 <= 0)
26032 {
26034 rocketDelay2 = 60;
26035 }
26036 int type = 6;
26037 float scale = 1.5f;
26038 int alpha = 100;
26039 float x5 = position.X + (float)(width / 2) + 16f;
26040 if (direction > 0)
26041 {
26042 x5 = position.X + (float)(width / 2) - 26f;
26043 }
26044 float num60 = position.Y + (float)height - 18f;
26045 if (Main.rand.Next(2) == 1)
26046 {
26047 x5 = position.X + (float)(width / 2) + 8f;
26048 if (direction > 0)
26049 {
26050 x5 = position.X + (float)(width / 2) - 20f;
26051 }
26052 num60 += 6f;
26053 }
26054 int num61 = Dust.NewDust(new Vector2(x5, num60), 8, 8, type, 0f, 0f, alpha, default(Color), scale);
26055 Main.dust[num61].velocity.X *= 0.3f;
26056 Main.dust[num61].velocity.Y += 10f;
26057 Main.dust[num61].noGravity = true;
26058 Main.dust[num61].noLightEmittence = noLightEmittence;
26059 Main.dust[num61].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26061 if (wingFrameCounter > 4)
26062 {
26063 wingFrame++;
26064 wingFrameCounter = 0;
26065 if (wingFrame >= 3)
26066 {
26067 wingFrame = 0;
26068 }
26069 }
26070 }
26071 else if (wings != 22 && wings != 28)
26072 {
26073 if (wings == 30)
26074 {
26076 int num62 = 5;
26077 if (wingFrameCounter >= num62 * 3)
26078 {
26079 wingFrameCounter = 0;
26080 }
26082 }
26083 else if (wings == 34)
26084 {
26086 int num63 = 7;
26087 if (wingFrameCounter >= num63 * 6)
26088 {
26089 wingFrameCounter = 0;
26090 }
26092 }
26093 else if (wings != 45)
26094 {
26095 if (wings == 40)
26096 {
26097 wingFrame = 0;
26098 }
26099 else if (wings == 44)
26100 {
26101 wingFrame = 2;
26102 }
26103 else if (wings == 39)
26104 {
26106 int num64 = 12;
26107 if (wingFrameCounter >= num64 * 6)
26108 {
26109 wingFrameCounter = 0;
26110 }
26112 }
26113 else if (wings == 26)
26114 {
26115 int num65 = 6;
26116 if (direction == 1)
26117 {
26118 num65 = -30;
26119 }
26120 int num66 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num65, position.Y), 18, height, 217, 0f, 0f, 100, default(Color), 1.4f);
26121 Main.dust[num66].noGravity = true;
26122 Main.dust[num66].noLight = true;
26123 Main.dust[num66].velocity /= 4f;
26124 Main.dust[num66].velocity -= velocity;
26125 Main.dust[num66].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26126 if (Main.rand.Next(2) == 0)
26127 {
26128 num65 = -24;
26129 if (direction == 1)
26130 {
26131 num65 = 12;
26132 }
26133 float num67 = position.Y;
26134 if (gravDir == -1f)
26135 {
26136 num67 += (float)(height / 2);
26137 }
26138 num66 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num65, num67), 12, height / 2, 217, 0f, 0f, 100, default(Color), 1.4f);
26139 Main.dust[num66].noGravity = true;
26140 Main.dust[num66].noLight = true;
26141 Main.dust[num66].velocity /= 4f;
26142 Main.dust[num66].velocity -= velocity;
26143 Main.dust[num66].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26144 }
26145 wingFrame = 2;
26146 }
26147 else if (wings == 37)
26148 {
26149 Color color = Color.Lerp(Color.Black, Color.White, Main.rand.NextFloat());
26150 int num68 = 6;
26151 if (direction == 1)
26152 {
26153 num68 = -30;
26154 }
26155 int num69 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num68, position.Y), 24, height, Utils.SelectRandom<int>(Main.rand, 31, 31, 31), 0f, 0f, 100, default(Color), 0.7f);
26156 Main.dust[num69].noGravity = true;
26157 Main.dust[num69].noLight = true;
26158 Main.dust[num69].velocity /= 4f;
26159 Main.dust[num69].velocity -= velocity;
26160 Main.dust[num69].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26161 if (Main.dust[num69].type == 55)
26162 {
26163 Main.dust[num69].color = color;
26164 }
26165 if (Main.rand.Next(3) == 0)
26166 {
26167 num68 = -24;
26168 if (direction == 1)
26169 {
26170 num68 = 12;
26171 }
26172 float num70 = position.Y;
26173 if (gravDir == -1f)
26174 {
26175 num70 += (float)(height / 2);
26176 }
26177 num69 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num68, num70), 12, height / 2, Utils.SelectRandom<int>(Main.rand, 31, 31, 31), 0f, 0f, 140, default(Color), 0.7f);
26178 Main.dust[num69].noGravity = true;
26179 Main.dust[num69].noLight = true;
26180 Main.dust[num69].velocity /= 4f;
26181 Main.dust[num69].velocity -= velocity;
26182 Main.dust[num69].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
26183 if (Main.dust[num69].type == 55)
26184 {
26185 Main.dust[num69].color = color;
26186 }
26187 }
26188 wingFrame = 2;
26189 }
26190 else if (wings != 24)
26191 {
26192 if (wings == 43)
26193 {
26194 wingFrame = 1;
26195 }
26196 else if (wings == 12)
26197 {
26198 wingFrame = 3;
26199 }
26200 else
26201 {
26202 wingFrame = 2;
26203 }
26204 }
26205 }
26206 }
26207 }
26208 velocity.Y += gravity / 3f * gravDir;
26209 if (gravDir == 1f)
26210 {
26212 {
26213 velocity.Y = maxFallSpeed / 3f;
26214 }
26215 }
26216 else if (velocity.Y < (0f - maxFallSpeed) / 3f && !TryingToHoverUp)
26217 {
26218 velocity.Y = (0f - maxFallSpeed) / 3f;
26219 }
26220 }
26221 else if (cartRampTime <= 0)
26222 {
26223 velocity.Y += gravity * gravDir;
26224 }
26225 else
26226 {
26227 cartRampTime--;
26228 }
26229 }
26230 if (!mount.Active || mount.Type != 5)
26231 {
26232 if (gravDir == 1f)
26233 {
26234 if (velocity.Y > maxFallSpeed)
26235 {
26236 velocity.Y = maxFallSpeed;
26237 }
26239 {
26240 velocity.Y = maxFallSpeed / 3f;
26241 }
26243 {
26244 velocity.Y = maxFallSpeed / 10f;
26245 }
26246 }
26247 else
26248 {
26249 if (velocity.Y < 0f - maxFallSpeed)
26250 {
26251 velocity.Y = 0f - maxFallSpeed;
26252 }
26253 if (slowFall && velocity.Y < (0f - maxFallSpeed) / 3f && !TryingToHoverDown)
26254 {
26255 velocity.Y = (0f - maxFallSpeed) / 3f;
26256 }
26257 if (slowFall && velocity.Y < (0f - maxFallSpeed) / 5f && TryingToHoverUp)
26258 {
26259 velocity.Y = (0f - maxFallSpeed) / 10f;
26260 }
26261 }
26262 }
26263 }
26264 }
26265 else
26266 {
26268 }
26269 if (mount.Active)
26270 {
26271 wingFrame = 0;
26272 }
26273 if ((wingsLogic == 22 || wingsLogic == 28 || wingsLogic == 30 || wingsLogic == 31 || wingsLogic == 33 || wingsLogic == 35 || wingsLogic == 37 || wingsLogic == 45) && TryingToHoverDown && controlJump && wingTime > 0f && !merman)
26274 {
26275 float num71 = 0.9f;
26276 if (wingsLogic == 45)
26277 {
26278 num71 = 0.8f;
26279 }
26280 velocity.Y *= num71;
26281 if (velocity.Y > -2f && velocity.Y < 1f)
26282 {
26283 velocity.Y = 1E-05f;
26284 }
26285 }
26286 if (wingsLogic == 37 && TryingToHoverDown && controlJump && wingTime > 0f && !merman)
26287 {
26288 velocity.Y *= 0.92f;
26289 if (velocity.Y > -2f && velocity.Y < 1f)
26290 {
26291 velocity.Y = 1E-05f;
26292 }
26293 }
26294 GrabItems(i);
26296 if (tongued)
26297 {
26299 bool flag23 = false;
26300 if (Main.wofNPCIndex >= 0)
26301 {
26302 NPC nPC = Main.npc[Main.wofNPCIndex];
26303 float num72 = nPC.Center.X + (float)(nPC.direction * 200);
26304 float y7 = nPC.Center.Y;
26305 Vector2 center = base.Center;
26306 float num73 = num72 - center.X;
26307 float num74 = y7 - center.Y;
26308 float num75 = (float)Math.Sqrt(num73 * num73 + num74 * num74);
26309 float num76 = 11f;
26310 if (Main.expertMode)
26311 {
26312 float value = 22f;
26313 float amount = Math.Min(1f, nPC.velocity.Length() / 5f);
26315 }
26316 float num77 = num75;
26317 if (num75 > num76)
26318 {
26319 num77 = num76 / num75;
26320 }
26321 else
26322 {
26323 num77 = 1f;
26324 flag23 = true;
26325 }
26326 num73 *= num77;
26327 num74 *= num77;
26328 velocity.X = num73;
26329 velocity.Y = num74;
26330 }
26331 else
26332 {
26333 flag23 = true;
26334 }
26335 if (flag23 && Main.myPlayer == whoAmI)
26336 {
26337 for (int num78 = 0; num78 < maxBuffs; num78++)
26338 {
26339 if (buffType[num78] == 38)
26340 {
26341 DelBuff(num78);
26342 }
26343 }
26344 }
26345 }
26346 if (Main.myPlayer == whoAmI)
26347 {
26348 WOFTongue();
26349 if (controlHook)
26350 {
26351 if (releaseHook)
26352 {
26353 QuickGrapple();
26354 }
26355 releaseHook = false;
26356 }
26357 else
26358 {
26359 releaseHook = true;
26360 }
26361 if (talkNPC >= 0)
26362 {
26363 Rectangle rectangle = new Rectangle((int)(position.X + (float)(width / 2) - (float)(tileRangeX * 16)), (int)(position.Y + (float)(height / 2) - (float)(tileRangeY * 16)), tileRangeX * 16 * 2, tileRangeY * 16 * 2);
26364 Rectangle value2 = new Rectangle((int)Main.npc[talkNPC].position.X, (int)Main.npc[talkNPC].position.Y, Main.npc[talkNPC].width, Main.npc[talkNPC].height);
26365 if (!rectangle.Intersects(value2) || chest != -1 || !Main.npc[talkNPC].active || tileEntityAnchor.InUse)
26366 {
26367 if (chest == -1)
26368 {
26370 }
26371 SetTalkNPC(-1);
26372 Main.npcChatCornerItem = 0;
26373 Main.npcChatText = "";
26374 }
26375 }
26376 if (sign >= 0)
26377 {
26378 Rectangle value3 = new Rectangle((int)(position.X + (float)(width / 2) - (float)(tileRangeX * 16)), (int)(position.Y + (float)(height / 2) - (float)(tileRangeY * 16)), tileRangeX * 16 * 2, tileRangeY * 16 * 2);
26379 try
26380 {
26381 bool flag24 = false;
26382 if (Main.sign[sign] == null)
26383 {
26384 flag24 = true;
26385 }
26386 if (!flag24 && !new Rectangle(Main.sign[sign].x * 16, Main.sign[sign].y * 16, 32, 32).Intersects(value3))
26387 {
26388 flag24 = true;
26389 }
26390 if (flag24)
26391 {
26393 sign = -1;
26394 Main.editSign = false;
26395 Main.npcChatText = "";
26396 }
26397 }
26398 catch
26399 {
26401 sign = -1;
26402 Main.editSign = false;
26403 Main.npcChatText = "";
26404 }
26405 }
26406 if (Main.editSign)
26407 {
26408 if (sign == -1)
26409 {
26410 Main.editSign = false;
26411 }
26412 else
26413 {
26414 Main.InputTextSign();
26415 }
26416 }
26417 else if (Main.editChest)
26418 {
26419 Main.InputTextChest();
26420 if (Main.player[Main.myPlayer].chest == -1)
26421 {
26422 Main.editChest = false;
26423 }
26424 }
26425 if (mount.Active && mount.Cart && velocity.Length() > 4f)
26426 {
26428 if (velocity.X < -1f)
26429 {
26430 rectangle2.X -= 15;
26431 }
26432 if (velocity.X > 1f)
26433 {
26434 rectangle2.Width += 15;
26435 }
26436 if (velocity.X < -10f)
26437 {
26438 rectangle2.X -= 10;
26439 }
26440 if (velocity.X > 10f)
26441 {
26442 rectangle2.Width += 10;
26443 }
26444 if (velocity.Y < -1f)
26445 {
26446 rectangle2.Y -= 10;
26447 }
26448 if (velocity.Y > 1f)
26449 {
26450 rectangle2.Height += 10;
26451 }
26452 for (int num79 = 0; num79 < 200; num79++)
26453 {
26454 if (Main.npc[num79].active && !Main.npc[num79].dontTakeDamage && !Main.npc[num79].friendly && Main.npc[num79].immune[i] == 0 && CanNPCBeHitByPlayerOrPlayerProjectile(Main.npc[num79]) && rectangle2.Intersects(new Rectangle((int)Main.npc[num79].position.X, (int)Main.npc[num79].position.Y, Main.npc[num79].width, Main.npc[num79].height)))
26455 {
26456 float num80 = meleeCrit;
26457 if (num80 < (float)rangedCrit)
26458 {
26459 num80 = rangedCrit;
26460 }
26461 if (num80 < (float)magicCrit)
26462 {
26463 num80 = magicCrit;
26464 }
26465 bool crit = false;
26466 if ((float)Main.rand.Next(1, 101) <= num80)
26467 {
26468 crit = true;
26469 }
26472 int num81 = 1;
26473 if (velocity.X < 0f)
26474 {
26475 num81 = -1;
26476 }
26477 if (Main.npc[num79].knockBackResist < 1f && Main.npc[num79].knockBackResist > 0f)
26478 {
26479 knockback /= Main.npc[num79].knockBackResist;
26480 }
26481 if (whoAmI == Main.myPlayer)
26482 {
26483 ApplyDamageToNPC(Main.npc[num79], damage2, knockback, num81, crit);
26484 }
26485 Main.npc[num79].immune[i] = 30;
26486 if (!Main.npc[num79].active)
26487 {
26489 }
26490 }
26491 }
26492 }
26494 if (!shimmering)
26495 {
26496 Collision.HurtTile hurtTile = GetHurtTile();
26497 if (hurtTile.type >= 0)
26498 {
26500 }
26501 }
26503 }
26504 if (controlRight)
26505 {
26506 releaseRight = false;
26507 }
26508 else
26509 {
26510 releaseRight = true;
26511 rightTimer = 7;
26512 }
26513 if (controlLeft)
26514 {
26515 releaseLeft = false;
26516 }
26517 else
26518 {
26519 releaseLeft = true;
26520 leftTimer = 7;
26521 }
26523 if (rightTimer > 0)
26524 {
26525 rightTimer--;
26526 }
26527 else if (controlRight)
26528 {
26529 rightTimer = 7;
26530 }
26531 if (leftTimer > 0)
26532 {
26533 leftTimer--;
26534 }
26535 else if (controlLeft)
26536 {
26537 leftTimer = 7;
26538 }
26541 CheckDrowning();
26542 if (gravDir == -1f)
26543 {
26544 waterWalk = false;
26545 waterWalk2 = false;
26546 }
26547 int num82 = height;
26548 if (waterWalk)
26549 {
26550 num82 -= 6;
26551 }
26552 bool flag25 = false;
26553 if (!shimmering)
26554 {
26555 flag25 = Collision.LavaCollision(position, width, num82);
26556 }
26557 if (flag25)
26558 {
26559 if (!lavaImmune && Main.myPlayer == i && hurtCooldowns[4] <= 0)
26560 {
26561 if (lavaTime > 0)
26562 {
26563 lavaTime--;
26564 }
26565 else
26566 {
26567 int num83 = 80;
26568 int num84 = 420;
26569 if (Main.remixWorld)
26570 {
26571 num83 = 200;
26572 num84 = 630;
26573 }
26574 if (!ashWoodBonus || !lavaRose)
26575 {
26576 if (ashWoodBonus)
26577 {
26578 if (Main.remixWorld)
26579 {
26580 num83 = 145;
26581 }
26582 num83 /= 2;
26583 num84 -= 210;
26584 }
26585 if (lavaRose)
26586 {
26587 num83 -= 45;
26588 num84 -= 210;
26589 }
26590 if (num83 > 0)
26591 {
26593 }
26594 if (num84 > 0)
26595 {
26596 AddBuff(24, num84);
26597 }
26598 }
26599 }
26600 }
26601 lavaWet = true;
26602 }
26603 else
26604 {
26605 lavaWet = false;
26606 if (lavaTime < lavaMax)
26607 {
26608 lavaTime++;
26609 }
26610 }
26611 if (lavaTime > lavaMax)
26612 {
26613 lavaTime = lavaMax;
26614 }
26615 if (waterWalk2 && !waterWalk)
26616 {
26617 num82 -= 6;
26618 }
26619 bool num85 = Collision.WetCollision(position, width, height);
26620 bool flag26 = Collision.honey;
26621 bool shimmer = Collision.shimmer;
26622 if (shimmer)
26623 {
26624 shimmerWet = true;
26625 if (whoAmI == Main.myPlayer && !shimmerImmune && !shimmerUnstuckHelper.ShouldUnstuck)
26626 {
26627 int num86 = (int)(base.Center.X / 16f);
26628 int num87 = (int)((position.Y + 1f) / 16f);
26629 if (Main.tile[num86, num87] != null && Main.tile[num86, num87].shimmer() && Main.tile[num86, num87].liquid >= 0 && position.Y / 16f < (float)Main.UnderworldLayer)
26630 {
26631 AddBuff(353, 60);
26632 }
26633 }
26634 }
26635 if (flag26 && !shimmering)
26636 {
26637 AddBuff(48, 1800);
26638 honeyWet = true;
26639 }
26640 if (num85)
26641 {
26642 if ((onFire || onFire3) && !lavaWet)
26643 {
26644 for (int num88 = 0; num88 < maxBuffs; num88++)
26645 {
26646 int num89 = buffType[num88];
26647 if (num89 == 24 || num89 == 323)
26648 {
26649 DelBuff(num88);
26650 }
26651 }
26652 }
26653 if (!wet)
26654 {
26655 if (wetCount == 0)
26656 {
26657 wetCount = 10;
26658 if (!shimmering)
26659 {
26660 if (!flag25)
26661 {
26662 if (shimmerWet)
26663 {
26664 for (int num90 = 0; num90 < 50; num90++)
26665 {
26666 int num91 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2)), width + 12, 24, 308);
26667 Main.dust[num91].velocity.Y -= 4f;
26668 Main.dust[num91].velocity.X *= 2.5f;
26669 Main.dust[num91].scale = 0.8f;
26670 Main.dust[num91].noGravity = true;
26671 switch (Main.rand.Next(6))
26672 {
26673 case 0:
26674 Main.dust[num91].color = new Color(255, 255, 210);
26675 break;
26676 case 1:
26677 Main.dust[num91].color = new Color(190, 245, 255);
26678 break;
26679 case 2:
26680 Main.dust[num91].color = new Color(255, 150, 255);
26681 break;
26682 default:
26683 Main.dust[num91].color = new Color(190, 175, 255);
26684 break;
26685 }
26686 }
26687 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y, 2);
26688 }
26689 else if (honeyWet)
26690 {
26691 for (int num92 = 0; num92 < 20; num92++)
26692 {
26693 int num93 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2) - 8f), width + 12, 24, 152);
26694 Main.dust[num93].velocity.Y -= 1f;
26695 Main.dust[num93].velocity.X *= 2.5f;
26696 Main.dust[num93].scale = 1.3f;
26697 Main.dust[num93].alpha = 100;
26698 Main.dust[num93].noGravity = true;
26699 }
26700 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y);
26701 }
26702 else
26703 {
26704 for (int num94 = 0; num94 < 50; num94++)
26705 {
26706 int num95 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2) - 8f), width + 12, 24, Dust.dustWater());
26707 Main.dust[num95].velocity.Y -= 3f;
26708 Main.dust[num95].velocity.X *= 2.5f;
26709 Main.dust[num95].scale = 0.8f;
26710 Main.dust[num95].alpha = 100;
26711 Main.dust[num95].noGravity = true;
26712 }
26713 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y, 0);
26714 }
26715 }
26716 else
26717 {
26718 for (int num96 = 0; num96 < 20; num96++)
26719 {
26720 int num97 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2) - 8f), width + 12, 24, 35);
26721 Main.dust[num97].velocity.Y -= 1.5f;
26722 Main.dust[num97].velocity.X *= 2.5f;
26723 Main.dust[num97].scale = 1.3f;
26724 Main.dust[num97].alpha = 100;
26725 Main.dust[num97].noGravity = true;
26726 }
26727 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y);
26728 }
26729 }
26730 }
26731 wet = true;
26733 {
26734 velocity.Y /= 2f;
26735 if (velocity.Y > 3f)
26736 {
26737 velocity.Y = 3f;
26738 }
26739 }
26740 }
26741 }
26742 else if (wet)
26743 {
26744 wet = false;
26745 if (jump > jumpHeight / 5 && wetSlime == 0)
26746 {
26747 jump = jumpHeight / 5;
26748 }
26749 if (wetCount == 0)
26750 {
26751 wetCount = 10;
26752 if (!shimmering)
26753 {
26754 if (!lavaWet)
26755 {
26756 if (shimmerWet)
26757 {
26758 for (int num98 = 0; num98 < 50; num98++)
26759 {
26760 int num99 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2)), width + 12, 24, 308);
26761 Main.dust[num99].velocity.Y -= 4f;
26762 Main.dust[num99].velocity.X *= 2.5f;
26763 Main.dust[num99].scale = 0.75f;
26764 Main.dust[num99].noGravity = true;
26765 switch (Main.rand.Next(6))
26766 {
26767 case 0:
26768 Main.dust[num99].color = new Color(255, 255, 210);
26769 break;
26770 case 1:
26771 Main.dust[num99].color = new Color(190, 245, 255);
26772 break;
26773 case 2:
26774 Main.dust[num99].color = new Color(255, 150, 255);
26775 break;
26776 default:
26777 Main.dust[num99].color = new Color(190, 175, 255);
26778 break;
26779 }
26780 }
26781 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y, 3);
26782 }
26783 else if (honeyWet)
26784 {
26785 for (int num100 = 0; num100 < 20; num100++)
26786 {
26787 int num101 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2) - 8f), width + 12, 24, 152);
26788 Main.dust[num101].velocity.Y -= 1f;
26789 Main.dust[num101].velocity.X *= 2.5f;
26790 Main.dust[num101].scale = 1.3f;
26791 Main.dust[num101].alpha = 100;
26792 Main.dust[num101].noGravity = true;
26793 }
26794 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y);
26795 }
26796 else
26797 {
26798 for (int num102 = 0; num102 < 50; num102++)
26799 {
26800 int num103 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2)), width + 12, 24, Dust.dustWater());
26801 Main.dust[num103].velocity.Y -= 4f;
26802 Main.dust[num103].velocity.X *= 2.5f;
26803 Main.dust[num103].scale = 0.8f;
26804 Main.dust[num103].alpha = 100;
26805 Main.dust[num103].noGravity = true;
26806 }
26807 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y, 0);
26808 }
26809 }
26810 else
26811 {
26812 for (int num104 = 0; num104 < 20; num104++)
26813 {
26814 int num105 = Dust.NewDust(new Vector2(position.X - 6f, position.Y + (float)(height / 2) - 8f), width + 12, 24, 35);
26815 Main.dust[num105].velocity.Y -= 1.5f;
26816 Main.dust[num105].velocity.X *= 2.5f;
26817 Main.dust[num105].scale = 1.3f;
26818 Main.dust[num105].alpha = 100;
26819 Main.dust[num105].noGravity = true;
26820 }
26821 SoundEngine.PlaySound(19, (int)position.X, (int)position.Y);
26822 }
26823 }
26824 }
26825 }
26826 if (!flag26)
26827 {
26828 honeyWet = false;
26829 }
26830 if (!shimmer)
26831 {
26832 shimmerWet = false;
26833 }
26834 if (!wet)
26835 {
26836 lavaWet = false;
26837 honeyWet = false;
26838 shimmerWet = false;
26839 }
26840 if (wetCount > 0)
26841 {
26842 wetCount--;
26843 }
26844 if (wetSlime > 0)
26845 {
26846 wetSlime--;
26847 }
26848 if (wet && mount.Active)
26849 {
26850 switch (mount.Type)
26851 {
26852 case 5:
26853 case 7:
26854 if (whoAmI == Main.myPlayer)
26855 {
26856 mount.Dismount(this);
26857 }
26858 break;
26859 case 3:
26860 case 50:
26861 wetSlime = 30;
26862 if (velocity.Y > 2f)
26863 {
26864 velocity.Y *= 0.9f;
26865 }
26866 velocity.Y -= 0.5f;
26867 if (velocity.Y < -4f)
26868 {
26869 velocity.Y = -4f;
26870 }
26871 break;
26872 }
26873 }
26874 if (Main.expertMode && ZoneSnow && wet && !lavaWet && !honeyWet && !arcticDivingGear && environmentBuffImmunityTimer == 0)
26875 {
26876 AddBuff(46, 150);
26877 }
26878 float num106 = 1f + Math.Abs(velocity.X) / 3f;
26879 if (gfxOffY > 0f)
26880 {
26882 if (gfxOffY < 0f)
26883 {
26884 gfxOffY = 0f;
26885 }
26886 }
26887 else if (gfxOffY < 0f)
26888 {
26890 if (gfxOffY > 0f)
26891 {
26892 gfxOffY = 0f;
26893 }
26894 }
26895 if (gfxOffY > 32f)
26896 {
26897 gfxOffY = 32f;
26898 }
26899 if (gfxOffY < -32f)
26900 {
26901 gfxOffY = -32f;
26902 }
26903 if (Main.myPlayer == i)
26904 {
26905 if (!iceSkate)
26906 {
26907 CheckIceBreak();
26908 }
26910 }
26911 if (!shimmering)
26912 {
26914 bool flag27 = mount.Type == 7 || mount.Type == 8 || mount.Type == 12 || mount.Type == 44 || mount.Type == 49;
26915 if (velocity.Y == gravity && (!mount.Active || (!mount.Cart && mount.Type != 48 && !flag27)))
26916 {
26917 Collision.StepDown(ref position, ref velocity, width, height, ref stepSpeed, ref gfxOffY, (int)gravDir, waterWalk || waterWalk2);
26918 }
26919 if (gravDir == -1f)
26920 {
26921 if ((carpetFrame != -1 || velocity.Y <= gravity) && !controlUp)
26922 {
26923 Collision.StepUp(ref position, ref velocity, width, height, ref stepSpeed, ref gfxOffY, (int)gravDir, controlUp);
26924 }
26925 }
26926 else if ((carpetFrame != -1 || velocity.Y >= gravity) && !controlDown && !mount.Cart && !flag27 && grappling[0] == -1)
26927 {
26928 Collision.StepUp(ref position, ref velocity, width, height, ref stepSpeed, ref gfxOffY, (int)gravDir, controlUp);
26929 }
26930 }
26933 bool falling = false;
26934 if (velocity.Y > gravity)
26935 {
26936 falling = true;
26937 }
26938 if (velocity.Y < 0f - gravity)
26939 {
26940 falling = true;
26941 }
26943 slideDir = 0;
26944 bool ignorePlats = false;
26945 bool fallThrough = controlDown;
26946 if ((gravDir == -1f) | (mount.Active && (mount.Cart || mount.Type == 12 || mount.Type == 7 || mount.Type == 8 || mount.Type == 23 || mount.Type == 44 || mount.Type == 48)) | GoingDownWithGrapple | pulley)
26947 {
26948 ignorePlats = true;
26949 fallThrough = true;
26950 }
26951 bool flag28 = onTrack;
26952 onTrack = false;
26953 bool flag29 = false;
26954 if (mount.Active && mount.Cart)
26955 {
26957 float num107 = ((ignoreWater || merman) ? 1f : (shimmerWet ? 0.25f : (honeyWet ? 0.25f : ((!wet) ? 1f : 0.5f))));
26958 velocity *= num107;
26959 DelegateMethods.Minecart.rotation = fullRotation;
26960 DelegateMethods.Minecart.rotationOrigin = fullRotationOrigin;
26961 BitsByte bitsByte = Minecart.TrackCollision(this, ref position, ref velocity, ref lastBoost, width, height, controlDown, controlUp, fallStart2, trackOnly: false, mount.Delegations);
26962 if (bitsByte[0])
26963 {
26964 onTrack = true;
26965 gfxOffY = Minecart.TrackRotation(this, ref fullRotation, position + velocity, width, height, controlDown, controlUp, mount.Delegations);
26967 }
26968 if (flag28 && !onTrack)
26969 {
26971 }
26972 if (bitsByte[1])
26973 {
26975 {
26976 if (cartFlip)
26977 {
26978 cartFlip = false;
26979 }
26980 else
26981 {
26982 cartFlip = true;
26983 }
26984 }
26985 if (velocity.X > 0f)
26986 {
26987 direction = 1;
26988 }
26989 else if (velocity.X < 0f)
26990 {
26991 direction = -1;
26992 }
26994 }
26995 velocity /= num107;
26996 if (bitsByte[3] && whoAmI == Main.myPlayer)
26997 {
26998 flag29 = true;
26999 }
27000 if (bitsByte[2])
27001 {
27002 cartRampTime = (int)(Math.Abs(velocity.X) / mount.RunSpeed * 20f);
27003 }
27004 if (bitsByte[4])
27005 {
27006 trackBoost -= 4f;
27007 }
27008 if (bitsByte[5])
27009 {
27010 trackBoost += 4f;
27011 }
27012 }
27013 bool flag30 = whoAmI == Main.myPlayer && !mount.Active;
27015 if (vortexDebuff)
27016 {
27017 velocity.Y = velocity.Y * 0.8f + (float)Math.Cos(base.Center.X % 120f / 120f * ((float)Math.PI * 2f)) * 5f * 0.2f;
27018 }
27019 if (tongued)
27020 {
27021 position += velocity;
27022 flag30 = false;
27023 }
27024 else if (shimmerWet || shimmering)
27025 {
27027 }
27028 else if (honeyWet && !ignoreWater)
27029 {
27031 }
27032 else if (wet && !merman && !ignoreWater && !trident)
27033 {
27035 }
27036 else
27037 {
27040 {
27042 velocity.X = 0f;
27044 velocity.X = vector5.X;
27045 }
27046 if (mount.Active && mount.Type == 43 && velocity.Y != 0f)
27047 {
27049 velocity.X = 0f;
27051 velocity.X = vector6.X;
27052 }
27053 }
27055 TryBouncingBlocks(falling);
27057 if (!shimmering && !tongued)
27058 {
27060 if (!isLockedToATile)
27061 {
27062 Collision.StepConveyorBelt(this, gravDir);
27063 }
27064 }
27065 if (flag30 && velocity.Y == 0f)
27066 {
27068 }
27069 if (flag29)
27070 {
27071 NetMessage.SendData(13, -1, -1, null, whoAmI);
27072 Minecart.HitTrackSwitch(new Vector2(position.X, position.Y), width, height);
27073 }
27074 if (vector3.X != velocity.X)
27075 {
27076 if (vector3.X < 0f)
27077 {
27078 slideDir = -1;
27079 }
27080 else if (vector3.X > 0f)
27081 {
27082 slideDir = 1;
27083 }
27084 }
27085 if (gravDir == 1f && Collision.up)
27086 {
27087 velocity.Y = 0.01f;
27088 if (!merman)
27089 {
27090 jump = 0;
27091 }
27092 }
27093 else if (gravDir == -1f && Collision.down)
27094 {
27095 velocity.Y = -0.01f;
27096 if (!merman)
27097 {
27098 jump = 0;
27099 }
27100 }
27101 if (velocity.Y == 0f && grappling[0] == -1)
27102 {
27103 FloorVisuals(falling);
27104 }
27105 if (whoAmI == Main.myPlayer && !shimmering)
27106 {
27107 Collision.SwitchTiles(position, width, height, oldPosition, 1);
27108 }
27111 numMinions = 0;
27112 slotsMinions = 0f;
27113 if (Main.netMode != 2 && mount.Type != 8)
27114 {
27116 }
27118 PlayerFrame();
27119 if (mount.Type == 8)
27120 {
27121 mount.UseDrill(this);
27122 }
27123 if (statLife > statLifeMax2)
27124 {
27126 }
27127 if (statMana > statManaMax2)
27128 {
27130 }
27131 grappling[0] = -1;
27132 grapCount = 0;
27135 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static double Cos(double d)
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static double Sqrt(double d)
static double Abs(double value)
static int Sign(decimal value)
Definition Math.cs:1202
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static void PlaySound(int type, Vector2 position, int style=1)
static PlayerDeathReason ByOther(int type)
virtual void OnPlayerUpdate(Player player)
Vector2 oldPosition
Definition Entity.cs:18
bool honeyWet
Definition Entity.cs:34
bool shimmerWet
Definition Entity.cs:32
int oldDirection
Definition Entity.cs:22
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
byte wetCount
Definition Entity.cs:36
static void HandleSpecialEvent(Player player, int eventID)
static bool ShouldBlockBuilding(Vector2 worldPosition)
Definition DD2Event.cs:782
static void UpdatePlayerPosition(Player player)
static void SmartCursorLookup(Player player)
static Asset< Texture2D > HairStyleBack
static TriggersPack Triggers
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
static readonly int Count
Definition BuffID.cs:1069
static float[] BonusMeleeSpeedMultiplier
Definition ItemID.cs:1082
static readonly LegacySoundStyle Item32
Definition SoundID.cs:478
static readonly LegacySoundStyle Item24
Definition SoundID.cs:462
static readonly LegacySoundStyle Item13
Definition SoundID.cs:440
static readonly LegacySoundStyle Item8
Definition SoundID.cs:430
int headSlot
Definition Item.cs:195
int hammer
Definition Item.cs:157
int createWall
Definition Item.cs:163
int legSlot
Definition Item.cs:199
void TurnToAir(bool fullReset=false)
Definition Item.cs:49954
void SetDefaults(int Type=0)
Definition Item.cs:47332
int bodySlot
Definition Item.cs:197
Action< Player, Vector2, int, int > MinecartJumpingSound
Definition Mount.cs:87
Action< Player, Vector2, int, int > MinecartBumperSound
Definition Mount.cs:91
bool IsConsideredASlimeMount
Definition Mount.cs:471
void Dismount(Player mountedPlayer)
Definition Mount.cs:5229
float FallDamage
Definition Mount.cs:464
MountDelegatesData Delegations
Definition Mount.cs:507
bool Hover(Player mountedPlayer)
Definition Mount.cs:2807
bool Active
Definition Mount.cs:345
bool BlockExtraJumps
Definition Mount.cs:468
void UpdateEffects(Player mountedPlayer)
Definition Mount.cs:4057
void UpdateDrill(Player mountedPlayer, bool controlUp, bool controlDown)
Definition Mount.cs:2497
float Acceleration
Definition Mount.cs:453
bool CanFly()
Definition Mount.cs:2371
void UseDrill(Player mountedPlayer)
Definition Mount.cs:2520
void FatigueRecovery()
Definition Mount.cs:2475
void AbilityRecovery()
Definition Mount.cs:2452
bool CanHover()
Definition Mount.cs:2384
float RunSpeed
Definition Mount.cs:404
void ResetFlightTime(float xVelocity)
Definition Mount.cs:4471
bool Flight()
Definition Mount.cs:2487
float DashSpeed
Definition Mount.cs:441
int restorationDelayTime
Definition Player.cs:2445
float moveSpeed
Definition Player.cs:2047
void UpdateImmunity()
Definition Player.cs:18395
bool[] buffImmune
Definition Player.cs:1197
bool controlRight
Definition Player.cs:1383
void UpdateHairDyeDust()
Definition Player.cs:23274
DoorOpeningHelper doorHelper
Definition Player.cs:2471
int _quickGrappleCooldown
Definition Player.cs:2657
void SetTalkNPC(int npcIndex, bool fromNet=false)
Definition Player.cs:3725
void CheckDrowning()
Definition Player.cs:22224
float maxFallSpeed
Definition Player.cs:2095
void WingAirLogicTweaks()
Definition Player.cs:27575
bool releaseMapFullscreen
Definition Player.cs:1475
void ResetEffects()
Definition Player.cs:17886
bool controlDownHold
Definition Player.cs:1449
bool hasMagiluminescence
Definition Player.cs:1627
bool releaseQuickMana
Definition Player.cs:1423
bool IsVoidVaultEnabled
Definition Player.cs:3376
void HandleHotbar()
Definition Player.cs:29483
void Update_NPCCollision()
Definition Player.cs:29078
OverheadMessage chatOverhead
Definition Player.cs:581
bool canJumpAgain_Sandstorm
Definition Player.cs:2237
bool hasJumpOption_Sandstorm
Definition Player.cs:2235
bool runningOnSand
Definition Player.cs:887
float stepSpeed
Definition Player.cs:1303
SelectionRadial DpadRadial
Definition Player.cs:583
void UpdateMinionTarget()
Definition Player.cs:53608
bool IsStandingStillForSpecialEffects
Definition Player.cs:2841
void HandleBeingInChestRange()
Definition Player.cs:28762
void ToggleCreativeMenu()
Definition Player.cs:4153
void TrySyncingInput()
Definition Player.cs:5802
PlayerSleepingHelper sleeping
Definition Player.cs:2465
float rangedDamage
Definition Player.cs:2027
void UpdateManaRegen()
Definition Player.cs:18904
BitsByte ownedLargeGems
Definition Player.cs:829
int[] doubleTapCardinalTimer
Definition Player.cs:1081
int _timeSinceLastImmuneGet
Definition Player.cs:1115
void UpdateJumpHeight()
Definition Player.cs:18993
bool tankPetReset
Definition Player.cs:665
bool canJumpAgain_Fart
Definition Player.cs:2249
bool canJumpAgain_Sail
Definition Player.cs:2255
bool PortalPhysicsEnabled
Definition Player.cs:3494
void UpdateProjectileCaches(int i)
Definition Player.cs:11625
bool downedDD2EventAnyDifficulty
Definition Player.cs:1549
bool tryKeepingHoveringDown
Definition Player.cs:1457
bool empressBrooch
Definition Player.cs:1621
static readonly int maxBuffs
Definition Player.cs:1191
Collision.HurtTile GetHurtTile()
Definition Player.cs:27277
float wallSpeed
Definition Player.cs:2051
SelectionRadial QuicksRadial
Definition Player.cs:587
float pickSpeed
Definition Player.cs:2049
bool hasJumpOption_Santank
Definition Player.cs:2265
int _framesLeftEligibleForDeadmansChestDeathAchievement
Definition Player.cs:1045
void GamepadEnableGrappleCooldown()
Definition Player.cs:23162
void GetMinecartDamage(float currentSpeed, out int damage, out float knockback)
Definition Player.cs:27513
PlayerSittingHelper sitting
Definition Player.cs:2463
bool forceWerewolf
Definition Player.cs:1947
static float jumpSpeed
Definition Player.cs:2091
void CancelAllJumpVisualEffects()
Definition Player.cs:34862
bool mapAlphaDown
Definition Player.cs:1469
bool ItemTimeIsZero
Definition Player.cs:3525
bool mouseInterface
Definition Player.cs:1137
void QuickBuff()
Definition Player.cs:4802
void CapAttackSpeeds()
Definition Player.cs:27340
bool canJumpAgain_Basilisk
Definition Player.cs:2279
bool beetleOffense
Definition Player.cs:683
void KeyHoldDown(int keyDir, int holdTime)
Definition Player.cs:53503
Vector2 lastBoost
Definition Player.cs:1733
bool isPerformingJump_Blizzard
Definition Player.cs:2245
bool ashWoodBonus
Definition Player.cs:1235
bool hasJumpOption_Fart
Definition Player.cs:2247
static readonly float PhilosopherStoneDurationMultiplier
Definition Player.cs:1995
float meleeSpeed
Definition Player.cs:2043
float accRunSpeed
Definition Player.cs:821
bool isPerformingJump_Basilisk
Definition Player.cs:2281
void RocketBootVisuals()
Definition Player.cs:27605
static int GetMouseScrollDelta()
Definition Player.cs:27473
void WallslideMovement()
Definition Player.cs:20779
bool SlimeDontHyperJump
Definition Player.cs:3547
void PurgeDD2EnergyCrystals()
Definition Player.cs:29204
void UpdateMaxTurrets()
Definition Player.cs:49594
bool creativeGodMode
Definition Player.cs:1529
bool trapDebuffSource
Definition Player.cs:2003
int fartKartCloudDelay
Definition Player.cs:1295
void SmartInteractLookup()
Definition Player.cs:17002
float tileSpeed
Definition Player.cs:2053
float runAcceleration
Definition Player.cs:2099
void TryToShimmerUnstuck()
Definition Player.cs:27169
void GrappleMovement()
Definition Player.cs:21565
bool TryingToHoverDown
Definition Player.cs:3412
void LookForTileInteractions()
Definition Player.cs:29681
bool releaseRight
Definition Player.cs:1429
bool isPerformingJump_Santank
Definition Player.cs:2269
void ApplyTouchDamage(int tileId, int x, int y)
Definition Player.cs:27299
bool CanNPCBeHitByPlayerOrPlayerProjectile(NPC npc, Projectile projectile=null)
Definition Player.cs:19902
bool controlThrow
Definition Player.cs:1395
void UpdatePettingAnimal()
Definition Player.cs:31217
bool vortexStealthActive
Definition Player.cs:2411
int environmentBuffImmunityTimer
Definition Player.cs:1043
void GrabItems(int i)
Definition Player.cs:33106
void ResetVisibleAccessories()
Definition Player.cs:28887
float MountFishronSpecialCounter
Definition Player.cs:2557
float carpetFrameCounter
Definition Player.cs:857
bool canJumpAgain_Blizzard
Definition Player.cs:2243
int infernoCounter
Definition Player.cs:865
void HorizontalMovement()
Definition Player.cs:19152
bool HasItem(int type)
Definition Player.cs:52305
bool slowOgreSpit
Definition Player.cs:2009
void ItemCheckWrapped(int i)
Definition Player.cs:29512
int snowBallLauncherInteractionCooldown
Definition Player.cs:847
bool releaseMapStyle
Definition Player.cs:1477
float rangedMultDamage
Definition Player.cs:2029
void WingMovement()
Definition Player.cs:21052
void UpdatePetLight(int i)
Definition Player.cs:16939
bool controlCreativeMenu
Definition Player.cs:1441
void QuickGrapple()
Definition Player.cs:5170
void ResetFloorFlags()
Definition Player.cs:22794
int vanityRocketBoots
Definition Player.cs:2325
bool canJumpAgain_Cloud
Definition Player.cs:2231
void SmartSelectLookup()
Definition Player.cs:17044
void QuickHeal()
Definition Player.cs:4647
void ToggleInv()
Definition Player.cs:4038
void AdjustRemainingPotionSickness()
Definition Player.cs:27262
float meleeDamage
Definition Player.cs:2023
bool isControlledByFilm
Definition Player.cs:1455
bool witheredWeapon
Definition Player.cs:2007
bool witheredArmor
Definition Player.cs:2005
float ghostDmg
Definition Player.cs:773
int shadowDodgeTimer
Definition Player.cs:945
bool releaseThrow
Definition Player.cs:1421
bool GoingDownWithGrapple
Definition Player.cs:593
float slotsMinions
Definition Player.cs:969
bool onHitDodge
Definition Player.cs:931
ShimmerUnstuckHelper shimmerUnstuckHelper
Definition Player.cs:1907
float trackBoost
Definition Player.cs:1731
bool vortexDebuff
Definition Player.cs:2001
bool hasJumpOption_Unicorn
Definition Player.cs:2259
static int tileTargetY
Definition Player.cs:2085
void TrySpawningFaelings()
Definition Player.cs:16588
bool noBuilding
Definition Player.cs:799
bool isPerformingJump_Fart
Definition Player.cs:2251
void UpdateBuffs(int i)
Definition Player.cs:9342
bool outOfRange
Definition Player.cs:769
double Hurt(PlayerDeathReason damageSource, int Damage, int hitDirection, bool pvp=false, bool quiet=false, bool Crit=false, int cooldownCounter=-1, bool dodgeable=true)
Definition Player.cs:36134
int wingFrameCounter
Definition Player.cs:1031
int _portalPhysicsTime
Definition Player.cs:2551
bool ShouldFloatInWater
Definition Player.cs:3348
int starCloakCooldown
Definition Player.cs:869
void Yoraiz0rEye()
Definition Player.cs:11862
void AdjTiles()
Definition Player.cs:33828
bool CanMoveForwardOnRope(int dir, int x, int y)
Definition Player.cs:23253
void UpdateLifeRegen()
Definition Player.cs:18481
bool canJumpAgain_Unicorn
Definition Player.cs:2261
bool tryKeepingHoveringUp
Definition Player.cs:1459
bool mapFullScreen
Definition Player.cs:1471
void ApplyDamageToNPC(NPC npc, int damage, float knockback, int direction, bool crit)
Definition Player.cs:19845
int rocketSoundDelay
Definition Player.cs:2317
bool isPerformingJump_Sail
Definition Player.cs:2257
void QuickMount()
Definition Player.cs:5013
float maxRegenDelay
Definition Player.cs:1123
bool ShouldDrawWingsThatAreAlwaysAnimated()
Definition Player.cs:28507
PlayerMovementAccsCache movementAbilitiesCache
Definition Player.cs:2659
void KeyDoubleTap(int keyDir)
Definition Player.cs:53370
void UpdateArmorSets(int i)
Definition Player.cs:15283
void ResetControls()
Definition Player.cs:27371
bool controlTorch
Definition Player.cs:1401
void DoubleJumpVisuals()
Definition Player.cs:20921
void TryToToggleSmartCursor(ref bool smartCursorWanted)
Definition Player.cs:27137
bool gravControl2
Definition Player.cs:2421
bool hasJumpOption_Sail
Definition Player.cs:2253
bool controlMount
Definition Player.cs:1407
int titaniumStormCooldown
Definition Player.cs:939
void CheckIceBreak()
Definition Player.cs:22405
static int tileRangeX
Definition Player.cs:2075
void CarpetMovement()
Definition Player.cs:20871
bool portalPhysicsFlag
Definition Player.cs:2553
int[] grappling
Definition Player.cs:2305
float minionDamage
Definition Player.cs:2039
bool autoReuseAllWeapons
Definition Player.cs:1453
int crystalLeafCooldown
Definition Player.cs:1069
void JumpMovement()
Definition Player.cs:19912
bool canJumpAgain_Santank
Definition Player.cs:2267
bool controlQuickMana
Definition Player.cs:1437
void DashMovement()
Definition Player.cs:20374
bool hasJumpOption_WallOfFleshGoat
Definition Player.cs:2271
bool hasJumpOption_Cloud
Definition Player.cs:2229
bool hasLucyTheAxe
Definition Player.cs:1077
void SlopingCollision(bool fallThrough, bool ignorePlats)
Definition Player.cs:22725
void WaterCollision(bool fallThrough, bool ignorePlats)
Definition Player.cs:22491
void UpdateArmorLights()
Definition Player.cs:28907
void UpdatePortableStoolUsage()
Definition Player.cs:27478
void HoneyCollision(bool fallThrough, bool ignorePlats)
Definition Player.cs:22473
bool discountEquipped
Definition Player.cs:2211
void ItemCheck_ManageRightClickFeatures()
Definition Player.cs:29284
bool releaseCreativeMenu
Definition Player.cs:1443
static int jumpHeight
Definition Player.cs:2089
bool hasJumpOption_Basilisk
Definition Player.cs:2277
void dropItemCheck()
Definition Player.cs:4220
static int tileTargetX
Definition Player.cs:2083
void UpdateTouchingTiles()
Definition Player.cs:53670
static float defaultGravity
Definition Player.cs:2087
void SlopeDownMovement()
Definition Player.cs:22431
bool shroomiteStealth
Definition Player.cs:1233
void StopVanityActions(bool multiplayerBroadcast=true)
Definition Player.cs:31204
void UpdateDead()
Definition Player.cs:16766
void CheckCrackedBrickBreak()
Definition Player.cs:22332
bool controlQuickHeal
Definition Player.cs:1439
bool shadowDodge
Definition Player.cs:925
bool ZoneSandstorm
Definition Player.cs:3181
bool isOperatingAnotherEntity
Definition Player.cs:1451
int timeSinceLastDashStarted
Definition Player.cs:813
bool isPerformingJump_WallOfFleshGoat
Definition Player.cs:2275
float lifeSteal
Definition Player.cs:771
void UpdateLuck()
Definition Player.cs:27360
float manaSickReduction
Definition Player.cs:755
float maxRunSpeed
Definition Player.cs:2097
void UpdatePermanentBoosters()
Definition Player.cs:12221
void UpdatePet(int i)
Definition Player.cs:16926
bool rocketRelease
Definition Player.cs:2319
bool shimmerImmune
Definition Player.cs:1583
float magicDamage
Definition Player.cs:2025
float runSlowdown
Definition Player.cs:2101
void UpdateReleaseUseTile()
Definition Player.cs:27499
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Definition Player.cs:4441
static int tileRangeY
Definition Player.cs:2077
void UpdateControlHolds()
Definition Player.cs:27397
Vector2 instantMovementAccumulatedThisFrame
Definition Player.cs:2153
void ResetProjectileCaches()
Definition Player.cs:11658
PlayerEyeHelper eyeHelper
Definition Player.cs:2467
void TryBouncingBlocks(bool Falling)
Definition Player.cs:33032
void DryCollision(bool fallThrough, bool ignorePlats)
Definition Player.cs:22556
void WOFTongue()
Definition Player.cs:21298
void TryOpeningFullscreenMap()
Definition Player.cs:27420
void QuickMana()
Definition Player.cs:4732
bool isLockedToATile
Definition Player.cs:3482
void FloorVisuals(bool Falling)
Definition Player.cs:22756
int potionDelayTime
Definition Player.cs:2443
bool releaseSmart
Definition Player.cs:1431
void UpdateDyes()
Definition Player.cs:9096
void UpdateSocialShadow()
Definition Player.cs:15909
bool releaseQuickHeal
Definition Player.cs:1425
float pulleyFrameCounter
Definition Player.cs:839
bool TryingToHoverUp
Definition Player.cs:3400
SelectionRadial CircularRadial
Definition Player.cs:585
void TryLandingOnDetonator()
Definition Player.cs:33018
void FindPulley()
Definition Player.cs:19045
void ShimmerCollision(bool fallThrough, bool ignorePlats, bool noCollision)
Definition Player.cs:22449
bool releaseInventory
Definition Player.cs:1417
void WingAirVisuals()
Definition Player.cs:28516
float fullRotation
Definition Player.cs:1291
int[] hurtCooldowns
Definition Player.cs:2699
void UpdateMiscCounter()
Definition Player.cs:27566
void TryPortalJumping()
Definition Player.cs:53340
bool behindBackWall
Definition Player.cs:2591
DirectionalInputSyncCache LocalInputCache
Definition Player.cs:1379
bool delayUseItem
Definition Player.cs:1483
void UpdateNearbyInteractibleProjectilesList()
Definition Player.cs:22048
void UpdateBiomes()
Definition Player.cs:16067
void BordersMovement()
Definition Player.cs:23080
bool onWrongGround
Definition Player.cs:1723
void ResizeHitbox()
Definition Player.cs:27492
void UpdateAdvancedShadows()
Definition Player.cs:3688
bool releaseMount
Definition Player.cs:1433
void StickyMovement()
Definition Player.cs:21844
void DelBuff(int b)
Definition Player.cs:4602
int[] ownedProjectileCounts
Definition Player.cs:2545
bool hasJumpOption_Blizzard
Definition Player.cs:2241
void UpdateEquips(int i)
Definition Player.cs:12262
bool lastStoned
Definition Player.cs:791
void UpdateTeleportVisuals()
Definition Player.cs:15939
int[] holdDownCardinalTimer
Definition Player.cs:1083
Vector2 fullRotationOrigin
Definition Player.cs:1293
Item[] inventory
Definition Player.cs:1257
bool controlUseTile
Definition Player.cs:1393
bool beetleDefense
Definition Player.cs:681
bool controlUseItem
Definition Player.cs:1391
void PlayerFrame()
Definition Player.cs:33978
bool MountFishronSpecial
Definition Player.cs:3506
void RefreshDoubleJumps()
Definition Player.cs:21804
int mushroomDelayTime
Definition Player.cs:2447
void WingFrame(bool wingFlap)
Definition Player.cs:27719
bool controlSmart
Definition Player.cs:1405
bool isPerformingJump_Unicorn
Definition Player.cs:2263
bool canJumpAgain_WallOfFleshGoat
Definition Player.cs:2273
int boneGloveTimer
Definition Player.cs:947
bool discountAvailable
Definition Player.cs:2213
bool shieldRaised
Definition Player.cs:2673
bool arcticDivingGear
Definition Player.cs:1715
PlayerInteractionAnchor tileEntityAnchor
Definition Player.cs:2469
void ClearBuff(int type)
Definition Player.cs:4623
static bool DisableLeftShiftTrashCan
Definition ItemSlot.cs:22
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
bool Intersects(Rectangle value)
Definition Rectangle.cs:129
bool Contains(int x, int y)
Definition Rectangle.cs:92
static float Distance(Vector2 value1, Vector2 value2)
Definition Vector2.cs:91

References System.Math.Abs(), Terraria.Lighting.AddLight(), Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.Item.axe, Terraria.NPC.BigMimicSummonCheck(), Microsoft.Xna.Framework.Color.Black, Terraria.Main.blockInput, Terraria.Item.bodySlot, Terraria.ID.ItemID.Sets.BonusMeleeSpeedMultiplier, Terraria.NPC.brainOfGravity, Terraria.DataStructures.PlayerDeathReason.ByOther(), Terraria.Main.cameraX, Terraria.Player.SelectionRadial.ChangeSelection(), Terraria.Main.chest, Microsoft.Xna.Framework.MathHelper.Clamp(), Microsoft.Xna.Framework.Rectangle.Contains(), System.Math.Cos(), Terraria.ID.BuffID.Count, Terraria.Item.createWall, Terraria.Item.crit, Terraria.GameInput.PlayerInput.SettingsForUI.CurrentCursorMode, Terraria.Main.dayTime, Terraria.UI.ItemSlot.Options.DisableLeftShiftTrashCan, Microsoft.Xna.Framework.Vector2.Distance(), Terraria.Main.dontStarveWorld, Terraria.Collision.down, Terraria.GameContent.Events.DD2Event.DownedInvasionAnyDifficulty, Terraria.Main.drawingPlayerChat, Terraria.Main.dust, Terraria.Dust.dustWater(), System.E, Terraria.Main.editChest, Terraria.Main.editSign, Terraria.Main.expertMode, Terraria.GameContent.Events.DD2Event.FindArenaHitbox(), Terraria.Main.focusRecipe, Terraria.NPC.freeCake, Terraria.Main.GameModeInfo, Terraria.Projectile.GasTrapCheck(), Terraria.GameContent.TextureAssets.HairStyleBack, Terraria.Main.hairWindow, Terraria.Item.hammer, Terraria.GameContent.Achievements.AchievementsHelper.HandleRunning(), Terraria.GameContent.Achievements.AchievementsHelper.HandleSpecialEvent(), Terraria.Main.hasFocus, Terraria.Item.headSlot, Terraria.Minecart.HitTrackSwitch(), Terraria.Collision.honey, Terraria.GameInput.PlayerInput.MiscSettingsTEMP.HotbarRadialShouldBeUsed, Terraria.Player.Settings.HoverControl, Terraria.Main.InputTextChest(), Terraria.Main.InputTextSign(), Terraria.GameContent.Creative.CreativePowerManager.Instance, Terraria.Graphics.Capture.CaptureManager.Instance, Terraria.Main.instance, Microsoft.Xna.Framework.Rectangle.Intersects(), Terraria.WorldGen.InWorld(), Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.IsEnabledForPlayer(), Terraria.WorldGen.IsRope(), Terraria.ID.SoundID.Item13, Terraria.ID.SoundID.Item24, Terraria.ID.SoundID.Item32, Terraria.ID.SoundID.Item8, Terraria.Main.keyState, Terraria.Collision.LavaCollision(), Terraria.Item.legSlot, Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.MathHelper.Lerp(), Terraria.Main.mapFullscreen, Terraria.Main.mapFullscreenScale, Terraria.Main.mapStyle, System.Math.Max(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, System.Math.Min(), Terraria.Main.MouseScreen, Terraria.Main.mouseY, Terraria.Item.mushroomDelay, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Item.NewItem(), Terraria.Main.npc, Terraria.Main.npcShop, Terraria.Main.numAvailableRecipes, Terraria.TileObject.objectPreview, Terraria.GameContent.Events.DD2Event.Ongoing, Terraria.Minecart.OnTrack(), Terraria.Main.player, Terraria.Main.playerInventory, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Item.potionDelay, Terraria.Main.rand, Terraria.Main.recBigList, Terraria.Main.recStart, Terraria.Main.remixWorld, Terraria.Item.restorationDelay, Terraria.Main.SceneMetrics, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Player.SelectionRadial.SelectedBinding, Terraria.NetMessage.SendData(), Terraria.Item.SetDefaults(), Terraria.Main.SettingsEnabled_AutoReuseAllItems, Terraria.GameInput.PlayerInput.SetZoom_UI(), Terraria.GameInput.PlayerInput.SetZoom_World(), Terraria.Collision.shimmer, Terraria.GameContent.Events.DD2Event.ShouldBlockBuilding(), System.Math.Sign(), Terraria.Main.sign, Terraria.GameContent.SmartCursorHelper.SmartCursorLookup(), Terraria.Main.SmartCursorWanted_GamePad, Terraria.Main.SmartCursorWanted_Mouse, Terraria.Collision.SolidCollision(), System.Math.Sqrt(), Terraria.GameInput.PlayerInput.SteamDeckIsUsed, Terraria.Collision.StepConveyorBelt(), Terraria.Collision.StepDown(), Terraria.Collision.StepUp(), Terraria.Collision.SwitchTiles(), Terraria.DataStructures.Tile, Terraria.Main.tile, Terraria.Player.OverheadMessage.timeLeft, Terraria.Minecart.TrackCollision(), Terraria.Minecart.TrackRotation(), Terraria.GameInput.PlayerInput.Triggers, Terraria.GameContent.LucyAxeMessage.TryPlayingIdleMessage(), Terraria.Item.TurnToAir(), System.type, Terraria.Item.type, Terraria.Main.UnderworldLayer, Microsoft.Xna.Framework.Vector2.UnitY, Terraria.Collision.up, Terraria.GameInput.LockOnHelper.Update(), Terraria.Player.SelectionRadial.Update(), Terraria.GameContent.DontStarveDarknessDamageDealer.Update(), Terraria.GameContent.PressurePlateHelper.UpdatePlayerPosition(), Terraria.GameInput.PlayerInput.UsingGamepad, System.value, Terraria.Collision.WetCollision(), Microsoft.Xna.Framework.Color.White, Terraria.Main.wofNPCIndex, and Microsoft.Xna.Framework.Vector2.Zero.