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

◆ PayCurrency()

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

Definition at line 34155 of file Player.cs.

34156 {
34157 //IL_0119: Unknown result type (might be due to invalid IL or missing references)
34158 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
34159 //IL_01f7: Unknown result type (might be due to invalid IL or missing references)
34160 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
34161 //IL_02bd: Unknown result type (might be due to invalid IL or missing references)
34162 //IL_0320: Unknown result type (might be due to invalid IL or missing references)
34163 if (customCurrency != -1)
34164 {
34166 }
34167 List<Item[]> list = new List<Item[]>();
34175 list.Add(inventory);
34176 list.Add(bank.item);
34177 list.Add(bank2.item);
34178 list.Add(bank3.item);
34179 list.Add(bank4.item);
34180 for (int i = 0; i < list.Count; i++)
34181 {
34182 dictionary[i] = new List<int>();
34183 }
34184 dictionary[0] = new List<int> { 58, 57, 56, 55, 54 };
34185 for (int j = 0; j < list.Count; j++)
34186 {
34187 for (int k = 0; k < list[j].Length; k++)
34188 {
34189 if (!dictionary[j].Contains(k) && list[j][k].IsACoin)
34190 {
34191 list3.Add(new Point(j, k));
34192 }
34193 }
34194 }
34195 int num12 = 0;
34196 for (int num13 = list[num12].Length - 1; num13 >= 0; num13--)
34197 {
34198 if (!dictionary[num12].Contains(num13) && (list[num12][num13].type == 0 || list[num12][num13].stack == 0))
34199 {
34200 list2.Add(new Point(num12, num13));
34201 }
34202 }
34203 num12 = 1;
34204 for (int num14 = list[num12].Length - 1; num14 >= 0; num14--)
34205 {
34206 if (!dictionary[num12].Contains(num14) && (list[num12][num14].type == 0 || list[num12][num14].stack == 0))
34207 {
34208 list4.Add(new Point(num12, num14));
34209 }
34210 }
34211 num12 = 2;
34212 for (int num15 = list[num12].Length - 1; num15 >= 0; num15--)
34213 {
34214 if (!dictionary[num12].Contains(num15) && (list[num12][num15].type == 0 || list[num12][num15].stack == 0))
34215 {
34216 list5.Add(new Point(num12, num15));
34217 }
34218 }
34219 num12 = 3;
34220 for (int num10 = list[num12].Length - 1; num10 >= 0; num10--)
34221 {
34222 if (!dictionary[num12].Contains(num10) && (list[num12][num10].type == 0 || list[num12][num10].stack == 0))
34223 {
34224 list6.Add(new Point(num12, num10));
34225 }
34226 }
34227 num12 = 4;
34228 for (int num11 = list[num12].Length - 1; num11 >= 0; num11--)
34229 {
34230 if (!dictionary[num12].Contains(num11) && (list[num12][num11].type == 0 || list[num12][num11].stack == 0))
34231 {
34232 list7.Add(new Point(num12, num11));
34233 }
34234 }
34236 {
34237 return false;
34238 }
34239 return true;
34240 }
Item[] item
The items this chest contains. F:Terraria.Chest.maxItems elements long.
Definition Chest.cs:93
static bool PayCurrency(Player player, long price, int currencyIndex=-1)
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
static bool TryPurchasing(long price, List< Item[]> inv, List< Point > slotCoins, List< Point > slotsEmpty, List< Point > slotEmptyBank, List< Point > slotEmptyBank2, List< Point > slotEmptyBank3, List< Point > slotEmptyBank4)
Definition Player.cs:34242

References Terraria.Player.bank, Terraria.Player.bank2, Terraria.Player.bank3, Terraria.Player.bank4, Terraria.Player.inventory, Terraria.Chest.item, Terraria.GameContent.UI.CustomCurrencyManager.PayCurrency(), and Terraria.Player.TryPurchasing().

Referenced by Terraria.Player.BuyItem().

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