summaryrefslogtreecommitdiff
path: root/GameCode/LifeSteal.cs
blob: 6608cdb092dbec6fda91a91896045a6b05a86c38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using UnityEngine;

public class LifeSteal : DealtDamageEffect
{
	private HealthHandler health;

	public float multiplier;

	public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
	{
		if (!selfDamage)
		{
			if (!health)
			{
				health = GetComponentInParent<HealthHandler>();
			}
			health.Heal(damage.magnitude * multiplier);
		}
	}
}