diff options
Diffstat (limited to 'resources/js/classes')
-rw-r--r-- | resources/js/classes/StatusEffect.js | 2 | ||||
-rw-r--r-- | resources/js/classes/Technique.js | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/resources/js/classes/StatusEffect.js b/resources/js/classes/StatusEffect.js index ac6ae54..e1ae9c9 100644 --- a/resources/js/classes/StatusEffect.js +++ b/resources/js/classes/StatusEffect.js @@ -4,6 +4,8 @@ class StatusEffect { /** * @type {Monster} + * + * currently only used for lifeleech */ issuer = null; diff --git a/resources/js/classes/Technique.js b/resources/js/classes/Technique.js index a24e094..7558748 100644 --- a/resources/js/classes/Technique.js +++ b/resources/js/classes/Technique.js @@ -3,10 +3,14 @@ class Technique { #potency = 0; #power = 0; + turnLastUse = 0; + constructor (slug) { this.slug = slug; this.resetStats(); + + this.turnLastUse = -this.rechargeLength; } get name () { @@ -36,6 +40,22 @@ class Technique { return DB.techniques[this.slug].effects; } + get rechargeLength () { + return DB.techniques[this.slug].recharge; + } + + isUsable () { + if (this.turnLastUse >= Game.turn) { + return true; + } + + return Game.turn - this.turnLastUse >= this.rechargeLength; + } + + use () { + this.turnLastUse = Game.turn; + } + get accuracy () { return this.#accuracy; } |