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

◆ HandleBeingInChestRange()

void Terraria.Player.HandleBeingInChestRange ( )
inlineprivate

Definition at line 28651 of file Player.cs.

28652 {
28653 //IL_0101: Unknown result type (might be due to invalid IL or missing references)
28654 //IL_0107: Unknown result type (might be due to invalid IL or missing references)
28655 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
28656 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
28657 //IL_0114: Unknown result type (might be due to invalid IL or missing references)
28658 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
28659 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
28660 //IL_0260: Unknown result type (might be due to invalid IL or missing references)
28661 //IL_0265: Unknown result type (might be due to invalid IL or missing references)
28662 //IL_026a: Unknown result type (might be due to invalid IL or missing references)
28663 //IL_026d: Unknown result type (might be due to invalid IL or missing references)
28664 //IL_027e: Unknown result type (might be due to invalid IL or missing references)
28665 if (chest != -1)
28666 {
28667 if (chest != -2)
28668 {
28670 }
28671 if (chest != -5)
28672 {
28674 }
28675 bool flag = false;
28677 if (projectileLocalIndex >= 0)
28678 {
28679 flag = true;
28680 if (!Main.projectile[projectileLocalIndex].active || (Main.projectile[projectileLocalIndex].type != 525 && Main.projectile[projectileLocalIndex].type != 960))
28681 {
28682 Main.PlayInteractiveProjectileOpenCloseSound(Main.projectile[projectileLocalIndex].type, open: false);
28683 chest = -1;
28684 Recipe.FindRecipes();
28685 }
28686 else
28687 {
28688 int num = (int)(((double)position.X + (double)width * 0.5) / 16.0);
28689 int num2 = (int)(((double)position.Y + (double)height * 0.5) / 16.0);
28690 Vector2 vector = Main.projectile[projectileLocalIndex].Hitbox.ClosestPointInRect(base.Center);
28691 chestX = (int)vector.X / 16;
28692 chestY = (int)vector.Y / 16;
28694 {
28695 if (chest != -1)
28696 {
28697 Main.PlayInteractiveProjectileOpenCloseSound(Main.projectile[projectileLocalIndex].type, open: false);
28698 }
28699 chest = -1;
28700 Recipe.FindRecipes();
28701 }
28702 }
28703 }
28705 if (projectileLocalIndex2 >= 0)
28706 {
28707 flag = true;
28708 if (!Main.projectile[projectileLocalIndex2].active || Main.projectile[projectileLocalIndex2].type != 734)
28709 {
28711 chest = -1;
28712 Recipe.FindRecipes();
28713 }
28714 else
28715 {
28716 int num3 = (int)(((double)position.X + (double)width * 0.5) / 16.0);
28717 int num4 = (int)(((double)position.Y + (double)height * 0.5) / 16.0);
28718 Vector2 vector2 = Main.projectile[projectileLocalIndex2].Hitbox.ClosestPointInRect(base.Center);
28719 chestX = (int)vector2.X / 16;
28720 chestY = (int)vector2.Y / 16;
28722 {
28723 if (chest != -1)
28724 {
28726 }
28727 chest = -1;
28728 Recipe.FindRecipes();
28729 }
28730 }
28731 }
28732 if (flag)
28733 {
28734 return;
28735 }
28737 {
28738 if (chest != -1)
28739 {
28741 }
28742 chest = -1;
28743 Recipe.FindRecipes();
28744 }
28745 else if (!Main.tile[chestX, chestY].active())
28746 {
28748 chest = -1;
28749 Recipe.FindRecipes();
28750 }
28751 }
28752 else
28753 {
28756 }
28757 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static readonly SoundStyle Item130
Definition SoundID.cs:937
int chest
Represents the chest the player currently has open. If -1, the player has no chest open....
Definition Player.cs:2979
TrackedProjectileReference voidLensChest
Definition Player.cs:2972
static int tileRangeX
Definition Player.cs:2642
bool IsInInteractionRangeToMultiTileHitbox(int chestPointX, int chestPointY)
Definition Player.cs:28759
static int tileRangeY
Definition Player.cs:2644
TrackedProjectileReference piggyBankProjTracker
Definition Player.cs:2970

References Terraria.Player.chest, Terraria.Player.chestX, Terraria.Player.chestY, Terraria.DataStructures.TrackedProjectileReference.Clear(), Terraria.Recipe.FindRecipes(), Terraria.Entity.height, Terraria.Player.IsInInteractionRangeToMultiTileHitbox(), Terraria.ID.SoundID.Item130, Terraria.Player.piggyBankProjTracker, Terraria.Main.PlayInteractiveProjectileOpenCloseSound(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.projectile, Terraria.DataStructures.TrackedProjectileReference.ProjectileLocalIndex, Terraria.Main.tile, Terraria.Player.tileRangeX, Terraria.Player.tileRangeY, Terraria.Player.voidLensChest, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: