public void BuyItem(ItemEntryControllerScript itemScript)
 {
     if (gameData.player.Gold >= itemScript.item.Price && storeList.Contains(itemScript.item))
     {
         storeList.Remove(itemScript.item);
         gameData.player.Gold -= itemScript.item.Price;
         currentItemList.Remove(itemScript.item);
         gameData.player.itemList.Add(itemScript.item);
         RefreshItems();
     }
 }
 public void SellItem(ItemEntryControllerScript itemScript)
 {
     if (gameData.player.itemList.Contains(itemScript.item))
     {
         storeList.Add(itemScript.item);
         gameData.player.Gold += itemScript.item.Price;             //multiplier for store?
         gameData.player.itemList.Remove(itemScript.item);
         currentItemList.Remove(itemScript.item);
         RefreshItems();
     }
 }
Example #3
0
    public void EquipItem(ItemEntryControllerScript itemScript)
    {
        //trade items in player inventory
        var oldItem = gameData.player.EquipItem(itemScript.item);

        if (oldItem != null)
        {
            currentItemList.Add(oldItem);
        }

        currentItemList.Remove(itemScript.item);

        SetCurrentItemText();
        RefreshItems();
    }
Example #4
0
 public void DeleteItem(ItemEntryControllerScript itemScript)
 {
     gameData.player.itemList.Remove(itemScript.item);          //call helper on player inventory here
     currentItemList.Remove(itemScript.item);
     RefreshItems();
 }