1
Fork 0
slime-blood-and-pain/Assets/Scripts/EntityItemShop.cs

20 lines
564 B
C#
Raw Permalink Normal View History

2019-04-29 08:39:48 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EntityItemShop : EntityItem {
public float hpChange = -1f;
public float maxHpChange = -1f;
2019-04-29 13:27:26 +00:00
protected virtual void OnPurchase(EntityPlayer player) {
2019-04-29 08:39:48 +00:00
Debug.LogWarning("OnPurchase not overridden");
}
2019-04-29 12:35:35 +00:00
public override void OnPickup(EntityPlayer player) {
2019-04-29 08:39:48 +00:00
player.hp += hpChange;
2019-04-29 12:35:35 +00:00
player.hpMax += maxHpChange;
2019-04-29 13:27:26 +00:00
OnPurchase(player);
2019-04-29 08:39:48 +00:00
messageBar.Write("Bought: " + Name, Color.yellow);
Destroy(gameObject);
}
}