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

◆ TakeUnityPotion()

void Terraria.Player.TakeUnityPotion ( )
inline

Definition at line 41470 of file Player.cs.

41471 {
41472 for (int i = 0; i < 58; i++)
41473 {
41474 if (inventory[i].type == 2997 && inventory[i].stack > 0)
41475 {
41476 if (ItemLoader.ConsumeItem(inventory[i], this))
41477 {
41478 inventory[i].stack--;
41479 }
41480 if (inventory[i].stack <= 0)
41481 {
41483 }
41484 return;
41485 }
41486 }
41487 if (!useVoidBag())
41488 {
41489 return;
41490 }
41491 for (int j = 0; j < 40; j++)
41492 {
41493 if (bank4.item[j].type == 2997 && bank4.item[j].stack > 0)
41494 {
41495 if (ItemLoader.ConsumeItem(bank4.item[j], this))
41496 {
41497 bank4.item[j].stack--;
41498 }
41499 if (bank4.item[j].stack <= 0)
41500 {
41502 }
41503 break;
41504 }
41505 }
41506 }
Item[] item
The items this chest contains. F:Terraria.Chest.maxItems elements long.
Definition Chest.cs:93
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
void SetDefaults(int Type=0)
Definition Item.cs:48800
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345
static bool ConsumeItem(Item item, Player player)
If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to fals...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
bool useVoidBag()
Definition Player.cs:21132
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.Player.bank4, Terraria.ModLoader.ItemLoader.ConsumeItem(), Terraria.Player.inventory, Terraria.Chest.item, Terraria.Item.SetDefaults(), Terraria.Item.stack, Terraria.Item.type, and Terraria.Player.useVoidBag().

+ Here is the call graph for this function: