Skip to content
Snippets Groups Projects
Commit 0c469099 authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Made abilities use IAbilityParam instead.

parent 239cec99
No related branches found
No related tags found
1 merge request!53ToolTips, new ability parameter system & misc clean ups.
...@@ -69,7 +69,9 @@ namespace BigSock { ...@@ -69,7 +69,9 @@ namespace BigSock {
Handles cooldown and ability cost here. Handles cooldown and ability cost here.
Returns true if the ability was successfully used. 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. // Check that the ability is cooled down.
if(Ready) { if(Ready) {
//> Handle checking costs here. //> Handle checking costs here.
...@@ -78,7 +80,7 @@ namespace BigSock { ...@@ -78,7 +80,7 @@ namespace BigSock {
if(HPCost > 0f && actor.HP < HPCost) return false; if(HPCost > 0f && actor.HP < HPCost) return false;
// Activate the ability. // Activate the ability.
var res = Activate(actor, target); var res = Activate(par);
// If it succeeded, update cooldown and pay ability cost. // If it succeeded, update cooldown and pay ability cost.
if(res) { if(res) {
...@@ -102,7 +104,7 @@ namespace BigSock { ...@@ -102,7 +104,7 @@ namespace BigSock {
- Even if nothing was hit, used to indicate that cooldowns should be updated. - Even if nothing was hit, used to indicate that cooldowns should be updated.
This should be overridden in sub-classes for the actual abilities. 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);
......
...@@ -75,7 +75,7 @@ namespace BigSock { ...@@ -75,7 +75,7 @@ namespace BigSock {
/* /*
Try to use the ability. Try to use the ability.
*/ */
bool Use(Character actor, Vector3? target); bool Use(IAbilityParam par);
/* /*
Returns text that represents info about the ability. Returns text that represents info about the ability.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment