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

◆ BuyItem()

bool Terraria.Player.BuyItem ( long price,
int customCurrency = -1 )
inline

Attempts to "purchase" something that costs the given price .
Items will be taken from all of the player inventories and banks combined.
If customCurrency is provided, the price will be in terms of the custom currency instead of coins.
If the player has enough currency, the currency will be taken from the inventories.

Parameters
price
customCurrency
Returns
true if the player had enough currency to pay the price.

Definition at line 34127 of file Player.cs.

34128 {
34130 {
34132 }
34133 return false;
34134 }
bool PayCurrency(long price, int customCurrency=-1)
Definition Player.cs:34155
bool CanAfford(long price, int customCurrency=-1)
Definition Player.cs:34136

References Terraria.Player.CanAfford(), and Terraria.Player.PayCurrency().

+ Here is the call graph for this function: