public void Heal() { if (PlayerInventory.gold >= 10) { PlayerInventory.AddGold(-10); Player.playerHealth.GainHealth(1); } }
public override void Interact(NeverdawnCharacterController controller) { if (pickable.isPickable) { pickable.RemoveFromCollection(); PlayerInventory.AddGold(purse.gold); } pickable.frame.destroyed = true; Destroy(pickable.gameObject); }
public void Heal() { if (PlayerInventory.gold >= healCost && !PlayerHealth.IsMaxHealth()) { PlayerInventory.AddGold(-healCost); Player.playerHealth.GainHealth(1); healCost += healCostIncrement; UpdateHealCost(); } else { UIError(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { if (isKey) { PlayerInventory.AddKey(1); } else { PlayerInventory.AddGold(goldAmount); } Destroy(gameObject); } }
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); }
void Start() { PlayerInventory.AddGold(100); }
public void AddGold(int amount) { ButtonClicked(); PlayerInventory.AddGold(amount); }