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. } } }