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

◆ PickupItem()

Item Terraria.Player.PickupItem ( int playerIndex,
int worldItemArrayIndex,
Item itemToPickUp )
inlineprivate

Definition at line 33760 of file Player.cs.

33761 {
33762 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
33763 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
33765 {
33766 SoundEngine.PlaySound(7, (int)position.X, (int)position.Y);
33767 int num = itemToPickUp.buffType;
33768 itemToPickUp = new Item();
33769 if (Main.netMode == 1)
33770 {
33771 NetMessage.SendData(102, -1, -1, null, playerIndex, num, base.Center.X, base.Center.Y);
33772 }
33773 else
33774 {
33776 }
33777 }
33778 if (itemToPickUp.type == 58 || itemToPickUp.type == 1734 || itemToPickUp.type == 1867)
33779 {
33780 SoundEngine.PlaySound(7, (int)position.X, (int)position.Y);
33781 Heal(20);
33782 itemToPickUp = new Item();
33783 }
33784 else if (itemToPickUp.type == 184 || itemToPickUp.type == 1735 || itemToPickUp.type == 1868)
33785 {
33786 SoundEngine.PlaySound(7, (int)position.X, (int)position.Y);
33787 statMana += 100;
33788 if (Main.myPlayer == whoAmI)
33789 {
33790 ManaEffect(100);
33791 }
33792 if (statMana > statManaMax2)
33793 {
33795 }
33796 itemToPickUp = new Item();
33797 }
33798 else if (itemToPickUp.type == 4143)
33799 {
33800 SoundEngine.PlaySound(7, (int)position.X, (int)position.Y);
33801 statMana += 50;
33802 if (Main.myPlayer == whoAmI)
33803 {
33804 ManaEffect(50);
33805 }
33806 if (statMana > statManaMax2)
33807 {
33809 }
33810 itemToPickUp = new Item();
33811 }
33812 else
33813 {
33814 itemToPickUp = GetItem(playerIndex, itemToPickUp, GetItemSettings.PickupItemFromWorld);
33815 }
33816 Main.item[worldItemArrayIndex] = itemToPickUp;
33817 if (Main.netMode == 1)
33818 {
33819 NetMessage.SendData(21, -1, -1, null, worldItemArrayIndex);
33820 }
33821 return itemToPickUp;
33822 }
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 ...
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static bool[] NebulaPickup
Do not add items to this set. If true for a given item type (F:Terraria.Item.type),...
Definition ItemID.cs:1380
int statManaMax2
The maximum mana this player can have, adjusted by buffs and equipment.
Definition Player.cs:2122
Item GetItem(int plr, Item newItem, GetItemSettings settings)
Definition Player.cs:38131
void ManaEffect(int manaAmount)
Definition Player.cs:4991
void Heal(int amount)
Heals the player for a certain amount.
Definition Player.cs:33828
void NebulaLevelup(int type)
Definition Player.cs:58097
int statMana
The current mana of this player. Capped at F:Terraria.Player.statManaMax2. If you increase this val...
Definition Player.cs:2111

References Terraria.Player.GetItem(), Terraria.Player.Heal(), Terraria.Main.item, Terraria.Player.ManaEffect(), Terraria.Main.myPlayer, Terraria.Player.NebulaLevelup(), Terraria.ID.ItemID.Sets.NebulaPickup, Terraria.Main.netMode, Terraria.GetItemSettings.PickupItemFromWorld, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.NetMessage.SendData(), Terraria.Player.statMana, Terraria.Player.statManaMax2, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.GrabItems().

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