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

◆ HandleBeingInChestRange()

void Terraria.Player.HandleBeingInChestRange ( )
inlineprivate

Definition at line 28762 of file Player.cs.

28763 {
28764 if (chest != -1)
28765 {
28766 if (chest != -2)
28767 {
28769 }
28770 if (chest != -5)
28771 {
28773 }
28774 bool flag = false;
28776 if (projectileLocalIndex >= 0)
28777 {
28778 flag = true;
28779 if (!Main.projectile[projectileLocalIndex].active || (Main.projectile[projectileLocalIndex].type != 525 && Main.projectile[projectileLocalIndex].type != 960))
28780 {
28781 Main.PlayInteractiveProjectileOpenCloseSound(Main.projectile[projectileLocalIndex].type, open: false);
28782 chest = -1;
28783 Recipe.FindRecipes();
28784 }
28785 else
28786 {
28787 int num = (int)(((double)position.X + (double)width * 0.5) / 16.0);
28788 int num2 = (int)(((double)position.Y + (double)height * 0.5) / 16.0);
28789 Vector2 vector = Main.projectile[projectileLocalIndex].Hitbox.ClosestPointInRect(base.Center);
28790 chestX = (int)vector.X / 16;
28791 chestY = (int)vector.Y / 16;
28793 {
28794 if (chest != -1)
28795 {
28796 Main.PlayInteractiveProjectileOpenCloseSound(Main.projectile[projectileLocalIndex].type, open: false);
28797 }
28798 chest = -1;
28799 Recipe.FindRecipes();
28800 }
28801 }
28802 }
28804 if (projectileLocalIndex2 >= 0)
28805 {
28806 flag = true;
28807 if (!Main.projectile[projectileLocalIndex2].active || Main.projectile[projectileLocalIndex2].type != 734)
28808 {
28810 chest = -1;
28811 Recipe.FindRecipes();
28812 }
28813 else
28814 {
28815 int num3 = (int)(((double)position.X + (double)width * 0.5) / 16.0);
28816 int num4 = (int)(((double)position.Y + (double)height * 0.5) / 16.0);
28817 Vector2 vector2 = Main.projectile[projectileLocalIndex2].Hitbox.ClosestPointInRect(base.Center);
28818 chestX = (int)vector2.X / 16;
28819 chestY = (int)vector2.Y / 16;
28821 {
28822 if (chest != -1)
28823 {
28825 }
28826 chest = -1;
28827 Recipe.FindRecipes();
28828 }
28829 }
28830 }
28831 if (flag)
28832 {
28833 return;
28834 }
28836 {
28837 if (chest != -1)
28838 {
28840 }
28841 chest = -1;
28842 Recipe.FindRecipes();
28843 }
28844 else if (!Main.tile[chestX, chestY].active())
28845 {
28847 chest = -1;
28848 Recipe.FindRecipes();
28849 }
28850 }
28851 else
28852 {
28855 }
28856 }
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 position
Definition Entity.cs:14
static readonly LegacySoundStyle Item130
Definition SoundID.cs:674
TrackedProjectileReference voidLensChest
Definition Player.cs:2431
static int tileRangeX
Definition Player.cs:2075
bool IsInInteractionRangeToMultiTileHitbox(int chestPointX, int chestPointY)
Definition Player.cs:28858
static int tileRangeY
Definition Player.cs:2077
TrackedProjectileReference piggyBankProjTracker
Definition Player.cs:2429

References System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), Terraria.Recipe.FindRecipes(), Terraria.ID.SoundID.Item130, Terraria.Main.PlayInteractiveProjectileOpenCloseSound(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.projectile, and Terraria.Main.tile.