public void Heal(int healValue) { healValue = Mathf.Clamp(healValue, 0, maxHealth - currentHealth); currentHealth += healValue; postProcessingController.UpdatePostProcessing(); Debug.Log("HEALED TO " + currentHealth); }
public void Equip(Equipment newItem) { int slotIndex = (int)newItem.equipSlot; Equipment oldItem = null; if (currentEquipment[slotIndex] != null) { oldItem = currentEquipment[slotIndex]; inventory.Add(oldItem); } if (onEquipmentChanged != null) { onEquipmentChanged.Invoke(newItem, oldItem); playerStats.Heal(newItem.healingModifier); //healing the player on equipping } currentEquipment[slotIndex] = newItem; postProcessingController.UpdatePostProcessing(); }