summaryrefslogtreecommitdiff
path: root/resources/js/classes/Technique.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/classes/Technique.js')
-rw-r--r--resources/js/classes/Technique.js20
1 files changed, 20 insertions, 0 deletions
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;
}