2019-04-28 17:22:08 +02:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class EntityItemHeart : EntityItem
|
|
|
|
|
{
|
2019-04-29 19:53:45 +02:00
|
|
|
|
public float regen;
|
2019-04-28 18:00:11 +02:00
|
|
|
|
|
2019-04-28 17:22:08 +02:00
|
|
|
|
public override string Name {
|
|
|
|
|
get {
|
|
|
|
|
return "Heart";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnPickup(EntityPlayer player) {
|
2019-04-29 19:53:45 +02:00
|
|
|
|
messageBar.Write("Healed " + regen.ToString("0.0") + " HP!", Color.green);
|
2019-04-28 18:00:11 +02:00
|
|
|
|
player.hp += regen;
|
2019-04-28 17:22:08 +02:00
|
|
|
|
if (player.hp > player.hpMax) player.hp = player.hpMax;
|
|
|
|
|
Destroy(gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|