BloodAndGore/Assets/Scripts/Enemies/Health.cs

24 lines
733 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2019-08-14 16:17:48 +02:00
using Saltosion.OneWeapon.Player;
using Saltosion.OneWeapon.Effects;
2019-08-14 16:17:48 +02:00
namespace Saltosion.OneWeapon.Enemies {
2019-08-07 20:03:51 +02:00
public class Health : MonoBehaviour {
public float MaxHealth;
public float CurrentHealth;
private PlayerFun PlayerFun;
private void Start() {
PlayerFun = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerFun>();
}
public void Damage(float amount, Vector2 fromDirection) {
2019-08-04 20:09:00 +02:00
BloodLauncher.Splatter(transform.position, -fromDirection, (int)(amount), 100f, 100);
2019-08-07 20:13:54 +02:00
CurrentHealth -= amount * (1 + PlayerFun.CurrentDamageBoost);
}
}
}