new Skill(id, config, state)
Parameters:
Name | Type | Description |
---|---|---|
id |
string | |
config |
object | |
state |
GameState |
Properties:
Name | Type | Description |
---|---|---|
configureEffect |
function | modify the skill's effect before adding to player |
cooldownLength |
null | number | When a number > 0 apply a cooldown effect to disallow usage until the cooldown has ended |
effect |
string | Id of the passive effect for this skill |
flags |
Array.<SkillFlag> | |
info |
function | Function to run to display extra info about this skill |
run |
function | Function to run when skill is executed/activated |
state |
GameState | |
type |
SkillType |
Methods
-
cooldown(duration, character)
-
Put this skill on cooldown
Parameters:
Name Type Description duration
number Cooldown duration
character
Character -
execute(args, player, target)
-
perform an active skill
-
hasEnoughResource(character, resource) → {boolean}
-
Parameters:
Name Type Description character
Character resource
Object Returns:
boolean -
hasEnoughResources(character) → {boolean}
-
Parameters:
Name Type Description character
Character Returns:
boolean -
onCooldown(character) → {boolean|Effect}
-
Parameters:
Name Type Description character
Character -
payResourceCosts(player) → {boolean}
-
Parameters:
Name Type Description player
Player Returns:
boolean -If the player has paid the resource cost(s).