LunarInfantry/Assets/Scripts/HealAbility.cs
2026-01-26 01:06:40 -08:00

32 lines
703 B
C#

using UnityEngine;
public class HealAbility : ClassAbility
{
private PlayerEntity thisPlayer;
[SerializeField] private float healingAmount;
[SerializeField] private int suppliesMax;
public int currentSupplies;
public override void TryAbility()
{
if (currentSupplies > 0)
{
currentSupplies--;
AbilityEffects();
}
}
protected override void AbilityEffects()
{
HealPlayer();
}
public void HealPlayer()
{
PlayerEntity closestPlayer = thisPlayer.GetAdjacentPlayers();
if (closestPlayer)
{
closestPlayer.Heal(healingAmount); //insane code, i know.
}
}
}