The Greatest Game Dev To Have Ever Lived
This commit is contained in:
parent
fada3af715
commit
00e65ff31f
16 changed files with 398 additions and 37 deletions
32
Assets/Scripts/HealAbility.cs
Normal file
32
Assets/Scripts/HealAbility.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue