Example #1
0
 public void Heal()
 {
     if (PlayerInventory.gold >= 10)
     {
         PlayerInventory.AddGold(-10);
         Player.playerHealth.GainHealth(1);
     }
 }
Example #2
0
    public override void Interact(NeverdawnCharacterController controller)
    {
        if (pickable.isPickable)
        {
            pickable.RemoveFromCollection();
            PlayerInventory.AddGold(purse.gold);
        }


        pickable.frame.destroyed = true;
        Destroy(pickable.gameObject);
    }
Example #3
0
    public void Heal()
    {
        if (PlayerInventory.gold >= healCost && !PlayerHealth.IsMaxHealth())
        {
            PlayerInventory.AddGold(-healCost);
            Player.playerHealth.GainHealth(1);

            healCost += healCostIncrement;
            UpdateHealCost();
        }
        else
        {
            UIError();
        }
    }
Example #4
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            if (isKey)
            {
                PlayerInventory.AddKey(1);
            }
            else
            {
                PlayerInventory.AddGold(goldAmount);
            }

            Destroy(gameObject);
        }
    }
Example #5
0
    public void BuySelectedFromShop()
    {
        if (currShopSelected == -1 || currSelectedItem == null)
        {
            UIError();
            return;
        }

        if (PlayerInventory.gold < shopPrices[currShopSelected])
        {
            UIError();
            return;
        }

        if (currSelectedItem.itemType == Item.ItemType.weapon)
        {
            if (PlayerInventory.IsStorageFull())
            {
                UIError();
                return;
            }
            PlayerInventory.AddWeapon(currSelectedItem);
        }
        else
        {
            PlayerInventory.AddArtifact(currSelectedItem);
            //Debug.Log("Bought " + currSelectedItem.name + ", but didn't add.");
        }

        AudioManager.Play("ui_shop_buy");

        PlayerInventory.AddGold(-shopPrices[currShopSelected]);
        shopItems[currShopSelected] = null;
        DeselectAll();
        UpdateShopLootIcons();
    }
 /// <summary>
 /// Adds Dust to Inventory
 /// </summary>
 /// <param name="target">Inventory to Add to</param>
 /// <returns>True if adding was successful</returns>
 protected override bool OnCollect(PlayerInventory target)
 {
     target.AddGold(amount);
     return(true);
 }
Example #7
0
 void Start()
 {
     PlayerInventory.AddGold(100);
 }
Example #8
0
    public void AddGold(int amount)
    {
        ButtonClicked();

        PlayerInventory.AddGold(amount);
    }