more abilities and fixes
This commit is contained in:
parent
cb4470f2d6
commit
fc2329a873
31 changed files with 268 additions and 52 deletions
|
|
@ -1,39 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class Ability : MonoBehaviour
|
||||
{
|
||||
[Header("Identification")]
|
||||
public string abilityName;
|
||||
public Entity thisEntity;
|
||||
[Header("Cooldown")]
|
||||
protected float currentCooldown;
|
||||
public float cooldown;
|
||||
[Header("Stats")]
|
||||
public float power;
|
||||
public Vector3 targetLocation;
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
if (currentCooldown > 0f)
|
||||
{
|
||||
currentCooldown -= Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryAbility()
|
||||
{
|
||||
if (currentCooldown <= 0f)
|
||||
{
|
||||
AbilityEffects();
|
||||
currentCooldown = cooldown;
|
||||
Debug.Log($"Ability {abilityName} SUCCESS");
|
||||
return true;
|
||||
}
|
||||
Debug.Log($"Ability {abilityName} ON COOLDOWN");
|
||||
return false;
|
||||
}
|
||||
protected virtual void AbilityEffects()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue