2019-04-28 15:22:08 +00:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class EntityItemHeart : EntityItem
|
|
|
|
|
{
|
|
|
|
|
public int regen;
|
2019-04-28 16:00:11 +00:00
|
|
|
|
|
2019-04-28 15:22:08 +00:00
|
|
|
|
public override string Name {
|
|
|
|
|
get {
|
|
|
|
|
return "Heart";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnPickup(EntityPlayer player) {
|
2019-04-29 12:35:35 +00:00
|
|
|
|
messageBar.Write("Picked up: " + Name, Color.green);
|
2019-04-28 16:00:11 +00:00
|
|
|
|
player.hp += regen;
|
2019-04-28 15:22:08 +00:00
|
|
|
|
if (player.hp > player.hpMax) player.hp = player.hpMax;
|
|
|
|
|
Destroy(gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|