-
Notifications
You must be signed in to change notification settings - Fork 0
/
StoreController.cs
44 lines (36 loc) · 1.48 KB
/
StoreController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[System.Serializable]
public class StoreController : MonoBehaviour {
public static int commonFireCost = 10;
public void buyFireSummonButton(Item.ItemName itemName) {
if (Currency.gold > commonFireCost) {
Currency.gold -= commonFireCost;
Debug.Log("Item name on battleSystem " + itemName);
Item item = Items.getItemByName(itemName);
item.amount = 1;
Players.playersList[Players.getSelectedPlayer()].inventory.addItem(item);
} else {
Debug.Log("Não tem gold para comprar");
}
}
public static List<Item> getSummonItemList() {
List<Item> itemList = new List<Item>();
itemList.Add(Items.getItemByName(Item.ItemName.commonFire));
itemList.Add(Items.getItemByName(Item.ItemName.uncommonFire));
itemList.Add(Items.getItemByName(Item.ItemName.rareFire));
itemList.Add(Items.getItemByName(Item.ItemName.epicFire));
itemList.Add(Items.getItemByName(Item.ItemName.legendaryFire));
return itemList;
}
public static List<Item> getSummonItemListFromInventory() {
List<Item> itemList = new List<Item>();
foreach (Item item in Players.playersList[Players.getSelectedPlayer()].inventory.itemList) {
if (item.itemType == Item.ItemType.gacha) {
itemList.Add(item);
}
}
return itemList;
}
}