diff --git a/MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs b/MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs index 72ff08e6dbdb6c0c265016b602b22e2e3262ddcd..a652d433eb4271d05740f2d25a5a6df6a8f2a482 100644 --- a/MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs +++ b/MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs @@ -69,7 +69,9 @@ namespace BigSock { Handles cooldown and ability cost here. Returns true if the ability was successfully used. */ - public bool Use(Character actor, Vector3? target = null) { + public bool Use(IAbilityParam par) { + var actor = par.Actor; + // Check that the ability is cooled down. if(Ready) { //> Handle checking costs here. @@ -78,7 +80,7 @@ namespace BigSock { if(HPCost > 0f && actor.HP < HPCost) return false; // Activate the ability. - var res = Activate(actor, target); + var res = Activate(par); // If it succeeded, update cooldown and pay ability cost. if(res) { @@ -102,7 +104,7 @@ namespace BigSock { - Even if nothing was hit, used to indicate that cooldowns should be updated. This should be overridden in sub-classes for the actual abilities. */ - protected abstract bool Activate(Character actor, Vector3? target); + protected abstract bool Activate(IAbilityParam par); diff --git a/MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs b/MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs index 5751ef5bd397e15cb0eed17c2f0ff49be457ad7d..99cdd8be4802e1dc6c659749aa756838bba06c73 100644 --- a/MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs +++ b/MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs @@ -75,7 +75,7 @@ namespace BigSock { /* Try to use the ability. */ - bool Use(Character actor, Vector3? target); + bool Use(IAbilityParam par); /* Returns text that represents info about the ability.